define("winlines", ["viewBuilderApi", "componentmodelComponentApi", "clientkernelLoaderApi", "slotModelApi", "uiHelper", "displayEngineApi", "clientkernelTestableApi", "gameLayoutApi", "PIXI", "wildFuryWinLinesApi", "BABYLON", "clientkernelEventbusApi", "clientkernelModulesApi", "tools"],
    function(viewBuilderApi, componentmodelComponentApi, clientkernelLoaderApi, slotModelApi, uiHelper, displayEngineApi, clientkernelTestableApi, gameLayoutApi, PIXI, wildFuryWinLinesApi, BABYLON, clientkernelEventbusApi, clientkernelModulesApi, tools) {
        "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, '');
        };
        var Type = function() {};
        Type.__name__ = ["Type"];
        Type.createInstance = function(cl, args) {
            var _g = args.length;
            switch (_g) {
                case 0:
                    return new cl();
                case 1:
                    return new cl(args[0]);
                case 2:
                    return new cl(args[0], args[1]);
                case 3:
                    return new cl(args[0], args[1], args[2]);
                case 4:
                    return new cl(args[0], args[1], args[2], args[3]);
                case 5:
                    return new cl(args[0], args[1], args[2], args[3], args[4]);
                case 6:
                    return new cl(args[0], args[1], args[2], args[3], args[4], args[5]);
                case 7:
                    return new cl(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
                case 8:
                    return new cl(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7]);
                default:
                    throw new js._Boot.HaxeError("Too many arguments");
            }
            return null;
        };
        Type.createEnum = function(e, constr, params) {
            var f = _hcmn_.Reflect.field(e, constr);
            if (f == null) throw new js._Boot.HaxeError("No such constructor " + constr);
            if (_hcmn_.Reflect.isFunction(f)) {
                if (params == null) throw new js._Boot.HaxeError("Constructor " + constr + " need parameters");
                return _hcmn_.Reflect.callMethod(e, f, params);
            }
            if (params != null && params.length != 0) throw new js._Boot.HaxeError("Constructor " + constr + " does not need parameters");
            return f;
        };
        Type.getEnumConstructs = function(e) {
            var a = e.__constructs__;
            return a.slice();
        };
        Type.prototype.__class__ = Type;
        if (typeof haxe == 'undefined') {
            var haxe = {};
        };

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

            get: function(k) {
                return {
                    arguments: ["*"],
                    returns: "null"
                };
            },
            exists: function(k) {
                return {
                    arguments: ["*"],
                    returns: "boolean"
                };
            },
            keys: function() {
                return {
                    arguments: [],
                    returns: "null"
                };
            }
        };
        if (!haxe.ds) {
            haxe.ds = {};
        };
        haxe.ds.BalancedTree = function() {};
        haxe.ds.BalancedTree.__name__ = ["haxe", "ds", "BalancedTree"];
        haxe.ds.BalancedTree.prototype.root = null;
        haxe.ds.BalancedTree.prototype.set = function(key, value) {
            this.root = this.setLoop(key, value, this.root);
        };
        haxe.ds.BalancedTree.prototype.get = function(key) {
            var node = this.root;
            while (node != null) {
                var c = this.compare(key, node.key);
                if (c == 0) return node.value;
                if (c < 0) node = node.left;
                else node = node.right;
            }
            return null;
        };
        haxe.ds.BalancedTree.prototype.exists = function(key) {
            var node = this.root;
            while (node != null) {
                var c = this.compare(key, node.key);
                if (c == 0) return true;
                else if (c < 0) node = node.left;
                else node = node.right;
            }
            return false;
        };
        haxe.ds.BalancedTree.prototype.keys = function() {
            var ret = [];
            this.keysLoop(this.root, ret);
            return _hcmn_.HxOverrides.iter(ret);
        };
        haxe.ds.BalancedTree.prototype.setLoop = function(k, v, node) {
            if (node == null) return new haxe.ds.TreeNode(null, k, v, null);
            var c = this.compare(k, node.key);
            if (c == 0) return new haxe.ds.TreeNode(node.left, k, v, node.right, node == null ? 0 : node._height);
            else if (c < 0) {
                var nl = this.setLoop(k, v, node.left);
                return this.balance(nl, node.key, node.value, node.right);
            } else {
                var nr = this.setLoop(k, v, node.right);
                return this.balance(node.left, node.key, node.value, nr);
            }
        };
        haxe.ds.BalancedTree.prototype.keysLoop = function(node, acc) {
            if (node != null) {
                this.keysLoop(node.left, acc);
                acc.push(node.key);
                this.keysLoop(node.right, acc);
            }
        };
        haxe.ds.BalancedTree.prototype.balance = function(l, k, v, r) {
            var hl;
            if (l == null) hl = 0;
            else hl = l._height;
            var hr;
            if (r == null) hr = 0;
            else hr = r._height;
            if (hl > hr + 2) {
                if ((function($this) {
                        var $r;
                        var _this = l.left;
                        $r = _this == null ? 0 : _this._height;
                        return $r;
                    }(this)) >= (function($this) {
                        var $r;
                        var _this1 = l.right;
                        $r = _this1 == null ? 0 : _this1._height;
                        return $r;
                    }(this))) return new haxe.ds.TreeNode(l.left, l.key, l.value, new haxe.ds.TreeNode(l.right, k, v, r));
                else return new haxe.ds.TreeNode(new haxe.ds.TreeNode(l.left, l.key, l.value, l.right.left), l.right.key, l.right.value, new haxe.ds.TreeNode(l.right.right, k, v, r));
            } else if (hr > hl + 2) {
                if ((function($this) {
                        var $r;
                        var _this2 = r.right;
                        $r = _this2 == null ? 0 : _this2._height;
                        return $r;
                    }(this)) > (function($this) {
                        var $r;
                        var _this3 = r.left;
                        $r = _this3 == null ? 0 : _this3._height;
                        return $r;
                    }(this))) return new haxe.ds.TreeNode(new haxe.ds.TreeNode(l, k, v, r.left), r.key, r.value, r.right);
                else return new haxe.ds.TreeNode(new haxe.ds.TreeNode(l, k, v, r.left.left), r.left.key, r.left.value, new haxe.ds.TreeNode(r.left.right, r.key, r.value, r.right));
            } else return new haxe.ds.TreeNode(l, k, v, r, (hl > hr ? hl : hr) + 1);
        };
        haxe.ds.BalancedTree.prototype.compare = function(k1, k2) {
            return _hcmn_.Reflect.compare(k1, k2);
        };
        haxe.ds.BalancedTree.prototype.__class__ = haxe.ds.BalancedTree;
        haxe.ds.TreeNode = function(l, k, v, r, h) {
            if (h == null) h = -1;
            this.left = l;
            this.key = k;
            this.value = v;
            this.right = r;
            if (h == -1) this._height = ((function($this) {
                var $r;
                var _this = $this.left;
                $r = _this == null ? 0 : _this._height;
                return $r;
            }(this)) > (function($this) {
                var $r;
                var _this1 = $this.right;
                $r = _this1 == null ? 0 : _this1._height;
                return $r;
            }(this)) ? (function($this) {
                var $r;
                var _this2 = $this.left;
                $r = _this2 == null ? 0 : _this2._height;
                return $r;
            }(this)) : (function($this) {
                var $r;
                var _this3 = $this.right;
                $r = _this3 == null ? 0 : _this3._height;
                return $r;
            }(this))) + 1;
            else this._height = h;
        };
        haxe.ds.TreeNode.__name__ = ["haxe", "ds", "TreeNode"];
        haxe.ds.TreeNode.prototype.left = null;
        haxe.ds.TreeNode.prototype.right = null;
        haxe.ds.TreeNode.prototype.key = null;
        haxe.ds.TreeNode.prototype.value = null;
        haxe.ds.TreeNode.prototype._height = null;
        haxe.ds.TreeNode.prototype.__class__ = haxe.ds.TreeNode;
        haxe.ds.EnumValueMap = function() {
            haxe.ds.BalancedTree.call(this);
        };
        haxe.ds.EnumValueMap.__interfaces__ = [haxe.IMap];
        haxe.ds.EnumValueMap.__name__ = ["haxe", "ds", "EnumValueMap"];
        haxe.ds.EnumValueMap.__super__ = haxe.ds.BalancedTree;
        for (var k in haxe.ds.BalancedTree.prototype) haxe.ds.EnumValueMap.prototype[k] = haxe.ds.BalancedTree.prototype[k];
        haxe.ds.EnumValueMap.prototype.compare = function(k1, k2) {
            var d = k1[1] - k2[1];
            if (d != 0) return d;
            var p1 = k1.slice(2);
            var p2 = k2.slice(2);
            if (p1.length == 0 && p2.length == 0) return 0;
            return this.compareArgs(p1, p2);
        };
        haxe.ds.EnumValueMap.prototype.compareArgs = function(a1, a2) {
            var ld = a1.length - a2.length;
            if (ld != 0) return ld;
            var _g1 = 0;
            var _g = a1.length;
            while (_g1 < _g) {
                var i = _g1++;
                var d = this.compareArg(a1[i], a2[i]);
                if (d != 0) return d;
            }
            return 0;
        };
        haxe.ds.EnumValueMap.prototype.compareArg = function(v1, v2) {
            if (_hcmn_.Reflect.isEnumValue(v1) && _hcmn_.Reflect.isEnumValue(v2)) return this.compare(v1, v2);
            else if ((v1 instanceof Array) && v1.__enum__ == null && ((v2 instanceof Array) && v2.__enum__ == null)) return this.compareArgs(v1, v2);
            else return _hcmn_.Reflect.compare(v1, v2);
        };
        haxe.ds.EnumValueMap.prototype.__class__ = haxe.ds.EnumValueMap;
        if (!haxe.ds._StringMap) {
            haxe.ds._StringMap = {};
        };
        haxe.ds._StringMap.StringMapIterator = function(map, keys) {
            this.map = map;
            this.keys = keys;
            this.index = 0;
            this.count = keys.length;
        };
        haxe.ds._StringMap.StringMapIterator.__name__ = ["haxe", "ds", "_StringMap", "StringMapIterator"];
        haxe.ds._StringMap.StringMapIterator.prototype.map = null;
        haxe.ds._StringMap.StringMapIterator.prototype.keys = null;
        haxe.ds._StringMap.StringMapIterator.prototype.index = null;
        haxe.ds._StringMap.StringMapIterator.prototype.count = null;
        haxe.ds._StringMap.StringMapIterator.prototype.hasNext = function() {
            return this.index < this.count;
        };
        haxe.ds._StringMap.StringMapIterator.prototype.next = function() {
            return this.map.get(this.keys[this.index++]);
        };
        haxe.ds._StringMap.StringMapIterator.prototype.__class__ = haxe.ds._StringMap.StringMapIterator;
        if (typeof js == 'undefined') {
            var js = {};
        };
        if (!js._Boot) {
            js._Boot = {};
        };
        js._Boot.HaxeError = function(val) {
            Error.call(this);
            this.val = val;
            this.message = String(val);
            if (Error.captureStackTrace) Error.captureStackTrace(this, js._Boot.HaxeError);
        };
        js._Boot.HaxeError.__name__ = ["js", "_Boot", "HaxeError"];
        js._Boot.HaxeError.__super__ = Error;
        for (var k in Error.prototype) js._Boot.HaxeError.prototype[k] = Error.prototype[k];
        js._Boot.HaxeError.prototype.val = null;
        js._Boot.HaxeError.prototype.__class__ = js._Boot.HaxeError;
        if (typeof winlines == 'undefined') {
            var winlines = {};
        };
        winlines.Activator = function(context) {};
        winlines.Activator = ck_implements(winlines.Activator, clientkernelModulesApi.IModuleActivator);
        winlines.Activator.__interfaces__ = [clientkernelModulesApi.IModuleActivator];
        winlines.Activator.__name__ = ["winlines", "Activator"];
        winlines.Activator.prototype.start = function(context) {
            context.getServiceTracker([displayEngineApi.IDisplayProvider, clientkernelTestableApi.ITestable, viewBuilderApi.IViewBuilderFactory]).then(function(context1) {
                winlines.ExternalService.initialize(context1);
                var factory = context1.getAnyService(viewBuilderApi.IViewBuilderFactory, null);
                winlines.ExternalService.viewBuilderFactory = factory;
                context1.registerService(new winlines.WinLinesFactory(factory), wildFuryWinLinesApi.WinLinesDeclaration, null);
            });
        };
        winlines.Activator.prototype.stop = function(context) {};
        winlines.Activator.main = function() {};
        winlines.Activator.prototype.__class__ = winlines.Activator;
        winlines.Component = {
            __ename__: ["winlines", "Component"],
            __constructs__: ["EXPANDING_WILD", "WIN_SYMBOLS", "WIN_FRAMES", "SYMBOLS_GLOW"]
        };
        winlines.Component.WIN_FRAMES = ["WIN_FRAMES", 2];
        winlines.Component.WIN_FRAMES.toString = $estr;
        winlines.Component.WIN_FRAMES.__enum__ = winlines.Component;
        winlines.Component.WIN_SYMBOLS = ["WIN_SYMBOLS", 1];
        winlines.Component.WIN_SYMBOLS.toString = $estr;
        winlines.Component.WIN_SYMBOLS.__enum__ = winlines.Component;
        winlines.Component.SYMBOLS_GLOW = ["SYMBOLS_GLOW", 3];
        winlines.Component.SYMBOLS_GLOW.toString = $estr;
        winlines.Component.SYMBOLS_GLOW.__enum__ = winlines.Component;
        winlines.Component.EXPANDING_WILD = ["EXPANDING_WILD", 0];
        winlines.Component.EXPANDING_WILD.toString = $estr;
        winlines.Component.EXPANDING_WILD.__enum__ = winlines.Component;
        winlines.ExternalService = function() {};
        winlines.ExternalService.__name__ = ["winlines", "ExternalService"];
        winlines.ExternalService.componentContext = null;
        winlines.ExternalService.displayProvider = null;
        winlines.ExternalService.assetRegistry = null;
        winlines.ExternalService.testableLogger = null;
        winlines.ExternalService.viewBuilderFactory = null;
        winlines.ExternalService.bus = null;
        winlines.ExternalService.busChanel = null;
        winlines.ExternalService.loadedCallback = null;
        winlines.ExternalService.initialize = function(context) {
            winlines.ExternalService.displayProvider = context.getAnyService(displayEngineApi.IDisplayProvider, null);
            winlines.ExternalService.assetRegistry = context.getAnyService(clientkernelLoaderApi.IAssetRegistry, null);
            var testable = context.getAnyService(clientkernelTestableApi.ITestable, null);
            winlines.ExternalService.testableLogger = testable.getLogger(context);
            winlines.ExternalService.bus = context.getAnyService(clientkernelEventbusApi.IEventBus, null);
            winlines.ExternalService.busChanel = winlines.ExternalService.bus.getChannel("GFBus");
        };
        winlines.ExternalService.loadConfig = function(configId, configCallback) {
            winlines.ExternalService.assetRegistry.getAsset(configId).getContent().then(function(data) {
                configCallback(data);
            });
        };
        winlines.ExternalService.loadVBAssetsInGroup = function(groupId) {
            if (!winlines.ExternalService.loadedCallbacks.exists(groupId)) {
                var value = new winlines.Loader(groupId, winlines.ExternalService.assetRegistry, winlines.ExternalService.loadedAssets);
                winlines.ExternalService.loadedCallbacks.set(groupId, value);
            }
            return winlines.ExternalService.loadedCallbacks.get(groupId);
        };
        winlines.ExternalService.checkLoaded = function(id) {
            winlines.ExternalService.totalLoaded++;
            if (winlines.ExternalService.totalLoaded == winlines.ExternalService.loading) winlines.ExternalService.loadedCallback();
        };
        winlines.ExternalService.setLoadedCallback = function(callback) {
            winlines.ExternalService.loadedCallback = callback;
        };
        winlines.ExternalService.prototype.__class__ = winlines.ExternalService;
        winlines.Loader = function(groupId, assetRegistry, assetsList) {
            this.assetsToBeLoaded = [];
            this.expectedMaxTimeToLoadResources = 60000;
            this.errorThrowerTimerId = 0;
            this.maxNumberOfLoaders = 0;
            this.currentNumberOfLoaders = 0;
            this.assetIds = [];
            this.groupId = groupId;
            this.assetRegistry = assetRegistry;
            this.assetsList = assetsList;
        };
        winlines.Loader.__name__ = ["winlines", "Loader"];
        winlines.Loader.prototype.groupId = null;
        winlines.Loader.prototype.assetRegistry = null;
        winlines.Loader.prototype.loadedCallback = null;
        winlines.Loader.prototype.assetIds = null;
        winlines.Loader.prototype.assetsList = null;
        winlines.Loader.prototype.currentNumberOfLoaders = null;
        winlines.Loader.prototype.maxNumberOfLoaders = null;
        winlines.Loader.prototype.errorThrowerTimerId = null;
        winlines.Loader.prototype.expectedMaxTimeToLoadResources = null;
        winlines.Loader.prototype.assetsToBeLoaded = null;
        winlines.Loader.prototype.loadVBAsset = function(id) {
            this.assetIds.push(id);
            return this;
        };
        winlines.Loader.prototype.mapToLoadVBAsset = function(list, mapF) {
            var _g = 0;
            while (_g < list.length) {
                var item = list[_g];
                ++_g;
                this.loadVBAsset(mapF(item));
            }
            return this;
        };
        winlines.Loader.prototype.setMaxTimeToLoad = function(value) {
            this.expectedMaxTimeToLoadResources = value;
            return this;
        };
        winlines.Loader.prototype.load = function() {
            var _g2 = this;
            this.assetsToBeLoaded = this.assetIds.slice();
            var _g = 0;
            var _g1 = this.assetIds;
            while (_g < _g1.length) {
                var assetId = [_g1[_g]];
                ++_g;
                this.assetRegistry.getAsset(assetId[0]).getContent().then((function(assetId) {
                    return function(vba) {
                        _g2.assetsList.set(assetId[0], vba);
                        _g2.checkLoaded(assetId[0]);
                    };
                })(assetId));
            }
            this.maxNumberOfLoaders = this.assetIds.length;
            if (this.expectedMaxTimeToLoadResources > 0) this.errorThrowerTimerId = window.setTimeout($bind(this, this.throwTimedError), this.expectedMaxTimeToLoadResources);
            return this;
        };
        winlines.Loader.prototype.throwTimedError = function() {
            var error = "Assets: [" + this.groupId + "] would not loaded during: " + this.expectedMaxTimeToLoadResources + " ms.\n";
            error += "Loaded: " + this.currentNumberOfLoaders + " from: " + this.maxNumberOfLoaders + "\n";
            error += "List of awaiting resourse: " + _hcmn_.Std.string(this.assetsToBeLoaded) + "\n";
            window.console.error(error);
        };
        winlines.Loader.prototype.checkLoaded = function(id) {
            this.currentNumberOfLoaders++;
            _hcmn_.HxOverrides.remove(this.assetsToBeLoaded, id);
            if (this.maxNumberOfLoaders == this.currentNumberOfLoaders) {
                if (this.loadedCallback != null) {
                    window.clearTimeout(this.errorThrowerTimerId);
                    this.loadedCallback();
                }
            }
        };
        winlines.Loader.prototype.handleOfComplete = function(loadedCallback) {
            this.loadedCallback = loadedCallback;
            return this;
        };
        winlines.Loader.prototype.__class__ = winlines.Loader;
        winlines.WinLines = function(context, factory) {
            this.initialized = false;
            this.assetsLoaded = false;
            this.vba = null;
            this.context = context;
            this.layoutPort = context.getUsedPort(gameLayoutApi.IGameLayoutPort);
            this.factory = factory;
            this.port = context.getImplementedPort(wildFuryWinLinesApi.IWinLinesImplementationPort);
            this.baseEvents = new winlines.BaseEvents();
            this.layoutPort.getUpdateComponentLayout().subscribe($bind(this, this.updateLayout));
            this.controller = new winlines.WinLinesController(this);
            this.loadConfig();
        };
        winlines.WinLines.__name__ = ["winlines", "WinLines"];
        winlines.WinLines.prototype.winAnimationAssets = null;
        winlines.WinLines.prototype.layerContainers = null;
        winlines.WinLines.prototype.port = null;
        winlines.WinLines.prototype.view = null;
        winlines.WinLines.prototype.factory = null;
        winlines.WinLines.prototype.controller = null;
        winlines.WinLines.prototype.vba = null;
        winlines.WinLines.prototype.assetsLoaded = null;
        winlines.WinLines.prototype.initialized = null;
        winlines.WinLines.prototype.context = null;
        winlines.WinLines.prototype.baseEvents = null;
        winlines.WinLines.prototype.layoutPayload = null;
        winlines.WinLines.prototype.layoutPort = null;
        winlines.WinLines.prototype.winLinesConfig = null;
        winlines.WinLines.prototype.loadConfig = function() {
            var _g = this;
            winlines.ExternalService.loadConfig("win_definitions_config", function(config) {
                _g.winLinesConfig = config;
                _g.loadWinLinesResources();
            });
        };
        winlines.WinLines.prototype.loadWinLinesResources = function() {
            winlines.ExternalService.loadVBAssetsInGroup("WinLinesResources").mapToLoadVBAsset(this.winLinesConfig.symbolsToLoad, function(symbol) {
                return symbol;
            }).handleOfComplete($bind(this, this.onMainAssetsLoaded)).load();
        };
        winlines.WinLines.prototype.onMainAssetsLoaded = function() {
            var _g = this;
            winlines.ExternalService.assetRegistry.getAsset("animations").getContent().then(function(vba) {
                _g.vba = vba;
                _g.assetsLoaded = true;
                _g.initialize();
            });
        };
        winlines.WinLines.prototype.updateLayout = function(e) {
            this.layoutPayload = e.getPayload();
            if (!this.initialized) this.initialize();
            else {
                this.controller.updateLayout(this.layoutPayload);
                this.layoutPort.getComponentLayoutUpdated().publish(this.context.getInstance());
            }
        };
        winlines.WinLines.prototype.initialize = function() {
            if (this.assetsLoaded && this.layoutPayload != null) {
                this.view = this.factory.createView(this.vba);
                this.registerAllComponents();
                this.controller.init(this.winLinesConfig);
                this.controller.updateLayout(this.layoutPayload);
                this.layoutPort.getComponentLayoutUpdated().publish(this.context.getInstance());
                this.initialized = true;
            }
        };
        winlines.WinLines.prototype.registerAllComponents = function() {
            this.layerContainers = this.view.getChildComponents();
            var $it0 = this.layerContainers.keys();
            while ($it0.hasNext()) {
                var layerId = $it0.next();
                var constructorIndex;
                var _this = Type.getEnumConstructs(winlines.Component);
                constructorIndex = _hcmn_.HxOverrides.indexOf(_this, layerId, 0);
                if (constructorIndex < 0) throw new js._Boot.HaxeError("WinLines::undefined component to register: [" + layerId + "]");
                var componentEnum = Type.createEnum(winlines.Component, layerId, null);
                this.registerComponent(componentEnum, layerId);
            }
        };
        winlines.WinLines.prototype.registerComponent = function(componentEnum, layerId) {
            switch (componentEnum[1]) {
                case 1:
                    this.registerContainerComponent(winlines.Component.WIN_SYMBOLS, layerId, winlines.WinSymbols);
                    break;
                case 2:
                    this.registerContainerComponent(winlines.Component.WIN_FRAMES, layerId, winlines.WinFrames);
                    break;
                case 3:
                    this.registerContainerComponent(winlines.Component.SYMBOLS_GLOW, layerId, winlines.SymbolsGlow);
                    break;
                case 0:
                    this.registerContainerComponent(winlines.Component.EXPANDING_WILD, layerId, winlines.ExpandingWilds);
                    break;
            }
        };
        winlines.WinLines.prototype.registerContainerComponent = function(component, layerId, componentClass) {
            var container = this.view.getComponentById(component[0]);
            if (container == null) throw new js._Boot.HaxeError("WinLines::undefined component to register: [" + layerId + "]");
            if (componentClass != null) {
                var specificComponent = Type.createInstance(componentClass, [container, this.baseEvents, this.winLinesConfig]);
                winlines.WinLines.COMPONENTS.set(component, specificComponent);
            } else winlines.WinLines.COMPONENTS.set(component, container);
        };
        winlines.WinLines.prototype.setVisible = function(visible) {
            this.getDisplayObject().setVisible(visible);
            this.getWinSymbols().setVisible(visible);
            this.getWinFrames().setVisible(visible);
            this.getSymbolsGlow().setVisible(visible);
        };
        winlines.WinLines.prototype.getDisplayObject = function() {
            return this.view.getDisplayObject();
        };
        winlines.WinLines.prototype.getWinSymbols = function() {
            return this.getContainerComponent(winlines.Component.WIN_SYMBOLS);
        };
        winlines.WinLines.prototype.getExpandingSymbols = function() {
            return this.getContainerComponent(winlines.Component.EXPANDING_WILD);
        };
        winlines.WinLines.prototype.getWinFrames = function() {
            return this.getContainerComponent(winlines.Component.WIN_FRAMES);
        };
        winlines.WinLines.prototype.getSymbolsGlow = function() {
            return this.getContainerComponent(winlines.Component.SYMBOLS_GLOW);
        };
        winlines.WinLines.prototype.getContainerComponent = function(component) {
            return winlines.WinLines.COMPONENTS.get(component);
        };
        winlines.WinLines.prototype.getBaseEvent = function(id) {
            return this.baseEvents.getEvent(id);
        };
        winlines.WinLines.prototype.__class__ = winlines.WinLines;
        winlines.WinLinesConfig = function() {};
        winlines.WinLinesConfig.__name__ = ["winlines", "WinLinesConfig"];
        winlines.WinLinesConfig.prototype.expandingWildId = null;
        winlines.WinLinesConfig.prototype.cellsNum = null;
        winlines.WinLinesConfig.prototype.reelsNum = null;
        winlines.WinLinesConfig.prototype.cellWidth = null;
        winlines.WinLinesConfig.prototype.cellHeight = null;
        winlines.WinLinesConfig.prototype.cellHorizontalPaddingX = null;
        winlines.WinLinesConfig.prototype.cellHorizontalPaddingY = null;
        winlines.WinLinesConfig.prototype.cellHorizontalSpacing = null;
        winlines.WinLinesConfig.prototype.cellVerticalSpacing = null;
        winlines.WinLinesConfig.prototype.lineTime = null;
        winlines.WinLinesConfig.prototype.bonusLineTime = null;
        winlines.WinLinesConfig.prototype.symbols = null;
        winlines.WinLinesConfig.prototype.symbolsToLoad = null;
        winlines.WinLinesConfig.prototype.__class__ = winlines.WinLinesConfig;
        winlines.WinLinesController = function(winLines) {
            this.winLines = winLines;
        };
        winlines.WinLinesController.__name__ = ["winlines", "WinLinesController"];
        winlines.WinLinesController.prototype.winLines = null;
        winlines.WinLinesController.prototype.cellsNum = null;
        winlines.WinLinesController.prototype.reelsNum = null;
        winlines.WinLinesController.prototype.outcome = null;
        winlines.WinLinesController.prototype.config = null;
        winlines.WinLinesController.prototype.currentIndexOfWinFrames = null;
        winlines.WinLinesController.prototype.isLowWin = null;
        winlines.WinLinesController.prototype.init = function(config) {
            this.config = config;
            this.reelsNum = config.reelsNum;
            this.cellsNum = config.cellsNum;
            this.winLines.port.getShowOutcome().subscribe($bind(this, this.handleShowOutcome));
            this.winLines.port.getHideOutcome().subscribe($bind(this, this.handleHideOutcome));
            this.winLines.port.getVisible().subscribe($bind(this, this.handleSetVisible));
            this.winLines.port.getShowExpands().subscribe($bind(this, this.showExpandingWilds));
            this.winLines.port.getShowIdleAnimation().subscribe($bind(this, this.handleShowIdleAnimation));
            this.winLines.getBaseEvent(winlines.WinLineEvent.SHOW_WIN_LINE).add($bind(this, this.onWinLineShow));
            this.winLines.getBaseEvent(winlines.WinLineEvent.WIN_LINE_SHOWN).add($bind(this, this.onWinLineShown));
            this.winLines.getBaseEvent(winlines.WinLineEvent.EXPANDING_WILDS_SHOWN).add($bind(this, this.onExplandingWildShown));
            this.winLines.getBaseEvent(winlines.WinLineEvent.EXPANDING_WILD_COMPLETED).add($bind(this, this.onExplandingWildCompleted));
        };
        winlines.WinLinesController.prototype.showExpandingWilds = function(e) {
            var wilds = e.getPayload();
            this.winLines.getExpandingSymbols().show(wilds);
        };
        winlines.WinLinesController.prototype.handleSetVisible = function(e) {
            this.winLines.setVisible(e.getPayload());
        };
        winlines.WinLinesController.prototype.updateLayout = function(layoutPayload) {
            var $it0 = this.winLines.layerContainers.keys();
            while ($it0.hasNext()) {
                var layerId = $it0.next();
                var layerPayload = layoutPayload.containers.get(layerId);
                if (layerPayload == null) continue;
                var stage;
                var this1 = winlines.ExternalService.displayProvider.getStages();
                stage = this1.get(layerPayload.stage);
                var container = this.winLines.layerContainers.get(layerId).getDisplayObject();
                stage.removeChild(container);
                stage.addChild(container);
                container.setX(layerPayload.left);
                container.setY(layerPayload.top);
                container.setScaleX(layerPayload.width / container.getUserData().viewBuilderW);
                container.setScaleY(layerPayload.height / container.getUserData().viewBuilderH);
                container.setZIndex(layerPayload.zIndex);
            }
        };
        winlines.WinLinesController.prototype.handleHideOutcome = function(e) {
            this.hideAll();
        };
        winlines.WinLinesController.prototype.handleShowOutcome = function(e) {
            this.outcome = e.getPayload().outcome;
            this.isLowWin = e.getPayload().isLowWin;
            var winList = [];
            this.currentIndexOfWinFrames = 0;
            this.collectWinLines(winList, this.outcome.lineWins);
            this.collectWinLines(winList, this.outcome.scatterWins);
            if (winList.length > 0) this.showWinLinesSet(winList);
        };
        winlines.WinLinesController.prototype.handleShowIdleAnimation = function(e) {
            var payload = e.getPayload();
            this.winLines.getSymbolsGlow().showIdleAnimation(payload);
            this.winLines.getWinSymbols().showIdleAnimation(payload);
        };
        winlines.WinLinesController.prototype.collectWinLines = function(winList, wins) {
            if (wins == null) wins = [];
            else wins = wins;
            var _g = 0;
            while (_g < wins.length) {
                var win = wins[_g];
                ++_g;
                winList.push(win);
            }
        };
        winlines.WinLinesController.prototype.collectWinningSymbols = function(allWinningSymbols, wins) {
            if (wins == null) wins = [];
            else wins = wins;
            var _g = 0;
            while (_g < wins.length) {
                var win = wins[_g];
                ++_g;
                var _g2 = 0;
                var _g1 = this.reelsNum;
                while (_g2 < _g1) {
                    var i = _g2++;
                    var _g4 = 0;
                    var _g3 = this.cellsNum;
                    while (_g4 < _g3) {
                        var j = _g4++;
                        allWinningSymbols[i][j] = allWinningSymbols[i][j] || win.winPath.reelsInfo[i][j] == 1;
                    }
                }
            }
        };
        winlines.WinLinesController.prototype.showWinLinesSet = function(winList) {
            var _g = this;
            this.showWinSymbols(this.getAllWinSymbols(winList));
            var hideWinFrame = winList.length == 1 && winList[0].type == "Scatter";
            if (hideWinFrame) tools.TimeoutInvoker.setTimeout("showBonusLine", function() {
                if (winList[0].name != "LevelDoubleUp" && winList[0].name != "LevelUp") _g.winLines.port.getWinLineCyclePlayed().publish(null);
            }, this.config.bonusLineTime);
            else this.showCycleOfWinFrames(winList);
        };
        winlines.WinLinesController.prototype.getWinSymbols = function(win) {
            var reelsInfo = win.winPath.reelsInfo;
            var _g = [];
            var _g2 = 0;
            var _g1 = this.reelsNum;
            while (_g2 < _g1) {
                var i = _g2++;
                _g.push((function($this) {
                    var $r;
                    var _g3 = []; {
                        var _g5 = 0;
                        var _g4 = $this.cellsNum;
                        while (_g5 < _g4) {
                            var j = _g5++;
                            _g3.push(reelsInfo[i][j] == 1);
                        }
                    }
                    $r = _g3;
                    return $r;
                }(this)));
            }
            return _g;
        };
        winlines.WinLinesController.prototype.getAllWinSymbols = function(wins) {
            var allWinSymbols;
            var _g = [];
            var _g2 = 0;
            var _g1 = this.reelsNum;
            while (_g2 < _g1) {
                var i = _g2++;
                _g.push((function($this) {
                    var $r;
                    var _g3 = []; {
                        var _g5 = 0;
                        var _g4 = $this.cellsNum;
                        while (_g5 < _g4) {
                            var j = _g5++;
                            _g3.push(false);
                        }
                    }
                    $r = _g3;
                    return $r;
                }(this)));
            }
            allWinSymbols = _g;
            var _g11 = 0;
            while (_g11 < wins.length) {
                var win = wins[_g11];
                ++_g11;
                this.collectAllWinSymbols(allWinSymbols, win);
            }
            return allWinSymbols;
        };
        winlines.WinLinesController.prototype.collectAllWinSymbols = function(allWinSymbols, win) {
            var reelsInfo = win.winPath.reelsInfo;
            var _g1 = 0;
            var _g = this.reelsNum;
            while (_g1 < _g) {
                var i = _g1++;
                var _g3 = 0;
                var _g2 = this.cellsNum;
                while (_g3 < _g2) {
                    var j = _g3++;
                    if (allWinSymbols[i][j]) allWinSymbols[i][j] = allWinSymbols[i][j];
                    else allWinSymbols[i][j] = reelsInfo[i][j] == 1;
                }
            }
        };
        winlines.WinLinesController.prototype.onWinLineShow = function(data) {
            this.winLines.port.getWinLineShow().publish(data);
        };
        winlines.WinLinesController.prototype.onExplandingWildCompleted = function(data) {
            this.winLines.port.getExpandCompleted().publish(data);
        };
        winlines.WinLinesController.prototype.onExplandingWildShown = function(data) {
            this.winLines.port.getExpandsShown().publish(data);
        };
        winlines.WinLinesController.prototype.onWinLineShown = function(data) {
            this.winLines.port.getWinLineShown().publish(data);
        };
        winlines.WinLinesController.prototype.winLinesCycleEnded = function(data) {
            this.hideWinLines();
        };
        winlines.WinLinesController.prototype.showCycleOfWinFrames = function(winList) {
            var _g = this;
            this.currentIndexOfWinFrames++;
            var win = winList[0];
            if (win.name != "LevelDoubleUp" && win.name != "LevelUp") {
                this.winLines.port.getWinPresent().publish(win);
                var winsymbols = this.getWinSymbols(win);
                this.showWinFrames(winsymbols);
            }
            tools.TimeoutInvoker.setTimeout("showWinFrames", function() {
                if (_g.currentIndexOfWinFrames == winList.length) _g.winLines.port.getWinLineCyclePlayed().publish(null);
                winList.push(winList.shift());
                _g.showCycleOfWinFrames(winList);
            }, this.config.lineTime);
        };
        winlines.WinLinesController.prototype.showWinFrames = function(winsymbols) {
            this.winLines.getWinFrames().show(new winlines.WinSymbolsPayload(winsymbols, this.outcome, this.isLowWin));
        };
        winlines.WinLinesController.prototype.showWinSymbols = function(winsymbols) {
            this.winLines.getWinSymbols().show(new winlines.WinSymbolsPayload(winsymbols, this.outcome, this.isLowWin));
        };
        winlines.WinLinesController.prototype.hideAll = function() {
            this.hideWinLines();
            tools.TimeoutInvoker.clearTimeouts("showWinFrames");
            tools.TimeoutInvoker.clearTimeouts("showBonusLine");
        };
        winlines.WinLinesController.prototype.hideWinLines = function() {
            this.winLines.getWinSymbols().hide();
            this.winLines.getWinFrames().hide();
            this.winLines.getExpandingSymbols().hide();
            this.winLines.getSymbolsGlow().hide();
        };
        winlines.WinLinesController.prototype.__class__ = winlines.WinLinesController;
        winlines.WinLinesFactory = function(vbf) {
            this.vbf = vbf;
        };
        winlines.WinLinesFactory = ck_implements(winlines.WinLinesFactory, clientkernelModulesApi.IService);
        winlines.WinLinesFactory = ck_implements(winlines.WinLinesFactory, componentmodelComponentApi.IComponentFactory);
        winlines.WinLinesFactory.__interfaces__ = [clientkernelModulesApi.IService, componentmodelComponentApi.IComponentFactory];
        winlines.WinLinesFactory.__name__ = ["winlines", "WinLinesFactory"];
        winlines.WinLinesFactory.prototype.vbf = null;
        winlines.WinLinesFactory.prototype.getComponentDeclaration = function() {
            return wildFuryWinLinesApi.WinLinesDeclaration;
        };
        winlines.WinLinesFactory.prototype.createComponent = function(context) {
            winlines.ExternalService.componentContext = context;
            new winlines.WinLines(context, this.vbf);
        };
        winlines.WinLinesFactory.prototype.__class__ = winlines.WinLinesFactory;
        winlines.BaseEvents = function() {
            this.events = new haxe.ds.EnumValueMap();
            this.registerEvents();
        };
        winlines.BaseEvents.__name__ = ["winlines", "BaseEvents"];
        winlines.BaseEvents.prototype.events = null;
        winlines.BaseEvents.prototype.registerEvents = function() {
            var value = new _hcmn_.msignal_Signal1();
            this.events.set(winlines.WinLineEvent.SHOW_WIN_LINE, value);
            var value1 = new _hcmn_.msignal_Signal1();
            this.events.set(winlines.WinLineEvent.WIN_LINE_SHOWN, value1);
            var value2 = new _hcmn_.msignal_Signal1();
            this.events.set(winlines.WinLineEvent.EXPANDING_WILDS_SHOWN, value2);
            var value3 = new _hcmn_.msignal_Signal1();
            this.events.set(winlines.WinLineEvent.EXPANDING_WILD_COMPLETED, value3);
        };
        winlines.BaseEvents.prototype.getEvent = function(id) {
            return this.events.get(id);
        };
        winlines.BaseEvents.prototype.__class__ = winlines.BaseEvents;
        winlines.WinLineEvent = {
            __ename__: ["winlines", "WinLineEvent"],
            __constructs__: ["SHOW_WIN_LINE", "WIN_LINE_SHOWN", "EXPANDING_WILDS_SHOWN", "EXPANDING_WILD_COMPLETED"]
        };
        winlines.WinLineEvent.SHOW_WIN_LINE = ["SHOW_WIN_LINE", 0];
        winlines.WinLineEvent.SHOW_WIN_LINE.toString = $estr;
        winlines.WinLineEvent.SHOW_WIN_LINE.__enum__ = winlines.WinLineEvent;
        winlines.WinLineEvent.EXPANDING_WILD_COMPLETED = ["EXPANDING_WILD_COMPLETED", 3];
        winlines.WinLineEvent.EXPANDING_WILD_COMPLETED.toString = $estr;
        winlines.WinLineEvent.EXPANDING_WILD_COMPLETED.__enum__ = winlines.WinLineEvent;
        winlines.WinLineEvent.EXPANDING_WILDS_SHOWN = ["EXPANDING_WILDS_SHOWN", 2];
        winlines.WinLineEvent.EXPANDING_WILDS_SHOWN.toString = $estr;
        winlines.WinLineEvent.EXPANDING_WILDS_SHOWN.__enum__ = winlines.WinLineEvent;
        winlines.WinLineEvent.WIN_LINE_SHOWN = ["WIN_LINE_SHOWN", 1];
        winlines.WinLineEvent.WIN_LINE_SHOWN.toString = $estr;
        winlines.WinLineEvent.WIN_LINE_SHOWN.__enum__ = winlines.WinLineEvent;

        winlines.ISymbols = function() {}
        winlines.ISymbols.prototype = {

            show: function(symbolsPayload) {
                return {
                    arguments: ["*"],
                    returns: "void"
                };
            },
            hide: function() {
                return {
                    arguments: [],
                    returns: "void"
                };
            },
            setVisible: function(visible) {
                return {
                    arguments: ["boolean"],
                    returns: "void"
                };
            },
            showIdleAnimation: function(idlePayload) {
                return {
                    arguments: ["*"],
                    returns: "void"
                };
            }
        };
        winlines.BaseSymbols = function(symbolType, container, baseEvents, winLinesConfig) {
            this.isVisible = false;
            this.originalSymbols = new _hcmn_.haxe_ds_StringMap();
            this.symbolsList = new _hcmn_.haxe_ds_StringMap();
            this.container = container;
            this.symbolType = symbolType;
            this.baseEvents = baseEvents;
            this.winLinesConfig = winLinesConfig;
            this.cellsNum = winLinesConfig.cellsNum;
            this.reelsNum = winLinesConfig.reelsNum;
            this.horisontalGap = winLinesConfig.cellHorizontalSpacing;
            this.verticalGap = winLinesConfig.cellVerticalSpacing;
            this.container.hide();
            this.symbolsAssets = winlines.ExternalService.loadedAssets;
            this.uiHelper = uiHelper.UiHelper.getUiHelper(winlines.ExternalService.displayProvider);
            this.registerSymbols();
        };
        winlines.BaseSymbols = ck_implements(winlines.BaseSymbols, winlines.ISymbols);
        winlines.BaseSymbols.__interfaces__ = [winlines.ISymbols];
        winlines.BaseSymbols.__name__ = ["winlines", "BaseSymbols"];
        winlines.BaseSymbols.prototype.horisontalGap = null;
        winlines.BaseSymbols.prototype.verticalGap = null;
        winlines.BaseSymbols.prototype.symbolType = null;
        winlines.BaseSymbols.prototype.winLinesConfig = null;
        winlines.BaseSymbols.prototype.baseEvents = null;
        winlines.BaseSymbols.prototype.cellsNum = null;
        winlines.BaseSymbols.prototype.reelsNum = null;
        winlines.BaseSymbols.prototype.container = null;
        winlines.BaseSymbols.prototype.symbolsList = null;
        winlines.BaseSymbols.prototype.originalSymbols = null;
        winlines.BaseSymbols.prototype.mainContainer = null;
        winlines.BaseSymbols.prototype.symbolsAssets = null;
        winlines.BaseSymbols.prototype.isVisible = null;
        winlines.BaseSymbols.prototype.uiHelper = null;
        winlines.BaseSymbols.prototype.registerSymbols = function() {
            var _g = 0;
            var _g1 = this.winLinesConfig.symbols;
            while (_g < _g1.length) {
                var entry = _g1[_g];
                ++_g;
                this.symbolsList.set(entry.key, entry.value);
            }
        };
        winlines.BaseSymbols.prototype.setPosition = function(symbolContainer, col, row, entryValue) {
            var position = this.getSymbolPosition(col, row);
            var x = position.x + this.winLinesConfig.cellHorizontalPaddingX;
            var y = position.y + this.winLinesConfig.cellHorizontalPaddingY;
            if (entryValue != null) {
                x += entryValue.paddingX;
                y += entryValue.paddingY;
            }
            symbolContainer.setPos(x, y);
        };
        winlines.BaseSymbols.prototype.getSymbolPosition = function(col, row) {
            return new displayEngineApi.Point((this.winLinesConfig.cellWidth + this.horisontalGap) * col, (this.winLinesConfig.cellHeight + this.verticalGap) * row);
        };
        winlines.BaseSymbols.prototype.show = function(payload) {
            this.isVisible = true;
            this.container.show();
        };
        winlines.BaseSymbols.prototype.hide = function() {
            var $it0 = this.originalSymbols.keys();
            while ($it0.hasNext()) {
                var key = $it0.next();
                this.container.disposeChildComponent(key);
                this.originalSymbols.get(key).dispose();
            }
            this.container.hide();
            this.originalSymbols = new _hcmn_.haxe_ds_StringMap();
            this.isVisible = false;
        };
        winlines.BaseSymbols.prototype.setVisible = function(visible) {
            this.isVisible = visible;
            if (visible) this.container.show();
            else {
                this.container.hide();
                var $it0 = this.originalSymbols.keys();
                while ($it0.hasNext()) {
                    var key = $it0.next();
                    var animation = this.originalSymbols.get(key);
                    animation.stop();
                    animation.hide();
                }
            }
        };
        winlines.BaseSymbols.prototype.getEntryByName = function(name) {
            var $it0 = this.symbolsList.iterator();
            while ($it0.hasNext()) {
                var symbol = $it0.next();
                if (symbol.name == name) return symbol;
            }
            return null;
        };
        winlines.BaseSymbols.prototype.createAnimationSymbol = function(symbolName, col, row) {
            var symbolKey = this.getSymbolKey(symbolName, col, row);
            if ((function($this) {
                    var $r;
                    var this1 = $this.container.getChildComponents();
                    $r = this1.exists(symbolKey);
                    return $r;
                }(this))) return this.container.getVBAnimationById(symbolKey);
            var assets = this.getSymbolAsset(symbolName);
            var vbAnimView = winlines.ExternalService.viewBuilderFactory.createView(assets);
            var vbAniamtionHolder = vbAnimView.createContainerFromStoredConfig(winlines.BaseSymbols.ANIMATION_HOLDER);
            var vbAniamtionComponent = vbAniamtionHolder.getVBAnimationById(winlines.BaseSymbols.ANIMATION_CONTENT);
            this.container.addChildComponent(vbAniamtionComponent, symbolKey);
            this.setPosition(vbAniamtionComponent.getDisplayObject(), col, row, this.getEntryByName(symbolName));
            this.originalSymbols.set(symbolKey, vbAniamtionComponent);
            return vbAniamtionComponent;
        };
        winlines.BaseSymbols.prototype.getSymbolAsset = function(symbolName) {
            return this.symbolsAssets.get("" + this.symbolType + "_" + symbolName);
        };
        winlines.BaseSymbols.prototype.getSymbolKey = function(symbolName, col, row) {
            return symbolName + "_" + col + "_" + row;
        };
        winlines.BaseSymbols.prototype.showIdleAnimation = function(idlePayload) {};
        winlines.BaseSymbols.prototype.__class__ = winlines.BaseSymbols;
        winlines.ExpandingWilds = function(container, baseEvents, winLinesConfig) {
            this.totalWildsCount = -1;
            this.totalCompletedItems = 0;
            winlines.BaseSymbols.call(this, "EXPANDING_WILD", container, baseEvents, winLinesConfig);
        };
        winlines.ExpandingWilds.__name__ = ["winlines", "ExpandingWilds"];
        winlines.ExpandingWilds.__super__ = winlines.BaseSymbols;
        for (var k in winlines.BaseSymbols.prototype) winlines.ExpandingWilds.prototype[k] = winlines.BaseSymbols.prototype[k];
        winlines.ExpandingWilds.prototype.totalCompletedItems = null;
        winlines.ExpandingWilds.prototype.expandingReel = null;
        winlines.ExpandingWilds.prototype.totalWildsCount = null;
        winlines.ExpandingWilds.prototype.isLowWin = null;
        winlines.ExpandingWilds.prototype.show = function(expandingWilds) {
            winlines.BaseSymbols.prototype.show.call(this, expandingWilds);
            this.isLowWin = expandingWilds.isLowWin;
            this.expandingReel = expandingWilds.expandingReel;
            if (this.totalWildsCount < 0) {
                this.totalCompletedItems = 0;
                this.totalWildsCount = expandingWilds.totalCount;
            }
            this.createSymbol("EXPANDING_WILD", this.expandingReel, 3);
        };
        winlines.ExpandingWilds.prototype.getSymbolAsset = function(symbolName) {
            return this.symbolsAssets.get("" + symbolName);
        };
        winlines.ExpandingWilds.prototype.createSymbol = function(symbolName, col, row) {
            var symbol = this.createAnimationSymbol(symbolName, col, row);
            symbol.show();
            symbol.gotoAndPlay(false, "loop");
            symbol.addEventListener("ANIMATION::END", $bind(this, this.onAnimationEnd), [symbol]);
            return symbol;
        };
        winlines.ExpandingWilds.prototype.onAnimationEnd = function(symbols) {
            var symbol = symbols[0];
            var symbol_name = symbol.getDisplayObject().getName();
            var typeLength = this.symbolType.length;
            var reel = _hcmn_.Std.parseInt(symbol_name.charAt(typeLength + 1));
            symbol.removeEventListener("ANIMATION::END");
            symbol.gotoAndStop(false, "loop");
            symbol.hide();
            tools.TimeoutInvoker.setTimeout("ExpandingWildsCheckAllAnimationsIsEnd", (function(f, a1) {
                return function() {
                    f(a1);
                };
            })($bind(this, this.checkAllAnimationsIsEnd), reel));
        };
        winlines.ExpandingWilds.prototype.checkAllAnimationsIsEnd = function(reel) {
            this.totalCompletedItems++;
            if (this.totalCompletedItems == this.totalWildsCount) {
                this.totalCompletedItems = 0;
                this.totalWildsCount = -1;
                this.hide();
                tools.TimeoutInvoker.setTimeout("dispatchExpandingWildsShown", (function(f, a1) {
                    return function() {
                        f(a1);
                    };
                })($bind(this, this.dispatchExpandingWildsShown), reel));
            } else tools.TimeoutInvoker.setTimeout("dispatchCurrentExpandingCompleted", (function(f1, a11) {
                return function() {
                    f1(a11);
                };
            })($bind(this, this.dispatchCurrentExpandingCompleted), reel));
        };
        winlines.ExpandingWilds.prototype.dispatchCurrentExpandingCompleted = function(reel) {
            this.baseEvents.getEvent(winlines.WinLineEvent.EXPANDING_WILD_COMPLETED).dispatch(reel);
        };
        winlines.ExpandingWilds.prototype.dispatchExpandingWildsShown = function(reel) {
            this.baseEvents.getEvent(winlines.WinLineEvent.EXPANDING_WILDS_SHOWN).dispatch(reel);
        };
        winlines.ExpandingWilds.prototype.__class__ = winlines.ExpandingWilds;
        winlines.SymbolsGlow = function(container, baseEvents, winLinesConfig) {
            this.symbolsAmount = 0;
            winlines.BaseSymbols.call(this, "WIN", container, baseEvents, winLinesConfig);
        };
        winlines.SymbolsGlow.__name__ = ["winlines", "SymbolsGlow"];
        winlines.SymbolsGlow.__super__ = winlines.BaseSymbols;
        for (var k in winlines.BaseSymbols.prototype) winlines.SymbolsGlow.prototype[k] = winlines.BaseSymbols.prototype[k];
        winlines.SymbolsGlow.prototype.symbolsAmount = null;
        winlines.SymbolsGlow.prototype.isLowWin = null;
        winlines.SymbolsGlow.prototype.createAnimationSymbolsOnReel = function(col, reels) {
            var row = this.cellsNum;
            while (row > 0) {
                row--;
                var symbolNum = reels[row];
                var entry;
                var key = symbolNum;
                entry = this.symbolsList.get(key);
                var symbolVisible = entry != null && entry.underSymbolKey != null;
                if (!symbolVisible) continue;
                this.calculateSymbolsAmount(entry, row);
                entry = this.symbolsList.get(entry.underSymbolKey);
                var animation = this.createAnimationAndPlay(entry.name, col, row);
                var isTopSymbolNearReels = row == 0;
                var isSymbolNearReels = isTopSymbolNearReels || row == 5;
                if (isSymbolNearReels) this.applyNearMaskFor(animation.getDisplayObject(), isTopSymbolNearReels, entry);
            }
        };
        winlines.SymbolsGlow.prototype.calculateSymbolsAmount = function(entry, row) {
            var hasAnimations = entry.idle == 1;
            var isRowVisibleOnStage = row != 0 && row != 5;
            if (isRowVisibleOnStage) {
                if (hasAnimations) this.symbolsAmount = 3;
                else this.symbolsAmount++;
            }
        };
        winlines.SymbolsGlow.prototype.showIdleAnimation = function(idlePayload) {
            this.isLowWin = idlePayload.isLowWin;
            this.isVisible = true;
            this.container.show();
            if (idlePayload.reel == 0) {
                this.symbolsAmount = 0;
                this.applyMask();
            }
            this.createAnimationSymbolsOnReel(idlePayload.reel, idlePayload.symbols);
            var isCollectedMaxAmount = this.symbolsAmount == 3;
            if (isCollectedMaxAmount) this.uiHelper.clearMask(this.container.getDisplayObject());
            this.setVisible(((function($this) {
                var $r;
                var this1 = $this.container.getChildComponents();
                $r = this1.keys();
                return $r;
            }(this))).hasNext());
        };
        winlines.SymbolsGlow.prototype.applyNearMaskFor = function(displayObject, isTop, entry) {
            var paddingX = entry.paddingX;
            var paddingY = entry.paddingY;
            var maskWidth = this.winLinesConfig.cellWidth * 3;
            var maskHeight = this.winLinesConfig.cellHeight;
            var maskPaddingX = -paddingX - this.winLinesConfig.cellWidth;
            var maskPaddingY;
            if (isTop) maskPaddingY = -paddingY + maskHeight;
            else maskPaddingY = -paddingY - maskHeight;
            this.uiHelper.addRectMask(displayObject, maskWidth, maskHeight, maskPaddingX, maskPaddingY);
        };
        winlines.SymbolsGlow.prototype.applyMask = function() {
            var width = this.winLinesConfig.cellWidth * this.winLinesConfig.reelsNum;
            var height = this.winLinesConfig.cellHeight * (this.winLinesConfig.cellsNum - 2);
            this.uiHelper.addRectMask(this.container.getDisplayObject(), width, height, 0, 157);
        };
        winlines.SymbolsGlow.prototype.createAnimationAndPlay = function(symbolName, col, row) {
            var symbol = this.createAnimationSymbol(symbolName, col, row);
            symbol.gotoAndPlay(false, "loop");
            return symbol;
        };
        winlines.SymbolsGlow.prototype.hide = function() {
            this.symbolsAmount = 0;
            winlines.BaseSymbols.prototype.hide.call(this);
        };
        winlines.SymbolsGlow.prototype.__class__ = winlines.SymbolsGlow;
        winlines.WinFrames = function(container, baseEvents, winLinesConfig) {
            this.cachedItems = [];
            winlines.BaseSymbols.call(this, "WIN", container, baseEvents, winLinesConfig);
        };
        winlines.WinFrames.__name__ = ["winlines", "WinFrames"];
        winlines.WinFrames.__super__ = winlines.BaseSymbols;
        for (var k in winlines.BaseSymbols.prototype) winlines.WinFrames.prototype[k] = winlines.BaseSymbols.prototype[k];
        winlines.WinFrames.prototype.cachedItems = null;
        winlines.WinFrames.prototype.isLowWin = null;
        winlines.WinFrames.prototype.show = function(winsymbolsPayload) {
            winlines.BaseSymbols.prototype.show.call(this, winsymbolsPayload);
            var winsymbols = winsymbolsPayload.winsymbols;
            var outcome = winsymbolsPayload.outcome;
            this.isLowWin = winsymbolsPayload.isLowWin;
            var index = 0;
            var _g1 = 0;
            var _g = this.reelsNum;
            while (_g1 < _g) {
                var col = _g1++;
                var _g3 = 0;
                var _g2 = this.cellsNum;
                while (_g3 < _g2) {
                    var row = _g3++;
                    var symbolNum = outcome.reelStop.reels[col][row];
                    var symbolVisible = winsymbols[col][row];
                    if (!symbolVisible) continue;
                    if (this.cachedItems.length <= index) this.cachedItems.push(this.createSymbol("FRAME", col, row));
                    this.setPosition(this.cachedItems[index].getDisplayObject(), col, row, this.getEntryByName("FRAME"));
                    if (this.isLowWin) this.cachedItems[index].show();
                    else this.cachedItems[index].play(false);
                    index++;
                }
            }
            var _g11 = index;
            var _g4 = this.cachedItems.length;
            while (_g11 < _g4) {
                var i = _g11++;
                this.hideAnimation(this.cachedItems[i]);
            }
        };
        winlines.WinFrames.prototype.createSymbol = function(symbolName, col, row) {
            var symbol = this.createAnimationSymbol(symbolName, col, row);
            symbol.show();
            if (this.isLowWin) symbol.gotoAndStop(false, "1");
            else symbol.gotoAndPlay(false, "loop");
            return symbol;
        };
        winlines.WinFrames.prototype.hide = function() {
            this.container.hide();
            _hcmn_.Lambda.iter(this.cachedItems, $bind(this, this.hideAnimation));
        };
        winlines.WinFrames.prototype.hideAnimation = function(animation) {
            animation.stop();
            animation.hide();
        };
        winlines.WinFrames.prototype.__class__ = winlines.WinFrames;
        winlines.WinSymbols = function(container, baseEvents, winLinesConfig) {
            this.isLowWin = false;
            this.listOfTimeouts = [];
            winlines.BaseSymbols.call(this, "WIN", container, baseEvents, winLinesConfig);
        };
        winlines.WinSymbols.__name__ = ["winlines", "WinSymbols"];
        winlines.WinSymbols.__super__ = winlines.BaseSymbols;
        for (var k in winlines.BaseSymbols.prototype) winlines.WinSymbols.prototype[k] = winlines.BaseSymbols.prototype[k];
        winlines.WinSymbols.prototype.listOfTimeouts = null;
        winlines.WinSymbols.prototype.isLowWin = null;
        winlines.WinSymbols.prototype.show = function(winsymbolsPayload) {
            winlines.BaseSymbols.prototype.show.call(this, winsymbolsPayload);
            this.isLowWin = winsymbolsPayload.isLowWin;
            var winsymbols = winsymbolsPayload.winsymbols;
            var outcome = winsymbolsPayload.outcome;
            var symbols;
            var _g = [];
            var _g2 = 0;
            var _g1 = this.reelsNum;
            while (_g2 < _g1) {
                var i = _g2++;
                _g.push((function($this) {
                    var $r;
                    var _g3 = []; {
                        var _g5 = 0;
                        var _g4 = $this.cellsNum;
                        while (_g5 < _g4) {
                            var j = _g5++;
                            _g3.push(!winsymbols[i][j]);
                        }
                    }
                    $r = _g3;
                    return $r;
                }(this)));
            }
            symbols = _g;
            this.baseEvents.getEvent(winlines.WinLineEvent.SHOW_WIN_LINE).dispatch(symbols);
            var reels = outcome.reelStop.reels;
            var _g21 = 0;
            var _g11 = this.reelsNum;
            while (_g21 < _g11) {
                var col = _g21++;
                this.createAnimationSymbolsOnReel(col, reels[col], winsymbols[col]);
            }
            this.runAnimationChecker();
        };
        winlines.WinSymbols.prototype.runAnimationChecker = function() {
            var _g = this;
            tools.TimeoutInvoker.clearTimeoutsWithoutForceInvoke("animation_checker_timeout_id");
            var gropedSymbols = this.getGroupedSymbols();
            tools.TimeoutInvoker.setTimeout("animation_checker_timeout_id", function() {
                var $it0 = gropedSymbols.keys();
                while ($it0.hasNext()) {
                    var key = $it0.next();
                    var symbols;
                    symbols = _hcmn_.__map_reserved[key] != null ? gropedSymbols.getReserved(key) : gropedSymbols.h[key];
                    _g.checkeAnimationMistackes(symbols);
                }
                _g.runAnimationChecker();
            }, 1000);
        };
        winlines.WinSymbols.prototype.checkeAnimationMistackes = function(symbols) {
            var frames = [];
            var hasMistakes = false;
            var _g = 0;
            while (_g < symbols.length) {
                var symbol = symbols[_g];
                ++_g;
                var frameCount = symbol.frameCount;
                frames.push(frameCount);
                if (frames[0] != frameCount) hasMistakes = true;
            }
            if (hasMistakes) {
                var mostFrequentFrame = tools.ArrayUtil.getMostFrequent(frames);
                var _g1 = 0;
                while (_g1 < symbols.length) {
                    var symbol1 = symbols[_g1];
                    ++_g1;
                    symbol1.gotoAndPlayOnFrame(mostFrequentFrame);
                }
            }
        };
        winlines.WinSymbols.prototype.getGroupedSymbols = function() {
            var result = new _hcmn_.haxe_ds_StringMap();
            var $it0 = this.originalSymbols.keys();
            while ($it0.hasNext()) {
                var key = $it0.next();
                var movieClip = this.uiHelper.wrapAsMovieClip(this.originalSymbols.get(key));
                if (!result.exists(movieClip.animID)) result.set(movieClip.animID, []);
                result.get(movieClip.animID).push(movieClip);
            }
            return result;
        };
        winlines.WinSymbols.prototype.createAnimationSymbolsOnReel = function(col, reels, winsymbols) {
            var _g1 = 1;
            var _g = this.cellsNum - 1;
            while (_g1 < _g) {
                var row = _g1++;
                var symbolNum = reels[row];
                var entry;
                var key = symbolNum;
                entry = this.symbolsList.get(key);
                var symbolVisible = symbolNum >= 0 && entry != null && entry.idle == 1 || winsymbols != null && winsymbols[row];
                if (symbolVisible) {
                    if (!this.isLowWin) this.createSymbol(entry, col, row).getDisplayObject().sendToBottom();
                    else if (entry.name == "LEVEL_DOUBLE_UP" || entry.name == "LEVEL_UP") this.createSymbol(entry, col, row).getDisplayObject().sendToBottom();
                }
            }
        };
        winlines.WinSymbols.prototype.showIdleAnimation = function(idlePayload) {
            this.isLowWin = idlePayload.isLowWin;
            this.createAnimationSymbolsOnReel(idlePayload.reel, idlePayload.symbols, null);
            this.setVisible(((function($this) {
                var $r;
                var this1 = $this.container.getChildComponents();
                $r = this1.keys();
                return $r;
            }(this))).hasNext());
            if (this.isVisible) this.runAnimationChecker();
        };
        winlines.WinSymbols.prototype.createSymbol = function(entryValue, col, row) {
            return this.createAnimationAndPlay(entryValue.name, col, row, "loop", entryValue.playTimeout);
        };
        winlines.WinSymbols.prototype.createAnimationAndPlay = function(symbolName, col, row, frameLabel, playTimeout) {
            if (playTimeout == null) playTimeout = 0;
            var symbol = this.createAnimationSymbol(symbolName, col, row);
            symbol.show();
            symbol.gotoAndStop(false, frameLabel);
            if (symbolName == "LEVEL_DOUBLE_UP" || symbolName == "LEVEL_UP") symbol.gotoAndPlay(false, frameLabel);
            if (playTimeout > 0) {
                var timeOutId = this.getSymbolKey(symbolName, col, row);
                tools.TimeoutInvoker.setTimeout(timeOutId, (function(f, a1, a2) {
                    return function() {
                        f(a1, a2);
                    };
                })($bind(symbol, symbol.gotoAndPlay), false, frameLabel), playTimeout);
                this.listOfTimeouts.push(timeOutId);
            } else if (!this.isLowWin) symbol.gotoAndPlay(false, frameLabel);
            return symbol;
        };
        winlines.WinSymbols.prototype.hide = function() {
            tools.TimeoutInvoker.clearTimeoutsWithoutForceInvoke("animation_checker_timeout_id");
            _hcmn_.Lambda.iter(this.listOfTimeouts, tools.TimeoutInvoker.clearTimeoutsWithoutForceInvoke);
            this.listOfTimeouts = [];
            var symbols;
            var _g = [];
            var _g2 = 0;
            var _g1 = this.reelsNum;
            while (_g2 < _g1) {
                var i = _g2++;
                _g.push((function($this) {
                    var $r;
                    var _g3 = []; {
                        var _g5 = 0;
                        var _g4 = $this.cellsNum;
                        while (_g5 < _g4) {
                            var j = _g5++;
                            _g3.push(true);
                        }
                    }
                    $r = _g3;
                    return $r;
                }(this)));
            }
            symbols = _g;
            this.baseEvents.getEvent(winlines.WinLineEvent.WIN_LINE_SHOWN).dispatch(symbols);
            winlines.BaseSymbols.prototype.hide.call(this);
        };
        winlines.WinSymbols.prototype.__class__ = winlines.WinSymbols;
        winlines.WinSymbolsPayload = function(winsymbols, outcome, isLowWin) {
            this.winsymbols = winsymbols;
            this.outcome = outcome;
            this.isLowWin = isLowWin;
        };
        winlines.WinSymbolsPayload.__name__ = ["winlines", "WinSymbolsPayload"];
        winlines.WinSymbolsPayload.prototype.winsymbols = null;
        winlines.WinSymbolsPayload.prototype.outcome = null;
        winlines.WinSymbolsPayload.prototype.isLowWin = null;
        winlines.WinSymbolsPayload.prototype.__class__ = winlines.WinSymbolsPayload;
        winlines.ExternalService.loadedAssets = new _hcmn_.haxe_ds_StringMap();;
        winlines.ExternalService.loading = 0;;
        winlines.ExternalService.totalLoaded = 0;;
        winlines.ExternalService.loadedCallbacks = new _hcmn_.haxe_ds_StringMap();;
        winlines.WinLines.COMPONENTS = new haxe.ds.EnumValueMap();;
        winlines.BaseSymbols.ANIMATION_HOLDER = "ANIMATION_HOLDER";;
        winlines.BaseSymbols.ANIMATION_CONTENT = "ANIMATION_CONTENT";;
        winlines.SymbolsGlow.MAX_AMOUNT_OF_GLOWING_SYMBOLS = 3;;
        winlines.WinSymbols.ANIMATION_CHECKER_TIMEOUT_ID = "animation_checker_timeout_id";;
        return {
            exports: winlines,
            activator: winlines.Activator
        };
    });
//# sourceURL=wildFuryWinLinesImpl.js