define("icywildsComponentsWincap", ["viewBuilderApi", "componentmodelComponentApi", "icyWildsComponentsWincapPort", "translationmanagerApi", "clientkernelLoaderApi", "displayEngineApi", "gameLayoutApi", "icyWildsComponentsWincapDeclaration", "clientkernelEventbusApi", "clientkernelModulesApi"],
    function(viewBuilderApi, componentmodelComponentApi, icyWildsComponentsWincapPort, translationmanagerApi, clientkernelLoaderApi, displayEngineApi, gameLayoutApi, icyWildsComponentsWincapDeclaration, clientkernelEventbusApi, clientkernelModulesApi) {
        "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"
                };
            },
            keys: function() {
                return {
                    arguments: [],
                    returns: "null"
                };
            }
        };
        if (!haxe._Int64) {
            haxe._Int64 = {};
        };
        haxe._Int64.___Int64 = function(high, low) {
            this.high = high;
            this.low = low;
        };
        haxe._Int64.___Int64.__name__ = ["haxe", "_Int64", "___Int64"];
        haxe._Int64.___Int64.prototype.high = null;
        haxe._Int64.___Int64.prototype.low = null;
        haxe._Int64.___Int64.prototype.__class__ = haxe._Int64.___Int64;
        haxe.Log = function() {};
        haxe.Log.__name__ = ["haxe", "Log"];
        haxe.Log.trace = function(v, infos) {
            _hcmn_.js_Boot.__trace(v, infos);
        };
        haxe.Log.prototype.__class__ = haxe.Log;
        if (!haxe.io) {
            haxe.io = {};
        };
        haxe.io.Error = {
            __ename__: ["haxe", "io", "Error"],
            __constructs__: ["Blocked", "Overflow", "OutsideBounds", "Custom"]
        };
        haxe.io.Error.Custom = function(e) {
            var $x = ["Custom", 3, e];
            $x.__enum__ = haxe.io.Error;
            $x.toString = $estr;
            return $x;
        };
        haxe.io.Error.Blocked = ["Blocked", 0];
        haxe.io.Error.Blocked.toString = $estr;
        haxe.io.Error.Blocked.__enum__ = haxe.io.Error;
        haxe.io.Error.Overflow = ["Overflow", 1];
        haxe.io.Error.Overflow.toString = $estr;
        haxe.io.Error.Overflow.__enum__ = haxe.io.Error;
        haxe.io.Error.OutsideBounds = ["OutsideBounds", 2];
        haxe.io.Error.OutsideBounds.toString = $estr;
        haxe.io.Error.OutsideBounds.__enum__ = haxe.io.Error;
        haxe.io.FPHelper = function() {};
        haxe.io.FPHelper.__name__ = ["haxe", "io", "FPHelper"];
        haxe.io.FPHelper.i32ToFloat = function(i) {
            var sign = 1 - (i >>> 31 << 1);
            var exp = i >>> 23 & 255;
            var sig = i & 8388607;
            if (sig == 0 && exp == 0) return 0.0;
            return sign * (1 + _hcmn_.Math.pow(2, -23) * sig) * _hcmn_.Math.pow(2, exp - 127);
        };
        haxe.io.FPHelper.floatToI32 = function(f) {
            if (f == 0) return 0;
            var af;
            if (f < 0) af = -f;
            else af = f;
            var exp = _hcmn_.Math.floor(_hcmn_.Math.log(af) / 0.6931471805599453);
            if (exp < -127) exp = -127;
            else if (exp > 128) exp = 128;
            var sig = _hcmn_.Math.round((af / _hcmn_.Math.pow(2, exp) - 1) * 8388608) & 8388607;
            return (f < 0 ? -2147483648 : 0) | exp + 127 << 23 | sig;
        };
        haxe.io.FPHelper.i64ToDouble = function(low, high) {
            var sign = 1 - (high >>> 31 << 1);
            var exp = (high >> 20 & 2047) - 1023;
            var sig = (high & 1048575) * 4294967296. + (low >>> 31) * 2147483648. + (low & 2147483647);
            if (sig == 0 && exp == -1023) return 0.0;
            return sign * (1.0 + _hcmn_.Math.pow(2, -52) * sig) * _hcmn_.Math.pow(2, exp);
        };
        haxe.io.FPHelper.doubleToI64 = function(v) {
            var i64 = haxe.io.FPHelper.i64tmp;
            if (v == 0) {
                i64.low = 0;
                i64.high = 0;
            } else {
                var av;
                if (v < 0) av = -v;
                else av = v;
                var exp = _hcmn_.Math.floor(_hcmn_.Math.log(av) / 0.6931471805599453);
                var sig;
                var v1 = (av / _hcmn_.Math.pow(2, exp) - 1) * 4503599627370496.;
                sig = _hcmn_.Math.round(v1);
                var sig_l = sig | 0;
                var sig_h = sig / 4294967296.0 | 0;
                i64.low = sig_l;
                i64.high = (v < 0 ? -2147483648 : 0) | exp + 1023 << 20 | sig_h;
            }
            return i64;
        };
        haxe.io.FPHelper.prototype.__class__ = haxe.io.FPHelper;
        if (typeof icywildsComponentsWincap == 'undefined') {
            var icywildsComponentsWincap = {};
        };
        icywildsComponentsWincap.Activator = function(context) {};
        icywildsComponentsWincap.Activator = ck_implements(icywildsComponentsWincap.Activator, clientkernelModulesApi.IModuleActivator);
        icywildsComponentsWincap.Activator.__interfaces__ = [clientkernelModulesApi.IModuleActivator];
        icywildsComponentsWincap.Activator.__name__ = ["icywildsComponentsWincap", "Activator"];
        icywildsComponentsWincap.Activator.prototype.start = function(context) {
            context.getServiceTracker([viewBuilderApi.IViewBuilderFactory, clientkernelLoaderApi.IAssetRegistry, displayEngineApi.IDisplayProvider]).then(function(context1) {
                var vbf = context1.getAnyService(viewBuilderApi.IViewBuilderFactory, null);
                icywildsComponentsWincap.ExternalService.initialize(context1, vbf);
                context1.registerService(new icywildsComponentsWincap.WinCapFactory(context1), icyWildsComponentsWincapDeclaration.WinCapDeclaration, null);
            });
        };
        icywildsComponentsWincap.Activator.prototype.stop = function(context) {};
        icywildsComponentsWincap.Activator.main = function() {};
        icywildsComponentsWincap.Activator.prototype.__class__ = icywildsComponentsWincap.Activator;
        icywildsComponentsWincap.ExternalService = function() {};
        icywildsComponentsWincap.ExternalService.__name__ = ["icywildsComponentsWincap", "ExternalService"];
        icywildsComponentsWincap.ExternalService.displayProvider = null;
        icywildsComponentsWincap.ExternalService.assetRegistry = null;
        icywildsComponentsWincap.ExternalService.viewBuilderFactory = null;
        icywildsComponentsWincap.ExternalService.loadedCallback = null;
        icywildsComponentsWincap.ExternalService._moduleContext = null;
        icywildsComponentsWincap.ExternalService.initialize = function(context, vbf) {
            haxe.Log.trace("[ds]WinCapExternalService.initialize(context,vbf)", {
                fileName: "ExternalService.hx",
                lineNumber: 31,
                className: "icywilds.components.wincap.ExternalService",
                methodName: "initialize"
            });
            icywildsComponentsWincap.ExternalService._moduleContext = context;
            icywildsComponentsWincap.ExternalService.displayProvider = context.getAnyService(displayEngineApi.IDisplayProvider, null);
            icywildsComponentsWincap.ExternalService.assetRegistry = context.getAnyService(clientkernelLoaderApi.IAssetRegistry, null);
            icywildsComponentsWincap.ExternalService.viewBuilderFactory = vbf;
        };
        icywildsComponentsWincap.ExternalService.loadVBAssets = function(id, loadedCallback) {
            haxe.Log.trace("mv Animation loadVBAssets(" + id + ")", {
                fileName: "ExternalService.hx",
                lineNumber: 40,
                className: "icywilds.components.wincap.ExternalService",
                methodName: "loadVBAssets"
            });
            icywildsComponentsWincap.ExternalService.loadedCallback = loadedCallback;
            icywildsComponentsWincap.ExternalService.loading++;
            icywildsComponentsWincap.ExternalService.assetRegistry.getAsset(id).getContent().then(function(vba) {
                icywildsComponentsWincap.ExternalService.loadedAssets.set(id, vba);
                icywildsComponentsWincap.ExternalService.ceheckLoaded();
            });
        };
        icywildsComponentsWincap.ExternalService.ceheckLoaded = function() {
            icywildsComponentsWincap.ExternalService.totalLoaded++;
            haxe.Log.trace("mv Animation ceheckLoaded(" + icywildsComponentsWincap.ExternalService.totalLoaded + "/" + icywildsComponentsWincap.ExternalService.loading + ")", {
                fileName: "ExternalService.hx",
                lineNumber: 51,
                className: "icywilds.components.wincap.ExternalService",
                methodName: "ceheckLoaded"
            });
            if (icywildsComponentsWincap.ExternalService.totalLoaded == icywildsComponentsWincap.ExternalService.loading) icywildsComponentsWincap.ExternalService.loadedCallback();
        };
        icywildsComponentsWincap.ExternalService.getTranslationService = function() {
            return icywildsComponentsWincap.ExternalService._moduleContext.getAnyService(translationmanagerApi.ITranslationManager);
        };
        icywildsComponentsWincap.ExternalService.prototype.__class__ = icywildsComponentsWincap.ExternalService;
        icywildsComponentsWincap.WinCap = function(context) {
            this.numAssetsLoaded = 0;
            this.assetsLoaded = false;
            this.initialized = false;
            this.layoutPayload = null;
            haxe.Log.trace("[ds]WinCap.new(context)", {
                fileName: "WinCap.hx",
                lineNumber: 45,
                className: "icywilds.components.wincap.WinCap",
                methodName: "new"
            });
            this.context = context;
            this.wincapPort = context.getImplementedPort(icyWildsComponentsWincapPort.IWinCapImplementationPort);
            this.layoutPort = context.getUsedPort(gameLayoutApi.IGameLayoutPort);
            this.layoutPort.getUpdateComponentLayout().subscribe($bind(this, this.updateLayout));
            this.controller = new icywildsComponentsWincap.WinCapController(this);
            icywildsComponentsWincap.ExternalService.loadVBAssets(icywildsComponentsWincap.WinCap.MAIN_CONFIG_ID, $bind(this, this.loadedAsset));
            icywildsComponentsWincap.ExternalService.loadVBAssets(icywildsComponentsWincap.WinCap.POPUP_ASSET_BG_ID, $bind(this, this.loadedAsset));
            icywildsComponentsWincap.ExternalService.loadVBAssets(icywildsComponentsWincap.WinCap.POPUP_ASSET_ID, $bind(this, this.loadedAsset));
            icywildsComponentsWincap.ExternalService.loadVBAssets(icywildsComponentsWincap.WinCap.POPUP_BTN_ID, $bind(this, this.loadedAsset));
        };
        icywildsComponentsWincap.WinCap.__name__ = ["icywildsComponentsWincap", "WinCap"];
        icywildsComponentsWincap.WinCap.prototype.view = null;
        icywildsComponentsWincap.WinCap.prototype.wincapPort = null;
        icywildsComponentsWincap.WinCap.prototype.layoutPort = null;
        icywildsComponentsWincap.WinCap.prototype.wincapComponent = null;
        icywildsComponentsWincap.WinCap.prototype.context = null;
        icywildsComponentsWincap.WinCap.prototype.controller = null;
        icywildsComponentsWincap.WinCap.prototype.layoutPayload = null;
        icywildsComponentsWincap.WinCap.prototype.initialized = null;
        icywildsComponentsWincap.WinCap.prototype.assetsLoaded = null;
        icywildsComponentsWincap.WinCap.prototype.numAssetsLoaded = null;
        icywildsComponentsWincap.WinCap.prototype.loadedAsset = function() {
            this.assetsLoaded = true;
            this.initialize();
        };
        icywildsComponentsWincap.WinCap.prototype.updateLayout = function(e) {
            haxe.Log.trace("[ds]WinCap.updateLayout(e)", {
                fileName: "WinCap.hx",
                lineNumber: 65,
                className: "icywilds.components.wincap.WinCap",
                methodName: "updateLayout"
            });
            this.layoutPayload = e.getPayload();
            if (!this.initialized) this.initialize();
            else {
                this.controller.updateLayout(this.layoutPayload);
                this.layoutPort.getComponentLayoutUpdated().publish(this.context.getInstance());
            }
        };
        icywildsComponentsWincap.WinCap.prototype.initialize = function() {
            haxe.Log.trace("[ds]WinCap.initialize()", {
                fileName: "WinCap.hx",
                lineNumber: 77,
                className: "icywilds.components.wincap.WinCap",
                methodName: "initialize"
            });
            if (this.assetsLoaded && this.layoutPayload != null) {
                haxe.Log.trace("[ds]WinCap.initialize()-true", {
                    fileName: "WinCap.hx",
                    lineNumber: 80,
                    className: "icywilds.components.wincap.WinCap",
                    methodName: "initialize"
                });
                this.view = icywildsComponentsWincap.ExternalService.viewBuilderFactory.createView(icywildsComponentsWincap.ExternalService.loadedAssets.get(icywildsComponentsWincap.WinCap.MAIN_CONFIG_ID));
                var container = this.view.getComponentById(icywildsComponentsWincap.WinCap.COMPONENT_ID);
                if (container == null) throw new Error("WinCap container (with WinCap id) not found in assets!");
                this.wincapComponent = new icywildsComponentsWincap.WinCapComponent(container);
                this.controller.init();
                this.controller.updateLayout(this.layoutPayload);
                this.layoutPort.getComponentLayoutUpdated().publish(this.context.getInstance());
                this.initialized = true;
            }
        };
        icywildsComponentsWincap.WinCap.prototype.getWinCapComponent = function() {
            haxe.Log.trace("[ds]WinCap.getBannerComponent()", {
                fileName: "WinCap.hx",
                lineNumber: 99,
                className: "icywilds.components.wincap.WinCap",
                methodName: "getWinCapComponent"
            });
            return this.wincapComponent;
        };
        icywildsComponentsWincap.WinCap.prototype.__class__ = icywildsComponentsWincap.WinCap;
        icywildsComponentsWincap.WinCapFactory = function(context) {
            this.context = context;
        };
        icywildsComponentsWincap.WinCapFactory = ck_implements(icywildsComponentsWincap.WinCapFactory, clientkernelModulesApi.IService);
        icywildsComponentsWincap.WinCapFactory = ck_implements(icywildsComponentsWincap.WinCapFactory, componentmodelComponentApi.IComponentFactory);
        icywildsComponentsWincap.WinCapFactory.__interfaces__ = [clientkernelModulesApi.IService, componentmodelComponentApi.IComponentFactory];
        icywildsComponentsWincap.WinCapFactory.__name__ = ["icywildsComponentsWincap", "WinCapFactory"];
        icywildsComponentsWincap.WinCapFactory.prototype.context = null;
        icywildsComponentsWincap.WinCapFactory.prototype.getComponentDeclaration = function() {
            return icyWildsComponentsWincapDeclaration.WinCapDeclaration;
        };
        icywildsComponentsWincap.WinCapFactory.prototype.createComponent = function(ccontext) {
            new icywildsComponentsWincap.WinCap(ccontext);
        };
        icywildsComponentsWincap.WinCapFactory.prototype.__class__ = icywildsComponentsWincap.WinCapFactory;

        icywildsComponentsWincap.IWinCapComponent = function() {}
        icywildsComponentsWincap.IWinCapComponent.prototype = {

            configure: function(cfg) {
                return {
                    arguments: ["*"],
                    returns: "void"
                };
            },
            getEvents: function() {
                return {
                    arguments: [],
                    returns: "*"
                };
            },
            show: function() {
                return {
                    arguments: [],
                    returns: "void"
                };
            },
            hide: function() {
                return {
                    arguments: [],
                    returns: "void"
                };
            }
        };
        icywildsComponentsWincap.WinCapComponent = function(container) {
            this._hideDelay = 5000;
            haxe.Log.trace("[ds]WinCapComponent.new(container)", {
                fileName: "WinCapComponent.hx",
                lineNumber: 44,
                className: "icywilds.components.wincap.component.WinCapComponent",
                methodName: "new"
            });
            this.mainContainer = container;
            this.events = new icywildsComponentsWincap.WinCapScreenEvents();
            this.msgsInitialized = new _hcmn_.haxe_ds_StringMap();
            this.translationManager = icywildsComponentsWincap.ExternalService.getTranslationService();
            this.initialize();
        };
        icywildsComponentsWincap.WinCapComponent = ck_implements(icywildsComponentsWincap.WinCapComponent, icywildsComponentsWincap.IWinCapComponent);
        icywildsComponentsWincap.WinCapComponent.__interfaces__ = [icywildsComponentsWincap.IWinCapComponent];
        icywildsComponentsWincap.WinCapComponent.__name__ = ["icywildsComponentsWincap", "WinCapComponent"];
        icywildsComponentsWincap.WinCapComponent.prototype.containerAsset = null;
        icywildsComponentsWincap.WinCapComponent.prototype.mainContainer = null;
        icywildsComponentsWincap.WinCapComponent.prototype.btnSkin = null;
        icywildsComponentsWincap.WinCapComponent.prototype.btnContainer = null;
        icywildsComponentsWincap.WinCapComponent.prototype.freeGameIntroContainer = null;
        icywildsComponentsWincap.WinCapComponent.prototype.freeGameIntroContainerContent = null;
        icywildsComponentsWincap.WinCapComponent.prototype.freeGameIntroAnimationHolder = null;
        icywildsComponentsWincap.WinCapComponent.prototype.freeGameIntroAnimation = null;
        icywildsComponentsWincap.WinCapComponent.prototype.events = null;
        icywildsComponentsWincap.WinCapComponent.prototype.msgsInitialized = null;
        icywildsComponentsWincap.WinCapComponent.prototype.translationManager = null;
        icywildsComponentsWincap.WinCapComponent.prototype._hideDelay = null;
        icywildsComponentsWincap.WinCapComponent.prototype.initialize = function() {
            haxe.Log.trace("[ds]WinCapComponent.initialize()", {
                fileName: "WinCapComponent.hx",
                lineNumber: 55,
                className: "icywilds.components.wincap.component.WinCapComponent",
                methodName: "initialize"
            });
            var vbAsset = icywildsComponentsWincap.ExternalService.loadedAssets.get(icywildsComponentsWincap.WinCap.POPUP_ASSET_ID);
            var vbCont = icywildsComponentsWincap.ExternalService.viewBuilderFactory.createView(vbAsset);
            var introInContainer = vbCont.getComponentById("INTRO_IN_CONTAINER");
            this.freeGameIntroContainer = introInContainer.createContainerFromStoredConfig("FreeGameIntroContainer");
            this.mainContainer.addChildComponent(this.freeGameIntroContainer, "FreeGameIntroContainer");
            this.freeGameIntroAnimationHolder = _hcmn_.js_Boot.__cast(this.freeGameIntroContainer.getComponentById("FREE_GAME_INTRO"), viewBuilderApi.IViewBuilderContainer);
            this.containerAsset = icywildsComponentsWincap.ExternalService.loadedAssets.get(icywildsComponentsWincap.WinCap.POPUP_ASSET_BG_ID);
            var vbAnimView;
            vbAnimView = _hcmn_.js_Boot.__cast(icywildsComponentsWincap.ExternalService.viewBuilderFactory.createView(this.containerAsset), viewBuilderApi.IViewBuilderContainer);
            var vbdbAniamtionHolder;
            vbdbAniamtionHolder = _hcmn_.js_Boot.__cast(vbAnimView.createContainerFromStoredConfig("ANIMATION_HOLDER"), viewBuilderApi.IViewBuilderContainer);
            this.freeGameIntroAnimation = _hcmn_.js_Boot.__cast(vbdbAniamtionHolder.getComponentById("ANIMATION_CONTENT"), viewBuilderApi.IVBAnimationComponent);
            this.freeGameIntroAnimation.show();
            this.freeGameIntroAnimationHolder.addChildComponent(this.freeGameIntroAnimation, icywildsComponentsWincap.WinCap.POPUP_ASSET_BG_ID);
            this.freeGameIntroAnimation.gotoAndPlay(true, "intro");
            this.freeGameIntroContainerContent = _hcmn_.js_Boot.__cast(this.freeGameIntroContainer.getComponentById("PanelContentContainer"), viewBuilderApi.IViewBuilderContainer);
            var labelsContainer = this.freeGameIntroContainerContent.getComponentById("Labels");
            this.setLabelData(labelsContainer);
            this.freeGameIntroContainerContent.show();
            this.btnContainer = _hcmn_.js_Boot.__cast(this.freeGameIntroContainerContent.getComponentById("StartButtonContainer"), viewBuilderApi.IViewBuilderContainer);
            var vbAsset1 = icywildsComponentsWincap.ExternalService.loadedAssets.get(icywildsComponentsWincap.WinCap.POPUP_BTN_ID);
            if (vbAsset1 != null) {
                var startBtnAnimHolder;
                startBtnAnimHolder = _hcmn_.js_Boot.__cast(this.btnContainer.getComponentById("StartButtonSkin"), viewBuilderApi.IViewBuilderContainer);
                var vbAnimView1 = icywildsComponentsWincap.ExternalService.viewBuilderFactory.createView(vbAsset1);
                var vbdbAniamtionHolder1;
                vbdbAniamtionHolder1 = _hcmn_.js_Boot.__cast(vbAnimView1.createContainerFromStoredConfig("ANIMATION_HOLDER"), viewBuilderApi.IViewBuilderContainer);
                this.btnSkin = _hcmn_.js_Boot.__cast(vbdbAniamtionHolder1.getComponentById("ANIMATION_CONTENT"), viewBuilderApi.IVBAnimationComponent);
                startBtnAnimHolder.addChildComponent(this.btnSkin, "START_BUTTON" + "_VB");
                var btn;
                btn = _hcmn_.js_Boot.__cast(this.btnContainer.getComponentById("StartButtonMask"), viewBuilderApi.IButton);
                btn.getEvents().DOWN().addListener($bind(this, this.onCloseClicked));
                btn.getEvents().OVER().addListener($bind(this, this.onStartOver));
                btn.getEvents().OUT().addListener($bind(this, this.onStartOut));
                this.btnSkin.gotoAndPlay(true, "enabled");
                this.btnContainer.hide();
            }
            this.hide();
        };
        icywildsComponentsWincap.WinCapComponent.prototype.setProperties = function(element, key, msg) {
            haxe.Log.trace("[ds]WinCapComponent.setProperties(element,key,msg)", {
                fileName: "WinCapComponent.hx",
                lineNumber: 112,
                className: "icywilds.components.wincap.component.WinCapComponent",
                methodName: "setProperties"
            });
        };
        icywildsComponentsWincap.WinCapComponent.prototype.setLabelData = function(labelsContainer) {
            var $it0 = (function($this) {
                var $r;
                var this1 = labelsContainer.getChildComponents();
                $r = this1.keys();
                return $r;
            }(this));
            while ($it0.hasNext()) {
                var key = $it0.next();
                var label = labelsContainer.getComponentById(key);
                label.setText("");
            }
            var labelYouHave = labelsContainer.getComponentById("title");
            labelYouHave.setText(this.translationManager.stringLookup("YouHaveReached"));
            var labelAwardCap = labelsContainer.getComponentById("label2");
            labelAwardCap.setText(this.translationManager.stringLookup("AwardCap"));
        };
        icywildsComponentsWincap.WinCapComponent.prototype.configure = function(cfg) {
            haxe.Log.trace("[ds]WinCapComponent.configure(cfg)-cfg" + _hcmn_.Std.string(cfg), {
                fileName: "WinCapComponent.hx",
                lineNumber: 132,
                className: "icywilds.components.wincap.component.WinCapComponent",
                methodName: "configure"
            });
        };
        icywildsComponentsWincap.WinCapComponent.prototype.show = function() {
            this.mainContainer.show();
            _hcmn_.haxe_Timer.delay($bind(this, this.closePopup), this._hideDelay);
        };
        icywildsComponentsWincap.WinCapComponent.prototype.hide = function() {
            this.mainContainer.hide();
        };
        icywildsComponentsWincap.WinCapComponent.prototype.onCloseClicked = function(e) {
            this.btnSkin.gotoAndStop(true, "down");
            this.closePopup();
        };
        icywildsComponentsWincap.WinCapComponent.prototype.closePopup = function() {
            this.events.BUTTON_CLICKED().dispatch();
            this.freeGameIntroAnimation.gotoAndPlay(true, "outro");
            this.hide();
        };
        icywildsComponentsWincap.WinCapComponent.prototype.onStartOver = function(e) {
            this.btnSkin.gotoAndStop(true, "over");
        };
        icywildsComponentsWincap.WinCapComponent.prototype.onStartOut = function(e) {
            this.btnSkin.gotoAndPlay(true, "enabled");
        };
        icywildsComponentsWincap.WinCapComponent.prototype.getEvents = function() {
            return this.events;
        };
        icywildsComponentsWincap.WinCapComponent.prototype.__class__ = icywildsComponentsWincap.WinCapComponent;
        icywildsComponentsWincap.WinCapController = function(wincap) {
            this.flag_addedToStage = false;
            haxe.Log.trace("[ds]WinCapController.new(wincap)", {
                fileName: "WinCapController.hx",
                lineNumber: 21,
                className: "icywilds.components.wincap.controller.WinCapController",
                methodName: "new"
            });
            this.wincap = wincap;
        };
        icywildsComponentsWincap.WinCapController.__name__ = ["icywildsComponentsWincap", "WinCapController"];
        icywildsComponentsWincap.WinCapController.prototype.wincap = null;
        icywildsComponentsWincap.WinCapController.prototype.flag_addedToStage = null;
        icywildsComponentsWincap.WinCapController.prototype.updateLayout = function(layoutPayload) {
            haxe.Log.trace("[ds]WinCapController.updateLayout(layoutPayload)" + _hcmn_.Std.string(layoutPayload), {
                fileName: "WinCapController.hx",
                lineNumber: 26,
                className: "icywilds.components.wincap.controller.WinCapController",
                methodName: "updateLayout"
            });
            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 = icywildsComponentsWincap.ExternalService.displayProvider.getStages();
                stage = this1.get(layerPayload.stage);
                var container = this.wincap.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;
                haxe.Log.trace("[ds]WinCapController.updateLayout(layoutPayload)--> RECONFIGURE COMPONENTS", {
                    fileName: "WinCapController.hx",
                    lineNumber: 48,
                    className: "icywilds.components.wincap.controller.WinCapController",
                    methodName: "updateLayout",
                    customParams: [cfg]
                });
                this.wincap.getWinCapComponent().configure(cfg);
            }
            if (!this.flag_addedToStage) {
                this.flag_addedToStage = true;
                haxe.Log.trace("[ds]WinCapController.updateLayout(layoutPayload)", {
                    fileName: "WinCapController.hx",
                    lineNumber: 54,
                    className: "icywilds.components.wincap.controller.WinCapController",
                    methodName: "updateLayout",
                    customParams: ["[flag_addedToStage]"]
                });
            }
        };
        icywildsComponentsWincap.WinCapController.prototype.init = function() {
            haxe.Log.trace("[ds]WinCapController.init()", {
                fileName: "WinCapController.hx",
                lineNumber: 62,
                className: "icywilds.components.wincap.controller.WinCapController",
                methodName: "init"
            });
            this.wincap.wincapPort.getShowMessage().subscribe($bind(this, this.onShowMessage));
            this.wincap.getWinCapComponent().getEvents().BUTTON_CLICKED().addListener($bind(this, this.onCloseClicked));
        };
        icywildsComponentsWincap.WinCapController.prototype.onShowMessage = function(e) {
            haxe.Log.trace("[ds]WinCapController.onShowMessage(e)", {
                fileName: "WinCapController.hx",
                lineNumber: 70,
                className: "icywilds.components.wincap.controller.WinCapController",
                methodName: "onShowMessage"
            });
            this.wincap.getWinCapComponent().show();
        };
        icywildsComponentsWincap.WinCapController.prototype.onCloseClicked = function(e) {
            haxe.Log.trace("[im] (Animation) onFreeGameIntroButtonClicked" + e, {
                fileName: "WinCapController.hx",
                lineNumber: 75,
                className: "icywilds.components.wincap.controller.WinCapController",
                methodName: "onCloseClicked"
            });
            this.wincap.wincapPort.getClosedMessage().publish(null);
        };
        icywildsComponentsWincap.WinCapController.prototype.__class__ = icywildsComponentsWincap.WinCapController;
        icywildsComponentsWincap.BaseEvent = function() {
            this._signal = new _hcmn_.msignal_Signal1();
        };
        icywildsComponentsWincap.BaseEvent.__name__ = ["icywildsComponentsWincap", "BaseEvent"];
        icywildsComponentsWincap.BaseEvent.prototype._signal = null;
        icywildsComponentsWincap.BaseEvent.prototype.addListener = function(listener) {
            this._signal.add(listener);
        };
        icywildsComponentsWincap.BaseEvent.prototype.removeListener = function(listener) {
            this._signal.remove(listener);
        };
        icywildsComponentsWincap.BaseEvent.prototype.dispatch = function(data) {
            this._signal.dispatch(data);
        };
        icywildsComponentsWincap.BaseEvent.prototype.__class__ = icywildsComponentsWincap.BaseEvent;
        icywildsComponentsWincap.WinCapScreenEvents = function() {
            this.buttonClicked = new icywildsComponentsWincap.BaseEvent();
            this.animationEnded = new icywildsComponentsWincap.BaseEvent();
        };
        icywildsComponentsWincap.WinCapScreenEvents.__name__ = ["icywildsComponentsWincap", "WinCapScreenEvents"];
        icywildsComponentsWincap.WinCapScreenEvents.prototype.buttonClicked = null;
        icywildsComponentsWincap.WinCapScreenEvents.prototype.animationEnded = null;
        icywildsComponentsWincap.WinCapScreenEvents.prototype.BUTTON_CLICKED = function() {
            return this.buttonClicked;
        };
        icywildsComponentsWincap.WinCapScreenEvents.prototype.ANIMATION_ENDED = function() {
            return this.animationEnded;
        };
        icywildsComponentsWincap.WinCapScreenEvents.prototype.__class__ = icywildsComponentsWincap.WinCapScreenEvents;
        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 (!js.html) {
            js.html = {};
        };
        if (!js.html.compat) {
            js.html.compat = {};
        };
        js.html.compat.ArrayBuffer = function(a) {
            if ((a instanceof Array) && a.__enum__ == null) {
                this.a = a;
                this.byteLength = a.length;
            } else {
                var len = a;
                this.a = [];
                var _g = 0;
                while (_g < len) {
                    var i = _g++;
                    this.a[i] = 0;
                }
                this.byteLength = len;
            }
        };
        js.html.compat.ArrayBuffer.__name__ = ["js", "html", "compat", "ArrayBuffer"];
        js.html.compat.ArrayBuffer.prototype.byteLength = null;
        js.html.compat.ArrayBuffer.prototype.a = null;
        js.html.compat.ArrayBuffer.prototype.slice = function(begin, end) {
            return new js.html.compat.ArrayBuffer(this.a.slice(begin, end));
        };
        js.html.compat.ArrayBuffer.sliceImpl = function(begin, end) {
            var u = new Uint8Array(this, begin, end == null ? null : end - begin);
            var result = new ArrayBuffer(u.byteLength);
            var resultArray = new Uint8Array(result);
            resultArray.set(u);
            return result;
        };
        js.html.compat.ArrayBuffer.prototype.__class__ = js.html.compat.ArrayBuffer;
        js.html.compat.DataView = function(buffer, byteOffset, byteLength) {
            this.buf = buffer;
            if (byteOffset == null) this.offset = 0;
            else this.offset = byteOffset;
            if (byteLength == null) this.length = buffer.byteLength - this.offset;
            else this.length = byteLength;
            if (this.offset < 0 || this.length < 0 || this.offset + this.length > buffer.byteLength) throw new js._Boot.HaxeError(haxe.io.Error.OutsideBounds);
        };
        js.html.compat.DataView.__name__ = ["js", "html", "compat", "DataView"];
        js.html.compat.DataView.prototype.buf = null;
        js.html.compat.DataView.prototype.offset = null;
        js.html.compat.DataView.prototype.length = null;
        js.html.compat.DataView.prototype.getInt8 = function(byteOffset) {
            var v = this.buf.a[this.offset + byteOffset];
            if (v >= 128) return v - 256;
            else return v;
        };
        js.html.compat.DataView.prototype.getUint8 = function(byteOffset) {
            return this.buf.a[this.offset + byteOffset];
        };
        js.html.compat.DataView.prototype.getInt16 = function(byteOffset, littleEndian) {
            var v = this.getUint16(byteOffset, littleEndian);
            if (v >= 32768) return v - 65536;
            else return v;
        };
        js.html.compat.DataView.prototype.getUint16 = function(byteOffset, littleEndian) {
            if (littleEndian) return this.buf.a[this.offset + byteOffset] | this.buf.a[this.offset + byteOffset + 1] << 8;
            else return this.buf.a[this.offset + byteOffset] << 8 | this.buf.a[this.offset + byteOffset + 1];
        };
        js.html.compat.DataView.prototype.getInt32 = function(byteOffset, littleEndian) {
            var p = this.offset + byteOffset;
            var a = this.buf.a[p++];
            var b = this.buf.a[p++];
            var c = this.buf.a[p++];
            var d = this.buf.a[p++];
            if (littleEndian) return a | b << 8 | c << 16 | d << 24;
            else return d | c << 8 | b << 16 | a << 24;
        };
        js.html.compat.DataView.prototype.getUint32 = function(byteOffset, littleEndian) {
            var v = this.getInt32(byteOffset, littleEndian);
            if (v < 0) return v + 4294967296.;
            else return v;
        };
        js.html.compat.DataView.prototype.getFloat32 = function(byteOffset, littleEndian) {
            return haxe.io.FPHelper.i32ToFloat(this.getInt32(byteOffset, littleEndian));
        };
        js.html.compat.DataView.prototype.getFloat64 = function(byteOffset, littleEndian) {
            var a = this.getInt32(byteOffset, littleEndian);
            var b = this.getInt32(byteOffset + 4, littleEndian);
            return haxe.io.FPHelper.i64ToDouble(littleEndian ? a : b, littleEndian ? b : a);
        };
        js.html.compat.DataView.prototype.setInt8 = function(byteOffset, value) {
            if (value < 0) this.buf.a[byteOffset + this.offset] = value + 128 & 255;
            else this.buf.a[byteOffset + this.offset] = value & 255;
        };
        js.html.compat.DataView.prototype.setUint8 = function(byteOffset, value) {
            this.buf.a[byteOffset + this.offset] = value & 255;
        };
        js.html.compat.DataView.prototype.setInt16 = function(byteOffset, value, littleEndian) {
            this.setUint16(byteOffset, value < 0 ? value + 65536 : value, littleEndian);
        };
        js.html.compat.DataView.prototype.setUint16 = function(byteOffset, value, littleEndian) {
            var p = byteOffset + this.offset;
            if (littleEndian) {
                this.buf.a[p] = value & 255;
                this.buf.a[p++] = value >> 8 & 255;
            } else {
                this.buf.a[p++] = value >> 8 & 255;
                this.buf.a[p] = value & 255;
            }
        };
        js.html.compat.DataView.prototype.setInt32 = function(byteOffset, value, littleEndian) {
            this.setUint32(byteOffset, value, littleEndian);
        };
        js.html.compat.DataView.prototype.setUint32 = function(byteOffset, value, littleEndian) {
            var p = byteOffset + this.offset;
            if (littleEndian) {
                this.buf.a[p++] = value & 255;
                this.buf.a[p++] = value >> 8 & 255;
                this.buf.a[p++] = value >> 16 & 255;
                this.buf.a[p++] = value >>> 24;
            } else {
                this.buf.a[p++] = value >>> 24;
                this.buf.a[p++] = value >> 16 & 255;
                this.buf.a[p++] = value >> 8 & 255;
                this.buf.a[p++] = value & 255;
            }
        };
        js.html.compat.DataView.prototype.setFloat32 = function(byteOffset, value, littleEndian) {
            this.setUint32(byteOffset, haxe.io.FPHelper.floatToI32(value), littleEndian);
        };
        js.html.compat.DataView.prototype.setFloat64 = function(byteOffset, value, littleEndian) {
            var i64 = haxe.io.FPHelper.doubleToI64(value);
            if (littleEndian) {
                this.setUint32(byteOffset, i64.low);
                this.setUint32(byteOffset, i64.high);
            } else {
                this.setUint32(byteOffset, i64.high);
                this.setUint32(byteOffset, i64.low);
            }
        };
        js.html.compat.DataView.prototype.__class__ = js.html.compat.DataView;
        js.html.compat.Uint8Array = function() {};
        js.html.compat.Uint8Array.__name__ = ["js", "html", "compat", "Uint8Array"];
        js.html.compat.Uint8Array._new = function(arg1, offset, length) {
            var arr;
            if (typeof(arg1) == "number") {
                arr = [];
                var _g = 0;
                while (_g < arg1) {
                    var i = _g++;
                    arr[i] = 0;
                }
                arr.byteLength = arr.length;
                arr.byteOffset = 0;
                arr.buffer = new js.html.compat.ArrayBuffer(arr);
            } else if (_hcmn_.js_Boot.__instanceof(arg1, js.html.compat.ArrayBuffer)) {
                var buffer = arg1;
                if (offset == null) offset = 0;
                if (length == null) length = buffer.byteLength - offset;
                if (offset == 0) arr = buffer.a;
                else arr = buffer.a.slice(offset, offset + length);
                arr.byteLength = arr.length;
                arr.byteOffset = offset;
                arr.buffer = buffer;
            } else if ((arg1 instanceof Array) && arg1.__enum__ == null) {
                arr = arg1.slice();
                arr.byteLength = arr.length;
                arr.byteOffset = 0;
                arr.buffer = new js.html.compat.ArrayBuffer(arr);
            } else throw new js._Boot.HaxeError("TODO " + _hcmn_.Std.string(arg1));
            arr.subarray = js.html.compat.Uint8Array._subarray;
            arr.set = js.html.compat.Uint8Array._set;
            return arr;
        };
        js.html.compat.Uint8Array._set = function(arg, offset) {
            var t = this;
            if (_hcmn_.js_Boot.__instanceof(arg.buffer, js.html.compat.ArrayBuffer)) {
                var a = arg;
                if (arg.byteLength + offset > t.byteLength) throw new js._Boot.HaxeError("set() outside of range");
                var _g1 = 0;
                var _g = arg.byteLength;
                while (_g1 < _g) {
                    var i = _g1++;
                    t[i + offset] = a[i];
                }
            } else if ((arg instanceof Array) && arg.__enum__ == null) {
                var a1 = arg;
                if (a1.length + offset > t.byteLength) throw new js._Boot.HaxeError("set() outside of range");
                var _g11 = 0;
                var _g2 = a1.length;
                while (_g11 < _g2) {
                    var i1 = _g11++;
                    t[i1 + offset] = a1[i1];
                }
            } else throw new js._Boot.HaxeError("TODO");
        };
        js.html.compat.Uint8Array._subarray = function(start, end) {
            var t = this;
            var a = js.html.compat.Uint8Array._new(t.slice(start, end));
            a.byteOffset = start;
            return a;
        };
        js.html.compat.Uint8Array.prototype.__class__ = js.html.compat.Uint8Array; {
            var ArrayBuffer = (Function("return typeof ArrayBuffer != 'undefined' ? ArrayBuffer : null"))() || js.html.compat.ArrayBuffer;
            if (ArrayBuffer.prototype.slice == null) ArrayBuffer.prototype.slice = js.html.compat.ArrayBuffer.sliceImpl;
        };
        var DataView = (Function("return typeof DataView != 'undefined' ? DataView : null"))() || js.html.compat.DataView;
        var Uint8Array = (Function("return typeof Uint8Array != 'undefined' ? Uint8Array : null"))() || js.html.compat.Uint8Array._new;
        haxe.io.FPHelper.i64tmp = (function($this) {
            var $r;
            var x = new haxe._Int64.___Int64(0, 0);
            $r = x;
            return $r;
        }(this));;
        icywildsComponentsWincap.ExternalService.loadedAssets = new _hcmn_.haxe_ds_StringMap();;
        icywildsComponentsWincap.ExternalService.loading = 0;;
        icywildsComponentsWincap.ExternalService.totalLoaded = 0;;
        icywildsComponentsWincap.WinCap.MAIN_CONFIG_ID = "wincap";;
        icywildsComponentsWincap.WinCap.COMPONENT_ID = "WIN_CAP";;
        icywildsComponentsWincap.WinCap.POPUP_ASSET_BG_ID = "FREE_GAME_INTRO_VB";;
        icywildsComponentsWincap.WinCap.POPUP_BTN_ID = "START_BUTTON_VB";;
        icywildsComponentsWincap.WinCap.POPUP_ASSET_ID = "free_spin_panels_config_json";;
        icywildsComponentsWincap.WinCapComponent.ANIMATION_ID = "FREE_GAME_INTRO";;
        icywildsComponentsWincap.WinCapComponent.START_BUTTON_ID = "START_BUTTON";;
        js.html.compat.Uint8Array.BYTES_PER_ELEMENT = 1;;
        return {
            exports: icywildsComponentsWincap,
            activator: icywildsComponentsWincap.Activator
        };
    });
//# sourceURL=icyWildsWinCap.js