define("uiHelper", ["viewBuilderApi", "clientkernelLoaderApi", "displayEngineApi", "commonTools", "PIXI", "BABYLON"],
    function(viewBuilderApi, clientkernelLoaderApi, displayEngineApi, commonTools, PIXI, BABYLON) {
        "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 _List == 'undefined') {
            var _List = {};
        };
        _List.ListIterator = function(head) {
            this.head = head;
            this.val = null;
        };
        _List.ListIterator.__name__ = ["_List", "ListIterator"];
        _List.ListIterator.prototype.head = null;
        _List.ListIterator.prototype.val = null;
        _List.ListIterator.prototype.hasNext = function() {
            return this.head != null;
        };
        _List.ListIterator.prototype.next = function() {
            this.val = this.head[0];
            this.head = this.head[1];
            return this.val;
        };
        _List.ListIterator.prototype.__class__ = _List.ListIterator;
        if (typeof haxe == 'undefined') {
            var haxe = {};
        };

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

            get: function(k) {
                return {
                    arguments: ["*"],
                    returns: "null"
                };
            }
        };
        if (!haxe.ds) {
            haxe.ds = {};
        };
        if (!haxe.ds._StringMap) {
            haxe.ds._StringMap = {};
        };
        haxe.ds._StringMap.StringMapIterator = function(map, keys) {
            this.map = map;
            this.keys = keys;
            this.index = 0;
            this.count = keys.length;
        };
        haxe.ds._StringMap.StringMapIterator.__name__ = ["haxe", "ds", "_StringMap", "StringMapIterator"];
        haxe.ds._StringMap.StringMapIterator.prototype.map = null;
        haxe.ds._StringMap.StringMapIterator.prototype.keys = null;
        haxe.ds._StringMap.StringMapIterator.prototype.index = null;
        haxe.ds._StringMap.StringMapIterator.prototype.count = null;
        haxe.ds._StringMap.StringMapIterator.prototype.hasNext = function() {
            return this.index < this.count;
        };
        haxe.ds._StringMap.StringMapIterator.prototype.next = function() {
            return this.map.get(this.keys[this.index++]);
        };
        haxe.ds._StringMap.StringMapIterator.prototype.__class__ = haxe.ds._StringMap.StringMapIterator;
        if (typeof js == 'undefined') {
            var js = {};
        };
        if (!js._Boot) {
            js._Boot = {};
        };
        js._Boot.HaxeError = function(val) {
            Error.call(this);
            this.val = val;
            this.message = String(val);
            if (Error.captureStackTrace) Error.captureStackTrace(this, js._Boot.HaxeError);
        };
        js._Boot.HaxeError.__name__ = ["js", "_Boot", "HaxeError"];
        js._Boot.HaxeError.__super__ = Error;
        for (var k in Error.prototype) js._Boot.HaxeError.prototype[k] = Error.prototype[k];
        js._Boot.HaxeError.prototype.val = null;
        js._Boot.HaxeError.prototype.__class__ = js._Boot.HaxeError;
        if (typeof uiHelper == 'undefined') {
            var uiHelper = {};
        };
        uiHelper.BlendMode = function(value) {
            this.value = value;
            uiHelper.BlendMode.values.push(this);
        };
        uiHelper.BlendMode.__name__ = ["uiHelper", "BlendMode"];
        uiHelper.BlendMode.prototype.value = null;
        uiHelper.BlendMode.getByValue = function(value) {
            var _g = 0;
            var _g1 = uiHelper.BlendMode.values;
            while (_g < _g1.length) {
                var o = _g1[_g];
                ++_g;
                if (value == o.value) return o;
            }
            return null;
        };
        uiHelper.BlendMode.prototype.__class__ = uiHelper.BlendMode;
        uiHelper.CacheHelper = function(stage, useAsGlobal) {
            if (useAsGlobal == null) useAsGlobal = false;
            this.stage = stage;
            if (useAsGlobal) this.cachedItems = uiHelper.CacheHelper.GLOBAL_CACHED_ITEMS;
            else this.cachedItems = new _hcmn_.List();
            this.uiHelper = uiHelper.UiHelper.getSimpleHelper();
        };
        uiHelper.CacheHelper.__name__ = ["uiHelper", "CacheHelper"];
        uiHelper.CacheHelper.prototype.stage = null;
        uiHelper.CacheHelper.prototype.cachedItems = null;
        uiHelper.CacheHelper.prototype.uiHelper = null;
        uiHelper.CacheHelper.prototype.unCacheAll = function() {
            _hcmn_.Lambda.iter(this.cachedItems, $bind(this, this.unCacheDisplayObject));
            this.cachedItems.clear();
            return this;
        };
        uiHelper.CacheHelper.prototype.cacheAll = function() {
            this.cacheAllExcept([]);
            return this;
        };
        uiHelper.CacheHelper.prototype.cacheOnly = function(childNames) {
            _hcmn_.Lambda.iter(this.getChildrenInclude(childNames), $bind(this, this.cacheDisplayObject));
            return this;
        };
        uiHelper.CacheHelper.prototype.cacheAllExcept = function(childNames) {
            _hcmn_.Lambda.iter(this.getChildrenExcept(childNames), $bind(this, this.cacheDisplayObject));
            return this;
        };
        uiHelper.CacheHelper.prototype.unCacheDisplayObject = function(displayObject) {
            displayObject.setCacheAsBitmap(false);
        };
        uiHelper.CacheHelper.prototype.cacheDisplayObject = function(displayObject) {
            this.cachedItems.push(displayObject);
            displayObject.setCacheAsBitmap(true);
        };
        uiHelper.CacheHelper.prototype.getChildrenExcept = function(names) {
            return this.getChildren().filter(this.getNotContainsNameOfDisplayObjectInListFilter(names));
        };
        uiHelper.CacheHelper.prototype.getChildrenInclude = function(names) {
            return this.getChildren().filter(this.getContainsNameOfDisplayObjectInListFilter(names));
        };
        uiHelper.CacheHelper.prototype.getChildren = function() {
            return _hcmn_.Lambda.filter(this.stage.getChildren(), $bind(this, this.isDisplayObjectAbleToCache));
        };
        uiHelper.CacheHelper.prototype.isDisplayObjectAbleToCache = function(displaObject) {
            return displaObject.getVisible() && !this.uiHelper.isCacheAsBitmap(displaObject);
        };
        uiHelper.CacheHelper.prototype.getContainsNameOfDisplayObjectInListFilter = function(names) {
            return function(displaObject) {
                return (function($this) {
                    var $r;
                    var x = displaObject.getName();
                    $r = _hcmn_.HxOverrides.indexOf(names, x, 0);
                    return $r;
                }(this)) != -1;
            };
        };
        uiHelper.CacheHelper.prototype.getNotContainsNameOfDisplayObjectInListFilter = function(names) {
            return function(displaObject) {
                return (function($this) {
                    var $r;
                    var x = displaObject.getName();
                    $r = _hcmn_.HxOverrides.indexOf(names, x, 0);
                    return $r;
                }(this)) == -1;
            };
        };
        uiHelper.CacheHelper.prototype.__class__ = uiHelper.CacheHelper;
        uiHelper.DrawOptions = function() {
            this.polygons = [];
            this.drawRoundRect = false;
            this.fillCache = false;
            this.fillAlpha = 0;
            this.lineAlignment = 0.5;
            this.lineCache = false;
            this.lineAlpha = 0;
            this.useFillStyleEnd = true;
            this.useFillStyle = false;
            this.useLineStyle = false;
        };
        uiHelper.DrawOptions.__name__ = ["uiHelper", "DrawOptions"];
        uiHelper.DrawOptions.prototype.useLineStyle = null;
        uiHelper.DrawOptions.prototype.useFillStyle = null;
        uiHelper.DrawOptions.prototype.useFillStyleEnd = null;
        uiHelper.DrawOptions.prototype.thickness = null;
        uiHelper.DrawOptions.prototype.lineColor = null;
        uiHelper.DrawOptions.prototype.lineAlpha = null;
        uiHelper.DrawOptions.prototype.lineCache = null;
        uiHelper.DrawOptions.prototype.lineAlignment = null;
        uiHelper.DrawOptions.prototype.fillColor = null;
        uiHelper.DrawOptions.prototype.fillAlpha = null;
        uiHelper.DrawOptions.prototype.fillCache = null;
        uiHelper.DrawOptions.prototype.drawRoundRect = null;
        uiHelper.DrawOptions.prototype.polygons = null;
        uiHelper.DrawOptions.prototype.__class__ = uiHelper.DrawOptions;

        uiHelper.IGraphicsDrawer = function() {}
        uiHelper.IGraphicsDrawer.prototype = {

            withClearBeforeDraw: function(value) {
                return {
                    arguments: [{
                        type: "boolean",
                        opt: true
                    }],
                    returns: "*"
                };
            },
            clearPolygons: function() {
                return {
                    arguments: [],
                    returns: "*"
                };
            },
            breakPolygons: function() {
                return {
                    arguments: [],
                    returns: "*"
                };
            },
            withLineStyle: function(thickness, color, alpha, lineAlignment, cache) {
                return {
                    arguments: ["number", "number", {
                        type: "number",
                        opt: true
                    }, {
                        type: "number",
                        opt: true
                    }, {
                        type: "boolean",
                        opt: true
                    }],
                    returns: "*"
                };
            },
            withFillStyle: function(color, alpha, cache) {
                return {
                    arguments: ["number", {
                        type: "number",
                        opt: true
                    }, {
                        type: "boolean",
                        opt: true
                    }],
                    returns: "*"
                };
            },
            addRoundRect: function(x, y, width, height, borderRadius) {
                return {
                    arguments: ["number", "number", "number", "number", "number"],
                    returns: "*"
                };
            },
            addPolygon: function(x, y, useMoveTo) {
                return {
                    arguments: ["number", "number", {
                        type: "boolean",
                        opt: true
                    }],
                    returns: "*"
                };
            },
            addPolygons: function(polygons, useMoveTo) {
                return {
                    arguments: ["array", {
                        type: "boolean",
                        opt: true
                    }],
                    returns: "*"
                };
            },
            drawFor: function(graphics) {
                return {
                    arguments: ["*"],
                    returns: "*"
                };
            },
            draw: function() {
                return {
                    arguments: [],
                    returns: "*"
                };
            },
            drawPolygons: function(polygons) {
                return {
                    arguments: ["array"],
                    returns: "*"
                };
            },
            drawPolygonsFor: function(graphics, polygons) {
                return {
                    arguments: ["*", "array"],
                    returns: "*"
                };
            }
        };
        uiHelper.GraphicsDrawer = function(graphics) {
            this.clearBeforeDraw = false;
            this.polygons = [new uiHelper.DrawOptions()];
            this.graphics = graphics;
        };
        uiHelper.GraphicsDrawer = ck_implements(uiHelper.GraphicsDrawer, uiHelper.IGraphicsDrawer);
        uiHelper.GraphicsDrawer.__interfaces__ = [uiHelper.IGraphicsDrawer];
        uiHelper.GraphicsDrawer.__name__ = ["uiHelper", "GraphicsDrawer"];
        uiHelper.GraphicsDrawer.prototype.graphics = null;
        uiHelper.GraphicsDrawer.prototype.polygons = null;
        uiHelper.GraphicsDrawer.prototype.clearBeforeDraw = null;
        uiHelper.GraphicsDrawer.prototype.withClearBeforeDraw = function(value) {
            if (value == null) value = true;
            this.clearBeforeDraw = value;
            return this;
        };
        uiHelper.GraphicsDrawer.prototype.withLineStyle = function(thickness, color, alpha, lineAlignment, cache) {
            if (cache == null) cache = false;
            if (lineAlignment == null) lineAlignment = 0.5;
            if (alpha == null) alpha = 1;
            this.polygons[this.polygons.length - 1].useLineStyle = true;
            this.polygons[this.polygons.length - 1].thickness = thickness;
            this.polygons[this.polygons.length - 1].lineColor = color;
            this.polygons[this.polygons.length - 1].lineAlpha = alpha;
            this.polygons[this.polygons.length - 1].lineAlignment = lineAlignment;
            this.polygons[this.polygons.length - 1].lineCache = cache;
            return this;
        };
        uiHelper.GraphicsDrawer.prototype.clearPolygons = function() {
            this.polygons = [new uiHelper.DrawOptions()];
            return this;
        };
        uiHelper.GraphicsDrawer.prototype.breakPolygons = function() {
            this.polygons.push(new uiHelper.DrawOptions());
            return this;
        };
        uiHelper.GraphicsDrawer.prototype.addPolygon = function(x, y, useMoveTo) {
            if (useMoveTo == null) useMoveTo = true;
            this.polygons[this.polygons.length - 1].polygons.push(x);
            this.polygons[this.polygons.length - 1].polygons.push(y);
            return this;
        };
        uiHelper.GraphicsDrawer.prototype.addRoundRect = function(x, y, width, height, borderRadius) {
            this.breakPolygons();
            var roundRectPolygons = [x, y, width, height, borderRadius];
            this.polygons[this.polygons.length - 2].useFillStyleEnd = false;
            this.polygons[this.polygons.length - 1].drawRoundRect = true;
            this.polygons[this.polygons.length - 1].polygons = this.polygons[this.polygons.length - 1].polygons.concat(roundRectPolygons);
            return this;
        };
        uiHelper.GraphicsDrawer.prototype.addPolygons = function(polygons, useMoveTo) {
            if (useMoveTo == null) useMoveTo = true;
            if (useMoveTo) {
                this.breakPolygons();
                this.polygons[this.polygons.length - 2].useFillStyleEnd = false;
                this.polygons[this.polygons.length - 1].polygons = this.polygons[this.polygons.length - 1].polygons.concat(polygons);
            } else this.polygons[this.polygons.length - 1].polygons = this.polygons[this.polygons.length - 1].polygons.concat(polygons);
            return this;
        };
        uiHelper.GraphicsDrawer.prototype.withFillStyle = function(color, alpha, cache) {
            if (cache == null) cache = false;
            if (alpha == null) alpha = 1;
            this.polygons[this.polygons.length - 1].useFillStyle = true;
            this.polygons[this.polygons.length - 1].fillColor = color;
            this.polygons[this.polygons.length - 1].fillAlpha = alpha;
            this.polygons[this.polygons.length - 1].fillCache = cache;
            return this;
        };
        uiHelper.GraphicsDrawer.prototype.drawFor = function(graphics) {
            return this.drawPolygonsFor(graphics, this.polygons);
        };
        uiHelper.GraphicsDrawer.prototype.draw = function() {
            return this.drawPolygons(this.polygons);
        };
        uiHelper.GraphicsDrawer.prototype.drawPolygons = function(polygons) {
            return this.drawPolygonsFor(this.graphics, polygons);
        };
        uiHelper.GraphicsDrawer.prototype.drawPolygonsFor = function(graphics, polygons) {
            if (this.clearBeforeDraw) graphics.clear();
            var _g = 0;
            while (_g < polygons.length) {
                var polygons1 = polygons[_g];
                ++_g;
                this.drawMe(graphics, polygons1);
            }
            return graphics;
        };
        uiHelper.GraphicsDrawer.prototype.drawMe = function(graphics, drawOptions) {
            var polygons = drawOptions.polygons;
            if (drawOptions.useFillStyle) graphics.beginFill(drawOptions.fillColor, drawOptions.fillAlpha);
            if (drawOptions.useLineStyle) {
                graphics.lineStyle(drawOptions.thickness, drawOptions.lineColor, drawOptions.lineAlpha, drawOptions.lineCache);
                graphics._g.lineStyle(graphics._lineStyle.lineWidth | 0, graphics._lineStyle.color, graphics._lineStyle.alpha, drawOptions.lineAlignment);
            }
            if (drawOptions.drawRoundRect) graphics.drawRoundRect(drawOptions.polygons[0], drawOptions.polygons[1], drawOptions.polygons[2], drawOptions.polygons[3], drawOptions.polygons[4]);
            else {
                graphics.moveTo(polygons[0], polygons[1]);
                var i = 0;
                while (i < polygons.length) {
                    graphics.lineTo(polygons[i], polygons[i + 1]);
                    i += 2;
                }
            }
            if (drawOptions.useFillStyle && drawOptions.useFillStyleEnd) graphics.endFill();
        };
        uiHelper.GraphicsDrawer.prototype.__class__ = uiHelper.GraphicsDrawer;
        uiHelper.GuiMath = function() {};
        uiHelper.GuiMath.__name__ = ["uiHelper", "GuiMath"];
        uiHelper.GuiMath.rotatePointAroundPoint = function(point, arroundPoint, angle) {
            return uiHelper.GuiMath.addPoints(uiHelper.GuiMath.rotatePoint(uiHelper.GuiMath.subtractPoint(point, arroundPoint), angle), arroundPoint);
        };
        uiHelper.GuiMath.rotatePoint = function(point, angle) {
            angle = uiHelper.GuiMath.converGradToRad(angle);
            return uiHelper.GuiMath.calcRotation(new displayEngineApi.Point(point.x, point.y), _hcmn_.Math.sin(angle), _hcmn_.Math.cos(angle));
        };
        uiHelper.GuiMath.calcRotation = function(point, sinA, cosA) {
            var xx = point.x * cosA - point.y * sinA;
            point.y = point.y * cosA + point.x * sinA;
            point.x = xx;
            return point;
        };
        uiHelper.GuiMath.addPoints = function(v1, v2) {
            return new displayEngineApi.Point(v1.x + v2.x, v1.y + v2.y);
        };
        uiHelper.GuiMath.angleOfVector = function(vector) {
            var unitVector = uiHelper.GuiMath.getUnitVector(vector);
            var a = _hcmn_.Math.acos(unitVector.x);
            if (unitVector.y < 0) a = _hcmn_.Math.PI * 2 - a;
            return uiHelper.GuiMath.converRadToGrad(a);
        };
        uiHelper.GuiMath.converGradToRad = function(angle) {
            return (angle + 360) / 360 * (_hcmn_.Math.PI * 2);
        };
        uiHelper.GuiMath.converRadToGrad = function(angle) {
            return angle / (2 * _hcmn_.Math.PI) * 360;
        };
        uiHelper.GuiMath.subtractPoint = function(v1, v2) {
            return new displayEngineApi.Point(v1.x - v2.x, v1.y - v2.y);
        };
        uiHelper.GuiMath.getPointLength = function(point) {
            return _hcmn_.Math.sqrt(point.x * point.x + point.y * point.y);
        };
        uiHelper.GuiMath.getUnitVector = function(vector) {
            var length = uiHelper.GuiMath.getPointLength(vector);
            return new displayEngineApi.Point(vector.x / length, vector.y / length);
        };
        uiHelper.GuiMath.getDistance = function(point1, point2) {
            return _hcmn_.Math.sqrt(_hcmn_.Math.pow(point2.x - point1.x, 2) + _hcmn_.Math.pow(point2.y - point1.y, 2));
        };
        uiHelper.GuiMath.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);
        };
        uiHelper.GuiMath.getSegmentsIntersection = function(b1, b2) {
            var ta1 = b1.point1.x - b1.point2.x;
            var tb1 = b2.point2.x - b2.point1.x;
            var ta2 = b1.point1.y - b1.point2.y;
            var tb2 = b2.point2.y - b2.point1.y;
            var d = ta1 * tb2 - ta2 * tb1;
            if (d != 0) {
                var tc1 = b1.point1.x - b2.point1.x;
                var tc2 = b1.point1.y - b2.point1.y;
                var dx = tc1 * tb2 - tc2 * tb1;
                var dy = ta1 * tc2 - ta2 * tc1;
                var t1 = dx / d;
                var t2 = dy / d;
                if (t1 >= 0 && t1 <= 1 && t2 >= 0 && t2 <= 1) return new displayEngineApi.Point(b1.point1.x - ta1 * t1, b1.point1.y - ta2 * t1);
            }
            return null;
        };
        uiHelper.GuiMath.prototype.__class__ = uiHelper.GuiMath;

        uiHelper.ISimpleUiHelper = function() {}
        uiHelper.ISimpleUiHelper.prototype = {

            getGraphicsDrawerFor: function(graphics) {
                return {
                    arguments: ["*"],
                    returns: "*"
                };
            },
            getRectPolygons: function(width, height, paddingX, paddingY) {
                return {
                    arguments: ["number", "number", {
                        type: "number",
                        opt: true
                    }, {
                        type: "number",
                        opt: true
                    }],
                    returns: "array"
                };
            },
            getCirclePolygons: function(radius, steps, startAngle) {
                return {
                    arguments: ["number", "number", {
                        type: "number",
                        opt: true
                    }],
                    returns: "array"
                };
            },
            clearMask: function(container) {
                return {
                    arguments: ["*"],
                    returns: "void"
                };
            },
            getUserDataFromVBContainer: function(viewBuilderContainer) {
                return {
                    arguments: ["*"],
                    returns: "null"
                };
            },
            getUserData: function(dispayObject) {
                return {
                    arguments: ["*"],
                    returns: "null"
                };
            },
            setFps: function(dispayObject, fps) {
                return {
                    arguments: ["*", "number"],
                    returns: "void"
                };
            },
            setBlendMode: function(dispayObject, blendMode) {
                return {
                    arguments: ["*", "*"],
                    returns: "void"
                };
            },
            isCacheAsBitmap: function(dispayObject) {
                return {
                    arguments: ["*"],
                    returns: "boolean"
                };
            },
            wrapAsMovieClip: function(dispayObject, offScreen) {
                return {
                    arguments: ["*", {
                        type: "boolean",
                        opt: true
                    }],
                    returns: "*"
                };
            },
            addMask: function(container, mask) {
                return {
                    arguments: ["*", "*"],
                    returns: "void"
                };
            },
            setChildrenCacheAsBitmap: function(container, state) {
                return {
                    arguments: ["*", "boolean"],
                    returns: "void"
                };
            },
            getUiGroupFor: function(container, childNames) {
                return {
                    arguments: ["*", "array"],
                    returns: "*"
                };
            },
            eachAllChilds: function(parent, eachFunction) {
                return {
                    arguments: ["*", "*"],
                    returns: "void"
                };
            }
        };

        uiHelper.IUiHelper = function() {}
        uiHelper.IUiHelper.prototype = {

            getNewDisplaObjectContainer: function(name) {
                return {
                    arguments: [{
                        type: "string",
                        opt: true
                    }],
                    returns: "*"
                };
            },
            getGraphicsDrawer: function(cacheCommands) {
                return {
                    arguments: [{
                        type: "boolean",
                        opt: true
                    }],
                    returns: "*"
                };
            },
            getGraphics: function(polygons, color, alpha) {
                return {
                    arguments: ["array", {
                        type: "number",
                        opt: true
                    }, {
                        type: "number",
                        opt: true
                    }],
                    returns: "*"
                };
            },
            showMask: function(container, polygons, paddingX, paddingY) {
                return {
                    arguments: ["*", "array", {
                        type: "number",
                        opt: true
                    }, {
                        type: "number",
                        opt: true
                    }],
                    returns: "void"
                };
            },
            showRectMask: function(container, width, height, paddingX, paddingY) {
                return {
                    arguments: ["*", "number", "number", {
                        type: "number",
                        opt: true
                    }, {
                        type: "number",
                        opt: true
                    }],
                    returns: "void"
                };
            },
            addPolygonsMask: function(container, polygons, paddingX, paddingY) {
                return {
                    arguments: ["*", "array", {
                        type: "number",
                        opt: true
                    }, {
                        type: "number",
                        opt: true
                    }],
                    returns: "void"
                };
            },
            addRectMask: function(container, width, height, paddingX, paddingY) {
                return {
                    arguments: ["*", "number", "number", {
                        type: "number",
                        opt: true
                    }, {
                        type: "number",
                        opt: true
                    }],
                    returns: "void"
                };
            },
            getMask: function(polygons, paddingX, paddingY, alpha) {
                return {
                    arguments: ["array", {
                        type: "number",
                        opt: true
                    }, {
                        type: "number",
                        opt: true
                    }, {
                        type: "number",
                        opt: true
                    }],
                    returns: "*"
                };
            },
            getCacheHelper: function(useAsGlobal, stageName) {
                return {
                    arguments: [{
                        type: "boolean",
                        opt: true
                    }, {
                        type: "*",
                        opt: true
                    }],
                    returns: "*"
                };
            }
        };
        uiHelper.Segment = function(p1, p2) {
            if (p1 != null) this.point1 = new displayEngineApi.Point(p1.x, p1.y);
            else this.point1 = new displayEngineApi.Point();
            if (p2 != null) this.point2 = new displayEngineApi.Point(p2.x, p2.y);
            else this.point2 = new displayEngineApi.Point();
        };
        uiHelper.Segment.__name__ = ["uiHelper", "Segment"];
        uiHelper.Segment.prototype.point1 = null;
        uiHelper.Segment.prototype.point2 = null;
        uiHelper.Segment.prototype.__class__ = uiHelper.Segment;
        uiHelper.UiHelper = function(displayProvider) {
            this.displayProvider = displayProvider;
            if (displayProvider != null) this.factory = displayProvider.getFactory();
            else this.factory = null;
        };
        uiHelper.UiHelper = ck_implements(uiHelper.UiHelper, uiHelper.IUiHelper);
        uiHelper.UiHelper.__interfaces__ = [uiHelper.IUiHelper];
        uiHelper.UiHelper.__name__ = ["uiHelper", "UiHelper"];
        uiHelper.UiHelper.prototype.factory = null;
        uiHelper.UiHelper.prototype.displayProvider = null;
        uiHelper.UiHelper.prototype.getCacheHelper = function(useAsGlobal, stageName) {
            if (useAsGlobal == null) useAsGlobal = false;
            var stage;
            if (stageName == null) stage = this.displayProvider.getDefaultStage();
            else {
                var this1 = this.displayProvider.getStages();
                stage = this1.get(stageName);
            }
            if (stage == null) throw new js._Boot.HaxeError("Could not get stage by name: " + stageName);
            return new uiHelper.CacheHelper(stage, useAsGlobal);
        };
        uiHelper.UiHelper.prototype.showRectMask = function(container, width, height, paddingX, paddingY) {
            if (paddingY == null) paddingY = 0;
            if (paddingX == null) paddingX = 0;
            var maskPoints = this.getRectPolygons(width, height);
            this.showMask(container, maskPoints, paddingX, paddingY);
        };
        uiHelper.UiHelper.prototype.showMask = function(container, polygons, paddingX, paddingY) {
            if (paddingY == null) paddingY = 0;
            if (paddingX == null) paddingX = 0;
            this.clearMask(container);
            var mask = this.getMask(polygons, paddingX, paddingY, .5);
            mask.setName("mask");
            if (container.getChildByName("mask") != null) container.removeChild(container.getChildByName("mask"));
            container.setCacheAsBitmap(false);
            container.addChildAt(mask, 0);
        };
        uiHelper.UiHelper.prototype.clearMask = function(container) {
            var mask = container.getMask();
            if (mask != null) container._obj._mask = null;
        };
        uiHelper.UiHelper.prototype.getRectPolygons = function(width, height, paddingX, paddingY) {
            if (paddingY == null) paddingY = 0;
            if (paddingX == null) paddingX = 0;
            var zeroV = 0;
            var result = [paddingX + zeroV, paddingY + zeroV, paddingX + width, paddingY + zeroV, paddingX + width, paddingY + height, paddingX + zeroV, paddingY + height, paddingX + zeroV, paddingY + zeroV];
            return result;
        };
        uiHelper.UiHelper.prototype.addRectMask = function(container, width, height, paddingX, paddingY) {
            if (paddingY == null) paddingY = 0;
            if (paddingX == null) paddingX = 0;
            var maskPoints = this.getRectPolygons(width, height);
            this.addPolygonsMask(container, maskPoints, paddingX, paddingY);
        };
        uiHelper.UiHelper.prototype.addPolygonsMask = function(container, polygons, paddingX, paddingY) {
            if (paddingY == null) paddingY = 0;
            if (paddingX == null) paddingX = 0;
            var mask = this.getMask(polygons, paddingX, paddingY, 1);
            this.addMask(container, mask);
        };
        uiHelper.UiHelper.prototype.addMask = function(container, mask) {
            var isCachedAsBitmap = this.isCacheAsBitmap(container);
            container.setCacheAsBitmap(false);
            this.clearMask(container);
            container.setMask(mask);
            container.setCacheAsBitmap(isCachedAsBitmap);
        };
        uiHelper.UiHelper.prototype.getMask = function(polygons, paddingX, paddingY, alpha) {
            if (alpha == null) alpha = 1;
            if (paddingY == null) paddingY = 0;
            if (paddingX == null) paddingX = 0;
            var mask = this.getGraphics(polygons, 16711680, alpha);
            mask.setX(paddingX);
            mask.setY(paddingY);
            return mask;
        };
        uiHelper.UiHelper.prototype.getNewDisplaObjectContainer = function(name) {
            if (name == null) name = "NewDisplaObjectContainer";
            var container = this.factory.createDisplayObjectContainer();
            container.setName(name);
            return container;
        };
        uiHelper.UiHelper.prototype.getGraphicsDrawer = function(cacheCommands) {
            if (cacheCommands == null) cacheCommands = false;
            return this.getGraphicsDrawerFor(this.factory.createGraphics(cacheCommands));
        };
        uiHelper.UiHelper.prototype.getGraphicsDrawerFor = function(graphics) {
            return new uiHelper.GraphicsDrawer(graphics);
        };
        uiHelper.UiHelper.prototype.getGraphics = function(polygons, color, alpha) {
            if (alpha == null) alpha = 1;
            if (color == null) color = 16711680;
            var graphics = this.factory.createGraphics();
            graphics.beginFill(color, alpha);
            graphics.moveTo(polygons[0], polygons[1]);
            var i = 0;
            while (i < polygons.length) {
                graphics.lineTo(polygons[i], polygons[i + 1]);
                i += 2;
            }
            graphics.endFill();
            return graphics;
        };
        uiHelper.UiHelper.prototype.getCirclePolygons = function(radius, steps, startAngle) {
            if (startAngle == null) startAngle = 0.0;
            var polygons = [];
            var angle = startAngle;
            var angleStep = 2 * _hcmn_.Math.PI / steps;
            var _g = 0;
            while (_g < steps) {
                var i = _g++;
                var point = new displayEngineApi.Point(_hcmn_.Math.cos(angle) * radius, _hcmn_.Math.sin(angle) * radius);
                polygons.push(point.x + radius);
                polygons.push(point.y + radius);
                angle += angleStep;
            }
            return polygons;
        };
        uiHelper.UiHelper.prototype.getUserDataFromVBContainer = function(viewBuilderContainer) {
            return this.getUserData(viewBuilderContainer.getDisplayObject());
        };
        uiHelper.UiHelper.prototype.getUserData = function(dispayObject) {
            return dispayObject.getUserData();
        };
        uiHelper.UiHelper.prototype.setBlendMode = function(dispayObject, blendMode) {
            dispayObject._obj.blendMode = blendMode.value;
        };
        uiHelper.UiHelper.prototype.setFps = function(dispayObject, fps) {
            dispayObject.fps = fps;
        };
        uiHelper.UiHelper.prototype.isCacheAsBitmap = function(dispayObject) {
            return dispayObject._obj.cacheAsBitmap;
        };
        uiHelper.UiHelper.prototype.eachAllChilds = function(parent, eachFunction) {
            var _g1 = 0;
            var _g = parent.getNumChildren();
            while (_g1 < _g) {
                var i = _g1++;
                var child = parent.getChildAt(i);
                eachFunction(child);
                if (_hcmn_.js_Boot.__instanceof(child, displayEngineApi.IDisplayObjectContainer)) this.eachAllChilds(child, eachFunction);
            }
        };
        uiHelper.UiHelper.prototype.wrapAsMovieClip = function(animation, offScreen) {
            if (offScreen == null) offScreen = false;
            var _g = this;
            var result = animation;
            if ($bind(result, result.getFramesAmount) != null) return result;
            result.getFramesAmount = function() {
                if (result.hasFrames) return result.frames.length;
                if ($bind(result, result.getChildComponents) == null) return 0;
                var layerContainers = result.getChildComponents();
                var $it0 = layerContainers.keys();
                while ($it0.hasNext()) {
                    var layerId = $it0.next();
                    var child = result.getVBAnimationById(layerId);
                    if (child.hasFrames) return child.frames.length;
                }
                return 0;
            };
            result.gotoAndStopOnLabel = function(label) {
                var frame = result.frameLabels.get(label) + 1;
                result.gotoAndStopOnFrame(frame);
            };
            result.gotoAndPlayOnLabel = function(label1) {
                var frame1 = result.frameLabels.get(label1) + 1;
                result.gotoAndPlayOnFrame(frame1);
            };
            result.gotoAndPlayOnFrame = function(frame2) {
                result.gotoAndStopOnFrame(frame2);
                result.play(offScreen);
            };
            result.gotoOnNextFrame = function() {
                result.gotoAndStopOnFrame(_hcmn_.Math.round(_hcmn_.Math.min(result.getFramesAmount(), result.frameCount + 2)));
            };
            result.gotoOnPrevFrame = function() {
                result.gotoAndStopOnFrame(_hcmn_.Math.round(_hcmn_.Math.max(1, result.frameCount)));
            };
            result.gotoAndStopOnFrame = function(frame3) {
                if ($bind(result, result.getChildComponents) == null) {
                    if (_hcmn_.Std["is"](result.getDisplayObject(), displayEngineApi.IMovieClip))(_hcmn_.js_Boot.__cast(result.getDisplayObject(), displayEngineApi.IMovieClip)).gotoAndStop(null, frame3 - 1);
                    return;
                }
                var fixedFrame = _hcmn_.Math.round(_hcmn_.Math.min(frame3, result.getFramesAmount()));
                var expectedFrameCount = _hcmn_.Math.round(_hcmn_.Math.max(0, fixedFrame - 1));
                result.frameCount = fixedFrame;
                result.playingState = true;
                var layerContainers1 = result.getChildComponents();
                result.frameCount = expectedFrameCount;
                if ($bind(result, result.playAnimationContainer) != null) result.playAnimationContainer(result, result, true, true);
                result.playingState = true;
                result.frameCount = expectedFrameCount;
                result.stop();
                var $it1 = layerContainers1.keys();
                while ($it1.hasNext()) {
                    var layerId1 = $it1.next();
                    var child1 = _g.wrapAsMovieClip(result.getVBAnimationById(layerId1));
                    child1.frameCount = expectedFrameCount;
                    child1.gotoAndStopOnFrame(fixedFrame);
                    child1.playingState = true;
                    child1.frameCount = expectedFrameCount;
                }
                result.playingState = false;
            };
            return result;
        };
        uiHelper.UiHelper.prototype.setChildrenCacheAsBitmap = function(container, state) {
            var children = container.getChildren();
            var _g = 0;
            while (_g < children.length) {
                var child = children[_g];
                ++_g;
                child.setCacheAsBitmap(state);
                if (_hcmn_.js_Boot.__instanceof(child, displayEngineApi.IDisplayObjectContainer)) this.setChildrenCacheAsBitmap(_hcmn_.js_Boot.__cast(child, displayEngineApi.IDisplayObjectContainer), state);
            }
        };
        uiHelper.UiHelper.prototype.getUiGroupFor = function(container, childNames) {
            var result = new uiHelper.UiGroup();
            var _g = 0;
            while (_g < childNames.length) {
                var childName = childNames[_g];
                ++_g;
                result.addElementProvider((function(f, a1) {
                    return function() {
                        return f(a1);
                    };
                })($bind(container, container.getChildByName), childName));
            }
            return result;
        };
        uiHelper.UiHelper.getUiHelper = function(displayProvider) {
            return new uiHelper.UiHelper(displayProvider);
        };
        uiHelper.UiHelper.getSimpleHelper = function() {
            return uiHelper.UiHelper.getUiHelper(null);
        };
        uiHelper.UiHelper.prototype.__class__ = uiHelper.UiHelper;
        uiHelper.IntervalAnimator = function(enterFrameListener, animationInterval) {
            this.symbolsToPlay = [];
            this.animationInterval = 0;
            this.currentAnimationInterval = 0;
            this.previousDate = 0;
            this.enterFrameListener = enterFrameListener;
            this.animationInterval = animationInterval;
        };
        uiHelper.IntervalAnimator.__name__ = ["uiHelper", "IntervalAnimator"];
        uiHelper.IntervalAnimator.prototype.enterFrameListener = null;
        uiHelper.IntervalAnimator.prototype.previousDate = null;
        uiHelper.IntervalAnimator.prototype.currentAnimationInterval = null;
        uiHelper.IntervalAnimator.prototype.animationInterval = null;
        uiHelper.IntervalAnimator.prototype.symbolsToPlay = null;
        uiHelper.IntervalAnimator.prototype.addAnimation = function(animaion, cycleAmountPerInterval) {
            this.symbolsToPlay.push({
                animaion: animaion,
                cycleAmountPerInterval: cycleAmountPerInterval
            });
        };
        uiHelper.IntervalAnimator.prototype.removeAnimations = function() {
            this.symbolsToPlay = [];
        };
        uiHelper.IntervalAnimator.prototype.hasAnimations = function() {
            return this.symbolsToPlay.length > 0;
        };
        uiHelper.IntervalAnimator.prototype.runSynchronizedDrawer = function() {
            this.enterFrameListener.addListener($bind(this, this.onEnterFrame));
            this.previousDate = new _hcmn_.Date().getTime();
            this.currentAnimationInterval = 0;
        };
        uiHelper.IntervalAnimator.prototype.stopSynchronizedDrawer = function() {
            this.enterFrameListener.removeListener($bind(this, this.onEnterFrame));
        };
        uiHelper.IntervalAnimator.prototype.onEnterFrame = function() {
            var currentDate = new _hcmn_.Date().getTime();
            var dt = currentDate - this.previousDate;
            this.currentAnimationInterval += dt;
            var precision = _hcmn_.Math.min(this.currentAnimationInterval / this.animationInterval, 1);
            this.draw(this.currentAnimationInterval, precision);
            this.previousDate = currentDate;
        };
        uiHelper.IntervalAnimator.prototype.draw = function(dt, precision) {
            var _g = 0;
            var _g1 = this.symbolsToPlay;
            while (_g < _g1.length) {
                var symbol = _g1[_g];
                ++_g;
                var animation = symbol.animaion;
                var cycleAmountPerInterval = symbol.cycleAmountPerInterval;
                var framesAmount = uiHelper.VBAnimationExtension.getFramesAmount(animation);
                var frame = _hcmn_.Math.round((framesAmount - 1) * precision * cycleAmountPerInterval) + cycleAmountPerInterval - 1;
                var frame1 = frame % framesAmount + 1;
                if (uiHelper.VBAnimationExtension.getFrameCount(animation) != frame1) uiHelper.VBAnimationExtension.gotoAndStopOnFrame(animation, frame1);
            }
        };
        uiHelper.IntervalAnimator.prototype.__class__ = uiHelper.IntervalAnimator;

        uiHelper.IEnterFrameListener = function() {}
        uiHelper.IEnterFrameListener.prototype = {

            addListener: function(listener) {
                return {
                    arguments: ["*"],
                    returns: "void"
                };
            },
            removeListener: function(listener) {
                return {
                    arguments: ["*"],
                    returns: "void"
                };
            }
        };
        uiHelper.StageEnterFrameListener = function(stage) {
            this.stage = stage;
        };
        uiHelper.StageEnterFrameListener = ck_implements(uiHelper.StageEnterFrameListener, uiHelper.IEnterFrameListener);
        uiHelper.StageEnterFrameListener.__interfaces__ = [uiHelper.IEnterFrameListener];
        uiHelper.StageEnterFrameListener.__name__ = ["uiHelper", "StageEnterFrameListener"];
        uiHelper.StageEnterFrameListener.prototype.stage = null;
        uiHelper.StageEnterFrameListener.prototype.addListener = function(listener) {
            this.stage.on(displayEngineApi.DisplayObjectEvents.ENTER_FRAME, listener);
        };
        uiHelper.StageEnterFrameListener.prototype.removeListener = function(listener) {
            this.stage.off(displayEngineApi.DisplayObjectEvents.ENTER_FRAME, listener);
        };
        uiHelper.StageEnterFrameListener.prototype.__class__ = uiHelper.StageEnterFrameListener;
        uiHelper.DisplayObjectExtension = function() {};
        uiHelper.DisplayObjectExtension.__name__ = ["uiHelper", "DisplayObjectExtension"];
        uiHelper.DisplayObjectExtension.updateCacheAsBitmap = function(value) {
            var cache = value.getCacheAsBitmap();
            if (cache) {
                uiHelper.DisplayObjectExtension.cacheAsBitmap(value, false);
                uiHelper.DisplayObjectExtension.cacheAsBitmap(value, cache);
            }
        };
        uiHelper.DisplayObjectExtension.cacheAsBitmap = function(displaObject, value) {
            if (value == null) value = true;
            var iOS = eval("/iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream");
            if (iOS) return;
            displaObject.setCacheAsBitmap(value);
        };
        uiHelper.DisplayObjectExtension.prototype.__class__ = uiHelper.DisplayObjectExtension;
        uiHelper.OffScreenVBAnimationExtension = function() {};
        uiHelper.OffScreenVBAnimationExtension.__name__ = ["uiHelper", "OffScreenVBAnimationExtension"];
        uiHelper.OffScreenVBAnimationExtension.gotoAndStopOnLabel = function(dispayObject, label) {
            uiHelper.OffScreenVBAnimationExtension.wrapAsMovieClip(dispayObject).gotoAndStopOnLabel(label);
        };
        uiHelper.OffScreenVBAnimationExtension.gotoAndPlayOnLabel = function(dispayObject, label) {
            uiHelper.OffScreenVBAnimationExtension.wrapAsMovieClip(dispayObject).gotoAndPlayOnLabel(label);
        };
        uiHelper.OffScreenVBAnimationExtension.gotoAndStopOnFrame = function(dispayObject, frame) {
            uiHelper.OffScreenVBAnimationExtension.wrapAsMovieClip(dispayObject).gotoAndStopOnFrame(frame);
        };
        uiHelper.OffScreenVBAnimationExtension.gotoAndPlayOnFrame = function(dispayObject, frame) {
            uiHelper.OffScreenVBAnimationExtension.wrapAsMovieClip(dispayObject).gotoAndPlayOnFrame(frame);
        };
        uiHelper.OffScreenVBAnimationExtension.getFramesAmount = function(dispayObject) {
            return uiHelper.OffScreenVBAnimationExtension.wrapAsMovieClip(dispayObject).getFramesAmount();
        };
        uiHelper.OffScreenVBAnimationExtension.getFrameCount = function(dispayObject) {
            return uiHelper.OffScreenVBAnimationExtension.wrapAsMovieClip(dispayObject).frameCount + 1;
        };
        uiHelper.OffScreenVBAnimationExtension.gotoOnNextFrame = function(dispayObject) {
            uiHelper.OffScreenVBAnimationExtension.wrapAsMovieClip(dispayObject).gotoOnNextFrame();
            return;
        };
        uiHelper.OffScreenVBAnimationExtension.gotoOnPrevFrame = function(dispayObject) {
            uiHelper.OffScreenVBAnimationExtension.wrapAsMovieClip(dispayObject).gotoOnPrevFrame();
            return;
        };
        uiHelper.OffScreenVBAnimationExtension.wrapAsMovieClip = function(dispayObject) {
            return uiHelper.UiHelper.getSimpleHelper().wrapAsMovieClip(dispayObject, true);
        };
        uiHelper.OffScreenVBAnimationExtension.prototype.__class__ = uiHelper.OffScreenVBAnimationExtension;
        uiHelper.VBAnimationExtension = function() {};
        uiHelper.VBAnimationExtension.__name__ = ["uiHelper", "VBAnimationExtension"];
        uiHelper.VBAnimationExtension.gotoAndStopOnLabel = function(dispayObject, label) {
            uiHelper.VBAnimationExtension.wrapAsMovieClip(dispayObject).gotoAndStopOnLabel(label);
        };
        uiHelper.VBAnimationExtension.gotoAndPlayOnLabel = function(dispayObject, label) {
            uiHelper.VBAnimationExtension.wrapAsMovieClip(dispayObject).gotoAndPlayOnLabel(label);
        };
        uiHelper.VBAnimationExtension.gotoAndStopOnFrame = function(dispayObject, frame) {
            uiHelper.VBAnimationExtension.wrapAsMovieClip(dispayObject).gotoAndStopOnFrame(frame);
        };
        uiHelper.VBAnimationExtension.gotoAndPlayOnFrame = function(dispayObject, frame) {
            uiHelper.VBAnimationExtension.wrapAsMovieClip(dispayObject).gotoAndPlayOnFrame(frame);
        };
        uiHelper.VBAnimationExtension.getFramesAmount = function(dispayObject) {
            return uiHelper.VBAnimationExtension.wrapAsMovieClip(dispayObject).getFramesAmount();
        };
        uiHelper.VBAnimationExtension.getFrameCount = function(dispayObject) {
            return uiHelper.VBAnimationExtension.wrapAsMovieClip(dispayObject).frameCount + 1;
        };
        uiHelper.VBAnimationExtension.gotoOnNextFrame = function(dispayObject) {
            uiHelper.VBAnimationExtension.wrapAsMovieClip(dispayObject).gotoOnNextFrame();
            return;
        };
        uiHelper.VBAnimationExtension.gotoOnPrevFrame = function(dispayObject) {
            uiHelper.VBAnimationExtension.wrapAsMovieClip(dispayObject).gotoOnPrevFrame();
            return;
        };
        uiHelper.VBAnimationExtension.wrapAsMovieClip = function(dispayObject) {
            return uiHelper.UiHelper.getSimpleHelper().wrapAsMovieClip(dispayObject);
        };
        uiHelper.VBAnimationExtension.prototype.__class__ = uiHelper.VBAnimationExtension;
        uiHelper.ViewBuilderContainerExtension = function() {};
        uiHelper.ViewBuilderContainerExtension.__name__ = ["uiHelper", "ViewBuilderContainerExtension"];
        uiHelper.ViewBuilderContainerExtension.getCacheAsBitmap = function(vbContainer) {
            return vbContainer.getDisplayObject().getCacheAsBitmap();
        };
        uiHelper.ViewBuilderContainerExtension.cacheAsBitmap = function(vbContainer, value) {
            if (value == null) value = true;
            var iOS = eval("/iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream");
            if (iOS) return;
            uiHelper.ViewBuilderContainerExtension.setCacheAsBitmap(vbContainer, value);
        };
        uiHelper.ViewBuilderContainerExtension.setCacheAsBitmap = function(vbContainer, value) {
            if (value == null) value = true;
            vbContainer.getDisplayObject().setCacheAsBitmap(value);
            return;
        };
        uiHelper.ViewBuilderContainerExtension.updateCacheAsBitmap = function(vbContainer) {
            uiHelper.DisplayObjectExtension.updateCacheAsBitmap(vbContainer.getDisplayObject());
        };
        uiHelper.ViewBuilderContainerExtension.prototype.__class__ = uiHelper.ViewBuilderContainerExtension;

        uiHelper.IAnimationPool = function() {}
        uiHelper.IAnimationPool.prototype = {

            backAnimationToPool: function(symbolName, animation) {
                return {
                    arguments: ["string", "*"],
                    returns: "void"
                };
            },
            getAnimationFromPool: function(symbolName) {
                return {
                    arguments: ["string"],
                    returns: "*"
                };
            }
        };
        uiHelper.AnimationPool = function(autogenAnimationPool) {
            this.autogenAnimationPool = autogenAnimationPool;
        };
        uiHelper.AnimationPool = ck_implements(uiHelper.AnimationPool, uiHelper.IAnimationPool);
        uiHelper.AnimationPool.__interfaces__ = [uiHelper.IAnimationPool];
        uiHelper.AnimationPool.__name__ = ["uiHelper", "AnimationPool"];
        uiHelper.AnimationPool.prototype.autogenAnimationPool = null;
        uiHelper.AnimationPool.prototype.backAnimationToPool = function(symbolName, animation) {
            this.stopAnimation(animation);
            this.autogenAnimationPool.backToPool(symbolName, animation);
        };
        uiHelper.AnimationPool.prototype.getAnimationFromPool = function(symbolName) {
            var animation = this.autogenAnimationPool.getFromPool(symbolName);
            animation.show();
            return animation;
        };
        uiHelper.AnimationPool.prototype.stopAnimation = function(animation) {
            animation.stop();
            animation.hide();
            var displayObject = animation.getDisplayObject();
            var parent = displayObject.getParent();
            if (parent != null) parent.removeChild(displayObject);
        };
        uiHelper.AnimationPool.prototype.__class__ = uiHelper.AnimationPool;
        uiHelper.AutogenAnimationPool = function(vBAnimationComponentProvider, pool) {
            if (pool == null) pool = new commonTools.Pool();
            this.vBAnimationComponentProvider = vBAnimationComponentProvider;
            this.pool = pool;
        };
        uiHelper.AutogenAnimationPool = ck_implements(uiHelper.AutogenAnimationPool, commonTools.IPool);
        uiHelper.AutogenAnimationPool.__interfaces__ = [commonTools.IPool];
        uiHelper.AutogenAnimationPool.__name__ = ["uiHelper", "AutogenAnimationPool"];
        uiHelper.AutogenAnimationPool.prototype.vBAnimationComponentProvider = null;
        uiHelper.AutogenAnimationPool.prototype.pool = null;
        uiHelper.AutogenAnimationPool.prototype.addToPool = function(poolKey, poolElement) {
            this.backToPool(poolKey, poolElement);
        };
        uiHelper.AutogenAnimationPool.prototype.backToPool = function(symbolName, animation) {
            this.pool.backToPool(symbolName, animation);
        };
        uiHelper.AutogenAnimationPool.prototype.getFromPool = function(symbolName) {
            var result = this.pool.getFromPool(symbolName);
            if (result == null) {
                this.createNewPoolElement(symbolName);
                result = this.pool.getFromPool(symbolName);
            }
            return result;
        };
        uiHelper.AutogenAnimationPool.prototype.createNewPoolElement = function(symbolName) {
            var element = this.vBAnimationComponentProvider.provide(symbolName);
            element.getDisplayObject().setName(symbolName);
            this.pool.addToPool(symbolName, element);
        };
        uiHelper.AutogenAnimationPool.prototype.__class__ = uiHelper.AutogenAnimationPool;
        uiHelper.VBAnimationComponentProvider = function(viewBuilderContainerProvider, vBAnimationById) {
            if (vBAnimationById == null) vBAnimationById = "ANIMATION_CONTENT";
            this.viewBuilderContainerProvider = viewBuilderContainerProvider;
            this.vBAnimationById = vBAnimationById;
        };
        uiHelper.VBAnimationComponentProvider = ck_implements(uiHelper.VBAnimationComponentProvider, commonTools.Provider);
        uiHelper.VBAnimationComponentProvider.__interfaces__ = [commonTools.Provider];
        uiHelper.VBAnimationComponentProvider.__name__ = ["uiHelper", "VBAnimationComponentProvider"];
        uiHelper.VBAnimationComponentProvider.prototype.viewBuilderContainerProvider = null;
        uiHelper.VBAnimationComponentProvider.prototype.vBAnimationById = null;
        uiHelper.VBAnimationComponentProvider.prototype.provide = function(key) {
            return this.viewBuilderContainerProvider.provide(key).getVBAnimationById(this.vBAnimationById);
        };
        uiHelper.VBAnimationComponentProvider.prototype.__class__ = uiHelper.VBAnimationComponentProvider;
        uiHelper.VbAnimationProvider = function(viewBuilderFactory, assets) {
            this.contentName = "ANIMATION_CONTENT";
            this.holderName = "ANIMATION_HOLDER";
            this.viewBuilderFactory = viewBuilderFactory;
            this.assets = assets;
        };
        uiHelper.VbAnimationProvider = ck_implements(uiHelper.VbAnimationProvider, commonTools.Provider);
        uiHelper.VbAnimationProvider.__interfaces__ = [commonTools.Provider];
        uiHelper.VbAnimationProvider.__name__ = ["uiHelper", "VbAnimationProvider"];
        uiHelper.VbAnimationProvider.prototype.viewBuilderFactory = null;
        uiHelper.VbAnimationProvider.prototype.assets = null;
        uiHelper.VbAnimationProvider.prototype.holderName = null;
        uiHelper.VbAnimationProvider.prototype.contentName = null;
        uiHelper.VbAnimationProvider.prototype.withHolderName = function(holderName) {
            this.holderName = holderName;
            return this;
        };
        uiHelper.VbAnimationProvider.prototype.withContentName = function(contentName) {
            this.contentName = contentName;
            return this;
        };
        uiHelper.VbAnimationProvider.prototype.provide = function(t) {
            var vba = this.assets.get(t);
            return this.viewBuilderFactory.createView(vba).createContainerFromStoredConfig(this.holderName).getVBAnimationById(this.contentName);
        };
        uiHelper.VbAnimationProvider.prototype.__class__ = uiHelper.VbAnimationProvider;
        uiHelper.ViewBuilderContainerProvider = function(viewBuilderFactory, loadedAssets, cache) {
            this.holderName = "ANIMATION_HOLDER";
            this.viewBuilderFactory = viewBuilderFactory;
            this.loadedAssets = loadedAssets;
            if (cache == null) cache = new _hcmn_.haxe_ds_StringMap();
            this.cache = cache;
        };
        uiHelper.ViewBuilderContainerProvider = ck_implements(uiHelper.ViewBuilderContainerProvider, commonTools.Provider);
        uiHelper.ViewBuilderContainerProvider.__interfaces__ = [commonTools.Provider];
        uiHelper.ViewBuilderContainerProvider.__name__ = ["uiHelper", "ViewBuilderContainerProvider"];
        uiHelper.ViewBuilderContainerProvider.prototype.viewBuilderFactory = null;
        uiHelper.ViewBuilderContainerProvider.prototype.loadedAssets = null;
        uiHelper.ViewBuilderContainerProvider.prototype.cache = null;
        uiHelper.ViewBuilderContainerProvider.prototype.holderName = null;
        uiHelper.ViewBuilderContainerProvider.prototype.withHolderName = function(holderName) {
            this.holderName = holderName;
            return this;
        };
        uiHelper.ViewBuilderContainerProvider.prototype.provide = function(symbolName) {
            var getViewBuilderContainer = this.getViewBuilderContainerProvider(symbolName);
            var result = null;
            var $it0 = this.loadedAssets.iterator();
            while ($it0.hasNext()) {
                var asset = $it0.next();
                result = getViewBuilderContainer(asset);
                if (result != null) return result;
            }
            return result;
        };
        uiHelper.ViewBuilderContainerProvider.prototype.getViewBuilderContainerProvider = function(symbolName) {
            var _g = this;
            return function(vbAsset) {
                var vbAssetsConfiguration = vbAsset.getConfiguration();
                if (vbAssetsConfiguration != null) {
                    if (symbolName == vbAssetsConfiguration.id) return _g.createView(vbAsset).createContainerFromStoredConfig(_g.holderName);
                    if (_g.hasSymbolInComponents(symbolName, vbAssetsConfiguration.components)) return _g.createView(vbAsset).createContainerFromStoredConfig(symbolName);
                }
                return null;
            };
        };
        uiHelper.ViewBuilderContainerProvider.prototype.hasSymbolInComponents = function(symbolName, components) {
            return components.filter(function(component) {
                return component.id == symbolName;
            }).length > 0;
        };
        uiHelper.ViewBuilderContainerProvider.prototype.createView = function(vba) {
            var vbAssetsConfiguration = vba.getConfiguration();
            var assetName = vbAssetsConfiguration.id;
            if (!this.cache.exists(assetName)) {
                var value = this.viewBuilderFactory.createView(vba);
                this.cache.set(assetName, value);
            }
            return this.cache.get(assetName);
        };
        uiHelper.ViewBuilderContainerProvider.prototype.__class__ = uiHelper.ViewBuilderContainerProvider;

        uiHelper.IUiGroup = function() {}
        uiHelper.IUiGroup.prototype = {

            addElementProvider: function(elementProvider) {
                return {
                    arguments: ["*"],
                    returns: "*"
                };
            },
            cacheAll: function() {
                return {
                    arguments: [],
                    returns: "*"
                };
            },
            unCacheAll: function() {
                return {
                    arguments: [],
                    returns: "*"
                };
            },
            showAll: function() {
                return {
                    arguments: [],
                    returns: "*"
                };
            },
            hideAll: function() {
                return {
                    arguments: [],
                    returns: "*"
                };
            },
            eachAll: function(callbackF) {
                return {
                    arguments: ["*"],
                    returns: "*"
                };
            }
        };
        uiHelper.UiGroup = function() {
            this.listOfElementProvider = [];
        };
        uiHelper.UiGroup = ck_implements(uiHelper.UiGroup, uiHelper.IUiGroup);
        uiHelper.UiGroup.__interfaces__ = [uiHelper.IUiGroup];
        uiHelper.UiGroup.__name__ = ["uiHelper", "UiGroup"];
        uiHelper.UiGroup.prototype.listOfElementProvider = null;
        uiHelper.UiGroup.prototype.addElementProvider = function(elementProvider) {
            this.listOfElementProvider.push(elementProvider);
            return this;
        };
        uiHelper.UiGroup.prototype.cacheAll = function() {
            return this.eachAll(function(element) {
                element.setCacheAsBitmap(true);
            });
        };
        uiHelper.UiGroup.prototype.unCacheAll = function() {
            return this.eachAll(function(element) {
                element.setCacheAsBitmap(false);
            });
        };
        uiHelper.UiGroup.prototype.showAll = function() {
            return this.eachAll(function(element) {
                element.setVisible(true);
            });
        };
        uiHelper.UiGroup.prototype.hideAll = function() {
            return this.eachAll(function(element) {
                element.setVisible(false);
            });
        };
        uiHelper.UiGroup.prototype.eachAll = function(callbackF) {
            var _g = 0;
            var _g1 = this.listOfElementProvider;
            while (_g < _g1.length) {
                var elementProvider = _g1[_g];
                ++_g;
                var element = elementProvider();
                if (element != null) callbackF(element);
            }
            return this;
        };
        uiHelper.UiGroup.prototype.__class__ = uiHelper.UiGroup;
        uiHelper.BlendMode.values = [];;
        uiHelper.BlendMode.ADD = new uiHelper.BlendMode(1);;
        uiHelper.BlendMode.ADD_NPM = new uiHelper.BlendMode(18);;
        uiHelper.BlendMode.COLOR = new uiHelper.BlendMode(15);;
        uiHelper.BlendMode.COLOR_BURN = new uiHelper.BlendMode(8);;
        uiHelper.BlendMode.COLOR_DODGE = new uiHelper.BlendMode(7);;
        uiHelper.BlendMode.DARKEN = new uiHelper.BlendMode(5);;
        uiHelper.BlendMode.DIFFERENCE = new uiHelper.BlendMode(11);;
        uiHelper.BlendMode.EXCLUSION = new uiHelper.BlendMode(12);;
        uiHelper.BlendMode.HARD_LIGHT = new uiHelper.BlendMode(9);;
        uiHelper.BlendMode.HUE = new uiHelper.BlendMode(13);;
        uiHelper.BlendMode.LIGHTEN = new uiHelper.BlendMode(6);;
        uiHelper.BlendMode.LUMINOSITY = new uiHelper.BlendMode(16);;
        uiHelper.BlendMode.MULTIPLY = new uiHelper.BlendMode(2);;
        uiHelper.BlendMode.NORMAL = new uiHelper.BlendMode(0);;
        uiHelper.BlendMode.NORMAL_NPM = new uiHelper.BlendMode(17);;
        uiHelper.BlendMode.OVERLAY = new uiHelper.BlendMode(4);;
        uiHelper.BlendMode.SATURATION = new uiHelper.BlendMode(14);;
        uiHelper.BlendMode.SCREEN = new uiHelper.BlendMode(3);;
        uiHelper.BlendMode.SCREEN_NPM = new uiHelper.BlendMode(19);;
        uiHelper.BlendMode.SOFT_LIGHT = new uiHelper.BlendMode(10);;
        uiHelper.CacheHelper.GLOBAL_CACHED_ITEMS = new _hcmn_.List();;
        return {
            exports: uiHelper
        };
    });