define("tripleRedHotSevensIXFPopups", ["viewBuilderApi", "componentmodelComponentApi", "translationmanagerApi", "clientkernelLoaderApi", "uiHelper", "displayEngineApi", "tripleRedHotSevensIXFPopupsApi", "commonTools", "gameLayoutApi", "PIXI", "BABYLON", "clientkernelEventbusApi", "clientkernelModulesApi", "moneyApi"],
    function(viewBuilderApi, componentmodelComponentApi, translationmanagerApi, clientkernelLoaderApi, uiHelper, displayEngineApi, tripleRedHotSevensIXFPopupsApi, commonTools, gameLayoutApi, PIXI, BABYLON, clientkernelEventbusApi, clientkernelModulesApi, 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 tripleRedHotSevensIXFPopups == 'undefined') {
            var tripleRedHotSevensIXFPopups = {};
        };
        tripleRedHotSevensIXFPopups.Activator = function(context) {};
        tripleRedHotSevensIXFPopups.Activator = ck_implements(tripleRedHotSevensIXFPopups.Activator, clientkernelModulesApi.IModuleActivator);
        tripleRedHotSevensIXFPopups.Activator.__interfaces__ = [clientkernelModulesApi.IModuleActivator];
        tripleRedHotSevensIXFPopups.Activator.__name__ = ["tripleRedHotSevensIXFPopups", "Activator"];
        tripleRedHotSevensIXFPopups.Activator.prototype.start = function(context) {
            context.getServiceTracker([clientkernelLoaderApi.IAssetRegistry, viewBuilderApi.IViewBuilderFactory, displayEngineApi.IDisplayProvider, translationmanagerApi.ITranslationManager, moneyApi.IMoneyFormatter]).then(function(context1) {
                tripleRedHotSevensIXFPopups.ExternalService.initialize(context1);
                context1.registerService(new tripleRedHotSevensIXFPopups.PopupsFactory(context1), tripleRedHotSevensIXFPopupsApi.PopupsDeclaration, null);
            });
        };
        tripleRedHotSevensIXFPopups.Activator.prototype.stop = function(context) {};
        tripleRedHotSevensIXFPopups.Activator.main = function() {};
        tripleRedHotSevensIXFPopups.Activator.prototype.__class__ = tripleRedHotSevensIXFPopups.Activator;
        tripleRedHotSevensIXFPopups.ExternalService = function() {};
        tripleRedHotSevensIXFPopups.ExternalService.__name__ = ["tripleRedHotSevensIXFPopups", "ExternalService"];
        tripleRedHotSevensIXFPopups.ExternalService.assetRegistry = null;
        tripleRedHotSevensIXFPopups.ExternalService.viewBuilderFactory = null;
        tripleRedHotSevensIXFPopups.ExternalService.displayProvider = null;
        tripleRedHotSevensIXFPopups.ExternalService.translationManager = null;
        tripleRedHotSevensIXFPopups.ExternalService.bus = null;
        tripleRedHotSevensIXFPopups.ExternalService.uiHelper = null;
        tripleRedHotSevensIXFPopups.ExternalService.initialize = function(context) {
            tripleRedHotSevensIXFPopups.ExternalService.assetRegistry = context.getAnyService(clientkernelLoaderApi.IAssetRegistry, null);
            tripleRedHotSevensIXFPopups.ExternalService.viewBuilderFactory = context.getAnyService(viewBuilderApi.IViewBuilderFactory, null);
            tripleRedHotSevensIXFPopups.ExternalService.displayProvider = context.getAnyService(displayEngineApi.IDisplayProvider, null);
            tripleRedHotSevensIXFPopups.ExternalService.translationManager = context.getAnyService(translationmanagerApi.ITranslationManager, null);
            tripleRedHotSevensIXFPopups.ExternalService.bus = context.getAnyService(clientkernelEventbusApi.IEventBus, null);
            tripleRedHotSevensIXFPopups.ExternalService.uiHelper = uiHelper.UiHelper.getUiHelper(tripleRedHotSevensIXFPopups.ExternalService.displayProvider);
        };
        tripleRedHotSevensIXFPopups.ExternalService.getAsset = function(id) {
            return tripleRedHotSevensIXFPopups.ExternalService.assetRegistry.getAsset(id).getContent();
        };
        tripleRedHotSevensIXFPopups.ExternalService.prototype.__class__ = tripleRedHotSevensIXFPopups.ExternalService;
        tripleRedHotSevensIXFPopups.Popups = function(context, cfgId) {
            this.outroScreen = new tripleRedHotSevensIXFPopups.FreeSpinOutroScreen();
            this.introScreen = new tripleRedHotSevensIXFPopups.FreeSpinIntroScreen();
            this.retriggerScreen = new tripleRedHotSevensIXFPopups.RetriggerScreen();
            this.awardCapScreen = new tripleRedHotSevensIXFPopups.AwardCapScreen();
            this.initialized = false;
            this.context = context;
            this.layoutPort = context.getUsedPort(gameLayoutApi.IGameLayoutPort);
            this.initialUpdateLayout = this.layoutPort.getUpdateComponentLayout().subscribe($bind(this, this.onInitialUpdateLayout));
            this.popupsImplPort = context.getImplementedPort(tripleRedHotSevensIXFPopupsApi.IPopupsImplementationPort);
            this.popupsImplPort.onShowAwardCap($bind(this, this.onShowAwardCap));
            this.popupsImplPort.onShowRetrigger($bind(this, this.onShowRetriggerPopup));
            this.popupsImplPort.onShowFreeSpinIntro($bind(this, this.onShowFreeSpinIntro));
            this.popupsImplPort.onShowFreeSpinOutro($bind(this, this.onShowFreeSpinOutro));
            this.popupsImplPort.onHide($bind(this, this.onHide));
            this.introScreen.setPort(this.popupsImplPort);
        };
        tripleRedHotSevensIXFPopups.Popups.__name__ = ["tripleRedHotSevensIXFPopups", "Popups"];
        tripleRedHotSevensIXFPopups.Popups.prototype.popupsImplPort = null;
        tripleRedHotSevensIXFPopups.Popups.prototype.context = null;
        tripleRedHotSevensIXFPopups.Popups.prototype.layoutPort = null;
        tripleRedHotSevensIXFPopups.Popups.prototype.layoutPayload = null;
        tripleRedHotSevensIXFPopups.Popups.prototype.initialized = null;
        tripleRedHotSevensIXFPopups.Popups.prototype.view = null;
        tripleRedHotSevensIXFPopups.Popups.prototype.layerContainer = null;
        tripleRedHotSevensIXFPopups.Popups.prototype.awardCapScreen = null;
        tripleRedHotSevensIXFPopups.Popups.prototype.retriggerScreen = null;
        tripleRedHotSevensIXFPopups.Popups.prototype.introScreen = null;
        tripleRedHotSevensIXFPopups.Popups.prototype.outroScreen = null;
        tripleRedHotSevensIXFPopups.Popups.prototype.currentPopup = null;
        tripleRedHotSevensIXFPopups.Popups.prototype.initialUpdateLayout = null;
        tripleRedHotSevensIXFPopups.Popups.prototype.onHide = function(e) {
            if (this.currentPopup != null) {
                this.currentPopup.hide();
                this.currentPopup = null;
            }
        };
        tripleRedHotSevensIXFPopups.Popups.prototype.onShowAwardCap = function(e) {
            this.showPopup(this.awardCapScreen, e.getPayload());
        };
        tripleRedHotSevensIXFPopups.Popups.prototype.onShowRetriggerPopup = function(e) {
            this.showPopup(this.retriggerScreen, e.getPayload());
        };
        tripleRedHotSevensIXFPopups.Popups.prototype.onShowFreeSpinIntro = function(e) {
            this.showPopup(this.introScreen, e.getPayload());
        };
        tripleRedHotSevensIXFPopups.Popups.prototype.onShowFreeSpinOutro = function(e) {
            this.showPopup(this.outroScreen, e.getPayload());
        };
        tripleRedHotSevensIXFPopups.Popups.prototype.onInitialUpdateLayout = function(e) {
            this.layoutPayload = e.getPayload();
            this.initialUpdateLayout.unsubscribe();
            this.layoutPort.getUpdateComponentLayout().subscribe($bind(this, this.onUpdateLayout));
            commonTools.PromiseExtension.thenCall(this.initializeAssets(), $bind(this, this.updateLayout));
        };
        tripleRedHotSevensIXFPopups.Popups.prototype.initializeAssets = function() {
            var _g = this;
            var promise = new Promise(function(resolve, reject) {
                window.setTimeout(function() {
                    var assetsList = [];
                    assetsList.push("popups-assets/" + "popups.viewbuilder.json");
                    assetsList.push("popups-assets/" + "popups_animation.viewbuilder.json");
                    tripleRedHotSevensIXFPopups.ExternalService.assetRegistry.getAssetsContent(assetsList).then(function(data) {
                        tripleRedHotSevensIXFPopups.ExternalService.loadedAssets = data;
                        _g.initialize(tripleRedHotSevensIXFPopups.ExternalService.loadedAssets.get("popups.viewbuilder.json"));
                        resolve(null);
                    });
                }, 1);
            });
            return promise;
        };
        tripleRedHotSevensIXFPopups.Popups.prototype.initialize = function(vba) {
            this.view = tripleRedHotSevensIXFPopups.ExternalService.viewBuilderFactory.createView(vba);
            this.layerContainer = this.view.getContainerById("POPUP");
            this.initAllScreens();
        };
        tripleRedHotSevensIXFPopups.Popups.prototype.initAllScreens = function() {
            var layout = this.layoutPayload.containers.get("POPUP");
            this.awardCapScreen.init(this.layerContainer, layout);
            this.retriggerScreen.init(this.layerContainer, layout);
            this.introScreen.init(this.layerContainer, layout);
            this.outroScreen.init(this.layerContainer, layout);
        };
        tripleRedHotSevensIXFPopups.Popups.prototype.onUpdateLayout = function(e) {
            this.layoutPayload = e.getPayload();
            this.updateLayout();
        };
        tripleRedHotSevensIXFPopups.Popups.prototype.showPopup = function(popupToShow, payload) {
            if (this.currentPopup != null) {
                this.currentPopup.hide();
                this.currentPopup.updateCache();
            }
            this.currentPopup = popupToShow;
            this.currentPopup.show(payload);
            this.currentPopup.updateCache();
        };
        tripleRedHotSevensIXFPopups.Popups.prototype.updateLayout = function() {
            var layoutPayload = this.layoutPayload.containers.get("POPUP");
            var containerDisplayObject = this.layerContainer.getDisplayObject();
            this.addToStage(containerDisplayObject, layoutPayload.stage);
            containerDisplayObject.setX(layoutPayload.left);
            containerDisplayObject.setY(layoutPayload.top);
            containerDisplayObject.setZIndex(layoutPayload.zIndex);
            containerDisplayObject.setScaleX(layoutPayload.width / containerDisplayObject.getUserData().viewBuilderW);
            containerDisplayObject.setScaleY(layoutPayload.height / containerDisplayObject.getUserData().viewBuilderH);
            if (layoutPayload.configuration != null) this.updateCustomLayouts(layoutPayload.configuration);
            if (this.currentPopup != null) this.currentPopup.onUpdateLayout(layoutPayload);
            this.layoutPort.getComponentLayoutUpdated().publish(this.context.getInstance());
        };
        tripleRedHotSevensIXFPopups.Popups.prototype.updateCustomLayouts = function(config) {
            var _g = 0;
            while (_g < config.length) {
                var configItem = config[_g];
                ++_g;
                this.adjustLayout(configItem, this.layerContainer);
            }
        };
        tripleRedHotSevensIXFPopups.Popups.prototype.adjustLayout = function(customLayout, parentContainer) {
            var customPopup = parentContainer.getContainerById(customLayout.id).getDisplayObject();
            if (customLayout.stage != null) {
                this.addToStage(customPopup, customLayout.stage);
                customPopup.setZIndex(customLayout.zIndex);
            }
            customPopup.setX(customLayout.left);
            customPopup.setY(customLayout.top);
            customPopup.setScaleX(customLayout.width / customPopup.getUserData().viewBuilderW);
            customPopup.setScaleY(customLayout.height / customPopup.getUserData().viewBuilderH);
        };
        tripleRedHotSevensIXFPopups.Popups.prototype.addToStage = function(container, stageId) {
            var stage;
            var this1 = tripleRedHotSevensIXFPopups.ExternalService.displayProvider.getStages();
            stage = this1.get(stageId);
            stage.removeChild(container);
            stage.addChild(container);
        };
        tripleRedHotSevensIXFPopups.Popups.prototype.__class__ = tripleRedHotSevensIXFPopups.Popups;
        tripleRedHotSevensIXFPopups.PopupsFactory = function(context) {
            this.context = context;
        };
        tripleRedHotSevensIXFPopups.PopupsFactory = ck_implements(tripleRedHotSevensIXFPopups.PopupsFactory, clientkernelModulesApi.IService);
        tripleRedHotSevensIXFPopups.PopupsFactory = ck_implements(tripleRedHotSevensIXFPopups.PopupsFactory, componentmodelComponentApi.IComponentFactory);
        tripleRedHotSevensIXFPopups.PopupsFactory.__interfaces__ = [clientkernelModulesApi.IService, componentmodelComponentApi.IComponentFactory];
        tripleRedHotSevensIXFPopups.PopupsFactory.__name__ = ["tripleRedHotSevensIXFPopups", "PopupsFactory"];
        tripleRedHotSevensIXFPopups.PopupsFactory.prototype.context = null;
        tripleRedHotSevensIXFPopups.PopupsFactory.prototype.getComponentDeclaration = function() {
            return tripleRedHotSevensIXFPopupsApi.PopupsDeclaration;
        };
        tripleRedHotSevensIXFPopups.PopupsFactory.prototype.createComponent = function(context) {
            var cfgId = context.getConfiguration();
            new tripleRedHotSevensIXFPopups.Popups(context, cfgId);
        };
        tripleRedHotSevensIXFPopups.PopupsFactory.prototype.__class__ = tripleRedHotSevensIXFPopups.PopupsFactory;

        tripleRedHotSevensIXFPopups.IPopup = function() {}
        tripleRedHotSevensIXFPopups.IPopup.prototype = {

            init: function(container, layoutPayload) {
                return {
                    arguments: ["*", "*"],
                    returns: "void"
                };
            },
            show: function(payload) {
                return {
                    arguments: ["*"],
                    returns: "void"
                };
            },
            updateCache: function() {
                return {
                    arguments: [],
                    returns: "void"
                };
            },
            hide: function() {
                return {
                    arguments: [],
                    returns: "void"
                };
            },
            onUpdateLayout: function(layoutPayload) {
                return {
                    arguments: ["*"],
                    returns: "void"
                };
            }
        };
        tripleRedHotSevensIXFPopups.AwardCapScreen = function() {};
        tripleRedHotSevensIXFPopups.AwardCapScreen = ck_implements(tripleRedHotSevensIXFPopups.AwardCapScreen, tripleRedHotSevensIXFPopups.IPopup);
        tripleRedHotSevensIXFPopups.AwardCapScreen.__interfaces__ = [tripleRedHotSevensIXFPopups.IPopup];
        tripleRedHotSevensIXFPopups.AwardCapScreen.__name__ = ["tripleRedHotSevensIXFPopups", "AwardCapScreen"];
        tripleRedHotSevensIXFPopups.AwardCapScreen.prototype.appearAnimation = null;
        tripleRedHotSevensIXFPopups.AwardCapScreen.prototype.layerContainer = null;
        tripleRedHotSevensIXFPopups.AwardCapScreen.prototype.labelsGroup = null;
        tripleRedHotSevensIXFPopups.AwardCapScreen.prototype.labelsForFreeSpinsGroup = null;
        tripleRedHotSevensIXFPopups.AwardCapScreen.prototype.payload = null;
        tripleRedHotSevensIXFPopups.AwardCapScreen.prototype.layoutPayload = null;
        tripleRedHotSevensIXFPopups.AwardCapScreen.prototype.init = function(container, layoutPayload) {
            this.layoutPayload = layoutPayload;
            this.layerContainer = container.getContainerById("popup_AwardCup");
            var ANIM_CONTAINER_ID = "ANIMATION_PLACE";
            var animationHolder = this.layerContainer.getContainerById(ANIM_CONTAINER_ID);
            this.appearAnimation = this.getAnimation("MAXAWARD_HOLDER", "ANIMATION_CONTENT");
            animationHolder.addChildComponent(this.appearAnimation, ANIM_CONTAINER_ID);
            this.appearAnimation.addEventListener("LOOP::END", $bind(this, this.onLoopEnd));
            this.appearAnimation.addEventListener("SHOW::LABELS", $bind(this, this.onShowLabels));
            this.labelsGroup = tripleRedHotSevensIXFPopups.ExternalService.uiHelper.getUiGroupFor(this.layerContainer.getDisplayObject(), tripleRedHotSevensIXFPopups.AwardCapScreen.labels);
            this.labelsForFreeSpinsGroup = tripleRedHotSevensIXFPopups.ExternalService.uiHelper.getUiGroupFor(this.layerContainer.getDisplayObject(), tripleRedHotSevensIXFPopups.AwardCapScreen.labelsForFreeSpins);
            this.hide();
            uiHelper.ViewBuilderContainerExtension.cacheAsBitmap(this.layerContainer);
        };
        tripleRedHotSevensIXFPopups.AwardCapScreen.prototype.onUpdateLayout = function(layoutPayload) {};
        tripleRedHotSevensIXFPopups.AwardCapScreen.prototype.show = function(popupPayload) {
            this.payload = popupPayload;
            this.layerContainer.getLabelById("popups_AwardCap_amount").setText(popupPayload.maxValue);
            this.hideLabels();
            this.appearAnimation.gotoAndPlay(false, "firstFrame");
            this.layerContainer.show();
        };
        tripleRedHotSevensIXFPopups.AwardCapScreen.prototype.updateCache = function() {
            uiHelper.ViewBuilderContainerExtension.updateCacheAsBitmap(this.layerContainer);
        };
        tripleRedHotSevensIXFPopups.AwardCapScreen.prototype.hide = function() {
            this.layerContainer.hide();
            this.appearAnimation.gotoAndStop(false, "firstFrame");
        };
        tripleRedHotSevensIXFPopups.AwardCapScreen.prototype.getAnimation = function(holderID, animationID) {
            var animAssets = tripleRedHotSevensIXFPopups.ExternalService.loadedAssets.get("popups_animation.viewbuilder.json");
            var animView = tripleRedHotSevensIXFPopups.ExternalService.viewBuilderFactory.createView(animAssets);
            var animHolder = animView.createContainerFromStoredConfig(holderID);
            return animHolder.getVBAnimationById(animationID);
        };
        tripleRedHotSevensIXFPopups.AwardCapScreen.prototype.onLoopEnd = function() {
            this.appearAnimation.gotoAndPlay(false, "loopStart");
        };
        tripleRedHotSevensIXFPopups.AwardCapScreen.prototype.onShowLabels = function() {
            this.showLabels();
        };
        tripleRedHotSevensIXFPopups.AwardCapScreen.prototype.hideLabels = function() {
            this.labelsGroup.hideAll();
            this.labelsForFreeSpinsGroup.hideAll();
        };
        tripleRedHotSevensIXFPopups.AwardCapScreen.prototype.showLabels = function() {
            this.labelsGroup.showAll();
            if (this.payload.isFreeSpinsEnded) this.labelsForFreeSpinsGroup.showAll();
        };
        tripleRedHotSevensIXFPopups.AwardCapScreen.prototype.__class__ = tripleRedHotSevensIXFPopups.AwardCapScreen;
        tripleRedHotSevensIXFPopups.BaseScreen = function() {};
        tripleRedHotSevensIXFPopups.BaseScreen.__name__ = ["tripleRedHotSevensIXFPopups", "BaseScreen"];
        tripleRedHotSevensIXFPopups.BaseScreen.prototype.popupBg = null;
        tripleRedHotSevensIXFPopups.BaseScreen.prototype.stage = null;
        tripleRedHotSevensIXFPopups.BaseScreen.prototype.payload = null;
        tripleRedHotSevensIXFPopups.BaseScreen.prototype.port = null;
        tripleRedHotSevensIXFPopups.BaseScreen.prototype.setPort = function(popupPort) {
            this.port = popupPort;
        };
        tripleRedHotSevensIXFPopups.BaseScreen.prototype.onUpdateLayout = function(layoutPayload) {};
        tripleRedHotSevensIXFPopups.BaseScreen.prototype.initPopupBg = function(payload) {
            this.payload = payload;
            this.popupBg = window.document.getElementById("MainBg");
            if (this.popupBg == null) this.popupBg = this.createBg("MainBg");
        };
        tripleRedHotSevensIXFPopups.BaseScreen.prototype.createBg = function(name, fillColor) {
            if (fillColor == null) fillColor = "#000000dd";
            var bg = window.document.createElement("div");
            var canvas = this.getStage().getCanvas();
            canvas.parentNode.insertBefore(bg, canvas);
            bg.style.backgroundColor = fillColor;
            bg.style.width = "100%";
            bg.style.height = "100%";
            bg.style.position = "absolute";
            bg.style.zIndex = _hcmn_.Std.parseInt(canvas.style.zIndex) + "";
            bg.style.display = "none";
            bg.id = name;
            bg.onmousedown = $bind(this, this.emptyFunction);
            return bg;
        };
        tripleRedHotSevensIXFPopups.BaseScreen.prototype.emptyFunction = function() {};
        tripleRedHotSevensIXFPopups.BaseScreen.prototype.showBG = function() {
            this.getStage().setVisible(true);
            this.popupBg.style.display = "block";
        };
        tripleRedHotSevensIXFPopups.BaseScreen.prototype.hideBG = function() {
            this.popupBg.style.display = "none";
            this.getStage().setVisible(false);
        };
        tripleRedHotSevensIXFPopups.BaseScreen.prototype.getStage = function() {
            var this1 = tripleRedHotSevensIXFPopups.ExternalService.displayProvider.getStages();
            return this1.get(this.payload.stage);
        };
        tripleRedHotSevensIXFPopups.BaseScreen.prototype.__class__ = tripleRedHotSevensIXFPopups.BaseScreen;
        tripleRedHotSevensIXFPopups.FreeSpinIntroScreen = function() {
            this.timeoutId = -1;
            tripleRedHotSevensIXFPopups.BaseScreen.call(this);
        };
        tripleRedHotSevensIXFPopups.FreeSpinIntroScreen = ck_implements(tripleRedHotSevensIXFPopups.FreeSpinIntroScreen, tripleRedHotSevensIXFPopups.IPopup);
        tripleRedHotSevensIXFPopups.FreeSpinIntroScreen.__interfaces__ = [tripleRedHotSevensIXFPopups.IPopup];
        tripleRedHotSevensIXFPopups.FreeSpinIntroScreen.__name__ = ["tripleRedHotSevensIXFPopups", "FreeSpinIntroScreen"];
        tripleRedHotSevensIXFPopups.FreeSpinIntroScreen.__super__ = tripleRedHotSevensIXFPopups.BaseScreen;
        for (var k in tripleRedHotSevensIXFPopups.BaseScreen.prototype) tripleRedHotSevensIXFPopups.FreeSpinIntroScreen.prototype[k] = tripleRedHotSevensIXFPopups.BaseScreen.prototype[k];
        tripleRedHotSevensIXFPopups.FreeSpinIntroScreen.prototype.channel = null;
        tripleRedHotSevensIXFPopups.FreeSpinIntroScreen.prototype.congratsScreen = null;
        tripleRedHotSevensIXFPopups.FreeSpinIntroScreen.prototype.pressButtonScreen = null;
        tripleRedHotSevensIXFPopups.FreeSpinIntroScreen.prototype.button = null;
        tripleRedHotSevensIXFPopups.FreeSpinIntroScreen.prototype.timeoutId = null;
        tripleRedHotSevensIXFPopups.FreeSpinIntroScreen.prototype.init = function(container, layoutPayload) {
            this.channel = tripleRedHotSevensIXFPopups.ExternalService.bus.getChannel("GFBus");
            this.congratsScreen = container.getContainerById("popup_FSIntro");
            this.pressButtonScreen = container.getContainerById("popup_FSIntro_Start");
            this.initButton();
            this.hide();
            uiHelper.ViewBuilderContainerExtension.cacheAsBitmap(this.congratsScreen);
            uiHelper.ViewBuilderContainerExtension.cacheAsBitmap(this.pressButtonScreen);
        };
        tripleRedHotSevensIXFPopups.FreeSpinIntroScreen.prototype.initButton = function() {
            var _g = this;
            var cont = this.pressButtonScreen.getContainerById("FREESPIN_BUTTON");
            this.button = cont.getContainerById("START_BONUS_BTN").getButtonById("btn");
            this.channel.subscribe("multipicker:choice", $bind(this, this.onButtonClickedByTest));
            this.button.getEvents().DOWN().addListener($bind(this, this.onButtonClicked));
            this.button.disable();
            _hcmn_.haxe_Timer.delay(function() {
                _g.placeOver(cont.getDisplayObject(), _g.getSpinButtonObject());
            }, 10);
        };
        tripleRedHotSevensIXFPopups.FreeSpinIntroScreen.prototype.getStage = function() {
            var this1 = tripleRedHotSevensIXFPopups.ExternalService.displayProvider.getStages();
            return this1.get("skgl_0");
        };
        tripleRedHotSevensIXFPopups.FreeSpinIntroScreen.prototype.show = function(amount) {
            if (amount > 0) {
                this.congratsScreen.getLabelById("popups_Fsintro_amount").setText("" + amount);
                this.congratsScreen.show();
                _hcmn_.haxe_Timer.delay($bind(this, this.showPressButton), 2500);
            } else this.showPressButton();
        };
        tripleRedHotSevensIXFPopups.FreeSpinIntroScreen.prototype.updateCache = function() {
            uiHelper.ViewBuilderContainerExtension.updateCacheAsBitmap(this.congratsScreen);
            uiHelper.ViewBuilderContainerExtension.updateCacheAsBitmap(this.pressButtonScreen);
        };
        tripleRedHotSevensIXFPopups.FreeSpinIntroScreen.prototype.showPressButton = function() {
            this.congratsScreen.hide();
            this.pressButtonScreen.show();
            this.moveButton();
            this.button.show();
            this.button.enable();
            this.sendButtonEnabled();
        };
        tripleRedHotSevensIXFPopups.FreeSpinIntroScreen.prototype.sendButtonEnabled = function() {
            this.port.publishButtonEnabled();
            var payload = {
                'instanceId': "0",
                'availablePicks': {
                    'h': {
                        '1': true
                    }
                }
            };
            this.channel.publish("multipicker:availablePicks", payload);
        };
        tripleRedHotSevensIXFPopups.FreeSpinIntroScreen.prototype.hide = function() {
            this.button.hide();
            this.congratsScreen.hide();
            this.pressButtonScreen.hide();
        };
        tripleRedHotSevensIXFPopups.FreeSpinIntroScreen.prototype.onButtonClickedByTest = function(e) {
            this.onButtonClicked();
        };
        tripleRedHotSevensIXFPopups.FreeSpinIntroScreen.prototype.onButtonClicked = function() {
            this.button.disable();
            this.port.publishButtonClicked();
        };
        tripleRedHotSevensIXFPopups.FreeSpinIntroScreen.prototype.onUpdateLayout = function(layoutPayload) {
            this.moveButton();
            window.clearTimeout(this.timeoutId);
            this.timeoutId = window.setTimeout($bind(this, this.moveButton), 100);
        };
        tripleRedHotSevensIXFPopups.FreeSpinIntroScreen.prototype.moveButton = function() {
            var btnObject = this.pressButtonScreen.getContainerById("FREESPIN_BUTTON").getDisplayObject();
            this.placeOver(btnObject, this.getSpinButtonObject(), false);
        };
        tripleRedHotSevensIXFPopups.FreeSpinIntroScreen.prototype.getSpinButtonObject = function() {
            return this.getStage().getChildByID("bp_spin");
        };
        tripleRedHotSevensIXFPopups.FreeSpinIntroScreen.prototype.placeOver = function(obj1, obj2, addToStage) {
            if (addToStage == null) addToStage = true;
            if (obj1 == null || obj2 == null) return;
            if (addToStage) {
                this.getStage().addChild(obj1);
                obj1.setZIndex(obj2.getZIndex() + 1);
            }
            obj1.setScale(obj2.getScaleX());
            obj1.setPos(obj2.getX(), obj2.getY());
        };
        tripleRedHotSevensIXFPopups.FreeSpinIntroScreen.prototype.__class__ = tripleRedHotSevensIXFPopups.FreeSpinIntroScreen;
        tripleRedHotSevensIXFPopups.FreeSpinOutroScreen = function() {
            tripleRedHotSevensIXFPopups.BaseScreen.call(this);
        };
        tripleRedHotSevensIXFPopups.FreeSpinOutroScreen = ck_implements(tripleRedHotSevensIXFPopups.FreeSpinOutroScreen, tripleRedHotSevensIXFPopups.IPopup);
        tripleRedHotSevensIXFPopups.FreeSpinOutroScreen.__interfaces__ = [tripleRedHotSevensIXFPopups.IPopup];
        tripleRedHotSevensIXFPopups.FreeSpinOutroScreen.__name__ = ["tripleRedHotSevensIXFPopups", "FreeSpinOutroScreen"];
        tripleRedHotSevensIXFPopups.FreeSpinOutroScreen.__super__ = tripleRedHotSevensIXFPopups.BaseScreen;
        for (var k in tripleRedHotSevensIXFPopups.BaseScreen.prototype) tripleRedHotSevensIXFPopups.FreeSpinOutroScreen.prototype[k] = tripleRedHotSevensIXFPopups.BaseScreen.prototype[k];
        tripleRedHotSevensIXFPopups.FreeSpinOutroScreen.prototype.congratsScreen = null;
        tripleRedHotSevensIXFPopups.FreeSpinOutroScreen.prototype.completeScreen = null;
        tripleRedHotSevensIXFPopups.FreeSpinOutroScreen.prototype.init = function(container, layoutPayload) {
            this.initPopupBg(layoutPayload);
            this.congratsScreen = container.getContainerById("popup_FSOutro_Win");
            this.completeScreen = container.getContainerById("popup_FSOutro_NoWin");
            this.hide();
            uiHelper.ViewBuilderContainerExtension.cacheAsBitmap(this.congratsScreen);
            uiHelper.ViewBuilderContainerExtension.cacheAsBitmap(this.completeScreen);
        };
        tripleRedHotSevensIXFPopups.FreeSpinOutroScreen.prototype.show = function(winAmount) {
            this.showBG();
            if (winAmount == "0") this.completeScreen.show();
            else {
                this.congratsScreen.getLabelById("popups_FsOutro_winAmount").setText(winAmount);
                this.congratsScreen.show();
            }
        };
        tripleRedHotSevensIXFPopups.FreeSpinOutroScreen.prototype.updateCache = function() {
            uiHelper.ViewBuilderContainerExtension.updateCacheAsBitmap(this.completeScreen);
            uiHelper.ViewBuilderContainerExtension.updateCacheAsBitmap(this.congratsScreen);
        };
        tripleRedHotSevensIXFPopups.FreeSpinOutroScreen.prototype.hide = function() {
            this.hideBG();
            this.completeScreen.hide();
            this.congratsScreen.hide();
        };
        tripleRedHotSevensIXFPopups.FreeSpinOutroScreen.prototype.__class__ = tripleRedHotSevensIXFPopups.FreeSpinOutroScreen;
        tripleRedHotSevensIXFPopups.RetriggerScreen = function() {
            tripleRedHotSevensIXFPopups.BaseScreen.call(this);
        };
        tripleRedHotSevensIXFPopups.RetriggerScreen = ck_implements(tripleRedHotSevensIXFPopups.RetriggerScreen, tripleRedHotSevensIXFPopups.IPopup);
        tripleRedHotSevensIXFPopups.RetriggerScreen.__interfaces__ = [tripleRedHotSevensIXFPopups.IPopup];
        tripleRedHotSevensIXFPopups.RetriggerScreen.__name__ = ["tripleRedHotSevensIXFPopups", "RetriggerScreen"];
        tripleRedHotSevensIXFPopups.RetriggerScreen.__super__ = tripleRedHotSevensIXFPopups.BaseScreen;
        for (var k in tripleRedHotSevensIXFPopups.BaseScreen.prototype) tripleRedHotSevensIXFPopups.RetriggerScreen.prototype[k] = tripleRedHotSevensIXFPopups.BaseScreen.prototype[k];
        tripleRedHotSevensIXFPopups.RetriggerScreen.prototype.maxRetrigger = null;
        tripleRedHotSevensIXFPopups.RetriggerScreen.prototype.simpleRetrigger = null;
        tripleRedHotSevensIXFPopups.RetriggerScreen.prototype.init = function(container, layoutPayload) {
            this.initPopupBg(layoutPayload);
            this.maxRetrigger = container.getContainerById("popup_MaxReTrigger");
            this.simpleRetrigger = container.getContainerById("popup_ReTrigger");
            this.hide();
            uiHelper.ViewBuilderContainerExtension.cacheAsBitmap(this.maxRetrigger);
            uiHelper.ViewBuilderContainerExtension.cacheAsBitmap(this.simpleRetrigger);
        };
        tripleRedHotSevensIXFPopups.RetriggerScreen.prototype.show = function(payload) {
            this.showBG();
            if (payload.isMaxAwarded) this.showMaxRetrigger(payload);
            else this.showSimpleRetrigger(payload);
        };
        tripleRedHotSevensIXFPopups.RetriggerScreen.prototype.updateCache = function() {
            uiHelper.ViewBuilderContainerExtension.updateCacheAsBitmap(this.maxRetrigger);
            uiHelper.ViewBuilderContainerExtension.updateCacheAsBitmap(this.simpleRetrigger);
        };
        tripleRedHotSevensIXFPopups.RetriggerScreen.prototype.showMaxRetrigger = function(payload) {
            this.maxRetrigger.getLabelById("popups_Fs_max_retrigger_amount").setText("" + payload.freespinsTotal);
            var freeSpinsAddedText;
            if (payload.freeSpinsAdded == 0) freeSpinsAddedText = this.getTextTranslated("popups_Fs_max_retrigger_noMoreFS");
            else freeSpinsAddedText = this.getTextTranslated("popups_Fs_max_retrigger_MoreFS", ["" + payload.freeSpinsAdded]);
            this.maxRetrigger.getLabelById("popups_Fs_max_retrigger_noMoreFS").setText(freeSpinsAddedText);
            this.maxRetrigger.show();
        };
        tripleRedHotSevensIXFPopups.RetriggerScreen.prototype.showSimpleRetrigger = function(payload) {
            this.simpleRetrigger.getLabelById("popups_Fs_retrigger_amount").setText("" + payload.freeSpinsAdded);
            this.simpleRetrigger.show();
        };
        tripleRedHotSevensIXFPopups.RetriggerScreen.prototype.hide = function() {
            this.hideBG();
            this.maxRetrigger.hide();
            this.simpleRetrigger.hide();
        };
        tripleRedHotSevensIXFPopups.RetriggerScreen.prototype.getTextTranslated = function(textId, valuesToShow) {
            return tripleRedHotSevensIXFPopups.ExternalService.translationManager.stringLookup(textId, valuesToShow);
        };
        tripleRedHotSevensIXFPopups.RetriggerScreen.prototype.__class__ = tripleRedHotSevensIXFPopups.RetriggerScreen;
        if (typeof haxe == 'undefined') {
            var haxe = {};
        };

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

            get: function(k) {
                return {
                    arguments: ["*"],
                    returns: "null"
                };
            }
        };
        tripleRedHotSevensIXFPopups.ExternalService.loadedAssets = new _hcmn_.haxe_ds_StringMap();;
        tripleRedHotSevensIXFPopups.Popups.PATH_POPUP_BASE = "popups-assets/";;
        tripleRedHotSevensIXFPopups.Popups.VB_MAIN_ID = "popups.viewbuilder.json";;
        tripleRedHotSevensIXFPopups.Popups.VB_POPUP_ANIMATIONS_ID = "popups_animation.viewbuilder.json";;
        tripleRedHotSevensIXFPopups.AwardCapScreen.TITLE_ID = "popups_AwardCap_title";;
        tripleRedHotSevensIXFPopups.AwardCapScreen.CONTENT_ID = "popups_AwardCap_content";;
        tripleRedHotSevensIXFPopups.AwardCapScreen.AMOUNT_ID = "popups_AwardCap_amount";;
        tripleRedHotSevensIXFPopups.AwardCapScreen.FRAME_ID = "popups_frame";;
        tripleRedHotSevensIXFPopups.AwardCapScreen.IS_FREESPINS_ID = "popups_AwardCap_isFreespins_finished";;
        tripleRedHotSevensIXFPopups.AwardCapScreen.labels = ["popups_AwardCap_title", "popups_AwardCap_content", "popups_AwardCap_amount", "popups_frame"];;
        tripleRedHotSevensIXFPopups.AwardCapScreen.labelsForFreeSpins = ["popups_AwardCap_isFreespins_finished"];;
        tripleRedHotSevensIXFPopups.FreeSpinIntroScreen.AMOUNT_ID = "popups_Fsintro_amount";;
        tripleRedHotSevensIXFPopups.FreeSpinIntroScreen.BUTTON_CONTAINER = "FREESPIN_BUTTON";;
        tripleRedHotSevensIXFPopups.FreeSpinIntroScreen.BUTTON_CLICK_TOPIC = "multipicker:choice";;
        tripleRedHotSevensIXFPopups.FreeSpinIntroScreen.BUTTON_READY_TOPIC = "multipicker:availablePicks";;
        tripleRedHotSevensIXFPopups.FreeSpinIntroScreen.CONGRATS_DURATION = 2500;;
        tripleRedHotSevensIXFPopups.FreeSpinOutroScreen.AMOUNT_ID = "popups_FsOutro_winAmount";;
        tripleRedHotSevensIXFPopups.RetriggerScreen.MAX_AMOUNT_ID = "popups_Fs_max_retrigger_amount";;
        tripleRedHotSevensIXFPopups.RetriggerScreen.AMOUNT_ID = "popups_Fs_retrigger_amount";;
        tripleRedHotSevensIXFPopups.RetriggerScreen.NO_MORE_FS_ID = "popups_Fs_max_retrigger_noMoreFS";;
        tripleRedHotSevensIXFPopups.RetriggerScreen.MORE_FS_ID = "popups_Fs_max_retrigger_MoreFS";;
        return {
            exports: tripleRedHotSevensIXFPopups,
            activator: tripleRedHotSevensIXFPopups.Activator
        };
    });