var egret;
(function (c) {
    var d = function () {
        function b() {
            this._hashCode = b.hashCount++
        }
        Object.defineProperty(b.prototype, "hashCode", {
            get: function () {
                return this._hashCode
            }, enumerable: !0,
            configurable: !0
        });
        b.hashCount = 1;
        return b
    }();
    c.HashObject = d;
    d.prototype.__class__ = "egret.HashObject"
})(egret || (egret = {}));
var __extends = this.__extends || function (c, d) {
    function b() {
        this.constructor = c
    }
    for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
    b.prototype = d.prototype;
    c.prototype = new b
};
(function (c) {
    var d = function (b) {
        function a(e) {
            void 0 === e && (e = 300);
            b.call(this);
            this.objectPool = [];
            this._length = 0;
            1 > e && (e = 1);
            this.autoDisposeTime = e;
            this.frameCount = 0
        }
        __extends(a, b);
        a.prototype._checkFrame = function () {
            this.frameCount--;
            0 >= this.frameCount && this.dispose()
        };
        Object.defineProperty(a.prototype, "length", {
            get: function () {
                return this._length
            }, enumerable: !0,
            configurable: !0
        });
        a.prototype.push = function (e) {
            var l = this.objectPool; - 1 == l.indexOf(e) && (l.push(e), this._length++, 0 == this.frameCount && (this.frameCount =
                this.autoDisposeTime, a._callBackList.push(this)))
        };
        a.prototype.pop = function () {
            if (0 == this._length) return null;
            this._length--;
            return this.objectPool.pop()
        };
        a.prototype.dispose = function () {
            0 < this._length && (this.objectPool = [], this._length = 0);
            this.frameCount = 0;
            var e = a._callBackList,
                l = e.indexOf(this); - 1 != l && e.splice(l, 1)
        };
        a._callBackList = [];
        return a
    }(c.HashObject);
    c.Recycler = d;
    d.prototype.__class__ = "egret.Recycler"
})(egret || (egret = {}));
(function (c) {
    c.__START_TIME;
    c.getTimer = function () {
        return Date.now() - c.__START_TIME
    }
})(egret || (egret = {}));
(function (c) {
    c.__callLaterFunctionList = [];
    c.__callLaterThisList = [];
    c.__callLaterArgsList = [];
    c.callLater = function (d, b) {
        for (var a = [], e = 2; e < arguments.length; e++) a[e - 2] = arguments[e];
        c.__callLaterFunctionList.push(d);
        c.__callLaterThisList.push(b);
        c.__callLaterArgsList.push(a)
    };
    c.__callAsyncFunctionList = [];
    c.__callAsyncThisList = [];
    c.__callAsyncArgsList = [];
    c.__callAsync = function (d, b) {
        for (var a = [], e = 2; e < arguments.length; e++) a[e - 2] = arguments[e];
        c.__callAsyncFunctionList.push(d);
        c.__callAsyncThisList.push(b);
        c.__callAsyncArgsList.push(a)
    }
})(egret || (egret = {}));
var egret_dom;
(function (c) {
    function d() {
        for (var b = document.createElement("div").style, a = ["t", "webkitT", "msT", "MozT", "OT"], e = 0; e < a.length; e++)
            if (a[e] + "ransform" in b) return a[e];
        return a[0]
    }
    c.header = "";
    c.getHeader = d;
    c.getTrans = function (b) {
        "" == c.header && (c.header = d());
        return c.header + b.substring(1, b.length)
    }
})(egret_dom || (egret_dom = {}));
__extends = this.__extends || function (c, d) {
    function b() {
        this.constructor = c
    }
    for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
    b.prototype = d.prototype;
    c.prototype = new b
};
(function (c) {
    var d = function (b) {
        function a(e, a, q) {
            void 0 === a && (a = !1);
            void 0 === q && (q = !1);
            b.call(this);
            this._eventPhase = 2;
            this._isPropagationImmediateStopped = this._isPropagationStopped = this._isDefaultPrevented = !1;
            this.isNew = !0;
            this._type = e;
            this._bubbles = a;
            this._cancelable = q
        }
        __extends(a, b);
        Object.defineProperty(a.prototype, "type", {
            get: function () {
                return this._type
            }, enumerable: !0,
            configurable: !0
        });
        Object.defineProperty(a.prototype, "bubbles", {
            get: function () {
                return this._bubbles
            }, enumerable: !0,
            configurable: !0
        });
        Object.defineProperty(a.prototype, "cancelable", {
            get: function () {
                return this._cancelable
            }, enumerable: !0,
            configurable: !0
        });
        Object.defineProperty(a.prototype, "eventPhase", {
            get: function () {
                return this._eventPhase
            }, enumerable: !0,
            configurable: !0
        });
        Object.defineProperty(a.prototype, "currentTarget", {
            get: function () {
                return this._currentTarget
            }, enumerable: !0,
            configurable: !0
        });
        Object.defineProperty(a.prototype, "target", {
            get: function () {
                return this._target
            }, enumerable: !0,
            configurable: !0
        });
        a.prototype.isDefaultPrevented =
            function () {
                return this._isDefaultPrevented
            };
        a.prototype.preventDefault = function () {
            this._cancelable && (this._isDefaultPrevented = !0)
        };
        a.prototype.stopPropagation = function () {
            this._bubbles && (this._isPropagationStopped = !0)
        };
        a.prototype.stopImmediatePropagation = function () {
            this._bubbles && (this._isPropagationImmediateStopped = !0)
        };
        a.prototype._reset = function () {
            this.isNew ? this.isNew = !1 : (this._isPropagationImmediateStopped = this._isPropagationStopped = this._isDefaultPrevented = !1, this._currentTarget = this._target =
                null, this._eventPhase = 2)
        };
        a._dispatchByTarget = function (e, a, b, d, g, f) {
            void 0 === g && (g = !1);
            void 0 === f && (f = !1);
            var k = e.eventRecycler;
            k || (k = e.eventRecycler = new c.Recycler);
            var m = k.pop();
            m ? m._type = b : m = new e(b);
            m._bubbles = g;
            m._cancelable = f;
            if (d)
                for (var n in d) m[n] = d[n], null !== m[n] && (d[n] = null);
            e = a.dispatchEvent(m);
            k.push(m);
            return e
        };
        a._getPropertyData = function (e) {
            var a = e._props;
            a || (a = e._props = {});
            return a
        };
        a.dispatchEvent = function (e, l, b, c) {
            void 0 === b && (b = !1);
            var d = a._getPropertyData(a);
            c && (d.data = c);
            a._dispatchByTarget(a,
                e, l, d, b)
        };
        a.ADDED_TO_STAGE = "addedToStage";
        a.REMOVED_FROM_STAGE = "removedFromStage";
        a.ADDED = "added";
        a.REMOVED = "removed";
        a.COMPLETE = "complete";
        a.ENTER_FRAME = "enterFrame";
        a.RENDER = "render";
        a.FINISH_RENDER = "finishRender";
        a.FINISH_UPDATE_TRANSFORM = "finishUpdateTransform";
        a.LEAVE_STAGE = "leaveStage";
        a.RESIZE = "resize";
        a.CHANGE = "change";
        a.ACTIVATE = "activate";
        a.DEACTIVATE = "deactivate";
        a.CLOSE = "close";
        a.CONNECT = "connect";
        return a
    }(c.HashObject);
    c.Event = d;
    d.prototype.__class__ = "egret.Event"
})(egret || (egret = {}));
__extends = this.__extends || function (c, d) {
    function b() {
        this.constructor = c
    }
    for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
    b.prototype = d.prototype;
    c.prototype = new b
};
(function (c) {
    var d = function (b) {
        function a(e, a, q) {
            void 0 === a && (a = !1);
            void 0 === q && (q = !1);
            b.call(this, e, a, q);
            this._status = 0
        }
        __extends(a, b);
        Object.defineProperty(a.prototype, "status", {
            get: function () {
                return this._status
            }, enumerable: !0,
            configurable: !0
        });
        a.dispatchHTTPStatusEvent = function (e, l) {
            null == a.httpStatusEvent && (a.httpStatusEvent = new a(a.HTTP_STATUS));
            a.httpStatusEvent._status = l;
            e.dispatchEvent(a.httpStatusEvent)
        };
        a.HTTP_STATUS = "httpStatus";
        a.httpStatusEvent = null;
        return a
    }(c.Event);
    c.HTTPStatusEvent =
        d;
    d.prototype.__class__ = "egret.HTTPStatusEvent"
})(egret || (egret = {}));
__extends = this.__extends || function (c, d) {
    function b() {
        this.constructor = c
    }
    for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
    b.prototype = d.prototype;
    c.prototype = new b
};
(function (c) {
    var d = function (b) {
        function a(e, a, q) {
            void 0 === a && (a = !1);
            void 0 === q && (q = !1);
            b.call(this, e, a, q)
        }
        __extends(a, b);
        a.dispatchIOErrorEvent = function (e) {
            c.Event._dispatchByTarget(a, e, a.IO_ERROR)
        };
        a.IO_ERROR = "ioError";
        return a
    }(c.Event);
    c.IOErrorEvent = d;
    d.prototype.__class__ = "egret.IOErrorEvent"
})(egret || (egret = {}));
__extends = this.__extends || function (c, d) {
    function b() {
        this.constructor = c
    }
    for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
    b.prototype = d.prototype;
    c.prototype = new b
};
(function (c) {
    var d = function (b) {
        function a(e, a, q, c, d, f, k, m, n, p) {
            void 0 === a && (a = !0);
            void 0 === q && (q = !0);
            void 0 === c && (c = 0);
            void 0 === d && (d = 0);
            void 0 === f && (f = 0);
            void 0 === k && (k = !1);
            void 0 === m && (m = !1);
            void 0 === p && (p = !1);
            b.call(this, e, a, q);
            this._stageY = this._stageX = 0;
            this.touchPointID = c;
            this._stageX = d;
            this._stageY = f;
            this.ctrlKey = k;
            this.altKey = m;
            this.touchDown = p
        }
        __extends(a, b);
        Object.defineProperty(a.prototype, "stageX", {
            get: function () {
                return this._stageX
            }, enumerable: !0,
            configurable: !0
        });
        Object.defineProperty(a.prototype,
            "stageY", {
                get: function () {
                    return this._stageY
                }, enumerable: !0,
                configurable: !0
            });
        Object.defineProperty(a.prototype, "localX", {
            get: function () {
                return this._currentTarget.globalToLocal(this._stageX, this._stageY, c.Point.identity).x
            }, enumerable: !0,
            configurable: !0
        });
        Object.defineProperty(a.prototype, "localY", {
            get: function () {
                return this._currentTarget.globalToLocal(this._stageX, this._stageY, c.Point.identity).y
            }, enumerable: !0,
            configurable: !0
        });
        a.dispatchTouchEvent = function (e, l, b, d, g, f, k, m, n) {
            void 0 === b && (b = 0);
            void 0 === d && (d = 0);
            void 0 === g && (g = 0);
            void 0 === f && (f = !1);
            void 0 === k && (k = !1);
            void 0 === m && (m = !1);
            void 0 === n && (n = !1);
            var p = c.Event._getPropertyData(a);
            p.touchPointID = b;
            p._stageX = d;
            p._stageY = g;
            p.ctrlKey = f;
            p.altKey = k;
            p.shiftKey = m;
            p.touchDown = n;
            c.Event._dispatchByTarget(a, e, l, p, !0, !0)
        };
        a.TOUCH_TAP = "touchTap";
        a.TOUCH_MOVE = "touchMove";
        a.TOUCH_BEGIN = "touchBegin";
        a.TOUCH_END = "touchEnd";
        a.TOUCH_RELEASE_OUTSIDE = "touchReleaseOutside";
        a.TOUCH_ROLL_OUT = "touchRollOut";
        a.TOUCH_ROLL_OVER = "touchRollOver";
        a.TOUCH_OUT =
            "touchOut";
        a.TOUCH_OVER = "touchOver";
        return a
    }(c.Event);
    c.TouchEvent = d;
    d.prototype.__class__ = "egret.TouchEvent"
})(egret || (egret = {}));
__extends = this.__extends || function (c, d) {
    function b() {
        this.constructor = c
    }
    for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
    b.prototype = d.prototype;
    c.prototype = new b
};
(function (c) {
    var d = function (b) {
        function a(e, a, c) {
            void 0 === a && (a = !1);
            void 0 === c && (c = !1);
            b.call(this, e, a, c)
        }
        __extends(a, b);
        a.dispatchTimerEvent = function (e, l) {
            c.Event._dispatchByTarget(a, e, l)
        };
        a.TIMER = "timer";
        a.TIMER_COMPLETE = "timerComplete";
        return a
    }(c.Event);
    c.TimerEvent = d;
    d.prototype.__class__ = "egret.TimerEvent"
})(egret || (egret = {}));
__extends = this.__extends || function (c, d) {
    function b() {
        this.constructor = c
    }
    for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
    b.prototype = d.prototype;
    c.prototype = new b
};
(function (c) {
    var d = function (b) {
        function a(e, a, c, d, g) {
            void 0 === a && (a = !1);
            void 0 === c && (c = !1);
            void 0 === d && (d = 0);
            void 0 === g && (g = 0);
            b.call(this, e, a, c);
            this.bytesLoaded = d;
            this.bytesTotal = g
        }
        __extends(a, b);
        a.dispatchProgressEvent = function (e, l, b, d) {
            void 0 === b && (b = 0);
            void 0 === d && (d = 0);
            c.Event._dispatchByTarget(a, e, l, {
                bytesLoaded: b,
                bytesTotal: d
            })
        };
        a.PROGRESS = "progress";
        a.SOCKET_DATA = "socketData";
        return a
    }(c.Event);
    c.ProgressEvent = d;
    d.prototype.__class__ = "egret.ProgressEvent"
})(egret || (egret = {}));
(function (c) {
    var d = function () {
        function b() {}
        b.CAPTURING_PHASE = 1;
        b.AT_TARGET = 2;
        b.BUBBLING_PHASE = 3;
        return b
    }();
    c.EventPhase = d;
    d.prototype.__class__ = "egret.EventPhase"
})(egret || (egret = {}));
__extends = this.__extends || function (c, d) {
    function b() {
        this.constructor = c
    }
    for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
    b.prototype = d.prototype;
    c.prototype = new b
};
(function (c) {
    var d = function (b) {
        function a(e) {
            void 0 === e && (e = null);
            b.call(this);
            this._eventTarget = e ? e : this
        }
        __extends(a, b);
        a.prototype.addEventListener = function (e, a, b, d, g) {
            void 0 === d && (d = !1);
            void 0 === g && (g = 0);
            "undefined" === typeof d && (d = !1);
            "undefined" === typeof g && (g = 0);
            a || c.Logger.fatal("addEventListener\u4fa6\u542c\u51fd\u6570\u4e0d\u80fd\u4e3a\u7a7a");
            d ? (this._captureEventsMap || (this._captureEventsMap = {}), d = this._captureEventsMap) : (this._eventsMap || (this._eventsMap = {}), d = this._eventsMap);
            var f = d[e];
            f || (f = d[e] = []);
            this._insertEventBin(f, a, b, g)
        };
        a.prototype._insertEventBin = function (e, a, b, c, d) {
            void 0 === d && (d = void 0);
            for (var f = -1, k = e.length, m = 0; m < k; m++) {
                var n = e[m];
                if (n.listener === a && n.thisObject === b && n.display === d) return !1; - 1 == f && n.priority < c && (f = m)
            }
            a = {
                listener: a,
                thisObject: b,
                priority: c
            };
            d && (a.display = d); - 1 != f ? e.splice(f, 0, a) : e.push(a);
            return !0
        };
        a.prototype.removeEventListener = function (e, a, b, c) {
            void 0 === c && (c = !1);
            if (c = c ? this._captureEventsMap : this._eventsMap) {
                var d = c[e];
                d && (this._removeEventBin(d,
                    a, b), 0 == d.length && delete c[e])
            }
        };
        a.prototype._removeEventBin = function (e, a, b, c) {
            void 0 === c && (c = void 0);
            for (var d = e.length, f = 0; f < d; f++) {
                var k = e[f];
                if (k.listener === a && k.thisObject === b && k.display === c) return e.splice(f, 1), !0
            }
            return !1
        };
        a.prototype.hasEventListener = function (e) {
            return this._eventsMap && this._eventsMap[e] || this._captureEventsMap && this._captureEventsMap[e]
        };
        a.prototype.willTrigger = function (e) {
            return this.hasEventListener(e)
        };
        a.prototype.dispatchEvent = function (e) {
            e._reset();
            e._target = this._eventTarget;
            e._currentTarget = this._eventTarget;
            return this._notifyListener(e)
        };
        a.prototype._notifyListener = function (e) {
            var a = 1 == e._eventPhase ? this._captureEventsMap : this._eventsMap;
            if (!a) return !0;
            a = a[e._type];
            if (!a) return !0;
            var b = a.length;
            if (0 == b) return !0;
            for (var a = a.concat(), c = 0; c < b; c++) {
                var d = a[c];
                d.listener.call(d.thisObject, e);
                if (e._isPropagationImmediateStopped) break
            }
            return !e._isDefaultPrevented
        };
        a.prototype.dispatchEventWith = function (e, a, b) {
            void 0 === a && (a = !1);
            c.Event.dispatchEvent(this, e, a, b)
        };
        return a
    }(c.HashObject);
    c.EventDispatcher = d;
    d.prototype.__class__ = "egret.EventDispatcher"
})(egret || (egret = {}));
__extends = this.__extends || function (c, d) {
    function b() {
        this.constructor = c
    }
    for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
    b.prototype = d.prototype;
    c.prototype = new b
};
(function (c) {
    var d = function (b) {
        function a() {
            b.call(this);
            this.reuseEvent = new c.Event("")
        }
        __extends(a, b);
        a.prototype.run = function () {
            c.Ticker.getInstance().run();
            c.Ticker.getInstance().register(this.renderLoop, this, Number.NEGATIVE_INFINITY);
            c.Ticker.getInstance().register(this.broadcastEnterFrame, this, Number.POSITIVE_INFINITY);
            this.touchContext.run()
        };
        a.prototype.renderLoop = function (e) {
            if (0 < c.__callLaterFunctionList.length) {
                var l = c.__callLaterFunctionList;
                c.__callLaterFunctionList = [];
                var b = c.__callLaterThisList;
                c.__callLaterThisList = [];
                var d = c.__callLaterArgsList;
                c.__callLaterArgsList = []
            }
            e = this.stage;
            var g = a.cachedEvent;
            g._type = c.Event.RENDER;
            this.dispatchEvent(g);
            c.Stage._invalidateRenderFlag && (this.broadcastRender(), c.Stage._invalidateRenderFlag = !1);
            l && this.doCallLaterList(l, b, d);
            0 < c.__callAsyncFunctionList.length && this.doCallAsyncList();
            l = this.rendererContext;
            l.onRenderStart();
            l.clearScreen();
            e._updateTransform();
            g._type = c.Event.FINISH_UPDATE_TRANSFORM;
            this.dispatchEvent(g);
            e._draw(l);
            g._type = c.Event.FINISH_RENDER;
            this.dispatchEvent(g);
            l.onRenderFinish()
        };
        a.prototype.broadcastEnterFrame = function (e) {
            e = this.reuseEvent;
            e._type = c.Event.ENTER_FRAME;
            this.dispatchEvent(e);
            for (var a = c.DisplayObject._enterFrameCallBackList.concat(), b = a.length, d = 0; d < b; d++) {
                var g = a[d];
                e._target = g.display;
                e._currentTarget = g.display;
                g.listener.call(g.thisObject, e)
            }
            a = c.Recycler._callBackList;
            for (d = a.length - 1; 0 <= d; d--) a[d]._checkFrame()
        };
        a.prototype.broadcastRender = function () {
            var e = this.reuseEvent;
            e._type = c.Event.RENDER;
            for (var a = c.DisplayObject._renderCallBackList.concat(),
                     b = a.length, d = 0; d < b; d++) {
                var g = a[d],
                    f = g.display;
                e._target = f;
                e._currentTarget = f;
                g.listener.call(g.thisObject, e)
            }
        };
        a.prototype.doCallLaterList = function (e, a, b) {
            for (var c = e.length, d = 0; d < c; d++) {
                var f = e[d];
                null != f && f.apply(a[d], b[d])
            }
        };
        a.prototype.doCallAsyncList = function () {
            var e = c.__callAsyncFunctionList.concat(),
                a = c.__callAsyncThisList.concat(),
                b = c.__callAsyncArgsList.concat();
            c.__callAsyncFunctionList.length = 0;
            c.__callAsyncThisList.length = 0;
            for (var d = c.__callAsyncArgsList.length = 0; d < e.length; d++) {
                var g =
                    e[d];
                null != g && g.apply(a[d], b[d])
            }
        };
        a.DEVICE_PC = "web";
        a.DEVICE_MOBILE = "native";
        a.RUNTIME_HTML5 = "runtime_html5";
        a.RUNTIME_NATIVE = "runtime_native";
        a.cachedEvent = new c.Event("");
        return a
    }(c.EventDispatcher);
    c.MainContext = d;
    d.prototype.__class__ = "egret.MainContext"
})(egret || (egret = {}));
var testDeviceType = function () {
        if (!this.navigator) return !0;
        var c = navigator.userAgent.toLowerCase();
        return -1 != c.indexOf("mobile") || -1 != c.indexOf("android")
    },
    testRuntimeType = function () {
        return this.navigator ? !0 : !1
    };
egret.MainContext.instance = new egret.MainContext;
egret.MainContext.deviceType = testDeviceType() ? egret.MainContext.DEVICE_MOBILE : egret.MainContext.DEVICE_PC;
egret.MainContext.runtimeType = testRuntimeType() ? egret.MainContext.RUNTIME_HTML5 : egret.MainContext.RUNTIME_NATIVE;
delete testDeviceType;
delete testRuntimeType;
(function (c) {
    var d = function () {
        function b() {
            this._tick = this._preDrawCount = this._updateTransformPerformanceCost = this._renderPerformanceCost = this._logicPerformanceCost = this._lastTime = 0;
            this._maxDeltaTime = 500;
            this._totalDeltaTime = 0
        }
        b.getInstance = function () {
            null == b.instance && (b.instance = new b);
            return b.instance
        };
        b.prototype.run = function () {
            c.Ticker.getInstance().register(this.update, this);
            null == this._txt && (this._txt = new c.TextField, this._txt.size = 28, this._txt.multiline = !0, c.MainContext.instance.stage.addChild(this._txt));
            var a = c.MainContext.instance;
            a.addEventListener(c.Event.ENTER_FRAME, this.onEnterFrame, this);
            a.addEventListener(c.Event.RENDER, this.onStartRender, this);
            a.addEventListener(c.Event.FINISH_RENDER, this.onFinishRender, this);
            a.addEventListener(c.Event.FINISH_UPDATE_TRANSFORM, this.onFinishUpdateTransform, this)
        };
        b.prototype.onEnterFrame = function (a) {
            this._lastTime = c.getTimer()
        };
        b.prototype.onStartRender = function (a) {
            a = c.getTimer();
            this._logicPerformanceCost = a - this._lastTime;
            this._lastTime = a
        };
        b.prototype.onFinishUpdateTransform =
            function (a) {
                a = c.getTimer();
                this._updateTransformPerformanceCost = a - this._lastTime;
                this._lastTime = a
            };
        b.prototype.onFinishRender = function (a) {
            a = c.getTimer();
            this._renderPerformanceCost = a - this._lastTime;
            this._lastTime = a
        };
        b.prototype.update = function (a) {
            this._tick++;
            this._totalDeltaTime += a;
            if (this._totalDeltaTime >= this._maxDeltaTime) {
                a = (this._preDrawCount - 1).toString();
                var e = Math.ceil(this._logicPerformanceCost).toString() + "," + Math.ceil(this._updateTransformPerformanceCost).toString() + "," + Math.ceil(this._renderPerformanceCost).toString() +
                    "," + Math.ceil(c.MainContext.instance.rendererContext.renderCost).toString();
                this._txt.text = "draw:" + a + "\ncost:" + e + "\nFPS:" + Math.floor(1E3 * this._tick / this._totalDeltaTime).toString();
                this._tick = this._totalDeltaTime = 0
            }
            this._preDrawCount = 0
        };
        b.prototype.onDrawImage = function () {
            this._preDrawCount++
        };
        return b
    }();
    c.Profiler = d;
    d.prototype.__class__ = "egret.Profiler"
})(egret || (egret = {}));
__extends = this.__extends || function (c, d) {
    function b() {
        this.constructor = c
    }
    for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
    b.prototype = d.prototype;
    c.prototype = new b
};
(function (c) {
    var d = function (b) {
        function a() {
            b.apply(this, arguments);
            this._timeScale = 1;
            this._paused = !1;
            this.callBackList = []
        }
        __extends(a, b);
        a.prototype.run = function () {
            c.__START_TIME = (new Date).getTime();
            c.MainContext.instance.deviceContext.executeMainLoop(this.update, this)
        };
        a.prototype.update = function (e) {
            var a = this.callBackList.concat(),
                b = a.length;
            e *= this._timeScale;
            e *= this._timeScale;
            for (var c = 0; c < b; c++) {
                var d = a[c];
                d.listener.call(d.thisObject, e)
            }
        };
        a.prototype.register = function (e, a, b) {
            void 0 === b &&
            (b = 0);
            this._insertEventBin(this.callBackList, e, a, b)
        };
        a.prototype.unregister = function (e, a) {
            this._removeEventBin(this.callBackList, e, a)
        };
        a.prototype.setTimeout = function (e, a, b) {
            for (var d = [], g = 3; g < arguments.length; g++) d[g - 3] = arguments[g];
            c.Logger.warning("Ticker#setTimeout\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03,\u8bf7\u4f7f\u7528egret.setTimeout");
            c.setTimeout.apply(null, [e, a, b].concat(d))
        };
        a.prototype.setTimeScale = function (e) {
            this._timeScale = e
        };
        a.prototype.getTimeScale = function () {
            return this._timeScale
        };
        a.prototype.pause = function () {
            this._paused = !0
        };
        a.prototype.resume = function () {
            this._paused = !1
        };
        a.getInstance = function () {
            null == a.instance && (a.instance = new a);
            return a.instance
        };
        return a
    }(c.EventDispatcher);
    c.Ticker = d;
    d.prototype.__class__ = "egret.Ticker"
})(egret || (egret = {}));
(function (c) {
    var d = function () {
        function b() {}
        b.LEFT = "left";
        b.RIGHT = "right";
        b.CENTER = "center";
        b.JUSTIFY = "justify";
        b.CONTENT_JUSTIFY = "contentJustify";
        return b
    }();
    c.HorizontalAlign = d;
    d.prototype.__class__ = "egret.HorizontalAlign"
})(egret || (egret = {}));
(function (c) {
    var d = function () {
        function b() {}
        b.TOP = "top";
        b.BOTTOM = "bottom";
        b.MIDDLE = "middle";
        b.JUSTIFY = "justify";
        b.CONTENT_JUSTIFY = "contentJustify";
        return b
    }();
    c.VerticalAlign = d;
    d.prototype.__class__ = "egret.VerticalAlign"
})(egret || (egret = {}));
__extends = this.__extends || function (c, d) {
    function b() {
        this.constructor = c
    }
    for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
    b.prototype = d.prototype;
    c.prototype = new b
};
(function (c) {
    var d = function (b) {
        function a(e, a) {
            void 0 === a && (a = 0);
            b.call(this);
            this._currentCount = 0;
            this.delay = e;
            this.repeatCount = a
        }
        __extends(a, b);
        a.prototype.currentCount = function () {
            return this._currentCount
        };
        Object.defineProperty(a.prototype, "running", {
            get: function () {
                return this._running
            }, enumerable: !0,
            configurable: !0
        });
        a.prototype.reset = function () {
            this.stop();
            this._currentCount = 0
        };
        a.prototype.start = function () {
            this._running || (this.lastTime = c.getTimer(), 0 != this._currentCount && (this._currentCount =
                0), c.Ticker.getInstance().register(this.onEnterFrame, this), this._running = !0)
        };
        a.prototype.stop = function () {
            this._running && (c.Ticker.getInstance().unregister(this.onEnterFrame, this), this._running = !1)
        };
        a.prototype.onEnterFrame = function (e) {
            e = c.getTimer();
            e - this.lastTime > this.delay && (this.lastTime = e, this._currentCount++, c.TimerEvent.dispatchTimerEvent(this, c.TimerEvent.TIMER), 0 < this.repeatCount && this._currentCount >= this.repeatCount && (this.stop(), c.TimerEvent.dispatchTimerEvent(this, c.TimerEvent.TIMER_COMPLETE)))
        };
        return a
    }(c.EventDispatcher);
    c.Timer = d;
    d.prototype.__class__ = "egret.Timer"
})(egret || (egret = {}));
(function (c) {
    function d(b) {
        b = b.prototype ? b.prototype : b.__proto__;
        if (b.hasOwnProperty("__class__")) return b.__class__;
        var a = b.constructor.toString(),
            e = a.indexOf("("),
            a = a.substring(9, e);
        Object.defineProperty(b, "__class__", {
            value: a,
            enumerable: !1,
            writable: !0
        });
        return a
    }
    c.getQualifiedClassName = d;
    c.getQualifiedSuperclassName = function (b) {
        b = b.prototype ? b.prototype : b.__proto__;
        if (b.hasOwnProperty("__superclass__")) return b.__superclass__;
        var a = Object.getPrototypeOf(b);
        if (null == a) return null;
        a = d(a.constructor);
        if (!a) return null;
        Object.defineProperty(b, "__superclass__", {
            value: a,
            enumerable: !1,
            writable: !0
        });
        return a
    }
})(egret || (egret = {}));
(function (c) {
    var d = {};
    c.getDefinitionByName = function (b) {
        if (!b) return null;
        var a = d[b];
        if (a) return a;
        for (var e = b.split("."), l = e.length, a = __global, c = 0; c < l; c++)
            if (a = a[e[c]], !a) return null;
        return d[b] = a
    }
})(egret || (egret = {}));
var __global = __global || this;
(function (c) {
    function d(e) {
        for (var a in b) {
            var c = b[a];
            c.delay -= e;
            0 >= c.delay && (c.listener.apply(c.thisObject, c.params), delete b[a])
        }
    }
    var b = {},
        a = 0;
    c.setTimeout = function (e, l, q) {
        for (var h = [], g = 3; g < arguments.length; g++) h[g - 3] = arguments[g];
        h = {
            listener: e,
            thisObject: l,
            delay: q,
            params: h
        };
        0 == a && c.Ticker.getInstance().register(d, null);
        a++;
        b[a] = h;
        return a
    };
    c.clearTimeout = function (e) {
        delete b[e]
    }
})(egret || (egret = {}));
(function (c) {
    c.hasDefinition = function (d) {
        return c.getDefinitionByName(d) ? !0 : !1
    }
})(egret || (egret = {}));
(function (c) {
    c.toColorString = function (c) {
        if (isNaN(c) || 0 > c) c = 0;
        16777215 < c && (c = 16777215);
        for (c = c.toString(16).toUpperCase(); 6 > c.length;) c = "0" + c;
        return "#" + c
    }
})(egret || (egret = {}));
__extends = this.__extends || function (c, d) {
    function b() {
        this.constructor = c
    }
    for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
    b.prototype = d.prototype;
    c.prototype = new b
};
(function (c) {
    var d = function (b) {
        function a(e, a, c, d, g, f) {
            void 0 === e && (e = 1);
            void 0 === a && (a = 0);
            void 0 === c && (c = 0);
            void 0 === d && (d = 1);
            void 0 === g && (g = 0);
            void 0 === f && (f = 0);
            b.call(this);
            this.a = e;
            this.b = a;
            this.c = c;
            this.d = d;
            this.tx = g;
            this.ty = f
        }
        __extends(a, b);
        a.prototype.prepend = function (e, a, b, c, d, f) {
            var k = this.tx;
            if (1 != e || 0 != a || 0 != b || 1 != c) {
                var m = this.a,
                    n = this.c;
                this.a = m * e + this.b * b;
                this.b = m * a + this.b * c;
                this.c = n * e + this.d * b;
                this.d = n * a + this.d * c
            }
            this.tx = k * e + this.ty * b + d;
            this.ty = k * a + this.ty * c + f;
            return this
        };
        a.prototype.append =
            function (e, a, b, c, d, f) {
                var k = this.a,
                    m = this.b,
                    n = this.c,
                    p = this.d;
                if (1 != e || 0 != a || 0 != b || 1 != c) this.a = e * k + a * n, this.b = e * m + a * p, this.c = b * k + c * n, this.d = b * m + c * p;
                this.tx = d * k + f * n + this.tx;
                this.ty = d * m + f * p + this.ty;
                return this
            };
        a.prototype.prependTransform = function (e, l, b, c, d, f, k, m, n) {
            if (d % 360) {
                var p = d * a.DEG_TO_RAD;
                d = Math.cos(p);
                p = Math.sin(p)
            } else d = 1, p = 0; if (m || n) this.tx -= m, this.ty -= n;
            f || k ? (f *= a.DEG_TO_RAD, k *= a.DEG_TO_RAD, this.prepend(d * b, p * b, -p * c, d * c, 0, 0), this.prepend(Math.cos(k), Math.sin(k), -Math.sin(f), Math.cos(f),
                e, l)) : this.prepend(d * b, p * b, -p * c, d * c, e, l);
            return this
        };
        a.prototype.appendTransform = function (e, l, b, c, d, f, k, m, n) {
            if (d % 360) {
                var p = d * a.DEG_TO_RAD;
                d = Math.cos(p);
                p = Math.sin(p)
            } else d = 1, p = 0;
            f || k ? (f *= a.DEG_TO_RAD, k *= a.DEG_TO_RAD, this.append(Math.cos(k), Math.sin(k), -Math.sin(f), Math.cos(f), e, l), this.append(d * b, p * b, -p * c, d * c, 0, 0)) : this.append(d * b, p * b, -p * c, d * c, e, l);
            if (m || n) this.tx -= m * this.a + n * this.c, this.ty -= m * this.b + n * this.d;
            return this
        };
        a.prototype.rotate = function (e) {
            var a = Math.cos(e);
            e = Math.sin(e);
            var b = this.a,
                c = this.c,
                d = this.tx;
            this.a = b * a - this.b * e;
            this.b = b * e + this.b * a;
            this.c = c * a - this.d * e;
            this.d = c * e + this.d * a;
            this.tx = d * a - this.ty * e;
            this.ty = d * e + this.ty * a;
            return this
        };
        a.prototype.skew = function (e, l) {
            e *= a.DEG_TO_RAD;
            l *= a.DEG_TO_RAD;
            this.append(Math.cos(l), Math.sin(l), -Math.sin(e), Math.cos(e), 0, 0);
            return this
        };
        a.prototype.scale = function (e, a) {
            this.a *= e;
            this.d *= a;
            this.c *= e;
            this.b *= a;
            this.tx *= e;
            this.ty *= a;
            return this
        };
        a.prototype.translate = function (e, a) {
            this.tx += e;
            this.ty += a;
            return this
        };
        a.prototype.identity = function () {
            this.a =
                this.d = 1;
            this.b = this.c = this.tx = this.ty = 0;
            return this
        };
        a.prototype.identityMatrix = function (e) {
            this.a = e.a;
            this.b = e.b;
            this.c = e.c;
            this.d = e.d;
            this.tx = e.tx;
            this.ty = e.ty;
            return this
        };
        a.prototype.invert = function () {
            var e = this.a,
                a = this.b,
                b = this.c,
                c = this.d,
                d = this.tx,
                f = e * c - a * b;
            this.a = c / f;
            this.b = -a / f;
            this.c = -b / f;
            this.d = e / f;
            this.tx = (b * this.ty - c * d) / f;
            this.ty = -(e * this.ty - a * d) / f;
            return this
        };
        a.transformCoords = function (e, a, b) {
            var d = c.Point.identity;
            d.x = e.a * a + e.c * b + e.tx;
            d.y = e.d * b + e.b * a + e.ty;
            return d
        };
        a.prototype.toArray =
            function (e) {
                this.array || (this.array = new Float32Array(9));
                e ? (this.array[0] = this.a, this.array[1] = this.b, this.array[2] = 0, this.array[3] = this.c, this.array[4] = this.d, this.array[5] = 0, this.array[6] = this.tx, this.array[7] = this.ty) : (this.array[0] = this.a, this.array[1] = this.b, this.array[2] = this.tx, this.array[3] = this.c, this.array[4] = this.d, this.array[5] = this.ty, this.array[6] = 0, this.array[7] = 0);
                this.array[8] = 1;
                return this.array
            };
        a.identity = new a;
        a.DEG_TO_RAD = Math.PI / 180;
        return a
    }(c.HashObject);
    c.Matrix = d;
    d.prototype.__class__ =
        "egret.Matrix"
})(egret || (egret = {}));
__extends = this.__extends || function (c, d) {
    function b() {
        this.constructor = c
    }
    for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
    b.prototype = d.prototype;
    c.prototype = new b
};
(function (c) {
    var d = function (b) {
        function a(e, a) {
            void 0 === e && (e = 0);
            void 0 === a && (a = 0);
            b.call(this);
            this.x = e;
            this.y = a
        }
        __extends(a, b);
        a.prototype.clone = function () {
            return new a(this.x, this.y)
        };
        a.prototype.equals = function (e) {
            return this.x == e.x && this.y == e.y
        };
        a.distance = function (e, a) {
            return Math.sqrt((e.x - a.x) * (e.x - a.x) + (e.y - a.y) * (e.y - a.y))
        };
        a.identity = new a(0, 0);
        return a
    }(c.HashObject);
    c.Point = d;
    d.prototype.__class__ = "egret.Point"
})(egret || (egret = {}));
__extends = this.__extends || function (c, d) {
    function b() {
        this.constructor = c
    }
    for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
    b.prototype = d.prototype;
    c.prototype = new b
};
(function (c) {
    var d = function (b) {
        function a(e, a, c, d) {
            void 0 === e && (e = 0);
            void 0 === a && (a = 0);
            void 0 === c && (c = 0);
            void 0 === d && (d = 0);
            b.call(this);
            this.x = e;
            this.y = a;
            this.width = c;
            this.height = d
        }
        __extends(a, b);
        Object.defineProperty(a.prototype, "right", {
            get: function () {
                return this.x + this.width
            }, set: function (e) {
                this.width = e - this.x
            }, enumerable: !0,
            configurable: !0
        });
        Object.defineProperty(a.prototype, "bottom", {
            get: function () {
                return this.y + this.height
            }, set: function (e) {
                this.height = e - this.y
            }, enumerable: !0,
            configurable: !0
        });
        a.prototype.initialize = function (e, a, b, c) {
            this.x = e;
            this.y = a;
            this.width = b;
            this.height = c;
            return this
        };
        a.prototype.contains = function (e, a) {
            return this.x <= e && this.x + this.width >= e && this.y <= a && this.y + this.height >= a
        };
        a.prototype.intersects = function (e) {
            var a = e.right,
                b = e.bottom,
                c = this.right,
                d = this.bottom;
            return this.contains(e.x, e.y) || this.contains(e.x, b) || this.contains(a, e.y) || this.contains(a, b) || e.contains(this.x, this.y) || e.contains(this.x, d) || e.contains(c, this.y) || e.contains(c, d) ? !0 : !1
        };
        a.prototype.clone =
            function () {
                return new a(this.x, this.y, this.width, this.height)
            };
        a.prototype.containsPoint = function (e) {
            return this.x < e.x && this.x + this.width > e.x && this.y < e.y && this.y + this.height > e.y ? !0 : !1
        };
        a.identity = new a(0, 0, 0, 0);
        return a
    }(c.HashObject);
    c.Rectangle = d;
    d.prototype.__class__ = "egret.Rectangle"
})(egret || (egret = {}));
(function (c) {
    var d = function () {
        function b() {}
        b.fatal = function (a, e) {
            void 0 === e && (e = null);
            c.Logger.traceToConsole("Fatal", a, e);
            throw Error(c.Logger.getTraceCode("Fatal", a, e));
        };
        b.info = function (a, e) {
            void 0 === e && (e = null);
            c.Logger.traceToConsole("Info", a, e)
        };
        b.warning = function (a, e) {
            void 0 === e && (e = null);
            c.Logger.traceToConsole("Warning", a, e)
        };
        b.traceToConsole = function (a, e, l) {
            console.log(c.Logger.getTraceCode(a, e, l))
        };
        b.getTraceCode = function (a, e, l) {
            return "[" + a + "]" + e + ":" + (null == l ? "" : l)
        };
        return b
    }();
    c.Logger =
        d;
    d.prototype.__class__ = "egret.Logger"
})(egret || (egret = {}));
__extends = this.__extends || function (c, d) {
    function b() {
        this.constructor = c
    }
    for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
    b.prototype = d.prototype;
    c.prototype = new b
};
(function (c) {
    var d = function (b) {
        function a() {
            b.call(this);
            this._isSupportDOMParser = this._xmlDict = this._parser = null;
            this._xmlDict = {};
            window.DOMParser ? (this._isSupportDOMParser = !0, this._parser = new DOMParser) : this._isSupportDOMParser = !1
        }
        __extends(a, b);
        a.getInstance = function () {
            a._instance || (a._instance = new a);
            return a._instance
        };
        a.prototype.parserXML = function (e) {
            for (var a = 0;
                 "\n" == e.charAt(a) || "\t" == e.charAt(a) || "\r" == e.charAt(a) || " " == e.charAt(a);) a++;
            0 != a && (e = e.substring(a, e.length));
            this._isSupportDOMParser ?
                a = this._parser.parseFromString(e, "text/xml") : (a = new ActiveXObject("Microsoft.XMLDOM"), a.async = "false", a.loadXML(e));
            null == a && c.Logger.info("xml not found!");
            return a
        };
        a._instance = null;
        return a
    }(c.HashObject);
    c.SAXParser = d;
    d.prototype.__class__ = "egret.SAXParser"
})(egret || (egret = {}));
__extends = this.__extends || function (c, d) {
    function b() {
        this.constructor = c
    }
    for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
    b.prototype = d.prototype;
    c.prototype = new b
};
(function (c) {
    var d = function (e) {
        function l() {
            e.call(this);
            this._designHeight = this._designWidth = 0;
            this._scaleY = this._scaleX = 1;
            this._stageHeight = this._stageWidth = this._offSetY = 0
        }
        __extends(l, e);
        l.getInstance = function () {
            null == l.instance && (a.initialize(), l.instance = new l);
            return l.instance
        };
        l.prototype.setDesignSize = function (e, a, l) {
            this._designWidth = e;
            this._designHeight = a;
            l && (c.Logger.warning("\u8be5\u65b9\u6cd5\u76ee\u524d\u4e0d\u5e94\u4f20\u5165 resolutionPolicy \u53c2\u6570\uff0c\u8bf7\u5728 docs/1.0_Final_ReleaseNote\u4e2d\u67e5\u770b\u5982\u4f55\u5347\u7ea7"),
                this._setResolutionPolicy(l))
        };
        l.prototype._setResolutionPolicy = function (e) {
            this._resolutionPolicy = e;
            e.init(this);
            e._apply(this, this._designWidth, this._designHeight)
        };
        l.prototype.getScaleX = function () {
            return this._scaleX
        };
        l.prototype.getScaleY = function () {
            return this._scaleY
        };
        l.prototype.getOffSetY = function () {
            return this._offSetY
        };
        l.canvas_name = "egretCanvas";
        l.canvas_div_name = "gameDiv";
        return l
    }(c.HashObject);
    c.StageDelegate = d;
    d.prototype.__class__ = "egret.StageDelegate";
    var b = function () {
        function e(a,
                   l) {
            this._containerStrategy = a;
            this._contentStrategy = l
        }
        e.prototype.init = function (e) {
            this._containerStrategy.init(e);
            this._contentStrategy.init(e)
        };
        e.prototype._apply = function (e, a, l) {
            this._containerStrategy._apply(e, a, l);
            this._contentStrategy._apply(e, a, l)
        };
        return e
    }();
    c.ResolutionPolicy = b;
    b.prototype.__class__ = "egret.ResolutionPolicy";
    var a = function () {
        function a() {}
        a.initialize = function () {
            a.EQUAL_TO_FRAME = new e
        };
        a.prototype.init = function (e) {};
        a.prototype._apply = function (e, a, l) {};
        a.prototype._setupContainer =
            function () {
                var e = document.body,
                    a;
                e && (a = e.style) && (a.paddingTop = a.paddingTop || "0px", a.paddingRight = a.paddingRight || "0px", a.paddingBottom = a.paddingBottom || "0px", a.paddingLeft = a.paddingLeft || "0px", a.borderTop = a.borderTop || "0px", a.borderRight = a.borderRight || "0px", a.borderBottom = a.borderBottom || "0px", a.borderLeft = a.borderLeft || "0px", a.marginTop = a.marginTop || "0px", a.marginRight = a.marginRight || "0px", a.marginBottom = a.marginBottom || "0px", a.marginLeft = a.marginLeft || "0px")
            };
        return a
    }();
    c.ContainerStrategy = a;
    a.prototype.__class__ = "egret.ContainerStrategy";
    var e = function (e) {
        function a() {
            e.apply(this, arguments)
        }
        __extends(a, e);
        a.prototype._apply = function (e) {
            this._setupContainer()
        };
        return a
    }(a);
    c.EqualToFrame = e;
    e.prototype.__class__ = "egret.EqualToFrame";
    b = function () {
        function e() {}
        e.prototype.init = function (e) {};
        e.prototype._apply = function (e, a, l) {};
        e.prototype.setEgretSize = function (e, a, l, b, q, n) {
            void 0 === n && (n = 0);
            c.StageDelegate.getInstance()._stageWidth = Math.round(e);
            c.StageDelegate.getInstance()._stageHeight =
                Math.round(a);
            e = document.getElementById(d.canvas_div_name);
            e.style.width = l + "px";
            e.style.height = b + "px";
            e.style.top = n + "px"
        };
        e.prototype._getClientWidth = function () {
            return document.documentElement.clientWidth
        };
        e.prototype._getClientHeight = function () {
            return document.documentElement.clientHeight
        };
        return e
    }();
    c.ContentStrategy = b;
    b.prototype.__class__ = "egret.ContentStrategy";
    var l = function (e) {
        function a(l) {
            void 0 === l && (l = 0);
            e.call(this);
            this.minWidth = l
        }
        __extends(a, e);
        a.prototype._apply = function (e, a, l) {
            a =
                this._getClientWidth();
            var b = this._getClientHeight(),
                c = b / l,
                q = a / c,
                d = 1;
            0 != this.minWidth && (d = Math.min(1, q / this.minWidth));
            this.setEgretSize(q / d, l, a, b * d);
            e._scaleX = c * d;
            e._scaleY = c * d
        };
        return a
    }(b);
    c.FixedHeight = l;
    l.prototype.__class__ = "egret.FixedHeight";
    l = function (e) {
        function a(l) {
            void 0 === l && (l = 0);
            e.call(this);
            this.minHeight = l
        }
        __extends(a, e);
        a.prototype._apply = function (e, a, l) {
            l = this._getClientWidth();
            var b = this._getClientHeight(),
                c = l / a,
                q = b / c,
                d = 1;
            0 != this.minHeight && (d = Math.min(1, q / this.minHeight));
            this.setEgretSize(a,
                q / d, l * d, b, l * (1 - d) / 2);
            e._scaleX = c * d;
            e._scaleY = c * d
        };
        return a
    }(b);
    c.FixedWidth = l;
    l.prototype.__class__ = "egret.FixedWidth";
    l = function (e) {
        function a(l, b) {
            e.call(this);
            this.width = l;
            this.height = b
        }
        __extends(a, e);
        a.prototype._apply = function (e, a, l) {
            l = this.width;
            var b = this.height,
                c = l / a;
            this.setEgretSize(a, b / c, l, b);
            e._scaleX = c;
            e._scaleY = c
        };
        return a
    }(b);
    c.FixedSize = l;
    l.prototype.__class__ = "egret.FixedSize";
    l = function (e) {
        function a() {
            e.call(this)
        }
        __extends(a, e);
        a.prototype._apply = function (e, a, l) {
            this.setEgretSize(a,
                l, a, l, Math.floor((a - a) / 2));
            e._scaleX = 1;
            e._scaleY = 1
        };
        return a
    }(b);
    c.NoScale = l;
    l.prototype.__class__ = "egret.NoScale";
    l = function (e) {
        function a() {
            e.call(this)
        }
        __extends(a, e);
        a.prototype._apply = function (e, a, l) {
            var b = this._getClientWidth(),
                c = this._getClientHeight(),
                q = b,
                d = c,
                h = q / a < d / l ? q / a : d / l,
                q = a * h,
                d = l * h,
                b = Math.floor((b - q) / 2);
            e._offSetY = Math.floor((c - d) / 2);
            this.setEgretSize(a, l / 1, 1 * q, d, b, e._offSetY);
            e._scaleX = 1 * h;
            e._scaleY = 1 * h
        };
        return a
    }(b);
    c.ShowAll = l;
    l.prototype.__class__ = "egret.ShowAll";
    b = function (e) {
        function a() {
            e.call(this)
        }
        __extends(a, e);
        a.prototype._apply = function (e, a, l) {
            var b = this._getClientWidth(),
                c = this._getClientHeight(),
                b = b / a,
                c = c / l;
            this.setEgretSize(a, l, a * b, l * c);
            e._scaleX = b;
            e._scaleY = c
        };
        return a
    }(b);
    c.FullScreen = b;
    b.prototype.__class__ = "egret.FullScreen"
})(egret || (egret = {}));
__extends = this.__extends || function (c, d) {
    function b() {
        this.constructor = c
    }
    for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
    b.prototype = d.prototype;
    c.prototype = new b
};
(function (c) {
    var d = function (b) {
        function a() {
            b.call(this);
            this._originalData = {};
            this._drawAreaList = []
        }
        __extends(a, b);
        a.getInstance = function () {
            null == a.instance && (a.instance = new a);
            return a.instance
        };
        a.prototype.addDrawArea = function (e) {
            this._drawAreaList.push(e)
        };
        a.prototype.clearDrawArea = function () {
            this._drawAreaList = []
        };
        a.prototype.drawImage = function (e, a, b, d, g, f, k, m, n, p, r) {
            void 0 === r && (r = void 0);
            k = k || 0;
            m = m || 0;
            var s = a._texture_to_render;
            if (null != s && 0 != f && 0 != g && 0 != n && 0 != p)
                if (0 != this._drawAreaList.length &&
                    c.MainContext.instance.rendererContext._cacheCanvasContext) {
                    var t = c.DisplayObject.getTransformBounds(a._getSize(c.Rectangle.identity), a._worldTransform);
                    a._worldBounds.initialize(t.x, t.y, t.width, t.height);
                    t = this._originalData;
                    t.sourceX = b;
                    t.sourceY = d;
                    t.sourceWidth = g;
                    t.sourceHeight = f;
                    t.destX = k;
                    t.destY = m;
                    t.destWidth = n;
                    t.destHeight = p;
                    for (var u = this.getDrawAreaList(), v = 0; v < u.length; v++)
                        if (!this.ignoreRender(a, u[v], t.destX, t.destY)) {
                            e.drawImage(s, b, d, g, f, k, m, n, p, r);
                            break
                        }
                } else e.drawImage(s, b, d, g, f, k, m,
                    n, p, r)
        };
        a.prototype.ignoreRender = function (e, a, b, c) {
            var d = e._worldBounds;
            b *= e._worldTransform.a;
            c *= e._worldTransform.d;
            return d.x + d.width + b <= a.x || d.x + b >= a.x + a.width || d.y + d.height + c <= a.y || d.y + c >= a.y + a.height ? !0 : !1
        };
        a.prototype.getDrawAreaList = function () {
            var e;
            0 == this._drawAreaList.length ? (this._defaultDrawAreaList || (this._defaultDrawAreaList = [new c.Rectangle(0, 0, c.MainContext.instance.stage.stageWidth, c.MainContext.instance.stage.stageHeight)], c.MainContext.instance.stage.addEventListener(c.Event.RESIZE,
                this.onResize, this)), e = this._defaultDrawAreaList) : e = this._drawAreaList;
            return e
        };
        a.prototype.onResize = function () {
            c.MainContext.instance.stage.removeEventListener(c.Event.RESIZE, this.onResize, this);
            this._defaultDrawAreaList = null
        };
        return a
    }(c.HashObject);
    c.RenderFilter = d;
    d.prototype.__class__ = "egret.RenderFilter"
})(egret || (egret = {}));
(function (c) {
    var d = function () {
        function b() {}
        b.mapClass = function (a, e, l) {
            void 0 === l && (l = "");
            a = this.getKey(a) + "#" + l;
            this.mapClassDic[a] = e
        };
        b.getKey = function (a) {
            return "string" == typeof a ? a : c.getQualifiedClassName(a)
        };
        b.mapValue = function (a, e, l) {
            void 0 === l && (l = "");
            a = this.getKey(a) + "#" + l;
            this.mapValueDic[a] = e
        };
        b.hasMapRule = function (a, e) {
            void 0 === e && (e = "");
            var l = this.getKey(a) + "#" + e;
            return this.mapValueDic[l] || this.mapClassDic[l] ? !0 : !1
        };
        b.getInstance = function (a, e) {
            void 0 === e && (e = "");
            var l = this.getKey(a) + "#" +
                e;
            if (this.mapValueDic[l]) return this.mapValueDic[l];
            var b = this.mapClassDic[l];
            if (b) return b = new b, this.mapValueDic[l] = b, delete this.mapClassDic[l], b;
            throw Error("\u8c03\u7528\u4e86\u672a\u914d\u7f6e\u7684\u6ce8\u5165\u89c4\u5219:" + l + "\u3002 \u8bf7\u5148\u5728\u9879\u76ee\u521d\u59cb\u5316\u91cc\u914d\u7f6e\u6307\u5b9a\u7684\u6ce8\u5165\u89c4\u5219\uff0c\u518d\u8c03\u7528\u5bf9\u5e94\u5355\u4f8b\u3002");
        };
        b.mapClassDic = {};
        b.mapValueDic = {};
        return b
    }();
    c.Injector = d;
    d.prototype.__class__ = "egret.Injector"
})(egret ||
    (egret = {}));
(function (c) {
    var d = function () {
        function b() {}
        b.NORMAL = "normal";
        b.ADD = "add";
        return b
    }();
    c.BlendMode = d;
    d.prototype.__class__ = "egret.BlendMode"
})(egret || (egret = {}));
__extends = this.__extends || function (c, d) {
    function b() {
        this.constructor = c
    }
    for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
    b.prototype = d.prototype;
    c.prototype = new b
};
(function (c) {
    var d = function (b) {
        function a() {
            b.call(this);
            this.__hack_local_matrix = null;
            this._sizeDirty = this._normalDirty = !0;
            this._parent = this._texture_to_render = null;
            this._y = this._x = 0;
            this._scaleY = this._scaleX = 1;
            this._anchorY = this._anchorX = this._anchorOffsetY = this._anchorOffsetX = 0;
            this._visible = !0;
            this._rotation = 0;
            this._alpha = 1;
            this._skewY = this._skewX = 0;
            this._touchEnabled = !1;
            this._scrollRect = this.blendMode = null;
            this._hasHeightSet = this._hasWidthSet = !1;
            this._worldBounds = this.mask = null;
            this.worldAlpha =
                1;
            this._rectH = this._rectW = 0;
            this._stage = null;
            this._cacheDirty = this._cacheAsBitmap = !1;
            this._colorTransform = null;
            this._worldTransform = new c.Matrix;
            this._worldBounds = new c.Rectangle(0, 0, 0, 0);
            this._cacheBounds = new c.Rectangle(0, 0, 0, 0)
        }
        __extends(a, b);
        a.prototype._setDirty = function () {
            this._normalDirty = !0
        };
        a.prototype.getDirty = function () {
            return this._normalDirty || this._sizeDirty
        };
        a.prototype._setParentSizeDirty = function () {
            var e = this._parent;
            !e || e._hasWidthSet || e._hasHeightSet || e._setSizeDirty()
        };
        a.prototype._setSizeDirty =
            function () {
                this._sizeDirty || (this._sizeDirty = !0, this._setDirty(), this._setCacheDirty(), this._setParentSizeDirty())
            };
        a.prototype._clearDirty = function () {
            this._normalDirty = !1
        };
        a.prototype._clearSizeDirty = function () {
            this._sizeDirty = !1
        };
        Object.defineProperty(a.prototype, "parent", {
            get: function () {
                return this._parent
            }, enumerable: !0,
            configurable: !0
        });
        a.prototype._parentChanged = function (e) {
            this._parent = e
        };
        Object.defineProperty(a.prototype, "x", {
            get: function () {
                return this._x
            }, set: function (e) {
                this._setX(e)
            }, enumerable: !0,
            configurable: !0
        });
        a.prototype._setX = function (e) {
            c.NumberUtils.isNumber(e) && this._x != e && (this._x = e, this._setDirty(), this._setParentSizeDirty())
        };
        Object.defineProperty(a.prototype, "y", {
            get: function () {
                return this._y
            }, set: function (e) {
                this._setY(e)
            }, enumerable: !0,
            configurable: !0
        });
        a.prototype._setY = function (e) {
            c.NumberUtils.isNumber(e) && this._y != e && (this._y = e, this._setDirty(), this._setParentSizeDirty())
        };
        Object.defineProperty(a.prototype, "scaleX", {
            get: function () {
                return this._scaleX
            }, set: function (e) {
                c.NumberUtils.isNumber(e) &&
                this._scaleX != e && (this._scaleX = e, this._setDirty(), this._setParentSizeDirty())
            }, enumerable: !0,
            configurable: !0
        });
        Object.defineProperty(a.prototype, "scaleY", {
            get: function () {
                return this._scaleY
            }, set: function (e) {
                c.NumberUtils.isNumber(e) && this._scaleY != e && (this._scaleY = e, this._setDirty(), this._setParentSizeDirty())
            }, enumerable: !0,
            configurable: !0
        });
        Object.defineProperty(a.prototype, "anchorOffsetX", {
            get: function () {
                return this._anchorOffsetX
            }, set: function (e) {
                c.NumberUtils.isNumber(e) && this._anchorOffsetX !=
                e && (this._anchorOffsetX = e, this._setDirty(), this._setParentSizeDirty())
            }, enumerable: !0,
            configurable: !0
        });
        Object.defineProperty(a.prototype, "anchorOffsetY", {
            get: function () {
                return this._anchorOffsetY
            }, set: function (e) {
                c.NumberUtils.isNumber(e) && this._anchorOffsetY != e && (this._anchorOffsetY = e, this._setDirty(), this._setParentSizeDirty())
            }, enumerable: !0,
            configurable: !0
        });
        Object.defineProperty(a.prototype, "anchorX", {
            get: function () {
                return this._anchorX
            }, set: function (e) {
                this._setAnchorX(e)
            }, enumerable: !0,
            configurable: !0
        });
        a.prototype._setAnchorX = function (e) {
            c.NumberUtils.isNumber(e) && this._anchorX != e && (this._anchorX = e, this._setDirty(), this._setParentSizeDirty())
        };
        Object.defineProperty(a.prototype, "anchorY", {
            get: function () {
                return this._anchorY
            }, set: function (e) {
                this._setAnchorY(e)
            }, enumerable: !0,
            configurable: !0
        });
        a.prototype._setAnchorY = function (e) {
            c.NumberUtils.isNumber(e) && this._anchorY != e && (this._anchorY = e, this._setDirty(), this._setParentSizeDirty())
        };
        Object.defineProperty(a.prototype, "visible", {
            get: function () {
                return this._visible
            },
            set: function (e) {
                this._setVisible(e)
            }, enumerable: !0,
            configurable: !0
        });
        a.prototype._setVisible = function (e) {
            this._visible != e && (this._visible = e, this._setSizeDirty())
        };
        Object.defineProperty(a.prototype, "rotation", {
            get: function () {
                return this._rotation
            }, set: function (e) {
                c.NumberUtils.isNumber(e) && this._rotation != e && (this._rotation = e, this._setSizeDirty())
            }, enumerable: !0,
            configurable: !0
        });
        Object.defineProperty(a.prototype, "alpha", {
            get: function () {
                return this._alpha
            }, set: function (e) {
                c.NumberUtils.isNumber(e) &&
                this._alpha != e && (this._alpha = e, this._setDirty(), this._setCacheDirty())
            }, enumerable: !0,
            configurable: !0
        });
        Object.defineProperty(a.prototype, "skewX", {
            get: function () {
                return this._skewX
            }, set: function (e) {
                c.NumberUtils.isNumber(e) && this._skewX != e && (this._skewX = e, this._setSizeDirty())
            }, enumerable: !0,
            configurable: !0
        });
        Object.defineProperty(a.prototype, "skewY", {
            get: function () {
                return this._skewY
            }, set: function (e) {
                c.NumberUtils.isNumber(e) && this._skewY != e && (this._skewY = e, this._setSizeDirty())
            }, enumerable: !0,
            configurable: !0
        });
        Object.defineProperty(a.prototype, "touchEnabled", {
            get: function () {
                return this._touchEnabled
            }, set: function (e) {
                this._setTouchEnabled(e)
            }, enumerable: !0,
            configurable: !0
        });
        a.prototype._setTouchEnabled = function (e) {
            this._touchEnabled = e
        };
        Object.defineProperty(a.prototype, "scrollRect", {
            get: function () {
                return this._scrollRect
            }, set: function (e) {
                this._setScrollRect(e)
            }, enumerable: !0,
            configurable: !0
        });
        a.prototype._setScrollRect = function (e) {
            this._scrollRect = e;
            this._setSizeDirty()
        };
        Object.defineProperty(a.prototype,
            "measuredWidth", {
                get: function () {
                    return this._measureBounds().width
                }, enumerable: !0,
                configurable: !0
            });
        Object.defineProperty(a.prototype, "measuredHeight", {
            get: function () {
                return this._measureBounds().height
            }, enumerable: !0,
            configurable: !0
        });
        Object.defineProperty(a.prototype, "explicitWidth", {
            get: function () {
                return this._explicitWidth
            }, enumerable: !0,
            configurable: !0
        });
        Object.defineProperty(a.prototype, "explicitHeight", {
            get: function () {
                return this._explicitHeight
            }, enumerable: !0,
            configurable: !0
        });
        Object.defineProperty(a.prototype,
            "width", {
                get: function () {
                    return this._getSize(c.Rectangle.identity).width
                }, set: function (e) {
                    this._setWidth(e)
                }, enumerable: !0,
                configurable: !0
            });
        Object.defineProperty(a.prototype, "height", {
            get: function () {
                return this._getSize(c.Rectangle.identity).height
            }, set: function (e) {
                this._setHeight(e)
            }, enumerable: !0,
            configurable: !0
        });
        a.prototype._setWidth = function (e) {
            this._setSizeDirty();
            this._setCacheDirty();
            this._explicitWidth = e;
            this._hasWidthSet = c.NumberUtils.isNumber(e)
        };
        a.prototype._setHeight = function (e) {
            this._setSizeDirty();
            this._setCacheDirty();
            this._explicitHeight = e;
            this._hasHeightSet = c.NumberUtils.isNumber(e)
        };
        a.prototype._draw = function (e) {
            if (this._visible && !this.drawCacheTexture(e)) {
                this._colorTransform && e.setGlobalColorTransform(this._colorTransform.matrix);
                e.setAlpha(this.worldAlpha, this.blendMode);
                e.setTransform(this._worldTransform);
                var a = this.mask || this._scrollRect;
                a && e.pushMask(a);
                this._render(e);
                a && e.popMask();
                this._colorTransform && e.setGlobalColorTransform(null)
            }
            this.destroyCacheBounds()
        };
        a.prototype.drawCacheTexture =
            function (e) {
                if (!1 == this._cacheAsBitmap) return !1;
                if (this._cacheDirty || null == this._texture_to_render || Math.round(this.width) != Math.round(this._texture_to_render._sourceWidth) || Math.round(this.height) != Math.round(this._texture_to_render._sourceHeight)) this._cacheDirty = !this._makeBitmapCache();
                if (null == this._texture_to_render) return !1;
                var a = this._texture_to_render,
                    b = a._offsetX,
                    d = a._offsetY,
                    g = a._textureWidth,
                    a = a._textureHeight;
                this._updateTransform();
                e.setAlpha(this.worldAlpha, this.blendMode);
                e.setTransform(this._worldTransform);
                var f = c.MainContext.instance.rendererContext.texture_scale_factor;
                c.RenderFilter.getInstance().drawImage(e, this, 0, 0, g * f, a * f, b, d, g, a);
                return !0
            };
        a.prototype._updateTransform = function () {
            this._calculateWorldTransform()
        };
        a.prototype._calculateWorldTransform = function () {
            var e = this._worldTransform,
                a = this._parent;
            e.identityMatrix(a._worldTransform);
            this._getMatrix(e);
            var b = this._scrollRect;
            b && e.append(1, 0, 0, 1, -b.x, -b.y);
            this.worldAlpha = a.worldAlpha * this._alpha
        };
        a.prototype._render = function (e) {};
        a.prototype.getBounds =
            function (e, a) {
                void 0 === a && (a = !0);
                var b = this._measureBounds(),
                    d = this._hasWidthSet ? this._explicitWidth : b.width,
                    g = this._hasHeightSet ? this._explicitHeight : b.height;
                this._rectW = b.width;
                this._rectH = b.height;
                this._clearSizeDirty();
                var f = b.x,
                    b = b.y,
                    k = 0,
                    m = 0;
                a && (0 != this._anchorX || 0 != this._anchorY ? (k = d * this._anchorX, m = g * this._anchorY) : (k = this._anchorOffsetX, m = this._anchorOffsetY));
                this._cacheBounds.initialize(f - k, b - m, d, g);
                d = this._cacheBounds;
                e || (e = new c.Rectangle);
                return e.initialize(d.x, d.y, d.width, d.height)
            };
        a.prototype.destroyCacheBounds = function () {
            this._cacheBounds.x = 0;
            this._cacheBounds.y = 0;
            this._cacheBounds.width = 0;
            this._cacheBounds.height = 0
        };
        a.prototype._getConcatenatedMatrix = function () {
            for (var e = a.identityMatrixForGetConcatenated.identity(), l = this; null != l;) {
                if (0 != l._anchorX || 0 != l._anchorY) {
                    var b = l._getSize(c.Rectangle.identity);
                    e.prependTransform(l._x, l._y, l._scaleX, l._scaleY, l._rotation, l._skewX, l._skewY, b.width * l._anchorX, b.height * l._anchorY)
                } else e.prependTransform(l._x, l._y, l._scaleX, l._scaleY,
                    l._rotation, l._skewX, l._skewY, l._anchorOffsetX, l._anchorOffsetY);
                l = l._parent
            }
            return e
        };
        a.prototype.localToGlobal = function (e, a, b) {
            void 0 === e && (e = 0);
            void 0 === a && (a = 0);
            var d = this._getConcatenatedMatrix();
            d.append(1, 0, 0, 1, e, a);
            b || (b = new c.Point);
            b.x = d.tx;
            b.y = d.ty;
            return b
        };
        a.prototype.globalToLocal = function (e, a, b) {
            void 0 === e && (e = 0);
            void 0 === a && (a = 0);
            var d = this._getConcatenatedMatrix();
            d.invert();
            d.append(1, 0, 0, 1, e, a);
            b || (b = new c.Point);
            b.x = d.tx;
            b.y = d.ty;
            return b
        };
        a.prototype.hitTest = function (e, a, b) {
            void 0 ===
            b && (b = !1);
            if (!this._visible || !b && !this._touchEnabled) return null;
            b = this._getSize(c.Rectangle.identity);
            return 0 <= e && e < b.width && 0 <= a && a < b.height ? this.mask || this._scrollRect ? this._scrollRect && e > this._scrollRect.x && a > this._scrollRect.y && e < this._scrollRect.x + this._scrollRect.width && a < this._scrollRect.y + this._scrollRect.height || this.mask && this.mask.x <= e && e < this.mask.x + this.mask.width && this.mask.y <= a && a < this.mask.y + this.mask.height ? this : null : this : null
        };
        a.prototype.hitTestPoint = function (e, a, b) {
            e = this.globalToLocal(e,
                a);
            return b ? (this._hitTestPointTexture || (this._hitTestPointTexture = new c.RenderTexture), b = this._hitTestPointTexture, b.drawToTexture(this), 0 != b.getPixel32(e.x - this._hitTestPointTexture._offsetX, e.y - this._hitTestPointTexture._offsetY)[3] ? !0 : !1) : !!this.hitTest(e.x, e.y, !0)
        };
        a.prototype._getMatrix = function (e) {
            e || (e = c.Matrix.identity.identity());
            var a, b;
            b = this._getOffsetPoint();
            a = b.x;
            b = b.y;
            var d = this.__hack_local_matrix;
            d ? (e.append(d.a, d.b, d.c, d.d, d.tx, d.ty), e.append(1, 0, 0, 1, -a, -b)) : e.appendTransform(this._x,
                this._y, this._scaleX, this._scaleY, this._rotation, this._skewX, this._skewY, a, b);
            return e
        };
        a.prototype._getSize = function (e) {
            return this._hasHeightSet && this._hasWidthSet ? e.initialize(0, 0, this._explicitWidth, this._explicitHeight) : this._measureSize(e)
        };
        a.prototype._measureSize = function (e) {
            this._sizeDirty ? (e = this._measureBounds(), this._rectW = e.width, this._rectH = e.height, this._clearSizeDirty()) : (e.width = this._rectW, e.height = this._rectH);
            e.x = 0;
            e.y = 0;
            return e
        };
        a.prototype._measureBounds = function () {
            return c.Rectangle.identity.initialize(0,
                0, 0, 0)
        };
        a.prototype._getOffsetPoint = function () {
            var e = this._anchorOffsetX,
                a = this._anchorOffsetY;
            if (0 != this._anchorX || 0 != this._anchorY) a = this._getSize(c.Rectangle.identity), e = this._anchorX * a.width, a = this._anchorY * a.height;
            var b = c.Point.identity;
            b.x = e;
            b.y = a;
            return b
        };
        a.prototype._onAddToStage = function () {
            this._stage = c.MainContext.instance.stage;
            c.DisplayObjectContainer.__EVENT__ADD_TO_STAGE_LIST.push(this)
        };
        a.prototype._onRemoveFromStage = function () {
            c.DisplayObjectContainer.__EVENT__REMOVE_FROM_STAGE_LIST.push(this)
        };
        Object.defineProperty(a.prototype, "stage", {
            get: function () {
                return this._stage
            }, enumerable: !0,
            configurable: !0
        });
        a.prototype.addEventListener = function (e, l, d, h, g) {
            void 0 === h && (h = !1);
            void 0 === g && (g = 0);
            b.prototype.addEventListener.call(this, e, l, d, h, g);
            ((h = e == c.Event.ENTER_FRAME) || e == c.Event.RENDER) && this._insertEventBin(h ? a._enterFrameCallBackList : a._renderCallBackList, l, d, g, this)
        };
        a.prototype.removeEventListener = function (e, l, d, h) {
            void 0 === h && (h = !1);
            b.prototype.removeEventListener.call(this, e, l, d, h);
            ((h =
                e == c.Event.ENTER_FRAME) || e == c.Event.RENDER) && this._removeEventBin(h ? a._enterFrameCallBackList : a._renderCallBackList, l, d, this)
        };
        a.prototype.dispatchEvent = function (e) {
            if (!e._bubbles) return b.prototype.dispatchEvent.call(this, e);
            for (var a = [], c = this; c;) a.push(c), c = c._parent;
            e._reset();
            this._dispatchPropagationEvent(e, a);
            return !e._isDefaultPrevented
        };
        a.prototype._dispatchPropagationEvent = function (e, a, b) {
            b = a.length;
            for (var c = 1, d = b - 1; 0 <= d; d--) {
                var f = a[d];
                e._currentTarget = f;
                e._target = this;
                e._eventPhase = c;
                f._notifyListener(e);
                if (e._isPropagationStopped || e._isPropagationImmediateStopped) return
            }
            f = a[0];
            e._currentTarget = f;
            e._target = this;
            e._eventPhase = 2;
            f._notifyListener(e);
            if (!e._isPropagationStopped && !e._isPropagationImmediateStopped)
                for (c = 3, d = 1; d < b && (f = a[d], e._currentTarget = f, e._target = this, e._eventPhase = c, f._notifyListener(e), !e._isPropagationStopped && !e._isPropagationImmediateStopped); d++);
        };
        a.prototype.willTrigger = function (e) {
            for (var a = this; a;) {
                if (a.hasEventListener(e)) return !0;
                a = a._parent
            }
            return !1
        };
        Object.defineProperty(a.prototype, "cacheAsBitmap", {
            get: function () {
                return this._cacheAsBitmap
            }, set: function (e) {
                (this._cacheAsBitmap = e) ? c.callLater(this._makeBitmapCache, this): this._texture_to_render = null
            }, enumerable: !0,
            configurable: !0
        });
        a.prototype._makeBitmapCache = function () {
            this.renderTexture || (this.renderTexture = new c.RenderTexture);
            var e = this.renderTexture.drawToTexture(this);
            this._texture_to_render = e ? this.renderTexture : null;
            return e
        };
        a.prototype._setCacheDirty = function (e) {
            void 0 === e && (e = !0);
            this._cacheDirty =
                e
        };
        a.getTransformBounds = function (e, a) {
            var b = e.x,
                c = e.y,
                d = e.width,
                f = e.height;
            (b || c) && a.appendTransform(0, 0, 1, 1, 0, 0, 0, -b, -c);
            var k = d * a.a,
                d = d * a.b,
                m = f * a.c,
                f = f * a.d,
                n = a.tx,
                p = a.ty,
                r = n,
                s = n,
                t = p,
                u = p;
            (b = k + n) < r ? r = b : b > s && (s = b);
            (b = k + m + n) < r ? r = b : b > s && (s = b);
            (b = m + n) < r ? r = b : b > s && (s = b);
            (c = d + p) < t ? t = c : c > u && (u = c);
            (c = d + f + p) < t ? t = c : c > u && (u = c);
            (c = f + p) < t ? t = c : c > u && (u = c);
            return e.initialize(r, t, s - r, u - t)
        };
        Object.defineProperty(a.prototype, "colorTransform", {
            get: function () {
                return this._colorTransform
            }, set: function (e) {
                this._colorTransform =
                    e
            }, enumerable: !0,
            configurable: !0
        });
        a.identityMatrixForGetConcatenated = new c.Matrix;
        a._enterFrameCallBackList = [];
        a._renderCallBackList = [];
        return a
    }(c.EventDispatcher);
    c.DisplayObject = d;
    d.prototype.__class__ = "egret.DisplayObject";
    d = function () {
        function b() {
            this.matrix = null
        }
        b.prototype.updateColor = function (a, e, b, c, d, g, f, k) {};
        return b
    }();
    c.ColorTransform = d;
    d.prototype.__class__ = "egret.ColorTransform"
})(egret || (egret = {}));
__extends = this.__extends || function (c, d) {
    function b() {
        this.constructor = c
    }
    for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
    b.prototype = d.prototype;
    c.prototype = new b
};
(function (c) {
    var d = function (b) {
        function a() {
            b.call(this);
            this._touchChildren = !0;
            this._children = []
        }
        __extends(a, b);
        Object.defineProperty(a.prototype, "touchChildren", {
            get: function () {
                return this._touchChildren
            }, set: function (e) {
                this._touchChildren = e
            }, enumerable: !0,
            configurable: !0
        });
        Object.defineProperty(a.prototype, "numChildren", {
            get: function () {
                return this._children.length
            }, enumerable: !0,
            configurable: !0
        });
        a.prototype.setChildIndex = function (e, a) {
            this.doSetChildIndex(e, a)
        };
        a.prototype.doSetChildIndex = function (e,
                                                a) {
            var b = this._children.indexOf(e);
            0 > b && c.Logger.fatal("child\u4e0d\u5728\u5f53\u524d\u5bb9\u5668\u5185");
            this._children.splice(b, 1);
            0 > a || this._children.length <= a ? this._children.push(e) : this._children.splice(a, 0, e)
        };
        a.prototype.addChild = function (e) {
            var a = this._children.length;
            e._parent == this && a--;
            return this._doAddChild(e, a)
        };
        a.prototype.addChildAt = function (e, a) {
            return this._doAddChild(e, a)
        };
        a.prototype._doAddChild = function (e, b, d) {
            void 0 === d && (d = !0);
            if (e == this) return e;
            if (0 > b || b > this._children.length) return c.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4"),
                e;
            var h = e._parent;
            if (h == this) return this.doSetChildIndex(e, b), e;
            h && (b = h._children.indexOf(e), 0 <= b && h._doRemoveChild(b));
            this._children.splice(b, 0, e);
            e._parentChanged(this);
            d && e.dispatchEventWith(c.Event.ADDED, !0);
            if (this._stage)
                for (e._onAddToStage(), b = a.__EVENT__ADD_TO_STAGE_LIST; 0 < b.length;) b.shift().dispatchEventWith(c.Event.ADDED_TO_STAGE);
            e._setDirty();
            this._setSizeDirty();
            return e
        };
        a.prototype.removeChild = function (e) {
            e = this._children.indexOf(e);
            if (0 <= e) return this._doRemoveChild(e);
            c.Logger.fatal("child\u672a\u88abaddChild\u5230\u8be5parent");
            return null
        };
        a.prototype.removeChildAt = function (e) {
            if (0 <= e && e < this._children.length) return this._doRemoveChild(e);
            c.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4");
            return null
        };
        a.prototype._doRemoveChild = function (e, b) {
            void 0 === b && (b = !0);
            var d = this._children,
                h = d[e];
            b && h.dispatchEventWith(c.Event.REMOVED, !0);
            if (this._stage) {
                h._onRemoveFromStage();
                for (var g = a.__EVENT__REMOVE_FROM_STAGE_LIST; 0 < g.length;) {
                    var f = g.shift();
                    f.dispatchEventWith(c.Event.REMOVED_FROM_STAGE);
                    f._stage = null
                }
            }
            h._parentChanged(null);
            d.splice(e, 1);
            this._setSizeDirty();
            return h
        };
        a.prototype.getChildAt = function (e) {
            if (0 <= e && e < this._children.length) return this._children[e];
            c.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4");
            return null
        };
        a.prototype.contains = function (e) {
            for (; e;) {
                if (e == this) return !0;
                e = e._parent
            }
            return !1
        };
        a.prototype.swapChildrenAt = function (e, a) {
            0 <= e && e < this._children.length && 0 <= a && a < this._children.length ? this._swapChildrenAt(e, a) : c.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4")
        };
        a.prototype.swapChildren = function (e, a) {
            var b = this._children.indexOf(e),
                d = this._children.indexOf(a); - 1 == b || -1 == d ? c.Logger.fatal("child\u672a\u88abaddChild\u5230\u8be5parent") : this._swapChildrenAt(b, d)
        };
        a.prototype._swapChildrenAt = function (e, a) {
            if (e != a) {
                var b = this._children,
                    c = b[e];
                b[e] = b[a];
                b[a] = c
            }
        };
        a.prototype.getChildIndex = function (e) {
            return this._children.indexOf(e)
        };
        a.prototype.removeChildren = function () {
            for (var e = this._children.length - 1; 0 <= e; e--) this._doRemoveChild(e)
        };
        a.prototype._updateTransform =
            function () {
                if (this._visible) {
                    b.prototype._updateTransform.call(this);
                    for (var e = 0, a = this._children.length; e < a; e++) this._children[e]._updateTransform()
                }
            };
        a.prototype._render = function (e) {
            for (var a = 0, b = this._children.length; a < b; a++) this._children[a]._draw(e)
        };
        a.prototype._measureBounds = function () {
            for (var e = 0, a = 0, b = 0, d = 0, g = this._children.length, f = 0; f < g; f++) {
                var k = this._children[f];
                if (k._visible) {
                    var m = k.getBounds(c.Rectangle.identity, !1),
                        n = m.x,
                        p = m.y,
                        r = m.width,
                        m = m.height,
                        k = k._getMatrix(),
                        k = c.DisplayObject.getTransformBounds(c.Rectangle.identity.initialize(n,
                            p, r, m), k),
                        n = k.x,
                        p = k.y,
                        r = k.width + k.x,
                        k = k.height + k.y;
                    if (n < e || 0 == f) e = n;
                    if (r > a || 0 == f) a = r;
                    if (p < b || 0 == f) b = p;
                    if (k > d || 0 == f) d = k
                }
            }
            return c.Rectangle.identity.initialize(e, b, a - e, d - b)
        };
        a.prototype.hitTest = function (e, a, d) {
            void 0 === d && (d = !1);
            var h;
            if (!this._visible) return null;
            if (this._scrollRect) {
                if (e < this._scrollRect.x || a < this._scrollRect.y || e > this._scrollRect.x + this._scrollRect.width || a > this._scrollRect.y + this._scrollRect.height) return null
            } else if (this.mask && (this.mask.x > e || e > this.mask.x + this.mask.width || this.mask.y >
                a || a > this.mask.y + this.mask.height)) return null;
            for (var g = this._children, f = this._touchChildren, k = g.length - 1; 0 <= k; k--) {
                var m = g[k],
                    n = m._getMatrix(),
                    p = m._scrollRect;
                p && n.append(1, 0, 0, 1, -p.x, -p.y);
                n.invert();
                n = c.Matrix.transformCoords(n, e, a);
                if (m = m.hitTest(n.x, n.y, !0)) {
                    if (!f) return this;
                    if (m._touchEnabled && f) return m;
                    h = this
                }
            }
            return h ? h : this._texture_to_render || this.graphics ? b.prototype.hitTest.call(this, e, a, d) : null
        };
        a.prototype._onAddToStage = function () {
            b.prototype._onAddToStage.call(this);
            for (var e = this._children.length,
                     a = 0; a < e; a++) this._children[a]._onAddToStage()
        };
        a.prototype._onRemoveFromStage = function () {
            b.prototype._onRemoveFromStage.call(this);
            for (var e = this._children.length, a = 0; a < e; a++) this._children[a]._onRemoveFromStage()
        };
        a.prototype.getChildByName = function (e) {
            for (var a = this._children, b = a.length, c, d = 0; d < b; d++)
                if (c = a[d], c.name == e) return c;
            return null
        };
        a.__EVENT__ADD_TO_STAGE_LIST = [];
        a.__EVENT__REMOVE_FROM_STAGE_LIST = [];
        return a
    }(c.DisplayObject);
    c.DisplayObjectContainer = d;
    d.prototype.__class__ = "egret.DisplayObjectContainer"
})(egret ||
    (egret = {}));
__extends = this.__extends || function (c, d) {
    function b() {
        this.constructor = c
    }
    for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
    b.prototype = d.prototype;
    c.prototype = new b
};
(function (c) {
    var d = function (b) {
        function a(e, a) {
            void 0 === e && (e = 480);
            void 0 === a && (a = 800);
            b.call(this);
            this.touchEnabled = !0;
            this._stage = this;
            this._stageWidth = e;
            this._stageHeight = a
        }
        __extends(a, b);
        a.prototype.invalidate = function () {
            a._invalidateRenderFlag = !0
        };
        Object.defineProperty(a.prototype, "scaleMode", {
            get: function () {
                return this._scaleMode
            }, set: function (e) {
                this._scaleMode != e && (this._scaleMode = e, this.setResolutionPolicy())
            }, enumerable: !0,
            configurable: !0
        });
        a.prototype.changeSize = function () {
            this.setResolutionPolicy();
            this.dispatchEventWith(c.Event.RESIZE)
        };
        a.prototype.setResolutionPolicy = function () {
            var e = {};
            e[c.StageScaleMode.NO_SCALE] = new c.NoScale;
            e[c.StageScaleMode.SHOW_ALL] = new c.ShowAll;
            e[c.StageScaleMode.NO_BORDER] = new c.FixedWidth;
            e[c.StageScaleMode.EXACT_FIT] = new c.FullScreen;
            e = e[this._scaleMode];
            if (!e) throw Error("\u4f7f\u7528\u4e86\u5c1a\u672a\u5b9e\u73b0\u7684ScaleMode");
            var a = new c.EqualToFrame,
                e = new c.ResolutionPolicy(a, e);
            c.StageDelegate.getInstance()._setResolutionPolicy(e);
            this._stageWidth = c.StageDelegate.getInstance()._stageWidth;
            this._stageHeight = c.StageDelegate.getInstance()._stageHeight
        };
        Object.defineProperty(a.prototype, "stageWidth", {
            get: function () {
                return this._stageWidth
            }, enumerable: !0,
            configurable: !0
        });
        Object.defineProperty(a.prototype, "stageHeight", {
            get: function () {
                return this._stageHeight
            }, enumerable: !0,
            configurable: !0
        });
        a.prototype.hitTest = function (e, a, b) {
            if (!this._touchEnabled) return null;
            var d;
            if (!this._touchChildren) return this;
            b = this._children;
            for (var g = b.length - 1; 0 <= g; g--) {
                d = b[g];
                var f = d._getMatrix(),
                    k = d._scrollRect;
                k && f.append(1, 0, 0, 1, -k.x, -k.y);
                f.invert();
                f = c.Matrix.transformCoords(f, e, a);
                if ((d = d.hitTest(f.x, f.y, !0)) && d._touchEnabled) return d
            }
            return this
        };
        a.prototype.getBounds = function (e) {
            e || (e = new c.Rectangle);
            return e.initialize(0, 0, this._stageWidth, this._stageHeight)
        };
        a.prototype._updateTransform = function () {
            for (var e = 0, a = this._children.length; e < a; e++) this._children[e]._updateTransform()
        };
        Object.defineProperty(a.prototype, "focus", {
            get: function () {
                return null
            }, enumerable: !0,
            configurable: !0
        });
        a._invalidateRenderFlag = !1;
        return a
    }(c.DisplayObjectContainer);
    c.Stage = d;
    d.prototype.__class__ = "egret.Stage"
})(egret || (egret = {}));
(function (c) {
    var d = function () {
        function b() {}
        b.NO_BORDER = "noBorder";
        b.NO_SCALE = "noScale";
        b.SHOW_ALL = "showAll";
        b.EXACT_FIT = "exactFit";
        return b
    }();
    c.StageScaleMode = d;
    d.prototype.__class__ = "egret.StageScaleMode"
})(egret || (egret = {}));
__extends = this.__extends || function (c, d) {
    function b() {
        this.constructor = c
    }
    for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
    b.prototype = d.prototype;
    c.prototype = new b
};
(function (c) {
    var d = function (b) {
        function a(e) {
            void 0 === e && (e = null);
            b.call(this);
            this._lastTouchPosition = new c.Point(0, 0);
            this._lastTouchTime = 0;
            this._lastTouchEvent = null;
            this._velocitys = [];
            this._content = null;
            this._horizontalScrollPolicy = this._verticalScrollPolicy = "auto";
            this._scrollTop = this._scrollLeft = 0;
            this._vCanScroll = this._hCanScroll = !1;
            this.touchEnabled = !0;
            e && this.setContent(e)
        }
        __extends(a, b);
        a.prototype.setContent = function (e) {
            this._content && (this._removeEvents(), b.prototype.removeChildAt.call(this,
                0));
            this._content = e;
            b.prototype.addChild.call(this, e);
            this._addEvents();
            this._explicitWidth || this._getContentWidth();
            this._explicitHeight || this._getContentHeight()
        };
        Object.defineProperty(a.prototype, "verticalScrollPolicy", {
            get: function () {
                return this._verticalScrollPolicy
            }, set: function (e) {
                e != this._verticalScrollPolicy && (this._verticalScrollPolicy = e)
            }, enumerable: !0,
            configurable: !0
        });
        Object.defineProperty(a.prototype, "horizontalScrollPolicy", {
            get: function () {
                return this._horizontalScrollPolicy
            }, set: function (e) {
                e !=
                this._horizontalScrollPolicy && (this._horizontalScrollPolicy = e)
            }, enumerable: !0,
            configurable: !0
        });
        Object.defineProperty(a.prototype, "scrollLeft", {
            get: function () {
                return this._scrollLeft
            }, set: function (e) {
                e != this._scrollLeft && (this._scrollLeft = e, this._validatePosition(!1, !0), this._updateContentPosition())
            }, enumerable: !0,
            configurable: !0
        });
        Object.defineProperty(a.prototype, "scrollTop", {
            get: function () {
                return this._scrollTop
            }, set: function (e) {
                e != this._scrollTop && (this._scrollTop = e, this._validatePosition(!0, !1), this._updateContentPosition())
            }, enumerable: !0,
            configurable: !0
        });
        a.prototype.setScrollPosition = function (e, a, b) {
            void 0 === b && (b = !1);
            if (!b || 0 != e || 0 != a)
                if (b || this._scrollTop != e || this._scrollLeft != a) {
                    if (b) {
                        b = this._isOnTheEdge(!0);
                        var c = this._isOnTheEdge(!1);
                        this._scrollTop += b ? e / 2 : e;
                        this._scrollLeft += c ? a / 2 : a
                    } else this._scrollTop = e, this._scrollLeft = a;
                    this._validatePosition(!0, !0);
                    this._updateContentPosition()
                }
        };
        a.prototype._isOnTheEdge = function (e) {
            void 0 === e && (e = !0);
            var a = this._scrollTop,
                b = this._scrollLeft;
            return e ? 0 > a || a > this.getMaxScrollTop() : 0 > b || b > this.getMaxScrollLeft()
        };
        a.prototype._validatePosition = function (e, a) {
            void 0 === e && (e = !1);
            void 0 === a && (a = !1);
            if (e) {
                var b = this.height,
                    c = this._getContentHeight();
                this._scrollTop = Math.max(this._scrollTop, (0 - b) / 2);
                this._scrollTop = Math.min(this._scrollTop, c > b ? c - b / 2 : c / 2)
            }
            a && (b = this.width, c = this._getContentWidth(), this._scrollLeft = Math.max(this._scrollLeft, (0 - b) / 2), this._scrollLeft = Math.min(this._scrollLeft, c > b ? c - b / 2 : c / 2))
        };
        a.prototype._setWidth = function (e) {
            this._explicitWidth !=
            e && (b.prototype._setWidth.call(this, e), this._updateContentPosition())
        };
        a.prototype._setHeight = function (e) {
            this._explicitHeight != e && (b.prototype._setHeight.call(this, e), this._updateContentPosition())
        };
        a.prototype._updateContentPosition = function () {
            var e = this.getBounds(c.Rectangle.identity);
            this.scrollRect = new c.Rectangle(this._scrollLeft, this._scrollTop, e.width, e.height);
            this.dispatchEvent(new c.Event(c.Event.CHANGE))
        };
        a.prototype._checkScrollPolicy = function () {
            var e = this.__checkScrollPolicy(this._horizontalScrollPolicy,
                this._getContentWidth(), this.width);
            this._hCanScroll = e;
            var a = this.__checkScrollPolicy(this._verticalScrollPolicy, this._getContentHeight(), this.height);
            this._vCanScroll = a;
            return e || a
        };
        a.prototype.__checkScrollPolicy = function (e, a, b) {
            return "on" == e ? !0 : "off" == e ? !1 : a > b
        };
        a.prototype._addEvents = function () {
            this.addEventListener(c.TouchEvent.TOUCH_BEGIN, this._onTouchBegin, this);
            this.addEventListener(c.TouchEvent.TOUCH_BEGIN, this._onTouchBeginCapture, this, !0);
            this.addEventListener(c.TouchEvent.TOUCH_END, this._onTouchEndCapture,
                this, !0)
        };
        a.prototype._removeEvents = function () {
            this.removeEventListener(c.TouchEvent.TOUCH_BEGIN, this._onTouchBegin, this);
            this.removeEventListener(c.TouchEvent.TOUCH_BEGIN, this._onTouchBeginCapture, this, !0);
            this.removeEventListener(c.TouchEvent.TOUCH_END, this._onTouchEndCapture, this, !0)
        };
        a.prototype._onTouchBegin = function (e) {
            e._isDefaultPrevented || (c.Tween.removeTweens(this), this.stage.addEventListener(c.TouchEvent.TOUCH_MOVE, this._onTouchMove, this), this.stage.addEventListener(c.TouchEvent.TOUCH_END,
                this._onTouchEnd, this), this.stage.addEventListener(c.TouchEvent.LEAVE_STAGE, this._onTouchEnd, this), this.addEventListener(c.Event.ENTER_FRAME, this._onEnterFrame, this), this._logTouchEvent(e), e.preventDefault())
        };
        a.prototype._onTouchBeginCapture = function (e) {
            var b = this._checkScrollPolicy();
            if (b) {
                for (var d = e.target; d != this;) {
                    if (d instanceof a && (b = d._checkScrollPolicy())) return;
                    d = d.parent
                }
                e.stopPropagation();
                this.delayTouchBeginEvent = this.cloneTouchEvent(e);
                this.touchBeginTimer || (this.touchBeginTimer = new c.Timer(100,
                    1), this.touchBeginTimer.addEventListener(c.TimerEvent.TIMER_COMPLETE, this._onTouchBeginTimer, this));
                this.touchBeginTimer.start();
                this._onTouchBegin(e)
            }
        };
        a.prototype._onTouchEndCapture = function (e) {
            this.delayTouchBeginEvent && this._onTouchBeginTimer()
        };
        a.prototype._onTouchBeginTimer = function () {
            this.touchBeginTimer.stop();
            var e = this.delayTouchBeginEvent;
            this.delayTouchBeginEvent = null;
            this.dispatchPropagationEvent(e)
        };
        a.prototype.dispatchPropagationEvent = function (e) {
            for (var a = [], b = e._target; b;) a.push(b),
                b = b.parent;
            for (var c = this._content, d = 1;; d += 2) {
                b = a[d];
                if (!b || b === c) break;
                a.unshift(b)
            }
            this._dispatchPropagationEvent(e, a)
        };
        a.prototype._dispatchPropagationEvent = function (e, a, b) {
            for (var c = a.length, d = 0; d < c; d++) {
                var f = a[d];
                e._currentTarget = f;
                e._target = this;
                e._eventPhase = d < b ? 1 : d == b ? 2 : 3;
                f._notifyListener(e);
                if (e._isPropagationStopped || e._isPropagationImmediateStopped) break
            }
        };
        a.prototype._onTouchMove = function (e) {
            if (this._lastTouchPosition.x != e.stageX || this._lastTouchPosition.y != e.stageY) {
                this.delayTouchBeginEvent &&
                (this.delayTouchBeginEvent = null, this.touchBeginTimer.stop());
                this.touchChildren = !1;
                var a = this._getPointChange(e);
                this.setScrollPosition(a.y, a.x, !0);
                this._calcVelocitys(e);
                this._logTouchEvent(e)
            }
        };
        a.prototype._onTouchEnd = function (e) {
            this.touchChildren = !0;
            c.MainContext.instance.stage.removeEventListener(c.TouchEvent.TOUCH_MOVE, this._onTouchMove, this);
            c.MainContext.instance.stage.removeEventListener(c.TouchEvent.TOUCH_END, this._onTouchEnd, this);
            c.MainContext.instance.stage.removeEventListener(c.TouchEvent.LEAVE_STAGE,
                this._onTouchEnd, this);
            this.removeEventListener(c.Event.ENTER_FRAME, this._onEnterFrame, this);
            this._moveAfterTouchEnd()
        };
        a.prototype._onEnterFrame = function (e) {
            e = c.getTimer();
            100 < e - this._lastTouchTime && 300 > e - this._lastTouchTime && this._calcVelocitys(this._lastTouchEvent)
        };
        a.prototype._logTouchEvent = function (e) {
            this._lastTouchPosition.x = e.stageX;
            this._lastTouchPosition.y = e.stageY;
            this._lastTouchEvent = this.cloneTouchEvent(e);
            this._lastTouchTime = c.getTimer()
        };
        a.prototype._getPointChange = function (e) {
            return {
                x: !1 ===
                this._hCanScroll ? 0 : this._lastTouchPosition.x - e.stageX,
                y: !1 === this._vCanScroll ? 0 : this._lastTouchPosition.y - e.stageY
            }
        };
        a.prototype._calcVelocitys = function (e) {
            var a = c.getTimer();
            if (0 == this._lastTouchTime) this._lastTouchTime = a;
            else {
                var b = this._getPointChange(e),
                    a = a - this._lastTouchTime;
                b.x /= a;
                b.y /= a;
                this._velocitys.push(b);
                5 < this._velocitys.length && this._velocitys.shift();
                this._lastTouchPosition.x = e.stageX;
                this._lastTouchPosition.y = e.stageY
            }
        };
        a.prototype._getContentWidth = function () {
            return this._content.explicitWidth ||
                this._content.width
        };
        a.prototype._getContentHeight = function () {
            return this._content.explicitHeight || this._content.height
        };
        a.prototype.getMaxScrollLeft = function () {
            var e = this._getContentWidth() - this.width;
            return Math.max(0, e)
        };
        a.prototype.getMaxScrollTop = function () {
            var e = this._getContentHeight() - this.height;
            return Math.max(0, e)
        };
        a.prototype._moveAfterTouchEnd = function () {
            if (0 != this._velocitys.length) {
                for (var e = 0, b = 0, c = 0, d = 0; d < this._velocitys.length; d++) var g = this._velocitys[d],
                    f = a.weight[d],
                    e = e + g.x * f,
                    b = b + g.y * f,
                    c = c + f;
                this._velocitys.length = 0;
                e /= c;
                b /= c;
                g = Math.abs(e);
                c = Math.abs(b);
                f = this.getMaxScrollLeft();
                d = this.getMaxScrollTop();
                e = 0.02 < g ? this.getAnimationDatas(e, this._scrollLeft, f) : {
                    position: this._scrollLeft,
                    duration: 1
                };
                b = 0.02 < c ? this.getAnimationDatas(b, this._scrollTop, d) : {
                    position: this._scrollTop,
                    duration: 1
                };
                this.setScrollLeft(e.position, e.duration);
                this.setScrollTop(b.position, b.duration)
            }
        };
        a.prototype.setScrollTop = function (e, a) {
            void 0 === a && (a = 0);
            var b = Math.min(this.getMaxScrollTop(), Math.max(e,
                0));
            if (0 == a) return this.scrollTop = b, null;
            var d = c.Tween.get(this).to({
                scrollTop: e
            }, a, c.Ease.quartOut);
            b != e && d.to({
                scrollTop: b
            }, 300, c.Ease.quintOut)
        };
        a.prototype.setScrollLeft = function (e, a) {
            void 0 === a && (a = 0);
            var b = Math.min(this.getMaxScrollLeft(), Math.max(e, 0));
            if (0 == a) return this.scrollLeft = b, null;
            var d = c.Tween.get(this).to({
                scrollLeft: e
            }, a, c.Ease.quartOut);
            b != e && d.to({
                scrollLeft: b
            }, 300, c.Ease.quintOut)
        };
        a.prototype.getAnimationDatas = function (e, a, b) {
            var c = Math.abs(e),
                d = 0,
                f = a + 500 * e;
            if (0 > f || f > b)
                for (f =
                         a; Infinity != Math.abs(e) && 0.02 < Math.abs(e);) f += e, e = 0 > f || f > b ? 0.998 * e * 0.95 : 0.998 * e, d++;
            else d = 500 * -Math.log(0.02 / c);
            return {
                position: Math.min(b + 50, Math.max(f, -50)),
                duration: d
            }
        };
        a.prototype.cloneTouchEvent = function (e) {
            var a = new c.TouchEvent(e._type, e._bubbles, e.cancelable);
            a.touchPointID = e.touchPointID;
            a._stageX = e._stageX;
            a._stageY = e._stageY;
            a.ctrlKey = e.ctrlKey;
            a.altKey = e.altKey;
            a.shiftKey = e.shiftKey;
            a.touchDown = e.touchDown;
            a._isDefaultPrevented = !1;
            a._target = e._target;
            return a
        };
        a.prototype.throwNotSupportedError =
            function () {
                throw Error("\u6b64\u65b9\u6cd5\u5728ScrollView\u5185\u4e0d\u53ef\u7528!");
            };
        a.prototype.addChild = function (a) {
            this.throwNotSupportedError();
            return null
        };
        a.prototype.addChildAt = function (a, b) {
            this.throwNotSupportedError();
            return null
        };
        a.prototype.removeChild = function (a) {
            this.throwNotSupportedError();
            return null
        };
        a.prototype.removeChildAt = function (a) {
            this.throwNotSupportedError();
            return null
        };
        a.prototype.setChildIndex = function (a, b) {
            this.throwNotSupportedError()
        };
        a.prototype.swapChildren = function (a,
                                             b) {
            this.throwNotSupportedError()
        };
        a.prototype.swapChildrenAt = function (a, b) {
            this.throwNotSupportedError()
        };
        a.weight = [1, 1.33, 1.66, 2, 2.33];
        return a
    }(c.DisplayObjectContainer);
    c.ScrollView = d;
    d.prototype.__class__ = "egret.ScrollView"
})(egret || (egret = {}));
__extends = this.__extends || function (c, d) {
    function b() {
        this.constructor = c
    }
    for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
    b.prototype = d.prototype;
    c.prototype = new b
};
(function (c) {
    var d = function (b) {
        function a(a, l, d) {
            void 0 === l && (l = NaN);
            void 0 === d && (d = NaN);
            b.call(this, a);
            this.content = a;
            this.width = NaN == l ? this._getContentWidth() : l;
            this.height = NaN == d ? this._getContentHeight() : d;
            c.Logger.warning("egret.Scroller\u5df2\u5e9f\u5f03\uff0c\u8bf7\u4f7f\u7528egret.ScrollView")
        }
        __extends(a, b);
        Object.defineProperty(a.prototype, "scrollXEnabled", {
            get: function () {
                return "off" != this.horizontalScrollPolicy
            }, set: function (a) {
                c.Logger.warning("egret.Scroller\u5df2\u5e9f\u5f03\uff0c\u8bf7\u4f7f\u7528egret.ScrollView");
                this.horizontalScrollPolicy = a ? "auto" : "off"
            }, enumerable: !0,
            configurable: !0
        });
        Object.defineProperty(a.prototype, "scrollYEnabled", {
            get: function () {
                return "off" != this.verticalScrollPolicy
            }, set: function (a) {
                c.Logger.warning("egret.Scroller\u5df2\u5e9f\u5f03\uff0c\u8bf7\u4f7f\u7528egret.ScrollView");
                this.verticalScrollPolicy = a ? "auto" : "off"
            }, enumerable: !0,
            configurable: !0
        });
        return a
    }(c.ScrollView);
    c.Scroller = d;
    d.prototype.__class__ = "egret.Scroller"
})(egret || (egret = {}));
(function (c) {
    var d = function () {
        function b() {}
        b.REPEAT = "repeat";
        b.SCALE = "scale";
        return b
    }();
    c.BitmapFillMode = d;
    d.prototype.__class__ = "egret.BitmapFillMode"
})(egret || (egret = {}));
__extends = this.__extends || function (c, d) {
    function b() {
        this.constructor = c
    }
    for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
    b.prototype = d.prototype;
    c.prototype = new b
};
(function (c) {
    var d = function (b) {
        function a(a) {
            b.call(this);
            this.debug = 1;
            this.debugColor = 16711680;
            this.scale9Grid = null;
            this.fillMode = "scale";
            a && (this._texture = a, this._setSizeDirty())
        }
        __extends(a, b);
        Object.defineProperty(a.prototype, "texture", {
            get: function () {
                return this._texture
            }, set: function (a) {
                a != this._texture && (this._setSizeDirty(), this._texture = a)
            }, enumerable: !0,
            configurable: !0
        });
        a.prototype._render = function (e) {
            var b = this._texture;
            b ? (this._texture_to_render = b, a._drawBitmap(e, this._hasWidthSet ? this._explicitWidth :
                b._textureWidth, this._hasHeightSet ? this._explicitHeight : b._textureHeight, this)) : this._texture_to_render = null
        };
        a._drawBitmap = function (e, b, c, d) {
            var g = d._texture_to_render;
            if (g) {
                var f = g._textureWidth,
                    k = g._textureHeight;
                if ("scale" == d.fillMode) {
                    var m = d.scale9Grid || g.scale9Grid;
                    if (m && f - m.width < b && k - m.height < c) a.drawScale9GridImage(e, d, m, b, c);
                    else {
                        var m = g._offsetX,
                            n = g._offsetY,
                            p = g._bitmapWidth || f,
                            r = g._bitmapHeight || k;
                        b /= f;
                        m = Math.round(m * b);
                        b = Math.round(p * b);
                        c /= k;
                        n = Math.round(n * c);
                        c = Math.round(r * c);
                        a.renderFilter.drawImage(e,
                            d, g._bitmapX, g._bitmapY, p, r, m, n, b, c)
                    }
                } else a.drawRepeatImage(e, d, b, c, d.fillMode)
            }
        };
        a.drawRepeatImage = function (a, b, d, h, g) {
            var f = b._texture_to_render;
            if (f) {
                var k = f._textureWidth,
                    m = f._textureHeight,
                    n = f._bitmapX,
                    p = f._bitmapY,
                    k = f._bitmapWidth || k,
                    m = f._bitmapHeight || m,
                    r = f._offsetX,
                    f = f._offsetY;
                c.RenderFilter.getInstance().drawImage(a, b, n, p, k, m, r, f, d, h, g)
            }
        };
        a.drawScale9GridImage = function (a, b, d, h, g) {
            var f = b._texture_to_render;
            if (f && d) {
                var k = c.RenderFilter.getInstance(),
                    m = f._textureWidth,
                    n = f._textureHeight,
                    p = f._bitmapX,
                    r = f._bitmapY,
                    s = f._bitmapWidth || m,
                    t = f._bitmapHeight || n,
                    u = f._offsetX,
                    f = f._offsetY;
                d = c.Rectangle.identity.initialize(d.x - Math.round(u), d.y - Math.round(u), d.width, d.height);
                u = Math.round(u);
                f = Math.round(f);
                h -= m - s;
                g -= n - t;
                d.y == d.bottom && (d.bottom < t ? d.bottom++ : d.y--);
                d.x == d.right && (d.right < s ? d.right++ : d.x--);
                var m = p + d.x,
                    n = p + d.right,
                    v = s - d.right,
                    x = r + d.y,
                    y = r + d.bottom,
                    w = t - d.bottom,
                    z = u + d.x,
                    A = f + d.y,
                    t = g - (t - d.bottom),
                    s = h - (s - d.right);
                k.drawImage(a, b, p, r, d.x, d.y, u, f, d.x, d.y);
                k.drawImage(a, b, m, r, d.width,
                    d.y, z, f, s - d.x, d.y);
                k.drawImage(a, b, n, r, v, d.y, u + s, f, h - s, d.y);
                k.drawImage(a, b, p, x, d.x, d.height, u, A, d.x, t - d.y);
                k.drawImage(a, b, m, x, d.width, d.height, z, A, s - d.x, t - d.y);
                k.drawImage(a, b, n, x, v, d.height, u + s, A, h - s, t - d.y);
                k.drawImage(a, b, p, y, d.x, w, u, f + t, d.x, g - t);
                k.drawImage(a, b, m, y, d.width, w, z, f + t, s - d.x, g - t);
                k.drawImage(a, b, n, y, v, w, u + s, f + t, h - s, g - t)
            }
        };
        a.prototype._measureBounds = function () {
            var a = this._texture;
            return a ? c.Rectangle.identity.initialize(a._offsetX, a._offsetY, a._textureWidth, a._textureHeight) : b.prototype._measureBounds.call(this)
        };
        a.debug = 1;
        a.renderFilter = c.RenderFilter.getInstance();
        return a
    }(c.DisplayObject);
    c.Bitmap = d;
    d.prototype.__class__ = "egret.Bitmap"
})(egret || (egret = {}));
__extends = this.__extends || function (c, d) {
    function b() {
        this.constructor = c
    }
    for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
    b.prototype = d.prototype;
    c.prototype = new b
};
(function (c) {
    var d = function (b) {
        function a() {
            b.call(this);
            this._text = "";
            this._textChanged = !1;
            this._bitmapPool = []
        }
        __extends(a, b);
        Object.defineProperty(a.prototype, "text", {
            get: function () {
                return this._text
            }, set: function (a) {
                this._textChanged = !0;
                this._text = a;
                this._setSizeDirty()
            }, enumerable: !0,
            configurable: !0
        });
        a.prototype._updateTransform = function () {
            this.visible && (this._textChanged && this._renderText(), b.prototype._updateTransform.call(this))
        };
        a.prototype._renderText = function (a) {
            var b = a = 0;
            this._textChanged &&
            this.removeChildren();
            for (var d = 0, h = this.text.length; d < h; d++) {
                var g = this.text.charAt(d),
                    f = this.spriteSheet.getTexture(g);
                if (null == f) console.log("\u5f53\u524d\u6ca1\u6709\u4f4d\u56fe\u6587\u5b57\uff1a" + g);
                else {
                    var g = f._offsetX,
                        k = f._offsetY,
                        m = f._textureWidth;
                    if (this._textChanged) {
                        var n = this._bitmapPool[d];
                        n || (n = new c.Bitmap, this._bitmapPool.push(n));
                        n.texture = f;
                        this.addChild(n);
                        n.x = a
                    }
                    a += m + g;
                    k + f._textureHeight > b && (b = k + f._textureHeight)
                }
            }
            this._textChanged = !1;
            return c.Rectangle.identity.initialize(0, 0,
                a, b)
        };
        a.prototype._measureBounds = function () {
            return this._renderText(!0)
        };
        return a
    }(c.DisplayObjectContainer);
    c.BitmapText = d;
    d.prototype.__class__ = "egret.BitmapText"
})(egret || (egret = {}));
(function (c) {
    var d = function () {
        function b() {
            this._lastY = this._lastX = this._maxY = this._maxX = this._minY = this._minX = 0;
            this.commandQueue = []
        }
        b.prototype.beginFill = function (a, e) {};
        b.prototype._setStyle = function (a) {};
        b.prototype.drawRect = function (a, e, b, c) {
            this.checkRect(a, e, b, c)
        };
        b.prototype.drawCircle = function (a, e, b) {
            this.checkRect(a - b, e - b, 2 * b, 2 * b)
        };
        b.prototype.drawRoundRect = function (a, e, b, c, d, g) {
            this.checkRect(a, e, b, c)
        };
        b.prototype.drawEllipse = function (a, e, b, c) {
            this.checkRect(a - b, e - c, 2 * b, 2 * c)
        };
        b.prototype.lineStyle =
            function (a, e, b, c, d, g, f, k) {};
        b.prototype.lineTo = function (a, e) {
            this.checkPoint(a, e)
        };
        b.prototype.curveTo = function (a, e, b, c) {
            this.checkPoint(a, e);
            this.checkPoint(b, c)
        };
        b.prototype.moveTo = function (a, e) {
            this.checkPoint(a, e)
        };
        b.prototype.clear = function () {
            this._maxY = this._maxX = this._minY = this._minX = 0
        };
        b.prototype.endFill = function () {};
        b.prototype._draw = function (a) {};
        b.prototype.checkRect = function (a, e, b, c) {
            this._minX = Math.min(this._minX, a);
            this._minY = Math.min(this._minY, e);
            this._maxX = Math.max(this._maxX, a +
                b);
            this._maxY = Math.max(this._maxY, e + c)
        };
        b.prototype.checkPoint = function (a, e) {
            this._minX = Math.min(this._minX, a);
            this._minY = Math.min(this._minY, e);
            this._maxX = Math.max(this._maxX, a);
            this._maxY = Math.max(this._maxY, e);
            this._lastX = a;
            this._lastY = e
        };
        return b
    }();
    c.Graphics = d;
    d.prototype.__class__ = "egret.Graphics";
    (function () {
        return function (b, a, e) {
            this.method = b;
            this.thisObject = a;
            this.args = e
        }
    })().prototype.__class__ = "egret.Command"
})(egret || (egret = {}));
__extends = this.__extends || function (c, d) {
    function b() {
        this.constructor = c
    }
    for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
    b.prototype = d.prototype;
    c.prototype = new b
};
(function (c) {
    var d = function (b) {
        function a() {
            b.call(this)
        }
        __extends(a, b);
        Object.defineProperty(a.prototype, "graphics", {
            get: function () {
                this._graphics || (this._graphics = new c.Graphics);
                return this._graphics
            }, enumerable: !0,
            configurable: !0
        });
        a.prototype._render = function (a) {
            this._graphics && this._graphics._draw(a)
        };
        return a
    }(c.DisplayObject);
    c.Shape = d;
    d.prototype.__class__ = "egret.Shape"
})(egret || (egret = {}));
__extends = this.__extends || function (c, d) {
    function b() {
        this.constructor = c
    }
    for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
    b.prototype = d.prototype;
    c.prototype = new b
};
(function (c) {
    var d = function (b) {
        function a() {
            b.call(this)
        }
        __extends(a, b);
        Object.defineProperty(a.prototype, "graphics", {
            get: function () {
                this._graphics || (this._graphics = new c.Graphics);
                return this._graphics
            }, enumerable: !0,
            configurable: !0
        });
        a.prototype._render = function (a) {
            this._graphics && this._graphics._draw(a);
            b.prototype._render.call(this, a)
        };
        return a
    }(c.DisplayObjectContainer);
    c.Sprite = d;
    d.prototype.__class__ = "egret.Sprite"
})(egret || (egret = {}));
__extends = this.__extends || function (c, d) {
    function b() {
        this.constructor = c
    }
    for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
    b.prototype = d.prototype;
    c.prototype = new b
};
(function (c) {
    var d = function (b) {
        function a() {
            b.call(this);
            this._inputEnabled = !1;
            this._text = this._type = "";
            this._displayAsPassword = !1;
            this._fontFamily = a.default_fontFamily;
            this._size = 30;
            this._textColorString = "#FFFFFF";
            this._textColor = 16777215;
            this._strokeColorString = "#000000";
            this._stroke = this._strokeColor = 0;
            this._textAlign = "left";
            this._verticalAlign = "top";
            this._maxChars = 0;
            this._scrollV = -1;
            this._numLines = this._lineSpacing = this._maxScrollV = 0;
            this._isFlow = this._multiline = !1;
            this._textArr = [];
            this._isArrayChanged = !1;
            this._textMaxHeight = this._textMaxWidth = 0;
            this._linesArr = []
        }
        __extends(a, b);
        a.prototype.isInput = function () {
            return this._type == c.TextFieldType.INPUT
        };
        a.prototype._setTouchEnabled = function (a) {
            b.prototype._setTouchEnabled.call(this, a);
            this.isInput() && (this._inputEnabled = !0)
        };
        Object.defineProperty(a.prototype, "type", {
            get: function () {
                return this._type
            }, set: function (a) {
                this._setType(a)
            }, enumerable: !0,
            configurable: !0
        });
        a.prototype._setType = function (a) {
            this._type != a && (this._type = a, this._type == c.TextFieldType.INPUT ?
                (this._hasWidthSet || this._setWidth(100), this._hasHeightSet || this._setHeight(30), null == this._inputUtils && (this._inputUtils = new c.InputController), this._inputUtils.init(this), this._setDirty(), this._stage && this._inputUtils._addStageText()) : this._inputUtils && (this._inputUtils._removeStageText(), this._inputUtils = null))
        };
        Object.defineProperty(a.prototype, "text", {
            get: function () {
                return this._getText()
            }, set: function (a) {
                this._setText(a)
            }, enumerable: !0,
            configurable: !0
        });
        a.prototype._getText = function () {
            return this._type ==
            c.TextFieldType.INPUT ? this._inputUtils._getText() : this._text
        };
        a.prototype._setSizeDirty = function () {
            b.prototype._setSizeDirty.call(this);
            this._isArrayChanged = !0
        };
        a.prototype._setTextDirty = function () {
            this._setSizeDirty()
        };
        a.prototype._setBaseText = function (a) {
            null == a && (a = "");
            this._isFlow = !1;
            if (this._text != a || this._displayAsPassword) this._setTextDirty(), this._text = a, a = "", a = this._displayAsPassword ? this.changeToPassText(this._text) : this._text, this.setMiddleStyle([{
                text: a
            }])
        };
        a.prototype._setText = function (a) {
            null ==
            a && (a = "");
            this._setBaseText(a);
            this._inputUtils && this._inputUtils._setText(this._text)
        };
        Object.defineProperty(a.prototype, "displayAsPassword", {
            get: function () {
                return this._displayAsPassword
            }, set: function (a) {
                this._setDisplayAsPassword(a)
            }, enumerable: !0,
            configurable: !0
        });
        a.prototype._setDisplayAsPassword = function (a) {
            this._displayAsPassword != a && (this._displayAsPassword = a, this._setText(this._text))
        };
        Object.defineProperty(a.prototype, "fontFamily", {
            get: function () {
                return this._fontFamily
            }, set: function (a) {
                this._setFontFamily(a)
            },
            enumerable: !0,
            configurable: !0
        });
        a.prototype._setFontFamily = function (a) {
            this._fontFamily != a && (this._setTextDirty(), this._fontFamily = a)
        };
        Object.defineProperty(a.prototype, "size", {
            get: function () {
                return this._size
            }, set: function (a) {
                this._setSize(a)
            }, enumerable: !0,
            configurable: !0
        });
        a.prototype._setSize = function (a) {
            this._size != a && (this._setTextDirty(), this._size = a)
        };
        Object.defineProperty(a.prototype, "italic", {
            get: function () {
                return this._italic
            }, set: function (a) {
                this._setItalic(a)
            }, enumerable: !0,
            configurable: !0
        });
        a.prototype._setItalic = function (a) {
            this._italic != a && (this._setTextDirty(), this._italic = a)
        };
        Object.defineProperty(a.prototype, "bold", {
            get: function () {
                return this._bold
            }, set: function (a) {
                this._setBold(a)
            }, enumerable: !0,
            configurable: !0
        });
        a.prototype._setBold = function (a) {
            this._bold != a && (this._setTextDirty(), this._bold = a)
        };
        Object.defineProperty(a.prototype, "textColor", {
            get: function () {
                return this._textColor
            }, set: function (a) {
                this._setTextColor(a)
            }, enumerable: !0,
            configurable: !0
        });
        a.prototype._setTextColor =
            function (a) {
                this._textColor != a && (this._setTextDirty(), this._textColor = a, this._textColorString = c.toColorString(a))
            };
        Object.defineProperty(a.prototype, "strokeColor", {
            get: function () {
                return this._strokeColor
            }, set: function (a) {
                this._setStrokeColor(a)
            }, enumerable: !0,
            configurable: !0
        });
        a.prototype._setStrokeColor = function (a) {
            this._strokeColor != a && (this._setTextDirty(), this._strokeColor = a, this._strokeColorString = c.toColorString(a))
        };
        Object.defineProperty(a.prototype, "stroke", {
            get: function () {
                return this._stroke
            },
            set: function (a) {
                this._setStroke(a)
            }, enumerable: !0,
            configurable: !0
        });
        a.prototype._setStroke = function (a) {
            this._stroke != a && (this._setTextDirty(), this._stroke = a)
        };
        Object.defineProperty(a.prototype, "textAlign", {
            get: function () {
                return this._textAlign
            }, set: function (a) {
                this._setTextAlign(a)
            }, enumerable: !0,
            configurable: !0
        });
        a.prototype._setTextAlign = function (a) {
            this._textAlign != a && (this._setTextDirty(), this._textAlign = a)
        };
        Object.defineProperty(a.prototype, "verticalAlign", {
            get: function () {
                return this._verticalAlign
            },
            set: function (a) {
                this._setVerticalAlign(a)
            }, enumerable: !0,
            configurable: !0
        });
        a.prototype._setVerticalAlign = function (a) {
            this._verticalAlign != a && (this._setTextDirty(), this._verticalAlign = a)
        };
        Object.defineProperty(a.prototype, "maxChars", {
            get: function () {
                return this._maxChars
            }, set: function (a) {
                this._setMaxChars(a)
            }, enumerable: !0,
            configurable: !0
        });
        a.prototype._setMaxChars = function (a) {
            this._maxChars != a && (this._maxChars = a)
        };
        Object.defineProperty(a.prototype, "scrollV", {
            set: function (a) {
                this._scrollV = a;
                this._setDirty()
            },
            enumerable: !0,
            configurable: !0
        });
        Object.defineProperty(a.prototype, "maxScrollV", {
            get: function () {
                return this._maxScrollV
            }, enumerable: !0,
            configurable: !0
        });
        Object.defineProperty(a.prototype, "selectionBeginIndex", {
            get: function () {
                return 0
            }, enumerable: !0,
            configurable: !0
        });
        Object.defineProperty(a.prototype, "selectionEndIndex", {
            get: function () {
                return 0
            }, enumerable: !0,
            configurable: !0
        });
        Object.defineProperty(a.prototype, "caretIndex", {
            get: function () {
                return 0
            }, enumerable: !0,
            configurable: !0
        });
        a.prototype._setSelection =
            function (a, b) {};
        Object.defineProperty(a.prototype, "lineSpacing", {
            get: function () {
                return this._lineSpacing
            }, set: function (a) {
                this._setLineSpacing(a)
            }, enumerable: !0,
            configurable: !0
        });
        a.prototype._setLineSpacing = function (a) {
            this._lineSpacing != a && (this._setTextDirty(), this._lineSpacing = a)
        };
        a.prototype._getLineHeight = function () {
            return this._lineSpacing + this._size
        };
        Object.defineProperty(a.prototype, "numLines", {
            get: function () {
                return this._numLines
            }, enumerable: !0,
            configurable: !0
        });
        Object.defineProperty(a.prototype,
            "multiline", {
                get: function () {
                    return this._multiline
                }, set: function (a) {
                    this._setMultiline(a)
                }, enumerable: !0,
                configurable: !0
            });
        a.prototype._setMultiline = function (a) {
            this._multiline = a;
            this._setDirty()
        };
        a.prototype.setFocus = function () {
            c.Logger.warning("TextField.setFocus \u6ca1\u6709\u5b9e\u73b0")
        };
        a.prototype._onRemoveFromStage = function () {
            b.prototype._onRemoveFromStage.call(this);
            this._type == c.TextFieldType.INPUT && this._inputUtils._removeStageText()
        };
        a.prototype._onAddToStage = function () {
            b.prototype._onAddToStage.call(this);
            this._type == c.TextFieldType.INPUT && this._inputUtils._addStageText()
        };
        a.prototype._updateBaseTransform = function () {
            b.prototype._updateTransform.call(this)
        };
        a.prototype._updateTransform = function () {
            this._type == c.TextFieldType.INPUT ? this._normalDirty ? (this._clearDirty(), this._inputUtils._updateProperties()) : this._inputUtils._updateTransform() : this._updateBaseTransform()
        };
        a.prototype._render = function (a) {
            this.drawText(a);
            this._clearDirty()
        };
        a.prototype._measureBounds = function () {
            return this.measureText()
        };
        Object.defineProperty(a.prototype, "textFlow", {
            set: function (a) {
                this._isFlow = !0;
                for (var b = "", c = 0; c < a.length; c++) b += a[c].text;
                this._displayAsPassword ? this._setBaseText(b) : (this._text = b, this.setMiddleStyle(a))
            }, enumerable: !0,
            configurable: !0
        });
        a.prototype.changeToPassText = function (a) {
            if (this._displayAsPassword) {
                for (var b = "", c = 0, d = a.length; c < d; c++) switch (a.charAt(c)) {
                    case "\n":
                        b += "\n";
                        break;
                    case "\r":
                        break;
                    default:
                        b += "*"
                }
                return b
            }
            return a
        };
        a.prototype.setMiddleStyle = function (a) {
            this._isArrayChanged = !0;
            this._textArr = a;
            this._setSizeDirty()
        };
        Object.defineProperty(a.prototype, "textWidth", {
            get: function () {
                return this._textMaxWidth
            }, enumerable: !0,
            configurable: !0
        });
        Object.defineProperty(a.prototype, "textHeight", {
            get: function () {
                return this._textMaxHeight
            }, enumerable: !0,
            configurable: !0
        });
        a.prototype.appendText = function (a) {
            this.appendElement({
                text: a
            })
        };
        a.prototype.appendElement = function (a) {
            this._textArr.push(a);
            this.setMiddleStyle(this._textArr)
        };
        a.prototype._getLinesArr = function () {
            if (!this._isArrayChanged) return this._linesArr;
            this._isArrayChanged = !1;
            var a = this._textArr,
                b = c.MainContext.instance.rendererContext;
            this._linesArr = [];
            this._textMaxWidth = this._textMaxHeight = 0;
            var d = this._linesArr,
                h = 0,
                g = 0,
                f = 0,
                k;
            this._isFlow || b.setupFont(this);
            for (var m = 0; m < a.length; m++) {
                var n = a[m];
                n.style = n.style || {};
                for (var p = n.text.toString().split(/(?:\r\n|\r|\n)/), r = 0; r < p.length; r++) {
                    null == d[f] && (k = {
                        width: 0,
                        height: 0,
                        elements: []
                    }, d[f] = k, g = h = 0);
                    g = this._type == c.TextFieldType.INPUT ? this._size : Math.max(g, n.style.size || this._size);
                    if ("" != p[r]) {
                        this._isFlow &&
                        b.setupFont(this, n.style);
                        var s = b.measureText(p[r]);
                        if (this._hasWidthSet)
                            if (h + s <= this._explicitWidth) k.elements.push({
                                width: s,
                                text: p[r],
                                style: n.style
                            }), h += s;
                            else {
                                for (var t = 0, u = 0, v = p[r]; t < v.length; t++) {
                                    s = b.measureText(v.charAt(t));
                                    if (h + s > this._explicitWidth) break;
                                    u += s;
                                    h += s
                                }
                                0 < t && (k.elements.push({
                                    width: u,
                                    text: v.substring(0, t),
                                    style: n.style
                                }), p[r] = v.substring(t));
                                r--
                            } else h += s, k.elements.push({
                            width: s,
                            text: p[r],
                            style: n.style
                        })
                    }
                    if (r < p.length - 1) {
                        k.width = h;
                        k.height = g;
                        this._textMaxWidth = Math.max(this._textMaxWidth,
                            h);
                        this._textMaxHeight += g;
                        if (this._type == c.TextFieldType.INPUT && !this._multiline) return this._numLines = d.length, d;
                        f++
                    }
                }
                m == a.length - 1 && k && (k.width = h, k.height = g, this._textMaxWidth = Math.max(this._textMaxWidth, h), this._textMaxHeight += g)
            }
            this._numLines = d.length;
            return d
        };
        a.prototype.measureText = function () {
            return this._getLinesArr() ? c.Rectangle.identity.initialize(0, 0, this._hasWidthSet ? this._explicitWidth : this._textMaxWidth, this._hasHeightSet ? this._explicitHeight : this._textMaxHeight + (this._numLines - 1) *
                this._lineSpacing) : c.Rectangle.identity.initialize(0, 0, 0, 0)
        };
        a.prototype.drawText = function (a) {
            var b = this._getLinesArr();
            if (b) {
                this._isFlow || a.setupFont(this);
                var d = this._hasWidthSet ? this._explicitWidth : this._textMaxWidth,
                    h = this._textMaxHeight + (this._numLines - 1) * this._lineSpacing,
                    g = 0,
                    f = 0;
                if (this._hasHeightSet)
                    if (h < this._explicitHeight) {
                        var k = 0;
                        this._verticalAlign == c.VerticalAlign.MIDDLE ? k = 0.5 : this._verticalAlign == c.VerticalAlign.BOTTOM && (k = 1);
                        g += k * (this._explicitHeight - h)
                    } else h > this._explicitHeight &&
                    (f = Math.max(this._scrollV - 1, 0), f = Math.min(this._numLines - 1, f));
                g = Math.round(g);
                h = 0;
                this._textAlign == c.HorizontalAlign.CENTER ? h = 0.5 : this._textAlign == c.HorizontalAlign.RIGHT && (h = 1);
                for (k = 0; f < this._numLines; f++) {
                    var m = b[f],
                        n = m.height,
                        g = g + n / 2;
                    if (0 != f && this._hasHeightSet && g > this._explicitHeight) break;
                    for (var k = Math.round((d - m.width) * h), p = 0; p < m.elements.length; p++) {
                        var r = m.elements[p],
                            s = r.style.size || this._size;
                        this._type == c.TextFieldType.INPUT ? a.drawText(this, r.text, k, g + (n - s) / 2, r.width) : (this._isFlow &&
                        a.setupFont(this, r.style), a.drawText(this, r.text, k, g + (n - s) / 2, r.width, r.style));
                        k += r.width
                    }
                    g += n / 2 + this._lineSpacing
                }
            }
        };
        a.default_fontFamily = "Arial";
        return a
    }(c.DisplayObject);
    c.TextField = d;
    d.prototype.__class__ = "egret.TextField"
})(egret || (egret = {}));
(function (c) {
    var d = function () {
        function b() {
            this.resutlArr = []
        }
        b.prototype.parser = function (a) {
            this.stackArray = [];
            this.resutlArr = [];
            for (var e = 0, b = a.length; e < b;) {
                var c = a.indexOf("<", e);
                0 > c ? (this.addToResultArr(a.substring(e)), e = b) : (this.addToResultArr(a.substring(e, c)), e = a.indexOf(">", c), "/" == a.charAt(c + 1) ? this.stackArray.pop() : this.addToArray(a.substring(c + 1, e)), e += 1)
            }
            return this.resutlArr
        };
        b.prototype.addToResultArr = function (a) {
            if ("" != a) {
                var e = [];
                e.push(["&lt;", "<"]);
                e.push(["&gt;", ">"]);
                e.push(["&amp;",
                    "&"
                ]);
                e.push(["&quot;", '"']);
                e.push(["&apos;;", "'"]);
                for (var b = 0; b < e.length; b++) a.replace(new RegExp(e[b][0], "g"), e[b][1]);
                0 < this.stackArray.length ? this.resutlArr.push({
                    text: a,
                    style: this.stackArray[this.stackArray.length - 1]
                }) : this.resutlArr.push({
                    text: a
                })
            }
        };
        b.prototype.changeStringToObject = function (a) {
            var e = {};
            a = a.replace(/( )+/g, " ").split(" ");
            for (var b = 0; b < a.length; b++) this.addProperty(e, a[b]);
            return e
        };
        b.prototype.addProperty = function (a, e) {
            var b = e.replace(/( )*=( )*/g, "=").split("=");
            b[1] && (b[1] =
                b[1].replace(/(\"|\')/g, ""));
            switch (b[0].toLowerCase()) {
                case "color":
                    a.textColor = parseInt(b[1]);
                    break;
                case "b":
                    a.bold = "true" == (b[1] || "true");
                    break;
                case "i":
                    a.italic = "true" == (b[1] || "true");
                    break;
                case "size":
                    a.size = parseInt(b[1]);
                    break;
                case "fontFamily":
                    a.fontFamily = b[1]
            }
        };
        b.prototype.addToArray = function (a) {
            a = this.changeStringToObject(a);
            if (0 != this.stackArray.length) {
                var e = this.stackArray[this.stackArray.length - 1],
                    b;
                for (b in e) null == a[b] && (a[b] = e[b])
            }
            this.stackArray.push(a)
        };
        return b
    }();
    c.HtmlTextParser =
        d;
    d.prototype.__class__ = "egret.HtmlTextParser"
})(egret || (egret = {}));
(function (c) {
    var d = function () {
        function b() {}
        b.DYNAMIC = "dynamic";
        b.INPUT = "input";
        return b
    }();
    c.TextFieldType = d;
    d.prototype.__class__ = "egret.TextFieldType"
})(egret || (egret = {}));
__extends = this.__extends || function (c, d) {
    function b() {
        this.constructor = c
    }
    for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
    b.prototype = d.prototype;
    c.prototype = new b
};
(function (c) {
    var d = function (b) {
        function a(a) {
            b.call(this);
            var c = a.bitmapData;
            this.bitmapData = c;
            this._textureMap = {};
            this._sourceWidth = c.width;
            this._sourceHeight = c.height;
            this._bitmapX = a._bitmapX - a._offsetX;
            this._bitmapY = a._bitmapY - a._offsetY
        }
        __extends(a, b);
        a.prototype.getTexture = function (a) {
            return this._textureMap[a]
        };
        a.prototype.createTexture = function (a, b, d, h, g, f, k, m, n) {
            void 0 === f && (f = 0);
            void 0 === k && (k = 0);
            "undefined" === typeof m && (m = f + h);
            "undefined" === typeof n && (n = k + g);
            var p = new c.Texture;
            p._bitmapData =
                this.bitmapData;
            p._bitmapX = this._bitmapX + b;
            p._bitmapY = this._bitmapY + d;
            p._bitmapWidth = h;
            p._bitmapHeight = g;
            p._offsetX = f;
            p._offsetY = k;
            p._textureWidth = m;
            p._textureHeight = n;
            p._sourceWidth = this._sourceWidth;
            p._sourceHeight = this._sourceHeight;
            return this._textureMap[a] = p
        };
        return a
    }(c.HashObject);
    c.SpriteSheet = d;
    d.prototype.__class__ = "egret.SpriteSheet"
})(egret || (egret = {}));
__extends = this.__extends || function (c, d) {
    function b() {
        this.constructor = c
    }
    for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
    b.prototype = d.prototype;
    c.prototype = new b
};
(function (c) {
    var d = function (b) {
        function a() {
            b.call(this);
            c.Logger.warning("TextInput \u5df2\u5e9f\u5f03\uff0c\u8bf7\u4f7f\u7528TextField\u4ee3\u66ff\uff0c\u5e76\u8bbe\u7f6etype\u4e3aTextFieldType.INPUT");
            this.type = c.TextFieldType.INPUT
        }
        __extends(a, b);
        a.prototype.setText = function (a) {
            c.Logger.warning("TextField.setText()\u5df2\u5e9f\u5f03\uff0c\u8bf7\u4f7f\u7528TextInput.text\u8bbe\u7f6e");
            this.text = a
        };
        a.prototype.getText = function () {
            c.Logger.warning("TextField.getText()\u5df2\u5e9f\u5f03\uff0c\u8bf7\u4f7f\u7528TextInput.text\u83b7\u53d6");
            return this.text
        };
        a.prototype.setTextType = function (a) {
            c.Logger.warning("TextField.setTextType()\u5df2\u5e9f\u5f03\uff0c\u8bf7\u4f7f\u7528TextInput.displayAsPassword\u8bbe\u7f6e");
            this.displayAsPassword = "password" == a
        };
        a.prototype.getTextType = function () {
            c.Logger.warning("TextField.getTextType()\u5df2\u5e9f\u5f03\uff0c\u8bf7\u4f7f\u7528TextInput.displayAsPassword\u83b7\u53d6");
            return this.displayAsPassword ? "password" : "text"
        };
        return a
    }(c.TextField);
    c.TextInput = d;
    d.prototype.__class__ = "egret.TextInput"
})(egret ||
    (egret = {}));
__extends = this.__extends || function (c, d) {
    function b() {
        this.constructor = c
    }
    for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
    b.prototype = d.prototype;
    c.prototype = new b
};
(function (c) {
    var d = function (b) {
        function a() {
            b.call(this);
            this._isFocus = !1;
            this._isFirst = this._isFirst = !0
        }
        __extends(a, b);
        a.prototype.init = function (a) {
            this._text = a;
            this.stageText = c.StageText.create();
            a = this._text.localToGlobal();
            this.stageText._open(a.x, a.y, this._text._explicitWidth, this._text._explicitHeight)
        };
        a.prototype._addStageText = function () {
            this._text._inputEnabled || (this._text._touchEnabled = !0);
            this.stageText._add();
            this.stageText._addListeners();
            this.stageText.addEventListener("blur", this.onBlurHandler,
                this);
            this.stageText.addEventListener("focus", this.onFocusHandler, this);
            this.stageText.addEventListener("updateText", this.updateTextHandler, this);
            this._text.addEventListener(c.TouchEvent.TOUCH_TAP, this.onMouseDownHandler, this);
            c.MainContext.instance.stage.addEventListener(c.TouchEvent.TOUCH_TAP, this.onStageDownHandler, this)
        };
        a.prototype._removeStageText = function () {
            this.stageText._remove();
            this.stageText._removeListeners();
            this._text._inputEnabled || (this._text._touchEnabled = !1);
            this.stageText.removeEventListener("blur",
                this.onBlurHandler, this);
            this.stageText.removeEventListener("focus", this.onFocusHandler, this);
            this.stageText.removeEventListener("updateText", this.updateTextHandler, this);
            this._text.removeEventListener(c.TouchEvent.TOUCH_TAP, this.onMouseDownHandler, this);
            c.MainContext.instance.stage.removeEventListener(c.TouchEvent.TOUCH_TAP, this.onStageDownHandler, this)
        };
        a.prototype._getText = function () {
            return this.stageText._getText()
        };
        a.prototype._setText = function (a) {
            this.stageText._setText(a)
        };
        a.prototype.onFocusHandler =
            function (a) {
                this.hideText()
            };
        a.prototype.onBlurHandler = function (a) {
            this.showText()
        };
        a.prototype.onMouseDownHandler = function (a) {
            a.stopPropagation();
            this._text._visible && this.stageText._show()
        };
        a.prototype.onStageDownHandler = function (a) {
            this.stageText._hide();
            this.showText()
        };
        a.prototype.showText = function () {
            this._isFocus && (this._isFocus = !1, this.resetText())
        };
        a.prototype.hideText = function () {
            this._isFocus || (this._text._setBaseText(""), this._isFocus = !0)
        };
        a.prototype.updateTextHandler = function (a) {
            this.resetText();
            this._text.dispatchEvent(new c.Event(c.Event.CHANGE))
        };
        a.prototype.resetText = function () {
            this._text._setBaseText(this.stageText._getText())
        };
        a.prototype._updateTransform = function () {
            var a = this._text._worldTransform.a,
                b = this._text._worldTransform.b,
                d = this._text._worldTransform.c,
                h = this._text._worldTransform.d,
                g = this._text._worldTransform.tx,
                f = this._text._worldTransform.ty;
            this._text._updateBaseTransform();
            var k = this._text._worldTransform;
            if (this._isFirst || a != k.a || b != k.b || d != k.c || h != k.d || g != k.tx || f !=
                k.ty) {
                this._isFirst = !1;
                a = this._text.localToGlobal();
                this.stageText.changePosition(a.x, a.y);
                var m = this;
                c.callLater(function () {
                    m.stageText._setScale(m._text._worldTransform.a, m._text._worldTransform.d)
                }, this)
            }
        };
        a.prototype._updateProperties = function () {
            var a = this._text._stage;
            if (null == a) this.stageText._setVisible(!1);
            else {
                for (var b = this._text, d = b._visible; d;) {
                    b = b.parent;
                    if (b == a) break;
                    d = b._visible
                }
                this.stageText._setVisible(d)
            }
            this.stageText._setMultiline(this._text._multiline);
            this.stageText._setMaxChars(this._text._maxChars);
            this.stageText._setSize(this._text._size);
            this.stageText._setTextColor(this._text._textColorString);
            this.stageText._setTextFontFamily(this._text._fontFamily);
            this.stageText._setBold(this._text._bold);
            this.stageText._setItalic(this._text._italic);
            this.stageText._setTextAlign(this._text._textAlign);
            this.stageText._setWidth(this._text._getSize(c.Rectangle.identity).width);
            this.stageText._setHeight(this._text._getSize(c.Rectangle.identity).height);
            this.stageText._setTextType(this._text._displayAsPassword ?
                "password" : "text");
            this.stageText._setText(this._text._text);
            this.stageText._resetStageText();
            this._updateTransform()
        };
        return a
    }(c.HashObject);
    c.InputController = d;
    d.prototype.__class__ = "egret.InputController"
})(egret || (egret = {}));
__extends = this.__extends || function (c, d) {
    function b() {
        this.constructor = c
    }
    for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
    b.prototype = d.prototype;
    c.prototype = new b
};
(function (c) {
    var d = function (b) {
        function a(a, c) {
            b.call(this, a);
            this.charList = this.parseConfig(c)
        }
        __extends(a, b);
        a.prototype.getTexture = function (a) {
            var b = this._textureMap[a];
            if (!b) {
                b = this.charList[a];
                if (!b) return null;
                b = this.createTexture(a, b.x, b.y, b.width, b.height, b.offsetX, b.offsetY);
                this._textureMap[a] = b
            }
            return b
        };
        a.prototype.parseConfig = function (a) {
            a = a.split("\r\n").join("\n");
            a = a.split("\n");
            for (var b = this.getConfigByKey(a[3], "count"), c = {}, d = 4; d < 4 + b; d++) {
                var g = a[d],
                    f = String.fromCharCode(this.getConfigByKey(g,
                        "id")),
                    k = {};
                c[f] = k;
                k.x = this.getConfigByKey(g, "x");
                k.y = this.getConfigByKey(g, "y");
                k.width = this.getConfigByKey(g, "width");
                k.height = this.getConfigByKey(g, "height");
                k.offsetX = this.getConfigByKey(g, "xoffset");
                k.offsetY = this.getConfigByKey(g, "yoffset")
            }
            return c
        };
        a.prototype.getConfigByKey = function (a, b) {
            for (var c = a.split(" "), d = 0, g = c.length; d < g; d++) {
                var f = c[d];
                if (b == f.substring(0, b.length)) return c = f.substring(b.length + 1), parseInt(c)
            }
            return 0
        };
        return a
    }(c.SpriteSheet);
    c.BitmapTextSpriteSheet = d;
    d.prototype.__class__ =
        "egret.BitmapTextSpriteSheet"
})(egret || (egret = {}));
__extends = this.__extends || function (c, d) {
    function b() {
        this.constructor = c
    }
    for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
    b.prototype = d.prototype;
    c.prototype = new b
};
(function (c) {
    var d = function (a) {
        function e(e, d) {
            a.call(this);
            this.frameRate = 60;
            e instanceof b ? (c.Logger.warning("MovieClip#constructor\u63a5\u53e3\u53c2\u6570\u5df2\u7ecf\u53d8\u66f4\uff0c\u8bf7\u5c3d\u5feb\u8c03\u6574\u7528\u6cd5\u4e3a new MovieClip(data,texture)"), this.delegate = e) : this.delegate = new b(e, d);
            this.delegate.setMovieClip(this)
        }
        __extends(e, a);
        e.prototype.gotoAndPlay = function (a) {
            this.delegate.gotoAndPlay(a)
        };
        e.prototype.gotoAndStop = function (a) {
            this.delegate.gotoAndStop(a)
        };
        e.prototype.stop =
            function () {
                this.delegate.stop()
            };
        e.prototype.dispose = function () {
            this.delegate.dispose()
        };
        e.prototype.release = function () {
            c.Logger.warning("MovieClip#release\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03");
            this.dispose()
        };
        e.prototype.getCurrentFrameIndex = function () {
            c.Logger.warning("MovieClip#getCurrentFrameIndex\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03");
            return this.delegate._currentFrameIndex
        };
        e.prototype.getTotalFrame = function () {
            c.Logger.warning("MovieClip#getTotalFrame\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03");
            return this.delegate._totalFrame
        };
        e.prototype.setInterval = function (a) {
            c.Logger.warning("MovieClip#setInterval\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03,\u8bf7\u4f7f\u7528MovieClip#frameRate\u4ee3\u66ff");
            this.frameRate = 60 / a
        };
        e.prototype.getIsPlaying = function () {
            c.Logger.warning("MovieClip#getIsPlaying\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03");
            return this.delegate.isPlaying
        };
        return e
    }(c.DisplayObjectContainer);
    c.MovieClip = d;
    d.prototype.__class__ = "egret.MovieClip";
    var b = function () {
        function a(a, b) {
            this.data = a;
            this._currentFrameIndex = this._passTime =
                this._totalFrame = 0;
            this._isPlaying = !1;
            this._frameData = a;
            this._spriteSheet = new c.SpriteSheet(b)
        }
        a.prototype.setMovieClip = function (a) {
            this.movieClip = a;
            this.bitmap = new c.Bitmap;
            this.movieClip.addChild(this.bitmap)
        };
        a.prototype.gotoAndPlay = function (a) {
            this.checkHasFrame(a);
            this._isPlaying = !0;
            this._currentFrameIndex = 0;
            this._currentFrameName = a;
            this._totalFrame = this._frameData.frames[a].totalFrame;
            this.playNextFrame();
            this._passTime = 0;
            c.Ticker.getInstance().register(this.update, this)
        };
        a.prototype.gotoAndStop =
            function (a) {
                this.checkHasFrame(a);
                this.stop();
                this._currentFrameIndex = this._passTime = 0;
                this._currentFrameName = a;
                this._totalFrame = this._frameData.frames[a].totalFrame;
                this.playNextFrame()
            };
        a.prototype.stop = function () {
            this._isPlaying = !1;
            c.Ticker.getInstance().unregister(this.update, this)
        };
        a.prototype.dispose = function () {};
        a.prototype.checkHasFrame = function (a) {
            void 0 == this._frameData.frames[a] && c.Logger.fatal("MovieClip\u6ca1\u6709\u5bf9\u5e94\u7684frame\uff1a", a)
        };
        a.prototype.update = function (a) {
            for (var b =
                1E3 / this.movieClip.frameRate, b = Math.floor((this._passTime % b + a) / b); 1 <= b;) 1 == b ? this.playNextFrame() : this.playNextFrame(!1), b--;
            this._passTime += a
        };
        a.prototype.playNextFrame = function (a) {
            void 0 === a && (a = !0);
            var b = this._frameData.frames[this._currentFrameName].childrenFrame[this._currentFrameIndex];
            if (a) {
                a = this.getTexture(b.res);
                var d = this.bitmap;
                d.x = b.x;
                d.y = b.y;
                d.texture = a
            }
            null != b.action && this.movieClip.dispatchEventWith(b.action);
            this._currentFrameIndex++;
            this._currentFrameIndex == this._totalFrame && (this._currentFrameIndex =
                0, b.action != c.Event.COMPLETE && this.movieClip.dispatchEventWith(c.Event.COMPLETE))
        };
        a.prototype.getTexture = function (a) {
            var b = this._frameData.res[a],
                c = this._spriteSheet.getTexture(a);
            c || (c = this._spriteSheet.createTexture(a, b.x, b.y, b.w, b.h));
            return c
        };
        return a
    }();
    c.DefaultMovieClipDelegate = b;
    b.prototype.__class__ = "egret.DefaultMovieClipDelegate"
})(egret || (egret = {}));
__extends = this.__extends || function (c, d) {
    function b() {
        this.constructor = c
    }
    for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
    b.prototype = d.prototype;
    c.prototype = new b
};
(function (c) {
    var d = function (b) {
        function a() {
            b.call(this);
            this._scaleY = this._scaleX = 1;
            this._size = 30;
            this._color = "#FFFFFF";
            this._fontFamily = "Arial";
            this._italic = this._bold = !1;
            this._textAlign = "left";
            this._multiline = this._visible = !1;
            this._maxChars = 0
        }
        __extends(a, b);
        a.prototype._getText = function () {
            return null
        };
        a.prototype._setText = function (a) {};
        a.prototype._setTextType = function (a) {};
        a.prototype._getTextType = function () {
            return null
        };
        a.prototype._open = function (a, b, c, d) {};
        a.prototype._show = function () {};
        a.prototype._add =
            function () {};
        a.prototype._remove = function () {};
        a.prototype._hide = function () {};
        a.prototype._addListeners = function () {};
        a.prototype._removeListeners = function () {};
        a.prototype._setScale = function (a, b) {
            this._scaleX = a;
            this._scaleY = b
        };
        a.prototype.changePosition = function (a, b) {};
        a.prototype._setSize = function (a) {
            this._size = a
        };
        a.prototype._setTextColor = function (a) {
            this._color = a
        };
        a.prototype._setTextFontFamily = function (a) {
            this._fontFamily = a
        };
        a.prototype._setBold = function (a) {
            this._bold = a
        };
        a.prototype._setItalic =
            function (a) {
                this._italic = a
            };
        a.prototype._setTextAlign = function (a) {
            this._textAlign = a
        };
        a.prototype._setVisible = function (a) {
            this._visible = a
        };
        a.prototype._setWidth = function (a) {};
        a.prototype._setHeight = function (a) {};
        a.prototype._setMultiline = function (a) {
            this._multiline = a
        };
        a.prototype._setMaxChars = function (a) {
            this._maxChars = a
        };
        a.prototype._resetStageText = function () {};
        a.create = function () {
            return null
        };
        return a
    }(c.EventDispatcher);
    c.StageText = d;
    d.prototype.__class__ = "egret.StageText"
})(egret || (egret = {}));
(function (c) {
    var d = function () {
        function b() {}
        b.GET = "get";
        b.POST = "post";
        return b
    }();
    c.URLRequestMethod = d;
    d.prototype.__class__ = "egret.URLRequestMethod"
})(egret || (egret = {}));
(function (c) {
    var d = function () {
        function b() {}
        b.BINARY = "binary";
        b.TEXT = "text";
        b.VARIABLES = "variables";
        b.TEXTURE = "texture";
        b.SOUND = "sound";
        return b
    }();
    c.URLLoaderDataFormat = d;
    d.prototype.__class__ = "egret.URLLoaderDataFormat"
})(egret || (egret = {}));
__extends = this.__extends || function (c, d) {
    function b() {
        this.constructor = c
    }
    for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
    b.prototype = d.prototype;
    c.prototype = new b
};
(function (c) {
    var d = function (b) {
        function a(a) {
            void 0 === a && (a = null);
            b.call(this);
            null !== a && this.decode(a)
        }
        __extends(a, b);
        a.prototype.decode = function (a) {
            this.variables || (this.variables = {});
            a = a.split("+").join(" ");
            for (var b, c = /[?&]?([^=]+)=([^&]*)/g; b = c.exec(a);) this.variables[decodeURIComponent(b[1])] = decodeURIComponent(b[2])
        };
        a.prototype.toString = function () {
            if (!this.variables) return "";
            var a = this.variables,
                b = "",
                c = !0,
                d;
            for (d in a) c ? c = !1 : b += "&", b += d + "=" + a[d];
            return b
        };
        return a
    }(c.HashObject);
    c.URLVariables =
        d;
    d.prototype.__class__ = "egret.URLVariables"
})(egret || (egret = {}));
__extends = this.__extends || function (c, d) {
    function b() {
        this.constructor = c
    }
    for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
    b.prototype = d.prototype;
    c.prototype = new b
};
(function (c) {
    var d = function (b) {
        function a(a) {
            void 0 === a && (a = null);
            b.call(this);
            this.method = c.URLRequestMethod.GET;
            this.url = a
        }
        __extends(a, b);
        return a
    }(c.HashObject);
    c.URLRequest = d;
    d.prototype.__class__ = "egret.URLRequest"
})(egret || (egret = {}));
__extends = this.__extends || function (c, d) {
    function b() {
        this.constructor = c
    }
    for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
    b.prototype = d.prototype;
    c.prototype = new b
};
(function (c) {
    var d = function (b) {
        function a(a) {
            void 0 === a && (a = null);
            b.call(this);
            this.dataFormat = c.URLLoaderDataFormat.TEXT;
            this._status = -1;
            a && this.load(a)
        }
        __extends(a, b);
        a.prototype.load = function (a) {
            this._request = a;
            this.data = null;
            c.MainContext.instance.netContext.proceed(this)
        };
        return a
    }(c.EventDispatcher);
    c.URLLoader = d;
    d.prototype.__class__ = "egret.URLLoader"
})(egret || (egret = {}));
__extends = this.__extends || function (c, d) {
    function b() {
        this.constructor = c
    }
    for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
    b.prototype = d.prototype;
    c.prototype = new b
};
(function (c) {
    var d = function (b) {
        function a() {
            b.call(this);
            this._textureHeight = this._textureWidth = this._offsetY = this._offsetX = this._bitmapHeight = this._bitmapWidth = this._bitmapY = this._bitmapX = 0
        }
        __extends(a, b);
        Object.defineProperty(a.prototype, "textureWidth", {
            get: function () {
                return this._textureWidth
            }, enumerable: !0,
            configurable: !0
        });
        Object.defineProperty(a.prototype, "textureHeight", {
            get: function () {
                return this._textureHeight
            }, enumerable: !0,
            configurable: !0
        });
        Object.defineProperty(a.prototype, "bitmapData", {
            get: function () {
                return this._bitmapData
            }, enumerable: !0,
            configurable: !0
        });
        a.prototype._setBitmapData = function (a) {
            var b = c.MainContext.instance.rendererContext.texture_scale_factor;
            this._bitmapData = a;
            this._sourceWidth = a.width;
            this._sourceHeight = a.height;
            this._textureWidth = this._sourceWidth * b;
            this._textureHeight = this._sourceHeight * b;
            this._bitmapWidth = this._textureWidth;
            this._bitmapHeight = this._textureHeight;
            this._offsetX = this._offsetY = this._bitmapX = this._bitmapY = 0
        };
        a.prototype.getPixel32 = function (a, b) {
            return this._bitmapData.getContext("2d").getImageData(a,
                b, 1, 1).data
        };
        return a
    }(c.HashObject);
    c.Texture = d;
    d.prototype.__class__ = "egret.Texture"
})(egret || (egret = {}));
__extends = this.__extends || function (c, d) {
    function b() {
        this.constructor = c
    }
    for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
    b.prototype = d.prototype;
    c.prototype = new b
};
(function (c) {
    var d = function (b) {
        function a() {
            b.call(this);
            this._bitmapData = document.createElement("canvas");
            this.renderContext = c.RendererContext.createRendererContext(this._bitmapData)
        }
        __extends(a, b);
        a.prototype.drawToTexture = function (e) {
            var b = this._bitmapData,
                d = e.getBounds(c.Rectangle.identity);
            if (0 == d.width || 0 == d.height) return c.Logger.warning("egret.RenderTexture#drawToTexture:\u663e\u793a\u5bf9\u8c61\u6d4b\u91cf\u7ed3\u679c\u5bbd\u9ad8\u4e3a0\uff0c\u8bf7\u68c0\u67e5"), !1;
            d.width = Math.floor(d.width);
            d.height = Math.floor(d.height);
            b.width = d.width;
            b.height = d.height;
            this.renderContext._cacheCanvas && (this.renderContext._cacheCanvas.width = d.width, this.renderContext._cacheCanvas.height = d.height);
            a.identityRectangle.width = d.width;
            a.identityRectangle.height = d.height;
            e._worldTransform.identity();
            e.worldAlpha = 1;
            if (e instanceof c.DisplayObjectContainer) {
                var b = e._anchorOffsetX,
                    h = e._anchorOffsetY;
                if (0 != e._anchorX || 0 != e._anchorY) b = e._anchorX * d.width, h = e._anchorY * d.height;
                this._offsetX = d.x + b;
                this._offsetY = d.y +
                    h;
                e._worldTransform.append(1, 0, 0, 1, -this._offsetX, -this._offsetY);
                d = e._children;
                b = 0;
                for (h = d.length; b < h; b++) d[b]._updateTransform()
            }
            d = c.RenderFilter.getInstance();
            b = d._drawAreaList.concat();
            d._drawAreaList.length = 0;
            this.renderContext.clearScreen();
            this.renderContext.onRenderStart();
            this.webGLTexture = null;
            (h = e.mask || e._scrollRect) && this.renderContext.pushMask(h);
            e._render(this.renderContext);
            h && this.renderContext.popMask();
            d.addDrawArea(a.identityRectangle);
            this.renderContext.onRenderFinish();
            d._drawAreaList =
                b;
            this._textureWidth = this._bitmapData.width;
            this._textureHeight = this._bitmapData.height;
            this._sourceWidth = this._textureWidth;
            this._sourceHeight = this._textureHeight;
            return !0
        };
        a.identityRectangle = new c.Rectangle;
        return a
    }(c.Texture);
    c.RenderTexture = d;
    d.prototype.__class__ = "egret.RenderTexture"
})(egret || (egret = {}));
__extends = this.__extends || function (c, d) {
    function b() {
        this.constructor = c
    }
    for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
    b.prototype = d.prototype;
    c.prototype = new b
};
(function (c) {
    var d = function (b) {
        function a() {
            b.call(this);
            this.renderCost = 0;
            this.texture_scale_factor = 1;
            this.profiler = c.Profiler.getInstance()
        }
        __extends(a, b);
        a.prototype.clearScreen = function () {};
        a.prototype.clearRect = function (a, b, c, d) {};
        a.prototype.drawImage = function (a, b, c, d, g, f, k, m, n, p) {
            this.profiler.onDrawImage()
        };
        a.prototype.setTransform = function (a) {};
        a.prototype.setAlpha = function (a, b) {};
        a.prototype.setupFont = function (a, b) {};
        a.prototype.measureText = function (a) {
            return 0
        };
        a.prototype.drawText = function (a,
                                         b, c, d, g, f) {
            this.profiler.onDrawImage()
        };
        a.prototype.strokeRect = function (a, b, c, d, g) {};
        a.prototype.pushMask = function (a) {};
        a.prototype.popMask = function () {};
        a.prototype.onRenderStart = function () {};
        a.prototype.onRenderFinish = function () {};
        a.prototype.setGlobalColorTransform = function (a) {};
        a.createRendererContext = function (a) {
            return null
        };
        a.imageSmoothingEnabled = !0;
        return a
    }(c.HashObject);
    c.RendererContext = d;
    d.prototype.__class__ = "egret.RendererContext"
})(egret || (egret = {}));
(function (c) {
    var d = function () {
        function b() {}
        b.MOUSE = "mouse";
        b.TOUCH = "touch";
        b.mode = "touch";
        return b
    }();
    c.InteractionMode = d;
    d.prototype.__class__ = "egret.InteractionMode"
})(egret || (egret = {}));
__extends = this.__extends || function (c, d) {
    function b() {
        this.constructor = c
    }
    for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
    b.prototype = d.prototype;
    c.prototype = new b
};
(function (c) {
    var d = function (b) {
        function a() {
            b.call(this);
            this._currentTouchTarget = {};
            this.maxTouches = 2;
            this.touchDownTarget = {};
            this.touchingIdentifiers = [];
            this.lastTouchY = this.lastTouchX = -1
        }
        __extends(a, b);
        a.prototype.run = function () {};
        a.prototype.getTouchData = function (a, b, c) {
            var d = this._currentTouchTarget[a];
            null == d && (d = {}, this._currentTouchTarget[a] = d);
            d.stageX = b;
            d.stageY = c;
            d.identifier = a;
            return d
        };
        a.prototype.dispatchEvent = function (a, b) {
            c.TouchEvent.dispatchTouchEvent(b.target, a, b.identifier, b.stageX,
                b.stageY, !1, !1, !1, !0 == this.touchDownTarget[b.identifier])
        };
        a.prototype.onTouchBegan = function (a, b, d) {
            if (this.touchingIdentifiers.length != this.maxTouches) {
                var h = c.MainContext.instance.stage.hitTest(a, b);
                h && (a = this.getTouchData(d, a, b), this.touchDownTarget[d] = !0, a.target = h, a.beginTarget = h, this.dispatchEvent(c.TouchEvent.TOUCH_BEGIN, a));
                this.touchingIdentifiers.push(d)
            }
        };
        a.prototype.onTouchMove = function (a, b, d) {
            if (-1 != this.touchingIdentifiers.indexOf(d) && (a != this.lastTouchX || b != this.lastTouchY)) {
                this.lastTouchX =
                    a;
                this.lastTouchY = b;
                var h = c.MainContext.instance.stage.hitTest(a, b);
                h && (a = this.getTouchData(d, a, b), a.target = h, this.dispatchEvent(c.TouchEvent.TOUCH_MOVE, a))
            }
        };
        a.prototype.onTouchEnd = function (a, b, d) {
            var h = this.touchingIdentifiers.indexOf(d); - 1 != h && (this.touchingIdentifiers.splice(h, 1), h = c.MainContext.instance.stage.hitTest(a, b)) && (a = this.getTouchData(d, a, b), delete this.touchDownTarget[d], d = a.beginTarget, a.target = h, this.dispatchEvent(c.TouchEvent.TOUCH_END, a), d == h ? this.dispatchEvent(c.TouchEvent.TOUCH_TAP,
                a) : a.beginTarget && (a.target = a.beginTarget, this.dispatchEvent(c.TouchEvent.TOUCH_RELEASE_OUTSIDE, a)), delete this._currentTouchTarget[a.identifier])
        };
        return a
    }(c.HashObject);
    c.TouchContext = d;
    d.prototype.__class__ = "egret.TouchContext"
})(egret || (egret = {}));
__extends = this.__extends || function (c, d) {
    function b() {
        this.constructor = c
    }
    for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
    b.prototype = d.prototype;
    c.prototype = new b
};
(function (c) {
    var d = function (b) {
        function a() {
            b.call(this)
        }
        __extends(a, b);
        a.prototype.proceed = function (a) {};
        a._getUrl = function (a) {
            var b = a.url; - 1 == b.indexOf("?") && a.method == c.URLRequestMethod.GET && a.data && a.data instanceof c.URLVariables && (b = b + "?" + a.data.toString());
            return b
        };
        a.prototype.getChangeList = function () {
            return []
        };
        return a
    }(c.HashObject);
    c.NetContext = d;
    d.prototype.__class__ = "egret.NetContext"
})(egret || (egret = {}));
__extends = this.__extends || function (c, d) {
    function b() {
        this.constructor = c
    }
    for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
    b.prototype = d.prototype;
    c.prototype = new b
};
(function (c) {
    var d = function (b) {
        function a() {
            b.call(this);
            this.frameRate = 60
        }
        __extends(a, b);
        a.prototype.executeMainLoop = function (a, b) {};
        return a
    }(c.HashObject);
    c.DeviceContext = d;
    d.prototype.__class__ = "egret.DeviceContext"
})(egret || (egret = {}));
(function (c) {
    var d = function () {
        function b() {}
        b.call = function (a, e) {};
        b.addCallback = function (a, e) {};
        return b
    }();
    c.ExternalInterface = d;
    d.prototype.__class__ = "egret.ExternalInterface"
})(egret || (egret = {}));
__extends = this.__extends || function (c, d) {
    function b() {
        this.constructor = c
    }
    for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
    b.prototype = d.prototype;
    c.prototype = new b
};
(function (c) {
    var d = function (b) {
        function a() {
            b.call(this);
            this.ua = navigator.userAgent.toLowerCase();
            this.trans = this._getTrans()
        }
        __extends(a, b);
        a.getInstance = function () {
            null == a.instance && (a.instance = new a);
            return a.instance
        };
        Object.defineProperty(a.prototype, "isMobile", {
            get: function () {
                c.Logger.warning("Browser.isMobile\u63a5\u53e3\u53c2\u6570\u5df2\u7ecf\u53d8\u66f4\uff0c\u8bf7\u5c3d\u5feb\u8c03\u6574\u7528\u6cd5\u4e3a egret.MainContext.deviceType == egret.MainContext.DEVICE_MOBILE ");
                return c.MainContext.deviceType ==
                    c.MainContext.DEVICE_MOBILE
            }, enumerable: !0,
            configurable: !0
        });
        a.prototype._getHeader = function (a) {
            if ("transform" in a) return "";
            for (var b = ["webkit", "ms", "Moz", "O"], c = 0; c < b.length; c++)
                if (b[c] + "Transform" in a) return b[c];
            return ""
        };
        a.prototype._getTrans = function () {
            var a = document.createElement("div").style,
                a = this._getHeader(a);
            return "" == a ? "transform" : a + "Transform"
        };
        a.prototype.$new = function (a) {
            return this.$(document.createElement(a))
        };
        a.prototype.$ = function (e) {
            var b = document;
            if (e = e instanceof HTMLElement ?
                e : b.querySelector(e)) e.find = e.find || this.$, e.hasClass = e.hasClass || function (a) {
                return this.className.match(new RegExp("(\\s|^)" + a + "(\\s|$)"))
            }, e.addClass = e.addClass || function (a) {
                this.hasClass(a) || (this.className && (this.className += " "), this.className += a);
                return this
            }, e.removeClass = e.removeClass || function (a) {
                this.hasClass(a) && (this.className = this.className.replace(a, ""));
                return this
            }, e.remove = e.remove || function () {}, e.appendTo = e.appendTo || function (a) {
                a.appendChild(this);
                return this
            }, e.prependTo = e.prependTo ||
                function (a) {
                    a.childNodes[0] ? a.insertBefore(this, a.childNodes[0]) : a.appendChild(this);
                    return this
                }, e.transforms = e.transforms || function () {
                this.style[a.getInstance().trans] = a.getInstance().translate(this.position) + a.getInstance().rotate(this.rotation) + a.getInstance().scale(this.scale) + a.getInstance().skew(this.skew);
                return this
            }, e.position = e.position || {
                x: 0,
                y: 0
            }, e.rotation = e.rotation || 0, e.scale = e.scale || {
                x: 1,
                y: 1
            }, e.skew = e.skew || {
                x: 0,
                y: 0
            }, e.translates = function (a, e) {
                this.position.x = a;
                this.position.y = e -
                    c.MainContext.instance.stage.stageHeight;
                this.transforms();
                return this
            }, e.rotate = function (a) {
                this.rotation = a;
                this.transforms();
                return this
            }, e.resize = function (a, e) {
                this.scale.x = a;
                this.scale.y = e;
                this.transforms();
                return this
            }, e.setSkew = function (a, e) {
                this.skew.x = a;
                this.skew.y = e;
                this.transforms();
                return this
            };
            return e
        };
        a.prototype.translate = function (a) {
            return "translate(" + a.x + "px, " + a.y + "px) "
        };
        a.prototype.rotate = function (a) {
            return "rotate(" + a + "deg) "
        };
        a.prototype.scale = function (a) {
            return "scale(" + a.x + ", " +
                a.y + ") "
        };
        a.prototype.skew = function (a) {
            return "skewX(" + -a.x + "deg) skewY(" + a.y + "deg)"
        };
        return a
    }(c.HashObject);
    c.Browser = d;
    d.prototype.__class__ = "egret.Browser"
})(egret || (egret = {}));
(function (c) {
    (function (c) {
        c.getItem = function (b) {
            return null
        };
        c.setItem = function (b, a) {
            return !1
        };
        c.removeItem = function (b) {};
        c.clear = function () {}
    })(c.localStorage || (c.localStorage = {}))
})(egret || (egret = {}));
(function (c) {
    var d = function () {
        function b() {}
        b.parse = function (a) {
            a = c.SAXParser.getInstance().parserXML(a);
            if (!a || !a.childNodes) return null;
            for (var e = a.childNodes.length, d = !1, q = 0; q < e; q++) {
                var h = a.childNodes[q];
                if (1 == h.nodeType) {
                    d = !0;
                    break
                }
            }
            return d ? b.parseNode(h) : null
        };
        b.parseNode = function (a) {
            if (!a || 1 != a.nodeType) return null;
            var e = {};
            e.localName = a.localName;
            e.name = a.nodeName;
            a.namespaceURI && (e.namespace = a.namespaceURI);
            a.prefix && (e.prefix = a.prefix);
            for (var c = a.attributes, d = c.length, h = 0; h < d; h++) {
                var g =
                        c[h],
                    f = g.name;
                0 != f.indexOf("xmlns:") && (e["$" + f] = g.value)
            }
            c = a.childNodes;
            d = c.length;
            for (h = 0; h < d; h++)
                if (g = b.parseNode(c[h])) e.children || (e.children = []), g.parent = e, e.children.push(g);
            !e.children && (a = a.textContent.trim()) && (e.text = a);
            return e
        };
        b.findChildren = function (a, e, c) {
            c ? c.length = 0 : c = [];
            b.findByPath(a, e, c);
            return c
        };
        b.findByPath = function (a, e, c) {
            var d = e.indexOf("."),
                h; - 1 == d ? (h = e, d = !0) : (h = e.substring(0, d), e = e.substring(d + 1), d = !1);
            if (a = a.children)
                for (var g = a.length, f = 0; f < g; f++) {
                    var k = a[f];
                    k.localName ==
                    h && (d ? c.push(k) : b.findByPath(k, e, c))
                }
        };
        b.getAttributes = function (a, e) {
            e ? e.length = 0 : e = [];
            for (var b in a) "$" == b.charAt(0) && e.push(b.substring(1));
            return e
        };
        return b
    }();
    c.XML = d;
    d.prototype.__class__ = "egret.XML"
})(egret || (egret = {}));
(function (c) {
    var d = function () {
        function a() {}
        a.LITTLE_ENDIAN = "LITTLE_ENDIAN";
        a.BIG_ENDIAN = "BIG_ENDIAN";
        return a
    }();
    c.Endian = d;
    d.prototype.__class__ = "egret.Endian";
    var b = function () {
        function a() {
            this.length = this.position = 0;
            this._mode = "";
            this.maxlength = 0;
            this._endian = d.LITTLE_ENDIAN;
            this.isLittleEndian = !1;
            this._mode = "Typed array";
            this.maxlength = 4;
            this.arraybytes = new ArrayBuffer(this.maxlength);
            this.unalignedarraybytestemp = new ArrayBuffer(16);
            this.endian = a.DEFAULT_ENDIAN
        }
        Object.defineProperty(a.prototype,
            "endian", {
                get: function () {
                    return this._endian
                }, set: function (a) {
                    this._endian = a;
                    this.isLittleEndian = a == d.LITTLE_ENDIAN
                }, enumerable: !0,
                configurable: !0
            });
        a.prototype.ensureWriteableSpace = function (a) {
            this.ensureSpace(a + this.position)
        };
        a.prototype.setArrayBuffer = function (a) {
            this.ensureSpace(a.byteLength);
            this.length = a.byteLength;
            a = new Int8Array(a);
            (new Int8Array(this.arraybytes, 0, this.length)).set(a);
            this.position = 0
        };
        Object.defineProperty(a.prototype, "bytesAvailable", {
            get: function () {
                return this.length - this.position
            },
            enumerable: !0,
            configurable: !0
        });
        a.prototype.ensureSpace = function (a) {
            if (a > this.maxlength) {
                a = a + 255 & -256;
                var b = new ArrayBuffer(a),
                    c = new Uint8Array(this.arraybytes, 0, this.length);
                (new Uint8Array(b, 0, this.length)).set(c);
                this.arraybytes = b;
                this.maxlength = a
            }
        };
        a.prototype.writeByte = function (a) {
            this.ensureWriteableSpace(1);
            (new Int8Array(this.arraybytes))[this.position++] = ~~a;
            this.position > this.length && (this.length = this.position)
        };
        a.prototype.readByte = function () {
            if (this.position >= this.length) throw "ByteArray out of bounds read. Positon=" +
            this.position + ", Length=" + this.length;
            return (new Int8Array(this.arraybytes))[this.position++]
        };
        a.prototype.readBytes = function (a, b, c) {
            void 0 === b && (b = 0);
            void 0 === c && (c = 0);
            null == c && (c = a.length);
            a.ensureWriteableSpace(b + c);
            var d = new Int8Array(a.arraybytes),
                g = new Int8Array(this.arraybytes);
            d.set(g.subarray(this.position, this.position + c), b);
            this.position += c;
            c + b > a.length && (a.length += c + b - a.length)
        };
        a.prototype.writeUnsignedByte = function (a) {
            this.ensureWriteableSpace(1);
            (new Uint8Array(this.arraybytes))[this.position++] = ~~a & 255;
            this.position > this.length && (this.length = this.position)
        };
        a.prototype.readUnsignedByte = function () {
            if (this.position >= this.length) throw "ByteArray out of bounds read. Positon=" + this.position + ", Length=" + this.length;
            return (new Uint8Array(this.arraybytes))[this.position++]
        };
        a.prototype.writeUnsignedShort = function (a) {
            this.ensureWriteableSpace(2);
            if (0 == (this.position & 1)) {
                var b = new Uint16Array(this.arraybytes);
                b[this.position >> 1] = ~~a & 65535
            } else b = new Uint16Array(this.unalignedarraybytestemp, 0, 1), b[0] = ~~a & 65535, a = new Uint8Array(this.arraybytes, this.position, 2), b = new Uint8Array(this.unalignedarraybytestemp, 0, 2), a.set(b);
            this.position += 2;
            this.position > this.length && (this.length = this.position)
        };
        a.prototype.readUTFBytes = function (a) {
            var b = "";
            a = this.position + a;
            for (var c = new DataView(this.arraybytes); this.position < a;) {
                var d = c.getUint8(this.position++);
                if (128 > d) {
                    if (0 == d) break;
                    b += String.fromCharCode(d)
                } else if (224 > d) b += String.fromCharCode((d & 63) << 6 | c.getUint8(this.position++) & 127);
                else if (240 > d) var g = c.getUint8(this.position++),
                    b = b + String.fromCharCode((d & 31) << 12 | (g & 127) << 6 | c.getUint8(this.position++) & 127);
                else var g = c.getUint8(this.position++),
                        f = c.getUint8(this.position++),
                        b = b + String.fromCharCode((d & 15) << 18 | (g & 127) << 12 | f << 6 & 127 | c.getUint8(this.position++) & 127)
            }
            return b
        };
        a.prototype.readInt = function () {
            var a = (new DataView(this.arraybytes)).getInt32(this.position, this.isLittleEndian);
            this.position += 4;
            return a
        };
        a.prototype.readShort = function () {
            var a = (new DataView(this.arraybytes)).getInt16(this.position, this.isLittleEndian);
            this.position += 2;
            return a
        };
        a.prototype.readDouble = function () {
            var a = (new DataView(this.arraybytes)).getFloat64(this.position, this.isLittleEndian);
            this.position += 8;
            return a
        };
        a.prototype.readUnsignedShort = function () {
            if (this.position > this.length + 2) throw "ByteArray out of bounds read. Position=" + this.position + ", Length=" + this.length;
            if (0 == (this.position & 1)) {
                var a = new Uint16Array(this.arraybytes),
                    b = this.position >> 1;
                this.position += 2;
                return a[b]
            }
            a = new Uint16Array(this.unalignedarraybytestemp, 0, 1);
            b = new Uint8Array(this.arraybytes,
                this.position, 2);
            (new Uint8Array(this.unalignedarraybytestemp, 0, 2)).set(b);
            this.position += 2;
            return a[0]
        };
        a.prototype.writeUnsignedInt = function (a) {
            this.ensureWriteableSpace(4);
            if (0 == (this.position & 3)) {
                var b = new Uint32Array(this.arraybytes);
                b[this.position >> 2] = ~~a & 4294967295
            } else b = new Uint32Array(this.unalignedarraybytestemp, 0, 1), b[0] = ~~a & 4294967295, a = new Uint8Array(this.arraybytes, this.position, 4), b = new Uint8Array(this.unalignedarraybytestemp, 0, 4), a.set(b);
            this.position += 4;
            this.position > this.length &&
            (this.length = this.position)
        };
        a.prototype.readUnsignedInt = function () {
            if (this.position > this.length + 4) throw "ByteArray out of bounds read. Position=" + this.position + ", Length=" + this.length;
            if (0 == (this.position & 3)) {
                var a = new Uint32Array(this.arraybytes),
                    b = this.position >> 2;
                this.position += 4;
                return a[b]
            }
            a = new Uint32Array(this.unalignedarraybytestemp, 0, 1);
            b = new Uint8Array(this.arraybytes, this.position, 4);
            (new Uint8Array(this.unalignedarraybytestemp, 0, 4)).set(b);
            this.position += 4;
            return a[0]
        };
        a.prototype.writeFloat =
            function (a) {
                this.ensureWriteableSpace(4);
                if (0 == (this.position & 3)) {
                    var b = new Float32Array(this.arraybytes);
                    b[this.position >> 2] = a
                } else b = new Float32Array(this.unalignedarraybytestemp, 0, 1), b[0] = a, a = new Uint8Array(this.arraybytes, this.position, 4), b = new Uint8Array(this.unalignedarraybytestemp, 0, 4), a.set(b);
                this.position += 4;
                this.position > this.length && (this.length = this.position)
            };
        a.prototype.readFloat = function () {
            if (this.position > this.length + 4) throw "ByteArray out of bounds read. Positon=" + this.position + ", Length=" +
            this.length;
            if (0 == (this.position & 3)) {
                var a = new Float32Array(this.arraybytes),
                    b = this.position >> 2;
                this.position += 4;
                return a[b]
            }
            a = new Float32Array(this.unalignedarraybytestemp, 0, 1);
            b = new Uint8Array(this.arraybytes, this.position, 4);
            (new Uint8Array(this.unalignedarraybytestemp, 0, 4)).set(b);
            this.position += 4;
            return a[0]
        };
        a.DEFAULT_ENDIAN = d.BIG_ENDIAN;
        return a
    }();
    c.ByteArray = b;
    b.prototype.__class__ = "egret.ByteArray"
})(egret || (egret = {}));
__extends = this.__extends || function (c, d) {
    function b() {
        this.constructor = c
    }
    for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
    b.prototype = d.prototype;
    c.prototype = new b
};
(function (c) {
    var d = function (b) {
        function a(a, c, d) {
            b.call(this);
            this._target = null;
            this.loop = this.ignoreGlobalPause = this._useTicks = !1;
            this._actions = this._steps = this.pluginData = null;
            this.paused = !1;
            this.duration = 0;
            this._prevPos = -1;
            this.position = null;
            this._stepPosition = this._prevPosition = 0;
            this.passive = !1;
            this.initialize(a, c, d)
        }
        __extends(a, b);
        a.get = function (e, b, c, d) {
            void 0 === b && (b = null);
            void 0 === c && (c = null);
            void 0 === d && (d = !1);
            d && a.removeTweens(e);
            return new a(e, b, c)
        };
        a.removeTweens = function (e) {
            if (e.tween_count) {
                for (var b =
                    a._tweens, c = b.length - 1; 0 <= c; c--) b[c]._target == e && (b[c].paused = !0, b.splice(c, 1));
                e.tween_count = 0
            }
        };
        a.pauseTweens = function (a) {
            if (a.tween_count)
                for (var b = c.Tween._tweens, d = b.length - 1; 0 <= d; d--) b[d]._target == a && (b[d].paused = !0)
        };
        a.resumeTweens = function (a) {
            if (a.tween_count)
                for (var b = c.Tween._tweens, d = b.length - 1; 0 <= d; d--) b[d]._target == a && (b[d].paused = !1)
        };
        a.tick = function (e, b) {
            void 0 === b && (b = !1);
            for (var c = a._tweens.concat(), d = c.length - 1; 0 <= d; d--) {
                var g = c[d];
                b && !g.ignoreGlobalPause || g.paused || g.tick(g._useTicks ?
                    1 : e)
            }
        };
        a._register = function (e, b) {
            var d = e._target,
                h = a._tweens;
            if (b) d && (d.tween_count = d.tween_count ? d.tween_count + 1 : 1), h.push(e), a._inited || (c.Ticker.getInstance().register(a.tick, null), a._inited = !0);
            else
                for (d && d.tween_count--, d = h.length; d--;)
                    if (h[d] == e) {
                        h.splice(d, 1);
                        break
                    }
        };
        a.removeAllTweens = function () {
            for (var e = a._tweens, b = 0, c = e.length; b < c; b++) {
                var d = e[b];
                d.paused = !0;
                d._target.tweenjs_count = 0
            }
            e.length = 0
        };
        a.prototype.initialize = function (e, b, c) {
            this._target = e;
            b && (this._useTicks = b.useTicks, this.ignoreGlobalPause =
                b.ignoreGlobalPause, this.loop = b.loop, b.onChange && this.addEventListener("change", b.onChange, b.onChangeObj), b.override && a.removeTweens(e));
            this.pluginData = c || {};
            this._curQueueProps = {};
            this._initQueueProps = {};
            this._steps = [];
            this._actions = [];
            b && b.paused ? this.paused = !0 : a._register(this, !0);
            b && null != b.position && this.setPosition(b.position, a.NONE)
        };
        a.prototype.setPosition = function (a, b) {
            void 0 === b && (b = 1);
            0 > a && (a = 0);
            var c = a,
                d = !1;
            c >= this.duration && (this.loop ? c %= this.duration : (c = this.duration, d = !0));
            if (c == this._prevPos) return d;
            var g = this._prevPos;
            this.position = this._prevPos = c;
            this._prevPosition = a;
            if (this._target)
                if (d) this._updateTargetProps(null, 1);
                else if (0 < this._steps.length) {
                    for (var f = 0, k = this._steps.length; f < k && !(this._steps[f].t > c); f++);
                    f = this._steps[f - 1];
                    this._updateTargetProps(f, (this._stepPosition = c - f.t) / f.d)
                }
            0 != b && 0 < this._actions.length && (this._useTicks ? this._runActions(c, c) : 1 == b && c < g ? (g != this.duration && this._runActions(g, this.duration), this._runActions(0, c, !0)) : this._runActions(g, c));
            d && this.setPaused(!0);
            this.dispatchEventWith("change");
            return d
        };
        a.prototype._runActions = function (a, b, c) {
            void 0 === c && (c = !1);
            var d = a,
                g = b,
                f = -1,
                k = this._actions.length,
                m = 1;
            a > b && (d = b, g = a, f = k, k = m = -1);
            for (;
                (f += m) != k;) {
                b = this._actions[f];
                var n = b.t;
                (n == g || n > d && n < g || c && n == a) && b.f.apply(b.o, b.p)
            }
        };
        a.prototype._updateTargetProps = function (b, c) {
            var d, h, g, f;
            if (b || 1 != c) {
                if (this.passive = !!b.v) return;
                b.e && (c = b.e(c, 0, 1, 1));
                d = b.p0;
                h = b.p1
            } else this.passive = !1, d = h = this._curQueueProps;
            for (var k in this._initQueueProps) {
                null == (g = d[k]) && (d[k] = g = this._initQueueProps[k]);
                null ==
                (f = h[k]) && (h[k] = f = g);
                g = g == f || 0 == c || 1 == c || "number" != typeof g ? 1 == c ? f : g : g + (f - g) * c;
                var m = !1;
                if (f = a._plugins[k])
                    for (var n = 0, p = f.length; n < p; n++) {
                        var r = f[n].tween(this, k, g, d, h, c, !!b && d == h, !b);
                        r == a.IGNORE ? m = !0 : g = r
                    }
                m || (this._target[k] = g)
            }
        };
        a.prototype.setPaused = function (b) {
            this.paused = b;
            a._register(this, !b);
            return this
        };
        a.prototype._cloneProps = function (a) {
            var b = {},
                c;
            for (c in a) b[c] = a[c];
            return b
        };
        a.prototype._addStep = function (a) {
            0 < a.d && (this._steps.push(a), a.t = this.duration, this.duration += a.d);
            return this
        };
        a.prototype._appendQueueProps = function (b) {
            var c, d, h, g, f, k;
            for (k in b)
                if (void 0 === this._initQueueProps[k]) {
                    d = this._target[k];
                    if (c = a._plugins[k])
                        for (h = 0, g = c.length; h < g; h++) d = c[h].init(this, k, d);
                    this._initQueueProps[k] = this._curQueueProps[k] = void 0 === d ? null : d
                }
            for (k in b) {
                d = this._curQueueProps[k];
                if (c = a._plugins[k])
                    for (f = f || {}, h = 0, g = c.length; h < g; h++) c[h].step && c[h].step(this, k, d, b[k], f);
                this._curQueueProps[k] = b[k]
            }
            f && this._appendQueueProps(f);
            return this._curQueueProps
        };
        a.prototype._addAction = function (a) {
            a.t =
                this.duration;
            this._actions.push(a);
            return this
        };
        a.prototype._set = function (a, b) {
            for (var c in a) b[c] = a[c]
        };
        a.prototype.wait = function (a, b) {
            if (null == a || 0 >= a) return this;
            var c = this._cloneProps(this._curQueueProps);
            return this._addStep({
                d: a,
                p0: c,
                p1: c,
                v: b
            })
        };
        a.prototype.to = function (a, b, c) {
            void 0 === c && (c = void 0);
            if (isNaN(b) || 0 > b) b = 0;
            return this._addStep({
                d: b || 0,
                p0: this._cloneProps(this._curQueueProps),
                e: c,
                p1: this._cloneProps(this._appendQueueProps(a))
            })
        };
        a.prototype.call = function (a, b, c) {
            void 0 === b && (b = void 0);
            void 0 === c && (c = void 0);
            return this._addAction({
                f: a,
                p: c ? c : [],
                o: b ? b : this._target
            })
        };
        a.prototype.set = function (a, b) {
            void 0 === b && (b = null);
            return this._addAction({
                f: this._set,
                o: this,
                p: [a, b ? b : this._target]
            })
        };
        a.prototype.play = function (a) {
            a || (a = this);
            return this.call(a.setPaused, a, [!1])
        };
        a.prototype.pause = function (a) {
            a || (a = this);
            return this.call(a.setPaused, a, [!0])
        };
        a.prototype.tick = function (a) {
            this.paused || this.setPosition(this._prevPosition + a)
        };
        a.NONE = 0;
        a.LOOP = 1;
        a.REVERSE = 2;
        a._tweens = [];
        a.IGNORE = {};
        a._plugins = {};
        a._inited = !1;
        return a
    }(c.EventDispatcher);
    c.Tween = d;
    d.prototype.__class__ = "egret.Tween"
})(egret || (egret = {}));