define("pBWOFExoticFarEastPicker", ["viewBuilderApi", "componentmodelComponentApi", "translationmanagerApi", "clientkernelLoaderApi", "displayEngineApi", "displayEngineUtils", "gameLayoutApi", "PIXI", "BABYLON", "clientkernelEventbusApi", "clientkernelModulesApi", "pbWofExoticFarEastPickerApi"],
    function(viewBuilderApi, componentmodelComponentApi, translationmanagerApi, clientkernelLoaderApi, displayEngineApi, displayEngineUtils, gameLayoutApi, PIXI, BABYLON, clientkernelEventbusApi, clientkernelModulesApi, pbWofExoticFarEastPickerApi) {
        "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 pBWOFExoticFarEastPicker == 'undefined') {
            var pBWOFExoticFarEastPicker = {};
        };
        pBWOFExoticFarEastPicker.Activator = function(context) {};
        pBWOFExoticFarEastPicker.Activator = ck_implements(pBWOFExoticFarEastPicker.Activator, clientkernelModulesApi.IModuleActivator);
        pBWOFExoticFarEastPicker.Activator.__interfaces__ = [clientkernelModulesApi.IModuleActivator];
        pBWOFExoticFarEastPicker.Activator.__name__ = ["pBWOFExoticFarEastPicker", "Activator"];
        pBWOFExoticFarEastPicker.Activator.prototype.start = function(context) {
            context.getServiceTracker([clientkernelLoaderApi.IAssetRegistry, viewBuilderApi.IViewBuilderFactory, displayEngineApi.IDisplayProvider]).then(function(context1) {
                pBWOFExoticFarEastPicker.ExternalService.initialize(context1);
                var vbf = context1.getAnyService(viewBuilderApi.IViewBuilderFactory, null);
                pBWOFExoticFarEastPicker.ExternalService.bus = context1.getAnyService(clientkernelEventbusApi.IEventBus, null);
                pBWOFExoticFarEastPicker.ExternalService.viewBuilderFactory = vbf;
                context1.registerService(new pBWOFExoticFarEastPicker.PickerFactory(vbf, context1), pbWofExoticFarEastPickerApi.PickerDeclaration, null);
            });
        };
        pBWOFExoticFarEastPicker.Activator.prototype.stop = function(context) {};
        pBWOFExoticFarEastPicker.Activator.main = function() {};
        pBWOFExoticFarEastPicker.Activator.prototype.__class__ = pBWOFExoticFarEastPicker.Activator;
        pBWOFExoticFarEastPicker.ExternalService = function() {};
        pBWOFExoticFarEastPicker.ExternalService.__name__ = ["pBWOFExoticFarEastPicker", "ExternalService"];
        pBWOFExoticFarEastPicker.ExternalService.assetRegistry = null;
        pBWOFExoticFarEastPicker.ExternalService.vbf = null;
        pBWOFExoticFarEastPicker.ExternalService.displayProvider = null;
        pBWOFExoticFarEastPicker.ExternalService.translationManager = null;
        pBWOFExoticFarEastPicker.ExternalService.bus = null;
        pBWOFExoticFarEastPicker.ExternalService.viewBuilderFactory = null;
        pBWOFExoticFarEastPicker.ExternalService.loadedAssets = null;
        pBWOFExoticFarEastPicker.ExternalService.initialize = function(context) {
            pBWOFExoticFarEastPicker.ExternalService.assetRegistry = context.getAnyService(clientkernelLoaderApi.IAssetRegistry, null);
            pBWOFExoticFarEastPicker.ExternalService.vbf = context.getAnyService(viewBuilderApi.IViewBuilderFactory, null);
            pBWOFExoticFarEastPicker.ExternalService.displayProvider = context.getAnyService(displayEngineApi.IDisplayProvider, null);
            pBWOFExoticFarEastPicker.ExternalService.loadedAssets = new _hcmn_.haxe_ds_StringMap();
        };
        pBWOFExoticFarEastPicker.ExternalService.prototype.__class__ = pBWOFExoticFarEastPicker.ExternalService;
        pBWOFExoticFarEastPicker.LayoutController = function(component) {
            this.flag_addedToStage = false;
            this.component = component;
        };
        pBWOFExoticFarEastPicker.LayoutController.__name__ = ["pBWOFExoticFarEastPicker", "LayoutController"];
        pBWOFExoticFarEastPicker.LayoutController.prototype.flag_addedToStage = null;
        pBWOFExoticFarEastPicker.LayoutController.prototype.component = null;
        pBWOFExoticFarEastPicker.LayoutController.prototype.updateLayout = function(layoutPayload) {
            var $it0 = layoutPayload.containers.keys();
            while ($it0.hasNext()) {
                var layerId = $it0.next();
                var layerPayload = layoutPayload.containers.get(layerId);
                var cfg = layerPayload.configuration;
                var stage;
                var this1 = pBWOFExoticFarEastPicker.ExternalService.displayProvider.getStages();
                stage = this1.get(layerPayload.stage);
                var container;
                container = (function($this) {
                    var $r;
                    var this2 = $this.component.view.getChildComponents();
                    $r = this2.get(layerId);
                    return $r;
                }(this));
                var containerDO = container.getDisplayObject();
                if (!this.flag_addedToStage) stage.addChild(containerDO);
                containerDO.setX(layerPayload.left);
                containerDO.setY(layerPayload.top);
                containerDO.setScaleX(layerPayload.width / containerDO.getUserData().viewBuilderW);
                containerDO.setScaleY(layerPayload.height / containerDO.getUserData().viewBuilderH);
                containerDO.setZIndex(layerPayload.zIndex);
                if (cfg != null) {}
            }
            if (!this.flag_addedToStage) this.flag_addedToStage = true;
        };
        pBWOFExoticFarEastPicker.LayoutController.prototype.__class__ = pBWOFExoticFarEastPicker.LayoutController;
        pBWOFExoticFarEastPicker.Picker = function(context, vbf) {
            this.assetsLoaded = false;
            this.initialized = false;
            this.layoutPayload = null;
            this.vba = null;
            this.cfgId = "picker-assets/picker_config";
            this.vbAssetID = "picker-assets/PICKER";
            this.vbf = vbf;
            this.context = context;
            this.port = context.getImplementedPort(pbWofExoticFarEastPickerApi.IPickerImplementationPort);
            this.layoutPort = context.getUsedPort(gameLayoutApi.IGameLayoutPort);
            this.layoutPort.getUpdateComponentLayout().subscribe($bind(this, this.updateLayout));
            this.layoutPort.getGameLayoutUpdated().subscribe($bind(this, this.updateLayoutCompleted));
            this.loadConfigData();
        };
        pBWOFExoticFarEastPicker.Picker.__name__ = ["pBWOFExoticFarEastPicker", "Picker"];
        pBWOFExoticFarEastPicker.Picker.prototype.vbAssetID = null;
        pBWOFExoticFarEastPicker.Picker.prototype.cfgId = null;
        pBWOFExoticFarEastPicker.Picker.prototype.view = null;
        pBWOFExoticFarEastPicker.Picker.prototype.context = null;
        pBWOFExoticFarEastPicker.Picker.prototype.vba = null;
        pBWOFExoticFarEastPicker.Picker.prototype.vbf = null;
        pBWOFExoticFarEastPicker.Picker.prototype.controller = null;
        pBWOFExoticFarEastPicker.Picker.prototype.layoutPayload = null;
        pBWOFExoticFarEastPicker.Picker.prototype.port = null;
        pBWOFExoticFarEastPicker.Picker.prototype.layoutPort = null;
        pBWOFExoticFarEastPicker.Picker.prototype.cfg = null;
        pBWOFExoticFarEastPicker.Picker.prototype.vbView = null;
        pBWOFExoticFarEastPicker.Picker.prototype.initialized = null;
        pBWOFExoticFarEastPicker.Picker.prototype.assetsLoaded = null;
        pBWOFExoticFarEastPicker.Picker.prototype.wheelView = null;
        pBWOFExoticFarEastPicker.Picker.prototype.updateLayoutCompleted = function(payload) {
            if (this.initialized) {
                if (this.wheelView != null) this.wheelView.onLayoutUpdateCompleted();
            }
        };
        pBWOFExoticFarEastPicker.Picker.prototype.loadConfigData = function() {
            var _g = this;
            pBWOFExoticFarEastPicker.ExternalService.assetRegistry.getAsset(this.cfgId).getContent().then(function(data) {
                _g.cfg = data;
                _g.loadVBAssets();
            });
        };
        pBWOFExoticFarEastPicker.Picker.prototype.loadVBAssets = function() {
            var _g = this;
            pBWOFExoticFarEastPicker.ExternalService.assetRegistry.getAssetsContent(["picker-assets/PICKER_ANIMATION"]).then(function(data) {
                pBWOFExoticFarEastPicker.ExternalService.loadedAssets = data;
                _g.loadMainAssets();
            });
        };
        pBWOFExoticFarEastPicker.Picker.prototype.loadMainAssets = function() {
            var _g = this;
            pBWOFExoticFarEastPicker.ExternalService.assetRegistry.getAsset(this.vbAssetID).getContent().then(function(vba) {
                _g.vba = vba;
                _g.assetsLoaded = true;
                _g.initialize();
            });
        };
        pBWOFExoticFarEastPicker.Picker.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());
            }
        };
        pBWOFExoticFarEastPicker.Picker.prototype.initialize = function() {
            if (!this.initialized && this.vba != null && this.layoutPayload != null) {
                this.controller = new pBWOFExoticFarEastPicker.LayoutController(this);
                this.view = this.vbf.createView(this.vba);
                this.registerAllComponents();
                this.controller.updateLayout(this.layoutPayload);
                this.layoutPort.getComponentLayoutUpdated().publish(this.context.getInstance());
                this.port.getHide().subscribe($bind(this, this.onHide));
                this.port.getStop().subscribe($bind(this, this.onStopWheel));
                this.port.getStart().subscribe($bind(this, this.onStartWheel));
                this.port.getShow().subscribe($bind(this, this.onShowPicker));
                this.port.getInitWheelStrips().subscribe($bind(this, this.onInitWheelStripsValues));
                this.port.getIdle().subscribe($bind(this, this.onPickerIdle));
                this.port.getActivateSpin().subscribe($bind(this, this.onActivateSpin));
                this.port.getDeactivateSpin().subscribe($bind(this, this.onDeactivateSpin));
                this.port.getUpdatePointers().subscribe($bind(this, this.onUpdatePointers));
                this.port.getPlayCashLinkAnimation().subscribe($bind(this, this.onPlayCashLinkAnimation));
                pBWOFExoticFarEastPicker.BaseEvents.WHEEL_SPINNING.add($bind(this, this.onWheenSpinning));
                pBWOFExoticFarEastPicker.BaseEvents.SPIN_PRESSED.add($bind(this, this.onSpinPressed));
                pBWOFExoticFarEastPicker.BaseEvents.WHEEL_STOPPED.add($bind(this, this.onWheelStopped));
                pBWOFExoticFarEastPicker.BaseEvents.COINS_LANDED.add($bind(this, this.onCoinsLanded));
                var stage = pBWOFExoticFarEastPicker.ExternalService.displayProvider.getDefaultStage();
                stage.getChildByID("placeholder_5x").setVisible(false);
                stage.getChildByID("placeholder_10x").setVisible(false);
                stage.getChildByID("placeholder_20x").setVisible(false);
                this.initialized = true;
            }
        };
        pBWOFExoticFarEastPicker.Picker.prototype.registerAllComponents = function() {
            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 constructorIndex;
                var _this = _hcmn_.Type.getEnumConstructs(pbWofExoticFarEastPickerApi.PickerTypeEnum);
                constructorIndex = _hcmn_.HxOverrides.indexOf(_this, compId, 0);
                if (constructorIndex < 0) continue;
                var componentEnum = _hcmn_.Type.createEnum(pbWofExoticFarEastPickerApi.PickerTypeEnum, compId, null);
                this.registerComponent(componentEnum);
            }
        };
        pBWOFExoticFarEastPicker.Picker.prototype.registerComponent = function(componentEnum) {
            switch (componentEnum[1]) {
                case 0:
                    var container = this.view.getContainerById(componentEnum[0]);
                    this.wheelView = new pBWOFExoticFarEastPicker.WheelView(container, this.cfg);
                    break;
                default:
                    return false;
            }
            return true;
        };
        pBWOFExoticFarEastPicker.Picker.prototype.onStopWheel = function(e) {
            this.wheelView.stop(e.getPayload());
        };
        pBWOFExoticFarEastPicker.Picker.prototype.onStartWheel = function(e) {
            this.wheelView.start();
            this.port.getWheelStarted().publish(null);
        };
        pBWOFExoticFarEastPicker.Picker.prototype.onHide = function(e) {
            this.wheelView.hide();
        };
        pBWOFExoticFarEastPicker.Picker.prototype.onActivateSpin = function(e) {
            this.wheelView.activateSpin();
        };
        pBWOFExoticFarEastPicker.Picker.prototype.onDeactivateSpin = function(e) {
            this.wheelView.deactivateSpin();
        };
        pBWOFExoticFarEastPicker.Picker.prototype.onInitWheelStripsValues = function(e) {
            var _g = this;
            this.wheelView.init(e.getPayload());
            this.wheelView.hide();
            _hcmn_.haxe_Timer.delay(function() {
                _g.wheelView.hide();
            }, 1);
        };
        pBWOFExoticFarEastPicker.Picker.prototype.onUpdatePointers = function(e) {
            this.wheelView.updatePointers(e.getPayload());
        };
        pBWOFExoticFarEastPicker.Picker.prototype.onShowPicker = function(e) {
            this.wheelView.show();
        };
        pBWOFExoticFarEastPicker.Picker.prototype.onPickerIdle = function(e) {
            this.wheelView.setIdle();
        };
        pBWOFExoticFarEastPicker.Picker.prototype.onPlayCashLinkAnimation = function(e) {
            this.wheelView.playCashLinkAnimation(e.getPayload()[0], e.getPayload()[1], e.getPayload()[2]);
        };
        pBWOFExoticFarEastPicker.Picker.prototype.onSpinPressed = function(payload) {
            this.port.getSpinBtnPressed().publish(null);
        };
        pBWOFExoticFarEastPicker.Picker.prototype.onWheenSpinning = function(payload) {
            this.port.wheelPosition().publish(null);
        };
        pBWOFExoticFarEastPicker.Picker.prototype.onWheelStopped = function(payload) {
            var _g = this;
            _hcmn_.haxe_Timer.delay(function() {
                _g.port.getWheelStopped().publish(null);
            }, 5000);
            this.wheelView.showCoins();
            this.wheelView.showSector();
        };
        pBWOFExoticFarEastPicker.Picker.prototype.onCoinsLanded = function(e) {
            this.port.getWheelCoinsFlewAway().publish(null);
        };
        pBWOFExoticFarEastPicker.Picker.prototype.hideCashLink = function() {};
        pBWOFExoticFarEastPicker.Picker.prototype.__class__ = pBWOFExoticFarEastPicker.Picker;
        pBWOFExoticFarEastPicker.PickerConfig = function() {};
        pBWOFExoticFarEastPicker.PickerConfig.__name__ = ["pBWOFExoticFarEastPicker", "PickerConfig"];
        pBWOFExoticFarEastPicker.PickerConfig.prototype.rotationPhases = null;
        pBWOFExoticFarEastPicker.PickerConfig.prototype.awatingCyclesAmout = null;
        pBWOFExoticFarEastPicker.PickerConfig.prototype.__class__ = pBWOFExoticFarEastPicker.PickerConfig;
        pBWOFExoticFarEastPicker.PickerFactory = function(vbf, context) {
            this.context = context;
            this.vbf = vbf;
        };
        pBWOFExoticFarEastPicker.PickerFactory = ck_implements(pBWOFExoticFarEastPicker.PickerFactory, clientkernelModulesApi.IService);
        pBWOFExoticFarEastPicker.PickerFactory = ck_implements(pBWOFExoticFarEastPicker.PickerFactory, componentmodelComponentApi.IComponentFactory);
        pBWOFExoticFarEastPicker.PickerFactory.__interfaces__ = [clientkernelModulesApi.IService, componentmodelComponentApi.IComponentFactory];
        pBWOFExoticFarEastPicker.PickerFactory.__name__ = ["pBWOFExoticFarEastPicker", "PickerFactory"];
        pBWOFExoticFarEastPicker.PickerFactory.prototype.context = null;
        pBWOFExoticFarEastPicker.PickerFactory.prototype.vbf = null;
        pBWOFExoticFarEastPicker.PickerFactory.prototype.getComponentDeclaration = function() {
            return pbWofExoticFarEastPickerApi.PickerDeclaration;
        };
        pBWOFExoticFarEastPicker.PickerFactory.prototype.createComponent = function(context) {
            new pBWOFExoticFarEastPicker.Picker(context, this.vbf);
        };
        pBWOFExoticFarEastPicker.PickerFactory.prototype.__class__ = pBWOFExoticFarEastPicker.PickerFactory;
        pBWOFExoticFarEastPicker.WheelAnimator = function(animatedObject, configuration) {
            this.pickerConfig = configuration;
            this.wheel = animatedObject;
            this.wheel.setCacheAsBitmap(true);
            this.setDefaultState();
            this.wheel.setPivot(new displayEngineApi.Point(this.wheel.getWidth() / 2, this.wheel.getHeight() / 2));
            this.wheel.setX(this.wheel.getWidth() / 2);
            this.wheel.setY(this.wheel.getHeight() / 2);
        };
        pBWOFExoticFarEastPicker.WheelAnimator.__name__ = ["pBWOFExoticFarEastPicker", "WheelAnimator"];
        pBWOFExoticFarEastPicker.WheelAnimator.prototype.pickerConfig = null;
        pBWOFExoticFarEastPicker.WheelAnimator.prototype.wheel = null;
        pBWOFExoticFarEastPicker.WheelAnimator.prototype.stoppingPosition = null;
        pBWOFExoticFarEastPicker.WheelAnimator.prototype.stopStripIndex = null;
        pBWOFExoticFarEastPicker.WheelAnimator.prototype.currentPhase = null;
        pBWOFExoticFarEastPicker.WheelAnimator.prototype.sectorProgress = null;
        pBWOFExoticFarEastPicker.WheelAnimator.prototype.rotateTween = null;
        pBWOFExoticFarEastPicker.WheelAnimator.prototype.phaseParam = null;
        pBWOFExoticFarEastPicker.WheelAnimator.prototype.tweens = null;
        pBWOFExoticFarEastPicker.WheelAnimator.prototype.playWheelRotation = function() {
            var phaseParam = this.pickerConfig.rotationPhases[this.currentPhase];
            var endAngle = 180.0 * phaseParam.cyclesPerPhase;
            var duration = phaseParam.cyclesPerPhase * phaseParam.timePerCycle;
            this.tweens = [];
            this.rotateTween = displayEngineUtils.TweenX.to(this.wheel, {
                rotation: endAngle
            }, duration, null, null, null, null, null, null, null, {
                fileName: "WheelAnimator.hx",
                lineNumber: 54,
                className: "components.picker.WheelAnimator",
                methodName: "playWheelRotation"
            }).ease(displayEngineUtils.EaseX.quadIn).onFinish($bind(this, this.startNextRotationPhase)).onUpdate($bind(this, this.rotate));
            this.tweens.push(this.rotateTween);
        };
        pBWOFExoticFarEastPicker.WheelAnimator.prototype.startNextRotationPhase = function() {
            this.stopTween();
            if (this.stopStripIndex >= 0) {
                this.currentPhase++;
                var phaseParam = this.pickerConfig.rotationPhases[this.currentPhase];
                var angle = this.wheel.getRotation() + 180.0 * phaseParam.cyclesPerPhase;
                var duration = phaseParam.cyclesPerPhase * phaseParam.timePerCycle;
                this.rotateTween = displayEngineUtils.TweenX.to(this.wheel, {
                    rotation: angle
                }, duration, null, null, null, null, null, null, null, {
                    fileName: "WheelAnimator.hx",
                    lineNumber: 67,
                    className: "components.picker.WheelAnimator",
                    methodName: "startNextRotationPhase"
                }).ease(displayEngineUtils.EaseX.linear).onFinish($bind(this, this.startStoppingRotationPhase)).onUpdate($bind(this, this.rotate));
                this.tweens.push(this.rotateTween);
            } else {
                var phaseParam1 = this.pickerConfig.rotationPhases[this.currentPhase];
                var angle1 = this.wheel.getRotation() + 180.0 * this.pickerConfig.awatingCyclesAmout;
                var duration1 = this.pickerConfig.awatingCyclesAmout * phaseParam1.timePerCycle;
                this.rotateTween = displayEngineUtils.TweenX.to(this.wheel, {
                    rotation: angle1
                }, duration1, null, null, null, null, null, null, null, {
                    fileName: "WheelAnimator.hx",
                    lineNumber: 74,
                    className: "components.picker.WheelAnimator",
                    methodName: "startNextRotationPhase"
                }).ease(displayEngineUtils.EaseX.linear).onFinish($bind(this, this.startNextRotationPhase)).onUpdate($bind(this, this.rotate));
                this.tweens.push(this.rotateTween);
            }
        };
        pBWOFExoticFarEastPicker.WheelAnimator.prototype.startStoppingRotationPhase = function() {
            this.stopTween();
            this.currentPhase++;
            this.calculateStoppingAngle();
            var phaseParam = this.pickerConfig.rotationPhases[this.currentPhase];
            this.wheel.setRotation(this.wheel.getRotation() % 360);
            var angle;
            if (this.wheel.getRotation() < this.stoppingPosition) angle = this.stoppingPosition;
            else angle = 360 + this.stoppingPosition;
            var duration = phaseParam.cyclesPerPhase * phaseParam.timePerCycle;
            this.rotateTween = displayEngineUtils.TweenX.to(this.wheel, {
                rotation: angle
            }, duration, null, null, null, null, null, null, null, {
                fileName: "WheelAnimator.hx",
                lineNumber: 88,
                className: "components.picker.WheelAnimator",
                methodName: "startStoppingRotationPhase"
            }).ease(displayEngineUtils.EaseX.cubicOut).onFinish($bind(this, this.stoppingWheel)).onUpdate($bind(this, this.rotate));
        };
        pBWOFExoticFarEastPicker.WheelAnimator.prototype.stopTween = function() {
            if (this.rotateTween != null) {
                this.rotateTween.stop();
                this.rotateTween = null;
            }
        };
        pBWOFExoticFarEastPicker.WheelAnimator.prototype.stopAllsTweens = function() {
            var _g = 0;
            var _g1 = this.tweens;
            while (_g < _g1.length) {
                var tween = _g1[_g];
                ++_g;
                if (tween != null) {
                    tween.onFinish(null);
                    tween.stop();
                    var totalTime = tween.get_totalTime();
                    tween["goto"](totalTime, false);
                    tween.onHead($bind(tween, tween.stop));
                    tween = null;
                }
            }
            this.tweens = [];
        };
        pBWOFExoticFarEastPicker.WheelAnimator.prototype.setIdle = function() {
            this.stopTween();
            this.rotateTween = displayEngineUtils.TweenX.to(this.wheel, {
                rotation: 0
            }, 1, null, null, null, null, null, null, null, {
                fileName: "WheelAnimator.hx",
                lineNumber: 121,
                className: "components.picker.WheelAnimator",
                methodName: "setIdle"
            }).onFinish($bind(this, this.onIdle));
            this.tweens.push(this.rotateTween);
        };
        pBWOFExoticFarEastPicker.WheelAnimator.prototype.onIdle = function() {
            this.setDefaultState();
        };
        pBWOFExoticFarEastPicker.WheelAnimator.prototype.setDefaultState = function() {
            this.currentPhase = 0;
            this.stopStripIndex = -1;
            this.stoppingPosition = 0;
        };
        pBWOFExoticFarEastPicker.WheelAnimator.prototype.stop = function(stopIndex) {
            this.stopStripIndex = stopIndex;
        };
        pBWOFExoticFarEastPicker.WheelAnimator.prototype.calculateStoppingAngle = function() {
            var stop = 0 - 16.3636364 * this.stopStripIndex;
            if (stop > 0) this.stoppingPosition = stop;
            else this.stoppingPosition = 360 + stop;
        };
        pBWOFExoticFarEastPicker.WheelAnimator.prototype.rotate = function() {
            var rotation = _hcmn_.Std["int"](this.wheel.getRotation()) % 360;
            var newSectorProgress = rotation % 16.3636364 | 0;
            if (this.sectorProgress > newSectorProgress) pBWOFExoticFarEastPicker.BaseEvents.WHEEL_SPINNING.dispatch([1]);
            this.sectorProgress = newSectorProgress;
        };
        pBWOFExoticFarEastPicker.WheelAnimator.prototype.stoppingWheel = function() {
            this.stopTween();
            this.wheel.setCacheAsBitmap(false);
            this.setDefaultState();
            pBWOFExoticFarEastPicker.BaseEvents.WHEEL_STOPPED.dispatch("");
        };
        pBWOFExoticFarEastPicker.WheelAnimator.prototype.__class__ = pBWOFExoticFarEastPicker.WheelAnimator;
        pBWOFExoticFarEastPicker.BaseEvents = function() {};
        pBWOFExoticFarEastPicker.BaseEvents.__name__ = ["pBWOFExoticFarEastPicker", "BaseEvents"];
        pBWOFExoticFarEastPicker.BaseEvents.prototype.__class__ = pBWOFExoticFarEastPicker.BaseEvents;
        pBWOFExoticFarEastPicker.WheelView = function(container, configuration) {
            this.tweenActive = false;
            this.currentTween = 0;
            this.totalTweens = 0;
            this.destinationX = 0;
            this.destinationY = 0;
            this.play20x = false;
            this.play10x = false;
            this.play5x = false;
            this.animationCache = new _hcmn_.haxe_ds_StringMap();
            this.container = container;
            this.container.hide();
            this.pointerEnabledList = [];
            this.pointerDisabledList = [];
            this.viewContent = this.container.getContainerById("Content").getContainerById("PICKER_WHEEL");
            this.wheel = this.viewContent.getContainerById("WheelContainer").getDisplayObject();
            this.buttonContainer = this.viewContent.getButtonContainerById("Spin_Btn");
            this.buttonContainer.getEvents().DOWN().addListener($bind(this, this.onSpinButtonPressed));
            this.wheelAnimator = new pBWOFExoticFarEastPicker.WheelAnimator(this.wheel, configuration);
            this.stage = pBWOFExoticFarEastPicker.ExternalService.displayProvider.getDefaultStage();
            this.initPointers();
        };
        pBWOFExoticFarEastPicker.WheelView.__name__ = ["pBWOFExoticFarEastPicker", "WheelView"];
        pBWOFExoticFarEastPicker.WheelView.prototype.stage = null;
        pBWOFExoticFarEastPicker.WheelView.prototype.viewContent = null;
        pBWOFExoticFarEastPicker.WheelView.prototype.container = null;
        pBWOFExoticFarEastPicker.WheelView.prototype.wheel = null;
        pBWOFExoticFarEastPicker.WheelView.prototype.stopStripIndex = null;
        pBWOFExoticFarEastPicker.WheelView.prototype.event = null;
        pBWOFExoticFarEastPicker.WheelView.prototype.buttonContainer = null;
        pBWOFExoticFarEastPicker.WheelView.prototype.pressToSpinLabel = null;
        pBWOFExoticFarEastPicker.WheelView.prototype.goodLuckLabel = null;
        pBWOFExoticFarEastPicker.WheelView.prototype.labelContainer = null;
        pBWOFExoticFarEastPicker.WheelView.prototype.panelAnimation = null;
        pBWOFExoticFarEastPicker.WheelView.prototype.pointerAnimation = null;
        pBWOFExoticFarEastPicker.WheelView.prototype.fireAnimation = null;
        pBWOFExoticFarEastPicker.WheelView.prototype.animationCache = null;
        pBWOFExoticFarEastPicker.WheelView.prototype.labelTween = null;
        pBWOFExoticFarEastPicker.WheelView.prototype.config = null;
        pBWOFExoticFarEastPicker.WheelView.prototype.wheelAnimator = null;
        pBWOFExoticFarEastPicker.WheelView.prototype.connecting = null;
        pBWOFExoticFarEastPicker.WheelView.prototype.connectingDisplayObject = null;
        pBWOFExoticFarEastPicker.WheelView.prototype.pointerEnabledList = null;
        pBWOFExoticFarEastPicker.WheelView.prototype.pointerDisabledList = null;
        pBWOFExoticFarEastPicker.WheelView.prototype.pointersCount = null;
        pBWOFExoticFarEastPicker.WheelView.prototype.tweens = null;
        pBWOFExoticFarEastPicker.WheelView.prototype.play5x = null;
        pBWOFExoticFarEastPicker.WheelView.prototype.play10x = null;
        pBWOFExoticFarEastPicker.WheelView.prototype.play20x = null;
        pBWOFExoticFarEastPicker.WheelView.prototype.destinationY = null;
        pBWOFExoticFarEastPicker.WheelView.prototype.destinationX = null;
        pBWOFExoticFarEastPicker.WheelView.prototype.totalTweens = null;
        pBWOFExoticFarEastPicker.WheelView.prototype.currentTween = null;
        pBWOFExoticFarEastPicker.WheelView.prototype.tweenActive = null;
        pBWOFExoticFarEastPicker.WheelView.prototype.getAnimation = function(holderID, animationID, assetID) {
            var animAssets = pBWOFExoticFarEastPicker.ExternalService.loadedAssets.get(assetID);
            var animView = pBWOFExoticFarEastPicker.ExternalService.viewBuilderFactory.createView(animAssets);
            var animHolder = animView.createContainerFromStoredConfig(holderID);
            var animation = animHolder.getVBAnimationById(animationID);
            this.animationCache.set(holderID, animation);
            return animation;
        };
        pBWOFExoticFarEastPicker.WheelView.prototype.disposeAnimations = function() {
            var $it0 = this.animationCache.keys();
            while ($it0.hasNext()) {
                var anim = $it0.next();
                this.container.disposeChildComponent(anim);
                this.animationCache.get(anim).dispose();
            }
            this.animationCache = new _hcmn_.haxe_ds_StringMap();
        };
        pBWOFExoticFarEastPicker.WheelView.prototype.initLabels = function() {
            this.labelContainer = this.buttonContainer.getContainerById("labelsContainer");
        };
        pBWOFExoticFarEastPicker.WheelView.prototype.onSpinButtonPressed = function(data) {
            this.buttonContainer.disable();
            pBWOFExoticFarEastPicker.BaseEvents.SPIN_PRESSED.dispatch("");
        };
        pBWOFExoticFarEastPicker.WheelView.prototype.init = function(data) {
            this.stopStripIndex = -1;
            this.wheel.setRotation(0);
            this.initWheelValues(data);
        };
        pBWOFExoticFarEastPicker.WheelView.prototype.show = function() {
            this.play5x = false;
            this.play10x = false;
            this.play20x = false;
            this.wheelAnimator.setDefaultState();
            this.container.show();
            this.activateSpin();
        };
        pBWOFExoticFarEastPicker.WheelView.prototype.stopLabelTween = function(callback) {
            var _g = this;
            if (this.labelTween != null) {
                this.labelTween.onStop(function() {
                    _g.labelTween = null;
                    callback();
                });
                this.labelTween.stop();
            } else callback();
        };
        pBWOFExoticFarEastPicker.WheelView.prototype.hide = function() {
            this.container.getDisplayObject().setVisible(false);
            this.disposeAnimations();
        };
        pBWOFExoticFarEastPicker.WheelView.prototype.start = function() {
            this.wheelAnimator.playWheelRotation();
        };
        pBWOFExoticFarEastPicker.WheelView.prototype.stop = function(data) {
            this.wheelAnimator.stop(data);
        };
        pBWOFExoticFarEastPicker.WheelView.prototype.hidePanelAnimation = function() {
            if (this.panelAnimation != null) {
                this.panelAnimation.stop();
                this.panelAnimation.hide();
            }
        };
        pBWOFExoticFarEastPicker.WheelView.prototype.showSector = function() {
            var _g1 = 0;
            var _g = this.pointersCount;
            while (_g1 < _g) {
                var i = _g1++;
                var animID = "BLUE_FRAME_ANIMATION_HOLDER_" + (i + 1);
                var frameAnimation = this.getAnimation(animID, "ANIMATION_CONTENT", "PICKER_ANIMATION");
                this.container.addChildComponent(frameAnimation, animID);
                frameAnimation.getDisplayObject().setPivot(new displayEngineApi.Point(frameAnimation.getDisplayObject().getWidth() / 2, frameAnimation.getDisplayObject().getHeight()));
                frameAnimation.getDisplayObject().setX(this.wheel.getWidth() / 2);
                frameAnimation.getDisplayObject().setY(this.wheel.getHeight() / 2);
                if (i > 0) {
                    if (i % 2 == 0) frameAnimation.getDisplayObject().setRotation(-(16.3636364 * i));
                    else frameAnimation.getDisplayObject().setRotation(16.3636364 * (i + 1));
                }
                frameAnimation.show();
                frameAnimation.gotoAndPlay(false, "loop");
            }
            this.container.getDisplayObject().removeChild(this.buttonContainer.getDisplayObject());
            this.container.getDisplayObject().addChild(this.buttonContainer.getDisplayObject());
        };
        pBWOFExoticFarEastPicker.WheelView.prototype.showCoins = function() {
            if (!this.play5x && !this.play10x && !this.play20x) return;
            var numberOfAnims = 0;
            if (this.play5x) numberOfAnims++;
            if (this.play10x) numberOfAnims++;
            if (this.play20x) numberOfAnims++;
            this.tweens = [];
            var placeholder_5x = this.stage.getChildByID("placeholder_5x");
            var placeholder_10x = this.stage.getChildByID("placeholder_10x");
            var placeholder_20x = this.stage.getChildByID("placeholder_20x");
            placeholder_5x.setVisible(false);
            placeholder_10x.setVisible(false);
            placeholder_20x.setVisible(false);
            if (this.play5x) {
                this.totalTweens++;
                placeholder_5x.setVisible(true);
                placeholder_5x.setX(this.getOffset("placeholder_5x", -65).x);
                placeholder_5x.setY(this.getOffset("placeholder_5x", -65).y);
                this.startTween(numberOfAnims, new displayEngineApi.Point(this.destinationX, this.destinationY), placeholder_5x);
            }
            if (this.play10x) {
                this.totalTweens++;
                placeholder_10x.setVisible(true);
                placeholder_10x.setX(this.getOffset("placeholder_10x", 67).x);
                placeholder_10x.setY(this.getOffset("placeholder_10x", 67).y);
                this.startTween(numberOfAnims, new displayEngineApi.Point(this.destinationX, this.destinationY), placeholder_10x);
            }
            if (this.play20x) {
                this.totalTweens++;
                placeholder_20x.setVisible(true);
                placeholder_20x.setX(this.getOffset("placeholder_20x", 0).x);
                placeholder_20x.setY(this.getOffset("placeholder_20x", 0).y);
                this.startTween(numberOfAnims, new displayEngineApi.Point(this.destinationX, this.destinationY), placeholder_20x);
            }
        };
        pBWOFExoticFarEastPicker.WheelView.prototype.addAnimationToViewContent = function(placeholderID, animationID, animation, play) {
            var placeHolder = this.viewContent.getContainerById(placeholderID);
            if (placeHolder.getComponentById(animationID) == null) placeHolder.addChildComponent(animation, animationID);
            if (play) animation.play(false);
        };
        pBWOFExoticFarEastPicker.WheelView.prototype.getOffset = function(id, targetAngle) {
            var viewContent = this.container.getContainerById("Content");
            var wheelContainer = viewContent.getContainerById("PICKER_WHEEL").getContainerById("WheelContainer");
            var targetContainer = this.stage.getChildByID(id);
            targetContainer.setScaleX(this.container.getDisplayObject().getScaleX());
            targetContainer.setScaleY(this.container.getDisplayObject().getScaleY());
            var rootPos = new displayEngineApi.Point(this.container.getDisplayObject().getX(), this.container.getDisplayObject().getY());
            var wheelPos = new displayEngineApi.Point(wheelContainer.getDisplayObject().getX(), wheelContainer.getDisplayObject().getY());
            var origin = new displayEngineApi.Point(rootPos.x + wheelPos.x * this.container.getDisplayObject().getScaleX(), rootPos.y + wheelPos.y * this.container.getDisplayObject().getScaleY());
            var angle = wheelContainer.getDisplayObject().getRotation() - 90 + targetAngle;
            var radius = 328 * this.container.getDisplayObject().getScaleX();
            var rad = angle * (_hcmn_.Math.PI / 180);
            targetContainer.setRotation(angle + 90);
            return new displayEngineApi.Point(origin.x + radius * _hcmn_.Math.cos(rad), origin.y + radius * _hcmn_.Math.sin(rad));
        };
        pBWOFExoticFarEastPicker.WheelView.prototype.addAnimationToPlaceholder = function(placeholderID, animationID, animation, play) {
            animation.getDisplayObject().setRotation(90);
            var placeHolder = this.viewContent.getContainerById("WheelContainer").getContainerById("wheel");
            if ((function($this) {
                    var $r;
                    var this1 = placeHolder.getChildComponents();
                    $r = this1.get(animationID);
                    return $r;
                }(this)) == null) placeHolder.addChildComponent(animation, animationID);
            if (play) animation.play(false);
        };
        pBWOFExoticFarEastPicker.WheelView.prototype.initWheelValues = function(data) {
            var container = this.viewContent.getContainerById("WheelContainer").getContainerById("wheel");
            container.show();
            var _g1 = 0;
            var _g = data.length;
            while (_g1 < _g) {
                var i = _g1++;
                var labelContainer = container.getContainerById("Sector" + (i + 1));
                var label = labelContainer.getLabelById("sectorValue");
                var value = "";
                var _g3 = 0;
                var _g2 = data[i].length - 1;
                while (_g3 < _g2) {
                    var j = _g3++;
                    value += data[i].charAt(j) + "\n";
                }
                value += data[i].charAt(data[i].length - 1);
                label.setText(value);
            }
        };
        pBWOFExoticFarEastPicker.WheelView.prototype.initPointers = function() {
            var container = this.viewContent.getContainerById("pointer");
            var _g = 1;
            while (_g < 8) {
                var i = _g++;
                var pointerContainerEnabled = container.getContainerById("enabled_" + i);
                var pointerContainerDisabled = container.getContainerById("disabled_" + i);
                this.pointerEnabledList.push(pointerContainerEnabled);
                this.pointerDisabledList.push(pointerContainerDisabled);
            }
        };
        pBWOFExoticFarEastPicker.WheelView.prototype.updatePointers = function(position) {
            this.pointersCount = position;
            var container = this.viewContent.getContainerById("pointer");
            var _g1 = 0;
            var _g = this.pointerEnabledList.length;
            while (_g1 < _g) {
                var i = _g1++;
                if (i < position) {
                    this.pointerEnabledList[i].show();
                    this.pointerDisabledList[i].hide();
                } else {
                    this.pointerEnabledList[i].hide();
                    this.pointerDisabledList[i].show();
                }
            }
        };
        pBWOFExoticFarEastPicker.WheelView.prototype.setConfig = function(cfg, stage) {
            this.config = cfg;
            this.stage = stage;
            this.updateLayout();
        };
        pBWOFExoticFarEastPicker.WheelView.prototype.setIdle = function() {
            this.wheelAnimator.stopAllsTweens();
            this.stopStripIndex = -1;
            this.wheel.setRotation(0);
            this.container.hide();
        };
        pBWOFExoticFarEastPicker.WheelView.prototype.updateLayout = function() {
            var contentContainer = this.container.getContainerById("Content");
            if (this.config != null) {
                var stageH = this.stage.getHeight();
                var stageW = this.stage.getWidth();
                contentContainer.getDisplayObject().setRotation(this.config.rotation);
                if (this.buttonContainer != null) {
                    this.buttonContainer.getDisplayObject().setRotation(-this.config.rotation);
                    this.buttonContainer.getDisplayObject().setPos(this.config.spinButtonPos.x, this.config.spinButtonPos.y);
                }
            }
        };
        pBWOFExoticFarEastPicker.WheelView.prototype.activateSpin = function() {
            this.buttonContainer.enable();
            this.buttonContainer.getButtonById("btn").getMainMovieClip().gotoAndPlay("enabled");
            this.buttonContainer.getButtonById("btn").getMainMovieClip().setLoop(true);
        };
        pBWOFExoticFarEastPicker.WheelView.prototype.deactivateSpin = function() {
            this.buttonContainer.disable();
            this.buttonContainer.getButtonById("btn").getMainMovieClip().setLoop(false);
        };
        pBWOFExoticFarEastPicker.WheelView.prototype.playCashLinkAnimation = function(play5x, play10x, play20x) {
            this.play5x = play5x;
            this.play10x = play10x;
            this.play20x = play20x;
        };
        pBWOFExoticFarEastPicker.WheelView.prototype.startTween = function(numberOfAnims, pos, element) {
            var _g = this;
            element.setRotation(0);
            this.tweenActive = true;
            var time = 1000;
            var tweener = displayEngineUtils.TweenX.to(element, {
                x: pos.x,
                y: pos.y
            }, time, null, null, null, null, null, null, null, {
                fileName: "WheelView.hx",
                lineNumber: 452,
                className: "components.picker.subcomponents.WheelView",
                methodName: "startTween"
            }).ease(displayEngineUtils.EaseX.quadInOut).onFinish(function() {
                _g.currentTween++;
                if (_g.currentTween == _g.totalTweens) {
                    _g.clearTweens();
                    _g.resetDisplayObjects(["placeholder_5x", "placeholder_10x", "placeholder_20x"]);
                    _g.tweenActive = false;
                    pBWOFExoticFarEastPicker.BaseEvents.COINS_LANDED.dispatch(null);
                }
            });
            this.tweens.push(tweener);
        };
        pBWOFExoticFarEastPicker.WheelView.prototype.clearTweens = function() {
            if (this.tweens != null) {
                var _g = 0;
                var _g1 = this.tweens;
                while (_g < _g1.length) {
                    var tween = _g1[_g];
                    ++_g;
                    if (tween != null) {
                        tween.onFinish(null);
                        tween.stop();
                        var totalTime = tween.get_totalTime();
                        tween["goto"](totalTime, false);
                        tween.onHead($bind(tween, tween.stop));
                        tween = null;
                        this.currentTween = 0;
                        this.totalTweens = 0;
                    }
                }
                this.tweens = null;
                this.tweens = [];
            }
        };
        pBWOFExoticFarEastPicker.WheelView.prototype.resetDisplayObjects = function(elements) {
            var _g1 = 0;
            var _g = elements.length;
            while (_g1 < _g) {
                var i = _g1++;
                var element = this.stage.getChildByID(elements[i]);
                element.setVisible(false);
                element.setX(0);
                element.setY(0);
            }
        };
        pBWOFExoticFarEastPicker.WheelView.prototype.onLayoutUpdateCompleted = function() {
            this.destinationX = this.stage.getChildByID("CASH_LINK").getX() + 180;
            this.destinationY = this.stage.getChildByID("CASH_LINK").getY() + 90;
            if (this.tweenActive) {
                this.tweenActive = false;
                this.clearTweens();
                pBWOFExoticFarEastPicker.BaseEvents.COINS_LANDED.dispatch(null);
            }
            this.currentTween = 0;
            this.totalTweens = 0;
            this.resetDisplayObjects(["placeholder_5x", "placeholder_10x", "placeholder_20x"]);
        };
        pBWOFExoticFarEastPicker.WheelView.prototype.__class__ = pBWOFExoticFarEastPicker.WheelView;
        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 (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;
        pBWOFExoticFarEastPicker.WheelAnimator.DEGREE_PER_SECTOR = 16.3636364;;
        pBWOFExoticFarEastPicker.WheelAnimator.DEGREE_TO_ARROW = 0;;
        pBWOFExoticFarEastPicker.WheelAnimator.BASIC_ANGLE = 180.0;;
        pBWOFExoticFarEastPicker.BaseEvents.SPIN_PRESSED = new _hcmn_.msignal_Signal1();;
        pBWOFExoticFarEastPicker.BaseEvents.WHEEL_STARTED = new _hcmn_.msignal_Signal1();;
        pBWOFExoticFarEastPicker.BaseEvents.WHEEL_STOPPED = new _hcmn_.msignal_Signal1();;
        pBWOFExoticFarEastPicker.BaseEvents.WHEEL_SPINNING = new _hcmn_.msignal_Signal1();;
        pBWOFExoticFarEastPicker.BaseEvents.COINS_LANDED = new _hcmn_.msignal_Signal1();;
        pBWOFExoticFarEastPicker.WheelView.CONNECTING_STATE = "CONNECTING_STATE";;
        pBWOFExoticFarEastPicker.WheelView.CONNECTED_STATE = "CONNECTED_STATE";;
        return {
            exports: pBWOFExoticFarEastPicker,
            activator: pBWOFExoticFarEastPicker.Activator
        };
    });
//# sourceURL=pbWofExoticFarEastPicker.js