define("smashthepigBanner", ["viewBuilderApi", "componentmodelComponentApi", "clientkernelLoaderApi", "displayEngineApi", "displayEngineUtils", "gameLayoutApi", "clientkernelEventbusApi", "smashThePigComponentsBannerDeclaration", "clientkernelModulesApi", "smashthepigComponentsBannerPort"],
    function(viewBuilderApi, componentmodelComponentApi, clientkernelLoaderApi, displayEngineApi, displayEngineUtils, gameLayoutApi, clientkernelEventbusApi, smashThePigComponentsBannerDeclaration, clientkernelModulesApi, smashthepigComponentsBannerPort) {
        "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 haxe == 'undefined') {
            var haxe = {};
        };

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

            get: function(k) {
                return {
                    arguments: ["*"],
                    returns: "null"
                };
            },
            set: function(k, v) {
                return {
                    arguments: ["*", "*"],
                    returns: "void"
                };
            }
        };
        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;
        if (typeof smashthepigBanner == 'undefined') {
            var smashthepigBanner = {};
        };
        smashthepigBanner.Activator = function(context) {};
        smashthepigBanner.Activator = ck_implements(smashthepigBanner.Activator, clientkernelModulesApi.IModuleActivator);
        smashthepigBanner.Activator.__interfaces__ = [clientkernelModulesApi.IModuleActivator];
        smashthepigBanner.Activator.__name__ = ["smashthepigBanner", "Activator"];
        smashthepigBanner.Activator.prototype.start = function(context) {
            context.getServiceTracker([viewBuilderApi.IViewBuilderFactory, clientkernelLoaderApi.IAssetRegistry, displayEngineApi.IDisplayProvider]).then(function(context1) {
                var vbf = context1.getAnyService(viewBuilderApi.IViewBuilderFactory, null);
                smashthepigBanner.ExternalService.initialize(context1, vbf);
                context1.registerService(new smashthepigBanner.BannerFactory(context1), smashThePigComponentsBannerDeclaration.BannerDeclaration, null);
            });
        };
        smashthepigBanner.Activator.prototype.stop = function(context) {};
        smashthepigBanner.Activator.main = function() {};
        smashthepigBanner.Activator.prototype.__class__ = smashthepigBanner.Activator;
        smashthepigBanner.Banner = function(context) {
            this.assetsLoaded = false;
            this.initialized = false;
            this.layoutPayload = null;
            this.DEFINITION_CONFIG_ID = "banner-assets/banner_definition_config.json";
            this.MAIN_CONFIG_ID = "banner-assets/banner.viewbuilder.json";
            this.COMPONENT_ID = "BANNER";
            var _g = this;
            console.log("[vp]Banner.new(context)");
            this.context = context;
            this.bannerPort = context.getImplementedPort(smashthepigComponentsBannerPort.IBannerImplementationPort);
            this.layoutPort = context.getUsedPort(gameLayoutApi.IGameLayoutPort);
            this.layoutPort.getUpdateComponentLayout().subscribe($bind(this, this.updateLayout));
            this.controller = new smashthepigBanner.BannerController(this);
            smashthepigBanner.ExternalService.assetRegistry.getAsset(this.MAIN_CONFIG_ID).getContent().then(function(vb) {
                smashthepigBanner.ExternalService.loadedAssets = vb;
                smashthepigBanner.ExternalService.assetRegistry.getAsset(_g.DEFINITION_CONFIG_ID).getContent().then(function(config) {
                    _g.assetsLoaded = true;
                    smashthepigBanner.ExternalService.loadedDefinitionConfig = config;
                    _g.initialize();
                });
            });
        };
        smashthepigBanner.Banner.__name__ = ["smashthepigBanner", "Banner"];
        smashthepigBanner.Banner.prototype.COMPONENT_ID = null;
        smashthepigBanner.Banner.prototype.MAIN_CONFIG_ID = null;
        smashthepigBanner.Banner.prototype.DEFINITION_CONFIG_ID = null;
        smashthepigBanner.Banner.prototype.view = null;
        smashthepigBanner.Banner.prototype.bannerPort = null;
        smashthepigBanner.Banner.prototype.layoutPort = null;
        smashthepigBanner.Banner.prototype.bannerComponent = null;
        smashthepigBanner.Banner.prototype.context = null;
        smashthepigBanner.Banner.prototype.controller = null;
        smashthepigBanner.Banner.prototype.layoutPayload = null;
        smashthepigBanner.Banner.prototype.initialized = null;
        smashthepigBanner.Banner.prototype.assetsLoaded = null;
        smashthepigBanner.Banner.prototype.portraitLogoMobile = null;
        smashthepigBanner.Banner.prototype.landscapeLogoMobile = null;
        smashthepigBanner.Banner.prototype.updateLayout = function(e) {
            this.layoutPayload = e.getPayload();
            if (!this.initialized) this.initialize();
            else {
                if (smashthepigBanner.ExternalService.isMobileGame()) {
                    var componentLayout = this.layoutPayload.containers.get(this.COMPONENT_ID);
                    var cfg = componentLayout.configuration;
                    if (cfg.dir == "left") {
                        this.landscapeLogoMobile.setVisible(true);
                        this.portraitLogoMobile.setVisible(false);
                    } else {
                        this.landscapeLogoMobile.setVisible(false);
                        this.portraitLogoMobile.setVisible(true);
                    }
                }
                this.controller.updateLayout(this.layoutPayload);
                this.layoutPort.getComponentLayoutUpdated().publish(this.context.getInstance());
            }
        };
        smashthepigBanner.Banner.prototype.initialize = function() {
            if (this.assetsLoaded && this.layoutPayload != null) {
                smashthepigBanner.BannerDefinition.initialize(smashthepigBanner.ExternalService.loadedDefinitionConfig);
                this.view = smashthepigBanner.ExternalService.viewBuilderFactory.createView(smashthepigBanner.ExternalService.loadedAssets);
                var container = this.view.getComponentById(this.COMPONENT_ID);
                if (container == null) throw new Error("Banner container (with BANNER id) not found in assets!");
                this.bannerComponent = new smashthepigBanner.BannerComponent(container);
                if (smashthepigBanner.ExternalService.isMobileGame()) {
                    var tempContainer = container.getComponentById("MESSAGES");
                    this.landscapeLogoMobile = tempContainer.getComponentById("staticLogoLandscape").getDisplayObject();
                    this.portraitLogoMobile = tempContainer.getComponentById("staticLogoPortrait").getDisplayObject();
                    var componentLayout = this.layoutPayload.containers.get(this.COMPONENT_ID);
                    var cfg = componentLayout.configuration;
                    if (cfg.dir == "left") {
                        this.landscapeLogoMobile.setVisible(true);
                        this.portraitLogoMobile.setVisible(false);
                    } else {
                        this.landscapeLogoMobile.setVisible(false);
                        this.portraitLogoMobile.setVisible(true);
                    }
                }
                this.controller.init();
                this.controller.updateLayout(this.layoutPayload);
                this.layoutPort.getComponentLayoutUpdated().publish(this.context.getInstance());
                this.initialized = true;
            }
        };
        smashthepigBanner.Banner.prototype.getBannerComponent = function() {
            return this.bannerComponent;
        };
        smashthepigBanner.Banner.prototype.__class__ = smashthepigBanner.Banner;
        smashthepigBanner.BannerFactory = function(context) {
            this.context = context;
        };
        smashthepigBanner.BannerFactory = ck_implements(smashthepigBanner.BannerFactory, clientkernelModulesApi.IService);
        smashthepigBanner.BannerFactory = ck_implements(smashthepigBanner.BannerFactory, componentmodelComponentApi.IComponentFactory);
        smashthepigBanner.BannerFactory.__interfaces__ = [clientkernelModulesApi.IService, componentmodelComponentApi.IComponentFactory];
        smashthepigBanner.BannerFactory.__name__ = ["smashthepigBanner", "BannerFactory"];
        smashthepigBanner.BannerFactory.prototype.context = null;
        smashthepigBanner.BannerFactory.prototype.getComponentDeclaration = function() {
            return smashThePigComponentsBannerDeclaration.BannerDeclaration;
        };
        smashthepigBanner.BannerFactory.prototype.createComponent = function(ccontext) {
            new smashthepigBanner.Banner(ccontext);
        };
        smashthepigBanner.BannerFactory.prototype.__class__ = smashthepigBanner.BannerFactory;
        smashthepigBanner.ExternalService = function() {};
        smashthepigBanner.ExternalService.__name__ = ["smashthepigBanner", "ExternalService"];
        smashthepigBanner.ExternalService.displayProvider = null;
        smashthepigBanner.ExternalService.assetRegistry = null;
        smashthepigBanner.ExternalService.viewBuilderFactory = null;
        smashthepigBanner.ExternalService.loadedAssets = null;
        smashthepigBanner.ExternalService.loadedDefinitionConfig = null;
        smashthepigBanner.ExternalService.variableRegistry = null;
        smashthepigBanner.ExternalService._moduleContext = null;
        smashthepigBanner.ExternalService.initialize = function(context, vbf) {
            smashthepigBanner.ExternalService.displayProvider = context.getAnyService(displayEngineApi.IDisplayProvider, null);
            smashthepigBanner.ExternalService.assetRegistry = context.getAnyService(clientkernelLoaderApi.IAssetRegistry, null);
            smashthepigBanner.ExternalService.variableRegistry = context.getAnyService(clientkernelLoaderApi.IVariableRegistry, null);
            smashthepigBanner.ExternalService.viewBuilderFactory = vbf;
            smashthepigBanner.ExternalService._moduleContext = context;
        };
        smashthepigBanner.ExternalService.isMobileGame = function() {
            return smashthepigBanner.ExternalService.variableRegistry.get("assetPack") == "mobile" || smashthepigBanner.ExternalService.variableRegistry.get("assetPack") == "tablet";
        };
        smashthepigBanner.ExternalService.getLanguage = function() {
            return smashthepigBanner.ExternalService.variableRegistry.get("language");
        };
        smashthepigBanner.ExternalService.prototype.__class__ = smashthepigBanner.ExternalService;

        smashthepigBanner.IBannerComponent = function() {}
        smashthepigBanner.IBannerComponent.prototype = {

            startPlayingGroup: function(group) {
                return {
                    arguments: ["string"],
                    returns: "void"
                };
            },
            pausePlayingGroup: function() {
                return {
                    arguments: [],
                    returns: "void"
                };
            },
            resumePlayingGroup: function() {
                return {
                    arguments: [],
                    returns: "void"
                };
            },
            stopPlayingGroup: function() {
                return {
                    arguments: [],
                    returns: "void"
                };
            },
            configure: function(cfg) {
                return {
                    arguments: ["*"],
                    returns: "void"
                };
            },
            setContentForFreespins: function(payload) {
                return {
                    arguments: ["*"],
                    returns: "void"
                };
            },
            stopAndPlayGroup: function(group) {
                return {
                    arguments: ["string"],
                    returns: "void"
                };
            }
        };
        smashthepigBanner.BannerComponent = function(container) {
            this.isPaused = false;
            this.isPlaying = false;
            console.log("[vp]BannerComponent.new(container)");
            this.container = container;
            this.msgsInitialized = new _hcmn_.haxe_ds_StringMap();
            this.initialize();
        };
        smashthepigBanner.BannerComponent = ck_implements(smashthepigBanner.BannerComponent, smashthepigBanner.IBannerComponent);
        smashthepigBanner.BannerComponent.__interfaces__ = [smashthepigBanner.IBannerComponent];
        smashthepigBanner.BannerComponent.__name__ = ["smashthepigBanner", "BannerComponent"];
        smashthepigBanner.BannerComponent.prototype.container = null;
        smashthepigBanner.BannerComponent.prototype.msgsInitialized = null;
        smashthepigBanner.BannerComponent.prototype.activeGroup = null;
        smashthepigBanner.BannerComponent.prototype.activeMsg = null;
        smashthepigBanner.BannerComponent.prototype.activeElement = null;
        smashthepigBanner.BannerComponent.prototype.activeProperties = null;
        smashthepigBanner.BannerComponent.prototype.activeTween = null;
        smashthepigBanner.BannerComponent.prototype.isPlaying = null;
        smashthepigBanner.BannerComponent.prototype.isPaused = null;
        smashthepigBanner.BannerComponent.prototype.freeSpinLabel = null;
        smashthepigBanner.BannerComponent.prototype.delayTimer = null;
        smashthepigBanner.BannerComponent.prototype.initialize = function() {
            var tempContainer = this.container.getComponentById("MESSAGES");
            var $it0 = smashthepigBanner.BannerDefinition.GROUP_ELEMENTS.keys();
            while ($it0.hasNext()) {
                var key = $it0.next();
                if (!smashthepigBanner.ExternalService.isMobileGame()) {
                    var _g = 0;
                    var _g1;
                    _g1 = _hcmn_.js_Boot.__cast(smashthepigBanner.BannerDefinition.GROUP_ELEMENTS.get(key), Array);
                    while (_g < _g1.length) {
                        var msg = _g1[_g];
                        ++_g;
                        var element = tempContainer.getComponentById(msg);
                        this.setProperties(element, key, msg);
                    }
                }
            }
        };
        smashthepigBanner.BannerComponent.prototype.setContentForFreespins = function(payload) {
            var tempContainer = this.container.getComponentById("MESSAGES");
            tempContainer = tempContainer.getComponentById(this.activeMsg);
            this.freeSpinLabel = tempContainer.getComponentById(payload.id);
            this.freeSpinLabel.setText(payload.text);
        };
        smashthepigBanner.BannerComponent.prototype.startGroupMessages = function(group) {
            this.activeGroup = group;
            this.activeMsg = (_hcmn_.js_Boot.__cast(smashthepigBanner.BannerDefinition.GROUP_ELEMENTS.get(group), Array))[0];
            this.activeElement = this.msgsInitialized.get(this.activeMsg);
            if (!smashthepigBanner.ExternalService.isMobileGame()) {
                var this1 = smashthepigBanner.BannerDefinition.ELEMENT_PROPERTIES.get(this.activeGroup);
                this.activeProperties = this1.get(this.activeMsg);
                this.activeTween = displayEngineUtils.TweenX.to(this.activeElement.getDisplayObject(), this.activeProperties.shown_properties, null, null, null, null, null, null, null, null, {
                    fileName: "BannerComponent.hx",
                    lineNumber: 74,
                    className: "smashthepig.components.banner.component.BannerComponent",
                    methodName: "startGroupMessages"
                });
                if ((_hcmn_.js_Boot.__cast(smashthepigBanner.BannerDefinition.GROUP_ELEMENTS.get(this.activeGroup), Array)).length > 1) this.delayTimer = _hcmn_.haxe_Timer.delay($bind(this, this.startTransitionOut), this.activeProperties.duration);
            }
            this.isPlaying = true;
        };
        smashthepigBanner.BannerComponent.prototype.transitionOut = function() {
            var easeMethod = (_hcmn_.js_Boot.__cast(this.activeProperties.easing, String)).split(".")[1];
            this.activeTween = displayEngineUtils.TweenX.to(this.activeElement.getDisplayObject(), this.activeProperties.hidden_properties, this.activeProperties.transitionOut, _hcmn_.Reflect.field(displayEngineUtils.EaseX, easeMethod), null, null, null, null, null, null, {
                fileName: "BannerComponent.hx",
                lineNumber: 84,
                className: "smashthepig.components.banner.component.BannerComponent",
                methodName: "transitionOut"
            });
        };
        smashthepigBanner.BannerComponent.prototype.startTransitionOut = function() {
            this.transitionOut();
            this.delayTimer = _hcmn_.haxe_Timer.delay($bind(this, this.stratTransitionIn), this.activeProperties.transitionOut - this.activeProperties.transitionOut / 4);
        };
        smashthepigBanner.BannerComponent.prototype.stratTransitionIn = function() {
            var groupArray;
            groupArray = _hcmn_.js_Boot.__cast(smashthepigBanner.BannerDefinition.GROUP_ELEMENTS.get(this.activeGroup), Array);
            var _g1 = 0;
            var _g = groupArray.length;
            while (_g1 < _g) {
                var i = _g1++;
                if (groupArray[i] == this.activeMsg) {
                    if (i == groupArray.length - 1) this.activeMsg = groupArray[0];
                    else this.activeMsg = groupArray[i + 1];
                    break;
                }
            }
            this.activeElement = this.msgsInitialized.get(this.activeMsg);
            var this1 = smashthepigBanner.BannerDefinition.ELEMENT_PROPERTIES.get(this.activeGroup);
            this.activeProperties = this1.get(this.activeMsg);
            var easeMethod = (_hcmn_.js_Boot.__cast(this.activeProperties.easing, String)).split(".")[1];
            this.activeTween = displayEngineUtils.TweenX.to(this.activeElement.getDisplayObject(), this.activeProperties.shown_properties, this.activeProperties.transitionIn, _hcmn_.Reflect.field(displayEngineUtils.EaseX, easeMethod), null, null, null, null, null, null, {
                fileName: "BannerComponent.hx",
                lineNumber: 110,
                className: "smashthepig.components.banner.component.BannerComponent",
                methodName: "stratTransitionIn"
            });
            this.delayTimer = _hcmn_.haxe_Timer.delay($bind(this, this.startTransitionOut), this.activeProperties.duration);
        };
        smashthepigBanner.BannerComponent.prototype.setProperties = function(element, key, msg) {
            if (!this.msgsInitialized.exists(msg)) {
                var properties;
                var this1 = smashthepigBanner.BannerDefinition.ELEMENT_PROPERTIES.get(key);
                properties = this1.get(msg);
                this.setDirection(properties, element, msg);
                element.setX(properties.posX);
                element.setY(properties.posY);
                displayEngineUtils.TweenX.to(element.getDisplayObject(), properties.hidden_properties, null, null, null, null, null, null, null, null, {
                    fileName: "BannerComponent.hx",
                    lineNumber: 120,
                    className: "smashthepig.components.banner.component.BannerComponent",
                    methodName: "setProperties"
                });
                this.msgsInitialized.set(msg, element);
            }
        };
        smashthepigBanner.BannerComponent.prototype.setDirection = function(directionProperties, element, key) {
            var orderString = "";
            var order = [];
            var tempDO;
            var tempElement = element;
            var startPosition = 0.00;
            if (_hcmn_.js_Boot.__instanceof(element, viewBuilderApi.IViewBuilderContainer)) {
                if (smashthepigBanner.BannerDefinition.ORDER_PROPERTIES.exists(key)) {
                    var this1 = smashthepigBanner.BannerDefinition.ORDER_PROPERTIES.get(key);
                    var key1 = smashthepigBanner.ExternalService.getLanguage();
                    orderString = this1.get(key1);
                    order = orderString.split("_");
                    var _g1 = 0;
                    var _g = order.length;
                    while (_g1 < _g) {
                        var i = _g1++;
                        tempDO = ((function($this) {
                            var $r;
                            var this2 = tempElement.getChildComponents();
                            $r = this2.get(order[i]);
                            return $r;
                        }(this))).getDisplayObject();
                        ((function($this) {
                            var $r;
                            var this3 = tempElement.getChildComponents();
                            $r = this3.get(order[i]);
                            return $r;
                        }(this))).getDisplayObject().setX(startPosition);
                        startPosition += ((function($this) {
                            var $r;
                            var this4 = tempElement.getChildComponents();
                            $r = this4.get(order[i]);
                            return $r;
                        }(this))).getDisplayObject().getWidth();
                    }
                }
            }
        };
        smashthepigBanner.BannerComponent.prototype.startPlayingGroup = function(group) {
            this.startGroupMessages(group);
        };
        smashthepigBanner.BannerComponent.prototype.stopPlayingGroup = function() {
            var _g = this;
            _hcmn_.haxe_Timer.delay(function() {
                _g.onStop();
            }, 30);
        };
        smashthepigBanner.BannerComponent.prototype.stopAndPlayGroup = function(group) {
            if (this.delayTimer != null) this.delayTimer.stop();
            this.activeTween["goto"](this.activeTween.get_totalTime(), false);
            this.activeTween.onFoot(($_ = this.activeTween, $bind($_, $_.stop)));
            this.activeTween.onHead(($_ = this.activeTween, $bind($_, $_.stop)));
            this.activeTween = null;
            this.activeElement.getDisplayObject().setAlpha(0);
            this.isPlaying = false;
            this.isPaused = false;
            this.startGroupMessages(group);
        };
        smashthepigBanner.BannerComponent.prototype.onStop = function(group) {
            if (this.isPlaying) {
                this.isPlaying = false;
                this.isPaused = false;
                if (this.delayTimer != null) this.delayTimer.stop();
                if (this.activeTween != null) this.activeTween.stop();
                if (this.activeElement != null) this.activeElement.getDisplayObject().setAlpha(0);
                this.transitionOut();
            }
        };
        smashthepigBanner.BannerComponent.prototype.pausePlayingGroup = function() {
            _hcmn_.haxe_Timer.delay($bind(this, this.onPause), 30);
        };
        smashthepigBanner.BannerComponent.prototype.onPause = function() {
            if (!this.isPaused && this.isPlaying) {
                this.delayTimer.stop();
                this.activeTween.stop();
                this.isPlaying = false;
                this.isPaused = true;
            }
        };
        smashthepigBanner.BannerComponent.prototype.resumePlayingGroup = function() {
            _hcmn_.haxe_Timer.delay($bind(this, this.onResume), 30);
        };
        smashthepigBanner.BannerComponent.prototype.onResume = function() {
            if (this.isPaused && !this.isPlaying) {
                this.delayTimer.run();
                this.activeTween.play();
                this.isPlaying = true;
                this.isPaused = false;
            }
        };
        smashthepigBanner.BannerComponent.prototype.configure = function(cfg) {};
        smashthepigBanner.BannerComponent.prototype.__class__ = smashthepigBanner.BannerComponent;
        smashthepigBanner.BannerController = function(banner) {
            this.flag_addedToStage = false;
            console.log("[vp]BannerController.new(banner)");
            this.banner = banner;
        };
        smashthepigBanner.BannerController.__name__ = ["smashthepigBanner", "BannerController"];
        smashthepigBanner.BannerController.prototype.banner = null;
        smashthepigBanner.BannerController.prototype.flag_addedToStage = null;
        smashthepigBanner.BannerController.prototype.updateLayout = function(layoutPayload) {
            var $it0 = layoutPayload.containers.keys();
            while ($it0.hasNext()) {
                var layerId = $it0.next();
                var layerPayload = layoutPayload.containers.get(layerId);
                var cfg = layerPayload.configuration;
                var stage;
                var this1 = smashthepigBanner.ExternalService.displayProvider.getStages();
                stage = this1.get(layerPayload.stage);
                var container = this.banner.view.getComponentById(layerId);
                var containerDO = container.getDisplayObject();
                containerDO.setCacheAsBitmap(false);
                if (!this.flag_addedToStage) stage.addChild(containerDO);
                containerDO.setX(layerPayload.left);
                containerDO.setY(layerPayload.top);
                containerDO.setScaleX(layerPayload.width / containerDO.getUserData().viewBuilderW);
                containerDO.setScaleY(layerPayload.height / containerDO.getUserData().viewBuilderH);
                containerDO.setZIndex(layerPayload.zIndex);
                if (cfg == null) continue;
                this.banner.getBannerComponent().configure(cfg);
            }
            if (!this.flag_addedToStage) this.flag_addedToStage = true;
        };
        smashthepigBanner.BannerController.prototype.init = function() {
            this.banner.bannerPort.startPlayingGroup().subscribe($bind(this, this.onStartPlayingGroup));
            this.banner.bannerPort.pausePlayingGroup().subscribe($bind(this, this.onPausePlayingGroup));
            this.banner.bannerPort.stopPlayingGroup().subscribe($bind(this, this.onStopPlayingGroup));
            this.banner.bannerPort.resumePlayingGroup().subscribe($bind(this, this.onResumePlayingGroup));
            this.banner.bannerPort.setContentForFreespins().subscribe($bind(this, this.onSetContentForFreespins));
            this.banner.bannerPort.stopAndPlayGroup().subscribe($bind(this, this.onStopAndPlayGroup));
        };
        smashthepigBanner.BannerController.prototype.onStopAndPlayGroup = function(e) {
            this.banner.getBannerComponent().stopAndPlayGroup(e.getPayload());
        };
        smashthepigBanner.BannerController.prototype.onSetContentForFreespins = function(e) {
            this.banner.getBannerComponent().setContentForFreespins(e.getPayload());
        };
        smashthepigBanner.BannerController.prototype.onPausePlayingGroup = function(e) {
            this.banner.getBannerComponent().pausePlayingGroup();
        };
        smashthepigBanner.BannerController.prototype.onResumePlayingGroup = function(e) {
            this.banner.getBannerComponent().resumePlayingGroup();
        };
        smashthepigBanner.BannerController.prototype.onStartPlayingGroup = function(e) {
            this.banner.getBannerComponent().startPlayingGroup(e.getPayload());
        };
        smashthepigBanner.BannerController.prototype.onStopPlayingGroup = function(e) {
            this.banner.getBannerComponent().stopPlayingGroup();
        };
        smashthepigBanner.BannerController.prototype.__class__ = smashthepigBanner.BannerController;
        smashthepigBanner.BannerDefinition = function() {};
        smashthepigBanner.BannerDefinition.__name__ = ["smashthepigBanner", "BannerDefinition"];
        smashthepigBanner.BannerDefinition.GROUPS_ARRAY = null;
        smashthepigBanner.BannerDefinition.GROUP_PROPERTIES = null;
        smashthepigBanner.BannerDefinition.GROUP_ELEMENTS = null;
        smashthepigBanner.BannerDefinition.ELEMENT_PROPERTIES = null;
        smashthepigBanner.BannerDefinition.ORDER_PROPERTIES = null;
        smashthepigBanner.BannerDefinition.initialize = function(loadedDefinitionConfig) {
            smashthepigBanner.BannerDefinition.GROUPS_ARRAY = [];
            smashthepigBanner.BannerDefinition.GROUP_PROPERTIES = new _hcmn_.haxe_ds_StringMap();
            smashthepigBanner.BannerDefinition.GROUP_ELEMENTS = new _hcmn_.haxe_ds_StringMap();
            smashthepigBanner.BannerDefinition.ELEMENT_PROPERTIES = new _hcmn_.haxe_ds_StringMap();
            smashthepigBanner.BannerDefinition.ORDER_PROPERTIES = new _hcmn_.haxe_ds_StringMap();
            var _g = 0;
            var _g1 = _hcmn_.Reflect.fields(loadedDefinitionConfig.groups);
            while (_g < _g1.length) {
                var element = _g1[_g];
                ++_g;
                smashthepigBanner.BannerDefinition.GROUPS_ARRAY.push(_hcmn_.Reflect.field(loadedDefinitionConfig.groups, element));
            }
            var _g2 = 0;
            var _g11 = smashthepigBanner.BannerDefinition.GROUPS_ARRAY;
            while (_g2 < _g11.length) {
                var element1 = _g11[_g2];
                ++_g2;
                var value = _hcmn_.Reflect.getProperty(loadedDefinitionConfig, element1);
                smashthepigBanner.BannerDefinition.GROUP_PROPERTIES.set(element1, value);
            }
            var $it0 = smashthepigBanner.BannerDefinition.GROUP_PROPERTIES.keys();
            while ($it0.hasNext()) {
                var key = $it0.next();
                var value1 = [];
                smashthepigBanner.BannerDefinition.GROUP_ELEMENTS.set(key, value1);
                var _g3 = 0;
                var _g12 = _hcmn_.Reflect.fields(smashthepigBanner.BannerDefinition.GROUP_PROPERTIES.get(key).elements);
                while (_g3 < _g12.length) {
                    var element2 = _g12[_g3];
                    ++_g3;
                    smashthepigBanner.BannerDefinition.GROUP_ELEMENTS.get(key).push(_hcmn_.Reflect.getProperty(smashthepigBanner.BannerDefinition.GROUP_PROPERTIES.get(key).elements, element2));
                }
            }
            var $it1 = smashthepigBanner.BannerDefinition.GROUP_ELEMENTS.keys();
            while ($it1.hasNext()) {
                var key1 = $it1.next();
                var value2 = new _hcmn_.haxe_ds_StringMap();
                smashthepigBanner.BannerDefinition.ELEMENT_PROPERTIES.set(key1, value2);
                var _g4 = 0;
                var _g13;
                _g13 = _hcmn_.js_Boot.__cast(smashthepigBanner.BannerDefinition.GROUP_ELEMENTS.get(key1), Array);
                while (_g4 < _g13.length) {
                    var element3 = _g13[_g4];
                    ++_g4;
                    var this1 = smashthepigBanner.BannerDefinition.ELEMENT_PROPERTIES.get(key1);
                    var key2 = element3;
                    var value3 = _hcmn_.Reflect.getProperty(smashthepigBanner.BannerDefinition.GROUP_PROPERTIES.get(key1), element3);
                    this1.set(key2, value3);
                }
            }
            var _g5 = 0;
            var _g14 = _hcmn_.Reflect.fields(loadedDefinitionConfig.directions);
            while (_g5 < _g14.length) {
                var message = _g14[_g5];
                ++_g5;
                var value4 = new _hcmn_.haxe_ds_StringMap();
                smashthepigBanner.BannerDefinition.ORDER_PROPERTIES.set(message, value4);
                var _g21 = 0;
                var _g31 = _hcmn_.Reflect.fields(loadedDefinitionConfig.directions[message]);
                while (_g21 < _g31.length) {
                    var order = _g31[_g21];
                    ++_g21;
                    var this2 = smashthepigBanner.BannerDefinition.ORDER_PROPERTIES.get(message);
                    this2.set(order, loadedDefinitionConfig.directions[message][order]);
                }
            }
        };
        smashthepigBanner.BannerDefinition.prototype.__class__ = smashthepigBanner.BannerDefinition;
        return {
            exports: smashthepigBanner,
            activator: smashthepigBanner.Activator
        };
    });
//# sourceURL=smashThePigBanner.js