define("ballooniesIXFAnimation", ["ballooniesIXFAnimationDeclaration", "viewBuilderApi", "componentmodelComponentApi", "clientkernelLoaderApi", "displayEngineApi", "gameLayoutApi", "BABYLON", "clientkernelEventbusApi", "clientkernelModulesApi", "ballooniesIXFAnimationPort"],
    function(ballooniesIXFAnimationDeclaration, viewBuilderApi, componentmodelComponentApi, clientkernelLoaderApi, displayEngineApi, gameLayoutApi, BABYLON, clientkernelEventbusApi, clientkernelModulesApi, ballooniesIXFAnimationPort) {
        "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 ballooniesIXFAnimation == 'undefined') {
            var ballooniesIXFAnimation = {};
        };
        ballooniesIXFAnimation.Activator = function(context) {};
        ballooniesIXFAnimation.Activator = ck_implements(ballooniesIXFAnimation.Activator, clientkernelModulesApi.IModuleActivator);
        ballooniesIXFAnimation.Activator.__interfaces__ = [clientkernelModulesApi.IModuleActivator];
        ballooniesIXFAnimation.Activator.__name__ = ["ballooniesIXFAnimation", "Activator"];
        ballooniesIXFAnimation.Activator.prototype.start = function(context) {
            context.getServiceTracker([viewBuilderApi.IViewBuilderFactory, clientkernelLoaderApi.IAssetRegistry, displayEngineApi.IDisplayProvider]).then(function(context1) {
                ballooniesIXFAnimation.ExternalService.initialize(context1);
                var vbf = context1.getAnyService(viewBuilderApi.IViewBuilderFactory, null);
                ballooniesIXFAnimation.ExternalService.viewBuilderFactory = vbf;
                context1.registerService(new ballooniesIXFAnimation.AnimationFactory(vbf, context1), ballooniesIXFAnimationDeclaration.AnimationDeclaration, null);
            });
        };
        ballooniesIXFAnimation.Activator.prototype.stop = function(context) {};
        ballooniesIXFAnimation.Activator.main = function() {};
        ballooniesIXFAnimation.Activator.prototype.__class__ = ballooniesIXFAnimation.Activator;
        ballooniesIXFAnimation.Animation = function(context, vbf, cfgId) {
            this.initialized = false;
            this.layoutPayload = null;
            this.vba = null;
            var _g = this;
            this.vbf = vbf;
            this.cfgId = cfgId;
            this.context = context;
            this.port = context.getImplementedPort(ballooniesIXFAnimationPort.IAnimationImplementationPort);
            this.layoutPort = context.getUsedPort(gameLayoutApi.IGameLayoutPort);
            this.layoutPort.getUpdateComponentLayout().subscribe($bind(this, this.updateLayout));
            ballooniesIXFAnimation.ExternalService.assetRegistry.getAsset(cfgId).getContent().then(function(vba) {
                _g.vba = vba;
                _g.initialize();
            });
        };
        ballooniesIXFAnimation.Animation.__name__ = ["ballooniesIXFAnimation", "Animation"];
        ballooniesIXFAnimation.Animation.prototype.view = null;
        ballooniesIXFAnimation.Animation.prototype.component = null;
        ballooniesIXFAnimation.Animation.prototype.cfgId = null;
        ballooniesIXFAnimation.Animation.prototype.context = null;
        ballooniesIXFAnimation.Animation.prototype.vba = null;
        ballooniesIXFAnimation.Animation.prototype.vbf = null;
        ballooniesIXFAnimation.Animation.prototype.controller = null;
        ballooniesIXFAnimation.Animation.prototype.layoutPayload = null;
        ballooniesIXFAnimation.Animation.prototype.initialized = null;
        ballooniesIXFAnimation.Animation.prototype.port = null;
        ballooniesIXFAnimation.Animation.prototype.layoutPort = null;
        ballooniesIXFAnimation.Animation.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());
            }
        };
        ballooniesIXFAnimation.Animation.prototype.initialize = function() {
            if (!this.initialized && this.vba != null && this.layoutPayload != null) {
                this.controller = new ballooniesIXFAnimation.AnimationController(this);
                this.view = this.vbf.createView(this.vba);
                this.registerAllComponents();
                this.controller.init();
                this.controller.updateLayout(this.layoutPayload);
                this.layoutPort.getComponentLayoutUpdated().publish(this.context.getInstance());
                this.initialized = true;
            }
        };
        ballooniesIXFAnimation.Animation.prototype.registerAllComponents = function() {
            var parts = new _hcmn_.List();
            var $it0 = (function($this) {
                var $r;
                var this1 = $this.view.getChildComponents();
                $r = this1.keys();
                return $r;
            }(this));
            while ($it0.hasNext()) {
                var compId = $it0.next();
                var comp = this.idToComponentEnum(compId);
                if (comp != ballooniesIXFAnimationPort.AnimationComponent.NONE) this.registerComponent(comp);
            }
        };
        ballooniesIXFAnimation.Animation.prototype.idToComponentEnum = function(id) {
            var ind;
            var _this = _hcmn_.Type.getEnumConstructs(ballooniesIXFAnimationPort.AnimationComponent);
            ind = _hcmn_.HxOverrides.indexOf(_this, id, 0);
            if (ind < 0) return ballooniesIXFAnimationPort.AnimationComponent.NONE;
            return _hcmn_.Type.createEnum(ballooniesIXFAnimationPort.AnimationComponent, id, null);
        };
        ballooniesIXFAnimation.Animation.prototype.registerComponent = function(componentEnum) {
            this.component = null;
            switch (componentEnum[1]) {
                case 3:
                    this.registerContainerComponent(ballooniesIXFAnimationPort.AnimationComponent.BASE_REEL_FRAME, ballooniesIXFAnimation.ReelFrames);
                    break;
                case 4:
                    this.registerContainerComponent(ballooniesIXFAnimationPort.AnimationComponent.BONUS_REEL_FRAME, ballooniesIXFAnimation.ReelFrames);
                    break;
                case 5:
                    this.registerContainerComponent(ballooniesIXFAnimationPort.AnimationComponent.MAINLOGO, ballooniesIXFAnimation.ReelMaskComponent);
                    this.registerContainerComponent(ballooniesIXFAnimationPort.AnimationComponent.MAINLOGO, ballooniesIXFAnimation.Logo);
                    break;
                case 2:
                    this.registerContainerComponent(ballooniesIXFAnimationPort.AnimationComponent.STAR_MULTIPLIER, ballooniesIXFAnimation.StarMultiplier);
                    break;
                case 0:
                    this.registerContainerComponent(ballooniesIXFAnimationPort.AnimationComponent.MULTIPLIER, ballooniesIXFAnimation.ReelMultiplier);
                    break;
                case 1:
                    this.registerContainerComponent(ballooniesIXFAnimationPort.AnimationComponent.RAINBOW, ballooniesIXFAnimation.Rainbow);
                    break;
                default:
                    return false;
            }
            return true;
        };
        ballooniesIXFAnimation.Animation.prototype.registerContainerComponent = function(componentEnum, componentClass) {
            var container = this.view.getComponentById(componentEnum[0]);
            if (container != null) {
                this.component = _hcmn_.Type.createInstance(componentClass, [container]);
                ballooniesIXFAnimation.Animation.COMPONENTS.set(componentEnum, this.component);
            }
        };
        ballooniesIXFAnimation.Animation.prototype.getComponent = function() {
            return this.component;
        };
        ballooniesIXFAnimation.Animation.prototype.isComponent = function(key) {
            return this.getComponent() == this.getComponentByKey(key);
        };
        ballooniesIXFAnimation.Animation.prototype.getComponentByKey = function(key) {
            return ballooniesIXFAnimation.Animation.COMPONENTS.get(key);
        };
        ballooniesIXFAnimation.Animation.prototype.__class__ = ballooniesIXFAnimation.Animation;
        ballooniesIXFAnimation.AnimationController = function(animation) {
            this.isAddedToStage = false;
            this.animation = animation;
        };
        ballooniesIXFAnimation.AnimationController.__name__ = ["ballooniesIXFAnimation", "AnimationController"];
        ballooniesIXFAnimation.AnimationController.prototype.isAddedToStage = null;
        ballooniesIXFAnimation.AnimationController.prototype.animation = null;
        ballooniesIXFAnimation.AnimationController.prototype.init = function() {
            this.animation.port.getAnimationAction().subscribe($bind(this, this.onAnimationAction));
        };
        ballooniesIXFAnimation.AnimationController.prototype.updateLayout = function(layoutPayload) {
            var $it0 = layoutPayload.containers.keys();
            while ($it0.hasNext()) {
                var layerId = $it0.next();
                var layerPayload = layoutPayload.containers.get(layerId);
                var cfg = layerPayload.configuration;
                var stage;
                var this2 = ballooniesIXFAnimation.ExternalService.displayProvider.getStages();
                stage = this2.get(layerPayload.stage);
                var container = ((function($this) {
                    var $r;
                    var this1 = $this.animation.view.getChildComponents();
                    $r = this1.get(layerId);
                    return $r;
                }(this))).getDisplayObject();
                if (!this.isAddedToStage) 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);
                if (cfg == null) continue;
                this.animation.getComponent().configure(cfg);
            }
            if (!this.isAddedToStage) this.isAddedToStage = true;
        };
        ballooniesIXFAnimation.AnimationController.prototype.onAnimationAction = function(e) {
            var animationAction = e.getPayload();
            var animationComponent = animationAction.animationComponent;
            if (this.animation.isComponent(animationComponent)) this.handleAnimationAction(animationAction);
        };
        ballooniesIXFAnimation.AnimationController.prototype.handleAnimationAction = function(action) {
            var component = this.animation.getComponent();
            var _g = action.action;
            switch (_g[1]) {
                case 0:
                    component.show();
                    break;
                case 1:
                    component.hide();
                    break;
                default:
                    component.action(action);
            }
        };
        ballooniesIXFAnimation.AnimationController.prototype.__class__ = ballooniesIXFAnimation.AnimationController;
        ballooniesIXFAnimation.AnimationFactory = function(vbf, context) {
            this.context = context;
            this.vbf = vbf;
        };
        ballooniesIXFAnimation.AnimationFactory = ck_implements(ballooniesIXFAnimation.AnimationFactory, clientkernelModulesApi.IService);
        ballooniesIXFAnimation.AnimationFactory = ck_implements(ballooniesIXFAnimation.AnimationFactory, componentmodelComponentApi.IComponentFactory);
        ballooniesIXFAnimation.AnimationFactory.__interfaces__ = [clientkernelModulesApi.IService, componentmodelComponentApi.IComponentFactory];
        ballooniesIXFAnimation.AnimationFactory.__name__ = ["ballooniesIXFAnimation", "AnimationFactory"];
        ballooniesIXFAnimation.AnimationFactory.prototype.vbf = null;
        ballooniesIXFAnimation.AnimationFactory.prototype.context = null;
        ballooniesIXFAnimation.AnimationFactory.prototype.getComponentDeclaration = function() {
            return ballooniesIXFAnimationDeclaration.AnimationDeclaration;
        };
        ballooniesIXFAnimation.AnimationFactory.prototype.createComponent = function(context) {
            var cfgId = context.getConfiguration();
            new ballooniesIXFAnimation.Animation(context, this.vbf, cfgId);
        };
        ballooniesIXFAnimation.AnimationFactory.prototype.__class__ = ballooniesIXFAnimation.AnimationFactory;
        ballooniesIXFAnimation.ExternalService = function() {};
        ballooniesIXFAnimation.ExternalService.__name__ = ["ballooniesIXFAnimation", "ExternalService"];
        ballooniesIXFAnimation.ExternalService.displayProvider = null;
        ballooniesIXFAnimation.ExternalService.assetRegistry = null;
        ballooniesIXFAnimation.ExternalService.viewBuilderFactory = null;
        ballooniesIXFAnimation.ExternalService.bus = null;
        ballooniesIXFAnimation.ExternalService.variableRegistry = null;
        ballooniesIXFAnimation.ExternalService.initialize = function(context) {
            ballooniesIXFAnimation.ExternalService.displayProvider = context.getAnyService(displayEngineApi.IDisplayProvider, null);
            ballooniesIXFAnimation.ExternalService.assetRegistry = context.getAnyService(clientkernelLoaderApi.IAssetRegistry, null);
            ballooniesIXFAnimation.ExternalService.variableRegistry = context.getAnyService(clientkernelLoaderApi.IVariableRegistry, null);
            ballooniesIXFAnimation.ExternalService.bus = context.getAnyService(clientkernelEventbusApi.IEventBus, null);
        };
        ballooniesIXFAnimation.ExternalService.getBus = function() {
            return ballooniesIXFAnimation.ExternalService.bus;
        };
        ballooniesIXFAnimation.ExternalService.loadConfig = function(config_id, configCallback) {
            ballooniesIXFAnimation.ExternalService.assetRegistry.getAsset(config_id).getContent().then(function(data) {
                configCallback(data);
            });
        };
        ballooniesIXFAnimation.ExternalService.prototype.__class__ = ballooniesIXFAnimation.ExternalService;

        ballooniesIXFAnimation.IAnimationComponent = function() {}
        ballooniesIXFAnimation.IAnimationComponent.prototype = {

            action: function(state) {
                return {
                    arguments: ["*"],
                    returns: "void"
                };
            },
            show: function() {
                return {
                    arguments: [],
                    returns: "void"
                };
            },
            hide: function() {
                return {
                    arguments: [],
                    returns: "void"
                };
            },
            configure: function(cfg) {
                return {
                    arguments: ["*"],
                    returns: "void"
                };
            }
        };
        ballooniesIXFAnimation.Logo = function(container) {
            this.playTimeoutId = 0;
            this.gameXOffset = 0;
            var _g = this;
            this.container = container;
            container.show();
            var gfBus = ballooniesIXFAnimation.ExternalService.bus.getChannel("GFBus");
            gfBus.subscribe(ballooniesIXFAnimation.Logo.HEADER_EYES_LOOK_ON_THIS_EVENT, $bind(this, this.onLookOnThisPointHandler));
            this.logoheader = container.getComponentById("LOGOHEADER");
            this.logoheader.addEventListener(ballooniesIXFAnimation.Logo.HEADER_EYES_END_EVENT, function() {
                _g.pauseAnimation();
                var timeout = (_hcmn_.Std.random(10) + 5) * 1000;
                _g.playTimeoutId = window.setTimeout($bind(_g, _g.playAnimation), timeout);
            });
            this.logoheader.addEventListener(ballooniesIXFAnimation.Logo.HEADER_EYES_BLINK_EVENT, function() {
                gfBus.publish(ballooniesIXFAnimation.Logo.HEADER_EYES_BLINK_EVENT, null);
            });
            this.logoheader.getDisplayObject().setVisible(true);
            this.logoheader.play(false);
            this.collectEyesValues();
            window.document.body.onmousemove = $bind(this, this.onMouseMove);
        };
        ballooniesIXFAnimation.Logo = ck_implements(ballooniesIXFAnimation.Logo, ballooniesIXFAnimationPort.IMainLogo);
        ballooniesIXFAnimation.Logo = ck_implements(ballooniesIXFAnimation.Logo, ballooniesIXFAnimation.IAnimationComponent);
        ballooniesIXFAnimation.Logo.__interfaces__ = [ballooniesIXFAnimationPort.IMainLogo, ballooniesIXFAnimation.IAnimationComponent];
        ballooniesIXFAnimation.Logo.__name__ = ["ballooniesIXFAnimation", "Logo"];
        ballooniesIXFAnimation.Logo.prototype.container = null;
        ballooniesIXFAnimation.Logo.prototype.logoheader = null;
        ballooniesIXFAnimation.Logo.prototype.rightEye = null;
        ballooniesIXFAnimation.Logo.prototype.rightEyeInitialPosition = null;
        ballooniesIXFAnimation.Logo.prototype.leftEye = null;
        ballooniesIXFAnimation.Logo.prototype.leftEyeInitialPosition = null;
        ballooniesIXFAnimation.Logo.prototype.gameXOffset = null;
        ballooniesIXFAnimation.Logo.prototype.playTimeoutId = null;
        ballooniesIXFAnimation.Logo.prototype.onLookOnThisPointHandler = function(e) {
            this.lookOnThisPoint(e.getPayload());
        };
        ballooniesIXFAnimation.Logo.prototype.playAnimation = function() {
            this.logoheader.play(false);
        };
        ballooniesIXFAnimation.Logo.prototype.pauseAnimation = function() {
            this.logoheader.gotoAndStop(false, "firstFrame");
            window.clearTimeout(this.playTimeoutId);
        };
        ballooniesIXFAnimation.Logo.prototype.collectEyesValues = function() {
            this.rightEye = this.logoheader.getContainerById("leftEye").getDisplayObject();
            this.leftEye = this.logoheader.getContainerById("rightEye").getDisplayObject();
            this.rightEyeInitialPosition = new displayEngineApi.Point(this.rightEye.getX(), this.rightEye.getY());
            this.leftEyeInitialPosition = new displayEngineApi.Point(this.leftEye.getX(), this.leftEye.getY());
            this.gameXOffset = _hcmn_.Std.parseInt(window.document.getElementById("skgl_0").style.left);
        };
        ballooniesIXFAnimation.Logo.prototype.onMouseMove = function(e) {
            var mousePosition = new displayEngineApi.Point(e.x - this.gameXOffset, e.y);
            this.lookOnThisPoint(mousePosition);
        };
        ballooniesIXFAnimation.Logo.prototype.lookOnThisPoint = function(position) {
            ballooniesIXFAnimation.Logo.moveElement(this.rightEye, this.rightEyeInitialPosition, position);
            ballooniesIXFAnimation.Logo.moveElement(this.leftEye, this.leftEyeInitialPosition, position);
        };
        ballooniesIXFAnimation.Logo.prototype.action = function(action) {
            var _g = action.action;
            switch (_g[1]) {
                case 3:
                    this.wakeUp();
                    break;
                case 2:
                    this.sleep();
                    break;
                default:
            }
        };
        ballooniesIXFAnimation.Logo.prototype.show = function() {
            this.container.show();
        };
        ballooniesIXFAnimation.Logo.prototype.sleep = function() {
            this.pauseAnimation();
        };
        ballooniesIXFAnimation.Logo.prototype.wakeUp = function() {
            this.playAnimation();
        };
        ballooniesIXFAnimation.Logo.prototype.hide = function() {
            this.container.hide();
        };
        ballooniesIXFAnimation.Logo.prototype.configure = function(config) {
            this.collectEyesValues();
        };
        ballooniesIXFAnimation.Logo.moveElement = function(element, initialPoint, mousePosition) {
            var vector = ballooniesIXFAnimation.Logo.getVectorToPoint(element, initialPoint, mousePosition);
            var point = ballooniesIXFAnimation.Logo.getPointToMoveElement(initialPoint, vector);
            element.setPos(point.x, point.y);
        };
        ballooniesIXFAnimation.Logo.getVectorToPoint = function(element, initialPoint, mousePosition) {
            var localVector = element.getParent().globalToLocal(mousePosition.x, mousePosition.y);
            return new displayEngineApi.Point(localVector.x - initialPoint.x, localVector.y - initialPoint.y);
        };
        ballooniesIXFAnimation.Logo.getPointToMoveElement = function(initialPoint, vector) {
            var distanceScale = .01;
            var eyeRadius = 10;
            var distance = ballooniesIXFAnimation.PointMath.getDistance(new displayEngineApi.Point(0, 0), vector);
            var distanceToMove = _hcmn_.Math.min(eyeRadius, distance * distanceScale);
            return ballooniesIXFAnimation.PointMath.movePointByVector(initialPoint, vector, distanceToMove);
        };
        ballooniesIXFAnimation.Logo.prototype.__class__ = ballooniesIXFAnimation.Logo;
        ballooniesIXFAnimation.Rainbow = function(container) {
            this.isRotated = false;
            this.width = 0.0;
            this.gameXOffset = 0;
            this.currentMultiplier = 0;
            this.container = container;
            container.show();
            this.multiplier = container.getComponentById("ANIMATION_HOLDER");
            this.width = this.multiplier.getDisplayObject().getWidth();
            this.multiplier.gotoAndStop(false, "INVISIBLE");
            this.gfBus = ballooniesIXFAnimation.ExternalService.bus.getChannel("GFBus");
            this.gfBus.subscribe("COLLECT_MULTIPLIER", $bind(this, this.onCollectMultiplier));
            this.gfBus.subscribe("UPDATE_MULTIPLIER", $bind(this, this.onUpdateMultiplier));
            this.multiplier.addEventListener("MULTIPLIER::RAINBOW:END", $bind(this, this.onRainbowCompleted));
            this.gameXOffset = _hcmn_.Std.parseInt(window.document.getElementById("skgl_0").style.left);
        };
        ballooniesIXFAnimation.Rainbow = ck_implements(ballooniesIXFAnimation.Rainbow, ballooniesIXFAnimation.IAnimationComponent);
        ballooniesIXFAnimation.Rainbow.__interfaces__ = [ballooniesIXFAnimation.IAnimationComponent];
        ballooniesIXFAnimation.Rainbow.__name__ = ["ballooniesIXFAnimation", "Rainbow"];
        ballooniesIXFAnimation.Rainbow.prototype.container = null;
        ballooniesIXFAnimation.Rainbow.prototype.multiplier = null;
        ballooniesIXFAnimation.Rainbow.prototype.currentMultiplier = null;
        ballooniesIXFAnimation.Rainbow.prototype.gameXOffset = null;
        ballooniesIXFAnimation.Rainbow.prototype.width = null;
        ballooniesIXFAnimation.Rainbow.prototype.gfBus = null;
        ballooniesIXFAnimation.Rainbow.prototype.endPoint = null;
        ballooniesIXFAnimation.Rainbow.prototype.isRotated = null;
        ballooniesIXFAnimation.Rainbow.prototype.onRainbowCompleted = function(e) {
            this.multiplier.gotoAndStop(false, "INVISIBLE");
            this.gfBus.publish("RAINBOW_COMPLETED", null);
        };
        ballooniesIXFAnimation.Rainbow.prototype.onMouseMove = function(e) {
            this.gameXOffset = _hcmn_.Std.parseInt(window.document.getElementById("skgl_0").style.left);
            var mousePosition = new displayEngineApi.Point(e.x - this.gameXOffset, e.y);
            this.multiplier.gotoAndPlay(false, "START");
            this.play(mousePosition);
        };
        ballooniesIXFAnimation.Rainbow.prototype.play = function(position) {
            var element = this.multiplier.getDisplayObject();
            var point = element.getParent().globalToLocal(position.x, position.y);
            element.setPos(point.x, point.y);
            var stageScaleX = element.getParent().getParent().getScaleX();
            var stageScaleY = element.getParent().getParent().getScaleY();
            var endPoint = element.getParent().localToGlobal(this.endPoint.x, this.endPoint.y);
            var angle = ballooniesIXFAnimation.GuiMath.angleOfVector(ballooniesIXFAnimation.GuiMath.subtractPoint(endPoint, position));
            var length = ballooniesIXFAnimation.GuiMath.getPointLength(ballooniesIXFAnimation.GuiMath.subtractPoint(endPoint, position));
            var scale = length / this.width;
            element.setWidth(length / stageScaleX);
            element.setScaleY(angle > 90 ? -1 : 1);
            element.setRotation(angle);
        };
        ballooniesIXFAnimation.Rainbow.prototype.onCollectMultiplier = function(e) {
            this.collectMultiplier(e.getPayload());
        };
        ballooniesIXFAnimation.Rainbow.prototype.onUpdateMultiplier = function(e) {
            if (this.multiplier.isPlaying() && this.isRotated) {
                var data = e.getPayload();
                this.play(data.position);
            }
            this.isRotated = false;
        };
        ballooniesIXFAnimation.Rainbow.prototype.collectMultiplier = function(data) {
            this.multiplier.gotoAndPlay(false, "START");
            this.play(data.position);
            this.gfBus.publish(ballooniesIXFAnimation.Logo.HEADER_EYES_LOOK_ON_THIS_EVENT, data.position);
        };
        ballooniesIXFAnimation.Rainbow.prototype.action = function(action) {};
        ballooniesIXFAnimation.Rainbow.prototype.show = function() {
            this.container.show();
        };
        ballooniesIXFAnimation.Rainbow.prototype.hide = function() {
            this.container.hide();
        };
        ballooniesIXFAnimation.Rainbow.prototype.configure = function(config) {
            this.gameXOffset = _hcmn_.Std.parseInt(window.document.getElementById("skgl_0").style.left);
            if (this.endPoint != null && this.endPoint.x != config.endPointX) {
                if (this.multiplier.isPlaying()) this.isRotated = true;
            }
            this.endPoint = new displayEngineApi.Point(config.endPointX, config.endPointY);
        };
        ballooniesIXFAnimation.Rainbow.prototype.__class__ = ballooniesIXFAnimation.Rainbow;
        ballooniesIXFAnimation.ReelFrames = function(container) {
            this.container = container;
            container.show();
        };
        ballooniesIXFAnimation.ReelFrames = ck_implements(ballooniesIXFAnimation.ReelFrames, ballooniesIXFAnimation.IAnimationComponent);
        ballooniesIXFAnimation.ReelFrames.__interfaces__ = [ballooniesIXFAnimation.IAnimationComponent];
        ballooniesIXFAnimation.ReelFrames.__name__ = ["ballooniesIXFAnimation", "ReelFrames"];
        ballooniesIXFAnimation.ReelFrames.prototype.container = null;
        ballooniesIXFAnimation.ReelFrames.prototype.action = function(action) {};
        ballooniesIXFAnimation.ReelFrames.prototype.show = function() {
            this.container.show();
        };
        ballooniesIXFAnimation.ReelFrames.prototype.hide = function() {
            this.container.getDisplayObject().setCacheAsBitmap(false);
            this.container.hide();
        };
        ballooniesIXFAnimation.ReelFrames.prototype.configure = function(config) {};
        ballooniesIXFAnimation.ReelFrames.prototype.__class__ = ballooniesIXFAnimation.ReelFrames;

        ballooniesIXFAnimation.IStaticComponent = function() {}
        ballooniesIXFAnimation.IStaticComponent.prototype = {

            show: function() {
                return {
                    arguments: [],
                    returns: "void"
                };
            },
            hide: function() {
                return {
                    arguments: [],
                    returns: "void"
                };
            },
            configure: function(cfg) {
                return {
                    arguments: ["*"],
                    returns: "void"
                };
            }
        };
        ballooniesIXFAnimation.ReelMaskComponent = function(container) {
            this.RELL_FRAME_MASK_POINTS = [
                [40, 0],
                [1300, 0],
                [1340, 40],
                [1340, 720],
                [1300, 760],
                [40, 760],
                [0, 720],
                [0, 40],
                [40, 0],
                [0, 0]
            ];
            this.container = container;
            container.show();
            this.waitStageIsPresent($bind(this, this.applyMasks));
        };
        ballooniesIXFAnimation.ReelMaskComponent = ck_implements(ballooniesIXFAnimation.ReelMaskComponent, ballooniesIXFAnimation.IStaticComponent);
        ballooniesIXFAnimation.ReelMaskComponent.__interfaces__ = [ballooniesIXFAnimation.IStaticComponent];
        ballooniesIXFAnimation.ReelMaskComponent.__name__ = ["ballooniesIXFAnimation", "ReelMaskComponent"];
        ballooniesIXFAnimation.ReelMaskComponent.prototype.RELL_FRAME_MASK_POINTS = null;
        ballooniesIXFAnimation.ReelMaskComponent.prototype.container = null;
        ballooniesIXFAnimation.ReelMaskComponent.prototype.waitStageIsPresent = function(calback) {
            var _g = this;
            this.wait(this.getParentIsStageBoolSupplier(), function() {
                calback(_hcmn_.js_Boot.__cast(_g.container.getDisplayObject().getParent(), displayEngineApi.IStage));
            });
        };
        ballooniesIXFAnimation.ReelMaskComponent.prototype.applyMasks = function(stage) {
            var _g = this;
            this.wait(this.getChildsIsPresentBoolSupplier(stage, ["layout"]), function() {
                var layout = stage.getChildByID("layout");
                _g.addMask(layout, _g.RELL_FRAME_MASK_POINTS, -20, -20);
            });
        };
        ballooniesIXFAnimation.ReelMaskComponent.prototype.wait = function(booleanSupplier, calback) {
            var intervalId = 0;
            intervalId = window.setInterval(function() {
                if (booleanSupplier()) {
                    window.clearInterval(intervalId);
                    calback();
                }
            }, 100);
        };
        ballooniesIXFAnimation.ReelMaskComponent.prototype.getParentIsStageBoolSupplier = function() {
            var _g = this;
            return function() {
                return _hcmn_.Std["is"](_g.container.getDisplayObject().getParent(), displayEngineApi.IStage);
            };
        };
        ballooniesIXFAnimation.ReelMaskComponent.prototype.getChildsIsPresentBoolSupplier = function(stage, childs) {
            var _g = this;
            return function() {
                return _g.isChildsPresent(stage, childs);
            };
        };
        ballooniesIXFAnimation.ReelMaskComponent.prototype.isChildsPresent = function(stage, childs) {
            var _g = 0;
            while (_g < childs.length) {
                var childName = childs[_g];
                ++_g;
                if (stage.getChildByID(childName) == null) return false;
            }
            return true;
        };
        ballooniesIXFAnimation.ReelMaskComponent.prototype.showMask = function(container, points, paddingX, paddingY) {
            if (paddingY == null) paddingY = 0;
            if (paddingX == null) paddingX = 0;
            if (container.getMask() != null) container.removeChild(container.getMask());
            var mask = container.getChildByName("mask");
            if (mask != null) container.removeChild(mask);
            mask = this.getMask(points, paddingX, paddingY, .5);
            mask.setName("mask");
            container.setCacheAsBitmap(false);
            container.addChildAt(mask, 0);
            var bigMask = this.getMask(ballooniesIXFAnimation.ReelMaskComponent.BIG_RELL_FRAME_MASK_POINTS, -100, -100, 0);
            container.setMask(bigMask);
            container.setCacheAsBitmap(true);
        };
        ballooniesIXFAnimation.ReelMaskComponent.prototype.addMask = function(container, points, paddingX, paddingY) {
            if (paddingY == null) paddingY = 0;
            if (paddingX == null) paddingX = 0;
            var mask = this.getMask(points, paddingX, paddingY, 0);
            if (container.getMask() != null) container.removeChild(container.getMask());
            container.setMask(mask);
        };
        ballooniesIXFAnimation.ReelMaskComponent.prototype.getMask = function(points, paddingX, paddingY, alpha) {
            if (alpha == null) alpha = 0;
            if (paddingY == null) paddingY = 0;
            if (paddingX == null) paddingX = 0;
            var mask = ballooniesIXFAnimation.ExternalService.displayProvider.getFactory().createGraphics();
            mask.beginFill(16711680, alpha);
            mask.moveTo(points[0][0], points[0][1]);
            var _g = 0;
            while (_g < points.length) {
                var point = points[_g];
                ++_g;
                mask.lineTo(point[0], point[1]);
            }
            mask.endFill();
            mask.setX(paddingX);
            mask.setY(paddingY);
            return mask;
        };
        ballooniesIXFAnimation.ReelMaskComponent.prototype.show = function() {
            this.container.show();
        };
        ballooniesIXFAnimation.ReelMaskComponent.prototype.hide = function() {
            this.container.hide();
        };
        ballooniesIXFAnimation.ReelMaskComponent.prototype.configure = function(config) {};
        ballooniesIXFAnimation.ReelMaskComponent.prototype.__class__ = ballooniesIXFAnimation.ReelMaskComponent;
        ballooniesIXFAnimation.ReelMultiplier = function(container) {
            this.gameXOffset = 0;
            this.container = container;
            container.show();
            this.multiplier = container.getComponentById("ANIMATION_HOLDER");
            this.multiplier.gotoAndStop(false, "INVISIBLE");
            this.gfBus = ballooniesIXFAnimation.ExternalService.bus.getChannel("GFBus");
            this.gfBus.subscribe("SHOW_MULTIPLIER", $bind(this, this.onCollectMultiplier));
            this.gameXOffset = _hcmn_.Std.parseInt(window.document.getElementById("skgl_0").style.left);
        };
        ballooniesIXFAnimation.ReelMultiplier = ck_implements(ballooniesIXFAnimation.ReelMultiplier, ballooniesIXFAnimation.IAnimationComponent);
        ballooniesIXFAnimation.ReelMultiplier.__interfaces__ = [ballooniesIXFAnimation.IAnimationComponent];
        ballooniesIXFAnimation.ReelMultiplier.__name__ = ["ballooniesIXFAnimation", "ReelMultiplier"];
        ballooniesIXFAnimation.ReelMultiplier.prototype.container = null;
        ballooniesIXFAnimation.ReelMultiplier.prototype.multiplier = null;
        ballooniesIXFAnimation.ReelMultiplier.prototype.gameXOffset = null;
        ballooniesIXFAnimation.ReelMultiplier.prototype.gfBus = null;
        ballooniesIXFAnimation.ReelMultiplier.prototype.playData = null;
        ballooniesIXFAnimation.ReelMultiplier.prototype.onMultiplierShown = function() {
            this.multiplier.removeEventListener("MULTIPLIER::SHOWN");
            this.multiplier.gotoAndStop(false, "INVISIBLE");
            this.gfBus.publish("MULTIPLIER_SHOWN", this.playData);
            this.playData = null;
        };
        ballooniesIXFAnimation.ReelMultiplier.prototype.onMouseMove = function(e) {
            this.gameXOffset = _hcmn_.Std.parseInt(window.document.getElementById("skgl_0").style.left);
            var mousePosition = new displayEngineApi.Point(e.x - this.gameXOffset, e.y);
            this.play(mousePosition);
        };
        ballooniesIXFAnimation.ReelMultiplier.prototype.setPosition = function(position) {
            var element = this.multiplier.getDisplayObject();
            var point = element.getParent().globalToLocal(position.x, position.y);
            element.setPos(point.x, point.y);
        };
        ballooniesIXFAnimation.ReelMultiplier.prototype.play = function(position) {
            this.multiplier.addEventListener("MULTIPLIER::SHOWN", $bind(this, this.onMultiplierShown));
            this.setPosition(position);
            this.multiplier.gotoAndPlay(false, "COLLECT");
        };
        ballooniesIXFAnimation.ReelMultiplier.prototype.onCollectMultiplier = function(e) {
            this.setPosition(e.getPayload().position);
            this.collectMultiplier(e.getPayload());
        };
        ballooniesIXFAnimation.ReelMultiplier.prototype.collectMultiplier = function(data) {
            this.playData = data;
            this.updateMultiplierValue(data.amount);
            this.play(data.position);
            this.gfBus.publish(ballooniesIXFAnimation.Logo.HEADER_EYES_LOOK_ON_THIS_EVENT, data.position);
        };
        ballooniesIXFAnimation.ReelMultiplier.prototype.updateMultiplierValue = function(value) {
            var multiplierLabel = this.multiplier.getContainerById("mc").getLabelById("reelMultiplierValue");
            multiplierLabel.setText(value + "x");
            this.multiplier.gotoAndPlay(false, "COLLECT");
        };
        ballooniesIXFAnimation.ReelMultiplier.prototype.action = function(action) {};
        ballooniesIXFAnimation.ReelMultiplier.prototype.show = function() {
            this.container.show();
        };
        ballooniesIXFAnimation.ReelMultiplier.prototype.hide = function() {
            this.container.hide();
        };
        ballooniesIXFAnimation.ReelMultiplier.prototype.configure = function(config) {
            this.gameXOffset = _hcmn_.Std.parseInt(window.document.getElementById("skgl_0").style.left);
        };
        ballooniesIXFAnimation.ReelMultiplier.prototype.__class__ = ballooniesIXFAnimation.ReelMultiplier;
        ballooniesIXFAnimation.StarMultiplier = function(container) {
            this.isActivated = false;
            this.isIdleState = false;
            this.multipliersSet = [];
            this.currentMultiplier = 0;
            this.isOpened = false;
            this.container = container;
            container.show();
            this.star = container.getComponentById("ANIMATION_HOLDER");
            this.star.getDisplayObject().setVisible(true);
            this.star.gotoAndStop(false, "INVISIBLE");
            this.gfBus = ballooniesIXFAnimation.ExternalService.bus.getChannel("GFBus");
            this.gfBus.subscribe("CLOSE_MULTIPLIER", $bind(this, this.onCloseMultiplier));
            this.gfBus.subscribe("COLLECT_MULTIPLIER", $bind(this, this.onCollectMultiplier));
            this.gfBus.subscribe("COLLECT_SET_OF_MULTIPLIERS", $bind(this, this.onCollectSetOfMultipliers));
            this.star.addEventListener("INIT_IDLE_STATE", $bind(this, this.onInitIdleState));
            this.loadConfig();
        };
        ballooniesIXFAnimation.StarMultiplier = ck_implements(ballooniesIXFAnimation.StarMultiplier, ballooniesIXFAnimation.IAnimationComponent);
        ballooniesIXFAnimation.StarMultiplier.__interfaces__ = [ballooniesIXFAnimation.IAnimationComponent];
        ballooniesIXFAnimation.StarMultiplier.__name__ = ["ballooniesIXFAnimation", "StarMultiplier"];
        ballooniesIXFAnimation.StarMultiplier.prototype.container = null;
        ballooniesIXFAnimation.StarMultiplier.prototype.star = null;
        ballooniesIXFAnimation.StarMultiplier.prototype.isOpened = null;
        ballooniesIXFAnimation.StarMultiplier.prototype.currentMultiplier = null;
        ballooniesIXFAnimation.StarMultiplier.prototype.multipliersSet = null;
        ballooniesIXFAnimation.StarMultiplier.prototype.gfBus = null;
        ballooniesIXFAnimation.StarMultiplier.prototype.isIdleState = null;
        ballooniesIXFAnimation.StarMultiplier.prototype.multiplierConfig = null;
        ballooniesIXFAnimation.StarMultiplier.prototype.isActivated = null;
        ballooniesIXFAnimation.StarMultiplier.prototype.loadConfig = function() {
            var _g = this;
            ballooniesIXFAnimation.ExternalService.loadConfig("multiplier_config", function(config) {
                _g.multiplierConfig = config;
            });
        };
        ballooniesIXFAnimation.StarMultiplier.prototype.onCollectMultiplier = function(e) {
            this.collectMultiplier(e.getPayload());
        };
        ballooniesIXFAnimation.StarMultiplier.prototype.onCollectSetOfMultipliers = function(e) {
            this.collectSetOfMultipliers(e.getPayload());
        };
        ballooniesIXFAnimation.StarMultiplier.prototype.onCloseMultiplier = function(e) {
            this.closeMultiplier();
        };
        ballooniesIXFAnimation.StarMultiplier.prototype.onInitIdleState = function() {
            var _g = this;
            if (!this.isIdleState) {
                this.isIdleState = true;
                if (this.currentMultiplier > 0) this.gfBus.publish("COLLECT_MULTIPLIER_END", null);
                if (this.isActivated) _hcmn_.haxe_Timer.delay(function() {
                    _g.updateMultiplierLabel();
                }, this.multiplierConfig.multiplierUpdatingDelay);
                else this.activateStar();
            }
        };
        ballooniesIXFAnimation.StarMultiplier.prototype.activateStar = function() {
            this.isActivated = true;
            this.updateMultiplierLabel("");
            this.star.gotoAndPlay(false, "SPAWN");
        };
        ballooniesIXFAnimation.StarMultiplier.prototype.collectMultiplier = function(data) {
            this.isIdleState = false;
            this.isOpened = true;
            this.currentMultiplier += data.amount;
            if (this.isActivated) this.star.gotoAndPlay(false, "COLLECT");
            else this.activateStar();
        };
        ballooniesIXFAnimation.StarMultiplier.prototype.collectSetOfMultipliers = function(data) {
            this.isIdleState = false;
            this.isOpened = true;
            this.currentMultiplier = 0;
            this.multipliersSet.push(data);
            this.isActivated = true;
            this.updateMultiplierLabel("" + data + "x");
            this.star.gotoAndPlay(false, "SPAWN");
        };
        ballooniesIXFAnimation.StarMultiplier.prototype.getCurrentMultiplier = function() {
            var result = 0;
            var _g = 0;
            var _g1 = this.multipliersSet;
            while (_g < _g1.length) {
                var multiplier = _g1[_g];
                ++_g;
                result += multiplier;
            }
            result += this.currentMultiplier;
            return result;
        };
        ballooniesIXFAnimation.StarMultiplier.prototype.closeMultiplier = function() {
            if (this.isOpened) {
                this.isOpened = false;
                this.isIdleState = false;
                this.star.gotoAndPlay(false, "DIE");
                this.currentMultiplier = 0;
                this.multipliersSet = [];
                var position = this.star.getDisplayObject().getParent().localToGlobal(0, 0);
                this.gfBus.publish(ballooniesIXFAnimation.Logo.HEADER_EYES_LOOK_ON_THIS_EVENT, position);
                this.gfBus.publish("COLLECT_MULTIPLIER_CLOSED", null);
            }
            this.isActivated = false;
        };
        ballooniesIXFAnimation.StarMultiplier.prototype.updateMultiplierLabel = function(text) {
            var multiplierLabel = this.star.getContainerById("mc").getLabelById("starMultiplierValue");
            multiplierLabel.setText("");
            var multiplier = this.getCurrentMultiplier();
            var multiplierLabelText;
            if (text != null) multiplierLabelText = text;
            else multiplierLabelText = "" + multiplier + "x";
            multiplierLabel.setText(multiplierLabelText);
        };
        ballooniesIXFAnimation.StarMultiplier.prototype.action = function(action) {};
        ballooniesIXFAnimation.StarMultiplier.prototype.show = function() {
            this.container.show();
        };
        ballooniesIXFAnimation.StarMultiplier.prototype.hide = function() {
            this.container.hide();
        };
        ballooniesIXFAnimation.StarMultiplier.prototype.configure = function(config) {};
        ballooniesIXFAnimation.StarMultiplier.prototype.__class__ = ballooniesIXFAnimation.StarMultiplier;
        ballooniesIXFAnimation.MultiplierConfig = function() {};
        ballooniesIXFAnimation.MultiplierConfig.__name__ = ["ballooniesIXFAnimation", "MultiplierConfig"];
        ballooniesIXFAnimation.MultiplierConfig.prototype.multiplierUpdatingDelay = null;
        ballooniesIXFAnimation.MultiplierConfig.prototype.__class__ = ballooniesIXFAnimation.MultiplierConfig;
        ballooniesIXFAnimation.GuiMath = function() {};
        ballooniesIXFAnimation.GuiMath.__name__ = ["ballooniesIXFAnimation", "GuiMath"];
        ballooniesIXFAnimation.GuiMath.angleOfVector = function(vector) {
            var unitVector = ballooniesIXFAnimation.GuiMath.getUnitVector(vector);
            var a = _hcmn_.Math.acos(unitVector.x);
            if (unitVector.y < 0) a = _hcmn_.Math.PI * 2 - a;
            return ballooniesIXFAnimation.GuiMath.converRadToGrad(a);
        };
        ballooniesIXFAnimation.GuiMath.converRadToGrad = function(angle) {
            return angle / (2 * _hcmn_.Math.PI) * 360;
        };
        ballooniesIXFAnimation.GuiMath.subtractPoint = function(v1, v2) {
            return new displayEngineApi.Point(v1.x - v2.x, v1.y - v2.y);
        };
        ballooniesIXFAnimation.GuiMath.getPointLength = function(point) {
            return _hcmn_.Math.sqrt(point.x * point.x + point.y * point.y);
        };
        ballooniesIXFAnimation.GuiMath.getUnitVector = function(vector) {
            var length = ballooniesIXFAnimation.GuiMath.getPointLength(vector);
            return new displayEngineApi.Point(vector.x / length, vector.y / length);
        };
        ballooniesIXFAnimation.GuiMath.prototype.__class__ = ballooniesIXFAnimation.GuiMath;
        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.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.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 (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;
        ballooniesIXFAnimation.PointMath = function() {};
        ballooniesIXFAnimation.PointMath.__name__ = ["ballooniesIXFAnimation", "PointMath"];
        ballooniesIXFAnimation.PointMath.getDistance = function(point1, point2) {
            return _hcmn_.Math.sqrt(_hcmn_.Math.pow(point2.x - point1.x, 2) + _hcmn_.Math.pow(point2.y - point1.y, 2));
        };
        ballooniesIXFAnimation.PointMath.movePointByVector = function(point, vector, distance) {
            var length = _hcmn_.Math.sqrt(vector.x * vector.x + vector.y * vector.y);
            var unitVector = new displayEngineApi.Point(vector.x / length, vector.y / length);
            return new displayEngineApi.Point(point.x + unitVector.x * distance, point.y + unitVector.y * distance);
        };
        ballooniesIXFAnimation.PointMath.prototype.__class__ = ballooniesIXFAnimation.PointMath;
        ballooniesIXFAnimation.Animation.COMPONENTS = new haxe.ds.EnumValueMap();;
        ballooniesIXFAnimation.Logo.HEADER_EYES_END_EVENT = "HEADER::EYES::end";;
        ballooniesIXFAnimation.Logo.HEADER_EYES_BLINK_EVENT = "HEADER::EYES::blink";;
        ballooniesIXFAnimation.Logo.HEADER_EYES_LOOK_ON_THIS_EVENT = "HEADER::EYES::lookOnThis";;
        ballooniesIXFAnimation.ReelMaskComponent.BIG_RELL_FRAME_MASK_POINTS = [
            [0, 0],
            [1500, 0],
            [1500, 1500],
            [0, 1500],
            [0, 0]
        ];;
        return {
            exports: ballooniesIXFAnimation,
            activator: ballooniesIXFAnimation.Activator
        };
    });
//# sourceURL=ballooniesIxfAnimation.js