define("ballooniesIxfGameController", ["componentmodelComponentApi", "translationmanagerApi", "clientkernelLoaderApi", "ballooniesIxfGameControllerDeclaration", "slotModelApi", "winMeterApi", "ballooniesIXFComponentsPaytableApi", "ballooniesIxfComponentsWinlinesPort", "soundManagerApi", "ballooniesIXFBackgroundPort", "gameLayoutApi", "ballooniesIxfTumbleReelsApi", "PopupApi", "clientkernelEventbusApi", "stateMachineEngine", "infoBarApi", "clientkernelModulesApi", "WinMeterWrapperApi", "betPanelApi", "clientkernelLoggerApi", "ballooniesIXFAnimationPort", "moneyApi"],
    function(componentmodelComponentApi, translationmanagerApi, clientkernelLoaderApi, ballooniesIxfGameControllerDeclaration, slotModelApi, winMeterApi, ballooniesIXFComponentsPaytableApi, ballooniesIxfComponentsWinlinesPort, soundManagerApi, ballooniesIXFBackgroundPort, gameLayoutApi, ballooniesIxfTumbleReelsApi, PopupApi, clientkernelEventbusApi, stateMachineEngine, infoBarApi, clientkernelModulesApi, WinMeterWrapperApi, betPanelApi, clientkernelLoggerApi, ballooniesIXFAnimationPort, moneyApi) {
        "use strict";

        function $iterator(o) {
            if (o instanceof Array) return function() {
                return {
                    cur: 0,
                    arr: o,
                    hasNext: function() {
                        return this.cur < this.arr.length;
                    },
                    next: function() {
                        return this.arr[this.cur++];
                    }
                };
            };
            return typeof(o.iterator) == 'function' ? $bind(o, o.iterator) : o.iterator;
        };;
        var $fid = 0;

        function $bind(o, m) {
            if (m == null) return null;
            if (m.__id__ == null) m.__id__ = $fid++;
            var f;
            if (o.hx__closures__ == null) o.hx__closures__ = {};
            else f = o.hx__closures__[m.__id__];
            if (f == null) {
                f = function() {
                    return f.method.apply(f.scope, arguments);
                };
                f.scope = o;
                f.method = m;
                o.hx__closures__[m.__id__] = f;
            }
            return f;
        };
        var $_;
        var $estr = function() {
            return _hcmn_.js_Boot.__string_rec(this, '');
        };
        if (typeof ballooniesIxfGameController == 'undefined') {
            var ballooniesIxfGameController = {};
        };
        ballooniesIxfGameController.Activator = function() {};
        ballooniesIxfGameController.Activator = ck_implements(ballooniesIxfGameController.Activator, clientkernelModulesApi.IModuleActivator);
        ballooniesIxfGameController.Activator.__interfaces__ = [clientkernelModulesApi.IModuleActivator];
        ballooniesIxfGameController.Activator.__name__ = ["ballooniesIxfGameController", "Activator"];
        ballooniesIxfGameController.Activator.prototype.start = function(context) {
            context.getServiceTracker([translationmanagerApi.ITranslationManager, moneyApi.IMoneyFormatter]).then(function(context1) {
                ballooniesIxfGameController.ExternalService.initialize(context1);
                context1.registerService(new ballooniesIxfGameController.Factory(), ballooniesIxfGameControllerDeclaration.GameControllerDeclaration, null);
            });
        };
        ballooniesIxfGameController.Activator.prototype.stop = function(context) {};
        ballooniesIxfGameController.Activator.main = function() {};
        ballooniesIxfGameController.Activator.prototype.__class__ = ballooniesIxfGameController.Activator;
        ballooniesIxfGameController.AutoplayController = function(betPanelPort, slotModelPort) {
            this.enablingAvailable = true;
            this.stopAvailable = false;
            this.startAvailable = false;
            this.autoSpinInfo = null;
            this.betPanelPort = betPanelPort;
            this.slotModelPort = slotModelPort;
            slotModelPort.getStages().getIdleStage().getAutoSpinStarted().subscribe($bind(this, this.onAutospinStartedListener));
            slotModelPort.getStages().getIdleStage().getAutoSpinsStopped().subscribe($bind(this, this.onAutoSpinStoppedListener));
            slotModelPort.getGameCommands().getStartAutoSpinsCommandAvailable().subscribe($bind(this, this.onEnableAutoSpinListener));
            slotModelPort.getGameCommands().getStopAutoSpinsCommandAvailable().subscribe($bind(this, this.onStopAvailableListener));
            slotModelPort.getStages().getAbortStage().getAbortSpin().subscribe($bind(this, this.onAbortSpin));
        };
        ballooniesIxfGameController.AutoplayController.__name__ = ["ballooniesIxfGameController", "AutoplayController"];
        ballooniesIxfGameController.AutoplayController.prototype.active = null;
        ballooniesIxfGameController.AutoplayController.prototype.autoSpinInfo = null;
        ballooniesIxfGameController.AutoplayController.prototype.startAvailable = null;
        ballooniesIxfGameController.AutoplayController.prototype.stopAvailable = null;
        ballooniesIxfGameController.AutoplayController.prototype.enablingAvailable = null;
        ballooniesIxfGameController.AutoplayController.prototype.betPanelPort = null;
        ballooniesIxfGameController.AutoplayController.prototype.slotModelPort = null;
        ballooniesIxfGameController.AutoplayController.prototype.onAbortSpin = function(e) {
            this.enablingAvailable = e.getPayload().nextStage.indexOf("Tumble") < 0;
        };
        ballooniesIxfGameController.AutoplayController.prototype.onEnableAutoSpinListener = function(e) {
            this.startAvailable = e.getPayload();
            this.updateButtonState();
        };
        ballooniesIxfGameController.AutoplayController.prototype.onAutospinStartedListener = function(e) {
            this.autoSpinInfo = e.getPayload();
            this.active = this.autoSpinInfo != null;
            this.updateButtonState();
            this.betPanelPort.setNumberOffAutoSpinsLeft().publish(this.autoSpinInfo.current + " / " + this.autoSpinInfo.total);
        };
        ballooniesIxfGameController.AutoplayController.prototype.onAutoSpinStoppedListener = function(e) {
            this.autoSpinInfo = null;
            this.active = false;
            this.updateButtonState();
        };
        ballooniesIxfGameController.AutoplayController.prototype.onStopAvailableListener = function(e) {
            this.stopAvailable = e.getPayload();
            this.updateButtonState();
        };
        ballooniesIxfGameController.AutoplayController.prototype.updateButtonState = function() {
            var isNeedShowAutoPlayBtn = this.active && this.stopAvailable || !this.active && this.startAvailable && this.enablingAvailable;
            this.setPlayStopButtonState(this.active);
            this.showAutoPlayBtn(isNeedShowAutoPlayBtn);
        };
        ballooniesIxfGameController.AutoplayController.prototype.showAutoPlayBtn = function(value) {
            var buttonPublisher;
            if (value) buttonPublisher = this.betPanelPort.enableButton();
            else buttonPublisher = this.betPanelPort.disableButton();
            buttonPublisher.publish(betPanelApi.EButton.AUTO_PLAY_BUTTON);
            this.enablingAvailable = true;
        };
        ballooniesIxfGameController.AutoplayController.prototype.setPlayStopButtonState = function(active) {
            var autoplayButtonState;
            if (active) autoplayButtonState = betPanelApi.SetAutoPlayButtonState.STOP_BUTTON_STATE;
            else autoplayButtonState = betPanelApi.SetAutoPlayButtonState.PLAY_BUTTON_STATE;
            this.betPanelPort.setAutoPlayButtonState().publish(autoplayButtonState);
        };
        ballooniesIxfGameController.AutoplayController.prototype.enableAutoplayButton = function() {
            if (this.startAvailable == true) this.betPanelPort.enableButton().publish(betPanelApi.EButton.AUTO_PLAY_BUTTON);
        };
        ballooniesIxfGameController.AutoplayController.prototype.stopAutoSpins = function() {
            if (this.active) this.slotModelPort.getGameCommands().getStopAutoSpinsCommandExecuted().publish(null);
        };
        ballooniesIxfGameController.AutoplayController.prototype.forceStopAutoSpins = function() {
            if (this.active) {
                this.slotModelPort.getGameCommands().getStopAutoSpinsCommandExecuted().publish(null);
                this.active = false;
                this.updateButtonState();
            }
        };
        ballooniesIxfGameController.AutoplayController.prototype.__class__ = ballooniesIxfGameController.AutoplayController;
        ballooniesIxfGameController.ExternalService = function() {};
        ballooniesIxfGameController.ExternalService.__name__ = ["ballooniesIxfGameController", "ExternalService"];
        ballooniesIxfGameController.ExternalService.bus = null;
        ballooniesIxfGameController.ExternalService.gfBusChanel = null;
        ballooniesIxfGameController.ExternalService.assetRegistry = null;
        ballooniesIxfGameController.ExternalService.moneyFormatter = null;
        ballooniesIxfGameController.ExternalService.variableRegistry = null;
        ballooniesIxfGameController.ExternalService.logger = null;
        ballooniesIxfGameController.ExternalService.moduleContext = null;
        ballooniesIxfGameController.ExternalService.initialize = function(context) {
            ballooniesIxfGameController.ExternalService.moduleContext = context;
            ballooniesIxfGameController.ExternalService.bus = context.getAnyService(clientkernelEventbusApi.IEventBus, null);
            ballooniesIxfGameController.ExternalService.gfBusChanel = ballooniesIxfGameController.ExternalService.bus.getChannel("GFBus");
            ballooniesIxfGameController.ExternalService.assetRegistry = context.getAnyService(clientkernelLoaderApi.IAssetRegistry, null);
            ballooniesIxfGameController.ExternalService.moneyFormatter = context.getAnyService(moneyApi.IMoneyFormatter, null);
            ballooniesIxfGameController.ExternalService.variableRegistry = context.getAnyService(clientkernelLoaderApi.IVariableRegistry, null);
            var loggerFactory = context.getAnyService(clientkernelLoggerApi.ILoggerFactory, null);
            ballooniesIxfGameController.ExternalService.logger = loggerFactory.getDefaultLogger();
        };
        ballooniesIxfGameController.ExternalService.getTranslationService = function() {
            return ballooniesIxfGameController.ExternalService.moduleContext.getAnyService(translationmanagerApi.ITranslationManager);
        };
        ballooniesIxfGameController.ExternalService.isMobile = function() {
            return ballooniesIxfGameController.ExternalService.variableRegistry.get("skin") == "mobile" || ballooniesIxfGameController.ExternalService.variableRegistry.get("assetPack") == "mobile";
        };
        ballooniesIxfGameController.ExternalService.isMini = function() {
            return ballooniesIxfGameController.ExternalService.variableRegistry.get("presenttype") == "MIN" || ballooniesIxfGameController.ExternalService.variableRegistry.get("assetPack") == "desktopmini" || ballooniesIxfGameController.ExternalService.variableRegistry.get("assetPack") == "tabletmini";
        };
        ballooniesIxfGameController.ExternalService.prototype.__class__ = ballooniesIxfGameController.ExternalService;
        ballooniesIxfGameController.Factory = function() {};
        ballooniesIxfGameController.Factory = ck_implements(ballooniesIxfGameController.Factory, clientkernelModulesApi.IService);
        ballooniesIxfGameController.Factory = ck_implements(ballooniesIxfGameController.Factory, componentmodelComponentApi.IComponentFactory);
        ballooniesIxfGameController.Factory.__interfaces__ = [clientkernelModulesApi.IService, componentmodelComponentApi.IComponentFactory];
        ballooniesIxfGameController.Factory.__name__ = ["ballooniesIxfGameController", "Factory"];
        ballooniesIxfGameController.Factory.prototype.createComponent = function(context) {
            new ballooniesIxfGameController.GameController(context);
        };
        ballooniesIxfGameController.Factory.prototype.getComponentDeclaration = function() {
            return ballooniesIxfGameControllerDeclaration.GameControllerDeclaration;
        };
        ballooniesIxfGameController.Factory.prototype.__class__ = ballooniesIxfGameController.Factory;
        ballooniesIxfGameController.GameController = function(context) {
            this.isSmallWin = false;
            this.winJoin = new ballooniesIxfGameController.Join();
            this.winAnimationReadyToSpawnSubscription = null;
            this.isExplosionReadyToSpawn = false;
            this.resultPresentedPublished = false;
            this.paytableOpened = false;
            var _g = this;
            this.translationManager = ballooniesIxfGameController.ExternalService.getTranslationService();
            this.model = new ballooniesIxfGameController.GameModel(this.translationManager);
            this.animationsPort = context.getUsedPort(ballooniesIXFAnimationPort.IAnimationPort);
            this.winLinesPort = context.getUsedPort(ballooniesIxfComponentsWinlinesPort.IWinLinesPort);
            this.betPanelPort = context.getUsedPort(betPanelApi.IBetPanelPort);
            this.reelsPort = context.getUsedPort(ballooniesIxfTumbleReelsApi.ITumbleReelsPort);
            this.slotModelPort = context.getUsedPort(slotModelApi.ISlotModelPort);
            this.gameLayoutPort = context.getUsedPort(gameLayoutApi.IGameLayoutPort);
            this.paytablePort = context.getUsedPort(ballooniesIXFComponentsPaytableApi.IPaytablePort);
            var infoBarPort = context.getUsedPort(infoBarApi.IInfoBarPort);
            this.winMeterPort = context.getUsedPort(winMeterApi.IWinMeterPort);
            this.infoBarControl = new ballooniesIxfGameController.InfoBarControl(infoBarPort);
            this.popupPort = context.getUsedPort(PopupApi.IPopupPort);
            this.wmWrapperPort = context.getUsedPort(WinMeterWrapperApi.IWMWrapperPort);
            this.winMeterControl = new ballooniesIxfGameController.WinMeterControl(context.getUsedPort(WinMeterWrapperApi.IWMWrapperPort));
            this.backgroundPort = context.getUsedPort(ballooniesIXFBackgroundPort.IBackgroundPort);
            this.soundController = new ballooniesIxfGameController.SoundController(context, this.model);
            this.setupStateMachine();
            context.getStarted().then(function(a) {
                _g.assemblyStarted = true;
                _g.checkGameLoaded();
            });
            ballooniesIxfGameController.ExternalService.assetRegistry.getAsset("game-config_json").getContent().then(function(data) {
                _g.config = data.gameControllerConfig;
                _g.checkGameLoaded();
            });
            this.moneyFormatter = ballooniesIxfGameController.ExternalService.moneyFormatter;
            this.soundPort = context.getUsedPort(soundManagerApi.ISoundManagerPort);
            this.autoplayController = new ballooniesIxfGameController.AutoplayController(this.betPanelPort, this.slotModelPort);
            ballooniesIxfGameController.ExternalService.assetRegistry.getAsset("slotmodel/slot-definition_json").getContent().then(function(data1) {
                _g.model.setStartFSReelPicture(data1.startFSReelPicture.reels);
            });
        };
        ballooniesIxfGameController.GameController.__name__ = ["ballooniesIxfGameController", "GameController"];
        ballooniesIxfGameController.GameController.prototype.stateMachine = null;
        ballooniesIxfGameController.GameController.prototype.smDispatcher = null;
        ballooniesIxfGameController.GameController.prototype.smContext = null;
        ballooniesIxfGameController.GameController.prototype.model = null;
        ballooniesIxfGameController.GameController.prototype.config = null;
        ballooniesIxfGameController.GameController.prototype.translationManager = null;
        ballooniesIxfGameController.GameController.prototype.moneyFormatter = null;
        ballooniesIxfGameController.GameController.prototype.assemblyStarted = null;
        ballooniesIxfGameController.GameController.prototype.layoutUpdated = null;
        ballooniesIxfGameController.GameController.prototype.stopSpinRecieved = null;
        ballooniesIxfGameController.GameController.prototype.abortSpinPayload = null;
        ballooniesIxfGameController.GameController.prototype.soundController = null;
        ballooniesIxfGameController.GameController.prototype.animationsPort = null;
        ballooniesIxfGameController.GameController.prototype.winLinesPort = null;
        ballooniesIxfGameController.GameController.prototype.betPanelPort = null;
        ballooniesIxfGameController.GameController.prototype.reelsPort = null;
        ballooniesIxfGameController.GameController.prototype.slotModelPort = null;
        ballooniesIxfGameController.GameController.prototype.gameLayoutPort = null;
        ballooniesIxfGameController.GameController.prototype.winMeterPort = null;
        ballooniesIxfGameController.GameController.prototype.backgroundPort = null;
        ballooniesIxfGameController.GameController.prototype.infoBarControl = null;
        ballooniesIxfGameController.GameController.prototype.popupPort = null;
        ballooniesIxfGameController.GameController.prototype.paytableOpened = null;
        ballooniesIxfGameController.GameController.prototype.paytablePort = null;
        ballooniesIxfGameController.GameController.prototype.repeatSpinRequestTimer = null;
        ballooniesIxfGameController.GameController.prototype.resultPresentedPublished = null;
        ballooniesIxfGameController.GameController.prototype.isExplosionReadyToSpawn = null;
        ballooniesIxfGameController.GameController.prototype.winAnimationReadyToSpawnSubscription = null;
        ballooniesIxfGameController.GameController.prototype.soundPort = null;
        ballooniesIxfGameController.GameController.prototype.autoplayController = null;
        ballooniesIxfGameController.GameController.prototype.winJoin = null;
        ballooniesIxfGameController.GameController.prototype.winMeterControl = null;
        ballooniesIxfGameController.GameController.prototype.wmWrapperPort = null;
        ballooniesIxfGameController.GameController.prototype.isSmallWin = null;
        ballooniesIxfGameController.GameController.prototype.handleSelection = function(payload) {
            var symbolId = payload;
            this.processChosenPick(symbolId);
        };
        ballooniesIxfGameController.GameController.prototype.setupStateMachine = function() {
            this.smDispatcher = new stateMachineEngine.EventDispatcher();
            this.smContext = new ballooniesIxfGameController.StateMachineContext(this.smDispatcher);
            this.smContext.setupContextData(this);
            this.stateMachine = new stateMachineEngine.StateMachine(this.smDispatcher, ballooniesIxfGameController.StateMachineDef.ID);
            this.stateMachine.setContext(this.smContext);
            this.stateMachine.logLevel = 3;
            this.stateMachine.logPrefix = "[GAME_CONTROLLER]";
            this.stateMachine.dispatchGlobalStateChange = false;
            stateMachineEngine.StateMachine.logger = ballooniesIxfGameController.ExternalService.logger;
            stateMachineEngine.FSMInjector.registerSM(this.stateMachine, ballooniesIxfGameController.StateMachineDef.FSM);
        };
        ballooniesIxfGameController.GameController.prototype.processChosenPick = function(value) {
            this.slotModelPort.getStages().getPickerBonusStage().getPickerBonusSelected().publish(this.model.pickerChoices[value]);
        };
        ballooniesIxfGameController.GameController.prototype.dispatchEvent = function(action) {
            this.smDispatcher.dispatchEvent(new stateMachineEngine.StateEvent(ballooniesIxfGameController.StateMachineDef.ID + stateMachineEngine.StateEvent.ACTION, action));
        };
        ballooniesIxfGameController.GameController.prototype.checkGameLoaded = function() {
            var isGameLoaded = this.assemblyStarted && this.layoutUpdated && this.config != null;
            if (isGameLoaded) this.slotModelPort.getStages().getInitStage().getGameLoaded().publish(null);
        };
        ballooniesIxfGameController.GameController.prototype.attachComponents = function() {
            this.slotModelPort.getGameContext().getBalance().subscribe($bind(this, this.onBalanceUpdate));
            this.slotModelPort.getGameContext().getGameOptionChangedFromPf().subscribe($bind(this, this.onGameOptionChanged));
            this.slotModelPort.getStages().getInitStage().getInitializeGamePhase().getInitializeGame().subscribe($bind(this, this.onSlotModelInitGame));
            this.slotModelPort.getStages().getResumeStage().getPrepareResume().subscribe($bind(this, this.onPrepareResume));
            this.slotModelPort.getStages().getIdleStage().getConfirmSelectedStake().subscribe($bind(this, this.onConfirmSelectedStake));
            this.slotModelPort.getStages().getIdleStage().getOpenPaytable().subscribe($bind(this, this.onOpenPaytable));
            this.slotModelPort.getStages().getIdleStage().getOpenHelp().subscribe($bind(this, this.onOpenHelp));
            this.slotModelPort.getStages().getSpinStage().getStartReelSpin().subscribe($bind(this, this.onModelSpinStart));
            this.slotModelPort.getStages().getSpinStage().getOutcomePhase().getSpinOutcome().subscribe($bind(this, this.onSpinOutcome));
            this.slotModelPort.getStages().getSpinStage().getStopReelSpin().subscribe($bind(this, this.onModelSpinStop));
            this.slotModelPort.getStages().getSpinStage().getOutcomePhase().getPresentSpinOutcome().subscribe($bind(this, this.onSpinOutcomePresent));
            this.slotModelPort.getStages().getAbortStage().getAbortSpin().subscribe($bind(this, this.onAbortSpin));
            this.slotModelPort.getStages().getResultStage().getPresentResult().subscribe($bind(this, this.onPresentResult));
            this.slotModelPort.getGameCommands().getSpinCommandAvailable().subscribe($bind(this, this.onSpinCommandAvailable));
            this.slotModelPort.getGameCommands().getContinueCommandAvailable().subscribe($bind(this, this.onContinueCommandAvailable));
            this.slotModelPort.getGameCommands().getPaytableCommandAvailable().subscribe($bind(this, this.onPaytableCommandAvailable));
            this.slotModelPort.getGameCommands().getStakeCommandAvailable().subscribe($bind(this, this.onStakeCommandAvailable));
            this.slotModelPort.getStages().getPickerBonusStage().getSelectPickerBonus().subscribe($bind(this, this.onSelectPickerBonus));
            this.betPanelPort.onButtonPressed().subscribe($bind(this, this.onBetPanelButtonPressed));
            this.betPanelPort.onStakeChanged().subscribe($bind(this, this.onBetPanelStakeChanged));
            this.reelsPort.getSpinStopped().subscribe($bind(this, this.onSpinStopped));
            this.reelsPort.getReelPictureExited().subscribe($bind(this, this.onReelOutcomeExit));
            this.reelsPort.getStopping().subscribe($bind(this, this.onReelsStopping));
            this.gameLayoutPort.getGameLayoutUpdated().subscribe($bind(this, this.onGameLayoutUpdated));
            this.paytablePort.onCloseButtonPressed().subscribe($bind(this, this.onPaytableClose));
            this.paytablePort.onPageChanged().subscribe($bind(this, this.onPaytablePageChanged));
            this.winLinesPort.getWinLineCycleAnimated().subscribe($bind(this, this.onWinAnimationReady));
            this.winLinesPort.getShowLineAnimations().subscribe($bind(this, this.onShowLineAnimations));
            this.winLinesPort.getMultipliersAnimated().subscribe($bind(this, this.onMultipliersAnimated));
            this.winAnimationReadyToSpawnSubscription = this.winLinesPort.getExplosionReadyToSpawn().subscribe($bind(this, this.onExplosionReadyToSpawn));
            this.popupPort.getPickerIsVisible().subscribe($bind(this, this.onPickerIntroComplete));
            this.popupPort.getPickerChoice().subscribe($bind(this, this.onSelection));
            this.popupPort.getPickerResultShown().subscribe($bind(this, this.onPickerResultShown));
            this.popupPort.getPickerOutroDone().subscribe($bind(this, this.onPickerOutroComplete));
            this.popupPort.getFSIntroFinished().subscribe($bind(this, this.onFSIntroFinished));
            this.popupPort.getFSOutroFinished().subscribe($bind(this, this.onFSOutroFinished));
            this.winMeterControl.onDisplayWinMeterFinished = $bind(this, this.onDisplayWinMeterFinished);
        };
        ballooniesIxfGameController.GameController.prototype.onDisplayWinMeterFinished = function(e) {
            this.winJoin.resolveCondition("meterFinished");
        };
        ballooniesIxfGameController.GameController.prototype.initGame = function() {
            this.model.isFirstSpin = true;
            this.betPanelPort.hideButton().publish(betPanelApi.EButton.SKIP);
            this.publishHideAnimationComponent(ballooniesIXFAnimationPort.AnimationComponent.BONUS_REEL_FRAME);
            this.slotModelPort.getStages().getInitStage().getGameInitialized().publish(null);
            this.initHotKeys();
            this.loadBackground(1);
            if (ballooniesIxfGameController.ExternalService.isMini()) this.enableSound(false);
        };
        ballooniesIxfGameController.GameController.prototype.initHotKeys = function() {};
        ballooniesIxfGameController.GameController.prototype.prepareResume = function() {
            this.showSpinButton();
            this.betPanelPort.disableButton().publish(betPanelApi.EButton.SPIN);
            this.betPanelPort.disableButton().publish(betPanelApi.EButton.TOTAL_BET);
            this.betPanelPort.disableButton().publish(betPanelApi.EButton.PAYTABLE);
            this.model.isFirstSpin = this.model.spinOutcome.nextStage.indexOf("Tumble") < 0;
            this.restoreLastSpin();
            this.reelsPort.getUpdateReelPicture().publish(this.model.outcome.reelStop.reels);
            this.reelsPort.getUpdateGaps().publish(this.model.getWinSymbolMatrix());
            this.slotModelPort.getStages().getResumeStage().getResumePrepared().publish(null);
        };
        ballooniesIxfGameController.GameController.prototype.restoreLastSpin = function() {
            this.model.setCurrentOutcome();
            if (this.model.isBaseGame()) return;
            if (this.model.isInTumble()) this.presentOutcome();
            else this.closeMultiplier();
        };
        ballooniesIxfGameController.GameController.prototype.setInfoBarIdleText = function() {
            if (this.stateMachine.isInState(ballooniesIxfGameController.StateMachineDef.IDLE_STATE) && !ballooniesIxfGameController.ExternalService.isMini()) this.infoBarControl.showCentralLabel(this.model.getIDLEText());
        };
        ballooniesIxfGameController.GameController.prototype.onBaseGameIdle = function() {
            if (this.model.isSpinAborted && this.model.isInTumble()) {
                this.showSkipButton();
                this.repeatSpinRequestTimer = _hcmn_.haxe_Timer.delay($bind(this, this.onPressSkipButton), this.config.delayRepeatSpinrequest);
            } else this.setGameIdle();
        };
        ballooniesIxfGameController.GameController.prototype.checkAutoplayFinished = function() {
            if (this.autoplayController.active) {
                this.setInfoBarIdleText();
                if (this.model.promotionalSpinsActive && this.model.promotionalSpinsCount == 0) this.autoplayController.forceStopAutoSpins();
            }
        };
        ballooniesIxfGameController.GameController.prototype.setGameIdle = function() {
            this.resultPresentedPublished = false;
            if (this.isSmallWin) _hcmn_.haxe_Timer.delay($bind(this, this.setInfoBarIdleText), this.config.clearInfobarOnSmallWinDelay);
            else this.setInfoBarIdleText();
            this.isSmallWin = false;
            if (!this.autoplayController.active) this.winLinesPort.getStartIdleAnimation().publish(this.model.outcome.reelStop.reels);
            this.smContext.setContextValue("realNextStage", "BaseGame");
            this.setButtonsToIdle();
            this.model.resetSpinAborting();
        };
        ballooniesIxfGameController.GameController.prototype.updateInfoBarOnSpin = function() {
            this.infoBarControl.hideAll();
            var infoBarText = this.model.getCentralMessage();
            this.infoBarControl.showCentralLabel(infoBarText);
        };
        ballooniesIxfGameController.GameController.prototype.prepareFSBetPanel = function() {
            this.winMeterControl.hideWinMeterWin();
        };
        ballooniesIxfGameController.GameController.prototype.setFSAmountMessage = function() {
            if (this.model.spinOutcome == null || this.model.spinOutcome.freeSpin.total == 0) return;
            var current = this.model.spinOutcome.freeSpin.current;
            if (this.model.isFirstSpin || this.model.isPicker()) current += 1;
            var total = this.model.spinOutcome.freeSpin.total;
            var stringLookup = this.translationManager.stringLookup("InfoBarFSOfTotal", [current, total]);
            this.infoBarControl.showCentralLabel(stringLookup);
        };
        ballooniesIxfGameController.GameController.prototype.setTotalWinToinfoBar = function(value) {
            if (value == null) value = "";
            var payout;
            if (value == "") payout = this.model.getFSAccumulatedPayout();
            else payout = value;
            if (this.moneyFormatter.isZero(payout)) return;
            this.infoBarControl.showRightLabel(this.translationManager.stringLookup("InfoBarFSPays", [this.moneyFormatter.format(payout)]));
        };
        ballooniesIxfGameController.GameController.prototype.clearAllWins = function() {
            this.model.resultPayload = null;
            this.abortSpinPayload = null;
            this.stopSpinRecieved = false;
            this.resultPresentedPublished = false;
            this.isSmallWin = false;
        };
        ballooniesIxfGameController.GameController.prototype.startSpin = function() {
            if (this.model.isFirstSpinInRound()) {
                this.clearAllWins();
                this.showSpinSkipButton();
                this.updateWin();
                this.showGoodLuckOnInfobar();
                this.reelsPort.getStartSpin().publish(null);
            }
            this.clearWinOnInfoBar();
            this.hideWinAnimation();
            this.abortSpinPayload = null;
            this.forcePaytableClose();
            this.model.isBonusSummary = false;
            this.changeSpinButtonConnectionState(betPanelApi.CustomButtonStatePayload.CONNECTING_STATE);
        };
        ballooniesIxfGameController.GameController.prototype.updatePromoSpinsCounter = function() {
            var message = this.model.getPromoSpinsMessage();
            if (message != "") this.infoBarControl.showCentralLabel(message);
        };
        ballooniesIxfGameController.GameController.prototype.showGoodLuckOnInfobar = function() {
            if (this.autoplayController.active && this.model.isBaseGame()) {
                var message = this.model.getGoodLuckMessage();
                if (message != "") this.infoBarControl.showCentralLabel(message);
            }
        };
        ballooniesIxfGameController.GameController.prototype.clearWinOnInfoBar = function() {
            this.infoBarControl.hideWinLineSummary();
            this.infoBarControl.hideLeftLabel();
            if (this.model.isBaseGame()) this.infoBarControl.hideRightLabel();
        };
        ballooniesIxfGameController.GameController.prototype.updateWin = function() {
            if (!this.model.isSpinAborted) {
                this.model.previousWinMeterValue = "0";
                this.model.accumulatedWinOfOneFreeSpin = 0.0;
                this.winMeterControl.hideWinMeterWin();
            }
            if (this.model.isFreeSpin() && !this.model.isBonusComplete) {
                if (this.moneyFormatter.isZero(this.model.accumulatedWinOfOneFreeSpin + "")) this.winMeterControl.hideWinMeterWin();
                else this.winMeterControl.displayWinInstant(this.model.accumulatedWinOfOneFreeSpin + "");
                this.setTotalWinToinfoBar();
            }
        };
        ballooniesIxfGameController.GameController.prototype.startAutoSpin = function() {
            this.hideWinAnimation();
            this.forcePaytableClose();
            this.infoBarControl.hideAll();
            this.infoBarControl.showCentralLabel(this.translationManager.stringLookup("InfoBarAutoSpin"));
        };
        ballooniesIxfGameController.GameController.prototype.checkForStopOrAbort = function() {
            if (this.abortSpinPayload != null) this.dispatchEvent(ballooniesIxfGameController.StateMachineDef.ABORT_SPIN);
            else if (this.stopSpinRecieved) this.dispatchEvent(ballooniesIxfGameController.StateMachineDef.STOP_REEL_SPIN);
        };
        ballooniesIxfGameController.GameController.prototype.applyAbortData = function() {
            this.changeSpinButtonConnectionState(betPanelApi.CustomButtonStatePayload.CONNECTED_STATE);
            this.applyStakeItemsWithTotalBet(this.abortSpinPayload.stake);
            this.betPanelPort.disableButton().publish(betPanelApi.EButton.TOTAL_BET);
            this.infoBarControl.hideAll();
            if (this.model.spinOutcome == null || this.model.isBaseGame() || this.model.isFreeSpinEnded()) this.resultPresentedPublished = false;
            else this.setFSAmountMessage();
            this.model.resultPayload = null;
            this.stopSpinRecieved = false;
        };
        ballooniesIxfGameController.GameController.prototype.stopSpin = function() {
            this.reelsPort.getStopSpin().publish(new ballooniesIxfTumbleReelsApi.StopSpinPayload(this.model.outcome.reelStop.reels, this.model.getWinSymbolMatrix()));
        };
        ballooniesIxfGameController.GameController.prototype.completeAbortedSpin = function() {
            if (!this.model.isInTumble()) this.reelsPort.getStopSpin().publish(new ballooniesIxfTumbleReelsApi.StopSpinPayload(this.model.outcome.reelStop.reels, this.model.getWinSymbolMatrix()));
            else this.reelsPort.getAbortSpin().publish(null);
        };
        ballooniesIxfGameController.GameController.prototype.stopReels = function() {
            this.updatePromoSpinsCounter();
            if (this.abortSpinPayload == null) this.stopSpin();
            else {
                this.reelsPort.getAbortSpin().publish(null);
                if (!this.model.isInTumble()) this.reelsPort.getStopSpin().publish(new ballooniesIxfTumbleReelsApi.StopSpinPayload(this.model.outcome.reelStop.reels, this.model.getWinSymbolMatrix()));
            }
        };
        ballooniesIxfGameController.GameController.prototype.showBaseGameWins = function() {
            this.presentOutcome();
        };
        ballooniesIxfGameController.GameController.prototype.presentMultipliersOutcome = function() {
            this.winLinesPort.getMultiplierOutcome().publish(this.model.getCurrentOutcome());
            if (!this.model.hasLinesWin()) this.displayGamePaysInfo();
        };
        ballooniesIxfGameController.GameController.prototype.onMultipliersCompleted = function() {
            this.presentOutcome();
        };
        ballooniesIxfGameController.GameController.prototype.closeMultiplier = function() {
            ballooniesIxfGameController.ExternalService.gfBusChanel.publish("CLOSE_MULTIPLIER", null);
        };
        ballooniesIxfGameController.GameController.prototype.showWinLinesOutcome = function() {
            this.hideWinAnimation();
            var payout = this.moneyFormatter.format(this.model.getSingleScatterWin());
            var winpayload = new ballooniesIxfComponentsWinlinesPort.WinPayload(this.model.getCurrentOutcome(), payout, this.model.isLowWin());
            this.winLinesPort.getShowOutcome().publish(winpayload);
        };
        ballooniesIxfGameController.GameController.prototype.onBonusExplosionReadyToSpawn = function(e) {
            var _g = this;
            this.winAnimationReadyToSpawnSubscription.unsubscribe();
            this.hideWinAnimation();
            var delay = 1000;
            var event = ballooniesIxfGameController.StateMachineDef.SET_PICKER_INTRO_ACTION;
            if (this.abortSpinPayload != null) {
                delay = 0;
                event = ballooniesIxfGameController.StateMachineDef.SET_PICKER_IDLE;
                this.abortSpinPayload = null;
            }
            window.setTimeout(function() {
                _g.dispatchEvent(event);
                _g.winAnimationReadyToSpawnSubscription = _g.winLinesPort.getExplosionReadyToSpawn().subscribe($bind(_g, _g.onExplosionReadyToSpawn));
            }, delay);
        };
        ballooniesIxfGameController.GameController.prototype.onExplosionReadyToSpawn = function(e) {
            this.isExplosionReadyToSpawn = true;
            this.displayWinMeter();
            this.prepareForNextTumbleSpin();
            if (this.stateMachine.isInState(ballooniesIxfGameController.StateMachineDef.FS_IDLE) && this.model.isResume) {
                this.model.isResume = false;
                this.executeContinueCommand();
                return;
            }
            if (this.model.isResume && this.model.isFreeSpin() && !this.model.isFreeSpinEnded() || this.model.isSpinAborted || this.stateMachine.isInState(ballooniesIxfGameController.StateMachineDef.PREPARE_RESUME_STATE)) return;
            this.publishSpinOutcomePresented();
        };
        ballooniesIxfGameController.GameController.prototype.onWinAnimationReady = function(e) {
            this.isExplosionReadyToSpawn = false;
            this.reelsPort.getStartSpin().publish(null);
            this.model.isSpinAborted = false;
            return;
        };
        ballooniesIxfGameController.GameController.prototype.onMultipliersAnimated = function(e) {
            this.presentLineWinsOutcome();
        };
        ballooniesIxfGameController.GameController.prototype.onShowLineAnimations = function(e) {
            var win = e.getPayload();
            if (this.model.isScatterWin(win)) this.displayWinInfo("InfoBarScatterWinPays", win.payout);
            else if (this.model.isBonusWin(win)) {
                if (this.model.isFreeSpinEnded()) this.displayWinInfo("InfoBarScatterBonusWinPays", this.model.spinOutcome.acumulatedFreeSpinPayout);
            } else {
                this.displayGamePaysInfo();
                this.showWinLineSummary(win);
            }
            if (ballooniesIxfGameController.ExternalService.isMini() && win.lineId != 0) {
                var lineWinSummary = this.translationManager.stringLookup("LineWinLabel", [win.lineId, this.moneyFormatter.format(win.payout)]);
                this.infoBarControl.showLeftLabel(lineWinSummary);
            }
        };
        ballooniesIxfGameController.GameController.prototype.displayWinInfo = function(label, payout) {
            var message = this.translationManager.stringLookup(label, [this.moneyFormatter.format(payout)]);
            this.infoBarControl.showLeftLabel(message);
        };
        ballooniesIxfGameController.GameController.prototype.showWinLineSummary = function(win) {
            var linePicture = this.model.getLinePictureForWin(win);
            this.infoBarControl.showWinLineSummary(linePicture, win.lineId == null ? "null" : "" + win.lineId, this.moneyFormatter.format(win.payout));
        };
        ballooniesIxfGameController.GameController.prototype.hideWinAnimation = function() {
            if (!this.isExplosionReadyToSpawn) this.winLinesPort.getHideOutcome().publish(null);
        };
        ballooniesIxfGameController.GameController.prototype.displayBaseGameWin = function() {
            if (!this.model.promotionalSpinsActive) this.infoBarControl.hideCentralLabel();
        };
        ballooniesIxfGameController.GameController.prototype.showScatterWins = function() {
            this.model.isScatterShown = true;
            this.infoBarControl.hideAll();
            this.infoBarControl.showCentralLabel(this.translationManager.stringLookup("InfoBarFSAwarded"));
            this.displayWinMeterWin(true);
            this.model.updateLastAccumulatedPayout();
        };
        ballooniesIxfGameController.GameController.prototype.displayFreeSpinWin = function() {
            this.dispatchEvent(ballooniesIxfGameController.StateMachineDef.CONTINUE);
            this.displayWinMeterWin(true);
        };
        ballooniesIxfGameController.GameController.prototype.showFreeSpinWins = function() {
            var _g = this;
            if (this.model.isFreeSpinEnded()) {
                this.closeMultiplier();
                _hcmn_.haxe_Timer.delay(function() {
                    _g.dispatchEvent(ballooniesIxfGameController.StateMachineDef.FS_FINISHED);
                }, this.config.fsBeforeSummaryDelay);
            } else {
                this.presentOutcome();
                this.dispatchEvent(ballooniesIxfGameController.StateMachineDef.FS_OUTCOME_DONE);
            }
        };
        ballooniesIxfGameController.GameController.prototype.presentOutcome = function() {
            if (this.model.hasMultiplier() && !this.model.isSpinAborted) this.presentMultipliersOutcome();
            else this.presentLineWinsOutcome();
        };
        ballooniesIxfGameController.GameController.prototype.presentLineWinsOutcome = function() {
            this.showWinLinesOutcome();
            if (!this.model.hasWin()) {
                this.displayGamePaysInfo();
                this.closeMultiplier();
                _hcmn_.haxe_Timer.delay($bind(this, this.publishSpinOutcomePresented), this.config.closeMultiplierTime);
                this.displayWinMeterWin(true);
            } else this.showSkipButton();
        };
        ballooniesIxfGameController.GameController.prototype.displayGamePaysInfo = function() {
            if (this.model.canShowGamePaysInfo()) {
                var payout = "";
                var stringId = "";
                var message;
                if (this.model.hasWin()) {
                    if (this.model.isBaseGame()) payout = this.model.outcome.totalPayout;
                    else payout = this.model.getFSAccumulatedPayout();
                    if (this.model.isBaseGame()) stringId = "InfoBarGamePays";
                    else stringId = "InfoBarFSPays";
                } else {
                    payout = this.model.spinOutcome.acumulatedPayout;
                    if (this.model.isBaseGame()) stringId = "InfoBarGamePaysTotal";
                    else stringId = "InfoBarFSPays";
                }
                if (!this.moneyFormatter.isZero(payout)) {
                    message = this.translationManager.stringLookup(stringId, [this.moneyFormatter.format(payout)]);
                    this.infoBarControl.showRightLabel(message);
                }
            }
        };
        ballooniesIxfGameController.GameController.prototype.completeWinMeter = function() {
            this.winMeterControl.isWinMeterInterruptAvailable = false;
            this.displayWinMeterWin(true);
            this.winJoin.resolveAll();
        };
        ballooniesIxfGameController.GameController.prototype.displayWinMeter = function() {
            var instant = this.model.isAwardCap() || this.model.spinOutcome.nextStage != "BaseGame";
            this.displayWinMeterWin(instant);
            if (this.winMeterControl.isWinMeterInterruptAvailable) this.showSkipButton();
        };
        ballooniesIxfGameController.GameController.prototype.startFSOutroAnim = function() {
            this.hideWinAnimation();
            this.winMeterControl.hideWinMeterWin();
            var totalBonusWin = this.model.spinOutcome.acumulatedFreeSpinPayout;
            if (totalBonusWin == "0") this.popupPort.getShowNoWinOutro().publish(null);
            else this.popupPort.getShowFSOutro().publish(this.moneyFormatter.format(totalBonusWin));
            this.loadBackground(0);
            this.changeBackground(0, true);
            this.infoBarControl.hideCentralLabel();
            this.model.isBonusSummary = true;
        };
        ballooniesIxfGameController.GameController.prototype.onFSOutroFinished = function(e) {
            this.dispatchEvent(ballooniesIxfGameController.StateMachineDef.FS_OUTRO_END);
            this.winMeterControl.displayWinInstant(this.model.spinOutcome.acumulatedPayout + "");
        };
        ballooniesIxfGameController.GameController.prototype.setBaseGameOutcome = function() {
            this.hideWinAnimation();
            this.model.isBonusComplete = true;
            this.model.setOutcome(this.model.spinOutcome.baseGame.outcome);
            this.reelsPort.getUpdateReelPicture().publish(this.model.outcome.reelStop.reels);
            this.reelsPort.getUpdateGaps().publish(this.model.getWinSymbolMatrix());
        };
        ballooniesIxfGameController.GameController.prototype.showSkipButton = function() {
            this.betPanelPort.showButton().publish(betPanelApi.EButton.SKIP);
            this.betPanelPort.enableButton().publish(betPanelApi.EButton.SKIP);
        };
        ballooniesIxfGameController.GameController.prototype.showSpinButton = function() {
            this.betPanelPort.showButton().publish(betPanelApi.EButton.SPIN);
        };
        ballooniesIxfGameController.GameController.prototype.showSpinSkipButton = function() {
            var button;
            if (this.model.isInTumble()) button = betPanelApi.EButton.SKIP;
            else button = betPanelApi.EButton.SPIN;
            this.betPanelPort.showButton().publish(button);
        };
        ballooniesIxfGameController.GameController.prototype.publishSpinOutcomePresented = function() {
            this.slotModelPort.getStages().getSpinStage().getOutcomePhase().getSpinOutcomePresented().publish(null);
        };
        ballooniesIxfGameController.GameController.prototype.executeContinueCommand = function() {
            if (!this.continueCommandAvailable()) return;
            var delay = this.getDelayToExecuteSlotModelContinueCommand();
            var continueCommand = this.slotModelPort.getGameCommands().getContinueCommandExecuted();
            if (delay > 0) _hcmn_.haxe_Timer.delay(function() {
                continueCommand.publish(null);
            }, delay);
            else continueCommand.publish(null);
        };
        ballooniesIxfGameController.GameController.prototype.continueCommandAvailable = function() {
            return this.model.canExecuteContinue() || this.isExplosionReadyToSpawn;
        };
        ballooniesIxfGameController.GameController.prototype.getDelayToExecuteSlotModelContinueCommand = function() {
            var result = -1;
            if (this.model.spinOutcome.stage == "FreeSpin") {
                var payout = this.model.spinOutcome.freeSpin.outcome.totalPayout;
                if (this.moneyFormatter.isZero(payout)) result = this.config.fsNoWinSpinDelay;
            } else result = this.config.fsFirstSpinDelay;
            return result;
        };
        ballooniesIxfGameController.GameController.prototype.publishResultPresented = function() {
            if (!this.resultPresentedPublished) {
                this.slotModelPort.getStages().getResultStage().getResultPresented().publish(null);
                this.resultPresentedPublished = true;
            }
        };
        ballooniesIxfGameController.GameController.prototype.prepareAwardCap = function() {
            this.model.isBonusComplete = true;
            if (this.model.isFreeSpin()) this.loadBackground(0);
            this.hideWinAnimation();
            this.infoBarControl.hideAll();
            this.autoplayController.stopAutoSpins();
            if (this.model.getTotalMultiplier(this.model.isFreeSpin()) <= 1) this.publishSpinOutcomePresented();
            else {
                this.closeMultiplier();
                _hcmn_.haxe_Timer.delay($bind(this, this.publishSpinOutcomePresented), this.config.closeMultiplierTime);
            }
        };
        ballooniesIxfGameController.GameController.prototype.showAwardCapScreen = function() {
            var payload = new PopupApi.AwardCapPayload(this.moneyFormatter.format(this.model.resultPayload.totalWin), this.model.isFreeSpin());
            this.popupPort.getShowAwardCap().publish(payload);
            _hcmn_.haxe_Timer.delay($bind(this, this.enableSpinAfterAwardCap), this.config.maxAwardSpinEnabledDelay);
        };
        ballooniesIxfGameController.GameController.prototype.enableSpinAfterAwardCap = function() {
            if (this.model.isFreeSpin()) {
                this.changeBackground(0, true);
                this.model.isFirstSpin = true;
                this.setBaseGameOutcome();
            }
            this.dispatchEvent(ballooniesIxfGameController.StateMachineDef.CONTINUE);
        };
        ballooniesIxfGameController.GameController.prototype.hideAwardCap = function() {
            this.popupPort.getHide().publish(null);
        };
        ballooniesIxfGameController.GameController.prototype.onBalanceUpdate = function(e) {
            var payload = e.getPayload();
            this.infoBarControl.set_isPromoSpinMode(payload.freespin != null);
            if (payload.freespin != null) {
                this.model.promotionalSpinsActive = true;
                this.model.promotionalSpinsCount = payload.freespin;
                this.betPanelPort.setBalance().publish(this.translationManager.stringLookup("BalanceValueNotAvailable"));
                this.betPanelPort.disableButton().publish(betPanelApi.EButton.TOTAL_BET);
            } else this.betPanelPort.setBalance().publish(payload.balance);
        };
        ballooniesIxfGameController.GameController.prototype.onGameOptionChanged = function(e) {
            var type = e.getPayload().key;
            var value = _hcmn_.Std.parseInt(e.getPayload().value);
            if (type == "sound") {
                if (value == 0) this.betPanelPort.enableButton().publish(betPanelApi.EButton.SOUND_ON);
                else this.betPanelPort.disableButton().publish(betPanelApi.EButton.SOUND_OFF);
            }
        };
        ballooniesIxfGameController.GameController.prototype.onSlotModelInitGame = function(e) {
            this.applyPresentationInitialization(e.getPayload());
            this.model.setStartFSReelPicture(e.getPayload().slotDefinition.startFSReelPicture.reels);
            this.reelsPort.getUpdateReelPicture().publish(this.model.outcome.reelStop.reels);
            this.model.rgPresentation = e.getPayload().riskControlSettings.rgPresentation;
            this.winLinesPort.getStartIdleAnimation().publish(this.model.outcome.reelStop.reels);
            this.betPanelPort.hideButton().publish(betPanelApi.EButton.SKIP);
            this.dispatchEvent(ballooniesIxfGameController.StateMachineDef.INIT_ACTION);
        };
        ballooniesIxfGameController.GameController.prototype.onPrepareResume = function(e) {
            this.loadBackground(1);
            this.initHotKeys();
            this.model.isResume = true;
            var resumePayload = e.getPayload();
            this.applyPresentationInitialization(resumePayload.initializationProperties);
            this.model.rgPresentation = e.getPayload().initializationProperties.riskControlSettings.rgPresentation;
            this.applyStakeItemsWithTotalBet(resumePayload.stake);
            this.model.setSpinOutcome(resumePayload.spinOutcome);
            this.resumeGameBackground();
            this.resumeWinOnPanel();
            this.resumeInfoBarMessage();
            this.resumeStarMultiplier();
            this.resumeSounds();
            this.dispatchEvent(ballooniesIxfGameController.StateMachineDef.PREPARE_RESUME);
        };
        ballooniesIxfGameController.GameController.prototype.resumeSounds = function() {
            this.enableSound(!ballooniesIxfGameController.ExternalService.isMini());
            if (this.model.isFreeSpin() && !this.model.isFreeSpinEnded()) ballooniesIxfGameController.ExternalService.gfBusChanel.publish("resume:bonus", null);
        };
        ballooniesIxfGameController.GameController.prototype.enableSound = function(value) {
            var payload = new slotModelApi.Pair("sound", value ? "0" : "1");
            this.slotModelPort.getGameContext().getGameOptionChangedFromGf().publish(payload);
        };
        ballooniesIxfGameController.GameController.prototype.resumeStarMultiplier = function() {
            var multiplier = this.model.getResumingMultiplier();
            if (multiplier != null && multiplier > 1) ballooniesIxfGameController.ExternalService.gfBusChanel.publish("COLLECT_SET_OF_MULTIPLIERS", multiplier);
        };
        ballooniesIxfGameController.GameController.prototype.resumeWinOnPanel = function() {
            this.winMeterControl.hideWinMeterWin();
            var accumulatedWin = this.model.getResumingWin();
            if (!this.moneyFormatter.isZero(accumulatedWin)) this.winMeterControl.displayWinInstant(accumulatedWin);
        };
        ballooniesIxfGameController.GameController.prototype.resumeInfoBarMessage = function() {
            this.infoBarControl.hideAll();
            if (!this.model.isFreeSpin() && !this.model.isPicker()) this.setInfoBarIdleText();
            else {
                this.setFSAmountMessage();
                this.setTotalWinToinfoBar();
            }
        };
        ballooniesIxfGameController.GameController.prototype.resumeGameBackground = function() {
            if (this.model.isFreeSpin() && !this.model.isFreeSpinEnded() || this.model.isPicker()) this.changeBackground(1, false);
            else this.publishHideAnimationComponent(ballooniesIXFAnimationPort.AnimationComponent.BONUS_REEL_FRAME);
        };
        ballooniesIxfGameController.GameController.prototype.applyPresentationInitialization = function(payload) {
            this.model.setDenomination(payload.riskControlSettings.denomination);
            this.applyStakeItemsWithTotalBet(payload.defaultStake);
        };
        ballooniesIxfGameController.GameController.prototype.onConfirmSelectedStake = function(e) {
            this.infoBarControl.hideRightLabel();
            this.applyStake(e.getPayload());
        };
        ballooniesIxfGameController.GameController.prototype.applyStakeItemsWithTotalBet = function(stakeState) {
            this.model.setOutcome(stakeState.outcome);
            this.applyStake(stakeState);
        };
        ballooniesIxfGameController.GameController.prototype.applyStake = function(stakeState) {
            this.model.setCurrentStake(stakeState);
            this.betPanelPort.setStake().publish(stakeState);
            this.winMeterControl.hideWinMeterWin();
        };
        ballooniesIxfGameController.GameController.prototype.onSpinCommandAvailable = function(e) {
            if (e.getPayload()) {
                var command = this.getAvailableSpinCommand();
                this.dispatchEvent(command);
            } else {
                var button;
                if (this.model.isInTumble()) button = betPanelApi.EButton.SKIP;
                else button = betPanelApi.EButton.SPIN;
                this.betPanelPort.disableButton().publish(button);
            }
        };
        ballooniesIxfGameController.GameController.prototype.getAvailableSpinCommand = function() {
            if (this.autoplayController.active) return ballooniesIxfGameController.StateMachineDef.START_REEL_SPIN;
            else return ballooniesIxfGameController.StateMachineDef.SPIN_ENABLED;
        };
        ballooniesIxfGameController.GameController.prototype.onStakeCommandAvailable = function(e) {
            if (!e.getPayload() || this.model.isInTumble()) this.betPanelPort.disableButton().publish(betPanelApi.EButton.TOTAL_BET);
            else if (!this.model.promotionalSpinsActive) this.betPanelPort.enableButton().publish(betPanelApi.EButton.TOTAL_BET);
        };
        ballooniesIxfGameController.GameController.prototype.onModelSpinStart = function(e) {
            this.dispatchEvent(ballooniesIxfGameController.StateMachineDef.START_REEL_SPIN);
        };
        ballooniesIxfGameController.GameController.prototype.onSpinOutcome = function(e) {
            this.spinOutcomeHandle(e.getPayload());
        };
        ballooniesIxfGameController.GameController.prototype.spinOutcomeHandle = function(outcome) {
            this.showExplosionWin();
            this.setSpinOutcome(outcome);
            this.changeSpinButtonConnectionState(betPanelApi.CustomButtonStatePayload.CONNECTED_STATE);
            this.model.isFirstSpin = false;
        };
        ballooniesIxfGameController.GameController.prototype.changeSpinButtonConnectionState = function(buttonState) {
            var button;
            if (this.model.isInTumble()) button = betPanelApi.EButton.SKIP;
            else button = betPanelApi.EButton.SPIN;
            var customButtonStatePayload = new betPanelApi.CustomButtonStatePayload(button, buttonState);
            this.betPanelPort.setCustomButtonState().publish(customButtonStatePayload);
        };
        ballooniesIxfGameController.GameController.prototype.showExplosionWin = function() {
            if ((!this.model.isFirstSpinInRound() || this.model.isResume || this.model.isSpinAborted) && !this.stateMachine.isInState(ballooniesIxfGameController.StateMachineDef.PICKER_STATE)) {
                this.winLinesPort.getShowWinOutcome().publish(this.model.getCurrentOutcome());
                this.model.isResume = false;
            }
        };
        ballooniesIxfGameController.GameController.prototype.setSpinOutcome = function(spinOutcome) {
            this.model.setSpinOutcome(spinOutcome);
            this.smContext.setContextValue("Stage", this.getStageName(spinOutcome.stage));
            this.smContext.setContextValue("NextStage", this.getStageName(spinOutcome.nextStage));
            this.smContext.setContextValue("awardCapExceeded", spinOutcome.awardCapExceeded);
            this.smContext.setContextValue("realNextStage", spinOutcome.nextStage);
        };
        ballooniesIxfGameController.GameController.prototype.getStageName = function(stageString) {
            switch (stageString) {
                case "BaseGameTumble":
                    return "BaseGame";
                case "FreeSpinTumble":
                    return "FreeSpin";
                default:
                    return stageString;
            }
        };
        ballooniesIxfGameController.GameController.prototype.onModelSpinStop = function(e) {
            if (this.stateMachine.isInState(ballooniesIxfGameController.StateMachineDef.SPINNING_STATE)) this.dispatchEvent(ballooniesIxfGameController.StateMachineDef.STOP_REEL_SPIN);
            else this.stopSpinRecieved = true;
        };
        ballooniesIxfGameController.GameController.prototype.onAbortSpin = function(e) {
            this.abortSpinPayload = e.getPayload();
            this.model.isSpinAborted = this.abortSpinPayload != null;
            if (this.stateMachine.isInState(ballooniesIxfGameController.StateMachineDef.SPINNING_STATE) || this.stateMachine.isInState(ballooniesIxfGameController.StateMachineDef.PICKER_STATE)) this.dispatchEvent(ballooniesIxfGameController.StateMachineDef.ABORT_SPIN);
            else if (this.stateMachine.isInState(ballooniesIxfGameController.StateMachineDef.SPIN_STARTING_STATE)) this.dispatchEvent(ballooniesIxfGameController.StateMachineDef.SPIN_STARTING_ENDED);
        };
        ballooniesIxfGameController.GameController.prototype.onSpinOutcomePresent = function(e) {
            this.dispatchEvent(ballooniesIxfGameController.StateMachineDef.PRESENT_SPIN_OUTCOME);
        };
        ballooniesIxfGameController.GameController.prototype.onPresentResult = function(e) {
            this.model.resultPayload = e.getPayload();
            if (this.model.isAwardCap()) {
                this.completeWinMeter();
                this.dispatchPresentResult();
            } else {
                this.winJoin = new ballooniesIxfGameController.Join(["meterFinished"]).then($bind(this, this.dispatchPresentResult));
                this.displayWinMeter();
            }
        };
        ballooniesIxfGameController.GameController.prototype.dispatchPresentResult = function() {
            this.dispatchEvent(ballooniesIxfGameController.StateMachineDef.PRESENT_RESULT);
        };
        ballooniesIxfGameController.GameController.prototype.onContinueCommandAvailable = function(e) {
            if (e.getPayload()) this.dispatchEvent(ballooniesIxfGameController.StateMachineDef.CONTINUE_ENABLED);
        };
        ballooniesIxfGameController.GameController.prototype.onPaytableCommandAvailable = function(e) {
            if (e.getPayload()) this.betPanelPort.enableButton().publish(betPanelApi.EButton.PAYTABLE);
            else this.betPanelPort.disableButton().publish(betPanelApi.EButton.PAYTABLE);
        };
        ballooniesIxfGameController.GameController.prototype.onOpenPaytable = function(e) {
            if (this.paytableOpened) this.closePaytable();
            else {
                this.betPanelPort.disableButton().publish(betPanelApi.EButton.AUTO_PLAY_BUTTON);
                this.hideAwardCap();
                this.openPaytable();
            }
        };
        ballooniesIxfGameController.GameController.prototype.onOpenHelp = function(e) {
            if (this.paytableOpened) {
                this.closePaytable();
                return;
            }
        };
        ballooniesIxfGameController.GameController.prototype.onGameLayoutUpdated = function(event) {
            if (!this.layoutUpdated) {
                this.layoutUpdated = true;
                this.checkGameLoaded();
            }
        };
        ballooniesIxfGameController.GameController.prototype.displayWinMeterWin = function(instantShow) {
            if (instantShow == null) instantShow = false;
            var winMeterParams = this.model.getWinMeterParams();
            this.model.previousWinMeterValue = winMeterParams.payout;
            if (this.moneyFormatter.isZero(winMeterParams.payout) || !winMeterParams.countUp) {
                this.winMeterControl.isWinMeterInterruptAvailable = false;
                this.winJoin.resolveAll();
                return;
            }
            if (this.model.isLowWin()) {
                instantShow = true;
                ballooniesIxfGameController.ExternalService.gfBusChanel.publish("LOW_WIN", null);
            }
            this.winMeterControl.displayWin(winMeterParams, instantShow);
            this.isSmallWin = winMeterParams.winGroup <= 2;
        };
        ballooniesIxfGameController.GameController.prototype.onBetPanelButtonPressed = function(e) {
            var button = e.getPayload();
            switch (button[1]) {
                case 1:
                    this.onPressOfSpinBtn();
                    break;
                case 3:
                    this.onPressSkipButton();
                    break;
                case 6:
                    this.paytablePort.setNextPage().publish(null);
                    break;
                case 7:
                    this.paytablePort.setPreviousPage().publish(null);
                    break;
                case 5:
                    this.slotModelPort.getGameCommands().getPaytableCommandExecuted().publish(null);
                    break;
                case 8:
                    this.closePaytable();
                    break;
                case 9:
                    this.enableSound(false);
                    break;
                case 10:
                    this.enableSound(true);
                    break;
                case 13:
                    this.onAutoplayPressed();
                    break;
                case 14:
                    this.onAutoplayStopPressed();
                    break;
                default:
            }
        };
        ballooniesIxfGameController.GameController.prototype.onAutoplayStopPressed = function() {
            this.autoplayController.stopAutoSpins();
            this.betPanelPort.disableButton().publish(betPanelApi.EButton.AUTO_PLAY_BUTTON);
        };
        ballooniesIxfGameController.GameController.prototype.onAutoplayPressed = function() {
            this.popupPort.getHide().publish(null);
            var autoSpinPayload = new slotModelApi.AutospinCommandPayload(null, null, null);
            this.slotModelPort.getGameCommands().getStartAutoSpinsCommandExecuted().publish(autoSpinPayload);
            this.betPanelPort.disableButton().publish(betPanelApi.EButton.SPIN);
            this.infoBarControl.hideCentralLabel();
        };
        ballooniesIxfGameController.GameController.prototype.prepareForNextTumbleSpin = function() {
            this.betPanelPort.disableButton().publish(betPanelApi.EButton.SKIP);
        };
        ballooniesIxfGameController.GameController.prototype.continueAfterAbort = function() {
            if (this.model.isSpinAborted) {
                this.slotModelPort.getGameCommands().getSpinCommandExecuted().publish(null);
                this.changeSpinButtonConnectionState(betPanelApi.CustomButtonStatePayload.CONNECTING_STATE);
                this.stopRequestTimer();
            }
        };
        ballooniesIxfGameController.GameController.prototype.stopRequestTimer = function() {
            if (this.repeatSpinRequestTimer != null) {
                this.repeatSpinRequestTimer.stop();
                this.repeatSpinRequestTimer = null;
            }
        };
        ballooniesIxfGameController.GameController.prototype.onPressSkipButton = function() {
            this.prepareForNextTumbleSpin();
            if (this.abortSpinPayload == null) this.hideWinAnimation();
            this.completeWinMeter();
            this.continueAfterAbort();
        };
        ballooniesIxfGameController.GameController.prototype.onPressOfSpinBtn = function() {
            this.stopRequestTimer();
            this.betPanelPort.disableButton().publish(betPanelApi.EButton.SPIN);
            this.betPanelPort.disableButton().publish(betPanelApi.EButton.AUTO_PLAY_BUTTON);
            this.hideAwardCap();
            this.slotModelPort.getGameCommands().getSpinCommandExecuted().publish(null);
            this.winMeterControl.hideWinMeterWin();
            this.hideWinAnimation();
        };
        ballooniesIxfGameController.GameController.prototype.openPaytable = function() {
            this.paytableOpened = true;
            this.paytablePort.show().publish(null);
            this.reelsPort.getHide().publish(null);
            this.infoBarControl.hideCentralLabel();
            this.animationsPort.getMainLogo().sleep();
        };
        ballooniesIxfGameController.GameController.prototype.onPaytableClose = function(e) {
            this.closePaytable();
        };
        ballooniesIxfGameController.GameController.prototype.onPaytablePageChanged = function(e) {
            this.betPanelPort.showPaytableControl().publish(e.getPayload());
        };
        ballooniesIxfGameController.GameController.prototype.closePaytable = function() {
            this.paytableOpened = false;
            this.paytablePort.hide().publish(null);
            this.betPanelPort.hidePaytableControl().publish(null);
            this.reelsPort.getShow().publish(null);
            this.setInfoBarIdleText();
            this.autoplayController.enableAutoplayButton();
            this.animationsPort.getMainLogo().wakeUp();
        };
        ballooniesIxfGameController.GameController.prototype.forcePaytableClose = function() {
            this.paytableOpened = false;
            this.paytablePort.hide().publish(null);
            this.betPanelPort.hidePaytableControl().publish(null);
            this.reelsPort.getShow().publish(null);
        };
        ballooniesIxfGameController.GameController.prototype.onBetPanelStakeChanged = function(e) {
            this.hideAwardCap();
            var stakeItems = e.getPayload();
            var channel = ballooniesIxfGameController.ExternalService.gfBusChanel;
            var topic = this.getBetPanelTopic(stakeItems);
            channel.publish(topic, null);
            this.model.stakeItems = stakeItems;
            this.slotModelPort.getGameCommands().getStakeCommandExecuted().publish(stakeItems);
        };
        ballooniesIxfGameController.GameController.prototype.getBetPanelTopic = function(stakeItems) {
            var result;
            if (this.model.stakeItems != null) {
                var newBet = parseFloat(stakeItems.betPerLine);
                var prevBet = parseFloat(this.model.stakeItems.betPerLine);
                if (newBet < prevBet) result = "betpanel:previousBet";
                else if (this.model.isMaxBet(newBet)) result = "betpanel:maxBet";
                else result = "betpanel:nextBet";
            } else result = "betpanel:nextBet";
            return result;
        };
        ballooniesIxfGameController.GameController.prototype.onReelOutcomeExit = function(e) {
            if (e.getPayload() == 0) this.dispatchEvent(ballooniesIxfGameController.StateMachineDef.SPIN_STARTING_ENDED);
        };
        ballooniesIxfGameController.GameController.prototype.onReelsStopping = function(e) {
            if (this.model.isFreeSpin()) this.setFSAmountMessage();
            this.winLinesPort.getStopIdleAnimation().publish(true);
        };
        ballooniesIxfGameController.GameController.prototype.onSpinStopped = function(e) {
            if (this.stateMachine.isInState(ballooniesIxfGameController.StateMachineDef.ABORT_SPIN_STATE)) this.publishSpinAborted();
            else this.applySpinStop();
        };
        ballooniesIxfGameController.GameController.prototype.applySpinStop = function() {
            if (this.spinStopAvailable()) {
                this.slotModelPort.getStages().getSpinStage().getReelSpinFinished().publish(null);
                this.checkAutoplayFinished();
            } else this.onModelSpinStop(null);
        };
        ballooniesIxfGameController.GameController.prototype.spinStopAvailable = function() {
            return this.stateMachine.isInState(ballooniesIxfGameController.StateMachineDef.STOPPING_STATE);
        };
        ballooniesIxfGameController.GameController.prototype.publishSpinAborted = function() {
            this.slotModelPort.getStages().getAbortStage().getSpinAborted().publish(null);
        };
        ballooniesIxfGameController.GameController.prototype.showPickerIntro = function() {
            this.winMeterControl.hideWinMeterWin();
            this.model.isBonusComplete = false;
            this.popupPort.getShowPicker().publish(null);
            this.loadBackground(1);
        };
        ballooniesIxfGameController.GameController.prototype.onPickerIntroComplete = function(e) {
            this.dispatchEvent(ballooniesIxfGameController.StateMachineDef.PICKER_INTRO_FINISHED);
        };
        ballooniesIxfGameController.GameController.prototype.enablePicker = function() {
            this.popupPort.getEnablePickerButtons().publish(null);
        };
        ballooniesIxfGameController.GameController.prototype.onSelection = function(e) {
            var value = e.getPayload();
            this.changeSpinButtonConnectionState(betPanelApi.CustomButtonStatePayload.CONNECTING_STATE);
            this.processChosenPick(value);
        };
        ballooniesIxfGameController.GameController.prototype.hidePicker = function() {
            this.popupPort.getShowPickerOutro().publish(null);
        };
        ballooniesIxfGameController.GameController.prototype.onSelectPickerBonus = function(e) {
            this.model.pickerChoices = e.getPayload();
            this.winAnimationReadyToSpawnSubscription.unsubscribe();
            this.winAnimationReadyToSpawnSubscription = this.winLinesPort.getExplosionReadyToSpawn().subscribe($bind(this, this.onBonusExplosionReadyToSpawn));
            var payout = this.moneyFormatter.format(this.model.getSingleScatterWin());
            var winpayload = new ballooniesIxfComponentsWinlinesPort.WinPayload(this.model.getBonusOutcome(), payout, this.model.isLowWin());
            this.winLinesPort.getShowOutcome().publish(winpayload);
        };
        ballooniesIxfGameController.GameController.prototype.showPickerResult = function() {
            this.changeSpinButtonConnectionState(betPanelApi.CustomButtonStatePayload.CONNECTED_STATE);
            if (this.abortSpinPayload == null) {
                this.popupPort.getShowPickerResult().publish(this.model.pickerOutcome);
                this.prepareFSBetPanel();
            }
        };
        ballooniesIxfGameController.GameController.prototype.onPickerResultShown = function(e) {
            this.reelsPort.getUpdateReelPicture().publish(this.model.startFSReelPicture);
            this.reelsPort.getHide().publish(null);
            this.popupPort.getShowPickerOutro().publish(null);
            this.changeBackground(1, true);
            this.infoBarControl.showCentralLabel(this.translationManager.stringLookup("InfoBarFSTriggered"));
        };
        ballooniesIxfGameController.GameController.prototype.hideFSIntro = function() {
            this.popupPort.getHide().publish(null);
        };
        ballooniesIxfGameController.GameController.prototype.onPickerOutroComplete = function(e) {
            this.dispatchEvent(ballooniesIxfGameController.StateMachineDef.START_FS_INTRO);
        };
        ballooniesIxfGameController.GameController.prototype.startFSIntroAnim = function() {
            this.popupPort.getShowFSIntro().publish(this.model.numFreeSpinsAwarded);
            this.model.isScatterShown = false;
        };
        ballooniesIxfGameController.GameController.prototype.onFSIntroFinished = function(e) {
            this.publishSpinOutcomePresented();
            this.setFSAmountMessage();
            this.setTotalWinToinfoBar(this.model.getTotalWinOnStartingBonus());
            this.reelsPort.getShow().publish(null);
        };
        ballooniesIxfGameController.GameController.prototype.setButtonsToIdle = function() {
            this.showSpinButton();
            this.betPanelPort.hideButton().publish(betPanelApi.EButton.SKIP);
            this.betPanelPort.enableButton().publish(betPanelApi.EButton.SPIN);
        };
        ballooniesIxfGameController.GameController.prototype.loadBackground = function(id) {
            this.backgroundPort.prepareBackground().publish(new ballooniesIXFBackgroundPort.ChangeBackgroundPayload(id));
        };
        ballooniesIxfGameController.GameController.prototype.changeBackground = function(id, fade) {
            this.backgroundPort.getChange().publish(new ballooniesIXFBackgroundPort.ChangeBackgroundPayload(id, fade));
            if (id == 0) this.switchReelFrame(ballooniesIXFAnimationPort.AnimationComponent.BONUS_REEL_FRAME, ballooniesIXFAnimationPort.AnimationComponent.BASE_REEL_FRAME);
            else this.switchReelFrame(ballooniesIXFAnimationPort.AnimationComponent.BASE_REEL_FRAME, ballooniesIXFAnimationPort.AnimationComponent.BONUS_REEL_FRAME);
        };
        ballooniesIxfGameController.GameController.prototype.switchReelFrame = function(toHide, toShow) {
            this.publishHideAnimationComponent(toHide);
            this.publishShowAnimationComponent(toShow);
        };
        ballooniesIxfGameController.GameController.prototype.publishShowAnimationComponent = function(componentId) {
            this.animationsPort.getAnimationAction().publish(new ballooniesIXFAnimationPort.AnimationAction(componentId, ballooniesIXFAnimationPort.Action.SHOW));
        };
        ballooniesIxfGameController.GameController.prototype.publishHideAnimationComponent = function(componentId) {
            this.animationsPort.getAnimationAction().publish(new ballooniesIXFAnimationPort.AnimationAction(componentId, ballooniesIXFAnimationPort.Action.HIDE));
        };
        ballooniesIxfGameController.GameController.prototype.stopTumbleProgress = function() {
            this.model.isFirstSpin = this.model.isLastSpinInRound() || this.model.isSpinAborted && this.model.isBaseGame();
            this.model.resetSpinAborting();
        };
        ballooniesIxfGameController.GameController.prototype.updateFSTotalWin = function() {
            this.setTotalWinToinfoBar();
        };
        ballooniesIxfGameController.GameController.prototype.abortPicker = function() {
            this.publishSpinAborted();
        };
        ballooniesIxfGameController.GameController.prototype.__class__ = ballooniesIxfGameController.GameController;
        ballooniesIxfGameController.GameControllerConfig = function() {};
        ballooniesIxfGameController.GameControllerConfig.__name__ = ["ballooniesIxfGameController", "GameControllerConfig"];
        ballooniesIxfGameController.GameControllerConfig.prototype.fsFirstSpinDelay = null;
        ballooniesIxfGameController.GameControllerConfig.prototype.fsNoWinSpinDelay = null;
        ballooniesIxfGameController.GameControllerConfig.prototype.fsBeforeSummaryDelay = null;
        ballooniesIxfGameController.GameControllerConfig.prototype.closeMultiplierTime = null;
        ballooniesIxfGameController.GameControllerConfig.prototype.clearInfobarOnSmallWinDelay = null;
        ballooniesIxfGameController.GameControllerConfig.prototype.maxAwardSpinEnabledDelay = null;
        ballooniesIxfGameController.GameControllerConfig.prototype.delayRepeatSpinrequest = null;
        ballooniesIxfGameController.GameControllerConfig.prototype.__class__ = ballooniesIxfGameController.GameControllerConfig;
        ballooniesIxfGameController.GameModel = function(translationManager) {
            this.isScatterShown = false;
            this.rgPresentation = false;
            this.isBonusComplete = true;
            this.promotionalSpinsActive = false;
            this.denomination = 1.0;
            this.baseGameTotalWin = 0.0;
            this.isResume = false;
            this.isSpinAborted = false;
            this.accumulatedWinOfOneFreeSpin = 0.0;
            this.translationManager = translationManager;
        };
        ballooniesIxfGameController.GameModel.__name__ = ["ballooniesIxfGameController", "GameModel"];
        ballooniesIxfGameController.GameModel.prototype.spinOutcome = null;
        ballooniesIxfGameController.GameModel.prototype.outcome = null;
        ballooniesIxfGameController.GameModel.prototype.stakeState = null;
        ballooniesIxfGameController.GameModel.prototype.stakeItems = null;
        ballooniesIxfGameController.GameModel.prototype.accumulatedWinOfOneFreeSpin = null;
        ballooniesIxfGameController.GameModel.prototype.previousWinMeterValue = null;
        ballooniesIxfGameController.GameModel.prototype.pickerChoices = null;
        ballooniesIxfGameController.GameModel.prototype.pickerOutcome = null;
        ballooniesIxfGameController.GameModel.prototype.numFreeSpinsAwarded = null;
        ballooniesIxfGameController.GameModel.prototype.winSymbols = null;
        ballooniesIxfGameController.GameModel.prototype.winOfPreviousFreeSpins = null;
        ballooniesIxfGameController.GameModel.prototype.isFirstSpin = null;
        ballooniesIxfGameController.GameModel.prototype.isSpinAborted = null;
        ballooniesIxfGameController.GameModel.prototype.isResume = null;
        ballooniesIxfGameController.GameModel.prototype.baseGameTotalWin = null;
        ballooniesIxfGameController.GameModel.prototype.denomination = null;
        ballooniesIxfGameController.GameModel.prototype.customField = null;
        ballooniesIxfGameController.GameModel.prototype.promotionalSpinsActive = null;
        ballooniesIxfGameController.GameModel.prototype.promotionalSpinsCount = null;
        ballooniesIxfGameController.GameModel.prototype.translationManager = null;
        ballooniesIxfGameController.GameModel.prototype.isBonusComplete = null;
        ballooniesIxfGameController.GameModel.prototype.startFSReelPicture = null;
        ballooniesIxfGameController.GameModel.prototype.resultPayload = null;
        ballooniesIxfGameController.GameModel.prototype.isBonusSummary = null;
        ballooniesIxfGameController.GameModel.prototype.totalBet = null;
        ballooniesIxfGameController.GameModel.prototype.rgPresentation = null;
        ballooniesIxfGameController.GameModel.prototype.isScatterShown = null;
        ballooniesIxfGameController.GameModel.prototype.setSpinOutcome = function(spinOutcome) {
            this.spinOutcome = spinOutcome;
            this.customField = spinOutcome.baseGame.outcome.customField;
            if (this.isPicker()) {
                this.setPickerOutcome(spinOutcome.pickerBonus.outcome);
                this.numFreeSpinsAwarded = spinOutcome.freeSpin.awarded;
                this.winOfPreviousFreeSpins = parseFloat(spinOutcome.acumulatedFreeSpinPayout);
                this.baseGameTotalWin = _hcmn_.Std.parseFloat(this.customField.baseGameTotalWin) * this.denomination;
            }
            if (this.isBaseGame() || this.isResume && this.isFreeSpinEnded()) {
                this.isBonusComplete = true;
                this.setOutcome(this.spinOutcome.baseGame.outcome);
            } else {
                this.isBonusComplete = false;
                this.setOutcome(this.spinOutcome.freeSpin.outcome);
            }
        };
        ballooniesIxfGameController.GameModel.prototype.setCurrentOutcome = function() {
            this.setOutcome(this.getCurrentOutcome());
        };
        ballooniesIxfGameController.GameModel.prototype.setOutcome = function(outcome) {
            this.outcome = outcome;
            if (this.isFreeSpin() && !this.isBonusComplete || this.isPicker()) this.mapOutcomSymbolsForBonusGame(outcome);
            else this.mapOutcomSymbolsForBaseGame(outcome);
            this.setWinSymbolMatrix();
            if (this.isFreeSpin()) this.calculateFreeSpinWinDetails();
        };
        ballooniesIxfGameController.GameModel.prototype.calculateFreeSpinWinDetails = function() {
            if (this.isResume) {
                this.accumulatedWinOfOneFreeSpin = components.gamecontroller.impl.FloatUtil.fixedFloat(this.customField.fsSingleWin * this.denomination);
                this.winOfPreviousFreeSpins = components.gamecontroller.impl.FloatUtil.fixedFloat(this.customField.fsTotalPrevious * this.denomination);
                this.baseGameTotalWin = components.gamecontroller.impl.FloatUtil.fixedFloat(this.customField.baseGameTotalWin * this.denomination);
                return;
            }
            var payout = parseFloat(this.outcome.totalPayout);
            if (payout > 0) this.accumulatedWinOfOneFreeSpin = components.gamecontroller.impl.FloatUtil.fixedFloat(this.accumulatedWinOfOneFreeSpin + payout);
            else {
                var value = parseFloat(this.spinOutcome.acumulatedFreeSpinPayout) - this.winOfPreviousFreeSpins;
                this.accumulatedWinOfOneFreeSpin = components.gamecontroller.impl.FloatUtil.fixedFloat(value);
                this.winOfPreviousFreeSpins = parseFloat(this.spinOutcome.acumulatedFreeSpinPayout);
            }
        };
        ballooniesIxfGameController.GameModel.prototype.getFSAccumulatedPayout = function() {
            var payout;
            if (this.isPicker()) {
                payout = parseFloat(this.spinOutcome.acumulatedFreeSpinPayout);
                if (this.isResume) payout += this.baseGameTotalWin;
            } else if (this.isFreeSpin()) {
                if (this.outcome.totalPayout != "0") payout = (this.customField.baseGameTotalWin + this.customField.fsTotalPrevious) * this.denomination;
                else payout = (this.customField.baseGameTotalWin + this.customField.fsTotalWin) * this.denomination;
            } else payout = 0;
            return components.gamecontroller.impl.FloatUtil.fixedFloat(payout) + "";
        };
        ballooniesIxfGameController.GameModel.prototype.getMultiplierOfOutcome = function(outcome) {
            if (outcome == null || outcome.scatterWins == null) return 0;
            var multiplier = 0;
            var _g = 0;
            var _g1 = outcome.scatterWins;
            while (_g < _g1.length) {
                var win = _g1[_g];
                ++_g;
                if (win.winningSymbol == "s08") {
                    var _g3 = 0;
                    var _g2 = win.symbolCount;
                    while (_g3 < _g2) {
                        var i = _g3++;
                        multiplier += _hcmn_.Math.round(outcome.customField.multipliers[i]);
                    }
                }
            }
            return multiplier;
        };
        ballooniesIxfGameController.GameModel.prototype.getTotalMultiplier = function(freeSpin) {
            if (freeSpin) return this.customField.totalFSMultiplier;
            else return this.customField.totalMultiplier;
        };
        ballooniesIxfGameController.GameModel.prototype.getResumingMultiplier = function() {
            var isBonus = this.isFreeSpin() && !this.isFreeSpinEnded() || this.isPicker();
            var totalMultiplier = this.getTotalMultiplier(isBonus);
            var tumbleMultiplier = this.getMultiplierOfOutcome(this.getResumingOutcome());
            return totalMultiplier - tumbleMultiplier;
        };
        ballooniesIxfGameController.GameModel.prototype.getResumingWin = function() {
            var accumulated = parseFloat(this.spinOutcome.acumulatedPayout);
            if (this.isFreeSpin() && !this.isFreeSpinEnded()) accumulated = components.gamecontroller.impl.FloatUtil.fixedFloat(this.customField.fsSingleWin * this.denomination);
            var currentTumbleWin = this.outcome.totalPayout;
            var result = components.gamecontroller.impl.FloatUtil.fixedFloat(accumulated - parseFloat(currentTumbleWin));
            if (result == null) return "null";
            else return "" + result;
        };
        ballooniesIxfGameController.GameModel.prototype.getTotalWinOnStartingBonus = function() {
            var accumulatedFromOutcome = parseFloat(this.spinOutcome.acumulatedFreeSpinPayout);
            var result = components.gamecontroller.impl.FloatUtil.fixedFloat(this.baseGameTotalWin + accumulatedFromOutcome);
            if (result == null) return "null";
            else return "" + result;
        };
        ballooniesIxfGameController.GameModel.prototype.mapOutcomSymbolsForBaseGame = function(outcome) {
            var bonusWins = outcome.bonusWins;
            if (bonusWins == null) bonusWins = [];
            else bonusWins = bonusWins;
            var _g = 0;
            while (_g < bonusWins.length) {
                var bonusWin = bonusWins[_g];
                ++_g;
                if (bonusWin.winningSymbol == null) eval("bonusWin.winningSymbol = 'b01'");
            }
        };
        ballooniesIxfGameController.GameModel.prototype.mapOutcomSymbolsForBonusGame = function(outcome) {
            var stopReels = outcome.reelStop.reels;
            var _g = 0;
            while (_g < 5) {
                var i = _g++;
                var _g1 = 0;
                while (_g1 < 3) {
                    var j = _g1++;
                    if (stopReels[i][j] == "s01") stopReels[i][j] = "fs01";
                }
            }
        };
        ballooniesIxfGameController.GameModel.prototype.getButtonIndex = function(pickerName) {
            var r = new _hcmn_.EReg("L.C(\\d)R.", "");
            r.match(pickerName);
            return _hcmn_.Std.parseInt(r.matched(1));
        };
        ballooniesIxfGameController.GameModel.prototype.setPickerOutcome = function(outcome) {
            var picks = outcome.pickerWins[0].picks;
            var _g = [];
            var _g2 = 0;
            var _g1 = picks.length;
            while (_g2 < _g1) {
                var i = _g2++;
                _g.push(null);
            }
            this.pickerOutcome = _g;
            var _g11 = 0;
            while (_g11 < picks.length) {
                var entry = picks[_g11];
                ++_g11;
                var index = this.getButtonIndex(entry.name);
                this.pickerOutcome[index] = new slotModelApi.Pair(entry.values[0].value, entry.picked);
            }
        };
        ballooniesIxfGameController.GameModel.prototype.updateLastAccumulatedPayout = function() {
            this.accumulatedWinOfOneFreeSpin = components.gamecontroller.impl.FloatUtil.fixedFloat(parseFloat(this.spinOutcome.acumulatedPayout));
        };
        ballooniesIxfGameController.GameModel.prototype.getLinePictureForWin = function(win) {
            var result;
            var _g = [];
            var _g1 = 0;
            while (_g1 < 5) {
                var i = _g1++;
                _g.push("-");
            }
            result = _g;
            var reelsInfo = win.winPath.reelsInfo;
            var reels = this.outcome.reelStop.reels;
            var _g2 = 0;
            var _g11 = win.symbolCount;
            while (_g2 < _g11) {
                var k = _g2++;
                var _g4 = 0;
                var _g3 = reelsInfo[k].length;
                while (_g4 < _g3) {
                    var i1 = _g4++;
                    if (win.winPath.reelsInfo[k][i1] == 1) {
                        result[k] = reels[k][i1];
                        break;
                    }
                }
            }
            return result;
        };
        ballooniesIxfGameController.GameModel.prototype.setCurrentStake = function(stakeState) {
            this.stakeState = stakeState;
            this.totalBet = stakeState.totalBet;
        };
        ballooniesIxfGameController.GameModel.prototype.setWinSymbolMatrix = function() {
            if (this.noWinsInOutcome() || this.bonusWinsBeforeFreeSpins() || this.isAwardCap()) {
                this.winSymbols = null;
                return;
            }
            var _g = [];
            var _g1 = 0;
            while (_g1 < 5) {
                var i = _g1++;
                _g.push((function($this) {
                    var $r;
                    var _g2 = []; {
                        var _g3 = 0;
                        while (_g3 < 3) {
                            var j = _g3++;
                            _g2.push(false);
                        }
                    }
                    $r = _g2;
                    return $r;
                }(this)));
            }
            this.winSymbols = _g;
            this.addWinPaths(this.outcome.lineWins);
            this.addWinPaths(this.outcome.scatterWins);
            if (this.isFreeSpinEnded()) this.addWinPaths(this.outcome.bonusWins);
        };
        ballooniesIxfGameController.GameModel.prototype.isAwardCap = function() {
            return this.spinOutcome != null && this.spinOutcome.awardCapExceeded;
        };
        ballooniesIxfGameController.GameModel.prototype.noWinsInOutcome = function() {
            return this.outcome.lineWins == null && this.outcome.scatterWins == null && this.outcome.bonusWins == null;
        };
        ballooniesIxfGameController.GameModel.prototype.bonusWinsBeforeFreeSpins = function() {
            return this.outcome.bonusWins != null && !this.isFreeSpinEnded();
        };
        ballooniesIxfGameController.GameModel.prototype.addWinPaths = function(wins) {
            if (wins != null) {
                var _g = 0;
                while (_g < wins.length) {
                    var w = wins[_g];
                    ++_g;
                    this.addWinPath(w.winPath.reelsInfo);
                }
            }
        };
        ballooniesIxfGameController.GameModel.prototype.addWinPath = function(path) {
            var _g = 0;
            while (_g < 5) {
                var i = _g++;
                var _g1 = 0;
                while (_g1 < 3) {
                    var j = _g1++;
                    this.winSymbols[i][j] = this.winSymbols[i][j] || path[i][j] == 1;
                }
            }
        };
        ballooniesIxfGameController.GameModel.prototype.getWinSymbolMatrix = function() {
            return this.winSymbols;
        };
        ballooniesIxfGameController.GameModel.prototype.isPicker = function() {
            return this.spinOutcome != null && new _hcmn_.EReg("^Picker", "").match(this.spinOutcome.stage);
        };
        ballooniesIxfGameController.GameModel.prototype.isBaseGame = function() {
            return this.spinOutcome != null && new _hcmn_.EReg("^BaseGame", "").match(this.spinOutcome.stage);
        };
        ballooniesIxfGameController.GameModel.prototype.isFreeSpin = function() {
            return this.spinOutcome != null && new _hcmn_.EReg("^FreeSpin", "").match(this.spinOutcome.stage);
        };
        ballooniesIxfGameController.GameModel.prototype.isFreeSpinEnded = function() {
            return this.isFreeSpin() && new _hcmn_.EReg("^BaseGame", "").match(this.spinOutcome.nextStage);
        };
        ballooniesIxfGameController.GameModel.prototype.isFirstSpinInRound = function() {
            return this.isFirstSpin;
        };
        ballooniesIxfGameController.GameModel.prototype.isLastSpinInRound = function() {
            return this.spinOutcome != null && !new _hcmn_.EReg("Tumble$", "").match(this.spinOutcome.nextStage);
        };
        ballooniesIxfGameController.GameModel.prototype.isInTumble = function() {
            return this.spinOutcome != null && new _hcmn_.EReg("Tumble$", "").match(this.spinOutcome.nextStage);
        };
        ballooniesIxfGameController.GameModel.prototype.hasWin = function() {
            return this.outcome.totalPayout != "0" || this.isFreeSpinEnded();
        };
        ballooniesIxfGameController.GameModel.prototype.isScatterWin = function(win) {
            return win.type == "Scatter";
        };
        ballooniesIxfGameController.GameModel.prototype.isBonusWin = function(win) {
            return win.type == "BaseGame.Bonus";
        };
        ballooniesIxfGameController.GameModel.prototype.hasLinesWin = function() {
            return this.spinOutcome != null && this.outcome.lineWins != null;
        };
        ballooniesIxfGameController.GameModel.prototype.hasMultiplier = function() {
            return this.spinOutcome != null && this.outcome.scatterWins != null;
        };
        ballooniesIxfGameController.GameModel.prototype.hasWonFreeSpins = function() {
            return this.spinOutcome != null && this.spinOutcome.nextStage == "Picker";
        };
        ballooniesIxfGameController.GameModel.prototype.isMaxBet = function(bet) {
            var length = this.stakeState.totalBetsForSelectedLines.length;
            var lastBet = parseFloat(this.stakeState.totalBetsForSelectedLines[length - 1].value);
            return lastBet == bet;
        };
        ballooniesIxfGameController.GameModel.prototype.getBonusOutcome = function() {
            var outcome = this.getCurrentOutcome();
            var result = new slotModelApi.Outcome(outcome.reelStop, outcome.reelStopAdditional, [], [], outcome.bonusWins, [], outcome.totalPayout, outcome.bigWin, outcome.customField);
            return result;
        };
        ballooniesIxfGameController.GameModel.prototype.getCurrentOutcome = function() {
            if (this.isResume) return this.getResumingOutcome();
            return this.outcome;
        };
        ballooniesIxfGameController.GameModel.prototype.getResumingOutcome = function() {
            if (this.isBaseGame() || this.isFreeSpinEnded()) return this.spinOutcome.baseGame.outcome;
            return this.spinOutcome.freeSpin.outcome;
        };
        ballooniesIxfGameController.GameModel.prototype.getIDLEText = function() {
            var infoBarText;
            if (this.promotionalSpinsActive) infoBarText = this.getPromoSpinsMessage();
            else if (this.hasWonFreeSpins()) infoBarText = this.stringLookup("InfoBarFSAwarded");
            else infoBarText = this.stringLookup("InfoBarIdle");
            return infoBarText;
        };
        ballooniesIxfGameController.GameModel.prototype.getPromoSpinsMessage = function() {
            var infoBarText = "";
            if (this.promotionalSpinsActive) infoBarText = this.stringLookup("InfoBarPromotionalSpinsLeft") + " " + this.promotionalSpinsCount;
            return infoBarText;
        };
        ballooniesIxfGameController.GameModel.prototype.getGoodLuckMessage = function() {
            if (this.isSpinAborted) return "";
            else return this.stringLookup("InfoBarGoodLuck");
        };
        ballooniesIxfGameController.GameModel.prototype.getCentralMessage = function() {
            if (ballooniesIxfGameController.ExternalService.isMini()) return "";
            var infoBarText;
            if (this.promotionalSpinsActive) infoBarText = this.getPromoSpinsMessage();
            else infoBarText = this.getGoodLuckMessage();
            return infoBarText;
        };
        ballooniesIxfGameController.GameModel.prototype.stringLookup = function(value) {
            return this.translationManager.stringLookup(value);
        };
        ballooniesIxfGameController.GameModel.prototype.setDenomination = function(denomValue) {
            this.denomination = parseFloat(denomValue);
        };
        ballooniesIxfGameController.GameModel.prototype.setStartFSReelPicture = function(reels) {
            this.startFSReelPicture = [];
            var reskinFn = function(e) {
                if (e == "s01") return "fs01";
                else return e;
            };
            var _g = 0;
            while (_g < reels.length) {
                var reel = reels[_g];
                ++_g;
                this.startFSReelPicture.push(reel.map(reskinFn));
            }
        };
        ballooniesIxfGameController.GameModel.prototype.getSingleScatterWin = function() {
            var result = "";
            if (this.outcome != null && this.outcome.scatterWins != null && this.outcome.scatterWins.length > 0) {
                var scatterWin = this.outcome.scatterWins[0];
                var payout = parseFloat(scatterWin.payout) / scatterWin.symbolCount;
                result = components.gamecontroller.impl.FloatUtil.fixedFloat(payout) + "";
            }
            return result;
        };
        ballooniesIxfGameController.GameModel.prototype.resetSpinAborting = function() {
            if (!this.isInTumble() && this.isSpinAborted) this.isSpinAborted = false;
        };
        ballooniesIxfGameController.GameModel.prototype.getWinMeterParams = function() {
            var params = new components.gamecontroller.impl.WinMeterParams();
            if (this.spinOutcome == null) return params;
            if (this.resultPayload != null) params.init(this.resultPayload.totalWin, this.resultPayload.bigWin);
            else if (this.isFreeSpin() && !this.isBonusComplete) {
                var bigWinFeeSpin = new slotModelApi.BigWin(2, [{
                    totalWin: params.payout,
                    winGroup: 2
                }], null);
                params.init(this.accumulatedWinOfOneFreeSpin + "", bigWinFeeSpin);
            } else params.init(this.spinOutcome.acumulatedPayout, this.spinOutcome.baseGame.outcome.bigWin);
            params.countUp = this.isWinCountUpNeeded(params.payout, params.winSegments.length);
            if (params.countUp) params.startingAmount = "0";
            else params.startingAmount = this.previousWinMeterValue;
            return params;
        };
        ballooniesIxfGameController.GameModel.prototype.isWinCountUpNeeded = function(payout, winSegmentCount) {
            if (winSegmentCount > 2) return true;
            return payout != this.previousWinMeterValue;
        };
        ballooniesIxfGameController.GameModel.prototype.canShowGamePaysInfo = function() {
            return this.spinOutcome.acumulatedPayout != "0";
        };
        ballooniesIxfGameController.GameModel.prototype.canExecuteContinue = function() {
            return !(this.isResume && this.isInTumble());
        };
        ballooniesIxfGameController.GameModel.prototype.isHighWin = function() {
            if (this.spinOutcome != null) {
                var totalPayout = parseFloat(this.spinOutcome.baseGame.outcome.totalPayout);
                if (this.getStageName(this.spinOutcome.stage) == "FreeSpin" && this.getStageName(this.spinOutcome.nextStage) == "BaseGame" && this.isBonusSummary) totalPayout = parseFloat(this.spinOutcome.acumulatedPayout);
                else if (this.getStageName(this.spinOutcome.stage) == "FreeSpin" && this.getStageName(this.spinOutcome.nextStage) == "BaseGame" && !this.isBonusSummary) totalPayout = parseFloat(this.spinOutcome.freeSpin.outcome.totalPayout);
                else if (this.getStageName(this.spinOutcome.stage) == "FreeSpin" && this.getStageName(this.spinOutcome.nextStage) == "FreeSpin") totalPayout = parseFloat(this.spinOutcome.freeSpin.outcome.totalPayout);
                var totalBetValue = parseFloat(this.totalBet);
                if (totalPayout > totalBetValue || totalPayout == 0 || this.isScatterShown) return true;
            }
            return false;
        };
        ballooniesIxfGameController.GameModel.prototype.isLowWin = function() {
            var isLowWin = false;
            if (this.rgPresentation) {
                if (!this.isHighWin()) isLowWin = true;
            }
            return isLowWin;
        };
        ballooniesIxfGameController.GameModel.prototype.getStageName = function(stageString) {
            switch (stageString) {
                case "BaseGameTumble":
                    return "BaseGame";
                case "FreeSpinTumble":
                    return "FreeSpin";
                default:
                    return stageString;
            }
        };
        ballooniesIxfGameController.GameModel.getEmptyMatrix = function(defaultValue) {
            if (defaultValue == null) defaultValue = 0;
            var visibility;
            var _g = [];
            var _g1 = 0;
            while (_g1 < 5) {
                var i = _g1++;
                _g.push((function($this) {
                    var $r;
                    var _g2 = []; {
                        var _g3 = 0;
                        while (_g3 < 3) {
                            var j = _g3++;
                            _g2.push(defaultValue);
                        }
                    }
                    $r = _g2;
                    return $r;
                }(this)));
            }
            visibility = _g;
            return visibility;
        };
        ballooniesIxfGameController.GameModel.prototype.__class__ = ballooniesIxfGameController.GameModel;
        if (typeof components == 'undefined') {
            var components = {};
        };
        if (!components.gamecontroller) {
            components.gamecontroller = {};
        };
        if (!components.gamecontroller.impl) {
            components.gamecontroller.impl = {};
        };
        components.gamecontroller.impl.WinMeterParams = function() {
            this.countUp = false;
            this.startingAmount = "0";
            this.payout = "0";
            this.winGroup = 0;
            this.winSegments = [];
        };
        components.gamecontroller.impl.WinMeterParams.__name__ = ["components", "gamecontroller", "impl", "WinMeterParams"];
        components.gamecontroller.impl.WinMeterParams.prototype.winSegments = null;
        components.gamecontroller.impl.WinMeterParams.prototype.winGroup = null;
        components.gamecontroller.impl.WinMeterParams.prototype.payout = null;
        components.gamecontroller.impl.WinMeterParams.prototype.startingAmount = null;
        components.gamecontroller.impl.WinMeterParams.prototype.countUp = null;
        components.gamecontroller.impl.WinMeterParams.prototype.init = function(payout, bigWin) {
            this.payout = payout;
            this.winGroup = bigWin.winGroup;
            this.winSegments = bigWin.winSegments;
        };
        components.gamecontroller.impl.WinMeterParams.prototype.__class__ = components.gamecontroller.impl.WinMeterParams;
        components.gamecontroller.impl.FloatUtil = function() {};
        components.gamecontroller.impl.FloatUtil.__name__ = ["components", "gamecontroller", "impl", "FloatUtil"];
        components.gamecontroller.impl.FloatUtil.fixedFloat = function(v, precision) {
            if (precision == null) precision = 2;
            var pow = _hcmn_.Math.pow(10, precision);
            return _hcmn_.Math.round(v * pow) / pow;
        };
        components.gamecontroller.impl.FloatUtil.prototype.__class__ = components.gamecontroller.impl.FloatUtil;
        ballooniesIxfGameController.Join = function(conditions) {
            this.map = new _hcmn_.haxe_ds_StringMap();
            if (conditions != null) {
                var _g = 0;
                while (_g < conditions.length) {
                    var condition = conditions[_g];
                    ++_g;
                    this.addCondition(condition);
                }
            }
        };
        ballooniesIxfGameController.Join.__name__ = ["ballooniesIxfGameController", "Join"];
        ballooniesIxfGameController.Join.prototype.callback = null;
        ballooniesIxfGameController.Join.prototype.map = null;
        ballooniesIxfGameController.Join.prototype.addCondition = function(id) {
            this.map.set(id, false);
        };
        ballooniesIxfGameController.Join.prototype.resolveCondition = function(id) {
            if (this.map.exists(id)) {
                this.map.set(id, true);
                if (this.isFinished()) {
                    this.clearAll();
                    this.callback();
                }
            }
        };
        ballooniesIxfGameController.Join.prototype.isFinished = function() {
            var out = true;
            var $it0 = this.map.iterator();
            while ($it0.hasNext()) {
                var value = $it0.next();
                out = out && value;
            }
            return out;
        };
        ballooniesIxfGameController.Join.prototype.clearAll = function() {
            var $it0 = this.map.keys();
            while ($it0.hasNext()) {
                var key = $it0.next();
                this.map.remove(key);
            }
        };
        ballooniesIxfGameController.Join.prototype.resolveAll = function() {
            if (_hcmn_.Lambda.array(this.map).length > 0) {
                this.clearAll();
                this.callback();
            }
        };
        ballooniesIxfGameController.Join.prototype.then = function(callback) {
            this.callback = callback;
            return this;
        };
        ballooniesIxfGameController.Join.prototype.__class__ = ballooniesIxfGameController.Join;
        ballooniesIxfGameController.StateMachineContext = function(dispatcher) {
            stateMachineEngine.SMContext.call(this, dispatcher);
        };
        ballooniesIxfGameController.StateMachineContext.__name__ = ["ballooniesIxfGameController", "StateMachineContext"];
        ballooniesIxfGameController.StateMachineContext.__super__ = stateMachineEngine.SMContext;
        for (var k in stateMachineEngine.SMContext.prototype) ballooniesIxfGameController.StateMachineContext.prototype[k] = stateMachineEngine.SMContext.prototype[k];
        ballooniesIxfGameController.StateMachineContext.prototype.setupContextData = function(game) {
            this.set_contextValues(new _hcmn_.haxe_ds_StringMap());
            var this1 = this.get_contextValues();
            this1.set("Stage", "");
            var this2 = this.get_contextValues();
            this2.set("NextStage", "");
            var this3 = this.get_contextValues();
            this3.set("awardCapExceeded", false);
            this.set_contextMethods(new _hcmn_.haxe_ds_StringMap());
            var this4 = this.get_contextMethods();
            this4.set("initGame", $bind(game, game.initGame));
            var this5 = this.get_contextMethods();
            this5.set("attachComponents", $bind(game, game.attachComponents));
            var this6 = this.get_contextMethods();
            this6.set("prepareResume", $bind(game, game.prepareResume));
            var this7 = this.get_contextMethods();
            this7.set("onBaseGameIdle", $bind(game, game.onBaseGameIdle));
            var this8 = this.get_contextMethods();
            this8.set("startSpin", $bind(game, game.startSpin));
            var this9 = this.get_contextMethods();
            this9.set("startAutoSpin", $bind(game, game.startAutoSpin));
            var this10 = this.get_contextMethods();
            this10.set("clearAllWins", $bind(game, game.clearAllWins));
            var this11 = this.get_contextMethods();
            this11.set("stopTumbleProgress", $bind(game, game.stopTumbleProgress));
            var this12 = this.get_contextMethods();
            this12.set("checkForStopOrAbort", $bind(game, game.checkForStopOrAbort));
            var this13 = this.get_contextMethods();
            this13.set("applyAbortData", $bind(game, game.applyAbortData));
            var this14 = this.get_contextMethods();
            this14.set("stopReels", $bind(game, game.stopReels));
            var this15 = this.get_contextMethods();
            this15.set("completeAbortedSpin", $bind(game, game.completeAbortedSpin));
            var this16 = this.get_contextMethods();
            this16.set("showBaseGameWins", $bind(game, game.showBaseGameWins));
            var this17 = this.get_contextMethods();
            this17.set("showScatterWins", $bind(game, game.showScatterWins));
            var this18 = this.get_contextMethods();
            this18.set("showFreeSpinWins", $bind(game, game.showFreeSpinWins));
            var this19 = this.get_contextMethods();
            this19.set("displayBaseGameWin", $bind(game, game.displayBaseGameWin));
            var this20 = this.get_contextMethods();
            this20.set("displayFreeSpinWin", $bind(game, game.displayFreeSpinWin));
            var this21 = this.get_contextMethods();
            this21.set("updateInfoBarOnSpin", $bind(game, game.updateInfoBarOnSpin));
            var this22 = this.get_contextMethods();
            this22.set("setBaseGameOutcome", $bind(game, game.setBaseGameOutcome));
            var this23 = this.get_contextMethods();
            this23.set("showSpinButton", $bind(game, game.showSpinButton));
            var this24 = this.get_contextMethods();
            this24.set("showSkipButton", $bind(game, game.showSkipButton));
            var this25 = this.get_contextMethods();
            this25.set("executeContinueCommand", $bind(game, game.executeContinueCommand));
            var this26 = this.get_contextMethods();
            this26.set("showAwardCapScreen", $bind(game, game.showAwardCapScreen));
            var this27 = this.get_contextMethods();
            this27.set("prepareAwardCap", $bind(game, game.prepareAwardCap));
            var this28 = this.get_contextMethods();
            this28.set("publishSpinOutcomePresented", $bind(game, game.publishSpinOutcomePresented));
            var this29 = this.get_contextMethods();
            this29.set("publishResultPresented", $bind(game, game.publishResultPresented));
            var this30 = this.get_contextMethods();
            this30.set("displayWinMeter", $bind(game, game.displayWinMeter));
            this.setPickerMethods(game);
            this.setFreeGameMethods(game);
        };
        ballooniesIxfGameController.StateMachineContext.prototype.setFreeGameMethods = function(game) {
            var this1 = this.get_contextMethods();
            this1.set("startFSIntroAnim", $bind(game, game.startFSIntroAnim));
            var this2 = this.get_contextMethods();
            this2.set("hideFSIntro", $bind(game, game.hideFSIntro));
            var this3 = this.get_contextMethods();
            this3.set("startFSOutroAnim", $bind(game, game.startFSOutroAnim));
            var this4 = this.get_contextMethods();
            this4.set("updateFSTotalWin", $bind(game, game.updateFSTotalWin));
        };
        ballooniesIxfGameController.StateMachineContext.prototype.setPickerMethods = function(game) {
            var this1 = this.get_contextMethods();
            this1.set("showPickerIntro", $bind(game, game.showPickerIntro));
            var this2 = this.get_contextMethods();
            this2.set("enablePicker", $bind(game, game.enablePicker));
            var this3 = this.get_contextMethods();
            this3.set("showPickerResult", $bind(game, game.showPickerResult));
            var this4 = this.get_contextMethods();
            this4.set("hidePicker", $bind(game, game.hidePicker));
            var this5 = this.get_contextMethods();
            this5.set("abortPicker", $bind(game, game.abortPicker));
        };
        ballooniesIxfGameController.StateMachineContext.prototype.__class__ = ballooniesIxfGameController.StateMachineContext;
        ballooniesIxfGameController.StateMachineDef = function() {};
        ballooniesIxfGameController.StateMachineDef.__name__ = ["ballooniesIxfGameController", "StateMachineDef"];
        ballooniesIxfGameController.StateMachineDef.prototype.__class__ = ballooniesIxfGameController.StateMachineDef;
        ballooniesIxfGameController.WinMeterControl = function(winMeterPort) {
            this.winMeterPort = winMeterPort;
            winMeterPort.onDisplayWinFinished().subscribe($bind(this, this.onWinMeterFinished));
        };
        ballooniesIxfGameController.WinMeterControl.__name__ = ["ballooniesIxfGameController", "WinMeterControl"];
        ballooniesIxfGameController.WinMeterControl.prototype.winMeterPort = null;
        ballooniesIxfGameController.WinMeterControl.prototype.onDisplayWinMeterFinished = null;
        ballooniesIxfGameController.WinMeterControl.prototype.isWinMeterInterruptAvailable = null;
        ballooniesIxfGameController.WinMeterControl.prototype.onWinMeterFinished = function(e) {
            this.onDisplayWinMeterFinished(e);
        };
        ballooniesIxfGameController.WinMeterControl.prototype.hideWinMeterWin = function() {
            this.winMeterPort.showMessage().publish("");
        };
        ballooniesIxfGameController.WinMeterControl.prototype.displayWinInstant = function(amount) {
            this.show(new winMeterApi.WinMeterPayload(amount, null, true, "0"));
        };
        ballooniesIxfGameController.WinMeterControl.prototype.displayWin = function(params, instantShow) {
            if (instantShow == null) instantShow = false;
            this.show(new winMeterApi.WinMeterPayload(params.payout, params.winSegments, instantShow, params.startingAmount));
        };
        ballooniesIxfGameController.WinMeterControl.prototype.show = function(payload) {
            this.hideWinMeterWin();
            this.winMeterPort.displayWin().publish(payload);
            this.isWinMeterInterruptAvailable = true;
        };
        ballooniesIxfGameController.WinMeterControl.prototype.showMessage = function(message) {
            this.winMeterPort.showMessage().publish(message);
        };
        ballooniesIxfGameController.WinMeterControl.prototype.__class__ = ballooniesIxfGameController.WinMeterControl;
        ballooniesIxfGameController.BaseInfoBarControl = function(infoBarPort) {
            this.infoBarPort = infoBarPort;
        };
        ballooniesIxfGameController.BaseInfoBarControl.__name__ = ["ballooniesIxfGameController", "BaseInfoBarControl"];
        ballooniesIxfGameController.BaseInfoBarControl.prototype.infoBarPort = null;
        ballooniesIxfGameController.BaseInfoBarControl.prototype.hideAll = function() {
            this.hideAllLabels();
            this.hideWinLineSummary();
        };
        ballooniesIxfGameController.BaseInfoBarControl.prototype.hideAllLabels = function() {
            this.hideLabel(infoBarApi.InfoBarLabelEnum.RIGHT);
            this.hideLabel(infoBarApi.InfoBarLabelEnum.LEFT);
            this.hideLabel(infoBarApi.InfoBarLabelEnum.CENTRAL);
        };
        ballooniesIxfGameController.BaseInfoBarControl.prototype.hideRightLabel = function() {
            this.hideLabel(infoBarApi.InfoBarLabelEnum.RIGHT);
        };
        ballooniesIxfGameController.BaseInfoBarControl.prototype.hideLeftLabel = function() {
            this.hideLabel(infoBarApi.InfoBarLabelEnum.LEFT);
        };
        ballooniesIxfGameController.BaseInfoBarControl.prototype.hideCentralLabel = function() {
            this.hideLabel(infoBarApi.InfoBarLabelEnum.CENTRAL);
        };
        ballooniesIxfGameController.BaseInfoBarControl.prototype.hideLabel = function(infoBarLabel) {
            this.infoBarPort.hideLabel().publish(infoBarLabel);
        };
        ballooniesIxfGameController.BaseInfoBarControl.prototype.hideWinLineSummary = function() {
            this.infoBarPort.hideWinLineSummary().publish(null);
        };
        ballooniesIxfGameController.BaseInfoBarControl.prototype.showRightLabel = function(value) {
            this.showLabel(infoBarApi.InfoBarLabelEnum.RIGHT, value);
        };
        ballooniesIxfGameController.BaseInfoBarControl.prototype.showLeftLabel = function(value) {
            this.showLabel(infoBarApi.InfoBarLabelEnum.LEFT, value);
        };
        ballooniesIxfGameController.BaseInfoBarControl.prototype.showCentralLabel = function(value) {
            this.showLabel(infoBarApi.InfoBarLabelEnum.CENTRAL, value);
        };
        ballooniesIxfGameController.BaseInfoBarControl.prototype.showLabel = function(infoBarLabel, value) {
            this.infoBarPort.showLabel().publish(new infoBarApi.LabelContentPayload(infoBarLabel, value));
        };
        ballooniesIxfGameController.BaseInfoBarControl.prototype.showWinLineSummary = function(linePicture, winId, winSum) {
            this.infoBarPort.showWinLineSummary().publish(new infoBarApi.WinLineSummaryPayload(linePicture, winId, winSum));
        };
        ballooniesIxfGameController.BaseInfoBarControl.prototype.__class__ = ballooniesIxfGameController.BaseInfoBarControl;
        ballooniesIxfGameController.BaseGameInfoBarControl = function(infoBarPort) {
            ballooniesIxfGameController.BaseInfoBarControl.call(this, infoBarPort);
        };
        ballooniesIxfGameController.BaseGameInfoBarControl.__name__ = ["ballooniesIxfGameController", "BaseGameInfoBarControl"];
        ballooniesIxfGameController.BaseGameInfoBarControl.__super__ = ballooniesIxfGameController.BaseInfoBarControl;
        for (var k in ballooniesIxfGameController.BaseInfoBarControl.prototype) ballooniesIxfGameController.BaseGameInfoBarControl.prototype[k] = ballooniesIxfGameController.BaseInfoBarControl.prototype[k];
        ballooniesIxfGameController.BaseGameInfoBarControl.prototype.__class__ = ballooniesIxfGameController.BaseGameInfoBarControl;
        ballooniesIxfGameController.InfoBarControl = function(infoBarPort) {
            this._isPromoSpinMode = false;
            this.promoBar = new ballooniesIxfGameController.PromoSpinsInfoBarControl(infoBarPort);
            this.baseGameBar = new ballooniesIxfGameController.BaseGameInfoBarControl(infoBarPort);
            this.set_isPromoSpinMode(false);
        };
        ballooniesIxfGameController.InfoBarControl.__name__ = ["ballooniesIxfGameController", "InfoBarControl"];
        ballooniesIxfGameController.InfoBarControl.prototype.promoBar = null;
        ballooniesIxfGameController.InfoBarControl.prototype.baseGameBar = null;
        ballooniesIxfGameController.InfoBarControl.prototype.currentInfoBar = null;
        ballooniesIxfGameController.InfoBarControl.prototype._isPromoSpinMode = null;
        ballooniesIxfGameController.InfoBarControl.prototype.isPromoSpinMode = null;
        ballooniesIxfGameController.InfoBarControl.prototype.set_isPromoSpinMode = function(value) {
            this._isPromoSpinMode = value;
            if (value) this.currentInfoBar = this.promoBar;
            else this.currentInfoBar = this.baseGameBar;
            return value;
        };
        ballooniesIxfGameController.InfoBarControl.prototype.hideAll = function() {
            this.currentInfoBar.hideAll();
        };
        ballooniesIxfGameController.InfoBarControl.prototype.hideAllLabels = function() {
            this.currentInfoBar.hideAllLabels();
        };
        ballooniesIxfGameController.InfoBarControl.prototype.hideRightLabel = function() {
            this.currentInfoBar.hideRightLabel();
        };
        ballooniesIxfGameController.InfoBarControl.prototype.hideLeftLabel = function() {
            this.currentInfoBar.hideLeftLabel();
        };
        ballooniesIxfGameController.InfoBarControl.prototype.hideCentralLabel = function() {
            this.currentInfoBar.hideCentralLabel();
        };
        ballooniesIxfGameController.InfoBarControl.prototype.hideLabel = function(infoBarLabel) {
            this.currentInfoBar.hideLabel(infoBarLabel);
        };
        ballooniesIxfGameController.InfoBarControl.prototype.hideWinLineSummary = function() {
            this.currentInfoBar.hideWinLineSummary();
        };
        ballooniesIxfGameController.InfoBarControl.prototype.showRightLabel = function(value) {
            this.currentInfoBar.showRightLabel(value);
        };
        ballooniesIxfGameController.InfoBarControl.prototype.showLeftLabel = function(value) {
            this.currentInfoBar.showLeftLabel(value);
        };
        ballooniesIxfGameController.InfoBarControl.prototype.showCentralLabel = function(value) {
            this.currentInfoBar.showCentralLabel(value);
        };
        ballooniesIxfGameController.InfoBarControl.prototype.showLabel = function(infoBarLabel, value) {
            this.currentInfoBar.showLabel(infoBarLabel, value);
        };
        ballooniesIxfGameController.InfoBarControl.prototype.showWinLineSummary = function(linePicture, winId, winSum) {
            this.currentInfoBar.showWinLineSummary(linePicture, winId, winSum);
        };
        ballooniesIxfGameController.InfoBarControl.prototype.__class__ = ballooniesIxfGameController.InfoBarControl;
        ballooniesIxfGameController.PromoSpinsInfoBarControl = function(infoBarPort) {
            ballooniesIxfGameController.BaseInfoBarControl.call(this, infoBarPort);
        };
        ballooniesIxfGameController.PromoSpinsInfoBarControl.__name__ = ["ballooniesIxfGameController", "PromoSpinsInfoBarControl"];
        ballooniesIxfGameController.PromoSpinsInfoBarControl.__super__ = ballooniesIxfGameController.BaseInfoBarControl;
        for (var k in ballooniesIxfGameController.BaseInfoBarControl.prototype) ballooniesIxfGameController.PromoSpinsInfoBarControl.prototype[k] = ballooniesIxfGameController.BaseInfoBarControl.prototype[k];
        ballooniesIxfGameController.PromoSpinsInfoBarControl.prototype.hideAll = function() {
            this.hideAllLabels();
            this.hideWinLineSummary();
        };
        ballooniesIxfGameController.PromoSpinsInfoBarControl.prototype.hideAllLabels = function() {
            this.hideLabel(infoBarApi.InfoBarLabelEnum.RIGHT);
            this.hideLabel(infoBarApi.InfoBarLabelEnum.LEFT);
        };
        ballooniesIxfGameController.PromoSpinsInfoBarControl.prototype.hideCentralLabel = function() {
            this.hideLabel(infoBarApi.InfoBarLabelEnum.CENTRAL);
        };
        ballooniesIxfGameController.PromoSpinsInfoBarControl.prototype.showCentralLabel = function(value) {
            this.showLabel(infoBarApi.InfoBarLabelEnum.CENTRAL, value);
        };
        ballooniesIxfGameController.PromoSpinsInfoBarControl.prototype.__class__ = ballooniesIxfGameController.PromoSpinsInfoBarControl;
        ballooniesIxfGameController.SoundAction = function(obj) {
            this.id = obj.id;
            this.action = obj.action;
            this.isLocked = obj.status == "locked";
            if (obj.volume == null) this.volume = 1;
            else this.volume = _hcmn_.Std.parseFloat(obj.volume);
            this.value = obj.value;
            this.lastPlayedTime = 0;
        };
        ballooniesIxfGameController.SoundAction.__name__ = ["ballooniesIxfGameController", "SoundAction"];
        ballooniesIxfGameController.SoundAction.prototype.id = null;
        ballooniesIxfGameController.SoundAction.prototype.action = null;
        ballooniesIxfGameController.SoundAction.prototype.value = null;
        ballooniesIxfGameController.SoundAction.prototype.lastPlayedTime = null;
        ballooniesIxfGameController.SoundAction.prototype.volume = null;
        ballooniesIxfGameController.SoundAction.prototype.isLocked = null;
        ballooniesIxfGameController.SoundAction.prototype.__class__ = ballooniesIxfGameController.SoundAction;
        ballooniesIxfGameController.SoundConfig = function() {};
        ballooniesIxfGameController.SoundConfig.__name__ = ["ballooniesIxfGameController", "SoundConfig"];
        ballooniesIxfGameController.SoundConfig.prototype.events = null;
        ballooniesIxfGameController.SoundConfig.prototype.actions = null;
        ballooniesIxfGameController.SoundConfig.prototype.mapOfSoundList = null;
        ballooniesIxfGameController.SoundConfig.prototype.reflectionMap = null;
        ballooniesIxfGameController.SoundConfig.prototype.config = null;
        ballooniesIxfGameController.SoundConfig.prototype.initialize = function(config) {
            if (config == null) throw new Error("SoundConfig: config is null");
            this.config = config;
            this.events = new _hcmn_.haxe_ds_StringMap();
            this.actions = new _hcmn_.haxe_ds_StringMap();
            this.mapOfSoundList = new _hcmn_.haxe_ds_StringMap();
            this.reflectionMap = new _hcmn_.haxe_ds_StringMap();
            var _g = 0;
            var _g1 = _hcmn_.Reflect.fields(config.soundList);
            while (_g < _g1.length) {
                var listName = _g1[_g];
                ++_g;
                var value = _hcmn_.Reflect.field(config.soundList, listName);
                this.mapOfSoundList.set(listName, value);
            }
            if (Object.prototype.hasOwnProperty.call(config, "reflectionMap")) {
                var reflectionMap = _hcmn_.Reflect.field(config, "reflectionMap");
                var _g2 = 0;
                var _g11 = _hcmn_.Reflect.fields(reflectionMap);
                while (_g2 < _g11.length) {
                    var soundMapField = _g11[_g2];
                    ++_g2;
                    var value1 = _hcmn_.Reflect.field(reflectionMap, soundMapField);
                    this.reflectionMap.set(soundMapField, value1);
                }
            }
            var _g3 = 0;
            var _g12 = _hcmn_.Reflect.fields(config.events);
            while (_g3 < _g12.length) {
                var eventName = _g12[_g3];
                ++_g3;
                var arr = _hcmn_.Reflect.field(config.events, eventName);
                var actions = [];
                var _g31 = 0;
                var _g21 = arr.length;
                while (_g31 < _g21) {
                    var i = _g31++;
                    var soundAction = new ballooniesIxfGameController.SoundAction(arr[i]);
                    actions.push(soundAction);
                    this.addSoundAction(soundAction);
                }
                this.events.set(eventName, actions);
            }
            var _g4 = 0;
            var _g13 = _hcmn_.Reflect.fields(config.additionalSoundActions);
            while (_g4 < _g13.length) {
                var eventName1 = _g13[_g4];
                ++_g4;
                var arr1 = _hcmn_.Reflect.field(config.additionalSoundActions, eventName1);
                var actions1 = [];
                var _g32 = 0;
                var _g22 = arr1.length;
                while (_g32 < _g22) {
                    var i1 = _g32++;
                    var soundAction1 = new ballooniesIxfGameController.SoundAction(arr1[i1]);
                    actions1.push(soundAction1);
                    this.addSoundAction(soundAction1);
                    this.addSoundActionWithCustomId(eventName1, soundAction1);
                }
                this.events.set(eventName1, actions1);
            }
        };
        ballooniesIxfGameController.SoundConfig.prototype.getReflectionSound = function(id, data) {
            var sound = _hcmn_.Reflect.field(data, id);
            var reflectionMap = this.getReflectionSoundFromConfig(id, sound);
            if (reflectionMap != null) return reflectionMap;
            return sound;
        };
        ballooniesIxfGameController.SoundConfig.prototype.getReflectionSoundFromConfig = function(soundMapId, soundId) {
            if (this.reflectionMap.exists(soundMapId)) {
                var soundsMap = this.reflectionMap.get(soundMapId);
                if (Object.prototype.hasOwnProperty.call(soundsMap, soundId)) return _hcmn_.Reflect.field(soundsMap, soundId);
            }
            return null;
        };
        ballooniesIxfGameController.SoundConfig.prototype.getSoundMap = function(id) {
            var soundMap = new _hcmn_.haxe_ds_StringMap();
            var dynamicSoundMap = _hcmn_.Reflect.field(this.config, id);
            var _g = 0;
            var _g1 = _hcmn_.Reflect.fields(dynamicSoundMap);
            while (_g < _g1.length) {
                var field = _g1[_g];
                ++_g;
                var fieldValue = _hcmn_.Reflect.field(dynamicSoundMap, field);
                if (_hcmn_.__map_reserved[field] != null) soundMap.setReserved(field, fieldValue);
                else soundMap.h[field] = fieldValue;
            }
            return soundMap;
        };
        ballooniesIxfGameController.SoundConfig.prototype.getRadomSoundFromList = function(id) {
            var soundList = this.mapOfSoundList.get(id);
            var sound = soundList[_hcmn_.Std.random(soundList.length)];
            return sound;
        };
        ballooniesIxfGameController.SoundConfig.prototype.addSoundAction = function(soundAction) {
            this.addSoundActionWithCustomId(soundAction.id, soundAction);
        };
        ballooniesIxfGameController.SoundConfig.prototype.addSoundActionWithCustomId = function(id, soundAction) {
            if (!this.actions.exists(id)) this.actions.set(id, []);
            this.actions.get(id).push(soundAction);
        };
        ballooniesIxfGameController.SoundConfig.prototype.__class__ = ballooniesIxfGameController.SoundConfig;
        ballooniesIxfGameController.SoundController = function(context, model) {
            this.inBonusGame = false;
            this.soundON = true;
            var _g = this;
            this.soundPort = context.getUsedPort(soundManagerApi.ISoundManagerPort);
            this.model = model;
            this.soundPortHelper = new ballooniesIxfGameController.SoundPortHelper(this.soundPort, 33.3333333333333357);
            ballooniesIxfGameController.ExternalService.gfBusChanel.subscribe("*", $bind(this, this.onAllEvents));
            ballooniesIxfGameController.ExternalService.assetRegistry.getAsset("soundplayer-assets/soundevents").getContent().then(function(data) {
                _g.cfg = new ballooniesIxfGameController.SoundConfig();
                _g.cfg.initialize(data);
            });
            this.logger = ballooniesIxfGameController.ExternalService.logger;
        };
        ballooniesIxfGameController.SoundController.__name__ = ["ballooniesIxfGameController", "SoundController"];
        ballooniesIxfGameController.SoundController.prototype.cfg = null;
        ballooniesIxfGameController.SoundController.prototype.soundON = null;
        ballooniesIxfGameController.SoundController.prototype.soundPort = null;
        ballooniesIxfGameController.SoundController.prototype.soundPortHelper = null;
        ballooniesIxfGameController.SoundController.prototype.inBonusGame = null;
        ballooniesIxfGameController.SoundController.prototype.logger = null;
        ballooniesIxfGameController.SoundController.prototype.model = null;
        ballooniesIxfGameController.SoundController.prototype.onAllEvents = function(e) {
            var topic = e.getTopic();
            var payload = e.getPayload();
            this.onEvent(topic, payload);
        };
        ballooniesIxfGameController.SoundController.prototype.onEvent = function(topic, payload) {
            if (new _hcmn_.EReg("^slotmodel:gameOptionChangedFrom", "").match(topic) && payload.key == "sound") {
                if (payload.value == "1") this.soundPortHelper.turnOffSounds();
                else this.soundPortHelper.turnOnSounds();
            }
            if (this.cfg == null) {
                this.logger.warn("SoundEvent not loaded yeat");
                return;
            }
            if (this.cfg.events.exists(topic)) {
                var arr = this.cfg.events.get(topic);
                var _g1 = 0;
                var _g = arr.length;
                while (_g1 < _g) {
                    var i = _g1++;
                    if (this.model.isLowWin()) {
                        if (arr[i].id != "winningSymbol") this.executeAction(arr[i], payload);
                    } else this.executeAction(arr[i], payload);
                }
            }
        };
        ballooniesIxfGameController.SoundController.prototype.executeAction = function(action, payload) {
            if (action.isLocked) return;
            var _g = action.action;
            switch (_g) {
                case "executeAction":
                    var actionId = action.value;
                    var soundActions = this.cfg.actions.get(actionId);
                    var _g1 = 0;
                    while (_g1 < soundActions.length) {
                        var soundAction = soundActions[_g1];
                        ++_g1;
                        this.executeAction(soundAction, payload);
                    }
                    break;
                case "playPayload":
                    var sound = this.cfg.getReflectionSound(action.id, payload);
                    this.soundPortHelper.playSound(sound, action.volume);
                    break;
                case "invokePayloadActionMap":
                    var soundMap = this.cfg.getSoundMap(action.id);
                    if ((function($this) {
                            var $r;
                            var key = payload;
                            $r = _hcmn_.__map_reserved[key] != null ? soundMap.existsReserved(key) : soundMap.h.hasOwnProperty(key);
                            return $r;
                        }(this))) {
                        var actionId1;
                        var key1 = payload;
                        actionId1 = _hcmn_.__map_reserved[key1] != null ? soundMap.getReserved(key1) : soundMap.h[key1];
                        var soundActions1 = this.cfg.actions.get(actionId1);
                        var _g11 = 0;
                        while (_g11 < soundActions1.length) {
                            var soundAction1 = soundActions1[_g11];
                            ++_g11;
                            if (soundAction1.id == action.id) throw new js._Boot.HaxeError("soundAction: " + action.id + " wanted to play similar action; Possible stack overflow;");
                            this.executeAction(soundAction1, payload);
                        }
                    }
                    break;
                case "unlockAction":
                    this.unlockActions(action.value);
                    break;
                case "lockAction":
                    this.lockActions(action.value);
                    break;
                case "playRandom":
                    var sound1 = this.cfg.getRadomSoundFromList(action.id);
                    this.soundPortHelper.playSound(sound1, action.volume);
                    break;
                case "fadeOut":
                    this.soundPortHelper.fadeOut(action.id, _hcmn_.Std.parseInt(action.value), false);
                    break;
                case "fadeIn":
                    this.soundPortHelper.fadeIn(action.id, _hcmn_.Std.parseInt(action.value));
                    break;
                case "mute":
                    this.soundPortHelper.stopSound(action.id);
                    break;
                case "play":
                    var currentTime = new _hcmn_.Date().getTime();
                    if (currentTime - action.lastPlayedTime > 50) {
                        this.soundPortHelper.playSound(action.id, action.volume);
                        action.lastPlayedTime = currentTime;
                    }
                    break;
                case "playOnce":
                    this.soundPortHelper.playSoundOnce(action.id, action.volume);
                    break;
            }
        };
        ballooniesIxfGameController.SoundController.prototype.unlockActions = function(id) {
            this.setLockStatusToActions(id, false);
        };
        ballooniesIxfGameController.SoundController.prototype.lockActions = function(id) {
            this.setLockStatusToActions(id, true);
        };
        ballooniesIxfGameController.SoundController.prototype.setLockStatusToActions = function(id, value) {
            var actions = this.cfg.actions.get(id);
            if (actions == null) {
                this.logger.warn("action " + id + " is not declared in config file");
                return;
            }
            var _g = 0;
            while (_g < actions.length) {
                var action = actions[_g];
                ++_g;
                action.isLocked = value;
            }
        };
        ballooniesIxfGameController.SoundController.prototype.__class__ = ballooniesIxfGameController.SoundController;
        ballooniesIxfGameController.SoundPortHelper = function(soundPort, frameRate) {
            this.soundsMap = new _hcmn_.haxe_ds_StringMap();
            this.fadeSoundsMap = new _hcmn_.haxe_ds_StringMap();
            this.soundsMuted = false;
            this.soundPort = soundPort;
            this.frameRate = frameRate;
            window.setInterval($bind(this, this.intervalHandler), null, frameRate);
            this.time = new _hcmn_.Date().getTime();
        };
        ballooniesIxfGameController.SoundPortHelper.__name__ = ["ballooniesIxfGameController", "SoundPortHelper"];
        ballooniesIxfGameController.SoundPortHelper.prototype.soundsMuted = null;
        ballooniesIxfGameController.SoundPortHelper.prototype.soundPort = null;
        ballooniesIxfGameController.SoundPortHelper.prototype.fadeSoundsMap = null;
        ballooniesIxfGameController.SoundPortHelper.prototype.soundsMap = null;
        ballooniesIxfGameController.SoundPortHelper.prototype.time = null;
        ballooniesIxfGameController.SoundPortHelper.prototype.frameRate = null;
        ballooniesIxfGameController.SoundPortHelper.prototype.fadeIn = function(soundId, fadeTimeout) {
            if (!this.fadeSoundsMap.exists(soundId)) {
                this.playSound(soundId, this.getSound(soundId).volume);
                var value = new components.gamecontroller.impl.sound.FadeValue(soundId, fadeTimeout, 0);
                this.fadeSoundsMap.set(soundId, value);
            }
            var fadedSoundValue = this.fadeSoundsMap.get(soundId);
            fadedSoundValue.stopAfterComplete = false;
            fadedSoundValue.timeout = fadeTimeout;
            if (fadedSoundValue.volume < 0) fadedSoundValue.volume = 0;
            fadedSoundValue.volumeOFsset = (1 - fadedSoundValue.volume) / (fadeTimeout / this.frameRate);
        };
        ballooniesIxfGameController.SoundPortHelper.prototype.fadeOut = function(soundId, fadeTimeout, stopAfterComplete) {
            if (stopAfterComplete == null) stopAfterComplete = true;
            if (!this.fadeSoundsMap.exists(soundId)) {
                this.playSoundOnce(soundId, this.getSound(soundId).volume);
                var value = new components.gamecontroller.impl.sound.FadeValue(soundId, fadeTimeout);
                this.fadeSoundsMap.set(soundId, value);
            }
            var fadedSoundValue = this.fadeSoundsMap.get(soundId);
            if (fadedSoundValue.volume > 1) fadedSoundValue.volume = 1;
            fadedSoundValue.stopAfterComplete = stopAfterComplete;
            fadedSoundValue.timeout = fadeTimeout;
            fadedSoundValue.volumeOFsset = -(fadedSoundValue.volume / (fadeTimeout / this.frameRate));
        };
        ballooniesIxfGameController.SoundPortHelper.prototype.stopSound = function(sound) {
            if (this.isSoundValid(sound)) {
                this.getSound(sound).isPlayed = false;
                this.soundPort.stop().publish(sound);
                this.fadeSoundsMap.remove(sound);
            }
        };
        ballooniesIxfGameController.SoundPortHelper.prototype.playSoundOnce = function(sound, volume) {
            if (volume == null) volume = 1;
            if (this.isSoundValid(sound) && !this.getSound(sound).isPlayed) this.playSound(sound, volume);
            else {
                this.setVolume(sound, volume);
                this.fadeSoundsMap.remove(sound);
            }
        };
        ballooniesIxfGameController.SoundPortHelper.prototype.playSound = function(sound, volume) {
            if (volume == null) volume = 1;
            if (this.isSoundValid(sound)) {
                this.fadeSoundsMap.remove(sound);
                this.soundPort.play().publish(sound);
                this.getSound(sound).isPlayed = true;
                if (volume != 1) this.setVolume(sound, volume);
                if (this.soundsMuted) this.soundPort.mute().publish(sound);
            }
        };
        ballooniesIxfGameController.SoundPortHelper.prototype.setVolume = function(sound, volume) {
            if (volume == null) volume = 1;
            this.soundPort.volume().publish(new soundManagerApi.SoundVolumeData(sound, volume));
            this.getSound(sound).volume = volume;
        };
        ballooniesIxfGameController.SoundPortHelper.prototype.isSoundsMuted = function() {
            return this.soundsMuted;
        };
        ballooniesIxfGameController.SoundPortHelper.prototype.isSoundValid = function(sound) {
            return sound != null && sound.length > 0;
        };
        ballooniesIxfGameController.SoundPortHelper.prototype.turnOnSounds = function() {
            this.soundPort.unmuteAll().publish(null);
            this.soundsMuted = false;
        };
        ballooniesIxfGameController.SoundPortHelper.prototype.turnOffSounds = function() {
            this.soundPort.muteAll().publish(null);
            this.soundsMuted = true;
        };
        ballooniesIxfGameController.SoundPortHelper.prototype.intervalHandler = function() {
            var currentTime = new _hcmn_.Date().getTime();
            var dt = currentTime - this.time;
            this.time = currentTime;
            var $it0 = this.fadeSoundsMap.iterator();
            while ($it0.hasNext()) {
                var soundValue = $it0.next();
                if (soundValue.timeout <= 0) {
                    if (soundValue.stopAfterComplete) {
                        this.soundPort.stop().publish(soundValue.sound);
                        this.fadeSoundsMap.remove(soundValue.sound);
                        this.getSound(soundValue.sound).isPlayed = soundValue.volume == 1;
                    }
                    continue;
                }
                soundValue.timeout -= dt;
                soundValue.volume += soundValue.volumeOFsset * (dt / this.frameRate);
                if (soundValue.volume < .005) soundValue.volume = 0;
                else if (soundValue.volume > 1) soundValue.volume = 1;
                this.setVolume(soundValue.sound, soundValue.volume);
            }
        };
        ballooniesIxfGameController.SoundPortHelper.prototype.getSound = function(sound) {
            if (!this.soundsMap.exists(sound)) {
                var value = new components.gamecontroller.impl.sound.Sound(sound);
                this.soundsMap.set(sound, value);
            }
            return this.soundsMap.get(sound);
        };
        ballooniesIxfGameController.SoundPortHelper.prototype.__class__ = ballooniesIxfGameController.SoundPortHelper;
        if (!components.gamecontroller.impl.sound) {
            components.gamecontroller.impl.sound = {};
        };
        components.gamecontroller.impl.sound.FadeValue = function(sound, timeout, volume) {
            if (volume == null) volume = 1;
            this.volumeOFsset = 0;
            this.volume = 1;
            this.sound = sound;
            this.timeout = timeout;
            this.volume = volume;
        };
        components.gamecontroller.impl.sound.FadeValue.__name__ = ["components", "gamecontroller", "impl", "sound", "FadeValue"];
        components.gamecontroller.impl.sound.FadeValue.prototype.sound = null;
        components.gamecontroller.impl.sound.FadeValue.prototype.timeout = null;
        components.gamecontroller.impl.sound.FadeValue.prototype.volume = null;
        components.gamecontroller.impl.sound.FadeValue.prototype.stopAfterComplete = null;
        components.gamecontroller.impl.sound.FadeValue.prototype.volumeOFsset = null;
        components.gamecontroller.impl.sound.FadeValue.prototype.__class__ = components.gamecontroller.impl.sound.FadeValue;
        components.gamecontroller.impl.sound.Sound = function(sound) {
            this.isLocked = false;
            this.isPlayed = false;
            this.volume = 1;
        };
        components.gamecontroller.impl.sound.Sound.__name__ = ["components", "gamecontroller", "impl", "sound", "Sound"];
        components.gamecontroller.impl.sound.Sound.prototype.sound = null;
        components.gamecontroller.impl.sound.Sound.prototype.volume = null;
        components.gamecontroller.impl.sound.Sound.prototype.isPlayed = null;
        components.gamecontroller.impl.sound.Sound.prototype.isLocked = null;
        components.gamecontroller.impl.sound.Sound.prototype.__class__ = components.gamecontroller.impl.sound.Sound;
        ballooniesIxfGameController.DevTool = function() {};
        ballooniesIxfGameController.DevTool.__name__ = ["ballooniesIxfGameController", "DevTool"];
        ballooniesIxfGameController.DevTool.getWinLineForBottomLine = function(size) {
            if (size == null) size = 4;
            var win = ballooniesIxfGameController.DevTool.getWinLine(1);
            ballooniesIxfGameController.DevTool.configureHorizontalWinPath(win.winPath.reelsInfo, 3, size);
            return win;
        };
        ballooniesIxfGameController.DevTool.configureOutcomeToShowWinLinesOutcome = function(outcome) {
            ballooniesIxfGameController.DevTool.clearAllWins(outcome);
            var scatterWin = ballooniesIxfGameController.DevTool.getScatterWin(1);
            ballooniesIxfGameController.DevTool.configureHorizontalWinPath(scatterWin.winPath.reelsInfo, 3, 4);
            var horizontalWin1 = ballooniesIxfGameController.DevTool.getWinLine(1);
            ballooniesIxfGameController.DevTool.configureHorizontalWinPath(horizontalWin1.winPath.reelsInfo, 1, 5);
            var horizontalWin2 = ballooniesIxfGameController.DevTool.getWinLine(2);
            ballooniesIxfGameController.DevTool.configureHorizontalWinPath(horizontalWin2.winPath.reelsInfo, 2, 5);
            var horizontalWin3 = ballooniesIxfGameController.DevTool.getWinLine(3);
            ballooniesIxfGameController.DevTool.configureHorizontalWinPath(horizontalWin3.winPath.reelsInfo, 3, 5);
            var win1 = ballooniesIxfGameController.DevTool.getWinLine(4);
            win1.winPath.reelsInfo[0][0] = 1;
            win1.winPath.reelsInfo[1][0] = 1;
            win1.winPath.reelsInfo[2][1] = 1;
            win1.winPath.reelsInfo[3][2] = 1;
            win1.winPath.reelsInfo[4][2] = 1;
            var win2 = ballooniesIxfGameController.DevTool.getWinLine(5);
            win2.winPath.reelsInfo[0][2] = 1;
            win2.winPath.reelsInfo[1][2] = 1;
            win2.winPath.reelsInfo[2][1] = 1;
            win2.winPath.reelsInfo[3][0] = 1;
            win2.winPath.reelsInfo[4][0] = 1;
            var win3 = ballooniesIxfGameController.DevTool.getWinLine(6);
            win3.winPath.reelsInfo[0][0] = 1;
            win3.winPath.reelsInfo[1][1] = 1;
            win3.winPath.reelsInfo[2][2] = 1;
            win3.winPath.reelsInfo[3][1] = 1;
            win3.winPath.reelsInfo[4][0] = 1;
            var win4 = ballooniesIxfGameController.DevTool.getWinLine(7);
            win4.winPath.reelsInfo[0][2] = 1;
            win4.winPath.reelsInfo[1][1] = 1;
            win4.winPath.reelsInfo[2][0] = 1;
            win4.winPath.reelsInfo[3][1] = 1;
            win4.winPath.reelsInfo[4][2] = 1;
            eval("outcome.lineWins = []");
            eval("outcome.scatterWins = []");
            eval("outcome.bonusWins = []");
            outcome.lineWins.push(horizontalWin1);
            outcome.lineWins.push(horizontalWin2);
            outcome.lineWins.push(horizontalWin3);
            outcome.lineWins.push(win1);
            outcome.lineWins.push(win2);
            outcome.lineWins.push(win3);
            outcome.lineWins.push(win4);
            outcome.scatterWins.push(scatterWin);
        };
        ballooniesIxfGameController.DevTool.clearAllWins = function(outcome) {
            eval("outcome.lineWins = []");
            eval("outcome.scatterWins = []");
            eval("outcome.bonusWins = []");
        };
        ballooniesIxfGameController.DevTool.configureOutcomeToAllSymbols = function(outcome, symbolsList) {
            var _g = 0;
            while (_g < 5) {
                var i = _g++;
                var _g1 = 0;
                while (_g1 < 3) {
                    var j = _g1++;
                    var symbol = symbolsList.shift();
                    outcome.reelStop.reels[i][j] = symbol;
                    symbolsList.push(symbol);
                }
            }
        };
        ballooniesIxfGameController.DevTool.configureHorizontalWinPath = function(reelsInfo, line, size) {
            if (size == null) size = 4;
            line -= 1;
            var _g = 0;
            while (_g < size) {
                var i = _g++;
                reelsInfo[i][line] = 1;
            }
        };
        ballooniesIxfGameController.DevTool.getWinLine = function(id) {
            var winPath = ballooniesIxfGameController.GameModel.getEmptyMatrix();
            var reelPictureInfo = new slotModelApi.ReelPictureInfo(winPath);
            var win = new slotModelApi.LineWin("supperLineWin" + id, id, "100", 1, "1", reelPictureInfo, "s01", 5);
            return win;
        };
        ballooniesIxfGameController.DevTool.getScatterWin = function(id) {
            var winPath = ballooniesIxfGameController.GameModel.getEmptyMatrix();
            var reelPictureInfo = new slotModelApi.ReelPictureInfo(winPath);
            var win = new slotModelApi.ScatterWin("supperScatterWin" + id, "100", 1, "1", reelPictureInfo, null, 5);
            return win;
        };
        ballooniesIxfGameController.DevTool.getCallStack = function() {
            var callStack = haxe.CallStack.callStack();
            var result = "\nCallStack: ";
            var stack = _hcmn_.Std.string(callStack.shift());
            while (stack.indexOf(_hcmn_.Type.getClassName(ballooniesIxfGameController.GameController)) == -1) {
                stack = _hcmn_.Std.string(callStack.shift());
                if (callStack.length == 0) break;
            }
            var _g = 0;
            while (_g < callStack.length) {
                var stack1 = callStack[_g];
                ++_g;
                var stackString = _hcmn_.StringTools.replace(_hcmn_.Std.string(stack1), ".js,", ".js:");
                result += "\n\t•" + stackString;
            }
            return result;
        };
        ballooniesIxfGameController.DevTool.prototype.__class__ = ballooniesIxfGameController.DevTool;
        if (typeof haxe == 'undefined') {
            var haxe = {};
        };
        haxe.StackItem = {
            __ename__: ["haxe", "StackItem"],
            __constructs__: ["CFunction", "Module", "FilePos", "Method", "LocalFunction"]
        };
        haxe.StackItem.Module = function(m) {
            var $x = ["Module", 1, m];
            $x.__enum__ = haxe.StackItem;
            $x.toString = $estr;
            return $x;
        };
        haxe.StackItem.Method = function(classname, method) {
            var $x = ["Method", 3, classname, method];
            $x.__enum__ = haxe.StackItem;
            $x.toString = $estr;
            return $x;
        };
        haxe.StackItem.LocalFunction = function(v) {
            var $x = ["LocalFunction", 4, v];
            $x.__enum__ = haxe.StackItem;
            $x.toString = $estr;
            return $x;
        };
        haxe.StackItem.FilePos = function(s, file, line) {
            var $x = ["FilePos", 2, s, file, line];
            $x.__enum__ = haxe.StackItem;
            $x.toString = $estr;
            return $x;
        };
        haxe.StackItem.CFunction = ["CFunction", 0];
        haxe.StackItem.CFunction.toString = $estr;
        haxe.StackItem.CFunction.__enum__ = haxe.StackItem;
        haxe.CallStack = function() {};
        haxe.CallStack.__name__ = ["haxe", "CallStack"];
        haxe.CallStack.getStack = function(e) {
            if (e == null) return [];
            var oldValue = Error.prepareStackTrace;
            Error.prepareStackTrace = function(error, callsites) {
                var stack = [];
                var _g = 0;
                while (_g < callsites.length) {
                    var site = callsites[_g];
                    ++_g;
                    if (haxe.CallStack.wrapCallSite != null) site = haxe.CallStack.wrapCallSite(site);
                    var method = null;
                    var fullName = site.getFunctionName();
                    if (fullName != null) {
                        var idx = fullName.lastIndexOf(".");
                        if (idx >= 0) {
                            var className = _hcmn_.HxOverrides.substr(fullName, 0, idx);
                            var methodName = _hcmn_.HxOverrides.substr(fullName, idx + 1, null);
                            method = haxe.StackItem.Method(className, methodName);
                        }
                    }
                    stack.push(haxe.StackItem.FilePos(method, site.getFileName(), site.getLineNumber()));
                }
                return stack;
            };
            var a = haxe.CallStack.makeStack(e.stack);
            Error.prepareStackTrace = oldValue;
            return a;
        };
        haxe.CallStack.wrapCallSite = null;
        haxe.CallStack.callStack = function() {
            try {
                throw new Error();
            } catch (e) {
                if (e instanceof js._Boot.HaxeError) e = e.val;
                var a = haxe.CallStack.getStack(e);
                a.shift();
                return a;
            }
        };
        haxe.CallStack.makeStack = function(s) {
            if (s == null) return [];
            else if (typeof(s) == "string") {
                var stack = s.split("\n");
                if (stack[0] == "Error") stack.shift();
                var m = [];
                var rie10 = new _hcmn_.EReg("^   at ([A-Za-z0-9_. ]+) \\(([^)]+):([0-9]+):([0-9]+)\\)$", "");
                var _g = 0;
                while (_g < stack.length) {
                    var line = stack[_g];
                    ++_g;
                    if (rie10.match(line)) {
                        var path = rie10.matched(1).split(".");
                        var meth = path.pop();
                        var file = rie10.matched(2);
                        var line1 = _hcmn_.Std.parseInt(rie10.matched(3));
                        m.push(haxe.StackItem.FilePos(meth == "Anonymous function" ? haxe.StackItem.LocalFunction() : meth == "Global code" ? null : haxe.StackItem.Method(path.join("."), meth), file, line1));
                    } else m.push(haxe.StackItem.Module(_hcmn_.StringTools.trim(line)));
                }
                return m;
            } else return s;
        };
        haxe.CallStack.prototype.__class__ = haxe.CallStack;

        haxe.IMap = function() {}
        haxe.IMap.prototype = {

            set: function(k, v) {
                return {
                    arguments: ["*", "*"],
                    returns: "void"
                };
            }
        };
        if (!haxe.ds) {
            haxe.ds = {};
        };
        if (!haxe.ds._StringMap) {
            haxe.ds._StringMap = {};
        };
        haxe.ds._StringMap.StringMapIterator = function(map, keys) {
            this.map = map;
            this.keys = keys;
            this.index = 0;
            this.count = keys.length;
        };
        haxe.ds._StringMap.StringMapIterator.__name__ = ["haxe", "ds", "_StringMap", "StringMapIterator"];
        haxe.ds._StringMap.StringMapIterator.prototype.map = null;
        haxe.ds._StringMap.StringMapIterator.prototype.keys = null;
        haxe.ds._StringMap.StringMapIterator.prototype.index = null;
        haxe.ds._StringMap.StringMapIterator.prototype.count = null;
        haxe.ds._StringMap.StringMapIterator.prototype.hasNext = function() {
            return this.index < this.count;
        };
        haxe.ds._StringMap.StringMapIterator.prototype.next = function() {
            return this.map.get(this.keys[this.index++]);
        };
        haxe.ds._StringMap.StringMapIterator.prototype.__class__ = haxe.ds._StringMap.StringMapIterator;
        if (typeof js == 'undefined') {
            var js = {};
        };
        if (!js._Boot) {
            js._Boot = {};
        };
        js._Boot.HaxeError = function(val) {
            Error.call(this);
            this.val = val;
            this.message = String(val);
            if (Error.captureStackTrace) Error.captureStackTrace(this, js._Boot.HaxeError);
        };
        js._Boot.HaxeError.__name__ = ["js", "_Boot", "HaxeError"];
        js._Boot.HaxeError.__super__ = Error;
        for (var k in Error.prototype) js._Boot.HaxeError.prototype[k] = Error.prototype[k];
        js._Boot.HaxeError.prototype.val = null;
        js._Boot.HaxeError.prototype.__class__ = js._Boot.HaxeError;
        ballooniesIxfGameController.GameController.BASE_GAME_ID = 0;;
        ballooniesIxfGameController.GameController.FREE_SPINS_ID = 1;;
        ballooniesIxfGameController.GameModel.CELLS_NUM = 3;;
        ballooniesIxfGameController.GameModel.REELS_NUM = 5;;
        ballooniesIxfGameController.GameModel.PICKER_STAGE = "Picker";;
        ballooniesIxfGameController.Join.ANIMATOR_FINISHED = "animatorFinished";;
        ballooniesIxfGameController.Join.METER_FINISHED = "meterFinished";;
        ballooniesIxfGameController.StateMachineDef.ID = "GAMECONTROLLERSM_";;
        ballooniesIxfGameController.StateMachineDef.LOADING_STATE = "LOADING_STATE";;
        ballooniesIxfGameController.StateMachineDef.PREPARE_RESUME_STATE = "PREPARE_RESUME_STATE";;
        ballooniesIxfGameController.StateMachineDef.INIT_STATE = "INIT_STATE";;
        ballooniesIxfGameController.StateMachineDef.IDLE_STATE = "IDLE_STATE";;
        ballooniesIxfGameController.StateMachineDef.SPIN_STARTING_STATE = "SPIN_STARTING_STATE";;
        ballooniesIxfGameController.StateMachineDef.SPINNING_STATE = "SPINNING_STATE";;
        ballooniesIxfGameController.StateMachineDef.FS_IDLE = "FS_IDLE";;
        ballooniesIxfGameController.StateMachineDef.ABORT_SPIN_STATE = "ABORT_SPIN_STATE";;
        ballooniesIxfGameController.StateMachineDef.STOPPING_STATE = "STOPPING_STATE";;
        ballooniesIxfGameController.StateMachineDef.AWARD_CAP_PREPARE = "AWARD_CAP_PREPARE";;
        ballooniesIxfGameController.StateMachineDef.AWARD_CAP_STATE = "AWARD_CAP_STATE";;
        ballooniesIxfGameController.StateMachineDef.BASEGAME_OUTCOME = "BASEGAME_OUTCOME";;
        ballooniesIxfGameController.StateMachineDef.SHOW_WIN_STATE = "SHOW_WIN_STATE";;
        ballooniesIxfGameController.StateMachineDef.FS_OUTCOME = "FS_OUTCOME";;
        ballooniesIxfGameController.StateMachineDef.FS_OUTCOME_PRESENTED = "FS_OUTCOME_PRESENTED";;
        ballooniesIxfGameController.StateMachineDef.FS_SUMMARY = "FS_SUMMARY";;
        ballooniesIxfGameController.StateMachineDef.SHOW_FS_RESULT_STATE = "SHOW_FS_RESULT_STATE";;
        ballooniesIxfGameController.StateMachineDef.BET_CONFIRM = "BET_CONFIRM";;
        ballooniesIxfGameController.StateMachineDef.PICKER_INTRO_STATE = "PICKER_INTRO_STATE";;
        ballooniesIxfGameController.StateMachineDef.SHOW_FS_WIN = "SHOW_FS_WIN";;
        ballooniesIxfGameController.StateMachineDef.PICKER_STATE = "PICKER_STATE";;
        ballooniesIxfGameController.StateMachineDef.PICKER_OUTRO_STATE = "PICKER_OUTRO_STATE";;
        ballooniesIxfGameController.StateMachineDef.FS_INTRO_STATE = "FS_INTRO_STATE";;
        ballooniesIxfGameController.StateMachineDef.ABORT_PICKER_STATE = "ABORT_PICKER_STATE";;
        ballooniesIxfGameController.StateMachineDef.PREPARE_RESUME = "PREPARE_RESUME";;
        ballooniesIxfGameController.StateMachineDef.INIT_ACTION = "INIT_ACTION";;
        ballooniesIxfGameController.StateMachineDef.CONTINUE_ENABLED = "CONTINUE_ENABLED";;
        ballooniesIxfGameController.StateMachineDef.SET_PICKER_IDLE = "SET_PICKER_IDLE";;
        ballooniesIxfGameController.StateMachineDef.SPIN_ENABLED = "SPIN_ENABLED";;
        ballooniesIxfGameController.StateMachineDef.START_REEL_SPIN = "START_REEL_SPIN";;
        ballooniesIxfGameController.StateMachineDef.SPIN_STARTING_ENDED = "SPIN_STARTING_ENDED";;
        ballooniesIxfGameController.StateMachineDef.STOP_REEL_SPIN = "STOP_REEL_SPIN";;
        ballooniesIxfGameController.StateMachineDef.ABORT_SPIN = "ABORT_SPIN";;
        ballooniesIxfGameController.StateMachineDef.PRESENT_SPIN_OUTCOME = "PRESENT_SPIN_OUTCOME";;
        ballooniesIxfGameController.StateMachineDef.PRESENT_RESULT = "PRESENT_RESULT";;
        ballooniesIxfGameController.StateMachineDef.CONTINUE = "CONTINUE";;
        ballooniesIxfGameController.StateMachineDef.FS_OUTCOME_DONE = "FS_OUTCOME_DONE";;
        ballooniesIxfGameController.StateMachineDef.FS_FINISHED = "FS_FINISHED";;
        ballooniesIxfGameController.StateMachineDef.FS_OUTRO_END = "FS_OUTRO_END";;
        ballooniesIxfGameController.StateMachineDef.PICKER_INTRO_FINISHED = "PICKER_INTRO_FINISHED";;
        ballooniesIxfGameController.StateMachineDef.SET_PICKER_INTRO_ACTION = "SET_PICKER_INTRO_ACTION";;
        ballooniesIxfGameController.StateMachineDef.START_PICKER_OUTRO = "START_PICKER_OUTRO";;
        ballooniesIxfGameController.StateMachineDef.START_FS_INTRO = "START_FS_INTRO";;
        ballooniesIxfGameController.StateMachineDef.FS_INTRO_COMPLETE = "FS_INTRO_COMPLETE";;
        ballooniesIxfGameController.StateMachineDef.FSM = "<fsm initial='LOADING_STATE'>\r\n\r\n  <state name='LOADING_STATE'>\r\n    <transition target='PREPARE_RESUME_STATE' action='PREPARE_RESUME'/>\r\n    <transition target='INIT_STATE' action='INIT_ACTION'/>\r\n    <operation type='do' method='attachComponents'/>\r\n  </state>\r\n  <state name='PREPARE_RESUME_STATE'>\r\n    <transition target='FS_IDLE' action='CONTINUE_ENABLED'/>\r\n    <transition target='PICKER_INTRO_STATE' action='SET_PICKER_INTRO_ACTION'/>\r\n    <transition target='BASEGAME_OUTCOME' action='PRESENT_SPIN_OUTCOME'/>\r\n    <operation type='do' method='prepareResume'/>\r\n  </state>\r\n  <state name='INIT_STATE'>\r\n    <transition target='IDLE_STATE' action='SPIN_ENABLED'/>\r\n    <operation type='do' method='initGame'/>\r\n  </state>\r\n  <state name='IDLE_STATE'>\r\n    <transition target='SPIN_STARTING_STATE' action='START_REEL_SPIN'/>\r\n    <transition target='IDLE_STATE' action='SPIN_ENABLED'/>\r\n    <operation type='do' method='onBaseGameIdle'/>\r\n    <operation type='exit' method='updateInfoBarOnSpin'/>\r\n  </state>\r\n  <state name='SPIN_STARTING_STATE'>\r\n    <transition target='SPINNING_STATE' action='SPIN_STARTING_ENDED'/>\r\n    <transition target='ABORT_SPIN_STATE' action='ABORT_SPIN'/>\r\n    <operation type='do' method='startSpin'/>\r\n  </state>\r\n  <state name='SPINNING_STATE'>\r\n    <transition target='STOPPING_STATE' action='STOP_REEL_SPIN'/>\r\n    <transition target='ABORT_SPIN_STATE' action='ABORT_SPIN'/>\r\n    <operation type='do' method='checkForStopOrAbort'/>\r\n  </state>\r\n  <state name='FS_IDLE'>\r\n    <transition target='SPIN_STARTING_STATE' action='START_REEL_SPIN'/>\r\n    <operation type='entry' method='stopTumbleProgress'/>\r\n    <operation type='do' method='executeContinueCommand'/>\r\n  </state>\r\n  <state name='ABORT_SPIN_STATE'>\r\n    <transition target='IDLE_STATE' action='SPIN_ENABLED'/>\r\n    <transition target='FS_IDLE' action='CONTINUE_ENABLED'/>\r\n    <operation type='entry' method='applyAbortData'/>\r\n    <operation type='do' method='completeAbortedSpin'/>\r\n  </state>\r\n  <state name='STOPPING_STATE'>\r\n    <transition target='SHOW_FS_WIN' condition='!awardCapExceeded,NextStage==Picker' action='PRESENT_SPIN_OUTCOME'/>\r\n    <transition target='BASEGAME_OUTCOME' condition='!awardCapExceeded,Stage==BaseGame,NextStage==BaseGame' action='PRESENT_SPIN_OUTCOME'/>\r\n    <transition target='FS_OUTCOME' condition='!awardCapExceeded,Stage==FreeSpin,NextStage==FreeSpin' action='PRESENT_SPIN_OUTCOME'/>\r\n    <transition target='SHOW_WIN_STATE' condition='!awardCapExceeded,Stage==FreeSpin,NextStage==BaseGame' action='PRESENT_SPIN_OUTCOME'/>\r\n    <transition target='AWARD_CAP_PREPARE' condition='awardCapExceeded' action='PRESENT_SPIN_OUTCOME'/>\r\n    <operation type='entry' method='stopReels'/>\r\n  </state>\r\n  <state name='AWARD_CAP_PREPARE'>\r\n    <transition target='AWARD_CAP_STATE' action='PRESENT_RESULT'/>\r\n    <operation type='entry' method='prepareAwardCap'/>\r\n  </state>\r\n  <state name='AWARD_CAP_STATE'>\r\n    <transition target='BET_CONFIRM' action='CONTINUE'/>\r\n    <operation type='do' method='showAwardCapScreen'/>\r\n  </state>\r\n  <state name='BASEGAME_OUTCOME'>\r\n    <transition target='SPIN_STARTING_STATE' action='START_REEL_SPIN'/>\r\n    <transition target='BET_CONFIRM' action='PRESENT_RESULT'/>\r\n    <operation type='entry' method='showBaseGameWins'/>\r\n    <operation type='entry' method='displayBaseGameWin'/>\r\n  </state>\r\n  <state name='SHOW_WIN_STATE'>\r\n    <transition target='FS_OUTCOME' action='CONTINUE'/>\r\n    <operation type='do' method='displayFreeSpinWin'/>\r\n  </state>\r\n  <state name='FS_OUTCOME'>\r\n    <transition target='FS_OUTCOME_PRESENTED' action='FS_OUTCOME_DONE'/>\r\n    <transition target='FS_SUMMARY' action='FS_FINISHED'/>\r\n    <operation type='do' method='showFreeSpinWins'/>\r\n  </state>\r\n  <state name='FS_OUTCOME_PRESENTED'>\r\n    <transition target='FS_IDLE' action='CONTINUE_ENABLED'/>\r\n    <transition target='SPIN_STARTING_STATE' action='START_REEL_SPIN'/>\r\n  </state>\r\n  <state name='FS_SUMMARY'>\r\n    <transition target='SHOW_FS_RESULT_STATE' action='FS_OUTRO_END'/>\r\n    <operation type='entry' method='updateFSTotalWin'/>\r\n    <operation type='do' method='startFSOutroAnim'/>\r\n    <operation type='exit' method='setBaseGameOutcome'/>\r\n  </state>\r\n  <state name='SHOW_FS_RESULT_STATE'>\r\n    <transition target='SPIN_STARTING_STATE' action='START_REEL_SPIN'/>\r\n    <operation type='do' method='showBaseGameWins'/>\r\n  </state>\r\n  <state name='BET_CONFIRM'>\r\n    <transition target='IDLE_STATE' action='SPIN_ENABLED'/>\r\n    <transition target='SPIN_STARTING_STATE' action='START_REEL_SPIN'/>\r\n    <operation type='exit' method='stopTumbleProgress'/>\r\n    <operation type='do' method='publishResultPresented'/>\r\n  </state>\r\n  <state name='PICKER_INTRO_STATE'>\r\n    <transition target='PICKER_STATE' action='PICKER_INTRO_FINISHED'/>\r\n    <operation type='do' method='showPickerIntro'/>\r\n  </state>\r\n  <state name='SHOW_FS_WIN'>\r\n    <transition target='PICKER_INTRO_STATE' action='SET_PICKER_INTRO_ACTION'/>\r\n    <operation type='do' method='showScatterWins'/>\r\n    <operation type='do' method='publishSpinOutcomePresented'/>\r\n  </state>\r\n  <state name='ABORT_PICKER_STATE'>\r\n    <transition target='PICKER_STATE' action='SET_PICKER_IDLE'/>\r\n  <operation type='do' method='abortPicker'/>\r\n  </state>\r\n  <state name='PICKER_STATE'>\r\n    <transition target='PICKER_OUTRO_STATE' action='PRESENT_SPIN_OUTCOME'/>\r\n    <transition target='ABORT_PICKER_STATE' action='ABORT_SPIN'/>\r\n    <operation type='do' method='enablePicker'/>\r\n    <operation type='exit' method='showPickerResult'/>\r\n  </state>\r\n  <state name='PICKER_OUTRO_STATE'>\r\n    <transition target='FS_INTRO_STATE' action='START_FS_INTRO'/>\r\n  </state>\r\n  <state name='FS_INTRO_STATE'>\r\n    <transition target='FS_IDLE' action='CONTINUE_ENABLED'/>\r\n    <operation type='do' method='startFSIntroAnim'/>\r\n  </state>\r\n</fsm>";;
        return {
            exports: ballooniesIxfGameController,
            activator: ballooniesIxfGameController.Activator
        };
    });
//# sourceURL=ballooniesIxfGameController.js