/** Penguin Diner, 2dplay and 2dplay.com are copyright and intellectual property of Bigwig Media Ltd, a UK registered company. **/ var Config={gameWidth:640,gameHeight:480,trackHighscore:!1,advertisePD2:!1,logoURL:"http://www.2dplay.com/#/",initialScreen:"HomeScreen",initialScreenArgs:[0]},Sprite=PIXI.Sprite;function preloadAssets(t,e){PIXI.Loader.shared.add("catalog_config_xml_class","assets/data/catalog_config_xml_class.xml"),PIXI.Loader.shared.add("config_xml_class","assets/data/config_xml_class.xml"),PIXI.Loader.shared.add("levels_config_xml_class","assets/data/levels_config_xml_class.xml"),PIXI.Loader.shared.add("comic_xml_class","assets/data/comic_xml_class.xml"),PIXI.Loader.shared.add("main_menu","assets/images/main_menu@2x.jpg"),PIXI.Loader.shared.add("background_map","assets/images/background_map@2x.png"),PIXI.Loader.shared.add("instructions_1","assets/images/instructions/instructions_1.jpg"),PIXI.Loader.shared.add("instructions_2","assets/images/instructions/instructions_2.jpg"),PIXI.Loader.shared.add("instructions_3","assets/images/instructions/instructions_3.jpg"),PIXI.Loader.shared.add("instructions_4","assets/images/instructions/instructions_4.jpg"),PIXI.Loader.shared.add("instructions_5","assets/images/instructions/instructions_5.jpg");for(var i=0;i<=15;i++)PIXI.Loader.shared.add("comic_page_"+i,"assets/images/commics/comic_page_"+i+".png");PIXI.Loader.shared.add("images0","assets/images/images0@2x.json"),PIXI.Loader.shared.add("images1","assets/images/images1@2x.json"),PIXI.Loader.shared.add("images2","assets/images/images2@2x.json"),PIXI.Loader.shared.add("images3","assets/images/images3@2x.json"),PIXI.Loader.shared.add("seal_textures","assets/images/seal0@2x.json"),PIXI.Loader.shared.add("cloths","assets/images/cloths@2x.json"),PIXI.Loader.shared.add("guest-animation_ske","assets/animations/guest-animation_ske.json"),PIXI.Loader.shared.add("guest-animation_tex","assets/animations/guest-animation_tex.json"),PIXI.Loader.shared.add("guest_animation_texture","assets/animations/guest-animation_tex.png"),PIXI.sound.add("bg_wind3_wav",{url:"assets/sounds/bg_wind3_wav.{webm,mp3}",preload:!0}),PIXI.sound.add("button_click_sfx",{url:"assets/sounds/button_click_sfx.{webm,mp3}",preload:!0}),PIXI.sound.add("button_rollover_sfx",{url:"assets/sounds/button_rollover_sfx.{webm,mp3}",preload:!0}),PIXI.sound.add("cancel_sfx",{url:"assets/sounds/cancel_sfx.{webm,mp3}",preload:!0}),PIXI.sound.add("click_game_object_sfx",{url:"assets/sounds/click_game_object_sfx.{webm,mp3}",preload:!0}),PIXI.sound.add("click_penguin_sfx",{url:"assets/sounds/click_penguin_sfx.{webm,mp3}",preload:!0}),PIXI.sound.add("close_sign_fall_sfx",{url:"assets/sounds/close_sign_fall_sfx.{webm,mp3}",preload:!0}),PIXI.sound.add("cooksfx_01_wav",{url:"assets/sounds/cooksfx_01_wav.{webm,mp3}",preload:!0}),PIXI.sound.add("cooksfx_02_wav",{url:"assets/sounds/cooksfx_02_wav.{webm,mp3}",preload:!0}),PIXI.sound.add("cooksfx_03_wav",{url:"assets/sounds/cooksfx_03_wav.{webm,mp3}",preload:!0}),PIXI.sound.add("crowd_clap_sfx",{url:"assets/sounds/crowd_clap_sfx.{webm,mp3}",preload:!0}),PIXI.sound.add("curtain_down_sfx",{url:"assets/sounds/curtain_down_sfx.{webm,mp3}",preload:!0}),PIXI.sound.add("curtain_up_sfx",{url:"assets/sounds/curtain_up_sfx.{webm,mp3}",preload:!0}),PIXI.sound.add("ent_jugglingseal2_sfx",{url:"assets/sounds/ent_jugglingseal2_sfx.{webm,mp3}",preload:!0}),PIXI.sound.add("ent_radio3_sfx",{url:"assets/sounds/ent_radio3_sfx.{webm,mp3}",preload:!0}),PIXI.sound.add("ent_tv3_sfx",{url:"assets/sounds/ent_tv3_sfx.{webm,mp3}",preload:!0}),PIXI.sound.add("food_give_sfx",{url:"assets/sounds/food_give_sfx.{webm,mp3}",preload:!0}),PIXI.sound.add("food_pickup_sfx",{url:"assets/sounds/food_pickup_sfx.{webm,mp3}",preload:!0}),PIXI.sound.add("food_ready_sfx",{url:"assets/sounds/food_ready_sfx.{webm,mp3}",preload:!0}),PIXI.sound.add("hello_f2_sfx",{url:"assets/sounds/hello_f2_sfx.{webm,mp3}",preload:!0}),PIXI.sound.add("hello_sfx",{url:"assets/sounds/hello_sfx.{webm,mp3}",preload:!0}),PIXI.sound.add("message_popup_sfx",{url:"assets/sounds/message_popup_sfx.{webm,mp3}",preload:!0}),PIXI.sound.add("money_pickup_sfx",{url:"assets/sounds/money_pickup_sfx.{webm,mp3}",preload:!0}),PIXI.sound.add("penguin_read_menu_sfx",{url:"assets/sounds/penguin_read_menu_sfx.{webm,mp3}",preload:!0}),PIXI.sound.add("peng_love2_wav",{url:"assets/sounds/peng_love2_wav.{webm,mp3}",preload:!0}),PIXI.sound.add("pop_sfx",{url:"assets/sounds/pop_sfx.{webm,mp3}",preload:!0}),PIXI.sound.add("trashcan_sfx",{url:"assets/sounds/trashcan_sfx.{webm,mp3}",preload:!0}),PIXI.sound.add("upgrade_buy_sfx",{url:"assets/sounds/upgrade_buy_sfx.{webm,mp3}",preload:!0}),PIXI.sound.add("walk_ice_02_sfx",{url:"assets/sounds/walk_ice_02_sfx.{webm,mp3}",preload:!0}),PIXI.sound.add("walk_ice_03_sfx",{url:"assets/sounds/walk_ice_03_sfx.{webm,mp3}",preload:!0}),PIXI.Loader.shared.load(function(t,e){}),PIXI.Loader.shared.onComplete.once(function(){t&&t()}),PIXI.Loader.shared.onLoad.add(function(t,i){e(t.progress/100)})}!function(t,e){function i(){this.initialize()}i.ANIMATION_BLACKOUT=1,i.prototype.initialize=function(){this.width=Config.gameWidth,this.height=Config.gameHeight,this.resizeCounter=0,this.forceUpdateInterval=null,this.paused=!1,this.rotationLayer=null,this.screens=[],this.initializePIXI(),createjs.Ticker.timingMode=createjs.Ticker.RAF,createjs.Ticker.framerate=60,createjs.Ticker.maxDelta=60,PIXI.Loader.shared.add("logo","assets/images/logo.png"),PIXI.Loader.shared.add("rotate_device_to_landscape","assets/images/rotate_device_to_landscape.png");var t=this;PIXI.Loader.shared.onComplete.once(function(){PIXI.Loader.shared.reset(),t.preloadAssets()}),PIXI.Loader.shared.load(),this.pausedScreen=null,Visibility.change(function(t,e){app.handleVisibility("visible"===e)})},i.prototype.preloadAssets=function(){var e=new LoadingScreen(this);this.addScreen(e),this.rotationLayer&&this.rotationLayer.bringToFront(),preloadAssets(function(){Managers.initialize(),setTimeout(function(){var e=applyToConstructor(t[Config.initialScreen],Config.initialScreenArgs);this.addScreen(e),this.rotationLayer&&this.rotationLayer.bringToFront()}.bind(this),100)}.bind(this),function(t){e.loadingBar.setPercent(t)})},i.prototype.addScreen=function(t,e,n){if(this.screens.push(t),e===i.ANIMATION_BLACKOUT){var a=this;createjs.Tween.get(this.screen).to({alpha:0},160).call(function(){a.screen&&(a.screen.removeFromParent(),a.screen.onHide())}).wait(80).call(function(){a.screen=t,a.stage.addChild(t),t.alpha=0,createjs.Tween.get(t).to({alpha:1},160).call(function(){t.onShow()}),n&&(a.screens=[a.screen])})}else this.screen&&(this.screen.removeFromParent(),this.screen.onHide()),this.screen=t,this.stage.addChild(t),t.onShow(),n&&(this.screens=[this.screen])},i.prototype.goBack=function(){if(this.screen){this.screens.pop();this.screen.removeFromParent(),this.screen.onHide(),this.screen=null}this.screen=this.screens[this.screens.length-1]||null,this.screen&&(this.screen.alpha=1,this.stage.addChild(this.screen),this.screen.onShow())},i.prototype.tick=function(){if(!this.paused){var t=this.pixi.ticker.elapsedMS;t=t>60?60:t,this.updateChildren(t)}},i.prototype.updateChildren=function(t,e){for(var i=(e=e||this.stage.children).length;i-- >0;){var n=e[i];n&&n.visible&&(n.onUpdate&&n.onUpdate(t),n&&this.updateChildren(t,n.children))}},i.prototype.initializePIXI=function(){PIXI.settings.FILTER_RESOLUTION=2,PIXI.settings.RESOLUTION=2;var e={resolution:2,width:this.width,height:this.height};this.pixi=new PIXI.Application(e),this.stage=this.pixi.stage,this.layoutCanvas(),this.pixi.ticker.add(this.tick,this),this.loader=PIXI.Loader.shared;var i=this;t.addEventListener("resize",function(t){setTimeout(function(){i.resize()},16)}),this.forceUpdateInterval=setInterval(this.forceInterval.bind(this),500)},i.prototype.resize=function(){this.calculateSizes();var t=this.windowWidth-this.canvasWidth,e=this.windowHeight-this.canvasHeight;this.pixi.view.style.width=this.canvasWidth+"px",this.pixi.view.style.height=this.canvasHeight+"px",this.pixi.view.style.marginLeft=Math.ceil(t/2)+"px",this.pixi.view.style.marginTop=Math.ceil(e/2)+"px",this.handleRotation()},i.prototype.layoutCanvas=function(){document.body.appendChild(this.pixi.view),this.resize()},i.prototype.calculateSizes=function(){var t=this.windowSize();this.windowWidth=t.width,this.windowHeight=t.height,this.canvasWidth=Math.ceil(t.width),this.canvasHeight=Math.ceil(t.height);var e=t.width/t.height,i=this.width/this.height;e>=this.width/this.height?(this.canvasWidth=Math.ceil(t.height*i),this.canvasHeight=Math.ceil(t.height)):(this.canvasWidth=Math.ceil(t.width),this.canvasHeight=Math.ceil(t.width/i))},i.prototype.windowSize=function(){var e=t,i="inner";return"innerWidth"in t||(i="client",e=document.documentElement||document.body),{width:e[i+"Width"],height:e[i+"Height"]}},i.prototype.pauseForAds=function(){createjs.Ticker.paused=!0,PIXI.sound.muteAll(),null===this.pausedScreen&&(this.pausedScreen=this.screen,this.pausedScreen.removeFromParent())},i.prototype.unpauseForAds=function(){createjs.Ticker.paused=!1,Managers.configManager.soundEnabled&&PIXI.sound.unmuteAll(),this.pausedScreen&&(this.screen=this.pausedScreen,this.stage.addChild(this.screen),this.pausedScreen=null)},i.prototype.handleVisibility=function(t){t?Managers.configManager.soundEnabled&&PIXI.sound.unmuteAll():PIXI.sound.muteAll()},i.prototype.handleRotation=function(){if(PIXI.isMobile.phone||PIXI.isMobile.tablet){if(this.windowHeight>this.windowWidth){if(!this.rotationLayer){createjs.Ticker.paused=!0,PIXI.sound.muteAll(),this.rotationLayer=new PIXI.Container,this.rotationLayer.interactive=!0,this.rotationLayer.pointerdown=this.rotationLayer.pointerup=function(t){return t.stopPropagation(),!1},this.stage.addChild(this.rotationLayer);var t=new PIXI.Sprite;t.texture=PIXI.Texture.WHITE,t.tint=0,t.width=this.width,t.height=this.height,this.rotationLayer.addChild(t);var e=null;(e=PIXI.utils.TextureCache.rotate_device_to_landscape?PIXI.Sprite.from("rotate_device_to_landscape"):PIXI.Sprite.from("assets/images/rotate_device_to_landscape.png")).centered(),e.position.set(this.width/2,this.height/2),this.rotationLayer.addChild(e),this.paused=!0}return void this.rotationLayer.bringToFront()}this.rotationLayer&&(this.rotationLayer.removeFromParent(),this.rotationLayer=null,createjs.Ticker.paused=!1,this.handleVisibility(!0),this.paused=!1)}},i.prototype.forceInterval=function(){this.resizeCounter++,this.resizeCounter>=10?clearInterval(this.forceUpdateInterval):this.resize()},t.App=i}(window),function(t,e){function i(){this.initialize()}i.prototype.initialize=function(){this._triggerID=0},i.prototype.toString=function(){return""},t.AbstractEvent=i}(window),function(t,e){function i(){this.initialize()}i.idCount=0,i.prototype.initialize=function(){this._active=!1,this._parent=null,this._owned=!1,this.transitionsList=[],this.updatableTriggers=[],this._id=i.idCount++,this.name="State_"+this._id},i.prototype.addTransition=function(t,e,i,n){e=void 0===e?null:e,i=void 0===i?null:i,n=void 0===n?null:n;e=e||new EmptyTrigger;for(var a=new Transition(this,t,e,i,n),r=0;rt.preventDefault()),function(t,e){function i(t,e,i,n,a){this.initialize(t,e,i,n,a)}i.prototype.initialize=function(t,e,i,n,a){this._type=t,this._priority=e,this._cancelQueue=i,this._removeDuplicates=n,this._data=a},i.prototype.cloneWithData=function(t){return new i(this._type,this._priority,this._cancelQueue,this._removeDuplicates,t)},i.prototype.toString=function(){return"[Message type="+this._type+" priority="+this._priority+" data="+this._data+"]"},Object.defineProperty(i.prototype,"type",{get:function(){return this._type}}),Object.defineProperty(i.prototype,"priority",{get:function(){return this._priority}}),Object.defineProperty(i.prototype,"cancelQueue",{get:function(){return this._cancelQueue}}),Object.defineProperty(i.prototype,"removeDuplicates",{get:function(){return this._removeDuplicates}}),Object.defineProperty(i.prototype,"data",{get:function(){return this._data}}),t.Message=i}(window),function(t,e){function i(){this.initialize()}i.prototype.initialize=function(){this.locked=!1,this.pendingMessages=[],this.pendingMessagesWhileLocked=[],this.messagePrototypes={}},i.prototype.registerMessage=function(t,e,i,n){if(i=i||!1,n=n||!1,void 0!=this.messagePrototypes[t])throw'Message of type "'+t+'" is registered already.';this.messagePrototypes[t]=new Message(t,e,n,i,null)},i.prototype.append=function(t,e){e=void 0===e?null:e;var i=this.messagePrototypes[t];if(null==i)throw'Message with type "'+t+'" is not registered.';var n=i.cloneWithData(e);this.locked?this.pendingMessagesWhileLocked.push(n):this._append(n)},i.prototype._append=function(t){var e=null,i=0;if(t.removeDuplicates)for(var n=0;n-1?a++:a=-a-1,this.pendingMessages.splice(a,0,t)},i.prototype.indexOfLastEqualPriority=function(t){for(var e=0,i=0,n=0,a=this.pendingMessages.length-1,r=!1;n<=a;)if(e=(a+n)/2,t<(i=this.pendingMessages[e].priority)){if(e==n)return r?e-1:-1-e;a=e-1}else if(t>i){if(e==a)return-1-(e+1);n=e+1}else{if(e==a)return e;r=!0,n=e+1}return-1},i.prototype.clear=function(){this.pendingMessages=[],this.pendingMessagesWhileLocked=[]},i.prototype.hasNext=function(){return this.pendingMessages.length>0},i.prototype.getNext=function(){var t=this.pendingMessages.pop();return t.cancelQueue&&(this.pendingMessages=[]),t},i.prototype.lock=function(){if(this.locked)throw"Message queue is already locked";this.locked=!0},i.prototype.unlock=function(){if(!this.locked)throw"Message queue is already unlocked";for(;this.pendingMessagesWhileLocked.length>0;)this._append(this.pendingMessagesWhileLocked.pop());this.locked=!1},i.prototype.dispose=function(){this.pendingMessages=[],this.pendingMessagesWhileLocked=[],this.messagePrototypes={}},t.MessageQueue=i}(window),function(t,e){function i(){this.initialize()}i.prototype=new AbstractState,i.prototype.parentInitialize4=i.prototype.initialize,i.prototype.initialize=function(){this.parentInitialize4()},i.prototype.addTransition=function(t,e,i,n){if(e=void 0===e?null:e,i=void 0===i?null:i,n=void 0===n?null:n,e&&!(e instanceof EmptyTrigger))throw"Transition from ChoiceState may not have a trigger.";AbstractState.prototype.addTransition.call(this,t,e,i,n)},t.ChoiceState=i}(window),function(t,e){function i(t,e,i){this.initialize(t,e,i)}i.prototype=new SimpleState,i.prototype.parentInitialize2=i.prototype.initialize,i.prototype.initialize=function(t,e,i){t=void 0===t?null:t,e=void 0===e?null:e,i=void 0===i?null:i,this.substatesList,this._initialState,this._lastActiveState,this.hasHistoryState=!1,this.substatesList=[],this.parentInitialize2(t,e,i)},i.prototype.addState=function(t){if(t.owned)throw"State can't be added twice.";if(t instanceof InitialState){if(this._initialState)throw"CompositeState can have at most one InitialState.";this._initialState=t}else if(t instanceof HistoryState){if(this.hasHistoryState)throw new"CompositeState can have at most one HistoryState.";this.hasHistoryState=!0}return Notes.add(this,Notes.StateEvent_DEACTIVATE),this.substatesList.push(t),t.setParent(this),t.setOwned(!0),t},i.prototype.onAddedTriggerHandler=function(t,e,i){},i.prototype.onStateDeactivateHandler=function(t){this.hasHistoryState&&(this._lastActiveState=t)},Object.defineProperty(i.prototype,"history",{get:function(){return this._lastActiveState||this._initialState}}),Object.defineProperty(i.prototype,"initial",{get:function(){return this._initialState}}),i.prototype.dispose=function(){for(var t=null,e=0;e0;){for(t=this.eventsQueue.shift(),i=this.activeStates.length,n=0;n"+e.id,a=this.routesHash[n];if(a)return a;switch(a=[],t.getTransitionLevel(e)){case TransitionLevel.TO_SELF:case TransitionLevel.TO_SIBLING:a.push(e);break;case TransitionLevel.TO_ANCESTOR:for(i=t.parent;a.push(i),i!=e;)i=i.parent;break;case TransitionLevel.TO_IRRELATIVE:for(i=e;a.push(i),i.parent&&i.parent!=t.parent;)i=i.parent;a.reverse();break;case TransitionLevel.TO_DESCENDANT:(a=(a=getStack(e).slice()).splice(0,a.indexOf(t))).reverse()}return this.routesHash[n]=a,a},i.prototype.getExitRoute=function(t,e){var i=null,n=t.id+"<-"+e.id,a=this.routesHash[n];if(a)return a;switch(a=[],t.getTransitionLevel(e)){case TransitionLevel.TO_SELF:case TransitionLevel.TO_SIBLING:a.push(t);break;case TransitionLevel.TO_ANCESTOR:for(i=t;i!=e;)a.push(i),i=i.parent;break;case TransitionLevel.TO_DESCENDANT:break;case TransitionLevel.TO_IRRELATIVE:for(i=t;a.push(i),i.parent&&i.parent!=e.parent;)i=i.parent}return this.routesHash[n]=a,a},i.prototype.start=function(){if(!this.started){if(!this.currentState)throw"InitialState doesn't exist or is not immediate state of state machine.";this.started=!0,this.sendEvent(new EmptyEvent)}},i.prototype.sendSignal=function(t,e){e=void 0===e?null:e,this.sendEvent(new SignalEvent(t,e))},i.prototype.sendEvent=function(t){if(!this.started)throw"State machine is not started.";this.completed||(this.eventsQueue.push(t),this.doTransition())},i.prototype.onNote=function(t,e,i){t===Notes.TriggerEvent_TRIGGER?this.onTriggerHandler(t,e,i):t===Notes.StateEvent_ADDED_TRIGGER&&this.onAddedTriggerHandler(t,e,i)},t.HSM=i}(window),function(t,e){function i(){this.initialize()}i.prototype=new SimpleState,i.prototype.parentInitialize3=i.prototype.initialize,i.prototype.initialize=function(){this.parentInitialize3()},i.prototype.addTransition=function(t,e,i,n){if(e=void 0===e?null:e,i=void 0===i?null:i,n=void 0===n?null:n,1==this.transitionsList.length)throw"InitialState can have at most one outgoing transition.";if(e&&!(e instanceof EmptyTrigger))throw"Transition from InitialState may not have a trigger.";SimpleState.prototype.addTransition.call(this,t,e,i,n)},t.InitialState=i}(window),function(t,e){function i(t,e){this.initialize(t,e)}i.prototype=new AbstractEvent,i.prototype.parentInitialize2=i.prototype.initialize,i.prototype.initialize=function(t,e){this.parentInitialize2(),this.type=t,this.data=e||null},t.SignalEvent=i}(window),function(t,e){function i(t){this.initialize(t)}i.prototype=new AbstractTrigger,i.prototype.parentInitialize2=i.prototype.initialize,i.prototype.initialize=function(t){this.parentInitialize2(),this._type=t},i.prototype.willFire=function(t){return t&&t.type==this._type},i.prototype.equals=function(t){return t&&t._type==this._type},t.SignalTrigger=i}(window),function(t,e){function i(t,e,i,n,a){this.initialize(t,e,i,n,a)}i.prototype.initialize=function(t,e,i,n,a){this._source=t,this._target=e,this._trigger=i,this._effect=n,this._guard=a},i.prototype.willFire=function(t){return!!this._trigger.willFire(t)&&(null==this.guard||this._guard())},i.prototype.invokeEffect=function(t){null!=this._effect&&this._effect(t)},i.prototype.conflicts=function(t){return this._source==t.source&&this._trigger.equals(t.trigger)&&this._guard==t.guard},i.prototype.dispose=function(){this._source=null,this._target=null,this._trigger.dispose(),this._trigger=null,this._effect=null,this._guard=null},i.prototype.toString=function(){return""},Object.defineProperty(i.prototype,"source",{get:function(){return this._source}}),Object.defineProperty(i.prototype,"target",{get:function(){return this._target}}),Object.defineProperty(i.prototype,"trigger",{get:function(){return this._trigger}}),Object.defineProperty(i.prototype,"guard",{get:function(){return this._guard}}),t.Transition=i}(window),function(t,e){function i(){}i.TO_SELF="toSelf",i.TO_SIBLING="toSibling",i.TO_ANCESTOR="toAncestor",i.TO_DESCENDANT="toDescendant",i.TO_IRRELATIVE="toIrrelative",t.TransitionLevel=i}(window),function(t,e){function i(t){this.initialize(t)}i.prototype=new AbstractTrigger,i.prototype.parentInitialize3=i.prototype.initialize,i.prototype.initialize=function(t){this.parentInitialize3(),this._count=t,this._updateCount=null},i.prototype.willFire=function(t){return t._triggerID==this._id},i.prototype.equals=function(t){return t&&t._count==this._count},i.prototype.activate=function(){this._updateCount=this._count},i.prototype.update=function(t){var e=null;this._updateCount-=t/30,this._updateCount<=1&&((e={count:this._count})._triggerID=this._id,Notes.send(Notes.TriggerEvent_TRIGGER,e,this))},t.UpdateTrigger=i}(window),function(t,e){function i(){this.initialize()}i.SFX="SFX",i.ENVIRONMENT_SFX="ENVIRONMENT_SFX",i.CHEF_SFX="CHEF_SFX",i.prototype.initialize=function(){},t.ChannelID=i}(window),function(t,e){function i(t){this.initialize(t)}i.prototype.initialize=function(t){this._goal=t.goal,this._guestAppearDelay=t.guestAppearDelay,this._guestReadingMenuTime=t.guestReadingMenuTime,this._guestChangeMoodTime=t.guestChangeMoodTime,this._guestEatingTime=t.guestEatingTime,this._maxGuestGroups=t.maxGuestGroups,this._guestDoubleAppearChance=t.guestDoubleAppearChance,this._guestCoupleAppearChance=t.guestCoupleAppearChance,this._guestAppearMood=t.guestAppearMood,this._guestAppearWorseMoodChance=t.guestAppearWorseMoodChance},Object.defineProperty(i.prototype,"goal",{get:function(){return this._goal}}),Object.defineProperty(i.prototype,"guestAppearDelay",{get:function(){return this._guestAppearDelay}}),Object.defineProperty(i.prototype,"guestReadingMenuTime",{get:function(){return this._guestReadingMenuTime}}),Object.defineProperty(i.prototype,"guestChangeMoodTime",{get:function(){return this._guestChangeMoodTime}}),Object.defineProperty(i.prototype,"guestEatingTime",{get:function(){return this._guestEatingTime}}),Object.defineProperty(i.prototype,"maxGuestGroups",{get:function(){return this._maxGuestGroups}}),Object.defineProperty(i.prototype,"guestDoubleAppearChance",{get:function(){return this._guestDoubleAppearChance}}),Object.defineProperty(i.prototype,"guestCoupleAppearChance",{get:function(){return this._guestCoupleAppearChance}}),Object.defineProperty(i.prototype,"guestAppearMood",{get:function(){return this._guestAppearMood}}),Object.defineProperty(i.prototype,"guestAppearWorseMoodChance",{get:function(){return this._guestAppearWorseMoodChance}}),t.DayInfo=i}(window),function(t,e){function i(){this.initialize()}i.UP="up",i.DOWN="down",i.LEFT="left",i.RIGHT="right",i.prototype.initialize=function(){},i.getDirection=function(t,e){return(t<0?Number(-t):Number(t))>(e<0?Number(-e):Number(e))?t>0?i.RIGHT:i.LEFT:e>0?i.DOWN:i.UP},t.Direction=i}(window),function(t,e){function i(){this.initialize()}i.STANDARD="standard",i.HATS="hats",i.BEACH="beach",i.BALL="ball",i.PIRATES="pirates",i.ECO="eco",i.prototype.initialize=function(){},t.RoomThemes=i}(window),function(t,e){function i(){this.initialize()}i.SOUND_ENABLED="SOUND_ENABLED",i.GAME_PROGRESS="GAME_PROGRESS",i.SHOWN_HINTS_IN_ORDER="SHOWN_HINTS_IN_ORDER",i.COMIC_POPUP_HASH="COMIC_POPUP_HASH",i.prototype.initialize=function(){},t.SOValues=i}(window),function(t,e){function i(){this.initialize()}i.BUTTON_ROLLOVER_SFX="button_rollover_sfx",i.BUTTON_CLICK_SFX="button_click_sfx",i.CLICK_GAME_OBJECT_SFX="click_game_object_sfx",i.CLICK_PENGUIN_SFX="click_penguin_sfx",i.CLOSE_SIGN_FALL_SFX="close_sign_fall_sfx",i.CROWD_CLAP_SFX="crowd_clap_sfx",i.CURTAIN_DOWN_SFX="curtain_down_sfx",i.CURTAIN_UP_SFX="curtain_up_sfx",i.FOOD_GIVE_SFX="food_give_sfx",i.FOOD_PICKUP_SFX="food_pickup_sfx",i.FOOD_READY_SFX="food_ready_sfx",i.HELLO_SFX="hello_sfx",i.MESSAGE_POPUP_SFX="message_popup_sfx",i.MONEY_PICKUP_SFX="money_pickup_sfx",i.PENGUIN_READ_MENU_SFX="penguin_read_menu_sfx",i.TRASHCAN_SFX="trashcan_sfx",i.UPGRADE_BUY_SFX="upgrade_buy_sfx",i.WALK_ICE_02_SFX="walk_ice_02_sfx",i.WALK_ICE_03_SFX="walk_ice_03_sfx",i.HELLO_F2_SFX="hello_f2_sfx",i.POP_SFX="pop_sfx",i.CANCEL_SFX="cancel_sfx",i.COOKSFX_01_WAV="cooksfx_01_wav",i.COOKSFX_02_WAV="cooksfx_02_wav",i.COOKSFX_03_WAV="cooksfx_03_wav",i.PENG_LOVE2_WAV="peng_love2_wav",i.ENT_JUGGLINGSEAL2_SFX="ent_jugglingseal2_sfx",i.ENT_RADIO3_SFX="ent_radio3_sfx",i.ENT_TV3_SFX="ent_tv3_sfx",i.BG_WIND3_WAV="bg_wind3_wav",i.prototype.initialize=function(){},t.SoundID=i}(window),function(t,e){function i(){this.initialize()}i.BAKER_STREET="bakerStreet",i.BLACK_TIE="blackTie",i.CARRIBEAN="carribean",i.ECO="eco",i.HATS="hats",i.PARIS="paris",i.STANDARD="standard",i.SUSHI_QUEEN="sushiQueen",i.prototype.initialize=function(){},t.Uniforms=i}(window),function(t,e){function i(){this.initialize()}i.prototype=Object.create(PIXI.Container.prototype),i.prototype.constructor=i,i.prototype.initialize=function(){PIXI.Container.call(this),this.sky=PIXI.Sprite.from("gb_day"),this.sky.x=100,this.sky.y=-10,this.addChild(this.sky),this.stars=PIXI.Sprite.from("bg_starz"),this.stars.x=100,this.addChild(this.stars),this.sun=PIXI.Sprite.from("sun"),this.sun.x=150,this.sun.centered(),this.addChild(this.sun),this.hills=PIXI.Sprite.from("hills_1"),this.hills.x=70,this.hills.y=10,this.addChild(this.hills),this.duration=6e3,this.timer=this.duration,this.sunX1=100,this.sunX2=600,this.sunY=40,this.sunElevation=50,this.sunRadius=1400,this.sunCenter=new PIXI.Point(app.width/2+60,this.sunRadius),this.redToWhite=new n(this.sky,16558956,16777215),this.whiteToBlue=new n(this.sky,16777215,8285104),this.m1T=new n(this.hills,14662330,16777215),this.m2T=new n(this.hills,16777215,16049637),this.m3T=new n(this.hills,16049637,9144970)},i.prototype.onUpdate=function(t){},i.prototype.setPercent=function(t){var e=Math.degreesToRadians(-100.6),i=e+(Math.degreesToRadians(-76)-e)*t,n=new PIXI.Point(this.sunRadius-10,0);n.setAngle(i),this.sun.x=n.x+this.sunCenter.x,this.sun.y=n.y+this.sunCenter.y,this.stars.alpha=t>.8?(t-.8)/.2:0,t<=.2?this.redToWhite.setPercent(t/.2):t>=.8?this.whiteToBlue.setPercent(1-(1-t)/.2):this.sky.tint=16777215,t<.3?this.m1T.setPercent(t/.3):t<=.8?this.m2T.setPercent(1-(.8-t)/.5):t>=.8&&this.m3T.setPercent(1-(1-t)/.2)},i.prototype.setTheme=function(t){var e=this;if("theme_pirates"===t){function i(t,i,n){for(var a=[],r=1;r<=16;r++)a.push(PIXI.utils.TextureCache["pirate_flag_"+r]);var s=new PIXI.AnimatedSprite(a);s.position.set(t,i),s.loop=!0,s.animationSpeed=.5,s.scale.set(n||.8),s.gotoAndPlay(Math.randomInt(0,15)),e.addChild(s)}i(130,8),i(350,30,.7),i(535,5,.7)}else if("theme_eco"===t){function n(t,i,n){var a=PIXI.Sprite.from("windmill_base");a.anchor.set(.5,0),a.position.set(t,i),e.addChild(a);var r=PIXI.Sprite.from("windmill_roto");r.anchor.set(.5,.5),r.position.set(t,i+2),e.addChild(r),r.timer=Math.randomInt(0,3e3),r.onUpdate=function(t){this.timer+=t,this.rotation=Math.degreesToRadians(.2*this.timer)}.bind(r),a.scale.set(n||.8),r.scale.set(n||.8)}n(160,30,.6),n(350,40,.5),n(570,35,.6)}};var n=function(t,e,i){this.start_tint=new Color(e),this.end_tint=new Color(i),this.object=t};n.prototype.setPercent=function(t){if(1===(t=Math.clamp(t,0,1)))this.object.tint=this.end_tint.hex_code;else{var e=(this.end_tint.red-this.start_tint.red)*t+this.start_tint.red,i=(this.end_tint.green-this.start_tint.green)*t+this.start_tint.green,n=(this.end_tint.blue-this.start_tint.blue)*t+this.start_tint.blue;this.object.tint=Color.get_color_32(1,e,i,n)}},t.Atmosphere1=i}(window),function(t,e){function i(t,e){this.initialize(t,e)}i.prototype=Object.create(PIXI.Container.prototype),i.prototype.constructor=i,i.prototype.initialize=function(t,e){PIXI.Container.call(this);var i=PIXI.Sprite.from(t);this.addChild(i),this.pageNum=e,this.interactive=!0,this.buttonMode=!0},t.BookmarkButton=i}(window),function(t,e){function i(){this.initialize()}i.prototype=Object.create(PIXI.Container.prototype),i.prototype.constructor=i,i.foodPosition={coffee:{x:2,y:0},icecream:{x:0,y:-1,scale:.8},cola:{x:2,y:-2,scale:.7},cake:{x:0,y:-1},lemonade:{x:0,y:-2,scale:.7},sundae:{x:0,y:-2,scale:.75},hot_dog:{x:0,y:0},soup:{x:0,y:0},egg_rolls:{x:0,y:0},burger:{x:0,y:-1},spaghetti:{x:0,y:-1},fish:{x:2,y:-1},mussels:{x:0,y:0},prawns:{x:0,y:0},seaweed_salad:{x:0,y:0},sushi:{x:0,y:0},krill_salad:{x:0,y:0},crab:{x:0,y:0},big_fish:{x:0,y:-1},lobster:{x:0,y:0}},i.prototype.initialize=function(){PIXI.Container.call(this),this.bubble=PIXI.Sprite.from("order_bubble"),this.bubble.centered(),this.addChild(this.bubble),this.foodClip=PIXI.Sprite.from("food_seaweed_salad"),this.foodClip.centered(),this.addChild(this.foodClip)},i.prototype.setFood=function(t){this.foodClip.texture=PIXI.utils.TextureCache["food_"+t];var e=i.foodPosition[t];e&&e.scale?this.foodClip.scale.set(e.scale):this.foodClip.scale.set(1),this.foodClip.position=e},t.BubbleClip=i}(window),function(t,e){function i(){this.initialize()}i.prototype=Object.create(PIXI.Container.prototype),i.prototype.constructor=i,i.prototype.initialize=function(){PIXI.Container.call(this),this.playing=!1,this._upgradeLevel=Managers.progressManager.chefUpgrade,this._upgradeLevel&&(this.footLeft=PIXI.Sprite.from("chef_foot"),this.footLeft.anchor.set(.5,.5),this.footLeft.position.set(-9,25),this.addChild(this.footLeft),this.footRight=PIXI.Sprite.from("chef_foot"),this.footRight.anchor.set(.5,.5),this.footRight.position.set(9,25),this.addChild(this.footRight),this.footLeft.scale=this.footRight.scale={x:1.5,y:.75},this.chops=new PIXI.Container,this.addChild(this.chops),this.leftFinHolder=new PIXI.Container,this.addChild(this.leftFinHolder),this.rightFinHolder=new PIXI.Container,this.addChild(this.rightFinHolder),this.headHolder=new PIXI.Container,this.addChild(this.headHolder),this._head=PIXI.Sprite.from("chef_head_"+this._upgradeLevel),this._head.anchor.set(.5,1),this.headHolder.addChild(this._head),this._hat=PIXI.Sprite.from("chef_hat_"+this._upgradeLevel),this._hat.anchor.set(.5,1),this._hat.position.set(0,-18),this.headHolder.addChild(this._hat),this.face=PIXI.Sprite.from("chef_face_"+this._upgradeLevel),this.face.anchor.set(0,0),this.headHolder.addChild(this.face),this._leftTool=new PIXI.Sprite,this.leftFinHolder.addChild(this._leftTool),this._rightTool=new PIXI.Sprite,this.rightFinHolder.addChild(this._rightTool),this._leftFin=PIXI.Sprite.from("chef_fing_"+this._upgradeLevel),this._leftFin.anchor.set(.8,.2),this.leftFinHolder.addChild(this._leftFin),this._rightFin=PIXI.Sprite.from("chef_fing_"+this._upgradeLevel),this._rightFin.anchor.set(.8,.2),this._rightFin.scale.x=-1,this.rightFinHolder.addChild(this._rightFin),this.leftFinHolder.position.set(-13,-14),this.rightFinHolder.position.set(13,-14),this.headHolder.position.set(0,-18),this.body=PIXI.Sprite.from("chef_body_"+this._upgradeLevel),this.body.anchor.set(.5,.5),this.addChild(this.body),this.face.visible=!1,1===Managers.progressManager.chefUpgrade?(this._hat.position.set(0,-18),this._head.y=0,this.face.anchor.x=.5,this.face.position.set(16.5,-20)):2===Managers.progressManager.chefUpgrade?(this._hat.position.set(1,-24),this._head.y=5,this.face.anchor.x=.2,this.face.position.set(11,-23)):3===Managers.progressManager.chefUpgrade&&(this._hat.position.set(0,-24),this._head.y=5,this.face.anchor.x=.2,this.face.position.set(11,-26)))},i.prototype.animate=function(){this._upgradeLevel&&(this.leftFinHolder.rotation=Math.degreesToRadians(10),this.rightFinHolder.rotation=Math.degreesToRadians(-10),this.twitchBody())},i.prototype.twitchBody=function(){this.playing&&(createjs.Tween.get(this.headHolder).to({y:-13},150).wait(210).call(this.showTools.bind(this)),createjs.Tween.get(this.leftFinHolder).to({rotation:Math.degreesToRadians(60)},150).to({rotation:Math.degreesToRadians(-5)},120).wait(120),createjs.Tween.get(this.rightFinHolder).to({rotation:Math.degreesToRadians(-60)},150).to({rotation:Math.degreesToRadians(5)},120))},i.prototype.showTools=function(){if(this.playing){createjs.Tween.get(this.headHolder).to({y:-18},210),this._leftTool.texture=PIXI.utils.TextureCache.chef_fork,this._leftTool.anchor.set(.5,.9),this._leftTool.position.set(5,0),this._leftTool.rotation=Math.degreesToRadians(-100),this._leftTool.visible=!0,createjs.Tween.get(this._leftTool).to({x:-2,y:14,rotation:Math.degreesToRadians(-65)},120).wait(420).to({x:20,y:30,rotation:Math.degreesToRadians(-30)},180),createjs.Tween.get(this.leftFinHolder).to({rotation:Math.degreesToRadians(50)},210).wait(210).to({rotation:Math.degreesToRadians(-5)},210),createjs.Tween.get(this.body).to({rotation:Math.degreesToRadians(5)},180).to({rotation:Math.degreesToRadians(0)},180),createjs.Tween.get(this.rightFinHolder).wait(240).to({rotation:Math.degreesToRadians(-60)},150).wait(150).to({rotation:Math.degreesToRadians(5)},150),this._rightTool.texture=PIXI.utils.TextureCache.chef_pan,this._rightTool.anchor.set(.2,.8),this._rightTool.position.set(-20,5),this._rightTool.rotation=Math.degreesToRadians(120),this._rightTool.visible=!0,createjs.Tween.get(this._rightTool).wait(240).to({x:5,y:14,rotation:Math.degreesToRadians(50)},150).wait(150).to({x:-25,y:14,rotation:Math.degreesToRadians(50)},150).wait(150).call(this.addSalt.bind(this)),this.face.visible=!0,this.face.scale.x=0,this.face.x=Math.abs(this.face.x);var t=this;createjs.Tween.get(this.face.scale).wait(180).to({x:1},120).wait(360).to({x:0},120).call(function(){t.face.visible=!1}),createjs.Tween.get(this._hat).wait(180).to({rotation:Math.degreesToRadians(-20)},120).wait(360).to({rotation:Math.degreesToRadians(0)},120)}},i.prototype.addSalt=function(){if(this.playing){this._leftTool.texture=PIXI.utils.TextureCache.chef_salt,this._leftTool.anchor.set(.5,.5),this._leftTool.position.set(-9,13),this._leftTool.scale.set(.8),this._leftTool.rotation=Math.degreesToRadians(-110);var t=this;createjs.Tween.get(this.leftFinHolder).to({rotation:Math.degreesToRadians(110)},120).to({rotation:Math.degreesToRadians(115)},120).to({rotation:Math.degreesToRadians(110)},120).to({rotation:Math.degreesToRadians(115)},120).to({rotation:Math.degreesToRadians(0)},150).call(function(){t._leftTool.visible=!1,t._leftTool.scale.set(1),t.startCutting()})}},i.prototype.startCutting=function(){this.playing&&(createjs.Tween.get(this.rightFinHolder).to({rotation:Math.degreesToRadians(-60)},150).to({rotation:Math.degreesToRadians(5)},120).to({rotation:Math.degreesToRadians(-30)},150).to({rotation:Math.degreesToRadians(5)},150).to({rotation:Math.degreesToRadians(-30)},150).to({rotation:Math.degreesToRadians(0)},150).call(this.throwChops.bind(this)),this._rightTool.texture=PIXI.utils.TextureCache.chef_knife,this._rightTool.anchor.set(.2,.8),this._rightTool.position.set(-20,5),this._rightTool.rotation=Math.degreesToRadians(120),createjs.Tween.get(this._rightTool).to({x:5,y:14,rotation:Math.degreesToRadians(50)},150).to({rotation:Math.degreesToRadians(-120)},120),createjs.Tween.get(this._rightTool.scale).wait(270).to({x:.8},60))},i.prototype.throwChops=function(){if(this.playing){this._rightTool.visible=!1,createjs.Tween.get(this.leftFinHolder).to({rotation:Math.degreesToRadians(-10)},60),this.chops.removeChildren(),this.chops.alpha=0,createjs.Tween.get(this.chops).wait(60).to({alpha:1},30);var t=PIXI.Sprite.from("chef_chop_1");t.centered(),this.chops.addChild(t),createjs.Tween.get(t).wait(60).to({y:-30},240,createjs.Ease.cubicOut).call(function(){t.texture=PIXI.utils.TextureCache.chef_chop_2}).wait(16).call(function(){t.texture=PIXI.utils.TextureCache.chef_chop_3}).to({y:0,alpha:0},240,createjs.Ease.cubicIn).call(this.throwCuts.bind(this))}},i.prototype.throwCuts=function(){if(this.playing){createjs.Tween.get(this.body).to({rotation:Math.degreesToRadians(5)},180).to({rotation:Math.degreesToRadians(0)},180),this.face.visible=!0,this.face.scale.x=0,this.face.x=-Math.abs(this.face.x);var t=this;createjs.Tween.get(this.face.scale).wait(180).to({x:-1},120).wait(360).to({x:0},120).call(function(){t.face.visible=!1}),createjs.Tween.get(this._hat).wait(180).to({rotation:Math.degreesToRadians(20)},120).wait(360).to({rotation:Math.degreesToRadians(0)},120),createjs.Tween.get(this.leftFinHolder).wait(460).to({rotation:Math.degreesToRadians(110)},120).wait(360).to({rotation:Math.degreesToRadians(-5)},120),this.chops.alpha=1,this.chops.removeChildren();var e=PIXI.Sprite.from("chef_cut");e.centered(),e.x=-10,this.chops.addChild(e),createjs.Tween.get(e).wait(520).to({y:-65,rotation:Math.degreesToRadians(60)},240,createjs.Ease.cubicOut).to({rotation:Math.degreesToRadians(70)},16).to({y:0,alpha:0,rotation:Math.degreesToRadians(120)},240,createjs.Ease.cubicIn).call(this.animationEnd.bind(this))}},i.prototype.stopAnimation=function(){this._upgradeLevel&&(this.chops.alpha=1,this.chops.visible=!0,this.chops.removeChildren(),this._leftTool.visible=!1,this._leftTool.alpha=1,this._rightTool.visible=!1,this._rightTool.alpha=1,this.face.visible=!1,createjs.Tween.removeTweens(this.leftFinHolder),createjs.Tween.removeTweens(this._leftFin),createjs.Tween.removeTweens(this._leftTool),createjs.Tween.removeTweens(this.rightFinHolder),createjs.Tween.removeTweens(this._rightFin),createjs.Tween.removeTweens(this._rightTool),createjs.Tween.removeTweens(this.headHolder),createjs.Tween.removeTweens(this._hat),createjs.Tween.removeTweens(this._head),createjs.Tween.removeTweens(this.face),createjs.Tween.get(this.headHolder).to({y:-18},210),createjs.Tween.get(this.leftFinHolder).to({rotation:Math.degreesToRadians(-5)},120),createjs.Tween.get(this.rightFinHolder).to({rotation:Math.degreesToRadians(5)},120),createjs.Tween.get(this._hat).to({rotation:0},120))},i.prototype.animationEnd=function(){this.animate()},i.prototype.start=function(){if(!this.playing){switch(this.playing=!0,this._upgradeLevel){case 1:Managers.soundManager.playSingle(SoundID.COOKSFX_01_WAV,Number.MAX_SAFE_INTEGER);break;case 2:Managers.soundManager.playSingle(SoundID.COOKSFX_02_WAV,Number.MAX_SAFE_INTEGER);break;case 3:Managers.soundManager.playSingle(SoundID.COOKSFX_03_WAV,Number.MAX_SAFE_INTEGER)}this.animate()}},i.prototype.stop=function(){this.playing&&(this.playing=!1,this.stopAnimation(),this._upgradeLevel>0&&Managers.soundManager.stopChannel(ChannelID.CHEF_SFX))},i.prototype.update=function(){},t.Chef=i}(window),function(t,e){function i(){this.initialize()}i.prototype=Object.create(PIXI.Container.prototype),i.prototype.constructor=i,i.prototype.initialize=function(){PIXI.Container.call(this),this.base=PIXI.Sprite.from("clock_base"),this.base.centered(),this.addChild(this.base),this.handHour=PIXI.Sprite.from("clock_hours"),this.handHour.anchor.set(.5,.95),this.addChild(this.handHour),this.handMinutes=PIXI.Sprite.from("clock_minutes"),this.handMinutes.anchor.set(.5,.95),this.addChild(this.handMinutes),this.from=9,this.to=21},i.prototype.setTheme=function(t){if(this.base.texture=PIXI.utils.TextureCache["clock_base_"+t],"theme_ball"===t){var e=PIXI.Sprite.from("ball_clock_hand");e.anchor.set(.5,0),e.y=2.5,e.from=Math.degreesToRadians(27),e.timer=0,e.onUpdate=function(t){this.timer+=t,e.rotation=this.from*Math.cos(.004*this.timer)}.bind(e),this.addChild(e),e.pushToBack();var i=PIXI.Sprite.from("ball_clock_back");i.centered(),i.y=4,this.addChild(i),i.pushToBack(),this.y-=10}},i.prototype.setTime=function(t,e){this.setHour(t),this.setMinute(e)},i.prototype.setHour=function(t){t%=12;var e=Math.degreesToRadians(t/12*360);this.handHour.rotation=e},i.prototype.setMinute=function(t){t%=60;var e=Math.degreesToRadians(t/60*360);this.handMinutes.rotation=e},i.prototype.setPercent=function(t){var e=(this.to-this.from)*t,i=this.from+e,n=i,a=60*(i-Math.floor(i));this.setTime(n,a)},t.Clock=i}(window),function(t,e){function i(){this.initialize()}i.prototype=Object.create(PIXI.Container.prototype),i.prototype.constructor=i,i.prototype.initialize=function(){PIXI.Container.call(this);var t=PIXI.Sprite.from("door_close_sign");t.anchor.set(.5,1),this.addChild(t),t.position.set(30,-20),createjs.Tween.get(this).wait(300).call(function(){Managers.soundManager.play(SoundID.CLOSE_SIGN_FALL_SFX)}),createjs.Tween.get(t,{override:!0}).to({y:245},1200,createjs.Ease.bounceOut)},t.ClosedSign=i}(window),function(t,e){function i(t,e,i){this.initialize(t,e,i)}i.prototype=Object.create(PIXI.Container.prototype),i.prototype.constructor=i,i.prototype.initialize=function(t,e,i){PIXI.Container.call(this),this._foodType=null,this._model=t,this._tileX=parseInt(e),this._tileY=parseInt(i),this.plate=new Plate,this.addChild(this.plate),this.x=(this.tileX+.5)*GameModel.MAP_TILE_SIZE+GameView.ROOM_DISP_X,this.y=(this.tileY+.5)*GameModel.MAP_TILE_SIZE+GameView.ROOM_DISP_Y,this.visible=!1,this.interactive=!0,this.buttonMode=!0,this.pointerup=this.onMouseUp.bind(this)},i.prototype.onMouseUp=function(){this._model.pathTargetMouseDown(this)},i.prototype.onShowFoodHandler=function(){null!=this.foodType?(this.visible=!0,this.plate.setPlate(this.foodType),this.plate.alpha=0,this.plate.y=0,createjs.Tween.get(this.plate).to({alpha:1},200),createjs.Tween.get(this.plate).to({y:9},600,createjs.Ease.bounceOut)):this.visible=!1},Object.defineProperty(i.prototype,"foodType",{get:function(){return this._foodType},set:function(t){this._foodType=t,this.onShowFoodHandler()}}),Object.defineProperty(i.prototype,"tileX",{get:function(){return this._tileX}}),Object.defineProperty(i.prototype,"tileY",{get:function(){return this._tileY}}),i.prototype.getPathTargetTile=function(t){if(t instanceof Penny)return new PIXI.Point(this._tileX,this._tileY);throw"This entity is not supported"},i.prototype.characterAction=function(t){var e=t;null!==this._foodType&&e.pickupCounterPlate(this._foodType)&&this._model.pickupCounterPlate(this)},t.CounterPlate=i}(window),function(t,e){function i(t,e,i,n){this.initialize(t,e,i,n)}i.prototype=Object.create(PIXI.Container.prototype),i.prototype.constructor=i,i.prototype.initialize=function(t,e,n,a){PIXI.Container.call(this),i._queuePlacesLeft=[new PathPlace(9,8),new PathPlace(7,8),new PathPlace(5,8)],i._queuePlacesRight=[new PathPlace(8,10),new PathPlace(6,10),new PathPlace(4,10)],this._numInQueue,this._guestLeft,this._guestRight,this._nextQueuePositionGetCount=2,this._guestsRemoved=0,this._model,this._table,this._selected=!1,this._appearMood,this._model=t,this._numInQueue=n,this._appearMood=this._model.dayInfo.guestAppearMood,3!=this._appearMood&&Math.random()>this._model.dayInfo.guestAppearWorseMoodChance&&(this._appearMood=3);var r=Math.random()<.5,s=a?!r:r;this._guestLeft=new Guest(this,t,e,1,8,!0,r,8),this._guestRight=new Guest(this,t,e,0,10,!1,s,10),this._guestLeft.moveToNextQueuePosition(),this._guestRight.moveToNextQueuePosition()},Object.defineProperty(i.prototype,"money",{get:function(){return this._guestLeft.money+this._guestRight.money}}),Object.defineProperty(i.prototype,"maxMoney",{get:function(){return this._guestLeft.maxMoney+this._guestRight.maxMoney}}),i.prototype.leaveTable=function(){this._table&&this._table.removeGuestGroup()},i.prototype.startEating=function(t){Managers.soundManager.play(SoundID.FOOD_GIVE_SFX),this._table.showFood(t.foodType,t.leftSide)},i.prototype.finishEating=function(t){this._table.showFood("empty",t.leftSide)},i.prototype.remove=function(){2==++this._guestsRemoved&&this._model.removeGuestGroup(this)},i.prototype.serve=function(){this._guestLeft.serve(),this._guestRight.serve()},i.prototype.update=function(t){this._guestLeft.update(t),this._guestRight.update(t)},i.prototype.dispose=function(){this._guestLeft.dispose(),this._guestRight.dispose(),this._guestLeft=null,this._guestRight=null,this._model=null},i.prototype.sendSignal=function(t){this._guestLeft.sendSignal(t),this._guestRight.sendSignal(t)},Object.defineProperty(i.prototype,"guests",{get:function(){return[this._guestLeft,this._guestRight]}}),i.prototype.isCompleted=function(){return this._guestLeft.completed&&this._guestRight.completed},i.prototype.isReadyForServing=function(){return this._guestLeft.readyForServing&&this._guestRight.readyForServing},i.prototype.isCouple=function(){return this._guestLeft.male!==this._guestRight.male},i.prototype.enableMouse=function(){this._guestLeft.canEnableMouse&&this._guestRight.canEnableMouse&&(this._guestLeft.enableMouse(),this._guestRight.enableMouse())},Object.defineProperty(i.prototype,"numInQueue",{get:function(){return this._numInQueue}}),Object.defineProperty(i.prototype,"selected",{get:function(){return this._selected},set:function(t){this._selected=t}}),Object.defineProperty(i.prototype,"table",{get:function(){return this._table},set:function(t){this._table=t}}),Object.defineProperty(i.prototype,"appearMood",{get:function(){return this._appearMood}}),i.prototype.mouseDown=function(){this._guestLeft.mouseDown(),this._guestRight.mouseDown()},i.prototype.mouseRollOver=function(){this._guestLeft.mouseRollOver(),this._guestRight.mouseRollOver()},i.prototype.mouseRollOut=function(){this._guestLeft.mouseRollOut(),this._guestRight.mouseRollOut()},i.prototype.getNextQueuePlace=function(t){var e=null,n=t==this._guestLeft?i._queuePlacesLeft:i._queuePlacesRight;return 0==--this._nextQueuePositionGetCount?(this._nextQueuePositionGetCount=2,e=n[--this._numInQueue]):e=n[this._numInQueue-1],e},i.prototype.addPathTarget=function(t){this._guestLeft.addPathTarget(t),this._guestRight.addPathTarget(t)},t.DoubleGuestGroup=i}(window),function(t,e){function i(t,e,i,n,a,r,s,o){this.initialize(t,e,i,n,a,r,s,o)}i.prototype=Object.create(PIXI.Container.prototype),i.prototype.constructor=i,i.SIGNAL_CONTINUE="SIGNAL_CONTINUE",i.SIGNAL_SELECT="SIGNAL_SELECT",i.SIGNAL_TIMEOUT="SIGNAL_TIMEOUT",i.SIGNAL_MOTION_END="SIGNAL_MOTION_END",i.SIGNAL_SERVE="SIGNAL_SERVE",i.prototype.initialize=function(t,e,n,a,r,s,o,h){PIXI.Container.call(this),this._completed=!1,this._readyForServing=!1,this._canEnableMouse=!1,this._money=0,this._animationState=null,this._direction=null,this._prevAnimationState=null,this._prevDirection=null,this._pathPointsList=[],this._pathTargets=[],this._group=t,this._model=e,this._leftSide=s,this._male=o,this._tileX=a,this._tileY=r,this._speed=h/2,this._foodType=n.getRandomFoodType(),this._clothes=n.getRandomGuestClothes(this._male),this._hat=n.getRandomGuestHat(this._male),this._maxMoney=Managers.progressManager.getDayFoodPrice(this._foodType),this._tips=Managers.progressManager.getDayTips(),this._mood=this._worstMood=this._group.appearMood,this.x=(this._tileX+.5)*GameModel.MAP_TILE_SIZE+GameView.ROOM_DISP_X,this.y=(this._tileY+.5)*GameModel.MAP_TILE_SIZE+GameView.ROOM_DISP_Y,this.view=new GuestView(this),this.addChild(this.view),this._stateMachine=new HSM;var l=this._stateMachine.addState(new InitialState),u=this._stateMachine.addState(new CompositeState),p=u.addState(new InitialState),c=u.addState(new SimpleState(this.enterGoingToNextPlace.bind(this),null,this.exitGoingToNextPlace.bind(this))),_=u.addState(new SimpleState(this.enterWaitingInQueue.bind(this),null,this.exitWaitingInQueue.bind(this))),d=u.addState(new ChoiceState),f=u.addState(new CompositeState(null,this.updateWaiting.bind(this),this.exitWaitingFirstComposite.bind(this))),m=f.addState(new InitialState),g=f.addState(new SimpleState(this.enterWaitingFirst.bind(this))),y=f.addState(new SimpleState(this.enterSelected.bind(this),null,this.exitSelected.bind(this))),v=this._stateMachine.addState(new CompositeState(this.enterAtTableComposite.bind(this))),T=v.addState(new InitialState),b=v.addState(new SimpleState),I=v.addState(new SimpleState(this.enterReadingMenu.bind(this))),S=v.addState(new SimpleState(this.enterWaitingForPenny.bind(this),this.updateWaiting.bind(this),this.exitWaitingForPenny.bind(this))),P=v.addState(new SimpleState(this.enterWaitingForFood.bind(this),this.updateWaiting.bind(this),this.exitWaitingForFood.bind(this))),D=v.addState(new SimpleState(this.enterEating.bind(this),null,this.exitEating.bind(this))),A=v.addState(new SimpleState(this.enterCompletedState.bind(this))),M=v.addState(new SimpleState(this.enterStandUpState.bind(this),null,this.exitStandUpState.bind(this))),w=this._stateMachine.addState(new SimpleState(this.enterLeaving.bind(this))),x=this._stateMachine.addState(new FinalState);this._changeMoodTime=this._model.dayInfo.guestChangeMoodTime*Managers.progressManager.guestPatienceMultiplier,this._waitCounter=this._changeMoodTime*(this._mood+1),l.addTransition(u,new EmptyTrigger),p.addTransition(c,new EmptyTrigger),c.addTransition(d,new SignalTrigger(i.SIGNAL_MOTION_END)),d.addTransition(f,new EmptyTrigger,null,this.isFirstInQueue.bind(this)),d.addTransition(_,new EmptyTrigger,null),_.addTransition(c,new SignalTrigger(i.SIGNAL_CONTINUE)),f.addTransition(w,new UpdateTrigger(this._changeMoodTime*(this._mood+1))),m.addTransition(g,new EmptyTrigger),g.addTransition(y,new SignalTrigger(i.SIGNAL_SELECT)),y.addTransition(v,new SignalTrigger(i.SIGNAL_CONTINUE)),T.addTransition(b,new EmptyTrigger),b.addTransition(I,new SignalTrigger(i.SIGNAL_MOTION_END)),I.addTransition(S,new UpdateTrigger(this._model.dayInfo.guestReadingMenuTime)),S.addTransition(A,new UpdateTrigger(4*this._changeMoodTime)),S.addTransition(P,new SignalTrigger(i.SIGNAL_SERVE),null,this._group.isReadyForServing.bind(this._group)),P.addTransition(A,new UpdateTrigger(4*this._changeMoodTime)),P.addTransition(D,new SignalTrigger(i.SIGNAL_SERVE),null,this.isPennyHasCorrectFood.bind(this)),D.addTransition(A,new UpdateTrigger(this._model.dayInfo.guestEatingTime)),A.addTransition(M,new SignalTrigger(i.SIGNAL_CONTINUE),null,this._group.isCompleted.bind(this._group)),M.addTransition(w,new UpdateTrigger(5)),w.addTransition(x,new SignalTrigger(i.SIGNAL_MOTION_END),this.finish.bind(this)),this._stateMachine.start(),this._exitPlace=new PathPlace(0,this._tileY-1),this.buttonMode=!0,this.pointerdown=this.mouseDown.bind(this),this.pointerover=this.mouseRollOver.bind(this),this.pointerout=this.mouseRollOut.bind(this),this.view.eyesSlot.displayIndex=this._male?1:0,this.setClothes(this._clothes,this._hat)},i.prototype.setClothes=function(t,e){if(t=parseInt(t),e=parseInt(e),this.view.sleveSlot.display.visible=!1,e>1?this.view.hatSlot.display.texture=PIXI.utils.TextureCache["hat_"+e]:this.view.hatSlot.display.visible=!1,t>1){this.view.shirtSlot.display.texture=PIXI.utils.TextureCache["cloth_"+t];var i=PIXI.utils.TextureCache["sleve_"+t];i&&(this.view.sleveSlot.display.texture=i,this.view.sleveSlot.display.visible=!0)}else this.view.shirtSlot.display.visible=!1},i.prototype.endWaitingCycle=function(){this._waitCounter=4*this._changeMoodTime,this._mood=3,this.onMoodChangeHandler()},i.prototype.updateWaiting=function(t){this._waitCounter-=t/30,this._mood=(this._waitCounter<0?0:this._waitCounter)/this._changeMoodTime,this.onMoodChangeHandler(),this._mood1&&(n=(e=this._pathPointsList.shift()).x-this.x,a=e.y-this.y,0==n&&0==a||(this._animationState=GuestView.STATE_WALK,this._direction=Direction.getDirection(n,a),this.x=e.x,this.y=e.y)),this._pathPointsList.length<=1&&(1==this._pathPointsList.length&&(r=this._pathPointsList.shift(),this._tileX=r.x,this._tileY=r.y,this._pathTargets.shift().characterAction(this),this._stateMachine.sendSignal(i.SIGNAL_MOTION_END)),this._pathTargets.length>0&&(s=this._pathTargets[0].getPathTargetTile(this),o=this._model.getPathPoints(this._tileX,this._tileY,s.x,s.y,this._speed),this._pathPointsList=o,this._pathPointsList.push(s))),this._animationState==GuestView.STATE_WALK){if(this._prevDirection==this._direction&&this._prevAnimationState==GuestView.STATE_WALK)return}else if(this._prevAnimationState==this._animationState)return;this._prevAnimationState=this._animationState,this._prevDirection=this._direction,this.onAnimationChangeHandler()},i.prototype.onAnimationChangeHandler=function(t){var e=this.animationState,i=this.direction;if(e==GuestView.STATE_WALK)switch(i){case Direction.DOWN:e+"_front";break;case Direction.UP:e+"_back";break;case Direction.LEFT:e+"_side",this.scale.x=-1;break;case Direction.RIGHT:e+"_side",this.scale.x=1}e==GuestView.STATE_READ_MENU&&(this.scale.x=this.leftSide?Number(1):Number(-1)),this.view.setAnimation(e),this.view._male=this._male},i.prototype.dispose=function(){this._stateMachine.dispose(),this._stateMachine=null,this._model=null,this._group=null},t.Guest=i}(window),function(t,e){function i(t,e){this.initialize(t,e)}i.SELECT_CUSTOMER="SELECT_CUSTOMER",i.SEAT_CUSTOMER="SEAT_CUSTOMER",i.SEAT_CUSTOMER_COUPLE="SEAT_CUSTOMER_COUPLE",i.WAIT_CUSTOMER_MAKE_ORDER="WAIT_CUSTOMER_MAKE_ORDER",i.TAKE_ORDER="TAKE_ORDER",i.PICKUP_FOOD="PICKUP_FOOD",i.CLEAN_TABLE="CLEAN_TABLE",i.PICKUP_ALL_MONEY="PICKUP_ALL_MONEY",i.prototype=Object.create(PIXI.Container.prototype),i.prototype.constructor=i,i.prototype.initialize=function(t,e){switch(PIXI.Container.call(this),this._message="",e?(this.x=e.x,this.y=e.y):(this.x=320,this.y=20),t){case i.SELECT_CUSTOMER:this._message="Look, a customer!\nClick your guest to select";break;case i.SEAT_CUSTOMER:this._message="Now click on a free table\nto seat the customer";break;case i.SEAT_CUSTOMER_COUPLE:this._message="Seat these love birds\nat table with flowers\nto get more tips";break;case i.WAIT_CUSTOMER_MAKE_ORDER:this._message="Wait for the customer\nto make an order";break;case i.TAKE_ORDER:this._message="Click customer\nto take the order";break;case i.PICKUP_FOOD:this._message="Take the food\nand serve it\nto the customer";break;case i.CLEAN_TABLE:this._message="Now clean\nthe table and\npick up your tip";break;case i.PICKUP_ALL_MONEY:this._message="Pickup all\nthe money!"}Managers.soundManager.play(SoundID.MESSAGE_POPUP_SFX),this.bouble=new PIXI.NineSlicePlane(PIXI.utils.TextureCache.popup,15,15,15,15),this.addChild(this.bouble);var n=new PIXI.Text(this._message,Styles.HINT_LABEL);n.anchor.set(.5,0),n.y=10,this.addChild(n),this.bouble.width=n.width+20,this.bouble.height=n.height+20,this.bouble.pivot.set(this.bouble.width/2,0);var a=createjs.Ease.elasticOut,r=this;this.scale.set(.5,.5),createjs.Tween.get(this.scale).to({x:1,y:1},700,a).wait(4500).call(function(){r.removeFromParent()})},t.Hint=i}(window),function(t,e){function i(t,e){this.initialize(t,e)}i.prototype.initialize=function(t,e){this._tile=new PIXI.Point(t,e)},i.prototype.getPathTargetTile=function(t){return this._tile},i.prototype.characterAction=function(t){},t.PathPlace=i}(window),function(t,e){function i(t,e,i){this.initialize(t,e,i)}i.prototype=Object.create(PIXI.Container.prototype),i.prototype.constructor=i,i.MAX_PATH_TARGETS=4,i.prototype.initialize=function(t,e,i){PIXI.Container.call(this),this._pathPointsList,this._pathTargets,this._uniform,this._skateUpgrade,this._speed,this._foodLeft=null,this._foodRight=null,this._idle=!1,this._direction=null,this._prevIdle=!1,this._prevDirection=null,this._pathPointsList=[],this._pathTargets=[],this._model=t,this._tileX=Number(e),this._tileY=Number(i),this._uniform=Managers.progressManager.pennyUniform,this._skateUpgrade=Managers.progressManager.skateUpgrade,this._speed=Managers.progressManager.pennySpeed/2,this.x=(this._tileX+.5)*GameModel.MAP_TILE_SIZE+GameView.ROOM_DISP_X,this.y=(this._tileY+.5)*GameModel.MAP_TILE_SIZE+GameView.ROOM_DISP_Y,this.view=new PennyView(this),this.addChild(this.view)},i.prototype.setUniform=function(t){this._uniform=t,this.view.setUniform(t)},i.prototype.addPathTarget=function(t){this._pathTargets.length1&&(e=(t=this._pathPointsList.shift()).x-this.x,i=t.y-this.y,0==e&&0==i||(this._direction=Direction.getDirection(e,i),this.x=t.x,this.y=t.y,this._idle=!1)),this._pathPointsList.length<=1&&(1==this._pathPointsList.length&&(n=this._pathPointsList.shift(),this._tileX=n.x,this._tileY=n.y,this._pathTargets.shift().characterAction(this),this._idle=!0),this._pathTargets.length>0&&(a=this._pathTargets[0].getPathTargetTile(this),(r=this._model.getPathPoints(this._tileX,this._tileY,a.x,a.y,this._speed))&&(this._pathPointsList=r,this._pathPointsList.push(a)))),this._idle==this._prevIdle&&this._direction==this._prevDirection||(this._prevIdle=this._idle,this._prevDirection=this._direction,this.onAnimationChange())},Object.defineProperty(i.prototype,"uniform",{get:function(){return this._uniform}}),Object.defineProperty(i.prototype,"skateUpgrade",{get:function(){return this._skateUpgrade}}),Object.defineProperty(i.prototype,"foodLeft",{get:function(){return this._foodLeft}}),Object.defineProperty(i.prototype,"foodRight",{get:function(){return this._foodRight}}),Object.defineProperty(i.prototype,"numPlates",{get:function(){return this._foodLeft&&this._foodRight?2:this._foodLeft||this._foodRight?1:0}}),Object.defineProperty(i.prototype,"direction",{get:function(){return this._direction}}),Object.defineProperty(i.prototype,"idle",{get:function(){return this._idle}}),i.prototype.dispose=function(){this._model=null},t.Penny=i}(window),function(t,e){function i(){this.initialize()}i.prototype=Object.create(PIXI.Container.prototype),i.prototype.constructor=i,i.foodPosition={coffee:{x:2,y:0},icecream:{x:1,y:2},cola:{x:3,y:2},cake:{x:0,y:3.5},lemonade:{x:0,y:1.5},sundae:{x:0,y:1.5},hot_dog:{x:0,y:2},soup:{x:0,y:1},egg_rolls:{x:0,y:6},burger:{x:0,y:1.5},spaghetti:{x:0,y:3},fish:{x:0,y:4.5},mussels:{x:0,y:5.5},prawns:{x:0,y:4},seaweed_salad:{x:0,y:1.5},sushi:{x:0,y:5},krill_salad:{x:-1,y:1.5},crab:{x:0,y:5.5},big_fish:{x:0,y:4},lobster:{x:0,y:5}},i.prototype.initialize=function(){PIXI.Container.call(this),this.base=PIXI.Sprite.from("empty_plate"),this.base.centered(),this.addChild(this.base),this.food=PIXI.Sprite.from("food_soup"),this.food.anchor.set(.5,1),this.addChild(this.food)},i.prototype.setPlate=function(t){var e=PIXI.utils.TextureCache["food_"+t];e?(this.food.visible=!0,this.food.texture=e,this.food.position=i.foodPosition[t]):this.food.visible=!1},t.Plate=i}(window),function(t,e){function i(t,e,i){this.initialize(t,e,i)}i.prototype=Object.create(PIXI.Container.prototype),i.prototype.constructor=i,i.prototype.initialize=function(t,e,n){PIXI.Container.call(this),i._queuePlaces=[new PathPlace(9,9),new PathPlace(7,9),new PathPlace(5,9)],this._table=null,this._selected=!1,this._model=t,this._numInQueue=n,this._appearMood=this._model.dayInfo.guestAppearMood,3!=this._appearMood&&Math.random()>this._model.dayInfo.guestAppearWorseMoodChance&&(this._appearMood=3),this._guest=new Guest(this,t,e,0,9,Math.random()<.5,Math.random()<.5,8),this._guest.moveToNextQueuePosition()},Object.defineProperty(i.prototype,"money",{get:function(){return this._guest.money}}),Object.defineProperty(i.prototype,"maxMoney",{get:function(){return this._guest.maxMoney}}),i.prototype.remove=function(){this._model.removeGuestGroup(this)},Object.defineProperty(i.prototype,"table",{get:function(){return this._table},set:function(t){this._table=t}}),i.prototype.leaveTable=function(){this._table.removeGuestGroup()},i.prototype.startEating=function(t){Managers.soundManager.play(SoundID.FOOD_GIVE_SFX),this._table.showFood(t.foodType,t.leftSide)},i.prototype.finishEating=function(t){this._table.showFood("empty",t.leftSide)},i.prototype.enableMouse=function(){this._guest.canEnableMouse&&this._guest.enableMouse()},i.prototype.serve=function(){this._guest.serve()},i.prototype.update=function(t){this._guest.update(t)},i.prototype.dispose=function(){this._guest.dispose(),this._guest=null,this._model=null},i.prototype.sendSignal=function(t){this._guest.sendSignal(t)},Object.defineProperty(i.prototype,"guests",{get:function(){return[this._guest]}}),i.prototype.isCompleted=function(){return this._guest.completed},i.prototype.isReadyForServing=function(){return this._guest.readyForServing},i.prototype.isCouple=function(){return!1},Object.defineProperty(i.prototype,"numInQueue",{get:function(){return this._numInQueue}}),Object.defineProperty(i.prototype,"selected",{get:function(){return this._selected},set:function(t){this._selected=t}}),Object.defineProperty(i.prototype,"appearMood",{get:function(){return this._appearMood}}),i.prototype.getNextQueuePlace=function(t){return i._queuePlaces[--this._numInQueue]},i.prototype.addPathTarget=function(t){this._guest.addPathTarget(t)},i.prototype.mouseDown=function(){this._guest.mouseDown()},i.prototype.mouseRollOver=function(){this._guest.mouseRollOver()},i.prototype.mouseRollOut=function(){this._guest.mouseRollOut()},t.SingleGuestGroup=i}(window),function(t,e){function i(t,e,i){this.initialize(t,e,i)}i.prototype=new StandardItemSlot,i.prototype.spriteInitialize22=i.prototype.initialize,i.prototype.initialize=function(t,e,i){this._equipField,this._itemSuperType,this._progressManager,this._equipButton=PIXI.Sprite.from("equip_btn"),this._equipField=new PIXI.Text("Equip",Styles.UPGRADE_BTN_LABEL);var n=(t=camelToUnderscore(t)).split("_");this._itemSuperType=n[0],this._price=parseInt(e),this.spriteInitialize22(t,-1,i),this._equipButton.position.set(160,20),this.addChild(this._equipButton),this._equipField.centered(),this._equipField.position.set(this._equipButton.width/2,this._equipButton.height/2),this._equipButton.addChild(this._equipField);var a=PIXI.Sprite.from("star");a.scale.set(.5),a.centered(),a.position.set(5,35),this._buyButton.addChild(a);var r=this;this._buyButton.pointerup=function(){r.delegate&&r.delegate.onBuyStarHandler&&r.delegate.onBuyStarHandler(r)},this._equipButton.pointerover=function(){r._buyButton.texture=PIXI.utils.TextureCache.equip_btn_hover},this._equipButton.pointerout=function(){r._buyButton.texture=PIXI.utils.TextureCache.equip_btn},this._equipButton.pointerup=function(){r.delegate&&r.delegate.onEquipHandler&&r.delegate.onEquipHandler(r)},this._equipButton.interactive=!0,this._equipButton.buttonMode=!0},i.prototype.onUpdate=function(t){},i.prototype.dispose=function(){this._progressManager=null},i.prototype.updateAccessOption=function(t){var e,i=null;e=this.getAccessOption(),(this._accessOption!=e||t)&&(this._accessOption=e,this._ownedIcon.visible=this._accessOption==StandardItemSlot.ITEM_EQUIPED,this._buyButton.visible=this._accessOption==StandardItemSlot.ITEM_ACCESSIBLE,this._equipButton.visible=this._accessOption==StandardItemSlot.ITEM_OWNED,this._equipField.visible=this._accessOption==StandardItemSlot.ITEM_OWNED,this._accessOption==StandardItemSlot.ITEM_ACCESSIBLE?(i=0==this._price?"?":formatThousands(this._price),this._priceField.text="BUY\n"+i):this._priceField.text="")},i.prototype.getAccessOption=function(){return"theme"==this._itemSuperType&&this._itemType==this._progressManager.roomTheme?StandardItemSlot.ITEM_EQUIPED:"uniform"==this._itemSuperType&&this._itemType==this._progressManager.pennyUniform?StandardItemSlot.ITEM_EQUIPED:this._progressManager.isStarItemOwned(this._itemType)?StandardItemSlot.ITEM_OWNED:StandardItemSlot.ITEM_ACCESSIBLE},Object.defineProperty(i.prototype,"priceIcon",{get:function(){return"IconStar"}}),Object.defineProperty(i.prototype,"itemSuperType",{get:function(){return this._itemSuperType}}),i.prototype.initializeMe=function(){this._progressManager=Managers.progressManager,this._descriptionField.text=this._description,this._descriptionField.y=(78-this._descriptionField.height)/2,this._itemIcon=PIXI.Sprite.from("upgrades_badge"),this._itemIcon.centered(),this._itemIcon.position.set(25,40),this.addChild(this._itemIcon);var t=PIXI.Sprite.from("upgrade_"+this._itemType);t.centered(),this._itemIcon.addChild(t),this.updateAccessOption()},i.prototype.mouseClicked=function(t){},t.StarItemSlot=i}(window),function(t,e){function i(t,e,i,n){this.initialize(t,e,i,n)}i.prototype=Object.create(PIXI.Container.prototype),i.prototype.constructor=i,i.prototype.initialize=function(t,e,i,n){PIXI.Container.call(this),i=parseInt(i),n=parseInt(n),this._moneyLeft=-1,this._guestGroup=null,this._showCoupleBonusEffect=null,this._moneyAmountIndex=null,this._model=t,this._hasFlowers=e,this._tileX=i,this._tileY=n,this.x=(i+.5)*GameModel.MAP_TILE_SIZE+GameView.ROOM_DISP_X,this.y=(n+.5)*GameModel.MAP_TILE_SIZE+GameView.ROOM_DISP_Y,this.seats=PIXI.Sprite.from("table_chairs_"+Managers.progressManager.seatUpgrade),this.seats.y=-8,this.seats.anchor.set(.5,0),this.addChild(this.seats),this.base=PIXI.Sprite.from("table_base_"+(0==Managers.progressManager.tableUpgrade?1:2)),this.base.anchor.set(.5,0),this.base.y=-50,this.addChild(this.base),this.tableCloth=PIXI.Sprite.from("table_top_"+Managers.progressManager.roomTheme.replace("theme_","")),this.tableCloth.anchor.set(.5,0),this.tableCloth.y=-50,this.tableCloth.visible=0!=Managers.progressManager.tableClothDecoration,this.addChild(this.tableCloth),this.flowers=PIXI.Sprite.from("table_flowers"),this.flowers.visible=e,this.flowers.anchor.set(.5,1),this.flowers.y=-35,this.addChild(this.flowers),this.moneyClip=PIXI.Sprite.from("table_money_1"),this.moneyClip.anchor.set(.5,1),this.moneyClip.position.set(0,-27),this.moneyClip.visible=!1,this.addChild(this.moneyClip),this._plateLeftClip=new Plate,this._plateLeftClip.visible=!1,this.addChild(this._plateLeftClip),this._plateRightClip=new Plate,this._plateRightClip.visible=!1,this.addChild(this._plateRightClip),this.interactive=!0,this.buttonMode=!0,this._plateLeftClip.position.set(-30,-36),this._plateRightClip.position.set(30,-36),this.pointerup=this.onMouseUp.bind(this),this.pointerover=this.mouseRollOver.bind(this),this.pointerout=this.mouseRollOut.bind(this)},i.prototype.mouseRollOver=function(){this.filters=[new PIXI.filters.GlowFilter({color:39168,distance:4,outerStrength:2,innerStrength:0})]},i.prototype.mouseRollOut=function(){this.filters=[]},i.prototype.onMouseUp=function(){this._model.pathTargetMouseDown(this)},i.prototype.onShowFoodHandler=function(t){var e=t.data.leftSide?this._plateLeftClip:this._plateRightClip;e.setPlate(t.data.foodType),e.visible=!0},i.prototype.addGuestGroup=function(t){if(this._guestGroup)throw"Can't add multiple groups";this._showCoupleBonusEffect=!0,this._guestGroup=t,this._guestGroup.table=this},i.prototype.removeGuestGroup=function(){var t=0,e=this._guestGroup.money;this._moneyLeft=0==e?-1:parseInt(e),-1!=this._moneyLeft&&(t=this._guestGroup.maxMoney,this._moneyAmountIndex=e>=t?2:e>t/2?1:0,this.moneyClip.visible=!0,this.moneyClip.texture=PIXI.utils.TextureCache["table_money_"+(this.moneyAmountIndex+1)]),this._guestGroup.table=null,this._guestGroup=null,this._model.onShowHintHandler(Hint.CLEAN_TABLE)},Object.defineProperty(i.prototype,"occupied",{get:function(){return-1!=this._moneyLeft||null!=this._guestGroup}}),Object.defineProperty(i.prototype,"hasFlowers",{get:function(){return this._hasFlowers}}),Object.defineProperty(i.prototype,"moneyLeft",{get:function(){return this._moneyLeft}}),Object.defineProperty(i.prototype,"moneyAmountIndex",{get:function(){return this._moneyAmountIndex}}),i.prototype.dispose=function(){this._model=null},i.prototype.getPathTargetTile=function(t){if(t instanceof Penny)return t.y>this.y?new PIXI.Point(this._tileX,this._tileY+1):new PIXI.Point(this._tileX,this._tileY-2);if(t instanceof Guest)return t.leftSide?new PIXI.Point(this._tileX-4,this._tileY+1):new PIXI.Point(this._tileX+4,this._tileY+1);throw"Entity "+t+" is not supported"},i.prototype.showFood=function(t,e){this.onShowFoodHandler({data:{foodType:t,leftSide:e}})},i.prototype.characterAction=function(t){t instanceof Penny?this._guestGroup?this._guestGroup.serve():-1!=this._moneyLeft&&(Managers.soundManager.play(SoundID.MONEY_PICKUP_SFX),this.moneyClip.visible=!1,this._plateLeftClip.visible=!1,this._plateRightClip.visible=!1,this._model.pickupMoney(this),this._moneyLeft=-1):t instanceof Guest&&this._hasFlowers&&t.group.isCouple()&&this._showCoupleBonusEffect&&(this._showCoupleBonusEffect=!1,this._model.showCoupleBonusEffect(this),Managers.soundManager.play(SoundID.PENG_LOVE2_WAV))},t.Table=i}(window),function(t,e){function i(t){this.initialize(t)}i.prototype=Object.create(PIXI.Container.prototype),i.prototype.constructor=i,i.prototype.initialize=function(t){PIXI.Container.call(this),this._tileX=28,this._tileY=20,this.trashcan=Sprite.from("trashcan"),this.trashcan.position.set(365,app.height-70),this.addChild(this.trashcan),this.interactive=!0,this.buttonMode=!0,this.pointerup=this.onTap.bind(this),this.model=t},i.prototype.onTap=function(t){this.model.pathTargetMouseDown(this)},i.prototype.getPathTargetTile=function(t){if(t instanceof Penny)return new PIXI.Point(this._tileX,this._tileY);throw"Entity "+t+" is not supported"},i.prototype.characterAction=function(t){t.disposeFood()},t.Trashbin=i}(window),function(t,e){function i(){this.initialize()}i.prototype=Object.create(PIXI.Container.prototype),i.prototype.constructor=i,i.prototype.initialize=function(){PIXI.Container.call(this),this.timer=0,this.play()},i.prototype.play=function(){this.scenes=[];var t=Sprite.from("tv3_tv");t.anchor.set(.5,1),t.position.set(0,-28),this.addChild(t);var e=new PIXI.Container,i=new PIXI.Container,n=new PIXI.Container;this.addChild(e),this.addChild(i),this.addChild(n),this.scenes=[e,i,n],(p=Sprite.from("tv3_back")).anchor.set(.5,1),p.position.set(-1,-41),e.addChild(p);var a=Sprite.from("tv3_reporter");a.anchor.set(.5,1),a.position.set(1,-26),e.addChild(a);var r=Sprite.from("tv3_reporter_paper");r.anchor.set(.5,1),r.position.set(-32,-35),e.addChild(r);var s=Sprite.from("tv3_reporter_eyes");s.anchor.set(.5,.5),s.position.set(-31.5,-42),a.addChild(s),s.timer=0,s.ty=-42,s.onUpdate=function(t){this.timer+=t,this.y=this.ty+.4*Math.sin(.005*this.timer)};var o=new PIXI.Text("CRASHED\nUFO",Styles.UFO);o.position.set(-5,-63),e.addChild(o),(c=PIXI.Sprite.from("tv3_ppn")).centered(),c.position.set(40,-53),c.scale.set(.25),e.addChild(c),(h=Sprite.from("tv3_mask")).anchor.set(.5,1),h.position.set(0,-44),e.addChild(h),e.mask=h;var h,l=Sprite.from("tv3_ufo");l.anchor.set(1,0),l.position.set(51,-94),i.addChild(l),(h=Sprite.from("tv3_mask")).anchor.set(.5,1),h.position.set(0,-44),i.addChild(h),i.mask=h,i.ufo=l,i.isPlaying=!1;var u=PIXI.Sprite.from("tv3_one_penguin");i.addChild(u);var p,c,_=PIXI.Sprite.from("tv3_2penguins");i.addChild(_),(c=PIXI.Sprite.from("tv3_ppn")).centered(),c.position.set(0,-67),c.scale.set(.8),i.addChild(c),i.up1=u,i.up2=_,i.ppn=c,i.scene1=e,i.play=function(){if(!this.isPlaying){this.isPlaying=!0,this.up1.position.set(-70,-80),this.up2.position.set(-70,-30),this.ufo.scale.set(1),createjs.Tween.get(this.ufo.scale).to({x:2,y:2},900),createjs.Tween.get(this.up1).wait(600).to({x:-20,y:-70},1200),createjs.Tween.get(this.up2).wait(600).to({x:-40,y:-65},1200);var t=this;t.ppn.visible=!1,createjs.Tween.get(this).wait(3e3).call(function(){t.ppn.visible=!0})}},i.onUpdate=function(t){},(p=Sprite.from("tv3_back")).anchor.set(.5,1),p.position.set(-1,-41),n.addChild(p),(c=PIXI.Sprite.from("tv3_ppn")).centered(),c.position.set(0,-67),c.scale.set(.8),n.addChild(c)},i.prototype.onUpdate=function(t){this.timer+=t,this.timer<3e3?(this.removeScenes(),this.scenes[0].visible=!0):this.timer<7e3?(this.scenes[1].visible=!0,this.scenes[1].play()):this.timer<7600?(this.removeScenes(),this.scenes[2].visible=!0):(this.scenes[1].isPlaying=!1,this.timer=0)},i.prototype.removeScenes=function(){for(var t=0;te.y}),this._timeCount-=t,this._timeCount<=0&&!this.closeSign&&this.onTimeCompleteHandler(),this.onEnterFrameHandler(t))},i.prototype.onEnterFrameHandler=function(t){var e=!1,n=null,a=null;if(!this._paused){for(var r=0;r0)this._guestManager.update(t);else if(0===this._guestGroups.length){e=!1;for(r=0;r0&&(e=this._guestQueue[0]).selected&&!a.occupied&&a.addGuestGroup)for(a.addGuestGroup(e),e.sendSignal(Guest.SIGNAL_CONTINUE),e.addPathTarget(t),this._guestQueue.shift(),i=this._guestQueue.length,n=0;n0&&(this._cookingTime-=t/30)},Object.defineProperty(i.prototype,"ready",{get:function(){return this._cookingTime<=0}}),Object.defineProperty(i.prototype,"foodType",{get:function(){return this._foodType}}),t.FoodOrder=i}(window),function(t,e){function i(t){this.initialize(t)}i.prototype.initialize=function(t){this._foodOrders=[],this._numReadyCounterPlates=0,this._model=t},i.prototype.addOrder=function(t){this._foodOrders.push(new FoodOrder(t,Managers.progressManager.chefCookingTime))},i.prototype.pickupCounterPlate=function(){this._numReadyCounterPlates--},Object.defineProperty(i.prototype,"hasOrders",{get:function(){return this._foodOrders.length>0}}),i.prototype.update=function(t){for(var e=null,i=0,n=0;nMath.random()){var i=Math.random(),n=this._model.dayInfo.guestCoupleAppearChance>i;t=new DoubleGuestGroup(this._model,this,e,n)}else t=new SingleGuestGroup(this._model,this,e);this._model.addGuestGroup(t)}},t.GuestManager=i}(window),function(t,e){function i(){this.initialize()}i.prototype=Object.create(PIXI.Container.prototype),i.prototype.constructor=i,i.ROOM_DISP_X=-64,i.ROOM_DISP_Y=96,i.ROOM_SPRITE="ROOM_SPRITE",i.COUNTER_SPRITE="COUNTER_SPRITE",i.EFFECTS_SPRITE="EFFECTS_SPRITE",i.prototype.initialize=function(){PIXI.Container.call(this),this._entityToViewDict,this._viewToIPathTargetDict,this._popup,this._background,this._room,this._counter,this._effects,this._hints,this._openingBlinds,this._prevFrame=-1,this._depthSort,this._currentMoneyTextField,this._goalMoneyTextField,this._controller,this._entityToViewDict=[],this._viewToIPathTargetDict=[],this._background=new PIXI.Sprite;var t=Managers.progressManager.roomTheme,e=PIXI.Sprite.from(t+"_picture_left");e.centered(),e.position.set(256,45),e.visible=0!=Managers.progressManager.pictureDecoration,this.addChild(e);var i=PIXI.Sprite.from(t+"_picture_right");if(i.centered(),i.position.set(457,45),i.visible=0!=Managers.progressManager.pictureDecoration,this.addChild(i),0!=Managers.progressManager.curtainsDecoration){var n=PIXI.Sprite.from(t+"_curtain");n.anchor.set(.5,0),n.position.set(160,-8),this.addChild(n);var a=PIXI.Sprite.from(t+"_curtain");a.anchor.set(.5,0),a.position.set(355,-8),this.addChild(a);var r=PIXI.Sprite.from(t+"_curtain");r.anchor.set(.5,0),r.position.set(560,-8),this.addChild(r),"theme_ball"===t&&(n.y=a.y=r.y=-35)}if(0!=Managers.progressManager.lightsDecoration)if("theme_hats"===t)(s=PIXI.Sprite.from(t+"_light")).anchor.set(.5,.5),s.position.set(375,-8),this.addChild(s);else if("theme_ball"===t){var s;(s=PIXI.Sprite.from(t+"_light")).anchor.set(.5,0),s.position.set(app.width/2+30,-8),this.addChild(s)}else{var o=PIXI.Sprite.from(t+"_light");o.anchor.set(.5,0),o.position.set(190,-8),this.addChild(o);var h=PIXI.Sprite.from(t+"_light");h.anchor.set(.5,0),h.position.set(385,-8),this.addChild(h);var l=PIXI.Sprite.from(t+"_light");l.anchor.set(.5,0),l.position.set(590,-8),this.addChild(l),"theme_standard"===t?o.y=h.y=l.y=-50:"theme_eco"===t?(o.y=h.y=l.y=-100,h.scale.x=-1):"theme_beach"===t?o.y=h.y=l.y=-15:"theme_pirates"===t&&(o.y=h.y=l.y=-25,o.scale.x=-1)}if(this.addChild(this._background),this._room=new Sprite,this.addChild(this._room),1===Managers.progressManager.entertaimentUpgrade){for(var u=[],p=1;p<=8;p++)u.push(PIXI.utils.TextureCache["radio_"+p]);(_=new PIXI.AnimatedSprite(u)).position.set(60,150),_.anchor.set(.5,1),_.loop=!0,_.animationSpeed=.1,_.gotoAndPlay(0),this.addChild(_)}else if(2===Managers.progressManager.entertaimentUpgrade){var c=new TV;c.position.set(68,160),this.addChild(c)}else if(3===Managers.progressManager.entertaimentUpgrade){for(u=[],p=1;p<=20;p++)u.push(PIXI.utils.TextureCache["seal_"+p]);var _;(_=new PIXI.AnimatedSprite(u)).position.set(70,170),_.anchor.set(.5,1),_.loop=!0,_.animationSpeed=.5,_.gotoAndPlay(0),_.scale.set(-.8,.8),this.addChild(_)}this._effects=new PIXI.Sprite,this.addChild(this._effects),this._openingBlinds=new PIXI.Sprite,this.addChild(this._openingBlinds),this._depthSort=null,this.interactive=!0,this.pointerdown=this.onMouseDownHandler.bind(this)},i.prototype.onBlindsCompleteHandler=function(t){this._openingBlinds.removeEventListener(OpeningBlinds.EVENT_BLINDS_COMPLETE,onBlindsCompleteHandler),removeChild(this._openingBlinds),this._openingBlinds.dispose(),this._openingBlinds=null},i.prototype.removePausePopup=function(){removeChild(this._popup),this._popup.dispose(),this._popup=null},i.prototype.showPausePopup=function(){this._popup=new PausePopup,this.addChild(this._popup)},i.prototype.showTime=function(t){var e=1e3*(1-t);this._prevFrame!=e&&(this._prevFrame=e)},i.prototype.showCurrentMoney=function(t){this._controler.showCurrentMoney(t)},i.prototype.showDayResult=function(){var t=new DayResultScreen;app.addScreen(t)},i.prototype.onMouseDownHandler=function(t){this._viewToIPathTargetDict[t.target]&&Managers.soundManager.play(SoundID.CLICK_GAME_OBJECT_SFX)},i.prototype.addEntityView=function(t){},i.prototype.removeEntityView=function(t){},i.prototype.onDepthChangeHandler=function(t){},i.prototype.reparentEntityView=function(t,e){},t.GameView=i}(window),function(t,e){function i(){this.initialize()}i.prototype=Object.create(PIXI.Container.prototype),i.prototype.constructor=i,i.prototype.initialize=function(){PIXI.Container.call(this)},t.HUD=i}(window),function(t,e){function i(){this.initialize()}i.prototype.initialize=function(){this.configXML=JSON.parse(xml2json(PIXI.Loader.shared.resources.config_xml_class.data,""));var t=JSON.parse(xml2json(PIXI.Loader.shared.resources.levels_config_xml_class.data,""));this.catalogConfigXML=JSON.parse(xml2json(PIXI.Loader.shared.resources.catalog_config_xml_class.data,"")),this._initialized=!0,this._soundEnabled=!0,this._minUpgradePrice=-1,this._minChefMinPrice=-1,this.levelsConfigXML=this.parseLevelsConfig(t),!1===Managers.soManager.getValue(SOValues.SOUND_ENABLED)?this.soundEnabled=!1:this.soundEnabled=!0},i.prototype.parseLevelsConfig=function(t){for(var e=[],i=null,n=null,a=null,r=0,s=null,o=null,h=t.Workbook["ss:Worksheet"][0].Table.Row,l=0,u=0,p=[],c=0;c=2){u%10==0&&(e=[],p.push(e)),n={},a=i.Cell,r=0;for(var _=0;_0&&(t=parseInt(h["@price"]))0&&(e=parseInt(t["@price"]))0){for(var i=0,n=this._objects;i0){for(var a=0;ai&&(a.length=i),t._maxCountMap[n]=i;else for(var n in t._defaultMaxCount=i,t._poolsMap){var a;(a=t._poolsMap[n]).length>i&&(a.length=i),n in t._maxCountMap&&(t._maxCountMap[n]=i)}},t.clearPool=function(e){if(void 0===e&&(e=null),null!==e){var i=String(e);null!==(a=i in t._poolsMap?t._poolsMap[i]:null)&&a.length>0&&(a.length=0)}else for(var n in t._poolsMap){var a;(a=t._poolsMap[n]).length=0}},t.borrowObject=function(e){var i=String(e),n=i in t._poolsMap?t._poolsMap[i]:null;if(null!==n&&n.length>0){var a=n.pop();return a._isInPool=!1,a}var r=new e;return r._onClear(),r},t.prototype.returnToPool=function(){this._onClear(),t._returnObject(this)},t._hashCode=0,t._defaultMaxCount=3e3,t._maxCountMap={},t._poolsMap={},t}();t.BaseObject=e}(dragonBones||(dragonBones={})),function(t){var e=function(){function t(t,e,i,n,a,r){void 0===t&&(t=1),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=1),void 0===a&&(a=0),void 0===r&&(r=0),this.a=t,this.b=e,this.c=i,this.d=n,this.tx=a,this.ty=r}return t.prototype.toString=function(){return"[object dragonBones.Matrix] a:"+this.a+" b:"+this.b+" c:"+this.c+" d:"+this.d+" tx:"+this.tx+" ty:"+this.ty},t.prototype.copyFrom=function(t){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this},t.prototype.copyFromArray=function(t,e){return void 0===e&&(e=0),this.a=t[e],this.b=t[e+1],this.c=t[e+2],this.d=t[e+3],this.tx=t[e+4],this.ty=t[e+5],this},t.prototype.identity=function(){return this.a=this.d=1,this.b=this.c=0,this.tx=this.ty=0,this},t.prototype.concat=function(t){var e=this.a*t.a,i=0,n=0,a=this.d*t.d,r=this.tx*t.a+t.tx,s=this.ty*t.d+t.ty;return 0===this.b&&0===this.c||(e+=this.b*t.c,i+=this.b*t.d,n+=this.c*t.a,a+=this.c*t.b),0===t.b&&0===t.c||(i+=this.a*t.b,n+=this.d*t.c,r+=this.ty*t.c,s+=this.tx*t.b),this.a=e,this.b=i,this.c=n,this.d=a,this.tx=r,this.ty=s,this},t.prototype.invert=function(){var t=this.a,e=this.b,i=this.c,n=this.d,a=this.tx,r=this.ty;if(0===e&&0===i)return this.b=this.c=0,0===t||0===n?this.a=this.b=this.tx=this.ty=0:(t=this.a=1/t,n=this.d=1/n,this.tx=-t*a,this.ty=-n*r),this;var s=t*n-e*i;if(0===s)return this.a=this.d=1,this.b=this.c=0,this.tx=this.ty=0,this;s=1/s;var o=this.a=n*s;return e=this.b=-e*s,i=this.c=-i*s,n=this.d=t*s,this.tx=-(o*a+i*r),this.ty=-(e*a+n*r),this},t.prototype.transformPoint=function(t,e,i,n){void 0===n&&(n=!1),i.x=this.a*t+this.c*e,i.y=this.b*t+this.d*e,n||(i.x+=this.tx,i.y+=this.ty)},t.prototype.transformRectangle=function(t,e){void 0===e&&(e=!1);var i=this.a,n=this.b,a=this.c,r=this.d,s=e?0:this.tx,o=e?0:this.ty,h=t.x,l=t.y,u=h+t.width,p=l+t.height,c=i*h+a*l+s,_=n*h+r*l+o,d=i*u+a*l+s,f=n*u+r*l+o,m=i*u+a*p+s,g=n*u+r*p+o,y=i*h+a*p+s,v=n*h+r*p+o,T=0;c>d&&(T=c,c=d,d=T),m>y&&(T=m,m=y,y=T),t.x=Math.floor(cy?d:y)-t.x),_>f&&(T=_,_=f,f=T),g>v&&(T=g,g=v,v=T),t.y=Math.floor(_v?f:v)-t.y)},t}();t.Matrix=e}(dragonBones||(dragonBones={})),function(t){var e=function(){function t(t,e,i,n,a,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===a&&(a=1),void 0===r&&(r=1),this.x=t,this.y=e,this.skew=i,this.rotation=n,this.scaleX=a,this.scaleY=r}return t.normalizeRadian=function(t){return t=(t+Math.PI)%(2*Math.PI),t+=t>0?-Math.PI:Math.PI},t.prototype.toString=function(){return"[object dragonBones.Transform] x:"+this.x+" y:"+this.y+" skewX:"+180*this.skew/Math.PI+" skewY:"+180*this.rotation/Math.PI+" scaleX:"+this.scaleX+" scaleY:"+this.scaleY},t.prototype.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.skew=t.skew,this.rotation=t.rotation,this.scaleX=t.scaleX,this.scaleY=t.scaleY,this},t.prototype.identity=function(){return this.x=this.y=0,this.skew=this.rotation=0,this.scaleX=this.scaleY=1,this},t.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this.skew+=t.skew,this.rotation+=t.rotation,this.scaleX*=t.scaleX,this.scaleY*=t.scaleY,this},t.prototype.minus=function(t){return this.x-=t.x,this.y-=t.y,this.skew-=t.skew,this.rotation-=t.rotation,this.scaleX/=t.scaleX,this.scaleY/=t.scaleY,this},t.prototype.fromMatrix=function(e){var i=this.scaleX,n=this.scaleY,a=t.PI_Q;this.x=e.tx,this.y=e.ty,this.rotation=Math.atan(e.b/e.a);var r=Math.atan(-e.c/e.d);return this.scaleX=this.rotation>-a&&this.rotation-a&&r=0&&this.scaleX<0&&(this.scaleX=-this.scaleX,this.rotation=this.rotation-Math.PI),n>=0&&this.scaleY<0&&(this.scaleY=-this.scaleY,r-=Math.PI),this.skew=r-this.rotation,this},t.prototype.toMatrix=function(t){return 0===this.rotation?(t.a=1,t.b=0):(t.a=Math.cos(this.rotation),t.b=Math.sin(this.rotation)),0===this.skew?(t.c=-t.b,t.d=t.a):(t.c=-Math.sin(this.skew+this.rotation),t.d=Math.cos(this.skew+this.rotation)),1!==this.scaleX&&(t.a*=this.scaleX,t.b*=this.scaleX),1!==this.scaleY&&(t.c*=this.scaleY,t.d*=this.scaleY),t.tx=this.x,t.ty=this.y,this},t.PI=Math.PI,t.PI_D=2*Math.PI,t.PI_H=Math.PI/2,t.PI_Q=Math.PI/4,t.RAD_DEG=180/Math.PI,t.DEG_RAD=Math.PI/180,t}();t.Transform=e}(dragonBones||(dragonBones={})),function(t){var e=function(){function t(t,e,i,n,a,r,s,o){void 0===t&&(t=1),void 0===e&&(e=1),void 0===i&&(i=1),void 0===n&&(n=1),void 0===a&&(a=0),void 0===r&&(r=0),void 0===s&&(s=0),void 0===o&&(o=0),this.alphaMultiplier=t,this.redMultiplier=e,this.greenMultiplier=i,this.blueMultiplier=n,this.alphaOffset=a,this.redOffset=r,this.greenOffset=s,this.blueOffset=o}return t.prototype.copyFrom=function(t){this.alphaMultiplier=t.alphaMultiplier,this.redMultiplier=t.redMultiplier,this.greenMultiplier=t.greenMultiplier,this.blueMultiplier=t.blueMultiplier,this.alphaOffset=t.alphaOffset,this.redOffset=t.redOffset,this.greenOffset=t.greenOffset,this.blueOffset=t.blueOffset},t.prototype.identity=function(){this.alphaMultiplier=this.redMultiplier=this.greenMultiplier=this.blueMultiplier=1,this.alphaOffset=this.redOffset=this.greenOffset=this.blueOffset=0},t}();t.ColorTransform=e}(dragonBones||(dragonBones={})),function(t){var e=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=t,this.y=e}return t.prototype.copyFrom=function(t){this.x=t.x,this.y=t.y},t.prototype.clear=function(){this.x=this.y=0},t}();t.Point=e}(dragonBones||(dragonBones={})),function(t){var e=function(){function t(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),this.x=t,this.y=e,this.width=i,this.height=n}return t.prototype.copyFrom=function(t){this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height},t.prototype.clear=function(){this.x=this.y=0,this.width=this.height=0},t}();t.Rectangle=e}(dragonBones||(dragonBones={})),function(t){var e=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.ints=[],e.floats=[],e.strings=[],e}return __extends(e,t),e.toString=function(){return"[class dragonBones.UserData]"},e.prototype._onClear=function(){this.ints.length=0,this.floats.length=0,this.strings.length=0},e.prototype.addInt=function(t){this.ints.push(t)},e.prototype.addFloat=function(t){this.floats.push(t)},e.prototype.addString=function(t){this.strings.push(t)},e.prototype.getInt=function(t){return void 0===t&&(t=0),t>=0&&t=0&&t=0&&t=t&&(i=0),!(this.sortedBones.indexOf(a)>=0)){var r=!1;for(var s in this.constraints){var o=this.constraints[s];if(o.root===a&&this.sortedBones.indexOf(o.target)<0){r=!0;break}}r||null!==a.parent&&this.sortedBones.indexOf(a.parent)<0||(this.sortedBones.push(a),n++)}}}},i.prototype.cacheFrames=function(t){if(!(this.cacheFrameRate>0))for(var e in this.cacheFrameRate=t,this.animations)this.animations[e].cacheFrames(this.cacheFrameRate)},i.prototype.setCacheFrame=function(t,e){var i=this.parent.cachedFrames,n=i.length;return i.length+=10,i[n]=t.a,i[n+1]=t.b,i[n+2]=t.c,i[n+3]=t.d,i[n+4]=t.tx,i[n+5]=t.ty,i[n+6]=e.rotation,i[n+7]=e.skew,i[n+8]=e.scaleX,i[n+9]=e.scaleY,n},i.prototype.getCacheFrame=function(t,e,i){var n=this.parent.cachedFrames;t.a=n[i],t.b=n[i+1],t.c=n[i+2],t.d=n[i+3],t.tx=n[i+4],t.ty=n[i+5],e.rotation=n[i+6],e.skew=n[i+7],e.scaleX=n[i+8],e.scaleY=n[i+9],e.x=t.tx,e.y=t.ty},i.prototype.addBone=function(t){t.name in this.bones?console.warn("Same bone: "+t.name):(this.bones[t.name]=t,this.sortedBones.push(t))},i.prototype.addSlot=function(t){t.name in this.slots?console.warn("Same slot: "+t.name):(this.slots[t.name]=t,this.sortedSlots.push(t))},i.prototype.addConstraint=function(t){t.name in this.constraints?console.warn("Same constraint: "+t.name):this.constraints[t.name]=t},i.prototype.addSkin=function(t){t.name in this.skins?console.warn("Same skin: "+t.name):(t.parent=this,this.skins[t.name]=t,null===this.defaultSkin&&(this.defaultSkin=t),"default"===t.name&&(this.defaultSkin=t))},i.prototype.addAnimation=function(t){t.name in this.animations?console.warn("Same animation: "+t.name):(t.parent=this,this.animations[t.name]=t,this.animationNames.push(t.name),null===this.defaultAnimation&&(this.defaultAnimation=t))},i.prototype.addAction=function(t,e){e?this.defaultActions.push(t):this.actions.push(t)},i.prototype.getBone=function(t){return t in this.bones?this.bones[t]:null},i.prototype.getSlot=function(t){return t in this.slots?this.slots[t]:null},i.prototype.getConstraint=function(t){return t in this.constraints?this.constraints[t]:null},i.prototype.getSkin=function(t){return t in this.skins?this.skins[t]:null},i.prototype.getMesh=function(t,e,i){var n=this.getSkin(t);return null===n?null:n.getDisplay(e,i)},i.prototype.getAnimation=function(t){return t in this.animations?this.animations[t]:null},i}(t.BaseObject);t.ArmatureData=e;var i=function(e){function i(){var i=null!==e&&e.apply(this,arguments)||this;return i.transform=new t.Transform,i.userData=null,i}return __extends(i,e),i.toString=function(){return"[class dragonBones.BoneData]"},i.prototype._onClear=function(){null!==this.userData&&this.userData.returnToPool(),this.inheritTranslation=!1,this.inheritRotation=!1,this.inheritScale=!1,this.inheritReflection=!1,this.type=0,this.length=0,this.alpha=1,this.name="",this.transform.identity(),this.userData=null,this.parent=null},i}(t.BaseObject);t.BoneData=i;var n=function(e){function i(){var i=null!==e&&e.apply(this,arguments)||this;return i.geometry=new t.GeometryData,i}return __extends(i,e),i.toString=function(){return"[class dragonBones.SurfaceData]"},i.prototype._onClear=function(){e.prototype._onClear.call(this),this.type=1,this.segmentX=0,this.segmentY=0,this.geometry.clear()},i}(i);t.SurfaceData=n;var a=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.color=null,t.userData=null,t}return __extends(i,e),i.createColor=function(){return new t.ColorTransform},i.toString=function(){return"[class dragonBones.SlotData]"},i.prototype._onClear=function(){null!==this.userData&&this.userData.returnToPool(),this.blendMode=0,this.displayIndex=0,this.zOrder=0,this.zIndex=0,this.alpha=1,this.name="",this.color=null,this.userData=null,this.parent=null},i.DEFAULT_COLOR=new t.ColorTransform,i}(t.BaseObject);t.SlotData=a}(dragonBones||(dragonBones={})),function(t){var e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype._onClear=function(){this.order=0,this.name="",this.type=0,this.target=null,this.root=null,this.bone=null},e}(t.BaseObject);t.ConstraintData=e;var i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.toString=function(){return"[class dragonBones.IKConstraintData]"},e.prototype._onClear=function(){t.prototype._onClear.call(this),this.scaleEnabled=!1,this.bendPositive=!1,this.weight=1},e}(e);t.IKConstraintData=i;var n=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.bones=[],e}return __extends(e,t),e.toString=function(){return"[class dragonBones.PathConstraintData]"},e.prototype._onClear=function(){t.prototype._onClear.call(this),this.pathSlot=null,this.pathDisplayData=null,this.bones.length=0,this.positionMode=0,this.spacingMode=1,this.rotateMode=1,this.position=0,this.spacing=0,this.rotateOffset=0,this.rotateMix=0,this.translateMix=0},e.prototype.AddBone=function(t){this.bones.push(t)},e}(e);t.PathConstraintData=n}(dragonBones||(dragonBones={})),function(t){var e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.toString=function(){return"[class dragonBones.CanvasData]"},e.prototype._onClear=function(){this.hasBackground=!1,this.color=0,this.x=0,this.y=0,this.width=0,this.height=0},e}(t.BaseObject);t.CanvasData=e}(dragonBones||(dragonBones={})),function(t){var e=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.displays={},e}return __extends(e,t),e.toString=function(){return"[class dragonBones.SkinData]"},e.prototype._onClear=function(){for(var t in this.displays){for(var e=0,i=this.displays[t];ea&&(s|=2),er&&(s|=8),s},e.rectangleIntersectsSegment=function(t,i,n,a,r,s,o,h,l,u,p){void 0===l&&(l=null),void 0===u&&(u=null),void 0===p&&(p=null);var c=t>r&&ts&&ir&&ns&&a=-i&&t<=i){var n=.5*this.height;if(e>=-n&&e<=n)return!0}return!1},e.prototype.intersectsSegment=function(t,i,n,a,r,s,o){void 0===r&&(r=null),void 0===s&&(s=null),void 0===o&&(o=null);var h=.5*this.width,l=.5*this.height;return e.rectangleIntersectsSegment(t,i,n,a,-h,-l,h,l,r,s,o)},e}(e);t.RectangleBoundingBoxData=i;var n=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.toString=function(){return"[class dragonBones.EllipseData]"},e.ellipseIntersectsSegment=function(t,e,i,n,a,r,s,o,h,l,u){void 0===h&&(h=null),void 0===l&&(l=null),void 0===u&&(u=null);var p=s/o,c=p*p,_=i-t,d=(n*=p)-(e*=p),f=Math.sqrt(_*_+d*d),m=_/f,g=d/f,y=(a-t)*m+(r-e)*g,v=s*s,T=v-(t*t+e*e)+y*y,b=0;if(T>=0){var I=Math.sqrt(T),S=y-I,P=y+I,D=S<0?-1:S<=f?0:1,A=P<0?-1:P<=f?0:1,M=D*A;if(M<0)return-1;0===M&&(-1===D?(b=2,i=t+P*m,n=(e+P*g)/p,null!==h&&(h.x=i,h.y=n),null!==l&&(l.x=i,l.y=n),null!==u&&(u.x=Math.atan2(n/v*c,i/v),u.y=u.x+Math.PI)):1===A?(b=1,t+=S*m,e=(e+S*g)/p,null!==h&&(h.x=t,h.y=e),null!==l&&(l.x=t,l.y=e),null!==u&&(u.x=Math.atan2(e/v*c,t/v),u.y=u.x+Math.PI)):(b=3,null!==h&&(h.x=t+S*m,h.y=(e+S*g)/p,null!==u&&(u.x=Math.atan2(h.y/v*c,h.x/v))),null!==l&&(l.x=t+P*m,l.y=(e+P*g)/p,null!==u&&(u.y=Math.atan2(l.y/v*c,l.x/v)))))}return b},e.prototype._onClear=function(){t.prototype._onClear.call(this),this.type=1},e.prototype.containsPoint=function(t,e){var i=.5*this.width;if(t>=-i&&t<=i){var n=.5*this.height;if(e>=-n&&e<=n)return e*=i/n,Math.sqrt(t*t+e*e)<=i}return!1},e.prototype.intersectsSegment=function(t,i,n,a,r,s,o){return void 0===r&&(r=null),void 0===s&&(s=null),void 0===o&&(o=null),e.ellipseIntersectsSegment(t,i,n,a,0,0,.5*this.width,.5*this.height,r,s,o)},e}(e);t.EllipseBoundingBoxData=n;var a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.vertices=[],e}return __extends(e,t),e.toString=function(){return"[class dragonBones.PolygonBoundingBoxData]"},e.polygonIntersectsSegment=function(t,e,i,n,a,r,s,o){void 0===r&&(r=null),void 0===s&&(s=null),void 0===o&&(o=null),t===i&&(t=i+1e-6),e===n&&(e=n+1e-6);for(var h=a.length,l=t-i,u=e-n,p=t*n-e*i,c=0,_=a[h-2],d=a[h-1],f=0,m=0,g=0,y=0,v=0,T=0,b=0;b=_&&w<=I||w>=I&&w<=_)&&(0===l||w>=t&&w<=i||w>=i&&w<=t)){var x=(p*D-u*A)/M;if((x>=d&&x<=S||x>=S&&x<=d)&&(0===u||x>=e&&x<=n||x>=n&&x<=e)){if(null===s){g=w,y=x,v=w,T=x,c++,null!==o&&(o.x=Math.atan2(S-d,I-_)-.5*Math.PI,o.y=o.x);break}var E=w-t;E<0&&(E=-E),0===c?(f=E,m=E,g=w,y=x,v=w,T=x,null!==o&&(o.x=Math.atan2(S-d,I-_)-.5*Math.PI,o.y=o.x)):(Em&&(m=E,v=w,T=x,null!==o&&(o.y=Math.atan2(S-d,I-_)-.5*Math.PI))),c++}}_=I,d=S}return 1===c?(null!==r&&(r.x=g,r.y=y),null!==s&&(s.x=g,s.y=y),null!==o&&(o.y=o.x+Math.PI)):c>1&&(c++,null!==r&&(r.x=g,r.y=y),null!==s&&(s.x=v,s.y=T)),c},e.prototype._onClear=function(){t.prototype._onClear.call(this),this.type=2,this.x=0,this.y=0,this.vertices.length=0},e.prototype.containsPoint=function(t,e){var i=!1;if(t>=this.x&&t<=this.width&&e>=this.y&&e<=this.height)for(var n=0,a=this.vertices.length,r=a-2;n=e||s=e){var h=this.vertices[r],l=this.vertices[n];(e-o)*(h-l)/(s-o)+l0)){this.cacheFrameRate=Math.max(Math.ceil(t*this.scale),1);var e=Math.ceil(this.cacheFrameRate*this.duration)+1;this.cachedFrames.length=e;for(var i=0,n=this.cacheFrames.length;i1e3*e._zIndex+e._zOrder?1:-1},i.prototype._onClear=function(){null!==this._clock&&this._clock.remove(this);for(var t=0,e=this._bones;t=r)){var o=i[s],h=this.getSlot(o.name);null!==h&&h._setZOrder(a)}}this._slotsDirty=!0,this._zOrderDirty=!n}},i.prototype._addBone=function(t){this._bones.indexOf(t)<0&&this._bones.push(t)},i.prototype._addSlot=function(t){this._slots.indexOf(t)<0&&this._slots.push(t)},i.prototype._addConstraint=function(t){this._constraints.indexOf(t)<0&&this._constraints.push(t)},i.prototype._bufferAction=function(t,e){this._actions.indexOf(t)<0&&(e?this._actions.push(t):this._actions.unshift(t))},i.prototype.dispose=function(){null!==this._armatureData&&(this._lockUpdate=!0,this._dragonBones.bufferObject(this))},i.prototype.init=function(e,i,n,a){null===this._armatureData&&(this._armatureData=e,this._animation=t.BaseObject.borrowObject(t.Animation),this._proxy=i,this._display=n,this._dragonBones=a,this._proxy.dbInit(this),this._animation.init(this),this._animation.animations=this._armatureData.animations)},i.prototype.advanceTime=function(t){if(!this._lockUpdate)if(this._lockUpdate=!0,null!==this._armatureData)if(null!==this._armatureData.parent){var e=this._cacheFrameIndex;if(this._animation.advanceTime(t),this._slotsDirty||this._zIndexDirty){if(this._slots.sort(i._onSortSlots),this._zIndexDirty)for(var n=0,a=this._slots.length;n0){for(var l=0,u=this._actions;l0){if(null!==(s=this.getBone(t))&&(s.invalidUpdate(),e))for(var i=0,n=this._slots;i0){if(null===a&&null===r){m=T;break}var b;null!==a&&((b=o?a.y-e:a.x-t)<0&&(b=-b),(null===m||bl)&&(l=b,c=r.x,_=r.y,g=T,null!==s&&(f=s.y)))}}return null!==m&&null!==a&&(a.x=u,a.y=p,null!==s&&(s.x=d)),null!==g&&null!==r&&(r.x=c,r.y=_,null!==s&&(s.y=f)),m},i.prototype.getBone=function(t){for(var e=0,i=this._bones;e=0&&null!==this._cachedFrameIndices){var e=this._cachedFrameIndices[t];if(e>=0&&this._cachedFrameIndex===e)this._transformDirty=!1;else if(e>=0)this._transformDirty=!0,this._cachedFrameIndex=e;else{if(this._hasConstraint)for(var i=0,n=this._armature._constraints;i=0?(this._transformDirty=!1,this._cachedFrameIndices[t]=this._cachedFrameIndex):(this._transformDirty=!0,this._cachedFrameIndex=-1)}}else{if(this._hasConstraint)for(var a=0,r=this._armature._constraints;a=0;this._localDirty&&this._updateGlobalTransformMatrix(o),o&&null!==this._cachedFrameIndices&&(this._cachedFrameIndex=this._cachedFrameIndices[t]=this._armature._armatureData.setCacheFrame(this.globalTransformMatrix,this.global))}else this._armature._armatureData.getCacheFrame(this.globalTransformMatrix,this.global,this._cachedFrameIndex);else this._childrenTransformDirty&&(this._childrenTransformDirty=!1);this._localDirty=!0},i.prototype.updateByConstraint=function(){this._localDirty&&(this._localDirty=!1,(this._transformDirty||null!==this._parent&&this._parent._childrenTransformDirty)&&this._updateGlobalTransformMatrix(!0),this._transformDirty=!0)},i.prototype.invalidUpdate=function(){this._transformDirty=!0},i.prototype.contains=function(t){if(t===this)return!1;for(var e=t;e!==this&&null!==e;)e=e.parent;return e===this},Object.defineProperty(i.prototype,"boneData",{get:function(){return this._boneData},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"visible",{get:function(){return this._visible},set:function(t){if(this._visible!==t){this._visible=t;for(var e=0,i=this._armature.getSlots();e=n)return this.globalTransformMatrix;if(g[d=7*(2*(o*h+o+h+h+_)+((r=i>this._kX*(t+n)+m)?1:0))]>0)y.copyFromArray(g,d+1);else{var v=_*(l+2),T=this._hullCache[4],b=this._hullCache[5],I=this._hullCache[2]-(h-_)*T,S=this._hullCache[3]-(h-_)*b,P=this._vertices;r?this._getAffineTransform(-n,m+p,800,p,P[v+l+2],P[v+l+3],I+T,S+b,P[v],P[v+1],e._helpTransform,y,!0):this._getAffineTransform(-a,m,800,p,I,S,P[v],P[v+1],I+T,S+b,e._helpTransform,y,!1),g[d]=1,g[d+1]=y.a,g[d+2]=y.b,g[d+3]=y.c,g[d+4]=y.d,g[d+5]=y.tx,g[d+6]=y.ty}}else if(t>=n){if(i<-n||i>=n)return this.globalTransformMatrix;if(g[d=7*(2*(o*h+o+_)+((r=i>this._kX*(t-a)+m)?1:0))]>0)y.copyFromArray(g,d+1);else{v=(_+1)*(l+2)-2,T=this._hullCache[4],b=this._hullCache[5],I=this._hullCache[0]+_*T,S=this._hullCache[1]+_*b,P=this._vertices;r?this._getAffineTransform(a,m+p,800,p,I+T,S+b,P[v+l+2],P[v+l+3],I,S,e._helpTransform,y,!0):this._getAffineTransform(n,m,800,p,P[v],P[v+1],I,S,P[v+l+2],P[v+l+3],e._helpTransform,y,!1),g[d]=1,g[d+1]=y.a,g[d+2]=y.b,g[d+3]=y.c,g[d+4]=y.d,g[d+5]=y.tx,g[d+6]=y.ty}}else if(i<-n){if(t<-n||t>=n)return this.globalTransformMatrix;if(g[d=7*(2*(o*h+c)+((r=i>this._kY*(t-f-u)-a)?1:0))]>0)y.copyFromArray(g,d+1);else{v=2*c,T=this._hullCache[10],b=this._hullCache[11],I=this._hullCache[8]+c*T,S=this._hullCache[9]+c*b,P=this._vertices;r?this._getAffineTransform(f+u,-n,u,800,P[v+2],P[v+3],P[v],P[v+1],I+T,S+b,e._helpTransform,y,!0):this._getAffineTransform(f,-a,u,800,I,S,I+T,S+b,P[v],P[v+1],e._helpTransform,y,!1),g[d]=1,g[d+1]=y.a,g[d+2]=y.b,g[d+3]=y.c,g[d+4]=y.d,g[d+5]=y.tx,g[d+6]=y.ty}}else if(i>=n){if(t<-n||t>=n)return this.globalTransformMatrix;if(g[d=7*(2*(o*h+o+h+c)+((r=i>this._kY*(t-f-u)+n)?1:0))]>0)y.copyFromArray(g,d+1);else{v=h*(l+2)+2*c,T=this._hullCache[10],b=this._hullCache[11],I=this._hullCache[6]-(o-c)*T,S=this._hullCache[7]-(o-c)*b,P=this._vertices;r?this._getAffineTransform(f+u,a,u,800,I+T,S+b,I,S,P[v+2],P[v+3],e._helpTransform,y,!0):this._getAffineTransform(f,n,u,800,P[v],P[v+1],P[v+2],P[v+3],I,S,e._helpTransform,y,!1),g[d]=1,g[d+1]=y.a,g[d+2]=y.b,g[d+3]=y.c,g[d+4]=y.d,g[d+5]=y.tx,g[d+6]=y.ty}}else if(g[d=7*(2*(o*_+c)+((r=i>this._k*(t-f-u)+m)?1:0))]>0)y.copyFromArray(g,d+1);else{v=2*c+_*(l+2),P=this._vertices;r?this._getAffineTransform(f+u,m+p,u,p,P[v+l+4],P[v+l+5],P[v+l+2],P[v+l+3],P[v+2],P[v+3],e._helpTransform,y,!0):this._getAffineTransform(f,m,u,p,P[v],P[v+1],P[v+2],P[v+3],P[v+l+2],P[v+l+3],e._helpTransform,y,!1),g[d]=1,g[d+1]=y.a,g[d+2]=y.b,g[d+3]=y.c,g[d+4]=y.d,g[d+5]=y.tx,g[d+6]=y.ty}return y},e.prototype.init=function(e,i){if(null===this._boneData){t.prototype.init.call(this,e,i);var n=e.segmentX,a=e.segmentY,r=this._armature.armatureData.parent.intArray[e.geometry.offset+0];this._dX=400/n,this._dY=400/a,this._k=-this._dY/this._dX,this._kX=-this._dY/800,this._kY=-800/this._dX,this._vertices.length=2*r,this._deformVertices.length=2*r,this._matrixCahce.length=2*(n*a+2*n+2*a)*7,this._hullCache.length=10;for(var s=0;s<2*r;++s)this._deformVertices[s]=0;null!==this._parent&&(0===this._parent.boneData.type?this._bone=this._parent:this._bone=this._parent._bone)}},e.prototype.update=function(t){if(t>=0&&null!==this._cachedFrameIndices){var i=this._cachedFrameIndices[t];if(i>=0&&this._cachedFrameIndex===i)this._transformDirty=!1;else if(i>=0)this._transformDirty=!0,this._cachedFrameIndex=i;else{if(this._hasConstraint)for(var n=0,a=this._armature._constraints;n=0?(this._transformDirty=!1,this._cachedFrameIndices[t]=this._cachedFrameIndex):(this._transformDirty=!0,this._cachedFrameIndex=-1)}}else{if(this._hasConstraint)for(var r=0,s=this._armature._constraints;r=0;this._localDirty&&this._updateGlobalTransformMatrix(u),u&&null!==this._cachedFrameIndices&&(this._cachedFrameIndex=this._cachedFrameIndices[t]=this._armature._armatureData.setCacheFrame(this.globalTransformMatrix,this.global))}else this._armature._armatureData.getCacheFrame(this.globalTransformMatrix,this.global,this._cachedFrameIndex);var p=2*this.global.x,c=2*this.global.y,_=e._helpPoint;this.globalTransformMatrix.transformPoint(1e3,-200,_),this._hullCache[0]=_.x,this._hullCache[1]=_.y,this._hullCache[2]=p-_.x,this._hullCache[3]=c-_.y,this.globalTransformMatrix.transformPoint(0,this._dY,_,!0),this._hullCache[4]=_.x,this._hullCache[5]=_.y,this.globalTransformMatrix.transformPoint(200,1e3,_),this._hullCache[6]=_.x,this._hullCache[7]=_.y,this._hullCache[8]=p-_.x,this._hullCache[9]=c-_.y,this.globalTransformMatrix.transformPoint(this._dX,0,_,!0),this._hullCache[10]=_.x,this._hullCache[11]=_.y}else this._childrenTransformDirty&&(this._childrenTransformDirty=!1);this._localDirty=!0},e}(t.Bone);t.Surface=e}(dragonBones||(dragonBones={})),function(t){var e=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.deformVertices=[],e}return __extends(e,t),e.toString=function(){return"[class dragonBones.DisplayFrame]"},e.prototype._onClear=function(){this.rawDisplayData=null,this.displayData=null,this.textureData=null,this.display=null,this.deformVertices.length=0},e.prototype.updateDeformVertices=function(){if(null!==this.rawDisplayData&&0===this.deformVertices.length){var t;if(2===this.rawDisplayData.type)t=this.rawDisplayData.geometry;else{if(4!==this.rawDisplayData.type)return;t=this.rawDisplayData.geometry}var e=0;e=null!==t.weight?2*t.weight.count:2*t.data.intArray[t.offset+0],this.deformVertices.length=e;for(var i=0,n=this.deformVertices.length;i=0&&this._displayIndex0)for(var s=0,o=a;s=0&&null!==this._cachedFrameIndices){var n=this._cachedFrameIndices[t];n>=0&&this._cachedFrameIndex===n?this._transformDirty=!1:n>=0?(this._transformDirty=!0,this._cachedFrameIndex=n):this._transformDirty||this._parent._childrenTransformDirty?(this._transformDirty=!0,this._cachedFrameIndex=-1):this._cachedFrameIndex>=0?(this._transformDirty=!1,this._cachedFrameIndices[t]=this._cachedFrameIndex):(this._transformDirty=!0,this._cachedFrameIndex=-1)}else(this._transformDirty||this._parent._childrenTransformDirty)&&(t=-1,this._transformDirty=!0,this._cachedFrameIndex=-1);if(this._transformDirty){if(this._cachedFrameIndex<0){var a=t>=0;this._updateGlobalTransformMatrix(a),a&&null!==this._cachedFrameIndices&&(this._cachedFrameIndex=this._cachedFrameIndices[t]=this._armature._armatureData.setCacheFrame(this.globalTransformMatrix,this.global))}else this._armature._armatureData.getCacheFrame(this.globalTransformMatrix,this.global,this._cachedFrameIndex);this._updateTransform(),this._transformDirty=!1}}},n.prototype.invalidUpdate=function(){this._displayDataDirty=!0,this._displayDirty=!0,this._transformDirty=!0},n.prototype.updateTransformAndMatrix=function(){this._transformDirty&&(this._updateGlobalTransformMatrix(!1),this._transformDirty=!1)},n.prototype.replaceRawDisplayData=function(t,e){if(void 0===e&&(e=-1),e<0)e=this._displayIndex<0?0:this._displayIndex;else if(e>=this._displayFrames.length)return;var i=this._displayFrames[e];if(i.rawDisplayData!==t){if(i.deformVertices.length=0,i.rawDisplayData=t,null===i.rawDisplayData){var n=this._armature._armatureData.defaultSkin;if(null!==n){var a=n.getDisplays(this._slotData.name);null!==a&&e=this._displayFrames.length)return;var i=this._displayFrames[e];i.displayData!==t&&i.rawDisplayData!==t&&(i.displayData=t,e===this._displayIndex&&(this._displayDataDirty=!0))},n.prototype.replaceTextureData=function(t,e){if(void 0===e&&(e=-1),e<0)e=this._displayIndex<0?0:this._displayIndex;else if(e>=this._displayFrames.length)return;var i=this._displayFrames[e];i.textureData!==t&&(i.textureData=t,e===this._displayIndex&&(this._displayDataDirty=!0))},n.prototype.replaceDisplay=function(e,i){if(void 0===i&&(i=-1),i<0)i=this._displayIndex<0?0:this._displayIndex;else if(i>=this._displayFrames.length)return;var n=this._displayFrames[i];if(n.display!==e){var a=n.display;n.display=e,null===a||a===this._rawDisplay||a===this._meshDisplay||this._hasDisplay(a)||a instanceof t.Armature||this._disposeDisplay(a,!0),null===e||e===this._rawDisplay||e===this._meshDisplay||this._hasDisplay(a)||e instanceof t.Armature||this._initDisplay(e,!0),i===this._displayIndex&&(this._displayDirty=!0)}},n.prototype.containsPoint=function(t,e){return null!==this._boundingBoxData&&(this.updateTransformAndMatrix(),n._helpMatrix.copyFrom(this.globalTransformMatrix),n._helpMatrix.invert(),n._helpMatrix.transformPoint(t,e,n._helpPoint),this._boundingBoxData.containsPoint(n._helpPoint.x,n._helpPoint.y))},n.prototype.intersectsSegment=function(t,e,i,a,r,s,o){if(void 0===r&&(r=null),void 0===s&&(s=null),void 0===o&&(o=null),null===this._boundingBoxData)return 0;this.updateTransformAndMatrix(),n._helpMatrix.copyFrom(this.globalTransformMatrix),n._helpMatrix.invert(),n._helpMatrix.transformPoint(t,e,n._helpPoint),t=n._helpPoint.x,e=n._helpPoint.y,n._helpMatrix.transformPoint(i,a,n._helpPoint),i=n._helpPoint.x,a=n._helpPoint.y;var h=this._boundingBoxData.intersectsSegment(t,e,i,a,r,s,o);return h>0&&(1===h||2===h?null!==r?(this.globalTransformMatrix.transformPoint(r.x,r.y,r),null!==s&&(s.x=r.x,s.y=r.y)):null!==s&&this.globalTransformMatrix.transformPoint(s.x,s.y,s):(null!==r&&this.globalTransformMatrix.transformPoint(r.x,r.y,r),null!==s&&this.globalTransformMatrix.transformPoint(s.x,s.y,s)),null!==o&&(this.globalTransformMatrix.transformPoint(Math.cos(o.x),Math.sin(o.x),n._helpPoint,!0),o.x=Math.atan2(n._helpPoint.y,n._helpPoint.x),this.globalTransformMatrix.transformPoint(Math.cos(o.y),Math.sin(o.y),n._helpPoint,!0),o.y=Math.atan2(n._helpPoint.y,n._helpPoint.x))),h},n.prototype.getDisplayFrameAt=function(t){return this._displayFrames[t]},Object.defineProperty(n.prototype,"visible",{get:function(){return this._visible},set:function(t){this._visible!==t&&(this._visible=t,this._updateVisible())},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"displayFrameCount",{get:function(){return this._displayFrames.length},set:function(i){var n=this._displayFrames.length;if(ni){for(a=n-1;ad)continue}for(;;V++){var R=f[V];if(!(L>R)){if(0===V)L/=R;else L=(L-(j=f[V-1]))/(R-j);break}}if(V!==c){c=V;var k=6*V;for(P=l[k],D=l[k+1],A=l[k+2],M=l[k+3],w=l[k+4],x=l[k+5],E=l[k+6],O=l[k+7],T=2*(m=.03*(P-2*A+w))+(y=.006*(3*(A-w)-P+E)),b=2*(g=.03*(D-2*M+x))+(v=.006*(3*(M-x)-D+O)),I=.3*(A-P)+m+.16666667*y,S=.3*(M-D)+g+.16666667*v,F=Math.sqrt(I*I+S*S),B[0]=F,k=1;k<8;k++)I+=T,S+=b,T+=y,b+=v,F+=Math.sqrt(I*I+S*S),B[k]=F;I+=T,S+=b,F+=Math.sqrt(I*I+S*S),B[8]=F,I+=T+y,S+=b+v,F+=Math.sqrt(I*I+S*S),B[9]=F,N=0}for(L*=F;;N++){var X=B[N];if(!(L>X)){var j;if(0===N)L/=X;else L=N+(L-(j=B[N-1]))/(X-j);break}}this.addCurvePosition(.1*L,P,D,A,M,w,x,E,O,s,G,i)}}else{var U=t.curveLengths;if(d=U[p-=h?1:2],n&&(_*=d),a)for(var H=0;Hd)continue}for(var z=0;;V++){var W=U[V];if(!(_>W)){if(0===V)z=_/W;else{var Y=U[V-1];z=(_-Y)/(W-Y)}break}}V!==c&&(c=V,h&&V===p?(this._computeVertices(u-4,4,0,l),this._computeVertices(0,4,4,l)):this._computeVertices(6*V+2,8,0,l)),this.addCurvePosition(z,l[0],l[1],l[2],l[3],l[4],l[5],l[6],l[7],s,G,i)}}},i.prototype.addCurvePosition=function(t,e,i,n,a,r,s,o,h,l,u,p){if(0===t)return l[u]=e,l[u+1]=i,void(l[u+2]=0);if(1===t)return l[u]=o,l[u+1]=h,void(l[u+2]=0);var c=1-t,_=c*c,d=t*t,f=_*c,m=_*t*3,g=c*d*3,y=t*d,v=f*e+m*n+g*r+y*o,T=f*i+m*a+g*s+y*h;l[u]=v,l[u+1]=T,l[u+2]=p?Math.atan2(T-(f*i+m*a+g*s),v-(f*e+m*n+g*r)):0},i.prototype.init=function(t,e){this._constraintData=t,this._armature=e;var i=t;this.pathOffset=i.pathDisplayData.geometry.offset,this.position=i.position,this.spacing=i.spacing,this.rotateOffset=i.rotateOffset,this.rotateMix=i.rotateMix,this.translateMix=i.translateMix,this._root=this._armature.getBone(i.root.name),this._target=this._armature.getBone(i.target.name),this._pathSlot=this._armature.getSlot(i.pathSlot.name);for(var n=0,a=i.bones.length;n0?t.Transform.DEG_RAD:-t.Transform.DEG_RAD;for(var A=this.rotateMix,M=this.translateMix,w=(f=0,3);f0){var N=E.a,L=E.b,R=E.c,k=E.d,X=void 0,j=void 0,U=void 0;if(X=u?I[w-1]:Math.atan2(C,O),X-=Math.atan2(L,N),b){j=Math.cos(X),U=Math.sin(X);var H=x._boneData.length;P+=(H*(j*N-U*L)-O)*A,D+=(H*(U*N+j*L)-C)*A}else X+=S;X>t.Transform.PI?X-=t.Transform.PI_D:X<-t.Transform.PI&&(X+=t.Transform.PI_D),X*=A,j=Math.cos(X),U=Math.sin(X),E.a=j*N-U*L,E.b=U*N+j*L,E.c=j*R-U*k,E.d=U*R+j*k}x.global.fromMatrix(E)}this.dirty=!1}}},i.prototype.invalidUpdate=function(){},i}(e);t.PathConstraint=n}(dragonBones||(dragonBones={})),function(t){var e=function(){function t(t){void 0===t&&(t=0),this.time=0,this.timeScale=1,this._systemTime=0,this._animatebles=[],this._clock=null,this.time=t,this._systemTime=.001*(new Date).getTime()}return t.prototype.advanceTime=function(t){t!=t&&(t=0);var e=.001*Date.now();if(t<0&&(t=e-this._systemTime),this._systemTime=e,1!==this.timeScale&&(t*=this.timeScale),0!==t){t<0?this.time-=t:this.time+=t;for(var i=0,n=0,a=this._animatebles.length;i0&&(this._animatebles[i-n]=r,this._animatebles[i]=null),r.advanceTime(t)):n++}if(n>0){for(a=this._animatebles.length;i=0&&(this._animatebles[e]=null,t.clock=null)},t.prototype.clear=function(){for(var t=0,e=this._animatebles;t0&&m._subFadeState>0)this._armature._dragonBones.bufferObject(m),this._animationStates.length=0,this._lastAnimationState=null;else{var r=m.animationData,s=r.cacheFrameRate;if(this._animationDirty&&s>0){this._animationDirty=!1;for(var o=0,h=this._armature.getBones();o0){var _=c.getDisplayFrameAt(0).rawDisplayData;if(null!==_&&_.parent===this._armature.armatureData.defaultSkin){c._cachedFrameIndices=r.getSlotCachedFrameIndices(c.name);continue}}c._cachedFrameIndices=null}}m.advanceTime(t,s)}else if(a>1){for(var d=0,f=0;d0&&m._subFadeState>0?(f++,this._armature._dragonBones.bufferObject(m),this._animationDirty=!0,this._lastAnimationState===m&&(this._lastAnimationState=null)):(f>0&&(this._animationStates[d-f]=m),m.advanceTime(t,0)),d===a-1&&f>0&&(this._animationStates.length-=f,null===this._lastAnimationState&&this._animationStates.length>0&&(this._lastAnimationState=this._animationStates[this._animationStates.length-1]))}this._armature._cacheFrameIndex=-1}else this._armature._cacheFrameIndex=-1},i.prototype.reset=function(){for(var t=0,e=this._animationStates;t0?(e.position<0?(e.position%=n.duration,e.position=n.duration-e.position):e.position===n.duration?e.position-=1e-6:e.position>n.duration&&(e.position%=n.duration),e.duration>0&&e.position+e.duration>n.duration&&(e.duration=n.duration-e.position),e.playTimes<0&&(e.playTimes=n.playTimes)):(e.playTimes=1,e.position=0,e.duration>0&&(e.duration=0)),0===e.duration&&(e.duration=-1),this._fadeOut(e);var o=t.BaseObject.borrowObject(t.AnimationState);if(o.init(this._armature,n,e),this._animationDirty=!0,this._armature._cacheFrameIndex=-1,this._animationStates.length>0){for(var h=!1,l=0,u=this._animationStates.length;lthis._animationStates[l].layer){h=!0,this._animationStates.splice(l,0,o);break}if(l!==u-1&&o.layer>this._animationStates[l+1].layer){h=!0,this._animationStates.splice(l+1,0,o);break}}h||this._animationStates.push(o)}else this._animationStates.push(o);for(var p=0,c=this._armature.getSlots();p0)this.playConfig(this._animationConfig);else if(null===this._lastAnimationState){var i=this._armature.armatureData.defaultAnimation;null!==i&&(this._animationConfig.animation=i.name,this.playConfig(this._animationConfig))}else this._lastAnimationState.isPlaying||this._lastAnimationState.isCompleted?(this._animationConfig.animation=this._lastAnimationState.name,this.playConfig(this._animationConfig)):this._lastAnimationState.play();return this._lastAnimationState},i.prototype.fadeIn=function(t,e,i,n,a,r){return void 0===e&&(e=-1),void 0===i&&(i=-1),void 0===n&&(n=0),void 0===a&&(a=null),void 0===r&&(r=3),this._animationConfig.clear(),this._animationConfig.fadeOutMode=r,this._animationConfig.playTimes=i,this._animationConfig.layer=n,this._animationConfig.fadeInTime=e,this._animationConfig.animation=t,this._animationConfig.group=null!==a?a:"",this.playConfig(this._animationConfig)},i.prototype.gotoAndPlayByTime=function(t,e,i){return void 0===e&&(e=0),void 0===i&&(i=-1),this._animationConfig.clear(),this._animationConfig.resetToPose=!0,this._animationConfig.playTimes=i,this._animationConfig.position=e,this._animationConfig.fadeInTime=0,this._animationConfig.animation=t,this.playConfig(this._animationConfig)},i.prototype.gotoAndPlayByFrame=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=-1),this._animationConfig.clear(),this._animationConfig.resetToPose=!0,this._animationConfig.playTimes=i,this._animationConfig.fadeInTime=0,this._animationConfig.animation=t;var n=t in this._animations?this._animations[t]:null;return null!==n&&(this._animationConfig.position=n.frameCount>0?n.duration*e/n.frameCount:0),this.playConfig(this._animationConfig)},i.prototype.gotoAndPlayByProgress=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=-1),this._animationConfig.clear(),this._animationConfig.resetToPose=!0,this._animationConfig.playTimes=i,this._animationConfig.fadeInTime=0,this._animationConfig.animation=t;var n=t in this._animations?this._animations[t]:null;return null!==n&&(this._animationConfig.position=n.duration*(e>0?e:0)),this.playConfig(this._animationConfig)},i.prototype.gotoAndStopByTime=function(t,e){void 0===e&&(e=0);var i=this.gotoAndPlayByTime(t,e,1);return null!==i&&i.stop(),i},i.prototype.gotoAndStopByFrame=function(t,e){void 0===e&&(e=0);var i=this.gotoAndPlayByFrame(t,e,1);return null!==i&&i.stop(),i},i.prototype.gotoAndStopByProgress=function(t,e){void 0===e&&(e=0);var i=this.gotoAndPlayByProgress(t,e,1);return null!==i&&i.stop(),i},i.prototype.getBlendState=function(e,i,n){e in this._blendStates||(this._blendStates[e]={});var a=this._blendStates[e];i in a||((a[i]=t.BaseObject.borrowObject(t.BlendState)).target=n);return a[i]},i.prototype.getState=function(t,e){void 0===e&&(e=-1);for(var i=this._animationStates.length;i--;){var n=this._animationStates[i];if(n.name===t&&(e<0||n.layer===e))return n}return null},i.prototype.hasAnimation=function(t){return t in this._animations},i.prototype.getStates=function(){return this._animationStates},Object.defineProperty(i.prototype,"isPlaying",{get:function(){for(var t=0,e=this._animationStates;t0},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"lastAnimationName",{get:function(){return null!==this._lastAnimationState?this._lastAnimationState.name:""},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"animationNames",{get:function(){return this._animationNames},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"animations",{get:function(){return this._animations},set:function(t){if(this._animations!==t){for(var e in this._animationNames.length=0,this._animations)delete this._animations[e];for(var e in t)this._animationNames.push(e),this._animations[e]=t[e]}},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"animationConfig",{get:function(){return this._animationConfig.clear(),this._animationConfig},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"lastAnimationState",{get:function(){return this._lastAnimationState},enumerable:!0,configurable:!0}),i}(t.BaseObject);t.Animation=e}(dragonBones||(dragonBones={})),function(t){var e=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t._boneMask=[],t._boneTimelines=[],t._boneBlendTimelines=[],t._slotTimelines=[],t._slotBlendTimelines=[],t._constraintTimelines=[],t._animationTimelines=[],t._poseTimelines=[],t._actionTimeline=null,t._zOrderTimeline=null,t}return __extends(n,e),n.toString=function(){return"[class dragonBones.AnimationState]"},n.prototype._onClear=function(){for(var t=0,e=this._boneTimelines;t=0&&(this._boneTimelines.splice(j,1),y.returnToPool()),(j=this._boneBlendTimelines.indexOf(y))>=0&&(this._boneBlendTimelines.splice(j,1),y.returnToPool())}for(var v={},T=[],b=0,I=this._slotTimelines;b=0&&(this._slotTimelines.splice(j,1),y.returnToPool()),(j=this._slotBlendTimelines.indexOf(y))>=0&&(this._slotBlendTimelines.splice(j,1),y.returnToPool())}},n.prototype._advanceFadeTime=function(e){var i=this._fadeState>0;if(this._subFadeState<0&&(this._subFadeState=0,null===this._parent&&this.actionEnabled)){var n=i?t.EventObject.FADE_OUT:t.EventObject.FADE_IN;if(this._armature.eventDispatcher.hasDBEventListener(n))(a=t.BaseObject.borrowObject(t.EventObject)).type=n,a.armature=this._armature,a.animationState=this,this._armature._dragonBones.bufferEvent(a)}if((e<0&&(e=-e),this._fadeTime+=e,this._fadeTime>=this.fadeTotalTime?(this._subFadeState=1,this._fadeProgress=i?0:1):this._fadeTime>0?this._fadeProgress=i?1-this._fadeTime/this.fadeTotalTime:this._fadeTime/this.fadeTotalTime:this._fadeProgress=i?1:0,this._subFadeState>0)&&(i||(this._playheadState|=1,this._fadeState=0),null===this._parent&&this.actionEnabled)){var a;n=i?t.EventObject.FADE_OUT_COMPLETE:t.EventObject.FADE_IN_COMPLETE;if(this._armature.eventDispatcher.hasDBEventListener(n))(a=t.BaseObject.borrowObject(t.EventObject)).type=n,a.armature=this._armature,a.animationState=this,this._armature._dragonBones.bufferEvent(a)}},n.prototype.init=function(e,i,n){if(null===this._armature){if(this._armature=e,this._animationData=i,this.resetToPose=n.resetToPose,this.additive=n.additive,this.displayControl=n.displayControl,this.actionEnabled=n.actionEnabled,this.blendType=i.blendType,this.layer=n.layer,this.playTimes=n.playTimes,this.timeScale=n.timeScale,this.fadeTotalTime=n.fadeInTime,this.autoFadeOutTime=n.autoFadeOutTime,this.name=n.name.length>0?n.name:n.animation,this.group=n.group,this._weight=n.weight,n.pauseFadeIn?this._playheadState=2:this._playheadState=3,n.duration<0?(this._position=0,this._duration=this._animationData.duration,0!==n.position?this.timeScale>=0?this._time=n.position:this._time=n.position-this._duration:this._time=0):(this._position=n.position,this._duration=n.duration,this._time=0),this.timeScale<0&&0===this._time&&(this._time=-1e-6),this.fadeTotalTime<=0&&(this._fadeProgress=.999999),n.boneMask.length>0){this._boneMask.length=n.boneMask.length;for(var a=0,r=this._boneMask.length;a0,a=!0,r=!0,s=this._time;if(this._weightResult=this._weight*this._fadeProgress,null!==this._parent&&(this._weightResult*=this._parent._weightResult),this._actionTimeline.playState<=0&&this._actionTimeline.update(s),0!==this._weight){if(n){var o=2*e;this._actionTimeline.currentTime=Math.floor(this._actionTimeline.currentTime*o)/o}if(null!==this._zOrderTimeline&&this._zOrderTimeline.playState<=0&&this._zOrderTimeline.update(s),n){var h=Math.floor(this._actionTimeline.currentTime*e);this._armature._cacheFrameIndex===h?(a=!1,r=!1):(this._armature._cacheFrameIndex=h,this._animationData.cachedFrames[h]?r=!1:this._animationData.cachedFrames[h]=!0)}if(a){var l=!1,u=null;if(r)for(var p=0,c=this._boneTimelines.length;p0){var m=100,g=100,y=null,v=null;for(p=0,c=this._animationTimelines.length;p=0?b0&&(this._subFadeState=0,this._poseTimelines.length>0)){for(var I=0,S=this._poseTimelines;I=0?(this._boneTimelines.splice(D,1),P.returnToPool()):(D=this._boneBlendTimelines.indexOf(P))>=0?(this._boneBlendTimelines.splice(D,1),P.returnToPool()):(D=this._slotTimelines.indexOf(P))>=0?(this._slotTimelines.splice(D,1),P.returnToPool()):(D=this._slotBlendTimelines.indexOf(P))>=0?(this._slotBlendTimelines.splice(D,1),P.returnToPool()):(D=this._constraintTimelines.indexOf(P))>=0&&(this._constraintTimelines.splice(D,1),P.returnToPool())}this._poseTimelines.length=0}this._actionTimeline.playState>0&&this.autoFadeOutTime>=0&&this.fadeOut(this.autoFadeOutTime)}}},n.prototype.play=function(){this._playheadState=3},n.prototype.stop=function(){this._playheadState&=1},n.prototype.fadeOut=function(t,e){if(void 0===e&&(e=!0),t<0&&(t=0),e&&(this._playheadState&=2),this._fadeState>0){if(t>this.fadeTotalTime-this._fadeTime)return}else{this._fadeState=1,this._subFadeState=-1,(t<=0||this._fadeProgress<=0)&&(this._fadeProgress=1e-6);for(var i=0,n=this._boneTimelines;i1e-6?t/this._fadeProgress:0,this._fadeTime=this.fadeTotalTime*(1-this._fadeProgress)},n.prototype.containsBoneMask=function(t){return 0===this._boneMask.length||this._boneMask.indexOf(t)>=0},n.prototype.addBoneMask=function(t,e){void 0===e&&(e=!0);var i=this._armature.getBone(t);if(null!==i){if(this._boneMask.indexOf(t)<0&&this._boneMask.push(t),e)for(var n=0,a=this._armature.getBones();n=0&&this._boneMask.splice(i,1),e){var n=this._armature.getBone(t);if(null!==n){var a=this._armature.getBones();if(this._boneMask.length>0)for(var r=0,s=a;r=0&&n.contains(o)&&this._boneMask.splice(h,1)}else for(var l=0,u=a;l0},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"isFadeComplete",{get:function(){return 0===this._fadeState},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"isPlaying",{get:function(){return 0!=(2&this._playheadState)&&this._actionTimeline.playState<=0},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"isCompleted",{get:function(){return this._actionTimeline.playState>0},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"currentPlayTimes",{get:function(){return this._actionTimeline.currentPlayTimes},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"totalTime",{get:function(){return this._duration},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"currentTime",{get:function(){return this._actionTimeline.currentTime},set:function(t){var e=this._actionTimeline.currentPlayTimes-(this._actionTimeline.playState>0?1:0);if((t<0||this._duration0&&e===this.playTimes-1&&t===this._duration&&null===this._parent&&(t=this._duration-1e-6),this._time!==t){this._time=t,this._actionTimeline.setCurrentTime(this._time),null!==this._zOrderTimeline&&(this._zOrderTimeline.playState=-1);for(var i=0,n=this._boneTimelines;i0){if(this.leftWeight>0){if(this.layer!==e){if(this.layerWeight>=this.leftWeight)return this.dirty++,this.layer=e,this.leftWeight=0,this.blendWeight=0,!1;this.layer=e,this.leftWeight-=this.layerWeight,this.layerWeight=0}return i*=this.leftWeight,this.dirty++,this.blendWeight=i,this.layerWeight+=this.blendWeight,!0}return!1}return this.dirty++,this.layer=e,this.leftWeight=1,this.blendWeight=i,this.layerWeight=i,!0},e.prototype.reset=function(){this.dirty=0,this.layer=0,this.leftWeight=0,this.layerWeight=0,this.blendWeight=0},e.BONE_TRANSFORM="boneTransform",e.BONE_ALPHA="boneAlpha",e.SURFACE="surface",e.SLOT_DEFORM="slotDeform",e.SLOT_ALPHA="slotAlpha",e.SLOT_Z_INDEX="slotZIndex",e}(t.BaseObject);t.BlendState=i}(dragonBones||(dragonBones={})),function(t){var e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype._onClear=function(){this.dirty=!1,this.playState=-1,this.currentPlayTimes=0,this.currentTime=-1,this.target=null,this._isTween=!1,this._valueOffset=0,this._frameValueOffset=0,this._frameOffset=0,this._frameRate=0,this._frameCount=0,this._frameIndex=-1,this._frameRateR=0,this._position=0,this._duration=0,this._timeScale=1,this._timeOffset=0,this._animationData=null,this._timelineData=null,this._armature=null,this._animationState=null,this._actionTimeline=null,this._frameArray=null,this._valueArray=null,this._timelineArray=null,this._frameIndices=null},e.prototype._setCurrentTime=function(t){var e=this.playState,i=this.currentPlayTimes,n=this.currentTime;if(null!==this._actionTimeline&&this._frameCount<=1)this.playState=this._actionTimeline.playState>=0?1:-1,this.currentPlayTimes=1,this.currentTime=this._actionTimeline.currentTime;else if(null===this._actionTimeline||1!==this._timeScale||0!==this._timeOffset){var a=this._animationState.playTimes,r=a*this._duration;t*=this._timeScale,0!==this._timeOffset&&(t+=this._timeOffset*this._animationData.duration),a>0&&(t>=r||t<=-r)?(this.playState<=0&&3===this._animationState._playheadState&&(this.playState=1),this.currentPlayTimes=a,this.currentTime=t<0?0:1===this.playState?this._duration+1e-6:this._duration):(0!==this.playState&&3===this._animationState._playheadState&&(this.playState=0),t<0?(t=-t,this.currentPlayTimes=Math.floor(t/this._duration),this.currentTime=this._duration-t%this._duration):(this.currentPlayTimes=Math.floor(t/this._duration),this.currentTime=t%this._duration)),this.currentTime+=this._position}else this.playState=this._actionTimeline.playState,this.currentPlayTimes=this._actionTimeline.currentPlayTimes,this.currentTime=this._actionTimeline.currentTime;return(this.currentPlayTimes!==i||this.currentTime!==n)&&((e<0&&this.playState!==e||this.playState<=0&&this.currentPlayTimes!==i)&&(this._frameIndex=-1),!0)},e.prototype.init=function(t,e,i){if(this._armature=t,this._animationState=e,this._timelineData=i,this._actionTimeline=this._animationState._actionTimeline,this===this._actionTimeline&&(this._actionTimeline=null),this._animationData=this._animationState.animationData,this._frameRate=this._animationData.parent.frameRate,this._frameRateR=1/this._frameRate,this._position=this._animationState._position,this._duration=this._animationState._duration,null!==this._timelineData){var n=this._animationData.parent.parent;this._frameArray=n.frameArray,this._timelineArray=n.timelineArray,this._frameIndices=n.frameIndices,this._frameCount=this._timelineArray[this._timelineData.offset+2],this._frameValueOffset=this._timelineArray[this._timelineData.offset+4],this._timeScale=100/this._timelineArray[this._timelineData.offset+0],this._timeOffset=.01*this._timelineArray[this._timelineData.offset+1]}},e.prototype.fadeOut=function(){this.dirty=!1},e.prototype.update=function(t){if(this._setCurrentTime(t)){if(this._frameCount>1){var e=Math.floor(this.currentTime*this._frameRate),i=this._frameIndices[this._timelineData.frameIndicesOffset+e];this._frameIndex!==i&&(this._frameIndex=i,this._frameOffset=this._animationData.frameOffset+this._timelineArray[this._timelineData.offset+5+this._frameIndex],this._onArriveAtFrame())}else this._frameIndex<0&&(this._frameIndex=0,null!==this._timelineData&&(this._frameOffset=this._animationData.frameOffset+this._timelineArray[this._timelineData.offset+5]),this._onArriveAtFrame());(this._isTween||this.dirty)&&this._onUpdateFrame()}},e.prototype.blend=function(t){},e}(t.BaseObject);t.TimelineState=e;var i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e._getEasingValue=function(t,e,i){var n=e;switch(t){case 3:n=Math.pow(e,2);break;case 4:n=1-Math.pow(1-e,2);break;case 5:n=.5*(1-Math.cos(e*Math.PI))}return(n-e)*i+e},e._getEasingCurveValue=function(t,e,i,n){if(t<=0)return 0;if(t>=1)return 1;var a=i>0,r=i+1,s=Math.floor(t*r),o=0,h=0;return a?(o=0===s?0:e[n+s-1],h=s===r-1?1e4:e[n+s]):(o=e[n+s-1],h=e[n+s]),1e-4*(o+(h-o)*(t*r-s))},e.prototype._onClear=function(){t.prototype._onClear.call(this),this._tweenType=0,this._curveCount=0,this._framePosition=0,this._frameDurationR=0,this._tweenEasing=0,this._tweenProgress=0,this._valueScale=1},e.prototype._onArriveAtFrame=function(){if(this._frameCount>1&&(this._frameIndex!==this._frameCount-1||0===this._animationState.playTimes||this._animationState.currentPlayTimes0?1/e:0}else this.dirty=!0,this._isTween=!1},e.prototype._onUpdateFrame=function(){this._isTween&&(this.dirty=!0,this._tweenProgress=(this.currentTime-this._framePosition)*this._frameDurationR,2===this._tweenType?this._tweenProgress=e._getEasingCurveValue(this._tweenProgress,this._frameArray,this._curveCount,this._frameOffset+3):1!==this._tweenType&&(this._tweenProgress=e._getEasingValue(this._tweenType,this._tweenProgress,this._tweenEasing)))},e}(e);t.TweenTimelineState=i;var n=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype._onClear=function(){t.prototype._onClear.call(this),this._current=0,this._difference=0,this._result=0},e.prototype._onArriveAtFrame=function(){if(t.prototype._onArriveAtFrame.call(this),null!==this._timelineData){var e=this._valueScale,i=this._valueArray,n=this._valueOffset+this._frameValueOffset+this._frameIndex;if(this._isTween){var a=this._frameIndex===this._frameCount-1?this._valueOffset+this._frameValueOffset:n+1;1===e?(this._current=i[n],this._difference=i[a]-this._current):(this._current=i[n]*e,this._difference=i[a]*e-this._current)}else this._result=i[n]*e}else this._result=0},e.prototype._onUpdateFrame=function(){t.prototype._onUpdateFrame.call(this),this._isTween&&(this._result=this._current+this._difference*this._tweenProgress)},e}(i);t.SingleValueTimelineState=n;var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype._onClear=function(){t.prototype._onClear.call(this),this._currentA=0,this._currentB=0,this._differenceA=0,this._differenceB=0,this._resultA=0,this._resultB=0},e.prototype._onArriveAtFrame=function(){if(t.prototype._onArriveAtFrame.call(this),null!==this._timelineData){var e=this._valueScale,i=this._valueArray,n=this._valueOffset+this._frameValueOffset+2*this._frameIndex;if(this._isTween){var a=this._frameIndex===this._frameCount-1?this._valueOffset+this._frameValueOffset:n+2;1===e?(this._currentA=i[n],this._currentB=i[n+1],this._differenceA=i[a]-this._currentA,this._differenceB=i[a+1]-this._currentB):(this._currentA=i[n]*e,this._currentB=i[n+1]*e,this._differenceA=i[a]*e-this._currentA,this._differenceB=i[a+1]*e-this._currentB)}else this._resultA=i[n]*e,this._resultB=i[n+1]*e}else this._resultA=0,this._resultB=0},e.prototype._onUpdateFrame=function(){t.prototype._onUpdateFrame.call(this),this._isTween&&(this._resultA=this._currentA+this._differenceA*this._tweenProgress,this._resultB=this._currentB+this._differenceB*this._tweenProgress)},e}(i);t.DoubleValueTimelineState=a;var r=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._rd=[],e}return __extends(e,t),e.prototype._onClear=function(){t.prototype._onClear.call(this),this._valueCount=0,this._rd.length=0},e.prototype._onArriveAtFrame=function(){t.prototype._onArriveAtFrame.call(this);var e=this._valueCount,i=this._rd;if(null!==this._timelineData){var n=this._valueScale,a=this._valueArray,r=this._valueOffset+this._frameValueOffset+this._frameIndex*e;if(this._isTween){var s=this._frameIndex===this._frameCount-1?this._valueOffset+this._frameValueOffset:r+e;if(1===n)for(var o=0;o0&&s.hasDBEventListener(t.EventObject.COMPLETE)&&((u=t.BaseObject.borrowObject(t.EventObject)).type=t.EventObject.COMPLETE,u.armature=this._armature,u.animationState=this._animationState)),this._frameCount>1){var p=this._timelineData,c=Math.floor(this.currentTime*this._frameRate),_=this._frameIndices[p.frameIndicesOffset+c];if(this._frameIndex!==_){var d=this._frameIndex;if(this._frameIndex=_,null!==this._timelineArray)if(this._frameOffset=this._animationData.frameOffset+this._timelineArray[p.offset+5+this._frameIndex],h){if(d<0){var f=Math.floor(a*this._frameRate);d=this._frameIndices[p.frameIndicesOffset+f],this.currentPlayTimes===n&&d===_&&(d=-1)}for(;d>=0;){var m=this._animationData.frameOffset+this._timelineArray[p.offset+5+d],g=this._frameArray[m]/this._frameRate;if(this._position<=g&&g<=this._position+this._duration&&this._onCrossFrame(d),null!==l&&0===d&&(this._armature._dragonBones.bufferEvent(l),l=null),d>0?d--:d=this._frameCount-1,d===_)break}}else{if(d<0){f=Math.floor(a*this._frameRate);d=this._frameIndices[p.frameIndicesOffset+f];m=this._animationData.frameOffset+this._timelineArray[p.offset+5+d],g=this._frameArray[m]/this._frameRate;this.currentPlayTimes===n&&(a<=g?d>0?d--:d=this._frameCount-1:d===_&&(d=-1))}for(;d>=0;){d=0&&(this._frameArray[this._frameOffset+1]>0?this._armature._sortZOrder(this._frameArray,this._frameOffset+2):this._armature._sortZOrder(null,0))},e.prototype._onUpdateFrame=function(){},e}(t.TimelineState);t.ZOrderTimelineState=i;var n=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return __extends(i,e),i.toString=function(){return"[class dragonBones.BoneAllTimelineState]"},i.prototype._onArriveAtFrame=function(){e.prototype._onArriveAtFrame.call(this),this._isTween&&this._frameIndex===this._frameCount-1&&(this._rd[2]=t.Transform.normalizeRadian(this._rd[2]),this._rd[3]=t.Transform.normalizeRadian(this._rd[3])),null===this._timelineData&&(this._rd[4]=1,this._rd[5]=1)},i.prototype.init=function(t,i,n){e.prototype.init.call(this,t,i,n),this._valueOffset=this._animationData.frameFloatOffset,this._valueCount=6,this._valueArray=this._animationData.parent.parent.frameFloatArray},i.prototype.fadeOut=function(){this.dirty=!1,this._rd[2]=t.Transform.normalizeRadian(this._rd[2]),this._rd[3]=t.Transform.normalizeRadian(this._rd[3])},i.prototype.blend=function(t){var e=this._armature.armatureData.scale,i=this._rd,n=this.target,a=n.target,r=n.blendWeight,s=a.animationPose;n.dirty>1?(s.x+=i[0]*r*e,s.y+=i[1]*r*e,s.rotation+=i[2]*r,s.skew+=i[3]*r,s.scaleX+=(i[4]-1)*r,s.scaleY+=(i[5]-1)*r):(s.x=i[0]*r*e,s.y=i[1]*r*e,s.rotation=i[2]*r,s.skew=i[3]*r,s.scaleX=(i[4]-1)*r+1,s.scaleY=(i[5]-1)*r+1),(t||this.dirty)&&(this.dirty=!1,a._transformDirty=!0)},i}(t.MutilpleValueTimelineState);t.BoneAllTimelineState=n;var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.toString=function(){return"[class dragonBones.BoneTranslateTimelineState]"},e.prototype.init=function(e,i,n){t.prototype.init.call(this,e,i,n),this._valueOffset=this._animationData.frameFloatOffset,this._valueScale=this._armature.armatureData.scale,this._valueArray=this._animationData.parent.parent.frameFloatArray},e.prototype.blend=function(t){var e=this.target,i=e.target,n=e.blendWeight,a=i.animationPose;e.dirty>1?(a.x+=this._resultA*n,a.y+=this._resultB*n):1!==n?(a.x=this._resultA*n,a.y=this._resultB*n):(a.x=this._resultA,a.y=this._resultB),(t||this.dirty)&&(this.dirty=!1,i._transformDirty=!0)},e}(t.DoubleValueTimelineState);t.BoneTranslateTimelineState=a;var r=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return __extends(i,e),i.toString=function(){return"[class dragonBones.BoneRotateTimelineState]"},i.prototype._onArriveAtFrame=function(){e.prototype._onArriveAtFrame.call(this),this._isTween&&this._frameIndex===this._frameCount-1&&(this._differenceA=t.Transform.normalizeRadian(this._differenceA),this._differenceB=t.Transform.normalizeRadian(this._differenceB))},i.prototype.init=function(t,i,n){e.prototype.init.call(this,t,i,n),this._valueOffset=this._animationData.frameFloatOffset,this._valueArray=this._animationData.parent.parent.frameFloatArray},i.prototype.fadeOut=function(){this.dirty=!1,this._resultA=t.Transform.normalizeRadian(this._resultA),this._resultB=t.Transform.normalizeRadian(this._resultB)},i.prototype.blend=function(t){var e=this.target,i=e.target,n=e.blendWeight,a=i.animationPose;e.dirty>1?(a.rotation+=this._resultA*n,a.skew+=this._resultB*n):1!==n?(a.rotation=this._resultA*n,a.skew=this._resultB*n):(a.rotation=this._resultA,a.skew=this._resultB),(t||this.dirty)&&(this.dirty=!1,i._transformDirty=!0)},i}(t.DoubleValueTimelineState);t.BoneRotateTimelineState=r;var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.toString=function(){return"[class dragonBones.BoneScaleTimelineState]"},e.prototype._onArriveAtFrame=function(){t.prototype._onArriveAtFrame.call(this),null===this._timelineData&&(this._resultA=1,this._resultB=1)},e.prototype.init=function(e,i,n){t.prototype.init.call(this,e,i,n),this._valueOffset=this._animationData.frameFloatOffset,this._valueArray=this._animationData.parent.parent.frameFloatArray},e.prototype.blend=function(t){var e=this.target,i=e.target,n=e.blendWeight,a=i.animationPose;e.dirty>1?(a.scaleX+=(this._resultA-1)*n,a.scaleY+=(this._resultB-1)*n):1!==n?(a.scaleX=(this._resultA-1)*n+1,a.scaleY=(this._resultB-1)*n+1):(a.scaleX=this._resultA,a.scaleY=this._resultB),(t||this.dirty)&&(this.dirty=!1,i._transformDirty=!0)},e}(t.DoubleValueTimelineState);t.BoneScaleTimelineState=s;var o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.toString=function(){return"[class dragonBones.SurfaceTimelineState]"},e.prototype._onClear=function(){t.prototype._onClear.call(this),this._deformCount=0,this._deformOffset=0,this._sameValueOffset=0},e.prototype.init=function(e,i,n){if(t.prototype.init.call(this,e,i,n),null!==this._timelineData){var a=this._animationData.parent.parent,r=a.frameIntArray,s=this._animationData.frameIntOffset+this._timelineArray[this._timelineData.offset+3];this._valueOffset=this._animationData.frameFloatOffset,this._valueCount=r[s+2],this._deformCount=r[s+1],this._deformOffset=r[s+3],this._sameValueOffset=r[s+4]+this._animationData.frameFloatOffset,this._valueScale=this._armature.armatureData.scale,this._valueArray=a.frameFloatArray,this._rd.length=2*this._valueCount}else this._deformCount=this.target.target._deformVertices.length},e.prototype.blend=function(t){var e=this.target,i=e.target,n=e.blendWeight,a=i._deformVertices,r=this._valueArray;if(null!==r)for(var s=this._valueCount,o=this._deformOffset,h=this._sameValueOffset,l=this._rd,u=0;u1?a[u]+=p*n:a[u]=p*n}else if(1===e.dirty)for(u=0;u1?(i._alpha+=this._result*n,i._alpha>1&&(i._alpha=1)):i._alpha=this._result*n,(t||this.dirty)&&(this.dirty=!1,this._armature._alphaDirty=!0)},e}(t.SingleValueTimelineState);t.AlphaTimelineState=h;var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.toString=function(){return"[class dragonBones.SlotDisplayTimelineState]"},e.prototype._onArriveAtFrame=function(){if(this.playState>=0){var t=this.target,e=null!==this._timelineData?this._frameArray[this._frameOffset+1]:t._slotData.displayIndex;t.displayIndex!==e&&t._setDisplayIndex(e,!0)}},e.prototype._onUpdateFrame=function(){},e}(t.TimelineState);t.SlotDisplayTimelineState=l;var u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._current=[0,0,0,0,0,0,0,0],e._difference=[0,0,0,0,0,0,0,0],e._result=[0,0,0,0,0,0,0,0],e}return __extends(e,t),e.toString=function(){return"[class dragonBones.SlotColorTimelineState]"},e.prototype._onArriveAtFrame=function(){if(t.prototype._onArriveAtFrame.call(this),null!==this._timelineData){var e=this._animationData.parent.parent,i=e.colorArray,n=e.frameIntArray,a=this._animationData.frameIntOffset+this._frameValueOffset+this._frameIndex,r=n[a];r<0&&(r+=65536),this._isTween?(this._current[0]=i[r++],this._current[1]=i[r++],this._current[2]=i[r++],this._current[3]=i[r++],this._current[4]=i[r++],this._current[5]=i[r++],this._current[6]=i[r++],this._current[7]=i[r++],(r=this._frameIndex===this._frameCount-1?n[this._animationData.frameIntOffset+this._frameValueOffset]:n[a+1])<0&&(r+=65536),this._difference[0]=i[r++]-this._current[0],this._difference[1]=i[r++]-this._current[1],this._difference[2]=i[r++]-this._current[2],this._difference[3]=i[r++]-this._current[3],this._difference[4]=i[r++]-this._current[4],this._difference[5]=i[r++]-this._current[5],this._difference[6]=i[r++]-this._current[6],this._difference[7]=i[r++]-this._current[7]):(this._result[0]=.01*i[r++],this._result[1]=.01*i[r++],this._result[2]=.01*i[r++],this._result[3]=.01*i[r++],this._result[4]=i[r++],this._result[5]=i[r++],this._result[6]=i[r++],this._result[7]=i[r++])}else{var s=this.target.slotData.color;this._result[0]=s.alphaMultiplier,this._result[1]=s.redMultiplier,this._result[2]=s.greenMultiplier,this._result[3]=s.blueMultiplier,this._result[4]=s.alphaOffset,this._result[5]=s.redOffset,this._result[6]=s.greenOffset,this._result[7]=s.blueOffset}},e.prototype._onUpdateFrame=function(){t.prototype._onUpdateFrame.call(this),this._isTween&&(this._result[0]=.01*(this._current[0]+this._difference[0]*this._tweenProgress),this._result[1]=.01*(this._current[1]+this._difference[1]*this._tweenProgress),this._result[2]=.01*(this._current[2]+this._difference[2]*this._tweenProgress),this._result[3]=.01*(this._current[3]+this._difference[3]*this._tweenProgress),this._result[4]=this._current[4]+this._difference[4]*this._tweenProgress,this._result[5]=this._current[5]+this._difference[5]*this._tweenProgress,this._result[6]=this._current[6]+this._difference[6]*this._tweenProgress,this._result[7]=this._current[7]+this._difference[7]*this._tweenProgress)},e.prototype.fadeOut=function(){this._isTween=!1},e.prototype.update=function(e){if(t.prototype.update.call(this,e),this._isTween||this.dirty){var i=this.target,n=i._colorTransform;if(0!==this._animationState._fadeState||0!==this._animationState._subFadeState){if(n.alphaMultiplier!==this._result[0]||n.redMultiplier!==this._result[1]||n.greenMultiplier!==this._result[2]||n.blueMultiplier!==this._result[3]||n.alphaOffset!==this._result[4]||n.redOffset!==this._result[5]||n.greenOffset!==this._result[6]||n.blueOffset!==this._result[7]){var a=Math.pow(this._animationState._fadeProgress,4);n.alphaMultiplier+=(this._result[0]-n.alphaMultiplier)*a,n.redMultiplier+=(this._result[1]-n.redMultiplier)*a,n.greenMultiplier+=(this._result[2]-n.greenMultiplier)*a,n.blueMultiplier+=(this._result[3]-n.blueMultiplier)*a,n.alphaOffset+=(this._result[4]-n.alphaOffset)*a,n.redOffset+=(this._result[5]-n.redOffset)*a,n.greenOffset+=(this._result[6]-n.greenOffset)*a,n.blueOffset+=(this._result[7]-n.blueOffset)*a,i._colorDirty=!0}}else this.dirty&&(this.dirty=!1,n.alphaMultiplier===this._result[0]&&n.redMultiplier===this._result[1]&&n.greenMultiplier===this._result[2]&&n.blueMultiplier===this._result[3]&&n.alphaOffset===this._result[4]&&n.redOffset===this._result[5]&&n.greenOffset===this._result[6]&&n.blueOffset===this._result[7]||(n.alphaMultiplier=this._result[0],n.redMultiplier=this._result[1],n.greenMultiplier=this._result[2],n.blueMultiplier=this._result[3],n.alphaOffset=this._result[4],n.redOffset=this._result[5],n.greenOffset=this._result[6],n.blueOffset=this._result[7],i._colorDirty=!0))}},e}(t.TweenTimelineState);t.SlotColorTimelineState=u;var p=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.toString=function(){return"[class dragonBones.SlotZIndexTimelineState]"},e.prototype._onArriveAtFrame=function(){if(t.prototype._onArriveAtFrame.call(this),null===this._timelineData){var e=this.target.target;this._result=e.slotData.zIndex}},e.prototype.init=function(e,i,n){t.prototype.init.call(this,e,i,n),this._valueOffset=this._animationData.frameIntOffset,this._valueArray=this._animationData.parent.parent.frameIntArray},e.prototype.blend=function(t){var e=this.target,i=e.target,n=e.blendWeight;e.dirty>1?i._zIndex+=this._result*n:i._zIndex=this._result*n,(t||this.dirty)&&(this.dirty=!1,this._armature._zIndexDirty=!0)},e}(t.SingleValueTimelineState);t.SlotZIndexTimelineState=p;var c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.toString=function(){return"[class dragonBones.DeformTimelineState]"},e.prototype._onClear=function(){t.prototype._onClear.call(this),this.geometryOffset=0,this.displayFrame=null,this._deformCount=0,this._deformOffset=0,this._sameValueOffset=0},e.prototype.init=function(e,i,n){if(t.prototype.init.call(this,e,i,n),null!==this._timelineData){var a=this._animationData.frameIntOffset+this._timelineArray[this._timelineData.offset+3],r=this._animationData.parent.parent,s=r.frameIntArray,o=this.target.target;this.geometryOffset=s[a+0],this.geometryOffset<0&&(this.geometryOffset+=65536);for(var h=0,l=o.displayFrameCount;h1?a[u]+=p*n:a[u]=p*n}else if(1===e.dirty)for(u=0;u0,e._weight=this._currentB;else{var i=e._constraintData;e._bendPositive=i.bendPositive,e._weight=i.weight}e.invalidUpdate(),this.dirty=!1},e.prototype.init=function(e,i,n){t.prototype.init.call(this,e,i,n),this._valueOffset=this._animationData.frameIntOffset,this._valueScale=.01,this._valueArray=this._animationData.parent.parent.frameIntArray},e}(t.DoubleValueTimelineState);t.IKConstraintTimelineState=_;var d=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.toString=function(){return"[class dragonBones.AnimationProgressTimelineState]"},e.prototype._onUpdateFrame=function(){t.prototype._onUpdateFrame.call(this);var e=this.target;null!==e._parent&&(e.currentTime=this._result*e.totalTime),this.dirty=!1},e.prototype.init=function(e,i,n){t.prototype.init.call(this,e,i,n),this._valueOffset=this._animationData.frameIntOffset,this._valueScale=1e-4,this._valueArray=this._animationData.parent.parent.frameIntArray},e}(t.SingleValueTimelineState);t.AnimationProgressTimelineState=d;var f=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.toString=function(){return"[class dragonBones.AnimationWeightTimelineState]"},e.prototype._onUpdateFrame=function(){t.prototype._onUpdateFrame.call(this);var e=this.target;null!==e._parent&&(e.weight=this._result),this.dirty=!1},e.prototype.init=function(e,i,n){t.prototype.init.call(this,e,i,n),this._valueOffset=this._animationData.frameIntOffset,this._valueScale=1e-4,this._valueArray=this._animationData.parent.parent.frameIntArray},e}(t.SingleValueTimelineState);t.AnimationWeightTimelineState=f;var m=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.toString=function(){return"[class dragonBones.AnimationParametersTimelineState]"},e.prototype._onUpdateFrame=function(){t.prototype._onUpdateFrame.call(this);var e=this.target;null!==e._parent&&(e.parameterX=this._resultA,e.parameterY=this._resultB),this.dirty=!1},e.prototype.init=function(e,i,n){t.prototype.init.call(this,e,i,n),this._valueOffset=this._animationData.frameIntOffset,this._valueScale=1e-4,this._valueArray=this._animationData.parent.parent.frameIntArray},e}(t.DoubleValueTimelineState);t.AnimationParametersTimelineState=m}(dragonBones||(dragonBones={})),function(t){var e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.actionDataToInstance=function(t,i,n){0===t.type?i.type=e.FRAME_EVENT:i.type=10===t.type?e.FRAME_EVENT:e.SOUND_EVENT,i.name=t.name,i.armature=n,i.actionData=t,i.data=t.data,null!==t.bone&&(i.bone=n.getBone(t.bone.name)),null!==t.slot&&(i.slot=n.getSlot(t.slot.name))},e.toString=function(){return"[class dragonBones.EventObject]"},e.prototype._onClear=function(){this.time=0,this.type="",this.name="",this.armature=null,this.bone=null,this.slot=null,this.animationState=null,this.actionData=null,this.data=null},e.START="start",e.LOOP_COMPLETE="loopComplete",e.COMPLETE="complete",e.FADE_IN="fadeIn",e.FADE_IN_COMPLETE="fadeInComplete",e.FADE_OUT="fadeOut",e.FADE_OUT_COMPLETE="fadeOutComplete",e.FRAME_EVENT="frameEvent",e.SOUND_EVENT="soundEvent",e}(t.BaseObject);t.EventObject=e}(dragonBones||(dragonBones={})),function(t){var e=function(){function t(){}return t._getArmatureType=function(t){switch(t.toLowerCase()){case"stage":return 2;case"armature":return 0;case"movieclip":return 1;default:return 0}},t._getBoneType=function(t){switch(t.toLowerCase()){case"bone":return 0;case"surface":return 1;default:return 0}},t._getPositionMode=function(t){switch(t.toLocaleLowerCase()){case"percent":return 1;case"fixed":return 0;default:return 1}},t._getSpacingMode=function(t){switch(t.toLocaleLowerCase()){case"length":return 0;case"percent":return 2;case"fixed":return 1;default:return 0}},t._getRotateMode=function(t){switch(t.toLocaleLowerCase()){case"tangent":return 0;case"chain":return 1;case"chainscale":return 2;default:return 0}},t._getDisplayType=function(t){switch(t.toLowerCase()){case"image":return 0;case"mesh":return 2;case"armature":return 1;case"boundingbox":return 3;case"path":return 4;default:return 0}},t._getBoundingBoxType=function(t){switch(t.toLowerCase()){case"rectangle":return 0;case"ellipse":return 1;case"polygon":return 2;default:return 0}},t._getBlendMode=function(t){switch(t.toLowerCase()){case"normal":return 0;case"add":return 1;case"alpha":return 2;case"darken":return 3;case"difference":return 4;case"erase":return 5;case"hardlight":return 6;case"invert":return 7;case"layer":return 8;case"lighten":return 9;case"multiply":return 10;case"overlay":return 11;case"screen":return 12;case"subtract":return 13;default:return 0}},t._getAnimationBlendType=function(t){switch(t.toLowerCase()){case"none":return 0;case"1d":return 1;default:return 0}},t._getActionType=function(t){switch(t.toLowerCase()){case"play":return 0;case"frame":return 10;case"sound":return 11;default:return 0}},t.DATA_VERSION_2_3="2.3",t.DATA_VERSION_3_0="3.0",t.DATA_VERSION_4_0="4.0",t.DATA_VERSION_4_5="4.5",t.DATA_VERSION_5_0="5.0",t.DATA_VERSION_5_5="5.5",t.DATA_VERSION_5_6="5.6",t.DATA_VERSION=t.DATA_VERSION_5_6,t.DATA_VERSIONS=[t.DATA_VERSION_4_0,t.DATA_VERSION_4_5,t.DATA_VERSION_5_0,t.DATA_VERSION_5_5,t.DATA_VERSION_5_6],t.TEXTURE_ATLAS="textureAtlas",t.SUB_TEXTURE="SubTexture",t.FORMAT="format",t.IMAGE_PATH="imagePath",t.WIDTH="width",t.HEIGHT="height",t.ROTATED="rotated",t.FRAME_X="frameX",t.FRAME_Y="frameY",t.FRAME_WIDTH="frameWidth",t.FRAME_HEIGHT="frameHeight",t.DRADON_BONES="dragonBones",t.USER_DATA="userData",t.ARMATURE="armature",t.CANVAS="canvas",t.BONE="bone",t.SURFACE="surface",t.SLOT="slot",t.CONSTRAINT="constraint",t.SKIN="skin",t.DISPLAY="display",t.FRAME="frame",t.IK="ik",t.PATH_CONSTRAINT="path",t.ANIMATION="animation",t.TIMELINE="timeline",t.FFD="ffd",t.TRANSLATE_FRAME="translateFrame",t.ROTATE_FRAME="rotateFrame",t.SCALE_FRAME="scaleFrame",t.DISPLAY_FRAME="displayFrame",t.COLOR_FRAME="colorFrame",t.DEFAULT_ACTIONS="defaultActions",t.ACTIONS="actions",t.EVENTS="events",t.INTS="ints",t.FLOATS="floats",t.STRINGS="strings",t.TRANSFORM="transform",t.PIVOT="pivot",t.AABB="aabb",t.COLOR="color",t.VERSION="version",t.COMPATIBLE_VERSION="compatibleVersion",t.FRAME_RATE="frameRate",t.TYPE="type",t.SUB_TYPE="subType",t.NAME="name",t.PARENT="parent",t.TARGET="target",t.STAGE="stage",t.SHARE="share",t.PATH="path",t.LENGTH="length",t.DISPLAY_INDEX="displayIndex",t.Z_ORDER="zOrder",t.Z_INDEX="zIndex",t.BLEND_MODE="blendMode",t.INHERIT_TRANSLATION="inheritTranslation",t.INHERIT_ROTATION="inheritRotation",t.INHERIT_SCALE="inheritScale",t.INHERIT_REFLECTION="inheritReflection",t.INHERIT_ANIMATION="inheritAnimation",t.INHERIT_DEFORM="inheritDeform",t.SEGMENT_X="segmentX",t.SEGMENT_Y="segmentY",t.BEND_POSITIVE="bendPositive",t.CHAIN="chain",t.WEIGHT="weight",t.BLEND_TYPE="blendType",t.FADE_IN_TIME="fadeInTime",t.PLAY_TIMES="playTimes",t.SCALE="scale",t.OFFSET="offset",t.POSITION="position",t.DURATION="duration",t.TWEEN_EASING="tweenEasing",t.TWEEN_ROTATE="tweenRotate",t.TWEEN_SCALE="tweenScale",t.CLOCK_WISE="clockwise",t.CURVE="curve",t.SOUND="sound",t.EVENT="event",t.ACTION="action",t.X="x",t.Y="y",t.SKEW_X="skX",t.SKEW_Y="skY",t.SCALE_X="scX",t.SCALE_Y="scY",t.VALUE="value",t.ROTATE="rotate",t.SKEW="skew",t.ALPHA="alpha",t.ALPHA_OFFSET="aO",t.RED_OFFSET="rO",t.GREEN_OFFSET="gO",t.BLUE_OFFSET="bO",t.ALPHA_MULTIPLIER="aM",t.RED_MULTIPLIER="rM",t.GREEN_MULTIPLIER="gM",t.BLUE_MULTIPLIER="bM",t.UVS="uvs",t.VERTICES="vertices",t.TRIANGLES="triangles",t.WEIGHTS="weights",t.SLOT_POSE="slotPose",t.BONE_POSE="bonePose",t.BONES="bones",t.POSITION_MODE="positionMode",t.SPACING_MODE="spacingMode",t.ROTATE_MODE="rotateMode",t.SPACING="spacing",t.ROTATE_OFFSET="rotateOffset",t.ROTATE_MIX="rotateMix",t.TRANSLATE_MIX="translateMix",t.TARGET_DISPLAY="targetDisplay",t.CLOSED="closed",t.CONSTANT_SPEED="constantSpeed",t.VERTEX_COUNT="vertexCount",t.LENGTHS="lengths",t.GOTO_AND_PLAY="gotoAndPlay",t.DEFAULT_NAME="default",t}();t.DataParser=e}(dragonBones||(dragonBones={})),function(t){var e=function(e){function n(){var i=null!==e&&e.apply(this,arguments)||this;return i._rawTextureAtlasIndex=0,i._rawBones=[],i._data=null,i._armature=null,i._bone=null,i._geometry=null,i._slot=null,i._skin=null,i._mesh=null,i._animation=null,i._timeline=null,i._rawTextureAtlases=null,i._frameValueType=0,i._defaultColorOffset=-1,i._prevClockwise=0,i._prevRotation=0,i._frameDefaultValue=0,i._frameValueScale=1,i._helpMatrixA=new t.Matrix,i._helpMatrixB=new t.Matrix,i._helpTransform=new t.Transform,i._helpColorTransform=new t.ColorTransform,i._helpPoint=new t.Point,i._helpArray=[],i._intArray=[],i._floatArray=[],i._frameIntArray=[],i._frameFloatArray=[],i._frameArray=[],i._timelineArray=[],i._colorArray=[],i._cacheRawMeshes=[],i._cacheMeshes=[],i._actionFrames=[],i._weightSlotPose={},i._weightBonePoses={},i._cacheBones={},i._slotChildActions={},i}return __extends(n,e),n._getBoolean=function(t,e,i){if(e in t){var n=t[e],a=typeof n;if("boolean"===a)return n;if("string"!==a)return!!n;switch(n){case"0":case"NaN":case"":case"false":case"null":case"undefined":return!1;default:return!0}}return i},n._getNumber=function(t,e,i){if(e in t){var n=t[e];return null===n||"NaN"===n?i:+n||0}return i},n._getString=function(t,e,i){if(e in t){var n=t[e];return"string"===typeof n?n:String(n)}return i},n.prototype._getCurvePoint=function(t,e,i,n,a,r,s,o,h,l){var u=1-h,p=u*u,c=h*h,_=u*p,d=3*h*p,f=3*u*c,m=h*c;l.x=_*t+d*i+f*a+m*s,l.y=_*e+d*n+f*r+m*o},n.prototype._samplingEasingCurve=function(t,e){var i=t.length;if(i%3==1){for(var n=-2,a=0,r=e.length;a=0&&n+61e-4;){var y=.5*(g+m);this._getCurvePoint(h,l,u,p,c,_,d,f,y,this._helpPoint),s-this._helpPoint.x>0?m=y:g=y}e[a]=this._helpPoint.y}return!0}for(n=0,a=0,r=e.length;a1e-4;){y=.5*(g+m);this._getCurvePoint(h,l,u,p,c,_,d,f,y,this._helpPoint),s-this._helpPoint.x>0?m=y:g=y}e[a]=this._helpPoint.y}return!1},n.prototype._parseActionDataInFrame=function(e,i,n,a){t.DataParser.EVENT in e&&this._mergeActionFrame(e[t.DataParser.EVENT],i,10,n,a),t.DataParser.SOUND in e&&this._mergeActionFrame(e[t.DataParser.SOUND],i,11,n,a),t.DataParser.ACTION in e&&this._mergeActionFrame(e[t.DataParser.ACTION],i,0,n,a),t.DataParser.EVENTS in e&&this._mergeActionFrame(e[t.DataParser.EVENTS],i,10,n,a),t.DataParser.ACTIONS in e&&this._mergeActionFrame(e[t.DataParser.ACTIONS],i,0,n,a)},n.prototype._mergeActionFrame=function(t,e,n,a,r){for(var s=this._armature.actions.length,o=this._parseActionData(t,n,a,r),h=0,l=null,u=0,p=o;ue)break;h++}null===l&&((l=new i).frameStart=e,this._actionFrames.splice(h,0,l));for(var m=0;m0){var _=a.getBone(p);null!==_?c.parent=_:(p in this._cacheBones||(this._cacheBones[p]=[]),this._cacheBones[p].push(c))}if(c.name in this._cacheBones){for(var d=0,f=this._cacheBones[c.name];d0&&null!==i.parent?(s.root=i.parent,s.bone=i):(s.root=i,s.bone=null),s},n.prototype._parsePathConstraint=function(e){var i=this._armature.getSlot(n._getString(e,t.DataParser.TARGET,""));if(null===i)return null;var a=this._armature.defaultSkin;if(null===a)return null;var r=a.getDisplay(i.name,n._getString(e,t.DataParser.TARGET_DISPLAY,i.name));if(null===r||!(r instanceof t.PathDisplayData))return null;var s=e[t.DataParser.BONES];if(null===s||0===s.length)return null;var o=t.BaseObject.borrowObject(t.PathConstraintData);o.name=n._getString(e,t.DataParser.NAME,""),o.type=1,o.pathSlot=i,o.pathDisplayData=r,o.target=i.parent,o.positionMode=t.DataParser._getPositionMode(n._getString(e,t.DataParser.POSITION_MODE,"")),o.spacingMode=t.DataParser._getSpacingMode(n._getString(e,t.DataParser.SPACING_MODE,"")),o.rotateMode=t.DataParser._getRotateMode(n._getString(e,t.DataParser.ROTATE_MODE,"")),o.position=n._getNumber(e,t.DataParser.POSITION,0),o.spacing=n._getNumber(e,t.DataParser.SPACING,0),o.rotateOffset=n._getNumber(e,t.DataParser.ROTATE_OFFSET,0),o.rotateMix=n._getNumber(e,t.DataParser.ROTATE_MIX,1),o.translateMix=n._getNumber(e,t.DataParser.TRANSLATE_MIX,1);for(var h=0,l=s;h0?a:i,this._parsePivot(e,o);break;case 1:var h=s=t.BaseObject.borrowObject(t.ArmatureDisplayData);if(h.name=i,h.path=a.length>0?a:i,h.inheritAnimation=!0,t.DataParser.ACTIONS in e)for(var l=0,u=this._parseActionData(e[t.DataParser.ACTIONS],0,null,null);l0?a:i,t.DataParser.SHARE in e?(f.geometry.data=this._data,this._cacheRawMeshes.push(e),this._cacheMeshes.push(f)):this._parseMesh(e,f);break;case 3:var m=this._parseBoundingBox(e);if(null!==m){var g=s=t.BaseObject.borrowObject(t.BoundingBoxDisplayData);g.name=i,g.path=a.length>0?a:i,g.boundingBox=m}break;case 4:var y=e[t.DataParser.LENGTHS],v=s=t.BaseObject.borrowObject(t.PathDisplayData);v.closed=n._getBoolean(e,t.DataParser.CLOSED,!1),v.constantSpeed=n._getBoolean(e,t.DataParser.CONSTANT_SPEED,!1),v.name=i,v.path=a.length>0?a:i,v.curveLengths.length=y.length;for(var T=0,b=y.length;Ti.width&&(i.width=h),li.height&&(i.height=l))}i.width-=i.x,i.height-=i.y}else console.warn("Data error.\n Please reexport DragonBones Data to fixed the bug.");return i},n.prototype._parseAnimation=function(e){var i=t.BaseObject.borrowObject(t.AnimationData);if(i.blendType=t.DataParser._getAnimationBlendType(n._getString(e,t.DataParser.BLEND_TYPE,"")),i.frameCount=n._getNumber(e,t.DataParser.DURATION,0),i.playTimes=n._getNumber(e,t.DataParser.PLAY_TIMES,1),i.duration=i.frameCount/this._armature.frameRate,i.fadeInTime=n._getNumber(e,t.DataParser.FADE_IN_TIME,0),i.scale=n._getNumber(e,t.DataParser.SCALE,1),i.name=n._getString(e,t.DataParser.NAME,t.DataParser.DEFAULT_NAME),0===i.name.length&&(i.name=t.DataParser.DEFAULT_NAME),i.frameIntOffset=this._frameIntArray.length,i.frameFloatOffset=this._frameFloatArray.length,i.frameOffset=this._frameArray.length,this._animation=i,t.DataParser.FRAME in e){var a=e[t.DataParser.FRAME],r=a.length;if(r>0)for(var s=0,o=0;s0&&(this._animation.actionTimeline=this._parseTimeline(null,this._actionFrames,"",0,0,0,this._parseActionFrame),this._actionFrames.length=0),t.DataParser.TIMELINE in e)for(var I=0,S=e[t.DataParser.TIMELINE];I0&&r in e&&(a=e[r]),null===a)return null;var p=a.length;if(0===p)return null;var c=this._frameIntArray.length,_=this._frameFloatArray.length,d=this._timelineArray.length;switch(null===u&&(u=t.BaseObject.borrowObject(t.TimelineData)),u.type=s,u.offset=d,this._frameValueType=o,this._timeline=u,this._timelineArray.length+=5+p,null!==e?(this._timelineArray[d+0]=Math.round(100*n._getNumber(e,t.DataParser.SCALE,1)),this._timelineArray[d+1]=Math.round(100*n._getNumber(e,t.DataParser.OFFSET,0))):(this._timelineArray[d+0]=100,this._timelineArray[d+1]=0),this._timelineArray[d+2]=p,this._timelineArray[d+3]=h,this._frameValueType){case 0:this._timelineArray[d+4]=0;break;case 1:this._timelineArray[d+4]=c-this._animation.frameIntOffset;break;case 2:this._timelineArray[d+4]=_-this._animation.frameFloatOffset}if(1===p)u.frameIndicesOffset=-1,this._timelineArray[d+5+0]=l.call(this,a[0],0,0)-this._animation.frameOffset;else{var f=this._animation.frameCount+1,m=this._data.frameIndices,g=m.length;m.length+=f,u.frameIndicesOffset=g;for(var y=0,v=0,T=0,b=0;y0)if(t.DataParser.CURVE in e){var s=a+1;this._helpArray.length=s;var o=this._samplingEasingCurve(e[t.DataParser.CURVE],this._helpArray);this._frameArray.length+=2+this._helpArray.length,this._frameArray[r+1]=2,this._frameArray[r+2]=o?s:-s;for(var h=0;h0){for(var s=this._armature.sortedSlots.length,o=new Array(s-r.length/2),h=new Array(s),l=0;l0?r>=this._prevRotation:r<=this._prevRotation)&&(this._prevClockwise=this._prevClockwise>0?this._prevClockwise-1:this._prevClockwise+1),r=this._prevRotation+r-this._prevRotation+t.Transform.PI_D*this._prevClockwise)),this._prevClockwise=n._getNumber(e,t.DataParser.TWEEN_ROTATE,0),this._prevRotation=r;var s=this._parseTweenFrame(e,i,a),o=this._frameFloatArray.length;return this._frameFloatArray.length+=6,this._frameFloatArray[o++]=this._helpTransform.x,this._frameFloatArray[o++]=this._helpTransform.y,this._frameFloatArray[o++]=r,this._frameFloatArray[o++]=this._helpTransform.skew,this._frameFloatArray[o++]=this._helpTransform.scaleX,this._frameFloatArray[o++]=this._helpTransform.scaleY,this._parseActionDataInFrame(e,i,this._bone,this._slot),s},n.prototype._parseBoneTranslateFrame=function(e,i,a){var r=this._parseTweenFrame(e,i,a),s=this._frameFloatArray.length;return this._frameFloatArray.length+=2,this._frameFloatArray[s++]=n._getNumber(e,t.DataParser.X,0),this._frameFloatArray[s++]=n._getNumber(e,t.DataParser.Y,0),r},n.prototype._parseBoneRotateFrame=function(e,i,a){var r=n._getNumber(e,t.DataParser.ROTATE,0)*t.Transform.DEG_RAD;0!==i&&(0===this._prevClockwise?r=this._prevRotation+t.Transform.normalizeRadian(r-this._prevRotation):((this._prevClockwise>0?r>=this._prevRotation:r<=this._prevRotation)&&(this._prevClockwise=this._prevClockwise>0?this._prevClockwise-1:this._prevClockwise+1),r=this._prevRotation+r-this._prevRotation+t.Transform.PI_D*this._prevClockwise)),this._prevClockwise=n._getNumber(e,t.DataParser.CLOCK_WISE,0),this._prevRotation=r;var s=this._parseTweenFrame(e,i,a),o=this._frameFloatArray.length;return this._frameFloatArray.length+=2,this._frameFloatArray[o++]=r,this._frameFloatArray[o++]=n._getNumber(e,t.DataParser.SKEW,0)*t.Transform.DEG_RAD,s},n.prototype._parseBoneScaleFrame=function(e,i,a){var r=this._parseTweenFrame(e,i,a),s=this._frameFloatArray.length;return this._frameFloatArray.length+=2,this._frameFloatArray[s++]=n._getNumber(e,t.DataParser.X,1),this._frameFloatArray[s++]=n._getNumber(e,t.DataParser.Y,1),r},n.prototype._parseSlotDisplayFrame=function(e,i,a){var r=this._parseFrame(e,i,a);return this._frameArray.length+=1,t.DataParser.VALUE in e?this._frameArray[r+1]=n._getNumber(e,t.DataParser.VALUE,0):this._frameArray[r+1]=n._getNumber(e,t.DataParser.DISPLAY_INDEX,0),this._parseActionDataInFrame(e,i,this._slot.parent,this._slot),r},n.prototype._parseSlotColorFrame=function(e,i,n){var a=this._parseTweenFrame(e,i,n),r=-1;if(t.DataParser.VALUE in e||t.DataParser.COLOR in e){var s=t.DataParser.VALUE in e?e[t.DataParser.VALUE]:e[t.DataParser.COLOR];for(var o in s){this._parseColorTransform(s,this._helpColorTransform),r=this._colorArray.length,this._colorArray.length+=8,this._colorArray[r++]=Math.round(100*this._helpColorTransform.alphaMultiplier),this._colorArray[r++]=Math.round(100*this._helpColorTransform.redMultiplier),this._colorArray[r++]=Math.round(100*this._helpColorTransform.greenMultiplier),this._colorArray[r++]=Math.round(100*this._helpColorTransform.blueMultiplier),this._colorArray[r++]=Math.round(this._helpColorTransform.alphaOffset),this._colorArray[r++]=Math.round(this._helpColorTransform.redOffset),this._colorArray[r++]=Math.round(this._helpColorTransform.greenOffset),this._colorArray[r++]=Math.round(this._helpColorTransform.blueOffset),r-=8;break}}r<0&&(this._defaultColorOffset<0&&(this._defaultColorOffset=r=this._colorArray.length,this._colorArray.length+=8,this._colorArray[r++]=100,this._colorArray[r++]=100,this._colorArray[r++]=100,this._colorArray[r++]=100,this._colorArray[r++]=0,this._colorArray[r++]=0,this._colorArray[r++]=0,this._colorArray[r++]=0),r=this._defaultColorOffset);var h=this._frameIntArray.length;return this._frameIntArray.length+=1,this._frameIntArray[h]=r,a},n.prototype._parseSlotDeformFrame=function(e,i,a){var r=this._frameFloatArray.length,s=this._parseTweenFrame(e,i,a),o=t.DataParser.VERTICES in e?e[t.DataParser.VERTICES]:null,h=n._getNumber(e,t.DataParser.OFFSET,0),l=this._intArray[this._mesh.geometry.offset+0],u=this._mesh.parent.name+"_"+this._slot.name+"_"+this._mesh.name,p=this._mesh.geometry.weight,c=0,_=0,d=0,f=0;if(null!==p){var m=this._weightSlotPose[u];this._helpMatrixA.copyFromArray(m,0),this._frameFloatArray.length+=2*p.count,d=p.offset+2+p.bones.length}else this._frameFloatArray.length+=2*l;for(var g=0;g<2*l;g+=2)if(null===o?(c=0,_=0):(c=g=o.length?0:o[g-h],_=g+1=o.length?0:o[g+1-h]),null!==p){var y=this._weightBonePoses[u],v=this._intArray[d++];this._helpMatrixA.transformPoint(c,_,this._helpPoint,!0),c=this._helpPoint.x,_=this._helpPoint.y;for(var T=0;T=o.length?0:o[c-h],p=c+1=o.length?0:o[c+1-h]):(u=0,p=0),this._frameFloatArray[r+c]=u,this._frameFloatArray[r+c+1]=p}if(0===i){var _=this._frameIntArray.length;this._frameIntArray.length+=5,this._frameIntArray[_+0]=this._geometry.offset,this._frameIntArray[_+1]=this._frameFloatArray.length-r,this._frameIntArray[_+2]=this._frameFloatArray.length-r,this._frameIntArray[_+3]=0,this._frameIntArray[_+4]=r-this._animation.frameFloatOffset,this._timelineArray[this._timeline.offset+3]=_-this._animation.frameIntOffset}return s},n.prototype._parseTransform=function(e,i,a){i.x=n._getNumber(e,t.DataParser.X,0)*a,i.y=n._getNumber(e,t.DataParser.Y,0)*a,t.DataParser.ROTATE in e||t.DataParser.SKEW in e?(i.rotation=t.Transform.normalizeRadian(n._getNumber(e,t.DataParser.ROTATE,0)*t.Transform.DEG_RAD),i.skew=t.Transform.normalizeRadian(n._getNumber(e,t.DataParser.SKEW,0)*t.Transform.DEG_RAD)):(t.DataParser.SKEW_X in e||t.DataParser.SKEW_Y in e)&&(i.rotation=t.Transform.normalizeRadian(n._getNumber(e,t.DataParser.SKEW_Y,0)*t.Transform.DEG_RAD),i.skew=t.Transform.normalizeRadian(n._getNumber(e,t.DataParser.SKEW_X,0)*t.Transform.DEG_RAD)-i.rotation),i.scaleX=n._getNumber(e,t.DataParser.SCALE_X,1),i.scaleY=n._getNumber(e,t.DataParser.SCALE_Y,1)},n.prototype._parseColorTransform=function(e,i){i.alphaMultiplier=.01*n._getNumber(e,t.DataParser.ALPHA_MULTIPLIER,100),i.redMultiplier=.01*n._getNumber(e,t.DataParser.RED_MULTIPLIER,100),i.greenMultiplier=.01*n._getNumber(e,t.DataParser.GREEN_MULTIPLIER,100),i.blueMultiplier=.01*n._getNumber(e,t.DataParser.BLUE_MULTIPLIER,100),i.alphaOffset=n._getNumber(e,t.DataParser.ALPHA_OFFSET,0),i.redOffset=n._getNumber(e,t.DataParser.RED_OFFSET,0),i.greenOffset=n._getNumber(e,t.DataParser.GREEN_OFFSET,0),i.blueOffset=n._getNumber(e,t.DataParser.BLUE_OFFSET,0)},n.prototype._parseGeometry=function(e,i){var n=e[t.DataParser.VERTICES],a=Math.floor(n.length/2),r=0,s=this._intArray.length,o=this._floatArray.length;i.offset=s,i.data=this._data,this._intArray.length+=4,this._intArray[s+0]=a,this._intArray[s+2]=o,this._intArray[s+3]=-1,this._floatArray.length+=2*a;for(var h=0,l=2*a;h=0||t.DataParser.DATA_VERSIONS.indexOf(r)>=0){var s=t.BaseObject.borrowObject(t.DragonBonesData);if(s.version=a,s.name=n._getString(e,t.DataParser.NAME,""),s.frameRate=n._getNumber(e,t.DataParser.FRAME_RATE,24),0===s.frameRate&&(s.frameRate=24),t.DataParser.ARMATURE in e){this._data=s,this._parseArray(e);for(var o=0,h=e[t.DataParser.ARMATURE];o0&&(s.stage=s.getArmature(s.armatureNames[0])),this._data=null}return t.DataParser.TEXTURE_ATLAS in e&&(this._rawTextureAtlases=e[t.DataParser.TEXTURE_ATLAS]),s}return console.assert(!1,"Nonsupport data version: "+a+"\nPlease convert DragonBones data to support version.\nRead more: https://github.com/DragonBones/Tools/"),null},n.prototype.parseTextureAtlasData=function(e,i,a){if(void 0===a&&(a=1),console.assert(void 0!==e),null===e){if(null===this._rawTextureAtlases||0===this._rawTextureAtlases.length)return!1;var r=this._rawTextureAtlases[this._rawTextureAtlasIndex++];return this.parseTextureAtlasData(r,i,a),this._rawTextureAtlasIndex>=this._rawTextureAtlases.length&&(this._rawTextureAtlasIndex=0,this._rawTextureAtlases=null),!0}if(i.width=n._getNumber(e,t.DataParser.WIDTH,0),i.height=n._getNumber(e,t.DataParser.HEIGHT,0),i.scale=1===a?1/n._getNumber(e,t.DataParser.SCALE,1):a,i.name=n._getString(e,t.DataParser.NAME,""),i.imagePath=n._getString(e,t.DataParser.IMAGE_PATH,""),t.DataParser.SUB_TEXTURE in e)for(var s=e[t.DataParser.SUB_TEXTURE],o=0,h=s.length;o0&&p>0&&(c.frame=t.TextureData.createRectangle(),c.frame.x=n._getNumber(l,t.DataParser.FRAME_X,0),c.frame.y=n._getNumber(l,t.DataParser.FRAME_Y,0),c.frame.width=u,c.frame.height=p),i.addTexture(c)}return!0},n.getInstance=function(){return null===n._objectDataParserInstance&&(n._objectDataParserInstance=new n),n._objectDataParserInstance},n._objectDataParserInstance=null,n}(t.DataParser);t.ObjectDataParser=e;var i=function(){return function(){this.frameStart=0,this.actions=[]}}();t.ActionFrame=i}(dragonBones||(dragonBones={})),function(t){var e=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return __extends(i,e),i.prototype._inRange=function(t,e,i){return e<=t&&t<=i},i.prototype._decodeUTF8=function(t){for(var e,i=0,n="",a=0,r=0,s=0,o=0;t.length>i;){var h=t[i++];if(-1===h)e=0!==r?65533:-1;else if(0===r)this._inRange(h,0,127)?e=h:(this._inRange(h,194,223)?(r=1,o=128,a=h-192):this._inRange(h,224,239)?(r=2,o=2048,a=h-224):this._inRange(h,240,244)&&(r=3,o=65536,a=h-240),a*=Math.pow(64,r),e=null);else if(this._inRange(h,128,191))if(s+=1,a+=(h-128)*Math.pow(64,r-s),s!==r)e=null;else{var l=a,u=o;a=0,r=0,s=0,o=0,e=this._inRange(l,u,1114111)&&!this._inRange(l,55296,57343)?l:h}else a=0,r=0,s=0,o=0,i--,e=h;null!==e&&-1!==e&&(e<=65535?e>0&&(n+=String.fromCharCode(e)):(e-=65536,n+=String.fromCharCode(55296+(e>>10&1023)),n+=String.fromCharCode(56320+(1023&e))))}return n},i.prototype._parseBinaryTimeline=function(e,i,n){void 0===n&&(n=null);var a=null!==n?n:t.BaseObject.borrowObject(t.TimelineData);a.type=e,a.offset=i,this._timeline=a;var r=this._timelineArrayBuffer[a.offset+2];if(1===r)a.frameIndicesOffset=-1;else{var s,o=this._animation.frameCount+1,h=this._data.frameIndices;s=h.length,h.length+=o,a.frameIndicesOffset=s;for(var l=0,u=0,p=0,c=0;l=0){u=t.ObjectDataParser._getNumber(g,t.DataParser.TYPE,0);var y=t.ObjectDataParser._getString(g,t.DataParser.NAME,"");c=null;if(40===u&&0!==i.blendType){var v=c=t.BaseObject.borrowObject(t.AnimationTimelineData);v.x=t.ObjectDataParser._getNumber(g,t.DataParser.X,0),v.y=t.ObjectDataParser._getNumber(g,t.DataParser.Y,0)}switch(c=this._parseBinaryTimeline(u,p,c),u){case 0:case 1:break;case 11:case 12:case 13:case 50:case 60:this._animation.addBoneTimeline(y,c);break;case 20:case 21:case 22:case 23:case 24:this._animation.addSlotTimeline(y,c);break;case 30:this._animation.addConstraintTimeline(y,c);break;case 40:case 41:case 42:this._animation.addAnimationTimeline(y,c)}}}return this._animation=null,i},i.prototype._parseGeometry=function(e,i){i.offset=e[t.DataParser.OFFSET],i.data=this._data;var n=this._intArrayBuffer[i.offset+3];if(n>=0){var a=t.BaseObject.borrowObject(t.WeightData),r=this._intArrayBuffer[i.offset+0],s=this._intArrayBuffer[n+0];a.offset=n;for(var o=0;o12?i[13]:0,u=new Int16Array(this._binary,this._binaryOffset+i[0],n/Int16Array.BYTES_PER_ELEMENT),p=new Float32Array(this._binary,this._binaryOffset+i[2],a/Float32Array.BYTES_PER_ELEMENT),c=new Int16Array(this._binary,this._binaryOffset+i[4],r/Int16Array.BYTES_PER_ELEMENT),_=new Float32Array(this._binary,this._binaryOffset+i[6],s/Float32Array.BYTES_PER_ELEMENT),d=new Int16Array(this._binary,this._binaryOffset+i[8],o/Int16Array.BYTES_PER_ELEMENT),f=new Uint16Array(this._binary,this._binaryOffset+i[10],h/Uint16Array.BYTES_PER_ELEMENT),m=l>0?new Int16Array(this._binary,this._binaryOffset+i[12],l/Int16Array.BYTES_PER_ELEMENT):u;this._data.binary=this._binary,this._data.intArray=this._intArrayBuffer=u,this._data.floatArray=p,this._data.frameIntArray=c,this._data.frameFloatArray=_,this._data.frameArray=this._frameArrayBuffer=d,this._data.timelineArray=this._timelineArrayBuffer=f,this._data.colorArray=m},i.prototype.parseDragonBonesData=function(t,i){void 0===i&&(i=1),console.assert(null!==t&&void 0!==t&&t instanceof ArrayBuffer,"Data error.");var n=new Uint8Array(t,0,8);if(n[0]!=="D".charCodeAt(0)||n[1]!=="B".charCodeAt(0)||n[2]!=="D".charCodeAt(0)||n[3]!=="T".charCodeAt(0))return console.assert(!1,"Nonsupport data."),null;var a=new Uint32Array(t,8,1)[0],r=new Uint8Array(t,12,a),s=this._decodeUTF8(r),o=JSON.parse(s);return this._binaryOffset=12+a,this._binary=t,e.prototype.parseDragonBonesData.call(this,o,i)},i.getInstance=function(){return null===i._binaryDataParserInstance&&(i._binaryDataParserInstance=new i),i._binaryDataParserInstance},i._binaryDataParserInstance=null,i}(t.ObjectDataParser);t.BinaryDataParser=e}(dragonBones||(dragonBones={})),function(t){var e=function(){function e(i){void 0===i&&(i=null),this.autoSearch=!1,this._dragonBonesDataMap={},this._textureAtlasDataMap={},this._dragonBones=null,this._dataParser=null,null===e._objectParser&&(e._objectParser=new t.ObjectDataParser),null===e._binaryParser&&(e._binaryParser=new t.BinaryDataParser),this._dataParser=null!==i?i:e._objectParser}return e.prototype._isSupportMesh=function(){return!0},e.prototype._getTextureData=function(t,e){if(t in this._textureAtlasDataMap)for(var i=0,n=this._textureAtlasDataMap[t];i0&&e in this._dragonBonesDataMap&&(s=(r=this._dragonBonesDataMap[e]).getArmature(i)),null===s&&(0===e.length||this.autoSearch))for(var o in this._dragonBonesDataMap)if(r=this._dragonBonesDataMap[o],(0===e.length||r.autoSearch)&&null!==(s=r.getArmature(i))){e=o;break}if(null!==s){if(t.dataName=e,t.textureAtlasName=a,t.data=r,t.armature=s,t.skin=null,n.length>0&&(t.skin=s.getSkin(n),null===t.skin&&this.autoSearch))for(var o in this._dragonBonesDataMap){var h=this._dragonBonesDataMap[o].getArmature(n);if(null!==h){t.skin=h.defaultSkin;break}}return null===t.skin&&(t.skin=s.defaultSkin),!0}return!1},e.prototype._buildBones=function(e,i){for(var n=0,a=e.armature.sortedBones;n0){var f=this._getTextureData(t.textureAtlasName,d.path);p.replaceTextureData(f,c)}var m=this._getSlotDisplay(t,d,p);p.replaceDisplay(m,c)}else p.replaceDisplay(null)}}p._setDisplayIndex(l.displayIndex,!0)}}},e.prototype._buildConstraints=function(e,i){var n=e.armature.constraints;for(var a in n){var r=n[a];switch(r.type){case 0:var s=t.BaseObject.borrowObject(t.IKConstraint);s.init(r,i),i._addConstraint(s);break;case 1:var o=t.BaseObject.borrowObject(t.PathConstraint);o.init(r,i),i._addConstraint(o);break;default:var h=t.BaseObject.borrowObject(t.IKConstraint);h.init(r,i),i._addConstraint(h)}}},e.prototype._buildChildArmature=function(t,e,i){return this.buildArmature(i.path,null!==t?t.dataName:"","",null!==t?t.textureAtlasName:"")},e.prototype._getSlotDisplay=function(e,i,n){var a=null!==e?e.dataName:i.parent.parent.parent.name,r=null;switch(i.type){case 0:var s=i;null===s.texture&&(s.texture=this._getTextureData(a,i.path)),r=n.rawDisplay;break;case 2:var o=i;null===o.texture&&(o.texture=this._getTextureData(a,o.path)),r=this._isSupportMesh()?n.meshDisplay:n.rawDisplay;break;case 1:var h=i,l=this._buildChildArmature(e,n,h);if(null!==l){if(l.inheritAnimation=h.inheritAnimation,!l.inheritAnimation){var u=h.actions.length>0?h.actions:l.armatureData.defaultActions;if(u.length>0)for(var p=0,c=u;p=0)){var l=e.getDisplays(h.name);if(null!==l||(null!==r&&e!==r&&(l=r.getDisplays(h.name)),null!==l)){h.displayFrameCount=l.length;for(var u=0,p=h.displayFrameCount;u0},i.prototype.addDBEventListener=function(t,e,i){this.addListener(t,e,i)},i.prototype.removeDBEventListener=function(t,e,i){this.removeListener(t,e,i)},Object.defineProperty(i.prototype,"armature",{get:function(){return this._armature},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"animation",{get:function(){return this._armature.animation},enumerable:!0,configurable:!0}),i}(PIXI.Sprite);t.PixiArmatureDisplay=e}(dragonBones||(dragonBones={})),function(t){var e=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return __extends(i,e),i.toString=function(){return"[class dragonBones.PixiSlot]"},i.prototype._onClear=function(){e.prototype._onClear.call(this),this._textureScale=1,this._renderDisplay=null,this._updateTransform="3"===PIXI.VERSION[0]?this._updateTransformV3:this._updateTransformV4},i.prototype._initDisplay=function(t,e){},i.prototype._disposeDisplay=function(t,e){e||t.destroy()},i.prototype._onUpdateDisplay=function(){this._renderDisplay=this._display?this._display:this._rawDisplay},i.prototype._addDisplay=function(){this._armature.display.addChild(this._renderDisplay)},i.prototype._replaceDisplay=function(t){var e=this._armature.display,i=t;e.addChild(this._renderDisplay),e.swapChildren(this._renderDisplay,i),e.removeChild(i),this._textureScale=1},i.prototype._removeDisplay=function(){this._renderDisplay.parent.removeChild(this._renderDisplay)},i.prototype._updateZOrder=function(){var t=this._armature.display;t.getChildIndex(this._renderDisplay)!==this._zOrder&&t.addChildAt(this._renderDisplay,this._zOrder)},i.prototype._updateVisible=function(){this._renderDisplay.visible=this._parent.visible&&this._visible},i.prototype._updateBlendMode=function(){if(this._renderDisplay instanceof PIXI.Sprite)switch(this._blendMode){case 0:this._renderDisplay.blendMode=PIXI.BLEND_MODES.NORMAL;break;case 1:this._renderDisplay.blendMode=PIXI.BLEND_MODES.ADD;break;case 3:this._renderDisplay.blendMode=PIXI.BLEND_MODES.DARKEN;break;case 4:this._renderDisplay.blendMode=PIXI.BLEND_MODES.DIFFERENCE;break;case 6:this._renderDisplay.blendMode=PIXI.BLEND_MODES.HARD_LIGHT;break;case 9:this._renderDisplay.blendMode=PIXI.BLEND_MODES.LIGHTEN;break;case 10:this._renderDisplay.blendMode=PIXI.BLEND_MODES.MULTIPLY;break;case 11:this._renderDisplay.blendMode=PIXI.BLEND_MODES.OVERLAY;break;case 12:this._renderDisplay.blendMode=PIXI.BLEND_MODES.SCREEN}},i.prototype._updateColor=function(){var t=this._colorTransform.alphaMultiplier*this._globalAlpha;if(this._renderDisplay.alpha=t,this._renderDisplay instanceof PIXI.Sprite||this._renderDisplay instanceof PIXI.SimpleMesh){var e=(Math.round(255*this._colorTransform.redMultiplier)<<16)+(Math.round(255*this._colorTransform.greenMultiplier)<<8)+Math.round(255*this._colorTransform.blueMultiplier);this._renderDisplay.tint=e}},i.prototype._updateFrame=function(){var e=this._textureData;if(this._displayIndex>=0&&null!==this._display&&null!==e){var i=e.parent;null!==this._armature.replacedTexture&&(null===this._armature._replaceTextureAtlasData?((i=t.BaseObject.borrowObject(t.PixiTextureAtlasData)).copyFrom(e.parent),i.renderTexture=this._armature.replacedTexture,this._armature._replaceTextureAtlasData=i):i=this._armature._replaceTextureAtlasData,e=i.getTexture(e.name));var n=e.renderTexture;if(null!==n){if(null!==this._geometryData){var a=this._geometryData.data,r=a.intArray,s=a.floatArray,o=r[this._geometryData.offset+0],h=r[this._geometryData.offset+1],l=r[this._geometryData.offset+2];l<0&&(l+=65536);for(var u=l+2*o,p=this._armature._armatureData.scale,c=this._renderDisplay,_=new Float32Array(2*o),d=new Float32Array(2*o),f=new Uint16Array(3*h),m=0,g=2*o;m0&&n.inheritDeform,s=this._renderDisplay;if(null!==a){var o=(D=n.data).intArray,h=D.floatArray,l=o[n.offset+0],u=o[a.offset+1];u<0&&(u+=65536);for(var p=0,c=0,_=a.offset+2+i.length,d=u,f=0;p=0&&e(t[i],n);--i)t[i+1]=t[i];t[i+1]=n}},Math.bubbleSort=function(t,e){var i;do{i=!1;for(var n=0;n=Math.min(e,i)&&t<=Math.max(e,i)},Math.normalize=function(t,e,i){return(t-e)/(i-e)},Math.lerp=function(t,e,i){return(i-e)*t+e},Math.map=function(t,e,i,n,a){return Math.lerp(Math.normalize(t,e,i),n,a)},Math.clamp=function(t,e,i){return Math.min(Math.max(t,Math.min(e,i)),Math.max(e,i))},Math.roundDecimal=function(t,e){var i=Math.pow(10,e);return Math.round(t*i)/i},void 0===log){function log(t){console.log(t)}}function trace(t){console.trace(t)}function generateString(t,e){var i="",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";e&&(n=" "+n+" ");for(var a=n.length,r=0;r-1?e(JSON.parse(n.responseText),n):e(n.responseText,n):e&&e(null,n))},n.open("GET",t,!0),n.send()}function ajaxPost(t,e,i,n){var a=createAjax();if(a.onreadystatechange=function(){if(4===a.readyState)if(200===a.status){if(i)if((a.getResponseHeader("content-type")||"").indexOf("json")>-1){var t=a.responseText;try{t=JSON.parse(a.responseText)}catch(e){t=a.responseText}i(t,a)}else i(a.responseText,a)}else i&&i(null,a)},a.open("POST",t,!0),n)for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&a.setRequestHeader(r,n[r]);else a.setRequestHeader("Content-type","application/x-www-form-urlencoded");if(e instanceof FormData)a.send(e);else{var s=serialize(e);a.send(s)}}function lang(t){var e=Localization.instance().text[t];return e||t}function shuffleArray(t){for(var e,i,n=t.length;0!==n;)i=Math.floor(Math.random()*n),e=t[n-=1],t[n]=t[i],t[i]=e;return t}function treatAsUTC(t){var e=new Date(t);return e.setMinutes(e.getMinutes()-e.getTimezoneOffset()),e}function daysBetween(t,e){return(treatAsUTC(e)-treatAsUTC(t))/864e5}function createPointsInSpace(t,e,i,n,a){for(var r=a||250,s=0,o=[],h=new V(e/2,i/2),l=0;s1e3&&r--;for(var c=0;c=e||s>=i)){n+="...";break}return n}function googleAnalytics(t){app.device.isLocalhost?log("localhost pageview : "+t):window._gTagID?gtag("config",_gTagID,{page_path:t}):console.warn("SaberJS: You need to define a global variable _gTagID")}function inArray(t,e){return-1!==t.indexOf(e)}function convertColor(t){if("transparent"===t||"#ffffff"===t||"#FFFFFF"===t)return 16777215;var e=t||"";return e=e.replace("#","0x"),e=PIXI.utils.hex2rgb(e),Color.get_color_32(1,255*e[0],255*e[1],255*e[2])}function getDateByTimeZone(t){t=t||0;var e=new Date,i=e.getTime()+6e4*e.getTimezoneOffset();return new Date(i+36e5*t)}function isDateBetween(t,e,i){var n=new Date(t.getFullYear(),t.getMonth(),t.getDate());return n>=e&&n<=i}function applyToConstructor(t,e){var i=[null].concat(e);return new(t.bind.apply(t,i))}function uuid(){var t=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var i=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"===e?i:3&i|8).toString(16)})}function numberWithCommas(t){var e=t.toString().split(".");return e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),e.join(".")}function isEmpty(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return JSON.stringify(t)===JSON.stringify({})}function formatThousands(t,e){e=void 0===e?",":e;var i,n=null,a=null,r=0;for(a="",i=(n=(t=t||0).toString()).length,r=0;r0&&(a=e+a),a=n.substr(i-(r+1),1)+a;return a}function camelToUnderscore(t){return t.replace(/([A-Z])/g," $1").split(" ").filter(function(t){return""!=t}).join("_").toLowerCase()}function createGradTexture(t,e){const i=document.createElement("canvas");i.width=1,i.height=256;const n=i.getContext("2d"),a=n.createLinearGradient(0,0,0,256);return a.addColorStop(0,t),a.addColorStop(1,e),n.fillStyle=a,n.fillRect(0,0,1,256),PIXI.Texture.from(i)}function xml2json(t,e){var i={toObj:function(t){var e={};if(1==t.nodeType){if(t.attributes.length)for(var n=0;n1)e=i.escape(i.innerXml(t));else for(o=t.firstChild;o;o=o.nextSibling)e["#cdata"]=i.escape(o.nodeValue)}t.attributes.length||t.firstChild||(e=null)}else 9==t.nodeType?e=i.toObj(t.documentElement):alert("unhandled node type: "+t.nodeType);return e},toJson:function(t,e,n){var a=e?'"'+e+'"':"";if(t instanceof Array){for(var r=0,s=t.length;r1?"\n"+n+"\t"+t.join(",\n"+n+"\t")+"\n"+n:t.join(""))+"]"}else if(null==t)a+=(e&&":")+"null";else if("object"==typeof t){var o=[];for(var h in t)o[o.length]=i.toJson(t[h],h,n+"\t");a+=(e?":{":"{")+(o.length>1?"\n"+n+"\t"+o.join(",\n"+n+"\t")+"\n"+n:o.join(""))+"}"}else a+="string"==typeof t?(e&&":")+'"'+t.toString()+'"':(e&&":")+t.toString();return a},innerXml:function(t){var e="";if("innerHTML"in t)e=t.innerHTML;else for(var i=function(t){var e="";if(1==t.nodeType){e+="<"+t.nodeName;for(var n=0;n"}else e+="/>"}else 3==t.nodeType?e+=t.nodeValue:4==t.nodeType&&(e+="");return e},n=t.firstChild;n;n=n.nextSibling)e+=i(n);return e},escape:function(t){return t.replace(/[\\]/g,"\\\\").replace(/[\"]/g,'\\"').replace(/[\n]/g,"\\n").replace(/[\r]/g,"\\r")},removeWhite:function(t){t.normalize();for(var e=t.firstChild;e;)if(3==e.nodeType)if(e.nodeValue.match(/[^ \f\n\r\t\v]/))e=e.nextSibling;else{var n=e.nextSibling;t.removeChild(e),e=n}else 1==e.nodeType?(i.removeWhite(e),e=e.nextSibling):e=e.nextSibling;return t}};9==t.nodeType&&(t=t.documentElement);var n=i.toJson(i.toObj(i.removeWhite(t)),t.nodeName,"\t");return"{\n"+e+(e?n.replace(/\t/g,e):n.replace(/\t|\n/g,""))+"\n}"}String.prototype.endsWith=function(t){return-1!==this.indexOf(t,this.length-t.length)},String.prototype.startsWith=function(t){return 0===this.indexOf(t)},String.prototype.capitalize=function(){return this.charAt(0).toUpperCase()+this.slice(1)},Object.defineProperty(Array.prototype,"removeElement",{enumerable:!1,value:function(t){for(var e=0,i=0;ie?this.smartShort(t-1,e):i},function(t,e){function i(){throw"Can't initialize Notes"}i.listeners={},i.add=function(t,e){if(!t.onNote)throw console.log(t),"the object must implement onNote method in order to recive Notes";i.listeners[e]||(i.listeners[e]=[]),-1===i.listeners[e].indexOf(t)&&i.listeners[e].push(t)},i.remove=function(t,e){if(e)(a=i.listeners[e])&&-1!==(r=a.indexOf(t))&&a.splice(r,1);else for(var n in i.listeners){var a,r;if(a=i.listeners[n])-1!==(r=a.indexOf(t))&&a.splice(r,1)}},i.removeAll=function(){i.listeners={}},i.send=function(t,e,n){if(i.listeners[t])for(var a=i.listeners[t],r=0;r10&&(t/=1e3),t||0},Object.defineProperty(i.prototype,"_enabled",{set:function(t){e.Ticker.shared.remove(this._updateListener,this),t&&e.Ticker.shared.add(this._updateListener,this)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"progress",{get:function(){return this._progress},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"paused",{get:function(){return this._paused},set:function(t){this._paused=t,this.refreshPaused()},enumerable:!0,configurable:!0}),i.prototype.destroy=function(){this.removeAllListeners(),this._internalStop(),this._gain&&(this._gain.disconnect(),this._gain=null),this._media&&(this._media.context.events.off("refresh",this.refresh,this),this._media.context.events.off("refreshPaused",this.refreshPaused,this),this._media=null),this._end=null,this._speed=1,this._volume=1,this._loop=!1,this._elapsed=0,this._duration=0,this._paused=!1,this._muted=!1,this._pausedReal=!1},i.prototype.toString=function(){return"[WebAudioInstance id="+this.id+"]"},i.prototype._now=function(){return this._media.context.audioContext.currentTime},i.prototype._updateListener=function(){this._update()},i.prototype._update=function(t){if(void 0===t&&(t=!1),this._source){var e=this._now(),i=e-this._lastUpdate;if(i>0||t){var n=this._source.playbackRate.value;this._elapsed+=i*n,this._lastUpdate=e;var a=this._duration,r=void 0;if(this._source.loopStart){var s=this._source.loopEnd-this._source.loopStart;r=(this._source.loopStart+this._elapsed%s)/a}else r=this._elapsed%a/a;this._progress=r,this.emit("progress",this._progress,a)}}},i.prototype.init=function(t){this._media=t,t.context.events.on("refresh",this.refresh,this),t.context.events.on("refreshPaused",this.refreshPaused,this)},i.prototype._internalStop=function(){this._source&&(this._enabled=!1,this._source.onended=null,this._source.stop(0),this._source.disconnect(),this._source=null)},i.prototype._onComplete=function(){this._source&&(this._enabled=!1,this._source.onended=null,this._source.disconnect()),this._source=null,this._progress=1,this.emit("progress",1,this._duration),this.emit("end",this)},i}(i.EventEmitter),y=function(t){function e(e){var i=this,n=e.audioContext,a=n.createBufferSource(),r=n.createGain(),s=n.createAnalyser();return a.connect(s),s.connect(r),r.connect(e.destination),(i=t.call(this,s,r)||this).context=e,i.bufferSource=a,i.gain=r,i.analyser=s,i}return o(e,t),Object.defineProperty(e.prototype,"script",{get:function(){return this._script||(this._script=this.context.audioContext.createScriptProcessor(e.BUFFER_SIZE),this._script.connect(this.context.destination)),this._script},enumerable:!0,configurable:!0}),e.prototype.destroy=function(){t.prototype.destroy.call(this),this.bufferSource.disconnect(),this._script&&this._script.disconnect(),this.gain.disconnect(),this.analyser.disconnect(),this.bufferSource=null,this._script=null,this.gain=null,this.analyser=null,this.context=null},e.prototype.cloneBufferSource=function(){var t=this.bufferSource,e=this.context.audioContext.createBufferSource();e.buffer=t.buffer,f.setParamValue(e.playbackRate,t.playbackRate.value),e.loop=t.loop;var i=this.context.audioContext.createGain();return e.connect(i),i.connect(this.destination),{source:e,gain:i}},Object.defineProperty(e.prototype,"bufferSize",{get:function(){return this.script.bufferSize},enumerable:!0,configurable:!0}),e.BUFFER_SIZE=0,e}(a),v=function(){function t(){}return t.prototype.init=function(t){this.parent=t,this._nodes=new y(this.context),this._source=this._nodes.bufferSource,this.source=t.options.source},t.prototype.destroy=function(){this.parent=null,this._nodes.destroy(),this._nodes=null,this._source=null,this.source=null},t.prototype.create=function(){return new g(this)},Object.defineProperty(t.prototype,"context",{get:function(){return this.parent.context},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isPlayable",{get:function(){return!!this._source&&!!this._source.buffer},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"filters",{get:function(){return this._nodes.filters},set:function(t){this._nodes.filters=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"duration",{get:function(){return this._source.buffer.duration},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"buffer",{get:function(){return this._source.buffer},set:function(t){this._source.buffer=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"nodes",{get:function(){return this._nodes},enumerable:!0,configurable:!0}),t.prototype.load=function(t){this.source?this._decode(this.source,t):this.parent.url?this._loadUrl(t):t&&t(new Error("sound.url or sound.source must be set"))},t.prototype._loadUrl=function(t){var e=this,i=new XMLHttpRequest,n=this.parent.url;i.open("GET",n,!0),i.responseType="arraybuffer",i.onload=function(){e.source=i.response,e._decode(i.response,t)},i.send()},t.prototype._decode=function(t,e){var i=this;this.parent.context.decode(t,function(t,n){if(t)e&&e(t);else{i.parent.isLoaded=!0,i.buffer=n;var a=i.parent.autoPlayStart();e&&e(null,i.parent,a)}})},t}(),T=function(t){function e(){var n=this,a=window,r=new e.AudioContext,s=r.createDynamicsCompressor(),o=r.createAnalyser();return o.connect(s),s.connect(r.destination),(n=t.call(this,o,s)||this)._ctx=r,n._offlineCtx=new e.OfflineAudioContext(1,2,a.OfflineAudioContext?r.sampleRate:44100),n._unlocked=!1,n.compressor=s,n.analyser=o,n.events=new i.EventEmitter,n.volume=1,n.speed=1,n.muted=!1,n.paused=!1,"running"!==r.state&&(n._unlock(),n._unlock=n._unlock.bind(n),document.addEventListener("mousedown",n._unlock,!0),document.addEventListener("touchstart",n._unlock,!0),document.addEventListener("touchend",n._unlock,!0)),n}return o(e,t),e.prototype._unlock=function(){this._unlocked||(this.playEmptySound(),"running"===this._ctx.state&&(document.removeEventListener("mousedown",this._unlock,!0),document.removeEventListener("touchend",this._unlock,!0),document.removeEventListener("touchstart",this._unlock,!0),this._unlocked=!0))},e.prototype.playEmptySound=function(){var t=this._ctx.createBufferSource();t.buffer=this._ctx.createBuffer(1,1,22050),t.connect(this._ctx.destination),t.start(0,0,0),"suspended"===t.context.state&&t.context.resume()},Object.defineProperty(e,"AudioContext",{get:function(){var t=window;return t.AudioContext||t.webkitAudioContext||null},enumerable:!0,configurable:!0}),Object.defineProperty(e,"OfflineAudioContext",{get:function(){var t=window;return t.OfflineAudioContext||t.webkitOfflineAudioContext||null},enumerable:!0,configurable:!0}),e.prototype.destroy=function(){t.prototype.destroy.call(this);var e=this._ctx;void 0!==e.close&&e.close(),this.events.removeAllListeners(),this.analyser.disconnect(),this.compressor.disconnect(),this.analyser=null,this.compressor=null,this.events=null,this._offlineCtx=null,this._ctx=null},Object.defineProperty(e.prototype,"audioContext",{get:function(){return this._ctx},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"offlineContext",{get:function(){return this._offlineCtx},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"paused",{get:function(){return this._paused},set:function(t){t&&"running"===this._ctx.state?this._ctx.suspend():t||"suspended"!==this._ctx.state||this._ctx.resume(),this._paused=t},enumerable:!0,configurable:!0}),e.prototype.refresh=function(){this.events.emit("refresh")},e.prototype.refreshPaused=function(){this.events.emit("refreshPaused")},e.prototype.toggleMute=function(){return this.muted=!this.muted,this.refresh(),this.muted},e.prototype.togglePause=function(){return this.paused=!this.paused,this.refreshPaused(),this._paused},e.prototype.decode=function(t,e){this._offlineCtx.decodeAudioData(t,function(t){e(null,t)},function(t){e(new Error(t.message||"Unable to decode file"))})},e}(a),b={WebAudioMedia:v,WebAudioInstance:g,WebAudioNodes:y,WebAudioContext:T,WebAudioUtils:f},I={Filter:r,EqualizerFilter:function(t){function e(i,n,a,r,s,o,h,l,p,c){void 0===i&&(i=0),void 0===n&&(n=0),void 0===a&&(a=0),void 0===r&&(r=0),void 0===s&&(s=0),void 0===o&&(o=0),void 0===h&&(h=0),void 0===l&&(l=0),void 0===p&&(p=0),void 0===c&&(c=0);var _=this;if(!u().useLegacy){var d=[{f:e.F32,type:"lowshelf",gain:i},{f:e.F64,type:"peaking",gain:n},{f:e.F125,type:"peaking",gain:a},{f:e.F250,type:"peaking",gain:r},{f:e.F500,type:"peaking",gain:s},{f:e.F1K,type:"peaking",gain:o},{f:e.F2K,type:"peaking",gain:h},{f:e.F4K,type:"peaking",gain:l},{f:e.F8K,type:"peaking",gain:p},{f:e.F16K,type:"highshelf",gain:c}].map(function(t){var e=u().context.audioContext.createBiquadFilter();return e.type=t.type,f.setParamValue(e.Q,1),e.frequency.value=t.f,f.setParamValue(e.gain,t.gain),e});(_=t.call(this,d[0],d[d.length-1])||this).bands=d,_.bandsMap={};for(var m=0;m<_.bands.length;m++){var g=_.bands[m];m>0&&_.bands[m-1].connect(g),_.bandsMap[g.frequency.value]=g}return _}_=t.call(this,null)||this}return o(e,t),e.prototype.setGain=function(t,e){if(void 0===e&&(e=0),!this.bandsMap[t])throw new Error("No band found for frequency "+t);f.setParamValue(this.bandsMap[t].gain,e)},e.prototype.getGain=function(t){if(!this.bandsMap[t])throw new Error("No band found for frequency "+t);return this.bandsMap[t].gain.value},Object.defineProperty(e.prototype,"f32",{get:function(){return this.getGain(e.F32)},set:function(t){this.setGain(e.F32,t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"f64",{get:function(){return this.getGain(e.F64)},set:function(t){this.setGain(e.F64,t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"f125",{get:function(){return this.getGain(e.F125)},set:function(t){this.setGain(e.F125,t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"f250",{get:function(){return this.getGain(e.F250)},set:function(t){this.setGain(e.F250,t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"f500",{get:function(){return this.getGain(e.F500)},set:function(t){this.setGain(e.F500,t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"f1k",{get:function(){return this.getGain(e.F1K)},set:function(t){this.setGain(e.F1K,t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"f2k",{get:function(){return this.getGain(e.F2K)},set:function(t){this.setGain(e.F2K,t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"f4k",{get:function(){return this.getGain(e.F4K)},set:function(t){this.setGain(e.F4K,t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"f8k",{get:function(){return this.getGain(e.F8K)},set:function(t){this.setGain(e.F8K,t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"f16k",{get:function(){return this.getGain(e.F16K)},set:function(t){this.setGain(e.F16K,t)},enumerable:!0,configurable:!0}),e.prototype.reset=function(){this.bands.forEach(function(t){f.setParamValue(t.gain,0)})},e.prototype.destroy=function(){this.bands.forEach(function(t){t.disconnect()}),this.bands=null,this.bandsMap=null},e.F32=32,e.F64=64,e.F125=125,e.F250=250,e.F500=500,e.F1K=1e3,e.F2K=2e3,e.F4K=4e3,e.F8K=8e3,e.F16K=16e3,e}(r),DistortionFilter:function(t){function e(e){void 0===e&&(e=0);var i=this;if(!u().useLegacy){var n=u().context.audioContext.createWaveShaper();return(i=t.call(this,n)||this)._distortion=n,i.amount=e,i}i=t.call(this,null)||this}return o(e,t),Object.defineProperty(e.prototype,"amount",{get:function(){return this._amount},set:function(t){t*=1e3,this._amount=t;for(var e,i=new Float32Array(44100),n=Math.PI/180,a=0;a<44100;++a)e=2*a/44100-1,i[a]=(3+t)*e*20*n/(Math.PI+t*Math.abs(e));this._distortion.curve=i,this._distortion.oversample="4x"},enumerable:!0,configurable:!0}),e.prototype.destroy=function(){this._distortion=null,t.prototype.destroy.call(this)},e}(r),StereoFilter:function(t){function e(e){void 0===e&&(e=0);var i=this;if(!u().useLegacy){var n,a,r,s=u().context.audioContext;return s.createStereoPanner?r=n=s.createStereoPanner():((a=s.createPanner()).panningModel="equalpower",r=a),(i=t.call(this,r)||this)._stereo=n,i._panner=a,i.pan=e,i}i=t.call(this,null)||this}return o(e,t),Object.defineProperty(e.prototype,"pan",{get:function(){return this._pan},set:function(t){this._pan=t,this._stereo?f.setParamValue(this._stereo.pan,t):this._panner.setPosition(t,0,1-Math.abs(t))},enumerable:!0,configurable:!0}),e.prototype.destroy=function(){t.prototype.destroy.call(this),this._stereo=null,this._panner=null},e}(r),ReverbFilter:function(t){function e(e,i,n){void 0===e&&(e=3),void 0===i&&(i=2),void 0===n&&(n=!1);var a=this;if(!u().useLegacy)return(a=t.call(this,null)||this)._seconds=a._clamp(e,1,50),a._decay=a._clamp(i,0,100),a._reverse=n,a._rebuild(),a;a=t.call(this,null)||this}return o(e,t),e.prototype._clamp=function(t,e,i){return Math.min(i,Math.max(e,t))},Object.defineProperty(e.prototype,"seconds",{get:function(){return this._seconds},set:function(t){this._seconds=this._clamp(t,1,50),this._rebuild()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"decay",{get:function(){return this._decay},set:function(t){this._decay=this._clamp(t,0,100),this._rebuild()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"reverse",{get:function(){return this._reverse},set:function(t){this._reverse=t,this._rebuild()},enumerable:!0,configurable:!0}),e.prototype._rebuild=function(){for(var t,e=u().context.audioContext,i=e.sampleRate,n=i*this._seconds,a=e.createBuffer(2,n,i),r=a.getChannelData(0),s=a.getChannelData(1),o=0;o=this._end&&!this._source.loop&&this._onComplete()},i.prototype._onComplete=function(){e.Ticker.shared.remove(this._onUpdate,this),this._internalStop(),this.emit("progress",1,this._duration),this.emit("end",this)},i.prototype.destroy=function(){e.Ticker.shared.remove(this._onUpdate,this),this.removeAllListeners();var t=this._source;t&&(t.onended=null,t.onplay=null,t.onpause=null,this._internalStop()),this._source=null,this._speed=1,this._volume=1,this._loop=!1,this._end=null,this._start=0,this._duration=0,this._playing=!1,this._pausedReal=!1,this._paused=!1,this._muted=!1,this._media&&(this._media.context.off("refresh",this.refresh,this),this._media.context.off("refreshPaused",this.refreshPaused,this),this._media=null)},i.prototype.toString=function(){return"[HTMLAudioInstance id="+this.id+"]"},i.PADDING=.1,i}(i.EventEmitter),D=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.init=function(t){this.parent=t,this._source=t.options.source||new Audio,t.url&&(this._source.src=t.url)},e.prototype.create=function(){return new P(this)},Object.defineProperty(e.prototype,"isPlayable",{get:function(){return!!this._source&&4===this._source.readyState},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"duration",{get:function(){return this._source.duration},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"context",{get:function(){return this.parent.context},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"filters",{get:function(){return null},set:function(t){},enumerable:!0,configurable:!0}),e.prototype.destroy=function(){this.removeAllListeners(),this.parent=null,this._source&&(this._source.src="",this._source.load(),this._source=null)},Object.defineProperty(e.prototype,"source",{get:function(){return this._source},enumerable:!0,configurable:!0}),e.prototype.load=function(t){var e=this._source,i=this.parent;if(4!==e.readyState){if(!i.url)return t(new Error("sound.url or sound.source must be set"));e.src=i.url;var n=function(){e.removeEventListener("canplaythrough",a),e.removeEventListener("load",a),e.removeEventListener("abort",r),e.removeEventListener("error",s)},a=function(){n(),i.isLoaded=!0;var e=i.autoPlayStart();t&&t(null,i,e)},r=function(){n(),t&&t(new Error("Sound loading has been aborted"))},s=function(){n();var i="Failed to load audio element (code: "+e.error.code+")";t&&t(new Error(i))};e.addEventListener("canplaythrough",a,!1),e.addEventListener("load",a,!1),e.addEventListener("abort",r,!1),e.addEventListener("error",s,!1),e.load()}else{i.isLoaded=!0;var o=i.autoPlayStart();t&&setTimeout(function(){t(null,i,o)},0)}},e}(i.EventEmitter),A=function(t){function e(){var e=t.call(this)||this;return e.speed=1,e.volume=1,e.muted=!1,e.paused=!1,e}return o(e,t),e.prototype.refresh=function(){this.emit("refresh")},e.prototype.refreshPaused=function(){this.emit("refreshPaused")},Object.defineProperty(e.prototype,"filters",{get:function(){return null},set:function(t){},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"audioContext",{get:function(){return null},enumerable:!0,configurable:!0}),e.prototype.toggleMute=function(){return this.muted=!this.muted,this.refresh(),this.muted},e.prototype.togglePause=function(){return this.paused=!this.paused,this.refreshPaused(),this.paused},e.prototype.destroy=function(){this.removeAllListeners()},e}(i.EventEmitter),M={HTMLAudioMedia:D,HTMLAudioInstance:P,HTMLAudioContext:A},w=["mp3","ogg","oga","opus","mpeg","wav","m4a","aiff","wma","mid"],x=(p={m4a:"mp4",oga:"ogg"},c=document.createElement("audio"),_={},d=/^no$/,w.forEach(function(t){var e=p[t]||t,i=c.canPlayType("audio/"+t).replace(d,""),n=c.canPlayType("audio/"+e).replace(d,"");_[t]=!!i||!!n}),Object.freeze(_)),E=/\.(\{([^\}]+)\})(\?.*)?$/;function O(t){var e=E,i="string"==typeof t?t:t.url;if(e.test(i)){for(var n=e.exec(i),a=n[2].split(","),r=a[a.length-1],s=0,o=a.length;s-1?t.sound=u().add(t.name,{loaded:e,preload:!0,url:t.url,source:t.data}):e()},e}(),B=function(){function t(t,e){this.parent=t,Object.assign(this,e),this.duration=this.end-this.start}return t.prototype.play=function(t){return this.parent.play({complete:t,speed:this.speed||this.parent.speed,end:this.end,start:this.start,loop:this.loop})},t.prototype.destroy=function(){this.parent=null},t}(),F=function(){function t(t,e){this.media=t,this.options=e,this._instances=[],this._sprites={},this.media.init(this);var i=e.complete;this._autoPlayOptions=i?{complete:i}:null,this.isLoaded=!1,this.isPlaying=!1,this.autoPlay=e.autoPlay,this.singleInstance=e.singleInstance,this.preload=e.preload||this.autoPlay,this.url=e.url,this.speed=e.speed,this.volume=e.volume,this.loop=e.loop,e.sprites&&this.addSprites(e.sprites),this.preload&&this._preload(e.loaded)}return t.from=function(e){var i={};return"string"==typeof e?i.url=e:e instanceof ArrayBuffer||e instanceof HTMLAudioElement?i.source=e:i=e,(i=l({autoPlay:!1,singleInstance:!1,url:null,source:null,preload:!1,volume:1,speed:1,complete:null,loaded:null,loop:!1},i)).url&&(i.url=O(i.url)),Object.freeze(i),new t(u().useLegacy?new D:new v,i)},Object.defineProperty(t.prototype,"context",{get:function(){return u().context},enumerable:!0,configurable:!0}),t.prototype.pause=function(){return this.isPlaying=!1,this.paused=!0,this},t.prototype.resume=function(){return this.isPlaying=this._instances.length>0,this.paused=!1,this},Object.defineProperty(t.prototype,"paused",{get:function(){return this._paused},set:function(t){this._paused=t,this.refreshPaused()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"speed",{get:function(){return this._speed},set:function(t){this._speed=t,this.refresh()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"filters",{get:function(){return this.media.filters},set:function(t){this.media.filters=t},enumerable:!0,configurable:!0}),t.prototype.addSprites=function(t,e){if("object"==typeof t){var i={};for(var n in t)i[n]=this.addSprites(n,t[n]);return i}if("string"==typeof t){var a=new B(this,e);return this._sprites[t]=a,a}},t.prototype.destroy=function(){this._removeInstances(),this.removeSprites(),this.media.destroy(),this.media=null,this._sprites=null,this._instances=null},t.prototype.removeSprites=function(t){if(t){var e=this._sprites[t];void 0!==e&&(e.destroy(),delete this._sprites[t])}else for(var i in this._sprites)this.removeSprites(i);return this},Object.defineProperty(t.prototype,"isPlayable",{get:function(){return this.isLoaded&&this.media&&this.media.isPlayable},enumerable:!0,configurable:!0}),t.prototype.stop=function(){if(!this.isPlayable)return this.autoPlay=!1,this._autoPlayOptions=null,this;this.isPlaying=!1;for(var t=this._instances.length-1;t>=0;t--)this._instances[t].stop();return this},t.prototype.play=function(t,e){var i,n=this;if("string"==typeof t?i={sprite:r=t,loop:this.loop,complete:e}:"function"==typeof t?(i={}).complete=t:i=t,(i=l({complete:null,loaded:null,sprite:null,end:null,start:0,volume:1,speed:1,muted:!1,loop:!1},i||{})).sprite){var a=i.sprite,r=this._sprites[a];i.start=r.start,i.end=r.end,i.speed=r.speed||1,i.loop=r.loop||i.loop,delete i.sprite}if(i.offset&&(i.start=i.offset),!this.isLoaded)return new Promise(function(t,e){n.autoPlay=!0,n._autoPlayOptions=i,n._preload(function(n,a,r){n?e(n):(i.loaded&&i.loaded(n,a,r),t(r))})});this.singleInstance&&this._removeInstances();var s=this._createInstance();return this._instances.push(s),this.isPlaying=!0,s.once("end",function(){i.complete&&i.complete(n),n._onComplete(s)}),s.once("stop",function(){n._onComplete(s)}),s.play(i),s},t.prototype.refresh=function(){for(var t=this._instances.length,e=0;e=0;t--)this._poolInstance(this._instances[t]);this._instances.length=0},t.prototype._onComplete=function(t){if(this._instances){var e=this._instances.indexOf(t);e>-1&&this._instances.splice(e,1),this.isPlaying=this._instances.length>0}this._poolInstance(t)},t.prototype._createInstance=function(){if(t._pool.length>0){var e=t._pool.pop();return e.init(this.media),e}return this.media.create()},t.prototype._poolInstance=function(e){e.destroy(),t._pool.indexOf(e)<0&&t._pool.push(e)},t._pool=[],t}(),N=function(){function t(){this.init()}return t.prototype.init=function(){return this.supported&&(this._webAudioContext=new T),this._htmlAudioContext=new A,this._sounds={},this.useLegacy=!this.supported,this},Object.defineProperty(t.prototype,"context",{get:function(){return this._context},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"filtersAll",{get:function(){return this.useLegacy?[]:this._context.filters},set:function(t){this.useLegacy||(this._context.filters=t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"supported",{get:function(){return null!==T.AudioContext},enumerable:!0,configurable:!0}),t.prototype.add=function(t,e){if("object"==typeof t){var i={};for(var n in t){var a=this._getOptions(t[n],e);i[n]=this.add(n,a)}return i}if("string"==typeof t){if(e instanceof F)return this._sounds[t]=e,e;a=this._getOptions(e);var r=F.from(a);return this._sounds[t]=r,r}},t.prototype._getOptions=function(t,e){var i;return i="string"==typeof t?{url:t}:t instanceof ArrayBuffer||t instanceof HTMLAudioElement?{source:t}:t,l({},i,e||{})},Object.defineProperty(t.prototype,"useLegacy",{get:function(){return this._useLegacy},set:function(t){C.legacy=t,this._useLegacy=t,this._context=!t&&this.supported?this._webAudioContext:this._htmlAudioContext},enumerable:!0,configurable:!0}),t.prototype.remove=function(t){return this.exists(t,!0),this._sounds[t].destroy(),delete this._sounds[t],this},Object.defineProperty(t.prototype,"volumeAll",{get:function(){return this._context.volume},set:function(t){this._context.volume=t,this._context.refresh()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"speedAll",{get:function(){return this._context.speed},set:function(t){this._context.speed=t,this._context.refresh()},enumerable:!0,configurable:!0}),t.prototype.togglePauseAll=function(){return this._context.togglePause()},t.prototype.pauseAll=function(){return this._context.paused=!0,this._context.refreshPaused(),this},t.prototype.resumeAll=function(){return this._context.paused=!1,this._context.refreshPaused(),this},t.prototype.toggleMuteAll=function(){return this._context.toggleMute()},t.prototype.muteAll=function(){return this._context.muted=!0,this._context.refresh(),this},t.prototype.unmuteAll=function(){return this._context.muted=!1,this._context.refresh(),this},t.prototype.removeAll=function(){for(var t in this._sounds)this._sounds[t].destroy(),delete this._sounds[t];return this},t.prototype.stopAll=function(){for(var t in this._sounds)this._sounds[t].stop();return this},t.prototype.exists=function(t,e){return void 0===e&&(e=!1),!!this._sounds[t]},t.prototype.find=function(t){return this.exists(t,!0),this._sounds[t]},t.prototype.play=function(t,e){return this.find(t).play(e)},t.prototype.stop=function(t){return this.find(t).stop()},t.prototype.pause=function(t){return this.find(t).pause()},t.prototype.resume=function(t){return this.find(t).resume()},t.prototype.volume=function(t,e){var i=this.find(t);return void 0!==e&&(i.volume=e),i.volume},t.prototype.speed=function(t,e){var i=this.find(t);return void 0!==e&&(i.speed=e),i.speed},t.prototype.duration=function(t){return this.find(t).duration},t.prototype.close=function(){return this.removeAll(),this._sounds=null,this._webAudioContext&&(this._webAudioContext.destroy(),this._webAudioContext=null),this._htmlAudioContext&&(this._htmlAudioContext.destroy(),this._htmlAudioContext=null),this._context=null,this},t}(),L=0,R={get PLAY_ID(){return L},playOnce:function(t,e){var i="alias"+L++;return u().add(i,{url:t,preload:!0,autoPlay:!0,loaded:function(t){t&&(u().remove(i),e&&e(t))},complete:function(){u().remove(i),e&&e(null)}}),i},render:function(t,e){var i=document.createElement("canvas");e=l({width:512,height:128,fill:"black"},e||{}),i.width=e.width,i.height=e.height;var a=n.BaseTexture.from(i);if(!(t.media instanceof v))return a;var r=t.media,s=i.getContext("2d");s.fillStyle=e.fill;for(var o=r.buffer.getChannelData(0),h=Math.ceil(o.length/e.width),u=e.height/2,p=0;p_&&(_=f)}s.fillRect(p,(1+c)*u,1,Math.max(1,(_-c)*u))}return a},resolveUrl:O,sineTone:function(t,e){void 0===t&&(t=200),void 0===e&&(e=1);var i=F.from({singleInstance:!0});if(!(i.media instanceof v))return i;for(var n=i.media,a=i.context.audioContext.createBuffer(1,48e3*e,48e3),r=a.getChannelData(0),s=0;sdocument.w=window'),h.close(),o=h.w.frames[0].document,e=o.createElement("div")}catch(t){e=a.createElement("div"),o=a.body}var l=function(t){return function(){var n=Array.prototype.slice.call(arguments,0);n.unshift(e),o.appendChild(e),e.addBehavior("#default#userData"),e.load(r);var a=t.apply(i,n);return o.removeChild(e),a}},u=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g"),p=function(t){return t.replace(/^d/,"___$&").replace(u,"___")};i.set=l(function(t,e,n){return e=p(e),void 0===n?i.remove(e):(t.setAttribute(e,i.serialize(n)),t.save(r),n)}),i.get=l(function(t,e,n){e=p(e);var a=i.deserialize(t.getAttribute(e));return void 0===a?n:a}),i.remove=l(function(t,e){e=p(e),t.removeAttribute(e),t.save(r)}),i.clear=l(function(t){var e=t.XMLDocument.documentElement.attributes;t.load(r);for(var i=e.length-1;i>=0;i--)t.removeAttribute(e[i].name);t.save(r)}),i.getAll=function(t){var e={};return i.forEach(function(t,i){e[t]=i}),e},i.forEach=l(function(t,e){for(var n,a=t.XMLDocument.documentElement.attributes,r=0;n=a[r];++r)e(n.name,i.deserialize(t.getAttribute(n.name)))})}try{var c="__storejs__";i.set(c,c),i.get(c)!=c&&(i.disabled=!0),i.remove(c)}catch(t){i.disabled=!0}return i.enabled=!i.disabled,i}()}).call(this,void 0!==global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}),this.createjs=this.createjs||{},createjs.extend=function(t,e){function i(){this.constructor=t}return i.prototype=e.prototype,t.prototype=new i},this.createjs=this.createjs||{},createjs.promote=function(t,e){var i=t.prototype,n=Object.getPrototypeOf&&Object.getPrototypeOf(i)||i.__proto__;if(n)for(var a in i[(e+="_")+"constructor"]=n.constructor,n)i.hasOwnProperty(a)&&"function"==typeof n[a]&&(i[e+a]=n[a]);return t},this.createjs=this.createjs||{},createjs.deprecate=function(t,e){return function(){var i="Deprecated property or method '"+e+"'. See docs for info.";return console&&(console.warn?console.warn(i):console.log(i)),t&&t.apply(this,arguments)}},this.createjs=this.createjs||{},function(){function t(t,e,i){this.type=t,this.target=null,this.currentTarget=null,this.eventPhase=0,this.bubbles=!!e,this.cancelable=!!i,this.timeStamp=(new Date).getTime(),this.defaultPrevented=!1,this.propagationStopped=!1,this.immediatePropagationStopped=!1,this.removed=!1}var e=t.prototype;e.preventDefault=function(){this.defaultPrevented=this.cancelable&&!0},e.stopPropagation=function(){this.propagationStopped=!0},e.stopImmediatePropagation=function(){this.immediatePropagationStopped=this.propagationStopped=!0},e.remove=function(){this.removed=!0},e.clone=function(){return new t(this.type,this.bubbles,this.cancelable)},e.set=function(t){for(var e in t)this[e]=t[e];return this},e.toString=function(){return"[Event (type="+this.type+")]"},createjs.Event=t}(),this.createjs=this.createjs||{},function(){function t(){this._listeners=null,this._captureListeners=null}var e=t.prototype;t.initialize=function(t){t.addEventListener=e.addEventListener,t.on=e.on,t.removeEventListener=t.off=e.removeEventListener,t.removeAllEventListeners=e.removeAllEventListeners,t.hasEventListener=e.hasEventListener,t.dispatchEvent=e.dispatchEvent,t._dispatchEvent=e._dispatchEvent,t.willTrigger=e.willTrigger},e.addEventListener=function(t,e,i){var n,a=(n=i?this._captureListeners=this._captureListeners||{}:this._listeners=this._listeners||{})[t];return a&&this.removeEventListener(t,e,i),(a=n[t])?a.push(e):n[t]=[e],e},e.on=function(t,e,i,n,a,r){return e.handleEvent&&(i=i||e,e=e.handleEvent),i=i||this,this.addEventListener(t,function(t){e.call(i,t,a),n&&t.remove()},r)},e.removeEventListener=function(t,e,i){var n=i?this._captureListeners:this._listeners;if(n){var a=n[t];if(a)for(var r=0,s=a.length;s>r;r++)if(a[r]==e){1==s?delete n[t]:a.splice(r,1);break}}},e.off=e.removeEventListener,e.removeAllEventListeners=function(t){t?(this._listeners&&delete this._listeners[t],this._captureListeners&&delete this._captureListeners[t]):this._listeners=this._captureListeners=null},e.dispatchEvent=function(t,e,i){if("string"==typeof t){var n=this._listeners;if(!(e||n&&n[t]))return!0;t=new createjs.Event(t,e,i)}else t.target&&t.clone&&(t=t.clone());try{t.target=this}catch(t){}if(t.bubbles&&this.parent){for(var a=this,r=[a];a.parent;)r.push(a=a.parent);var s,o=r.length;for(s=o-1;s>=0&&!t.propagationStopped;s--)r[s]._dispatchEvent(t,1+(0==s));for(s=1;o>s&&!t.propagationStopped;s++)r[s]._dispatchEvent(t,3)}else this._dispatchEvent(t,2);return!t.defaultPrevented},e.hasEventListener=function(t){var e=this._listeners,i=this._captureListeners;return!!(e&&e[t]||i&&i[t])},e.willTrigger=function(t){for(var e=this;e;){if(e.hasEventListener(t))return!0;e=e.parent}return!1},e.toString=function(){return"[EventDispatcher]"},e._dispatchEvent=function(t,e){var i,n,a=2>=e?this._captureListeners:this._listeners;if(t&&a&&(n=a[t.type])&&(i=n.length)){try{t.currentTarget=this}catch(t){}try{t.eventPhase=0|e}catch(t){}t.removed=!1,n=n.slice();for(var r=0;i>r&&!t.immediatePropagationStopped;r++){var s=n[r];s.handleEvent?s.handleEvent(t):s(t),t.removed&&(this.off(t.type,s,1==e),t.removed=!1)}}2===e&&this._dispatchEvent(t,2.1)},createjs.EventDispatcher=t}(),this.createjs=this.createjs||{},function(){function t(){throw"Ticker cannot be instantiated."}t.RAF_SYNCHED="synched",t.RAF="raf",t.TIMEOUT="timeout",t.timingMode=null,t.maxDelta=0,t.paused=!1,t.removeEventListener=null,t.removeAllEventListeners=null,t.dispatchEvent=null,t.hasEventListener=null,t._listeners=null,createjs.EventDispatcher.initialize(t),t._addEventListener=t.addEventListener,t.addEventListener=function(){return!t._inited&&t.init(),t._addEventListener.apply(t,arguments)},t._inited=!1,t._startTime=0,t._pausedTime=0,t._ticks=0,t._pausedTicks=0,t._interval=50,t._lastTime=0,t._times=null,t._tickTimes=null,t._timerId=null,t._raf=!0,t._setInterval=function(e){t._interval=e,t._inited&&t._setupTick()},t.setInterval=createjs.deprecate(t._setInterval,"Ticker.setInterval"),t._getInterval=function(){return t._interval},t.getInterval=createjs.deprecate(t._getInterval,"Ticker.getInterval"),t._setFPS=function(e){t._setInterval(1e3/e)},t.setFPS=createjs.deprecate(t._setFPS,"Ticker.setFPS"),t._getFPS=function(){return 1e3/t._interval},t.getFPS=createjs.deprecate(t._getFPS,"Ticker.getFPS");try{Object.defineProperties(t,{interval:{get:t._getInterval,set:t._setInterval},framerate:{get:t._getFPS,set:t._setFPS}})}catch(t){console.log(t)}t.init=function(){t._inited||(t._inited=!0,t._times=[],t._tickTimes=[],t._startTime=t._getTime(),t._times.push(t._lastTime=0),t.interval=t._interval)},t.reset=function(){if(t._raf){var e=window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.oCancelAnimationFrame||window.msCancelAnimationFrame;e&&e(t._timerId)}else clearTimeout(t._timerId);t.removeAllEventListeners("tick"),t._timerId=t._times=t._tickTimes=null,t._startTime=t._lastTime=t._ticks=t._pausedTime=0,t._inited=!1},t.getMeasuredTickTime=function(e){var i=0,n=t._tickTimes;if(!n||n.length<1)return-1;e=Math.min(n.length,e||0|t._getFPS());for(var a=0;e>a;a++)i+=n[a];return i/e},t.getMeasuredFPS=function(e){var i=t._times;return!i||i.length<2?-1:(e=Math.min(i.length-1,e||0|t._getFPS()),1e3/((i[0]-i[e])/e))},t.getTime=function(e){return t._startTime?t._getTime()-(e?t._pausedTime:0):-1},t.getEventTime=function(e){return t._startTime?(t._lastTime||t._startTime)-(e?t._pausedTime:0):-1},t.getTicks=function(e){return t._ticks-(e?t._pausedTicks:0)},t._handleSynch=function(){t._timerId=null,t._setupTick(),t._getTime()-t._lastTime>=.97*(t._interval-1)&&t._tick()},t._handleRAF=function(){t._timerId=null,t._setupTick(),t._tick()},t._handleTimeout=function(){t._timerId=null,t._setupTick(),t._tick()},t._setupTick=function(){if(null==t._timerId){var e=t.timingMode;if(e==t.RAF_SYNCHED||e==t.RAF){var i=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame;if(i)return t._timerId=i(e==t.RAF?t._handleRAF:t._handleSynch),void(t._raf=!0)}t._raf=!1,t._timerId=setTimeout(t._handleTimeout,t._interval)}},t._tick=function(){var e=t.paused,i=t._getTime(),n=i-t._lastTime;if(t._lastTime=i,t._ticks++,e&&(t._pausedTicks++,t._pausedTime+=n),t.hasEventListener("tick")){var a=new createjs.Event("tick"),r=t.maxDelta;a.delta=r&&n>r?r:n,a.paused=e,a.time=i,a.runTime=i-t._pausedTime,t.dispatchEvent(a)}for(t._tickTimes.unshift(t._getTime()-i);t._tickTimes.length>100;)t._tickTimes.pop();for(t._times.unshift(i);t._times.length>100;)t._times.pop()};var e=window,i=e.performance.now||e.performance.mozNow||e.performance.msNow||e.performance.oNow||e.performance.webkitNow;t._getTime=function(){return(i&&i.call(e.performance)||(new Date).getTime())-t._startTime},createjs.Ticker=t}(),this.createjs=this.createjs||{},function(){function t(t){this.EventDispatcher_constructor(),this.ignoreGlobalPause=!1,this.loop=0,this.useTicks=!1,this.reversed=!1,this.bounce=!1,this.timeScale=1,this.duration=0,this.position=0,this.rawPosition=-1,this._paused=!0,this._next=null,this._prev=null,this._parent=null,this._labels=null,this._labelList=null,t&&(this.useTicks=!!t.useTicks,this.ignoreGlobalPause=!!t.ignoreGlobalPause,this.loop=!0===t.loop?-1:t.loop||0,this.reversed=!!t.reversed,this.bounce=!!t.bounce,this.timeScale=t.timeScale||1,t.onChange&&this.addEventListener("change",t.onChange),t.onComplete&&this.addEventListener("complete",t.onComplete))}var e=createjs.extend(t,createjs.EventDispatcher);e._setPaused=function(t){return createjs.Tween._register(this,t),this},e.setPaused=createjs.deprecate(e._setPaused,"AbstractTween.setPaused"),e._getPaused=function(){return this._paused},e.getPaused=createjs.deprecate(e._getPaused,"AbstactTween.getPaused"),e._getCurrentLabel=function(t){var e=this.getLabels();null==t&&(t=this.position);for(var i=0,n=e.length;n>i&&!(tt&&(t=0),0===a){if(l=!0,-1!==s)return l}else{if(h=t-(o=t/a|0)*a,(l=-1!==r&&t>=r*a+a)&&(t=(h=a)*(o=r)+a),t===s)return l;!this.reversed!=!(this.bounce&&o%2)&&(h=a-h)}this.position=h,this.rawPosition=t,this._updatePosition(i,l),l&&(this.paused=!0),n&&n(this),e||this._runActions(s,t,i,!i&&-1===s),this.dispatchEvent("change"),l&&this.dispatchEvent("complete")},e.calculatePosition=function(t){var e=this.duration,i=this.loop,n=0,a=0;return 0===e?0:(-1!==i&&t>=i*e+e?(a=e,n=i):0>t?a=0:a=t-(n=t/e|0)*e,!this.reversed!=!(this.bounce&&n%2)?e-a:a)},e.getLabels=function(){var t=this._labelList;if(!t){t=this._labelList=[];var e=this._labels;for(var i in e)t.push({label:i,position:e[i]});t.sort(function(t,e){return t.position-e.position})}return t},e.setLabels=function(t){this._labels=t,this._labelList=null},e.addLabel=function(t,e){this._labels||(this._labels={}),this._labels[t]=e;var i=this._labelList;if(i){for(var n=0,a=i.length;a>n&&!(ep&&(o=h,r=p),a>p&&(s=h,a=p)),i)return this._runActionsRange(o,o,i,n);if(a!==r||s!==o||i||n){-1===a&&(a=s=0);var c=e>=t,_=a;do{var d=_===a?s:c?0:h,f=_===r?o:c?h:0;if(!l!=!(u&&_%2)&&(d=h-d,f=h-f),u&&_!==a&&d===f);else if(this._runActionsRange(d,f,i,n||_!==a&&!u))return!0;n=!1}while(c&&++_<=r||!c&&--_>=r)}}},e._runActionsRange=function(){},createjs.AbstractTween=createjs.promote(t,"EventDispatcher")}(),this.createjs=this.createjs||{},function(){function t(i,n){this.AbstractTween_constructor(n),this.pluginData=null,this.target=i,this.passive=!1,this._stepHead=new e(null,0,0,{},null,!0),this._stepTail=this._stepHead,this._stepPosition=0,this._actionHead=null,this._actionTail=null,this._plugins=null,this._pluginIds=null,this._injected=null,n&&(this.pluginData=n.pluginData,n.override&&t.removeTweens(i)),this.pluginData||(this.pluginData={}),this._init(n)}function e(t,e,i,n,a,r){this.next=null,this.prev=t,this.t=e,this.d=i,this.props=n,this.ease=a,this.passive=r,this.index=t?t.index+1:0}var i=createjs.extend(t,createjs.AbstractTween);t.IGNORE={},t._tweens=[],t._plugins=null,t._tweenHead=null,t._tweenTail=null,t.get=function(e,i){return new t(e,i)},t.tick=function(e,i){for(var n=t._tweenHead;n;){var a=n._next;i&&!n.ignoreGlobalPause||n._paused||n.advance(n.useTicks?1:e),n=a}},t.handleEvent=function(t){"tick"===t.type&&this.tick(t.delta,t.paused)},t.removeTweens=function(e){if(e.tweenjs_count){for(var i=t._tweenHead;i;){var n=i._next;i.target===e&&t._register(i,!0),i=n}e.tweenjs_count=0}},t.removeAllTweens=function(){for(var e=t._tweenHead;e;){var i=e._next;e._paused=!0,e.target&&(e.target.tweenjs_count=0),e._next=e._prev=null,e=i}t._tweenHead=t._tweenTail=null},t.hasActiveTweens=function(e){return e?!!e.tweenjs_count:!!t._tweenHead},t._installPlugin=function(e){for(var i=e.priority=e.priority||0,n=t._plugins=t._plugins||[],a=0,r=n.length;r>a&&!(i0&&this._addStep(+t,this._stepTail.props,null,e),this},i.to=function(t,e,i){(null==e||0>e)&&(e=0);var n=this._addStep(+e,null,i);return this._appendProps(t,n),this},i.label=function(t){return this.addLabel(t,this.duration),this},i.call=function(t,e,i){return this._addAction(i||this.target,t,e||[this])},i.set=function(t,e){return this._addAction(e||this.target,this._set,[t])},i.play=function(t){return this._addAction(t||this,this._set,[{paused:!1}])},i.pause=function(t){return this._addAction(t||this,this._set,[{paused:!0}])},i.w=i.wait,i.t=i.to,i.c=i.call,i.s=i.set,i.toString=function(){return"[Tween]"},i.clone=function(){throw"Tween can not be cloned."},i._addPlugin=function(t){var e=this._pluginIds||(this._pluginIds={}),i=t.ID;if(i&&!e[i]){e[i]=!0;for(var n=this._plugins||(this._plugins=[]),a=t.priority||0,r=0,s=n.length;s>r;r++)if(a=1?s:r,u)for(var c=0,_=u.length;_>c;c++){var d=u[c].change(this,e,p,a,i,n);if(d===t.IGNORE)continue t;void 0!==d&&(a=d)}this.target[p]=a}}},i._runActionsRange=function(t,e,i,n){var a=t>e,r=a?this._actionTail:this._actionHead,s=e,o=t;a&&(s=t,o=e);for(var h=this.position;r;){var l=r.t;if((l===e||l>o&&s>l||n&&l===t)&&(r.funct.apply(r.scope,r.params),h!==this.position))return!0;r=a?r.prev:r.next}},i._appendProps=function(e,i,n){var a,r,s,o,h,l=this._stepHead.props,u=this.target,p=t._plugins,c=i.prev,_=c.props,d=i.props||(i.props=this._cloneProps(_)),f={};for(a in e)if(e.hasOwnProperty(a)&&(f[a]=d[a]=e[a],void 0===l[a])){if(o=void 0,p)for(r=p.length-1;r>=0;r--)if(void 0!==(s=p[r].init(this,a,o))&&(o=s),o===t.IGNORE){delete d[a],delete f[a];break}o!==t.IGNORE&&(void 0===o&&(o=u[a]),_[a]=void 0===o?null:o)}for(a in f){s=e[a];for(var m,g=c;(m=g)&&(g=m.prev);)if(g.props!==m.props){if(void 0!==g.props[a])break;g.props[a]=_[a]}}if(!1!==n&&(p=this._plugins))for(r=p.length-1;r>=0;r--)p[r].step(this,i,f);(h=this._injected)&&(this._injected=null,this._appendProps(h,i,!1))},i._injectProp=function(t,e){(this._injected||(this._injected={}))[t]=e},i._addStep=function(t,i,n,a){var r=new e(this._stepTail,this.duration,t,i,n,a||!1);return this.duration+=t,this._stepTail=this._stepTail.next=r},i._addAction=function(t,e,i){var n=new function(t,e,i,n,a){this.next=null,this.prev=t,this.t=e,this.d=0,this.scope=i,this.funct=n,this.params=a}(this._actionTail,this.duration,t,e,i);return this._actionTail?this._actionTail.next=n:this._actionHead=n,this._actionTail=n,this},i._set=function(t){for(var e in t)this[e]=t[e]},i._cloneProps=function(t){var e={};for(var i in t)e[i]=t[i];return e},createjs.Tween=createjs.promote(t,"AbstractTween")}(),this.createjs=this.createjs||{},function(){function t(t){var e,i;t instanceof Array||null==t&&arguments.length>1?(e=t,i=arguments[1],t=arguments[2]):t&&(e=t.tweens,i=t.labels),this.AbstractTween_constructor(t),this.tweens=[],e&&this.addTween.apply(this,e),this.setLabels(i),this._init(t)}var e=createjs.extend(t,createjs.AbstractTween);e.addTween=function(t){t._parent&&t._parent.removeTween(t);var e=arguments.length;if(e>1){for(var i=0;e>i;i++)this.addTween(arguments[i]);return arguments[e-1]}if(0===e)return null;this.tweens.push(t),t._parent=this,t.paused=!0;var n=t.duration;return t.loop>0&&(n*=t.loop+1),n>this.duration&&(this.duration=n),this.rawPosition>=0&&t.setPosition(this.rawPosition),t},e.removeTween=function(t){var e=arguments.length;if(e>1){for(var i=!0,n=0;e>n;n++)i=i&&this.removeTween(arguments[n]);return i}if(0===e)return!0;var a=this.tweens;for(n=a.length;n--;)if(a[n]===t)return a.splice(n,1),t._parent=null,t.duration>=this.duration&&this.updateDuration(),!0;return!1},e.updateDuration=function(){this.duration=0;for(var t=0,e=this.tweens.length;e>t;t++){var i=this.tweens[t],n=i.duration;i.loop>0&&(n*=i.loop+1),n>this.duration&&(this.duration=n)}},e.toString=function(){return"[Timeline]"},e.clone=function(){throw"Timeline can not be cloned."},e._updatePosition=function(t){for(var e=this.position,i=0,n=this.tweens.length;n>i;i++)this.tweens[i].setPosition(e,!0,t)},e._runActionsRange=function(t,e,i,n){for(var a=this.position,r=0,s=this.tweens.length;s>r;r++)if(this.tweens[r]._runActions(t,e,i,n),a!==this.position)return!0},createjs.Timeline=createjs.promote(t,"AbstractTween")}(),this.createjs=this.createjs||{},function(){function t(){throw"Ease cannot be instantiated."}t.linear=function(t){return t},t.none=t.linear,t.get=function(t){return-1>t?t=-1:t>1&&(t=1),function(e){return 0==t?e:0>t?e*(e*-t+1+t):e*((2-e)*t+(1-t))}},t.getPowIn=function(t){return function(e){return Math.pow(e,t)}},t.getPowOut=function(t){return function(e){return 1-Math.pow(1-e,t)}},t.getPowInOut=function(t){return function(e){return(e*=2)<1?.5*Math.pow(e,t):1-.5*Math.abs(Math.pow(2-e,t))}},t.quadIn=t.getPowIn(2),t.quadOut=t.getPowOut(2),t.quadInOut=t.getPowInOut(2),t.cubicIn=t.getPowIn(3),t.cubicOut=t.getPowOut(3),t.cubicInOut=t.getPowInOut(3),t.quartIn=t.getPowIn(4),t.quartOut=t.getPowOut(4),t.quartInOut=t.getPowInOut(4),t.quintIn=t.getPowIn(5),t.quintOut=t.getPowOut(5),t.quintInOut=t.getPowInOut(5),t.sineIn=function(t){return 1-Math.cos(t*Math.PI/2)},t.sineOut=function(t){return Math.sin(t*Math.PI/2)},t.sineInOut=function(t){return-.5*(Math.cos(Math.PI*t)-1)},t.getBackIn=function(t){return function(e){return e*e*((t+1)*e-t)}},t.backIn=t.getBackIn(1.7),t.getBackOut=function(t){return function(e){return--e*e*((t+1)*e+t)+1}},t.backOut=t.getBackOut(1.7),t.getBackInOut=function(t){return t*=1.525,function(e){return(e*=2)<1?.5*e*e*((t+1)*e-t):.5*((e-=2)*e*((t+1)*e+t)+2)}},t.backInOut=t.getBackInOut(1.7),t.circIn=function(t){return-(Math.sqrt(1-t*t)-1)},t.circOut=function(t){return Math.sqrt(1- --t*t)},t.circInOut=function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},t.bounceIn=function(e){return 1-t.bounceOut(1-e)},t.bounceOut=function(t){return 1/2.75>t?7.5625*t*t:2/2.75>t?7.5625*(t-=1.5/2.75)*t+.75:2.5/2.75>t?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},t.bounceInOut=function(e){return.5>e?.5*t.bounceIn(2*e):.5*t.bounceOut(2*e-1)+.5},t.getElasticIn=function(t,e){var i=2*Math.PI;return function(n){if(0==n||1==n)return n;var a=e/i*Math.asin(1/t);return-t*Math.pow(2,10*(n-=1))*Math.sin((n-a)*i/e)}},t.elasticIn=t.getElasticIn(1,.3),t.getElasticOut=function(t,e){var i=2*Math.PI;return function(n){if(0==n||1==n)return n;var a=e/i*Math.asin(1/t);return t*Math.pow(2,-10*n)*Math.sin((n-a)*i/e)+1}},t.elasticOut=t.getElasticOut(1,.3),t.getElasticInOut=function(t,e){var i=2*Math.PI;return function(n){var a=e/i*Math.asin(1/t);return(n*=2)<1?-.5*t*Math.pow(2,10*(n-=1))*Math.sin((n-a)*i/e):t*Math.pow(2,-10*(n-=1))*Math.sin((n-a)*i/e)*.5+1}},t.elasticInOut=t.getElasticInOut(1,.3*1.5),createjs.Ease=t}(),this.createjs=this.createjs||{},function(){function t(){throw"MotionGuidePlugin cannot be instantiated."}var e=t;e.priority=0,e.ID="MotionGuide",e.install=function(){return createjs.Tween._installPlugin(t),createjs.Tween.IGNORE},e.init=function(t,i){"guide"==i&&t._addPlugin(e)},e.step=function(t,i,n){for(var a in n)if("guide"===a){var r=i.props.guide,s=e._solveGuideData(n.guide,r);r.valid=!s;var o=r.endData;if(t._injectProp("x",o.x),t._injectProp("y",o.y),s||!r.orient)break;var h=void 0===i.prev.props.rotation?t.target.rotation||0:i.prev.props.rotation;if(r.startOffsetRot=h-r.startData.rotation,"fixed"==r.orient)r.endAbsRot=o.rotation+r.startOffsetRot,r.deltaRotation=0;else{var l=void 0===n.rotation?t.target.rotation||0:n.rotation,u=l-r.endData.rotation-r.startOffsetRot,p=u%360;switch(r.endAbsRot=l,r.orient){case"auto":r.deltaRotation=u;break;case"cw":r.deltaRotation=(p+360)%360+360*Math.abs(u/360|0);break;case"ccw":r.deltaRotation=(p-360)%360+-360*Math.abs(u/360|0)}}t._injectProp("rotation",r.endAbsRot)}},e.change=function(t,i,n,a,r){var s=i.props.guide;if(s&&i.props!==i.prev.props&&s!==i.prev.props.guide)return"guide"===n&&!s.valid||"x"==n||"y"==n||"rotation"===n&&s.orient?createjs.Tween.IGNORE:void e._ratioToPositionData(r,s,t.target)},e.debug=function(t,i,n){t=t.guide||t;var a=e._findPathProblems(t);if(a&&console.error("MotionGuidePlugin Error found: \n"+a),!i)return a;var r=t.path,s=r.length;for(i.save(),i.lineCap="round",i.lineJoin="miter",i.beginPath(),i.moveTo(r[0],r[1]),u=2;s>u;u+=4)i.quadraticCurveTo(r[u],r[u+1],r[u+2],r[u+3]);i.strokeStyle="black",i.lineWidth=4.5,i.stroke(),i.strokeStyle="white",i.lineWidth=3,i.stroke(),i.closePath();var o=n.length;if(n&&o){var h={},l={};e._solveGuideData(t,h);for(var u=0;o>u;u++)h.orient="fixed",e._ratioToPositionData(n[u],h,l),i.beginPath(),i.moveTo(l.x,l.y),i.lineTo(l.x+9*Math.cos(.0174533*l.rotation),l.y+9*Math.sin(.0174533*l.rotation)),i.strokeStyle="black",i.lineWidth=4.5,i.stroke(),i.strokeStyle="red",i.lineWidth=3,i.stroke(),i.closePath()}return i.restore(),a},e._solveGuideData=function(t,i){var n;if(n=e.debug(t))return n;var a=i.path=t.path;i.orient=t.orient,i.subLines=[],i.totalLength=0,i.startOffsetRot=0,i.deltaRotation=0,i.startData={ratio:0},i.endData={ratio:1},i.animSpan=1;var r,s,o,h,l,u,p,c,_,d=a.length,f={};for(r=a[0],s=a[1],p=2;d>p;p+=4){o=a[p],h=a[p+1],l=a[p+2],u=a[p+3];var m={weightings:[],estLength:0,portion:0},g=r,y=s;for(c=1;10>=c;c++){e._getParamsForCurve(r,s,o,h,l,u,c/10,!1,f);var v=f.x-g,T=f.y-y;_=Math.sqrt(v*v+T*T),m.weightings.push(_),m.estLength+=_,g=f.x,y=f.y}for(i.totalLength+=m.estLength,c=0;10>c;c++)_=m.estLength,m.weightings[c]=m.weightings[c]/_;i.subLines.push(m),r=l,s=u}_=i.totalLength;var b=i.subLines.length;for(p=0;b>p;p++)i.subLines[p].portion=i.subLines[p].estLength/_;var I=isNaN(t.start)?0:t.start,S=isNaN(t.end)?1:t.end;e._ratioToPositionData(I,i,i.startData),e._ratioToPositionData(S,i,i.endData),i.startData.ratio=I,i.endData.ratio=S,i.animSpan=i.endData.ratio-i.startData.ratio},e._ratioToPositionData=function(t,i,n){var a,r,s,o,h,l=i.subLines,u=0,p=t*i.animSpan+i.startData.ratio;for(r=l.length,a=0;r>a;a++){if(u+(o=l[a].portion)>=p){h=a;break}u+=o}void 0===h&&(h=r-1,u-=o);var c=l[h].weightings,_=o;for(r=c.length,a=0;r>a&&!(u+(o=c[a]*_)>=p);a++)u+=o;h=4*h+2,s=a/10+(p-u)/o*.1;var d=i.path;return e._getParamsForCurve(d[h-2],d[h-1],d[h],d[h+1],d[h+2],d[h+3],s,i.orient,n),i.orient&&(t>=.99999&&1.00001>=t&&void 0!==i.endAbsRot?n.rotation=i.endAbsRot:n.rotation+=i.startOffsetRot+t*i.deltaRotation),n},e._getParamsForCurve=function(t,e,i,n,a,r,s,o,h){var l=1-s;h.x=l*l*t+2*l*s*i+s*s*a,h.y=l*l*e+2*l*s*n+s*s*r,o&&(h.rotation=57.2957795*Math.atan2((n-e)*l+(r-n)*s,(i-t)*l+(a-i)*s))},e._findPathProblems=function(t){var e=t.path,i=e&&e.length||0;if(6>i||(i-2)%4){var n="\tCannot parse 'path' array due to invalid number of entries in path. ";return n+="There should be an odd number of points, at least 3 points, and 2 entries per point (x & y). ",(n+="See 'CanvasRenderingContext2D.quadraticCurveTo' for details as 'path' models a quadratic bezier.\n\n")+"Only [ "+i+" ] values found. Expected: "+Math.max(4*Math.ceil((i-2)/4)+2,6)}for(var a=0;i>a;a++)if(isNaN(e[a]))return"All data in path array must be numeric";var r=t.start;if(isNaN(r)&&void 0!==r)return"'start' out of bounds. Expected 0 to 1, got: "+r;var s=t.end;if(isNaN(s)&&void 0!==s)return"'end' out of bounds. Expected 0 to 1, got: "+s;var o=t.orient;return o&&"fixed"!=o&&"auto"!=o&&"cw"!=o&&"ccw"!=o?'Invalid orientation value. Expected ["fixed", "auto", "cw", "ccw", undefined], got: '+o:void 0},createjs.MotionGuidePlugin=t}(),this.createjs=this.createjs||{},function(){var t=createjs.TweenJS=createjs.TweenJS||{};t.version="1.0.0",t.buildDate="Thu, 14 Sep 2017 19:47:47 GMT"}(),function(t){var e=-1,i={onVisible:function(t){var e=i.isSupported();if(!e||!i.hidden())return t(),e;var n=i.change(function(e,a){i.hidden()||(i.unbind(n),t())});return n},change:function(t){if(!i.isSupported())return!1;var n=e+=1;return i._callbacks[n]=t,i._listen(),n},unbind:function(t){delete i._callbacks[t]},afterPrerendering:function(t){var e=i.isSupported();if(!e||"prerender"!=i.state())return t(),e;var n=i.change(function(e,a){"prerender"!=a&&(i.unbind(n),t())});return n},hidden:function(){return!(!i._doc.hidden&&!i._doc.webkitHidden)},state:function(){return i._doc.visibilityState||i._doc.webkitVisibilityState||"visible"},isSupported:function(){return!(!i._doc.visibilityState&&!i._doc.webkitVisibilityState)},_doc:document||{},_callbacks:{},_change:function(t){var e=i.state();for(var n in i._callbacks)i._callbacks[n].call(i._doc,t,e)},_listen:function(){if(!i._init){var t="visibilitychange";i._doc.webkitVisibilityState&&(t="webkit"+t);var e=function(){i._change.apply(i,arguments)};i._doc.addEventListener?i._doc.addEventListener(t,e):i._doc.attachEvent(t,e),i._init=!0}}};"undefined"!=typeof module&&module.exports?module.exports=i:t.Visibility=i}(this),function(t,e){function i(t){this.initialize(t)}i.prototype=Object.create(PIXI.Container.prototype),i.prototype.constructor=i,i.prototype.initialize=function(t){PIXI.Container.call(this),this.anchor={x:0,y:0,set:function(){}},this.backgroundWidth=void 0!==t.backgroundWidth?t.backgroundWidth:500,this.backgroundHeight=void 0!==t.backgroundHeight?t.backgroundHeight:80,this.backgroundTint=void 0!==t.backgroundTint?t.backgroundTint:16777215,this.foregroundWidth=void 0!==t.foregroundWidth?t.foregroundWidth:500,this.foregroundHeight=void 0!==t.foregroundHeight?t.foregroundHeight:80,this.foregroundTint=void 0!==t.foregroundTint?t.foregroundTint:16777215,this.offsetX=void 0!==t.offsetX?t.offsetX:0,this.offsetY=void 0!==t.offsetY?t.offsetY:0,this.isAnimated=!0,this.duration=100,this.background=new PIXI.Sprite,this.background.texture=PIXI.Texture.WHITE,this.background.tint=this.backgroundTint,this.background.stretch(this.backgroundWidth,this.backgroundHeight),this.addChild(this.background),this.foregroundContainer=new PIXI.Container,this.addChild(this.foregroundContainer),this.foreground=new PIXI.Sprite,this.foreground.texture=PIXI.Texture.WHITE,this.foreground.tint=this.foregroundTint,this.foreground.stretch(this.foregroundWidth,this.foregroundHeight),this.foregroundContainer.addChild(this.foreground),this.foregroundContainer.x=this.offsetX,this.foregroundContainer.y=this.offsetY,this.background.x=0,this.background.y=0,this.percentage=0,this.toPercentage=1,this.isAnimating=!1;var e=new PIXI.Graphics;this.foreground.mask=e,this.foregroundContainer.addChild(e),this.centered()},i.prototype.setPercent=function(t,e){this.timeout=this.duration,this.isAnimating=void 0===e?this.isAnimated:e,this.isAnimating?this.toPercentage=t:(this.toPercentage=t,this.percentage=t,this.drawMask(t))},i.prototype.onUpdate=function(t){if(this.isAnimating&&this.timeout>0){this.timeout-=t;var e=(this.duration-this.timeout)/this.duration,i=this.toPercentage-this.percentage;this.drawMask(this.percentage+i*e)}this.timeout<=0&&this.percentage!==this.toPercentage&&(this.isAnimating=!1,this.percentage=this.toPercentage,this.drawMask(this.toPercentage))},i.prototype.drawMask=function(t){var e=this.foreground.mask,i=-this.foregroundWidth*this.anchor.x-this.offsetX*this.anchor.x,n=-this.foregroundHeight*this.anchor.y-this.offsetY*this.anchor.y;e&&(e.clear(),e.beginFill(16777215,1),e.drawRect(i,n,this.foregroundWidth*t,this.foregroundHeight),e.endFill()),this.percentage=t},t.LoadingBar=i}(window),function(t,e){var i=function(t,e,n,a){switch(this.$init(),e=void 0===e?0:e,n=void 0!==n&&n,a=void 0===a?"manhattan":a,t=t[0].row,this._map=t,this._mapMaxX=this._map[0].length-1,this._mapMaxY=this._map.length-1,this._testCorners=n,this._walkableValue=e,a){case i.MANHATTAN:this._heuristic=this.manhattan;break;case i.EUCLIDIAN:this._heuristic=this.euclidian;break;case i.DIAGONAL:this._heuristic=this.diagonal;break;default:throw new ArgumentError('Heuristic "'+a+'" is not supported.')}};i.STRAIGHT_COST=1,i.DIAG_COST=0,i.MANHATTAN=null,i.EUCLIDIAN=null,i.DIAGONAL=null,i.$cinit=function(){i.STRAIGHT_COST=1,i.DIAG_COST=Math.SQRT2,i.MANHATTAN="manhattan",i.EUCLIDIAN="euclidian",i.DIAGONAL="diagonal"},i.$cinit(),i.prototype.$init=function(){this._map=null,this._openList=null,this._openHash=null,this._closedHash=null,this._walkableValue=null,this._heuristic=null},i.prototype._map=null,i.prototype._openList=null,i.prototype._openHash=null,i.prototype._closedHash=null,i.prototype._mapMaxX=0,i.prototype._mapMaxY=0,i.prototype._endX=0,i.prototype._endY=0,i.prototype._walkableValue=null,i.prototype._heuristic=null,i.prototype._testCorners=!1,i.prototype.search=function(t,e,i,n){this._openList=[],this._openHash={},this._closedHash={},this._endX=i,this._endY=n;var a=this._heuristic(t,e);return this._search(new AStarNode(t,e,0,a,a))},i.prototype.searchReduced=function(t,e,i,n,a){a=void 0===a?2147483647:a;var r=null,s=null,o=0,h=0,l=0,u=0,p=0,c=0,_=0,d=0,f=0,m=0,g=0,y=0,v=0,T=0,b=this.search(t,e,i,n);if(!b||1==a)return b;for(var I=1;I(u=(l=s._y-r._y)<0?parseInt(-l):parseInt(l))?parseInt(h):parseInt(u))>a)for(d=a*(c=0==o?0:o<0?-1:1),f=a*(_=0==l?0:l<0?-1:1),g=.5*(p-a*((m=(p-1)/a)-1))-a,y=r._x+g*c,v=r._y+g*_,T=1;T<=m;T++)y+=d,v+=f,b.splice(++S,0,new AStarNode(y,v));return b},i.prototype.nodesOnLine=function(t,e,i){if(t._x==e._x&&e._x==i._x)return!0;if(t._y==e._y&&e._y==i._y)return!0;var n=(t._x-e._x)/(i._x-e._x),a=(t._y-e._y)/(i._y-e._y);return!isNaN(n)&&n==a},i.prototype._search=function(t){for(var e=0,n=0,a=0,r=0,s=0,o=0,h=null,l=NaN,u=NaN,p=NaN,c=NaN,_=null,d=t;d._x!=this._endX||d._y!=this._endY;){for((e=d._x-1)<0&&(e=0),(n=d._x+1)>this._mapMaxX&&(n=this._mapMaxX),(a=d._y-1)<0&&(a=0),(r=d._y+1)>this._mapMaxY&&(r=this._mapMaxY),s=e;s<=n;s++)for(o=a;o<=r;o++)h=s+"_"+o,s==d._x&&o==d._y||this._map[o][s]!==this._walkableValue||this._closedHash[h]||this._testCorners&&(this._map[o][d._x]!==this._walkableValue||this._map[d._y][s]!==this._walkableValue)||(l=d._x==s||d._y==o?Number(i.STRAIGHT_COST):Number(i.DIAG_COST),c=(u=d.g+l)+(p=this._heuristic(s,o)),null==(_=this._openHash[h])?((_=new AStarNode(s,o,u,p,c))._parent=d,this._openList.push(_),this._openHash[_._id]=_):_.f>c&&(_.g=u,_.h=p,_.f=c,_._parent=d));if(0==this._openList.length)return null;this._openList.sort(function(t,e){return t.f>e.f}),d=this._openList.shift(),delete this._openHash[d._id],this._closedHash[d._id]=d}for(var f=d,m=[f];f._parent;)m.unshift(f._parent),f=f._parent;return m},i.prototype.dispose=function(){this._map=null,this._walkableValue=null,this._openList=null,this._openHash=null,this._closedHash=null},i.prototype.manhattan=function(t,e){var n=t-this._endX;n<0&&(n=-n);var a=e-this._endY;return a<0&&(a=-a),(n+a)*i.STRAIGHT_COST},i.prototype.euclidian=function(t,e){var n=t-this._endX,a=e-this._endY;return Math.sqrt(n*n+a*a)*i.STRAIGHT_COST},i.prototype.diagonal=function(t,e){var n=t-this._endX;n<0&&(n=-n);var a=e-this._endY;a<0&&(a=-a);var r=n16777215?(this.alpha=t>>>24,this.a=t>>>24):(this.alpha=255,this.a=t>>>255),this.red=t>>16&255,this.green=t>>8&255,this.blue=255&t,this.r=t>>16&255,this.g=t>>8&255,this.b=255&t},i.hex_to_color_32=function(t){return(t>16777215?t>>>24:t>>>255)<<24|(t>>16&255)<<16|(t>>8&255)<<8|255&t},i.get_color_32=function(t,e,i,n){return t<<24|e<<16|i<<8|n},i.hex_to_number=function(t){t=t.replace("#","0x");return t=PIXI.utils.hex2rgb(t),t=i.get_color_32(1,255*t[0],255*t[1],255*t[2])},t.Color=i}(window),function(t,e){function i(){this.initialize()}i.prototype.initialize=function(){this.__invalidate=!0,this.__totalDist,this.__knots=0,this.__t=[],this.__x=[],this.__y=[],this.__d=[],this.__xSpline3=new Spline3,this.__ySpline3=new Spline3},Object.defineProperty(i.prototype,"chordLength",{get:function(){return this.__invalidate&&this.__computeKnots(),this.__totalDist}}),i.prototype.addControlPoint=function(t,e){if(isNaN(t))throw"invalid x-coordinate at knot: "+(this.__knots+1);if(isNaN(e))throw"invalid y-coordinate at knot: "+(this.__knots+1);this.__invalidate=!0,this.__x.push(t),this.__y.push(e),this.__knots++},i.prototype.getX=function(t){return 0==this.__knots?NaN:1==this.__knots?this.__x[0]:(this.__invalidate&&this.__computeKnots(),this.__xSpline3.eval(t))},i.prototype.getY=function(t){return 0==this.__knots?NaN:1==this.__knots?this.__y[0]:(this.__invalidate&&this.__computeKnots(),this.__ySpline3.eval(t))},i.prototype.__computeKnots=function(){var t=NaN,e=NaN;this.__totalDist=0,this.__d[0]=0,this.__t[0]=0;for(var i=1;ithis.__t[this.__knots-1])this.__t.push(t),this.__y.push(e),this.__knots++;else if(t1)for(i=0;ithis.__t[i]&&t=i;n--)this.__t[n+1]=this.__t[n],this.__y[n+1]=this.__y[n];this.__t[i]=t,this.__y[i]=e,this.__knots++},i.prototype.deleteAllKnots=function(){this.__t.splice(0),this.__y.splice(0),this.__knots=0,this.__invalidate=!0},i.prototype.eval=function(t){var e,i,n,a=0,r=0;if(0==this.__knots)return NaN;if(1==this.__knots)return this.__y[0];for(this.__invalidate&&this.__computeZ(),a=0,this.__delta=t-this.__t[0],r=this.__knots-2;r>=0;r--)if(t>=this.__t[r]){this.__delta=t-this.__t[r],a=r;break}return e=(this.__y[a+1]-this.__y[a])*this.__hInv[a]-this.__h[a]*(this.__z[a+1]+2*this.__z[a])*.166666666666667,i=.5*this.__z[a]+this.__delta*(this.__z[a+1]-this.__z[a])*.166666666666667*this.__hInv[a],n=e+this.__delta*i,this.__y[a]+this.__delta*n},i.prototype.__computeZ=function(){for(var t=0;t=1;t--)this.__z[t]=(this.__v[t]-this.__h[t]*this.__z[t+1])/this.__u[t];this.__z[0]=0,this.__invalidate=!1},t.Spline3=i}(window),Notes.StateEvent_ADDED_TRIGGER="StateEvent_ADDED_TRIGGER",Notes.StateEvent_DEACTIVATE="StateEvent_DEACTIVATE",Notes.TriggerEvent_TRIGGER="TriggerEvent_TRIGGER",Notes.EntityEvent_SHOW_FOOD="EntityEvent_SHOW_FOOD",function(t,e){function i(){this.initialize()}i.prototype=Object.create(PIXI.Container.prototype),i.prototype.constructor=i,i.prototype.initialize=function(){PIXI.Container.call(this),this.didShowMobile=!1,this.isInitialized=!1,this.padding=10,this._clip=PIXI.Sprite.from("door"),this.addChild(this._clip),this._catalogBtn=null,this._mainMenuBtn=null,this._restartDayBtn=null,this._nextDayBtn=null,this._submitScoreBtn=null,this._continueBtn=null,this._popup=null,this._successfulDay=!1,this._gameWin=!1,this._starEarned=!1,this._lastDayEarned=0,this._lastDayGoal=0,this._bankValueLabel=null,this._interstitial=null;var t=SOManager.getInstance().getValue("totalDaysPlaying")||0;SOManager.getInstance().setValue("totalDaysPlaying",t+1)},i.prototype.init=function(){this.isInitialized||(this.isInitialized=!0,this.onTweenCompleteHandler(),Managers.soundManager.play(SoundID.CURTAIN_DOWN_SFX))},i.prototype.createBtn=function(t,e,i,n,a,r){var s=new PIXI.Text(t,Styles.MENU_BTN);return n&&(s.style.fontSize=n),s.pointerup=this.onMouseClickHandler.bind(this),s.pointerover=this.btnHoverIn.bind(this),s.pointerout=this.btnHoverOut.bind(this),s.interactive=!0,s.buttonMode=!0,s.anchor.x=.5,s.anchor.y=1,s.position.set(e,i),s.rotation=a||0,this.addChild(s),s},i.prototype.onPopupClose=function(){this._popup instanceof ComicPopup&&this.showResults(),this._bankValueLabel&&(this._bankValueLabel.text="$"+formatThousands(Managers.progressManager.bank)),this._popup.removeFromParent(),this._popup.dispose(),this._popup=null},i.prototype.onTweenCompleteHandler=function(t){this.showResultsUI()},i.prototype.onInterstitialMouseClick=function(t){var e=t.target.name;"this._interstitialClip"==e?this.openInterstitialLink():"this._interstitialCloseButton"==e&&this.closeInterstitial()},i.prototype.openInterstitialLink=function(){Managers.soManager.setValue("interstitialTime",(new Date).getTime()),t.open("http://www.penguincity.com/penguindiner3d/","_blank")},i.prototype.closeInterstitial=function(){this._interstitial.removeFromParent(),this._interstitial=null,this.showResultsUI()},i.prototype.showResultsUI=function(){var t=Managers.progressManager;this._lastDayEarned=t.earned,this._lastDayGoal=t.dayInfo.goal,this._successfulDay=this._lastDayEarned>=this._lastDayGoal,this._starEarned=Number(this._lastDayEarned)>=1.3*Number(this._lastDayGoal),this._successfulDay&&(this._gameWin=t.updateNextDay()),this._starEarned&&(t.stars=t.stars+1),this._starEarned&&Managers.progressManager.willShowComicPopup(ComicPopup.FIRST_STAR)?this._popup=new ComicPopup(ComicPopup.FIRST_STAR,this):Managers.progressManager.bank>=Managers.configManager.getUpgradeMinPrice()&&Managers.progressManager.willShowComicPopup(ComicPopup.USE_CATALOG_HINT)?this._popup=new ComicPopup(ComicPopup.USE_CATALOG_HINT,this):Managers.progressManager.bank>=Managers.configManager.getChefMinPrice()&&Managers.progressManager.willShowComicPopup(ComicPopup.HIRE_CHEF_HINT)&&(this._popup=new ComicPopup(ComicPopup.HIRE_CHEF_HINT,this)),this._popup?this.addChild(this._popup):this.showResults()},i.prototype.showResults=function(){this.showDayResult();var t=this;createjs.Tween.get(this).wait(500).call(function(){t.showGoal()}).wait(500).call(function(){t.showEarned()}).wait(500).call(function(){t.showBank()}).wait(500).call(function(){t.showTotal()}).wait(500).call(function(){t.showStar()}).wait(500).call(function(){t.isGameWin()?t.showGameWinControls():t.isDaySuccessful()?t.showDayPassedControls():t.showDayFailedControls()})},i.prototype.onMouseClickHandler=function(t){switch(Managers.soundManager.play(SoundID.BUTTON_CLICK_SFX),t.target){case this._catalogBtn:var e=new UpgradesScreen;app.addScreen(e);break;case this._mainMenuBtn:e=new HomeScreen;app.addScreen(e);break;case this._restartDayBtn:AdManager.getInstance().showAd();e=new GameScreen;app.addScreen(e,app.ANIMATION_BLACKOUT,!0);break;case this._nextDayBtn:if(AdManager.getInstance().showAd(),0==Managers.progressManager.day){e=new MapScreen;app.addScreen(e,app.ANIMATION_BLACKOUT,!0)}else{e=new GameScreen;app.addScreen(e,app.ANIMATION_BLACKOUT,!0)}break;case this._submitScoreBtn:console.log("TODO submit score");break;case this._continueBtn:e=new EndScreen;app.addScreen(e,app.ANIMATION_BLACKOUT,!0)}},i.prototype.showDayResult=function(t){var e=new PIXI.Text(this._successfulDay?"A SUCCESSFUL DAY":"YOU DID NOT EARN ENOUGH FOR THE DAY",Styles.RESULT_LABEL);e.style.fill=this._successfulDay?39168:16711680,this.addChild(e),e.y=30,e.anchor.set(.5,0),e.x=app.width/2},i.prototype.showGoal=function(t){var e=new PIXI.Text("Needed:",Styles.RESULT_LABEL);this.addChild(e),e.anchor.set(1,0),e.x=app.width/2,e.y=100;var i=new PIXI.Text("$"+formatThousands(this._lastDayGoal),Styles.RESULT_LABEL);Managers.soundManager.play(SoundID.MONEY_PICKUP_SFX),this.addChild(i),i.anchor.set(0,0),i.x=app.width/2+this.padding,i.y=100},i.prototype.showEarned=function(t){var e=new PIXI.Text("Earned:",Styles.RESULT_LABEL);this.addChild(e),e.anchor.set(1,0),e.x=app.width/2,e.y=140;var i=new PIXI.Text("$"+formatThousands(this._lastDayEarned),Styles.RESULT_LABEL);this.addChild(i),i.anchor.set(0,0),i.x=app.width/2+this.padding,i.y=140,Managers.soundManager.play(SoundID.MONEY_PICKUP_SFX)},i.prototype.showBank=function(t){var e=new PIXI.Text("Bank:",Styles.RESULT_LABEL);this.addChild(e),e.anchor.set(1,0),e.x=app.width/2,e.y=180,this._bankValueLabel=new PIXI.Text("$"+formatThousands(Managers.progressManager.bank),Styles.RESULT_LABEL),this.addChild(this._bankValueLabel),this._bankValueLabel.anchor.set(0,0),this._bankValueLabel.x=app.width/2+this.padding,this._bankValueLabel.y=180,Managers.soundManager.play(SoundID.MONEY_PICKUP_SFX)},i.prototype.showTotal=function(t){var e=new PIXI.Text("Total:",Styles.RESULT_LABEL);this.addChild(e),e.anchor.set(1,0),e.x=app.width/2,e.y=220;var i=new PIXI.Text("$"+formatThousands(Managers.progressManager.score),Styles.RESULT_LABEL);this.addChild(i),i.anchor.set(0,0),i.x=app.width/2+this.padding,i.y=220,Managers.soundManager.play(SoundID.MONEY_PICKUP_SFX)},i.prototype.showStar=function(t){var e=null;this._starEarned&&((e=PIXI.Sprite.from("star")).anchor.set(.5,0),e.x=app.width/2,e.y=280,this.addChild(e),Managers.soundManager.play(SoundID.UPGRADE_BUY_SFX))},i.prototype.showDayPassedControls=function(t){this.showCommonControls(),this._nextDayBtn=this.createBtn("Start Next Day",app.width/2-130,app.height-70),this._nextDayBtn.beacon=!0,this.addChild(this._nextDayBtn)},i.prototype.showDayFailedControls=function(t){this.showCommonControls(),this._restartDayBtn=this.createBtn("Restart Day",app.width/2-130,app.height-70),this._restartDayBtn.beacon=!0,this.addChild(this._restartDayBtn)},i.prototype.showCommonControls=function(){this._catalogBtn=this.createBtn("Catalog",app.width/2+130,app.height-70),this._catalogBtn.beacon=!0,this.addChild(this._catalogBtn),this._mainMenuBtn=this.createBtn("Main Menu",app.width/2+130,app.height-30),this.addChild(this._mainMenuBtn);var t=new PIXI.Text("(Your progress will be saved)",Styles.RESULT_BOTTOM_LABEL);t.anchor.set(.5,1),t.position.set(app.width/2,app.height-6),this.addChild(t)},i.prototype.showGameWinControls=function(t){this._continueBtn=this.createBtn("Continue",app.width/2,app.height-30),this.addChild(this._continueBtn)},i.prototype.isGameWin=function(){return this._gameWin},i.prototype.isDaySuccessful=function(){return this._successfulDay},i.prototype.canShowInterstitial=function(){var t=parseInt(Managers.soManager.getValue("interstitialShowCounter"));if(t++,Managers.soManager.setValue("interstitialShowCounter",t),(t-1)%3!=0)return!1;if(!Managers.soManager.getValue("interstitialTime"))return!0;var e=(new Date).getTime()-Managers.soManager.getValue("interstitialTime");return!!(isNaN(e)||e<0)||e/1e3/60/60/24>=1},i.prototype.dispose=function(){},i.prototype.btnHoverIn=function(t){t.target.style.fill=Styles.MENU_BTN_HOVER.fill,Managers.soundManager.play(SoundID.BUTTON_ROLLOVER_SFX)},i.prototype.btnHoverOut=function(t){t.currentTarget&&(t.currentTarget.style.fill=Styles.MENU_BTN.fill)},i.prototype.onUpdate=function(t){},i.prototype.onShow=function(){if(this._bankValueLabel&&(this._bankValueLabel.text="$"+formatThousands(Managers.progressManager.bank)),(PIXI.utils.isMobile.phone||PIXI.utils.isMobile.tablet)&&!this.didShowMobile){var t=SOManager.getInstance().getValue("totalDaysPlaying");if(t>=3&&t%4==1){this.didShowMobile=!0;var e=new MobileScreen;return void app.addScreen(e)}}this.init()},i.prototype.onHide=function(){},t.DayResultScreen=i}(window),function(t,e){function i(){this.initialize()}i.prototype=Object.create(PIXI.Container.prototype),i.prototype.constructor=i,i.prototype.initialize=function(){PIXI.Container.call(this),this._finalScore=Managers.progressManager.score,this._popup=new ComicPopup(ComicPopup.GAME_WIN,this),this.addChild(this._popup)},i.prototype.onCommicContinue=function(t){1===t&&this.setButtons()},i.prototype.setButtons=function(){var t=new PIXI.Text("Final Score:",Styles.END_TEXT);t.style.fontSize=45,t.position.set(10,20),this.addChild(t);var e=new PIXI.Text("$"+formatThousands(this._finalScore),Styles.END_TEXT);e.style.fontSize=45,e.position.set(10+t.width+10,20),this.addChild(e),this.btn4=this.createBtn("MAIN MENU",10,70,35,0,this.onMainMenu)},i.prototype.createBtn=function(t,e,i,n,a,r){var s=new PIXI.Text(t,Styles.END_TEXT);return s.style.fontSize=n,s.pointerup=r.bind(this),s.pointerover=this.btnHoverIn.bind(this),s.pointerout=this.btnHoverOut.bind(this),s.interactive=!0,s.buttonMode=!0,s.anchor.x=0,s.position.set(e,i),s.rotation=a||0,this.addChild(s),s},i.prototype.onSubmit=function(t){},i.prototype.onHighScores=function(t){},i.prototype.onPlayMore=function(t){},i.prototype.onMainMenu=function(t){Managers.soundManager.play(SoundID.BUTTON_CLICK_SFX),Managers.progressManager.restartGame();var e=new HomeScreen;app.addScreen(e,App.ANIMATION_BLACKOUT,!0)},i.prototype.btnHoverIn=function(t){t.target.style.fill=Styles.END_TEXT_HOVER.fill,Managers.soundManager.play(SoundID.BUTTON_ROLLOVER_SFX)},i.prototype.btnHoverOut=function(t){t.currentTarget&&(t.currentTarget.style.fill=Styles.END_TEXT.fill)},i.prototype.onUpdate=function(t){},i.prototype.onShow=function(){Managers.soundManager.play(SoundID.CROWD_CLAP_SFX)},i.prototype.onHide=function(){},t.EndScreen=i}(window),function(t,e){function i(){this.initialize()}i.prototype=Object.create(PIXI.Container.prototype),i.prototype.constructor=i,i.prototype.initialize=function(){PIXI.Container.call(this),this.atmosphere=new Atmosphere1,this.atmosphere.setTheme(Managers.progressManager.roomTheme),this.addChild(this.atmosphere);var t=Sprite.from("resturant_environment");t.position.set(-11,-12),this.addChild(t),this.enterCarpet=Sprite.from("carpet_"+Managers.progressManager.roomTheme+"_entrance"),this.enterCarpet.position.set(-55,app.height/2-42),this.addChild(this.enterCarpet),this.mainCarpetBack=Sprite.from("carpet_back"),this.mainCarpetBack.anchor.set(.5,.5),this.mainCarpetBack.position.set(340,app.height/2+40),this.addChild(this.mainCarpetBack),this.mainCarpet=Sprite.from("carpet_theme_standard"),this.mainCarpet.anchor.set(.5,.5),this.mainCarpet.position.set(340,app.height/2+40),this.addChild(this.mainCarpet);0==Managers.progressManager.carpetDecoration?(this.mainCarpet.visible=!1,this.mainCarpetBack.visible=!1):(this.mainCarpet.texture=PIXI.utils.TextureCache["carpet_"+Managers.progressManager.roomTheme],this.mainCarpet.alpha=.4),this.clock=new Clock,this.clock.position.set(55,45),this.clock.setPercent(0),this.addChild(this.clock);var e=Managers.progressManager.roomTheme;0!=Managers.progressManager.clocksDecoration&&this.clock.setTheme(e),this._view=new GameView,this._view._controler=this,this.addChild(this._view),this._model=new GameModel,this._model.delegate=this,this.addChild(this._model),this.pause_btn=new PIXI.Text("PAUSE",Styles.PAUSE_BTN),this.pause_btn.anchor.set(1,1),this.pause_btn.pointerup=this.onPauseGameHandler.bind(this),this.pause_btn.pointerover=this.btnHoverIn.bind(this),this.pause_btn.pointerout=this.btnHoverOut.bind(this),this.pause_btn.buttonMode=!0,this.pause_btn.position.set(app.width-10,app.height-10),this.addChild(this.pause_btn);var i=this;this.atmosphere.setPercent(0);var n=PIXI.Sprite.from("door");n.anchor.set(.5,.5),n.x=app.width/2,n.y=app.height/2,this.addChild(n),(a=new PIXI.Text(Managers.progressManager.stageName+", Day "+(Managers.progressManager.day+1),Styles.DAY_START)).style.fontSize=40,a.centered(),a.position.set(app.width/2,app.height/2-25),this.addChild(a),(r=new PIXI.Text("You need to make $"+formatThousands(Managers.progressManager.dayInfo.goal),Styles.DAY_START)).centered(),r.position.set(app.width/2,app.height/2+12),this.addChild(r),this._dLabel=a,this._gLabel=r,this.door=n,createjs.Tween.get(this.door).wait(900).call(function(){Managers.soundManager.play(SoundID.CURTAIN_UP_SFX)}).to({y:-app.height/2},900).call(function(){i.door.removeFromParent(),i.pause_btn.interactive=!0,i.onBlindsOpenHandler()});var a=this._dLabel,r=this._gLabel;createjs.Tween.get(a).wait(2e3).to({alpha:0},600).call(function(){a.removeFromParent()}),createjs.Tween.get(r).wait(2e3).to({alpha:0},600).call(function(){r.removeFromParent()})},i.prototype.btnPauseHoverIn=function(t){t.target.style.fill=Styles.PAUSE_MENU_BTN_HOVER.fill},i.prototype.btnPauseHoverOut=function(t){t.currentTarget&&(t.currentTarget.style.fill=Styles.PAUSE_MENU_BTN.fill)},i.prototype.btnHoverIn=function(t){t.target.style.fill=Styles.PAUSE_BTN_HOVER.fill},i.prototype.btnHoverOut=function(t){t.currentTarget&&(t.currentTarget.style.fill=Styles.PAUSE_BTN.fill)},i.prototype.onUpdate=function(t){if(this._model.isStarted&&!app.screen._model._paused){var e=(this._model.dayDurationSeconds-this._model._timeCount)/this._model.dayDurationSeconds;this.atmosphere.setPercent(e),this.clock.setPercent(e)}},i.prototype.onShow=function(){},i.prototype.onHide=function(){},i.prototype.onWinGameHandler=function(t){console.log("//TODO onWinGameHandler")},i.prototype.onPlayNextDayHandler=function(t){console.log("//TODO onPlayNextDayHandler")},i.prototype.onRestartDayHandler=function(t){console.log("//TODO onRestartDayHandler")},i.prototype.onQuitGameHandler=function(t){console.log("//TODO onQuitGameHandler")},i.prototype.onPauseGameHandler=function(t){this.pauseMenu=new PIXI.Container,this.addChild(this.pauseMenu),this._model.interactive=!1,this._model.interactiveChildren=!1,this._view.interactive=!1,this._view.interactiveChildren=!1,this.pause_btn.interactive=!1;var e=createGradTexture("#bad9db","#91bec1"),i=PIXI.Sprite.from(e);i.stretch(app.width,app.height),this.pauseMenu.addChild(i),createjs.Tween.get(i).to({alpha:1},200);var n=new PIXI.Text("GAME PAUSED",Styles.PAUSE_MENU_BTN);n.style.fontSize=38,n.position.set(app.width/2,90),n.anchor.set(.5,.5),this.pauseMenu.addChild(n);var a=190,r=new PIXI.Text("RESUME GAME",Styles.PAUSE_MENU_BTN);r.anchor.set(.5,.5),r.position.set(app.width/2,a),r.interactive=!0,r.buttonMode=!0,r.pointerover=this.btnPauseHoverIn.bind(this),r.pointerout=this.btnPauseHoverOut.bind(this),r.pointerup=this.onGameResume.bind(this),this.pauseMenu.addChild(r);var s=new PIXI.Text("END DAY",Styles.PAUSE_MENU_BTN);s.anchor.set(.5,.5),s.position.set(app.width/2,230),s.interactive=!0,s.buttonMode=!0,s.pointerover=this.btnPauseHoverIn.bind(this),s.pointerout=this.btnPauseHoverOut.bind(this),s.pointerup=this.onDayEnd.bind(this),this.pauseMenu.addChild(s);var o=new PIXI.Text("(YOUR PROGRESS WILL BE SAVED)",Styles.HINT_LABEL);o.anchor.set(.5,.5),o.position.set(app.width/2,262),this.pauseMenu.addChild(o);var h=new PIXI.Text(this.soundLabel(),Styles.PAUSE_MENU_BTN);h.interactive=!0,h.buttonMode=!0,h.pointerover=this.btnPauseHoverIn.bind(this),h.pointerout=this.btnPauseHoverOut.bind(this),h.pointerup=this.onSoundSwitch.bind(this),h.anchor.set(.5,.5),h.position.set(app.width/2,290),this.pauseMenu.addChild(h);var l=new PIXI.Text("RESET HINTS",Styles.PAUSE_MENU_BTN);l.interactive=!0,l.buttonMode=!0,l.pointerover=this.btnPauseHoverIn.bind(this),l.pointerout=this.btnPauseHoverOut.bind(this),l.pointerup=this.onResetHints.bind(this),l.anchor.set(.5,.5),l.position.set(app.width/2,330),this.pauseMenu.addChild(l),this.switchSound=h,this._model.requestPause()},i.prototype.onGameResume=function(t){var e=this;createjs.Tween.get(this.pauseMenu).to({alpha:0},200).call(function(){e._model.unpause(),e.pauseMenu.removeFromParent(),e.switchSound=null,e.pauseMenu=null,e._model.interactive=!0,e._model.interactiveChildren=!0,e._view.interactive=!0,e._view.interactiveChildren=!0,e.pause_btn.interactive=!0})},i.prototype.onResetHints=function(t){Managers.progressManager.resetHints();var e=new PIXI.Text("Hints will be displayed again!",Styles.DAY_START);e.centered(),e.position.set(app.width/2,app.height/2+130),this.addChild(e),createjs.Tween.get(e).wait(500).to({alpha:0},1200).call(function(){e.removeFromParent()})},i.prototype.onDayEnd=function(t){this.onDayCompleteHandler()},i.prototype.onSoundSwitch=function(t){Managers.configManager.soundEnabled=!Managers.configManager.soundEnabled,this.switchSound.text=this.soundLabel(),Managers.soManager.flush()},i.prototype.soundLabel=function(){return Managers.configManager.soundEnabled?"Switch Sound Off":"Switch Sound On"},i.prototype.onBlindsOpenHandler=function(t){this._model.start()},i.prototype.onDayCompleteHandler=function(t){this._model._completed=!0,Managers.soundManager.stopChannel(ChannelID.ENVIRONMENT_SFX),Managers.progressManager.earned=this._model._moneyEarned,this.addChild(this.door),Managers.soundManager.play(SoundID.CURTAIN_DOWN_SFX);var e=this;createjs.Tween.get(this.door).to({y:app.height/2},1600,createjs.Ease.bounceOut).call(function(){Notes.removeAll(),e._view.showDayResult()})},i.prototype.onRemovedEntityHandler=function(t){this._view.removeEntityView(t.target)},i.prototype.onAddedEntityHandler=function(t){this._view.addEntityView(t.target)},i.prototype.onMoneyUpdateHandler=function(t){this._view.showCurrentMoney(parseInt(t))},i.prototype.onTimeUpdateHandler=function(t){this._view.showTime(Number(t.data))},i.prototype.onViewReparentHandler=function(t){this._view.reparentEntityView(t.guest,t.parentEntity)},i.prototype.onPathTargetClickHandler=function(t){this._model.pathTargetMouseDown(t.data)},Object.defineProperty(i.prototype,"view",{get:function(){return this._view}}),i.prototype.showCurrentMoney=function(t){this._model.showCurrentMoney(t)},t.GameScreen=i}(window),function(t,e){function i(){this.initialize()}i.prototype=Object.create(PIXI.Container.prototype),i.prototype.constructor=i,i.prototype.initialize=function(){PIXI.Container.call(this);var t=PIXI.Sprite.from("main_menu");this.addChild(t);var e=PIXI.Sprite.from("logo");e.position.set(10,app.height-10),e.anchor.set(0,1),e.fitTo(80,160),this.addChild(e),e.interactive=!0,e.buttonMode=!0,e.pointerup=this.onLogo.bind(this),e.pointerover=function(){e.alpha=.9},e.pointerout=function(){e.alpha=1};var i=app.width-15;this.playGameBtn=this.createBtn("PLAY GAME",i,320,null,0,this.onPlay),this.playGameBtn=this.createBtn("INSTRUCTIONS",i,360,null,0,this.onInstructions)},i.prototype.onFoodClick=function(){var t=this.foods.pop();this.plate.setFood(t)},i.prototype.onPlay=function(){if(Managers.soundManager.play(SoundID.BUTTON_CLICK_SFX),AdManager.getInstance().showAd(),Managers.progressManager.stage>0||Managers.progressManager.day>0)this.showContunuePopup();else{var t=null;t=0==Managers.progressManager.day?new MapScreen:new GameScreen,app.addScreen(t,App.ANIMATION_BLACKOUT)}},i.prototype.onViewScores=function(){Managers.soundManager.play(SoundID.BUTTON_CLICK_SFX)},i.prototype.onInstructions=function(){Managers.soundManager.play(SoundID.BUTTON_CLICK_SFX);var t=new InstructionsScreen;app.addScreen(t,app.ANIMATION_BLACKOUT)},i.prototype.onLogo=function(){Managers.soundManager.play(SoundID.BUTTON_CLICK_SFX);var e=Config.logoURL;t.open(e,"_blank")},i.prototype.animate=function(){},i.prototype.createBtn=function(t,e,i,n,a,r){var s=new PIXI.Text(t,Styles.MENU_BTN);return n&&(s.style.fontSize=n),s.pointerup=r.bind(this),s.pointerover=this.btnHoverIn.bind(this),s.pointerout=this.btnHoverOut.bind(this),s.interactive=!0,s.buttonMode=!0,s.anchor.x=1,s.position.set(e,i),s.rotation=a||0,this.addChild(s),s},i.prototype.btnHoverIn=function(t){t.target.style.fill=Styles.MENU_BTN_HOVER.fill,Managers.soundManager.play(SoundID.BUTTON_ROLLOVER_SFX)},i.prototype.btnHoverOut=function(t){t.currentTarget&&(t.currentTarget.style.fill=Styles.MENU_BTN.fill)},i.prototype.onUpdate=function(t){},i.prototype.onShow=function(){},i.prototype.onHide=function(){},i.prototype.showContunuePopup=function(){this.popup=new PIXI.NineSlicePlane(PIXI.Texture.from("popup"),60,60,60,60),this.popup.width=220,this.popup.height=90,this.popup.position.set(app.width/2-this.popup.width/2,100),this.addChild(this.popup);var t=new PIXI.Text("DO YOU WANT TO RESUME\nYOUR PREVIOUS GAME",Styles.POPUP_LABEL);t.position.set(this.popup.width/2,30),t.centered(),this.popup.addChild(t);var e=new PIXI.Text("YES",Styles.MENU_BTN);e.style.fontSize=18,e.centered(),e.pointerup=this.onContinueYes.bind(this),e.pointerover=this.btnHoverIn.bind(this),e.pointerout=this.btnHoverOut.bind(this),e.interactive=!0,e.buttonMode=!0,e.position.set(this.popup.width/2-40,65),this.popup.addChild(e);var i=new PIXI.Text("NO",Styles.MENU_BTN);i.centered(),i.style.fontSize=18,i.pointerup=this.onContinueNo.bind(this),i.pointerover=this.btnHoverIn.bind(this),i.pointerout=this.btnHoverOut.bind(this),i.interactive=!0,i.buttonMode=!0,i.position.set(this.popup.width/2+40,65),this.popup.addChild(i)},i.prototype.onContinueNo=function(){this.popup.removeFromParent(),Managers.progressManager.restartGame();var t=new MapScreen;app.addScreen(t,App.ANIMATION_BLACKOUT),Managers.soundManager.play(SoundID.BUTTON_CLICK_SFX)},i.prototype.onContinueYes=function(){Managers.soundManager.play(SoundID.BUTTON_CLICK_SFX),this.popup.removeFromParent();var t=new GameScreen;app.addScreen(t,App.ANIMATION_BLACKOUT)},t.HomeScreen=i}(window),function(t,e){function i(){this.initialize()}i.prototype=Object.create(PIXI.Container.prototype),i.prototype.constructor=i,i.prototype.initialize=function(){PIXI.Container.call(this);var t=createGradTexture("#b7d7db","#8dbac2"),e=PIXI.Sprite.from(t);e.stretch(app.width,app.height),this.addChild(e),this.tutImages=["instructions_1","instructions_2","instructions_3","instructions_4","instructions_5"],this.index=0;var i=new PIXI.NineSlicePlane(PIXI.Texture.from("popup"),30,30,30,30);i.width=563,i.height=424,i.position.set(38,13),this.addChild(i),this.tutorialImage=PIXI.Sprite.from("instructions_1"),this.tutorialImage.position.set(40,15),this.tutorialImage.scale.set(.5),this.addChild(this.tutorialImage);var n=new PIXI.Text("NEXT PAGE",Styles.MENU_BTN);n.style.fontSize=25,n.pointerup=this.onNext.bind(this),n.pointerover=this.btnHoverIn.bind(this),n.pointerout=this.btnHoverOut.bind(this),n.interactive=!0,n.buttonMode=!0,n.position.set(app.width-10,app.height-23),n.anchor.set(1,.5),this.addChild(n);var a=new PIXI.Text("PREVIOUS PAGE",Styles.MENU_BTN);a.style.fontSize=25,a.pointerup=this.onPrevious.bind(this),a.pointerover=this.btnHoverIn.bind(this),a.pointerout=this.btnHoverOut.bind(this),a.interactive=!0,a.buttonMode=!0,a.position.set(10,app.height-23),a.anchor.set(0,.5),this.addChild(a);var r=new PIXI.Text("MAIN MENU",Styles.MENU_BTN);r.anchor.x=.5,r.style.fontSize=25,r.pointerup=this.onMenu.bind(this),r.pointerover=this.btnHoverIn.bind(this),r.pointerout=this.btnHoverOut.bind(this),r.interactive=!0,r.buttonMode=!0,r.position.set(app.width/2,app.height-23),r.anchor.set(.5,.5),this.addChild(r),this.nextBtn=n,this.previousBtn=a,this.menuBtn=r,this.setTutorial();var s=PIXI.Sprite.from("t-top-left");s.position.set(37,12),this.addChild(s);var o=PIXI.Sprite.from("t-top-right");o.position.set(587,12),this.addChild(o);var h=PIXI.Sprite.from("t-bottom-left");h.position.set(37,423),this.addChild(h);var l=PIXI.Sprite.from("t-bottom-right");l.position.set(587,423),this.addChild(l)},i.prototype.setTutorial=function(){this.tutorialImage.texture=PIXI.utils.TextureCache[this.tutImages[this.index]],this.previousBtn.visible=0!==this.index,this.nextBtn.visible=4!==this.index},i.prototype.onPrevious=function(t){this.index--,this.index=Math.clamp(this.index,0,this.tutImages.length-1),this.setTutorial(),Managers.soundManager.play(SoundID.BUTTON_CLICK_SFX)},i.prototype.onMenu=function(t){app.goBack(),Managers.soundManager.play(SoundID.BUTTON_CLICK_SFX)},i.prototype.onNext=function(t){this.index++,this.index=Math.clamp(this.index,0,this.tutImages.length-1),this.setTutorial(),Managers.soundManager.play(SoundID.BUTTON_CLICK_SFX)},i.prototype.btnHoverIn=function(t){Managers.soundManager.play(SoundID.BUTTON_ROLLOVER_SFX),t.target.style.fill=Styles.MENU_BTN_HOVER.fill},i.prototype.btnHoverOut=function(t){t.currentTarget&&(t.currentTarget.style.fill=Styles.MENU_BTN.fill)},i.prototype.onUpdate=function(t){},i.prototype.onShow=function(){},i.prototype.onHide=function(){},t.InstructionsScreen=i}(window),function(t,e){function i(t){this.initialize(t)}i.prototype=Object.create(PIXI.Container.prototype),i.prototype.constructor=i,i.prototype.initialize=function(t){PIXI.Container.call(this);var e=PIXI.Sprite.from(PIXI.Texture.WHITE);e.stretch(t.width,t.height),e.tint=15263976,this.addChild(e),this.logo=PIXI.Sprite.from("logo"),this.logo.centered(),this.logo.position.set(t.width/2,t.height/2-20),this.logo.fitTo(150,150),this.addChild(this.logo),this.loadingBar=new LoadingBar({backgroundWidth:200,backgroundHeight:10,backgroundTint:16777215,foregroundWidth:198,foregroundHeight:8,foregroundTint:12902,offsetX:1,offsetY:1}),this.loadingBar.position.set(t.width/2-100,320),this.addChild(this.loadingBar)},i.prototype.onUpdate=function(t){},i.prototype.onShow=function(){},i.prototype.onHide=function(){},t.LoadingScreen=i}(window),function(t,e){function i(){this.initialize()}i.prototype=Object.create(PIXI.Container.prototype),i.prototype.constructor=i,i.prototype.initialize=function(){PIXI.Container.call(this);var t=PIXI.Sprite.from("background_map");this.addChild(t);var e=Managers.progressManager.stage,i=[{x:255,y:230},{x:360,y:125},{x:470,y:290},{x:370,y:315}];this.penny=null;for(var n=0;n<4;n++){var a=e==n?3:e=this.duration?(this.timer=this.duration,this.dir=-1):this.timer<=0&&(this.timer=0,this.dir=1);var e=this.timer/this.duration;this.rotation=Math.degreesToRadians(this.from+(this.to-this.from)*e)}.bind(i),t},t.MapScreen=i}(window),function(t,e){function i(){this.initialize()}i.prototype=Object.create(PIXI.Container.prototype),i.prototype.constructor=i,i.prototype.initialize=function(){PIXI.Container.call(this);var t=createGradTexture("#b7d7db","#8dbac2"),e=PIXI.Sprite.from(t);e.stretch(app.width,app.height),this.addChild(e),this.logo=PIXI.Sprite.from("logo"),this.logo.position.set(app.width/2,210),this.logo.fitTo(120,60),this.logo.centered(),this.addChild(this.logo),this.popup=new PIXI.NineSlicePlane(PIXI.Texture.from("popup"),15,15,15,15),this.popup.width=500,this.popup.height=135,this.popup.position.set((app.width-this.popup.width)/2,20),this.addChild(this.popup);var i=new PIXI.Text("Thank you for playing Penguin Diner! Why not download the game on your device to continue playing?",Styles.POPUP_LABEL);i.style.fontSize=20,i.style.wordWrap=!0,i.style.align="center",i.style.wordWrapWidth=450,i.anchor.set(.5,.5),i.position.set(this.popup.width/2,this.popup.height/2),this.popup.addChild(i);var n=PIXI.Sprite.from("./assets/images/google-play-badge.png");n.pointerup=this.onPlayStore.bind(this),n.pointerover=this.btnHoverIn.bind(this),n.pointerout=this.btnHoverOut.bind(this),n.interactive=!0,n.buttonMode=!0,n.centered(),n.scale.set(.3),n.position.set(app.width/2,290),this.addChild(n);var a=PIXI.Sprite.from("./assets/images/apple-app-store-badge.png");a.pointerup=this.onAppStore.bind(this),a.pointerover=this.btnHoverIn.bind(this),a.pointerout=this.btnHoverOut.bind(this),a.interactive=!0,a.iosButtonMode=!0,a.centered(),a.scale.set(.3),a.position.set(app.width/2,350),this.addChild(a);var r=PIXI.Sprite.from("close_red");r.pointerup=function(){app.goBack()},r.interactive=!0,r.buttonMode=!0,r.centered(),r.scale.set(1),r.position.set(app.width-25,25),this.addChild(r)},i.prototype.onAppStore=function(e){t.open("https://apps.apple.com/us/app/penguin-diner-2-pennys-antarctic-adventure/id962992063","_blank")},i.prototype.onPlayStore=function(e){t.open("https://play.google.com/store/apps/details?id=air.com.bigwigmedia.penguindiner2&hl=en&gl=US","_blank")},i.prototype.btnHoverIn=function(t){SoundManager.getInstance().startSound("button_rollover",{volume:.1})},i.prototype.btnHoverOut=function(t){},i.prototype.onUpdate=function(t){},i.prototype.onShow=function(){},i.prototype.onHide=function(){},t.MobileScreen=i}(window),function(t,e){function i(){this.initialize()}i.prototype=Object.create(PIXI.Container.prototype),i.prototype.constructor=i,i.DISP_X=15,i.prototype.initialize=function(){PIXI.Container.call(this);var t=createGradTexture("#b7d7db","#8dbac2"),e=PIXI.Sprite.from(t);e.stretch(app.width,app.height),this.addChild(e),this._currentPage=-1,this._clip,this._slotsHolder,this._backBtn,this._scoreLabel,this._starsLabel,this._messageLabel,this._messageTween,this._popup,this.content=new PIXI.Container,this.content.x=i.DISP_X,this.addChild(this.content),this.bookContent=new PIXI.Container,this.bookContent.x=i.DISP_X,this.addChild(this.bookContent);for(var n=[0,1,1,2,2,3,4,5],a=0;a<8;a++){var r=new BookmarkButton("bookmark_icon_"+a,n[a]);r.position.set(3,40+52*a),r.pointerup=this.onMouseClickHandler.bind(this),r.pointerover=function(){Managers.soundManager.play(SoundID.BUTTON_ROLLOVER_SFX)},this.content.addChild(r)}var s=new Sprite.from("u_book");s.anchor.x=.5,s.position.set(app.width/2,20),this.content.addChild(s),this._backBtn=this.createBtn("Back",app.width-10-i.DISP_X,app.height-10,this.onBack),this._backBtn.anchor.set(1,1),this._backBtn.beacon=!0,this.content.addChild(this._backBtn),this._scoreLabel=new PIXI.Text("",Styles.UPGRADE_LABEL),this._scoreLabel.position.set(i.DISP_X,app.height-33),this.addChild(this._scoreLabel),this._starsLabel=new PIXI.Text("",Styles.UPGRADE_LABEL),this._starsLabel.position.set(i.DISP_X+270,app.height-33),this.addChild(this._starsLabel),this.showScoreLabels(),this._messageLabel=new PIXI.Text("",Styles.UPGRADE_LABEL),this._messageLabel.anchor.set(.5),this._messageLabel.visible=!1,this._messageLabel.position.set(app.width/2,app.height/2),this.addChild(this._messageLabel),this._slotsHolder=new PIXI.Container,this._slotsHolder.position.set(0,0),this.content.addChild(this._slotsHolder),this.selectPage(0)},i.prototype.onBack=function(){Managers.soundManager.play(SoundID.BUTTON_CLICK_SFX),app.goBack()},i.prototype.createBtn=function(t,e,i,n){var a=new PIXI.Text(t,Styles.MENU_BTN);return n&&(a.pointerup=n.bind(this)),a.pointerover=this.btnHoverIn.bind(this),a.pointerout=this.btnHoverOut.bind(this),a.interactive=!0,a.buttonMode=!0,a.anchor.x=.5,a.anchor.y=1,a.position.set(e,i),this.addChild(a),a},i.prototype.btnHoverIn=function(t){Managers.soundManager.play(SoundID.BUTTON_ROLLOVER_SFX),t.target.style.fill=Styles.MENU_BTN_HOVER.fill},i.prototype.btnHoverOut=function(t){t.currentTarget&&(t.currentTarget.style.fill=Styles.MENU_BTN.fill)},i.prototype.onUpdate=function(t){},i.prototype.onShow=function(){},i.prototype.onHide=function(){},i.prototype.onAddedHandler=function(t){},i.prototype.showScoreLabels=function(){this._scoreLabel.text="Penny's Bank: $"+formatThousands(Managers.progressManager.bank),this._starsLabel.text="Stars:"+Managers.progressManager.stars},i.prototype.showMessage=function(t){Managers.soundManager.play(SoundID.CANCEL_SFX),this._messageLabel.text=t,this._messageLabel.visible=!0,createjs.Tween.get(this._messageLabel,{loop:2}).to({alpha:1},100).wait(200).to({alpha:0},100).wait(200)},i.prototype.setMessageLabelVisible=function(t){this._messageLabel.visible=t},i.prototype.updateSlots=function(){for(var t=this._slotsHolder.children.length,e=0;e0;)(t=this._slotsHolder.children[0]).removeFromParent(),t.dispose()},i.prototype.dispose=function(){this.removeItemSlots()},i.prototype.setPageBackground=function(t){this.bookContent.removeChildren();var e=new Sprite.from("text_tables");e.anchor.x=0,e.position.set(55,95),this.bookContent.addChild(e);var i=new PIXI.Text("",Styles.UPGRADE_RED_LABEL);i.position.set(55,144),this.bookContent.addChild(i);var n=new Sprite.from("text_chairs");n.anchor.x=0,n.position.set(app.width/2+5,95),this.bookContent.addChild(n);var a=new PIXI.Text("",Styles.UPGRADE_RED_LABEL);if(a.position.set(app.width/2+5,144),this.bookContent.addChild(a),0===t){(r=new Sprite.from("u_right_top")).anchor.x=0,r.position.set(app.width/2+1,20),this.bookContent.addChild(r)}else{var r;(r=new Sprite.from("u_top")).anchor.x=.5,r.position.set(app.width/2+1,20),this.bookContent.addChild(r);var s=new Sprite.from("u_title");s.anchor.x=0,s.position.set(app.width/2+15.5,27),this.bookContent.addChild(s)}if(0===t){e.visible=!1,i.visible=!1,n.texture=PIXI.utils.TextureCache.text_skates,a.text="Better skates help Penny serve faster";var o=new Sprite.from("u_page");o.anchor.x=0,o.position.set(55,20),this.bookContent.addChild(o);var h=new Sprite.from("u_page_swirl");h.anchor.x=0,h.tint=0,h.alpha=.2,h.scale.set(1.2),h.position.set(277,417),this.bookContent.addChild(h);var l=new Sprite.from("u_page_swirl");l.anchor.x=0,l.position.set(280,420),this.bookContent.addChild(l);for(var u=35,p=(p=(_=(_=Managers.configManager.catalogConfigXML.catalog.info["#cdata"]).replace(/\\n/gi,"\n")).split("\n")).filter(function(t){return""!=t}),c=0;c1&&c<5&&(f.style.fill="#902323")}}}else 1===t?(e.texture=PIXI.utils.TextureCache.text_tables,i.text="Where would the restaurant business\nbe if nobody invented the table?",n.texture=PIXI.utils.TextureCache.text_chairs,a.text="Top up customer satisfaction by seating your guests comfortably. It'll earn you tips!"):2===t?(e.texture=PIXI.utils.TextureCache.text_chefs,i.text="The more experienced your chef is,\nthe quicker he cooks and more\nrecipes he knows!",n.texture=PIXI.utils.TextureCache.text_entertainment,a.text="Entertain your customers to keep\nthem patient while the food is being\ncooked"):3===t?(e.texture=PIXI.utils.TextureCache.text_decorations,i.text="Luxurious decorations tempt\ncustomers to spend more",n.visible=!1,a.visible=!1):4===t?(e.texture=PIXI.utils.TextureCache.text_uniform,i.text="Penny has worked so hard! Treat\nher with a brand new uniform",n.visible=!1,a.visible=!1):5===t&&(e.texture=PIXI.utils.TextureCache.text_party_themes,i.text="Have some fun with these costume\nparty sets",n.visible=!1,a.visible=!1)},t.UpgradesScreen=i}(window),function(t,e){function i(){throw"Can't initialize"}i.MENU_BTN={fontFamily:"cheesebu",fontSize:34,fill:"#ffffff",stroke:"#2c4245",strokeThickness:3,padding:10},i.MENU_BTN_HOVER={fill:"#ffcc00"},i.RESULT_LABEL={fontFamily:"cheesebu",fontSize:34,fill:"#ffffff",stroke:"#2c4245",strokeThickness:3,padding:10},i.RESULT_BOTTOM_LABEL={fontFamily:"letteromatic",fontSize:10,fill:"#000000",padding:10},i.COMIC_LABEL={fontFamily:"letteromatic",fontSize:15,fill:"#000000",padding:10,lineHeight:19,wordWrap:!0,wordWrapWidth:600},i.UPGRADE_LABEL={fontFamily:"cheesebu",fontSize:34,fill:"#ffffff",stroke:"#2c4245",strokeThickness:3,padding:10},i.UPGRADE_BTN_LABEL={fontFamily:"tahoma",fontSize:15,fill:"#000000",stroke:"#000000",strokeThickness:1,padding:10,align:"center"},i.UPGRADE_ITEM_DESC={fontFamily:"tahoma",fontSize:12,fill:"#000000",padding:10,align:"left",wordWrap:!0,wordWrapWidth:85},i.UPGRADE_RED_LABEL={fontFamily:"arial",fontSize:14,fill:"#d40f07",padding:10,align:"left",wordWrap:!0,stroke:"#d40f07",strokeThickness:1,wordWrapWidth:250},i.UPGRADE_INFO={fontFamily:"arial",fontSize:12,fill:"#000000",padding:10,align:"left",wordWrap:!0,wordWrapWidth:250},i.POPUP_LABEL={fontFamily:"letteromatic",fontSize:12,fill:"#000000",padding:10,align:"center",wordWrap:!0,wordWrapWidth:250},i.POPUP_LABEL={fontFamily:"letteromatic",fontSize:12,fill:"#000000",padding:10,align:"center",wordWrap:!0,wordWrapWidth:250},i.COUNTER_LABEL={fontFamily:"tahoma",fontSize:15,fill:"#000000",padding:10},i.HINT_LABEL={fontFamily:"letteromatic",fontSize:12,fill:"#000000",padding:10,lineHeight:19,wordWrap:!0,wordWrapWidth:300,align:"center"},i.DAY_START={fontFamily:"cheesebu",fontSize:30,fill:"#ffffff",stroke:"#2c4245",strokeThickness:3,padding:10},i.PICKUP_MONEY={fontFamily:"cheesebu",fontSize:24,fill:"#ffffff",strokeThickness:3,stroke:"#2c4245",padding:10},i.PAUSE_BTN={fontFamily:"cheesebu",fontSize:30,fill:"#ffcc00",stroke:"#2c4245",strokeThickness:3,padding:10},i.PAUSE_BTN_HOVER={fill:"#ffffff"},i.PAUSE_MENU_BTN={fontFamily:"cheesebu",fontSize:28,fill:"#ffffff",stroke:"#2c4245",strokeThickness:3,padding:10},i.PAUSE_MENU_BTN_HOVER={fill:"#ffcc00"},i.END_TEXT={fontFamily:"cheesebu",fontSize:28,fill:"#ffffff",stroke:"#2c4245",strokeThickness:3,padding:10},i.END_TEXT_HOVER={fill:"#ffcc00"},t.Styles=i}(window),function(t,e){function i(){this.initialize()}i.prototype.initialize=function(){},i.formattedCurrency=function(t){var e;t<0?(t=-t,e=!0):e=!1;for(var i=t.toString(),n="",a=0,r=i.length-1;r>=0;r--)n=i.charAt(r)+n,3===++a&&r>0&&(a=0,n=","+n);return e?"-$"+n:"$"+n},t.Utils=i}(window);