function hex_md5(t) { return binl2hex(core_md5(str2binl(t), t.length * chrsz)); } function b64_md5(t) { return binl2b64(core_md5(str2binl(t), t.length * chrsz)); } function str_md5(t) { return binl2str(core_md5(str2binl(t), t.length * chrsz)); } function hex_hmac_md5(t, e) { return binl2hex(core_hmac_md5(t, e)); } function b64_hmac_md5(t, e) { return binl2b64(core_hmac_md5(t, e)); } function str_hmac_md5(t, e) { return binl2str(core_hmac_md5(t, e)); } function md5_vm_test() { return "900150983cd24fb0d6963f7d28e17f72" == hex_md5("abc"); } function core_md5(t, e) { t[e >> 5] |= 128 << e % 32, t[14 + (e + 64 >>> 9 << 4)] = e; for (var i = 1732584193, n = -271733879, s = -1732584194, a = 271733878, r = 0; r < t.length; r += 16) { var o = i, h = n, l = s, u = a; n = md5_ii(n = md5_ii(n = md5_ii(n = md5_ii(n = md5_hh(n = md5_hh(n = md5_hh(n = md5_hh(n = md5_gg(n = md5_gg(n = md5_gg(n = md5_gg(n = md5_ff(n = md5_ff(n = md5_ff(n = md5_ff(n, s = md5_ff(s, a = md5_ff(a, i = md5_ff(i, n, s, a, t[r + 0], 7, -680876936), n, s, t[r + 1], 12, -389564586), i, n, t[r + 2], 17, 606105819), a, i, t[r + 3], 22, -1044525330), s = md5_ff(s, a = md5_ff(a, i = md5_ff(i, n, s, a, t[r + 4], 7, -176418897), n, s, t[r + 5], 12, 1200080426), i, n, t[r + 6], 17, -1473231341), a, i, t[r + 7], 22, -45705983), s = md5_ff(s, a = md5_ff(a, i = md5_ff(i, n, s, a, t[r + 8], 7, 1770035416), n, s, t[r + 9], 12, -1958414417), i, n, t[r + 10], 17, -42063), a, i, t[r + 11], 22, -1990404162), s = md5_ff(s, a = md5_ff(a, i = md5_ff(i, n, s, a, t[r + 12], 7, 1804603682), n, s, t[r + 13], 12, -40341101), i, n, t[r + 14], 17, -1502002290), a, i, t[r + 15], 22, 1236535329), s = md5_gg(s, a = md5_gg(a, i = md5_gg(i, n, s, a, t[r + 1], 5, -165796510), n, s, t[r + 6], 9, -1069501632), i, n, t[r + 11], 14, 643717713), a, i, t[r + 0], 20, -373897302), s = md5_gg(s, a = md5_gg(a, i = md5_gg(i, n, s, a, t[r + 5], 5, -701558691), n, s, t[r + 10], 9, 38016083), i, n, t[r + 15], 14, -660478335), a, i, t[r + 4], 20, -405537848), s = md5_gg(s, a = md5_gg(a, i = md5_gg(i, n, s, a, t[r + 9], 5, 568446438), n, s, t[r + 14], 9, -1019803690), i, n, t[r + 3], 14, -187363961), a, i, t[r + 8], 20, 1163531501), s = md5_gg(s, a = md5_gg(a, i = md5_gg(i, n, s, a, t[r + 13], 5, -1444681467), n, s, t[r + 2], 9, -51403784), i, n, t[r + 7], 14, 1735328473), a, i, t[r + 12], 20, -1926607734), s = md5_hh(s, a = md5_hh(a, i = md5_hh(i, n, s, a, t[r + 5], 4, -378558), n, s, t[r + 8], 11, -2022574463), i, n, t[r + 11], 16, 1839030562), a, i, t[r + 14], 23, -35309556), s = md5_hh(s, a = md5_hh(a, i = md5_hh(i, n, s, a, t[r + 1], 4, -1530992060), n, s, t[r + 4], 11, 1272893353), i, n, t[r + 7], 16, -155497632), a, i, t[r + 10], 23, -1094730640), s = md5_hh(s, a = md5_hh(a, i = md5_hh(i, n, s, a, t[r + 13], 4, 681279174), n, s, t[r + 0], 11, -358537222), i, n, t[r + 3], 16, -722521979), a, i, t[r + 6], 23, 76029189), s = md5_hh(s, a = md5_hh(a, i = md5_hh(i, n, s, a, t[r + 9], 4, -640364487), n, s, t[r + 12], 11, -421815835), i, n, t[r + 15], 16, 530742520), a, i, t[r + 2], 23, -995338651), s = md5_ii(s, a = md5_ii(a, i = md5_ii(i, n, s, a, t[r + 0], 6, -198630844), n, s, t[r + 7], 10, 1126891415), i, n, t[r + 14], 15, -1416354905), a, i, t[r + 5], 21, -57434055), s = md5_ii(s, a = md5_ii(a, i = md5_ii(i, n, s, a, t[r + 12], 6, 1700485571), n, s, t[r + 3], 10, -1894986606), i, n, t[r + 10], 15, -1051523), a, i, t[r + 1], 21, -2054922799), s = md5_ii(s, a = md5_ii(a, i = md5_ii(i, n, s, a, t[r + 8], 6, 1873313359), n, s, t[r + 15], 10, -30611744), i, n, t[r + 6], 15, -1560198380), a, i, t[r + 13], 21, 1309151649), s = md5_ii(s, a = md5_ii(a, i = md5_ii(i, n, s, a, t[r + 4], 6, -145523070), n, s, t[r + 11], 10, -1120210379), i, n, t[r + 2], 15, 718787259), a, i, t[r + 9], 21, -343485551), i = safe_add(i, o), n = safe_add(n, h), s = safe_add(s, l), a = safe_add(a, u); } return Array(i, n, s, a); } function md5_cmn(t, e, i, n, s, a) { return safe_add(bit_rol(safe_add(safe_add(e, t), safe_add(n, a)), s), i); } function md5_ff(t, e, i, n, s, a, r) { return md5_cmn(e & i | ~e & n, t, e, s, a, r); } function md5_gg(t, e, i, n, s, a, r) { return md5_cmn(e & n | i & ~n, t, e, s, a, r); } function md5_hh(t, e, i, n, s, a, r) { return md5_cmn(e ^ i ^ n, t, e, s, a, r); } function md5_ii(t, e, i, n, s, a, r) { return md5_cmn(i ^ (e | ~n), t, e, s, a, r); } function core_hmac_md5(t, e) { var i = str2binl(t); i.length > 16 && (i = core_md5(i, t.length * chrsz)); for (var n = Array(16), s = Array(16), a = 0; a < 16; a++) n[a] = 909522486 ^ i[a], s[a] = 1549556828 ^ i[a]; var r = core_md5(n.concat(str2binl(e)), 512 + e.length * chrsz); return core_md5(s.concat(r), 640); } function safe_add(t, e) { var i = (65535 & t) + (65535 & e); return (t >> 16) + (e >> 16) + (i >> 16) << 16 | 65535 & i; } function bit_rol(t, e) { return t << e | t >>> 32 - e; } function str2binl(t) { for (var e = Array(), i = (1 << chrsz) - 1, n = 0; n < t.length * chrsz; n += chrsz) e[n >> 5] |= (t.charCodeAt(n / chrsz) & i) << n % 32; return e; } function binl2str(t) { for (var e = "", i = (1 << chrsz) - 1, n = 0; n < 32 * t.length; n += chrsz) e += String.fromCharCode(t[n >> 5] >>> n % 32 & i); return e; } function binl2hex(t) { for (var e = hexcase ? "0123456789ABCDEF" : "0123456789abcdef", i = "", n = 0; n < 4 * t.length; n++) i += e.charAt(t[n >> 2] >> n % 4 * 8 + 4 & 15) + e.charAt(t[n >> 2] >> n % 4 * 8 & 15); return i; } function binl2b64(t) { for (var e = "", i = 0; i < 4 * t.length; i += 3) for (var n = (t[i >> 2] >> i % 4 * 8 & 255) << 16 | (t[i + 1 >> 2] >> (i + 1) % 4 * 8 & 255) << 8 | t[i + 2 >> 2] >> (i + 2) % 4 * 8 & 255, s = 0; s < 4; s++) 8 * i + 6 * s > 32 * t.length ? e += b64pad : e += "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(n >> 6 * (3 - s) & 63); return e; } var instance, hexcase = 0, b64pad = "", chrsz = 8, CPA = function() { function t(t, e) { (instance = this).appid = e, instance.commdata = { openid: t, appid: e }, instance.currentpage = 0, instance.imgbaseurl = "https://h5.joyleafs.com/games/test/moregame/", instance.currentCPAVersion = "online3", instance.CPAdata = null, instance.isrefreshturndata = !0, instance.isOpenCPA = !0, instance.page_lightlist = [], instance.cpa_lightlist = [], instance.cpa_clicklist = [], instance.reportNum = 0, instance.minReportNum = 15, instance.reportTime = 6e4, instance.pagelist = { notice: 1, mainicon: 2, gameover: 3, mainbanner: 3 }, instance.CPAPoslist = { NOTICE: "notice", MAIN: "mainicon", GAMEOVER: "gameover", MAINBANNER: "mainbanner" }, instance.CPATypelist = { ICON: "icon", BANNER: "banner" }, instance.CPAReportdatatype = { CPA_LIGHT: "mg_light", CPA_CLICK: "mg_click", PAGE_LIGHT: "page_light" }, instance.CPAPosDataListCurIndexlist = {}, instance.CPAInit(); } var e = t.prototype; return e.callbackdefault = function(t) { console.log("default callback"); }, e.CPAInit = function() { function t() { var t = {}; t.p_comm = instance.commdata, t.page_light = instance.page_lightlist, t.mg_light = instance.cpa_lightlist, t.mg_click = instance.cpa_clicklist, instance.Post("datareportevent", t, function(t) { instance.reportNum = 0, instance.page_lightlist = [], instance.cpa_lightlist = [], instance.cpa_clicklist = []; }); } Object.keys(instance.CPAPoslist).forEach(function(t) { instance.CPAPosDataListCurIndexlist[instance.CPAPoslist[t]] = 0; }), instance.getCpaByPosConfig(instance.CPAPoslist.LOGIN, function(t) { console.log(t); }), setInterval(function() { instance.reportNum > instance.minReportNum && t(); }, instance.reporttime), wx.onHide(function(e) { t(); }); }, e.getCpaBypos = function(t, e) { void 0 === e && (e = instance.callbackdefault), null != t ? instance.getCpaByPosConfig(t, function(i) { var n = i.length; if (0 != n) { var s = instance.CPAPosDataListCurIndexlist[t], a = i[s]; instance.CPAPosDataListCurIndexlist[t] = s + 1 < n ? s + 1 : 0, instance.adddatatoreportlist(instance.CPAReportdatatype.CPA_LIGHT, { appid: a.appid, posid: t }), e(a); } else console.warn("cpa posid config is null,please check posid or severCPAconfig"); }) : console.warn("cpa posid param can not be null"); }, e.getCpaByPosConfig = function(t, e) { function i() { var e = instance.CPAdata[t], i = instance.CPAdata.addturnlist, n = instance.imgbaseurl, s = []; if (null != e) for (var a = e.adtype, r = e.itemlist, o = r.length, h = 0; h < o; h++) { var l = i[r[h]]; if (null != l) { var u = { appid: l.otherAppId, name: l.otherName, path: l.otherIndexPath, PicUrl: n + l.otherIconUrl }; switch (a) { case instance.CPATypelist.ICON: u.PicUrl = n + l.otherIconUrl; break; case instance.CPATypelist.BANNER: u.PicUrl = n + l.otherBannerUrl; } s.push(u); } } return null == s && (s = []), s; } if (void 0 === e && (e = instance.callbackdefault), instance.isrefreshturndata || null == instance.CPAdata) { if (null == instance.appid) return void console.warn("param appid can not be null"); instance.Get("moregame_turnlist", { appid: instance.appid, version: instance.currentCPAVersion }, function(t) { instance.isrefreshturndata = !1, instance.isOpenCPA = t.data.data.isopen, instance.CPAdata = []; var n = t.data.data; null != n && (instance.CPAdata = n); var s = []; instance.isOpenCPA && (s = i()), e(s); }, function(t) { console.log("network error"); }); } else { var n = []; instance.isOpenCPA && (n = i()), e(n); } }, e.setcurrentpageid = function(t) { t > 0 && t ? (instance.adddatatoreportlist(instance.CPAReportdatatype.PAGE_LIGHT, { pageid: t }), instance.currentpage = t) : console.warn("pageid can not be null"); }, e.adddatatoreportlist = function(t, e) { switch (void 0 === e && (e = {}), t) { case instance.CPAReportdatatype.CPA_LIGHT: if (null == e.posid || null == e.appid) return void console.warn("cpa light data error"); for (var i = !1, n = 0; n < instance.cpa_lightlist.length; n++) { s = instance.cpa_lightlist[n]; if (e.posid == s.p && e.appid == s.p) { instance.cpa_lightlist[n].n++, i = !0; break; } } if (!i) { s = { p: e.posid, k: e.appid, n: 1 }; instance.reportNum++, instance.cpa_lightlist.push(s); } break; case instance.CPAReportdatatype.CPA_CLICK: if (null == e.posid || null == e.appid || null == e.path) return void console.warn("cpa click data error"); s = { turn_appid: e.appid, path: e.path, pos_id: e.posid }; instance.reportNum++, instance.cpa_clicklist.push(s); break; case instance.CPAReportdatatype.PAGE_LIGHT: if (null == e.pageid) return void console.warn("page light data error"); for (var i = !1, n = 0; n < instance.page_lightlist.length; n++) { s = instance.page_lightlist[n]; if (e.pageid == s.k) { instance.page_lightlist[n].v++, i = !0; break; } } if (!i) { var s = { k: e.pageid, v: 1 }; instance.reportNum++, instance.page_lightlist.push(s); } } }, e.CPATurn = function(t) { var e = t.appid, i = void 0 === e ? "" : e, n = t.path, s = void 0 === n ? "" : n, a = t.posid, r = void 0 === a ? "0" : a, o = t.callback, h = void 0 === o ? function(t) { console.log("cpa turn", t); } : o, l = { appId: i, path: s, extraData: "", success: function(t) { instance.adddatatoreportlist(instance.CPAReportdatatype.CPA_CLICK, { appid: i, path: s, posid: r }), h(!0); }, fail: function(t) { h(!1); } }; wx.navigateToMiniProgram(l); }, e.Get = function(t, e, i, n) { void 0 === i && (i = instance.callbackdefault), void 0 === n && (n = instance.callbackdefault), e.channel = "wx"; var s = instance.getpart(t); wx.request({ url: s, data: e, method: "GET", dataType: "json", success: function(t) { i(t); }, fail: function(t) { n(t); } }); }, e.Post = function(t, e, i, n) { void 0 === i && (i = instance.callbackdefault), void 0 === n && (n = instance.callbackdefault); var s = instance.getpart(t); e.channel = "wx", wx.request({ url: s, data: e, method: "POST", dataType: "json", success: function(t) { 200 == t.statusCode ? i(t) : n(t); }, fail: function(t) { n(t); } }); }, e.getpart = function(t) { return "https://h5.joyleafs.com/games/" + { datareportevent: "mudgo_php/view/xyx_cpaReport.php", moregame_turnlist: "mudgo_php/view/xyx_getmoregameturn.php" }[t]; }, t; }(); "undefined" != typeof wx && (window.CPA = CPA); var Laya = window.Laya = function(t, e) { var i = { __internals: [], __packages: {}, __classmap: { Object: Object, Function: Function, Array: Array, String: String }, __sysClass: { object: "Object", array: "Array", string: "String", dictionary: "Dictionary" }, __propun: { writable: !0, enumerable: !1, configurable: !0 }, __presubstr: String.prototype.substr, __substr: function(t, e) { return 1 == arguments.length ? i.__presubstr.call(this, t) : i.__presubstr.call(this, t, e > 0 ? e : this.length + e); }, __init: function(t) { t.forEach(function(t) { t.__init$ && t.__init$(); }); }, __isClass: function(t) { return t && (t.__isclass || t == Object || t == String || t == Array); }, __newvec: function(t, e) { var i = []; i.length = t; for (var n = 0; n < t; n++) i[n] = e; return i; }, __extend: function(t, e) { function n() { i.un(this, "constructor", t); } for (var s in e) if (e.hasOwnProperty(s)) { var a = Object.getOwnPropertyDescriptor(e, s), r = a.get, o = a.set; r || o ? r && o ? Object.defineProperty(t, s, a) : (r && Object.defineProperty(t, s, r), o && Object.defineProperty(t, s, o)) : t[s] = e[s]; } n.prototype = e.prototype, t.prototype = new n(), i.un(t.prototype, "__imps", i.__copy({}, e.prototype.__imps)); }, __copy: function(t, e) { if (!e) return null; t = t || {}; for (var i in e) t[i] = e[i]; return t; }, __package: function(e, n) { if (!i.__packages[e]) { i.__packages[e] = !0; var s = t, a = e.split("."); if (a.length > 1) for (var r = 0, o = a.length - 1; r < o; r++) { var h = s[a[r]]; s = h || (s[a[r]] = {}); } s[a[a.length - 1]] || (s[a[a.length - 1]] = n || {}); } }, __hasOwnProperty: function(t, e) { function i(t, e) { if (Object.hasOwnProperty.call(e.prototype, t)) return !0; var n = e.prototype.__super; return null == n ? null : i(t, n); } return e = e || this, Object.hasOwnProperty.call(e, t) || i(t, e.__class); }, __typeof: function(t, e) { if (!t || !e) return !1; if (e === String) return "string" == typeof t; if (e === Number) return "number" == typeof t; if (e.__interface__) e = e.__interface__; else if ("string" != typeof e) return t instanceof e; return t.__imps && t.__imps[e] || t.__class == e; }, __as: function(t, e) { return this.__typeof(t, e) ? t : null; }, __int: function(t) { return t ? parseInt(t) : 0; }, interface: function(e, n) { i.__package(e, {}); var s = i.__internals, a = s[e] = s[e] || { self: e }; if (n) { var r = n.split(","); a.extend = []; for (u = 0; u < r.length; u++) { var o = r[u]; s[o] = s[o] || { self: o }, a.extend.push(s[o]); } } for (var h = t, l = e.split("."), u = 0; u < l.length - 1; u++) h = h[l[u]]; h[l[l.length - 1]] = { __interface__: e }; }, class: function(e, n, s, a) { if (s && i.__extend(e, s), n) if (i.__package(n, e), i.__classmap[n] = e, n.indexOf(".") > 0) { if (0 == n.indexOf("laya.")) { var r = n.split("."); a = a || r[r.length - 1], i[a] && console.log("Warning!,this class[" + a + "] already exist:", i[a]), i[a] = e; } } else "Main" == n ? t.Main = e : (i[n] && console.log("Error!,this class[" + n + "] already exist:", i[n]), i[n] = e); var o = i.un, h = e.prototype; o(h, "hasOwnProperty", i.__hasOwnProperty), o(h, "__class", e), o(h, "__super", s), o(h, "__className", n), o(e, "__super", s), o(e, "__className", n), o(e, "__isclass", !0), o(e, "super", function(t) { this.__super.call(t); }); }, imps: function(t, e) { function n(t) { var e, a; if ((e = i.__internals[t]) && (s[t] = !0, a = e.extend)) for (var r = 0; r < a.length; r++) n(a[r].self); } if (!e) return null; var s = t.__imps || i.un(t, "__imps", {}); for (var a in e) n(a); }, superSet: function(t, e, i, n) { var s = t.prototype["_$set_" + i]; s && s.call(e, n); }, superGet: function(t, e, i) { var n = t.prototype["_$get_" + i]; return n ? n.call(e) : null; }, getset: function(t, e, n, s, a) { t ? (s && (e["_$GET_" + n] = s), a && (e["_$SET_" + n] = a)) : (s && i.un(e, "_$get_" + n, s), a && i.un(e, "_$set_" + n, a)), s && a ? Object.defineProperty(e, n, { get: s, set: a, enumerable: !1, configurable: !0 }) : (s && Object.defineProperty(e, n, { get: s, enumerable: !1, configurable: !0 }), a && Object.defineProperty(e, n, { set: a, enumerable: !1, configurable: !0 })); }, static: function(t, e) { for (var i = 0, n = e.length; i < n; i += 2) "length" == e[i] ? t.length = e[i + 1].call(t) : function() { var n = e[i], s = e[i + 1]; Object.defineProperty(t, n, { get: function() { return delete this[n], this[n] = s.call(this); }, set: function(t) { delete this[n], this[n] = t; }, enumerable: !0, configurable: !0 }); }(); }, un: function(t, e, n) { return n || (n = t[e]), i.__propun.value = n, Object.defineProperty(t, e, i.__propun), n; }, uns: function(t, e) { e.forEach(function(e) { i.un(t, e); }); } }; return t.console = t.console || { log: function() {} }, t.trace = t.console.log, Error.prototype.throwError = function() { throw arguments; }, Object.defineProperty(Array.prototype, "fixed", { enumerable: !1 }), i; }(window, document); !function(t, e, i) { i.un, i.uns, i.static, i.class, i.getset, i.__newvec; }(window, document, Laya), function(t, e, i) { i.un, i.uns; var n = i.static, s = i.class, a = i.getset; i.__newvec; i.interface("laya.runtime.IMarket"), i.interface("laya.filters.IFilter"), i.interface("laya.display.ILayout"), i.interface("laya.resource.IDispose"), i.interface("laya.runtime.IPlatform"), i.interface("laya.resource.IDestroy"), i.interface("laya.runtime.IConchNode"), i.interface("laya.filters.IFilterAction"), i.interface("laya.runtime.ICPlatformClass"), i.interface("laya.resource.ICreateResource"), i.interface("laya.runtime.IConchRenderObject"), i.interface("laya.runtime.IPlatformClass", "laya.runtime.IPlatform"); var r = function() { function e() {} return s(e, "laya.utils.RunDriver"), e.FILTER_ACTIONS = [], e.pixelRatio = -1, e._charSizeTestDiv = null, e.now = function() { return Date.now(); }, e.getWindow = function() { return t; }, e.getPixelRatio = function() { if (e.pixelRatio < 0) { var t = B.context, i = t.backingStorePixelRatio || t.webkitBackingStorePixelRatio || t.mozBackingStorePixelRatio || t.msBackingStorePixelRatio || t.oBackingStorePixelRatio || t.backingStorePixelRatio || 1; (e.pixelRatio = (B.window.devicePixelRatio || 1) / i) < 1 && (e.pixelRatio = 1); } return e.pixelRatio; }, e.getIncludeStr = function(t) { return null; }, e.createShaderCondition = function(t) { var e = "(function() {return " + t + ";})"; return i._runScript(e); }, e.fontMap = [], e.measureText = function(t, i) { var n = e.hanzi.test(t); if (n && e.fontMap[i]) return e.fontMap[i]; var s = B.context; s.font = i; var a = s.measureText(t); return n && (e.fontMap[i] = a), a; }, e.getWebGLContext = function(t) {}, e.beginFlush = function() {}, e.endFinish = function() {}, e.addToAtlas = null, e.flashFlushImage = function(t) {}, e.drawToCanvas = function(t, e, i, n, s, a) { var r = yt.create("2D"), o = new R(i, n, r); return D.renders[e]._fun(t, o, s, a), r; }, e.createParticleTemplate2D = null, e.createGLTextur = null, e.createWebGLContext2D = null, e.changeWebGLSize = function(t, e) {}, e.createRenderSprite = function(t, e) { return new D(t, e); }, e.createFilterAction = function(t) { return new b(); }, e.createGraphics = function() { return new p(); }, e.clear = function(t) { k._context.ctx.clear(); }, e.cancelLoadByUrl = function(t) {}, e.clearAtlas = function(t) {}, e.isAtlas = function(t) { return !1; }, e.addTextureToAtlas = function(t) {}, e.getTexturePixels = function(t, e, i, n, s) { return null; }, e.skinAniSprite = function() { return null; }, e.update3DLoop = function() {}, n(e, [ "hanzi", function() { return this.hanzi = new RegExp("^[一-龥]$"); } ]), e; }(), o = (a(1, i, "alertGlobalError", null, function(t) { var e = 0; B.window.onerror = t ? function(t, i, n, s, a) { e++ < 5 && a && alert("出错啦,请把此信息截图给研发商\n" + t + "\n" + a.stack || a); } : null; }), i.init = function(t, e, n) { for (var s = [], a = 2, r = arguments.length; a < r; a++) s.push(arguments[a]); if (!i._isinit) { ArrayBuffer.prototype.slice || (ArrayBuffer.prototype.slice = i._arrayBufferSlice), i._isinit = !0, B.__init__(), N.__init__(), p.__init__(), i.timer = new j(), i.scaleTimer = new j(), i.loader = new ot(), Z.__init__(); for (var a = 0, o = s.length; a < o; a++) s[a].enable && s[a].enable(); return _.__init__(), c.__init__(), F.__init__(), z.beginCheck(), i._currentStage = i.stage = new mt(), i.stage.conchModel && i.stage.conchModel.setRootNode(), i._getUrlPath(), i.render = new k(0, 0), i.stage.size(t, e), D.__init__(), m.__init__(), v.instance.__init__(i.stage, k.canvas), bt.__init__(), E.autoStopMusic = !0, A.__init__(), k.canvas; } }, i._getUrlPath = function() { var t = B.window.location, e = t.pathname; e = ":" == e.charAt(2) ? e.substring(1) : e, P.rootPath = P.basePath = P.getPath("file:" == t.protocol ? e : t.protocol + "//" + t.host + t.pathname); }, i._arrayBufferSlice = function(t, e) { var i = new Uint8Array(this, t, e - t), n = new Uint8Array(i.length); return n.set(i), n.buffer; }, i._runScript = function(t) { return B.window[i._evcode](t); }, i.stage = null, i.timer = null, i.scaleTimer = null, i.loader = null, i.version = "1.8.4", i.render = null, i._currentStage = null, i._isinit = !1, i.MiniAdpter = { init: function() { t.navigator && t.navigator.userAgent && t.navigator.userAgent.indexOf("MiniGame") > -1 && console.error("请先引用小游戏适配库laya.wxmini.js,详细教程:https://ldc.layabox.com/doc/?nav=zh-ts-5-0-0"); } }, n(i, [ "conchMarket", function() { return this.conchMarket = t.conch ? conchMarket : null; }, "PlatformClass", function() { return this.PlatformClass = t.PlatformClass; }, "_evcode", function() { return this._evcode = "e" + String.fromCharCode(118) + "al"; } ]), function() { function t() {} return s(t, "Config"), t.WebGLTextCacheCount = 500, t.atlasEnable = !1, t.showCanvasMark = !1, t.animationInterval = 50, t.isAntialias = !1, t.isAlpha = !1, t.premultipliedAlpha = !0, t.isStencil = !0, t.preserveDrawingBuffer = !1, t.useRetinalCanvas = !1, t.CborderSize = 12, t; }()), h = function() { function t() { this._events = null; } var e; s(t, "laya.events.EventDispatcher"); var i = t.prototype; return i.hasListener = function(t) { return !!(this._events && this._events[t]); }, i.event = function(t, e) { if (!this._events || !this._events[t]) return !1; var i = this._events[t]; if (i.run) i.once && delete this._events[t], null != e ? i.runWith(e) : i.run(); else { for (var n = 0, s = i.length; n < s; n++) { var a = i[n]; a && (null != e ? a.runWith(e) : a.run()), a && !a.once || (i.splice(n, 1), n--, s--); } 0 === i.length && this._events && delete this._events[t]; } return !0; }, i.on = function(t, e, i, n) { return this._createListener(t, e, i, n, !1); }, i.once = function(t, e, i, n) { return this._createListener(t, e, i, n, !0); }, i._createListener = function(t, i, n, s, a, r) { void 0 === r && (r = !0), r && this.off(t, i, n, a); var o = e.create(i || this, n, s, a); this._events || (this._events = {}); var h = this._events; return h[t] ? h[t].run ? h[t] = [ h[t], o ] : h[t].push(o) : h[t] = o, this; }, i.off = function(t, e, i, n) { if (void 0 === n && (n = !1), !this._events || !this._events[t]) return this; var s = this._events[t]; if (null != s) if (s.run) e && s.caller !== e || s.method !== i || n && !s.once || (delete this._events[t], s.recover()); else { for (var a = 0, r = 0, o = s.length; r < o; r++) { var h = s[r]; h ? !h || e && h.caller !== e || h.method !== i || n && !h.once || (a++, s[r] = null, h.recover()) : a++; } a === o && delete this._events[t]; } return this; }, i.offAll = function(t) { var e = this._events; if (!e) return this; if (t) this._recoverHandlers(e[t]), delete e[t]; else { for (var i in e) this._recoverHandlers(e[i]); this._events = null; } return this; }, i._recoverHandlers = function(t) { if (t) if (t.run) t.recover(); else for (var e = t.length - 1; e > -1; e--) t[e] && (t[e].recover(), t[e] = null); }, i.isMouseEvent = function(e) { return t.MOUSE_EVENTS[e]; }, t.MOUSE_EVENTS = { rightmousedown: !0, rightmouseup: !0, rightclick: !0, mousedown: !0, mouseup: !0, mousemove: !0, mouseover: !0, mouseout: !0, click: !0, doubleclick: !0 }, t.__init$ = function() { Object.defineProperty(laya.events.EventDispatcher.prototype, "_events", { enumerable: !1, writable: !0 }), e = function(t) { function e(t, i, n, s) { e.__super.call(this, t, i, n, s); } s(e, "", l); return e.prototype.recover = function() { this._id > 0 && (this._id = 0, e._pool.push(this.clear())); }, e.create = function(t, i, n, s) { return void 0 === s && (s = !0), e._pool.length ? e._pool.pop().setTo(t, i, n, s) : new e(t, i, n, s); }, e._pool = [], e; }(); }, t; }(), l = function() { function t(t, e, i, n) { this.once = !1, this._id = 0, void 0 === n && (n = !1), this.setTo(t, e, i, n); } s(t, "laya.utils.Handler"); var e = t.prototype; return e.setTo = function(e, i, n, s) { return this._id = t._gid++, this.caller = e, this.method = i, this.args = n, this.once = s, this; }, e.run = function() { if (null == this.method) return null; var t = this._id, e = this.method.apply(this.caller, this.args); return this._id === t && this.once && this.recover(), e; }, e.runWith = function(t) { if (null == this.method) return null; var e = this._id; if (null == t) var i = this.method.apply(this.caller, this.args); else i = this.args || t.unshift ? this.args ? this.method.apply(this.caller, this.args.concat(t)) : this.method.apply(this.caller, t) : this.method.call(this.caller, t); return this._id === e && this.once && this.recover(), i; }, e.clear = function() { return this.caller = null, this.method = null, this.args = null, this; }, e.recover = function() { this._id > 0 && (this._id = 0, t._pool.push(this.clear())); }, t.create = function(e, i, n, s) { return void 0 === s && (s = !0), t._pool.length ? t._pool.pop().setTo(e, i, n, s) : new t(e, i, n, s); }, t._pool = [], t._gid = 1, t; }(), u = function() { function t() { this._texture = null, this._fontCharDic = {}, this._fontWidthMap = {}, this._complete = null, this._path = null, this._maxWidth = 0, this._spaceWidth = 10, this._padding = null, this.fontSize = 12, this.autoScaleSize = !1, this.letterSpacing = 0; } s(t, "laya.display.BitmapFont"); var e = t.prototype; return e.loadFont = function(t, e) { this._path = t, this._complete = e, i.loader.load([ { url: this._path, type: "xml" }, { url: this._path.replace(".fnt", ".png"), type: "image" } ], l.create(this, this.onLoaded)); }, e.onLoaded = function() { this.parseFont(rt.getRes(this._path), rt.getRes(this._path.replace(".fnt", ".png"))), this._complete && this._complete.runWith(this._texture ? this : null); }, e.parseFont = function(t, e) { if (null != t && null != e) { this._texture = e; var i = t.getElementsByTagName("info"); if (!i[0].getAttributeNode) return this.parseFont2(t, e); this.fontSize = parseInt(i[0].getAttributeNode("size").nodeValue); var n = i[0].getAttributeNode("padding").nodeValue.split(","); this._padding = [ parseInt(n[0]), parseInt(n[1]), parseInt(n[2]), parseInt(n[3]) ]; var s; s = t.getElementsByTagName("char"); var a = 0; for (a = 0; a < s.length; a++) { var r = s[a], o = parseInt(r.getAttributeNode("id").nodeValue), h = parseInt(r.getAttributeNode("xoffset").nodeValue) / 1, l = parseInt(r.getAttributeNode("yoffset").nodeValue) / 1, u = parseInt(r.getAttributeNode("xadvance").nodeValue) / 1, c = new M(); c.x = parseInt(r.getAttributeNode("x").nodeValue), c.y = parseInt(r.getAttributeNode("y").nodeValue), c.width = parseInt(r.getAttributeNode("width").nodeValue), c.height = parseInt(r.getAttributeNode("height").nodeValue); var _ = lt.create(e, c.x, c.y, c.width, c.height, h, l); this._maxWidth = Math.max(this._maxWidth, u + this.letterSpacing), this._fontCharDic[o] = _, this._fontWidthMap[o] = u; } } }, e.parseFont2 = function(t, e) { if (null != t && null != e) { this._texture = e; var i = t.getElementsByTagName("info"); this.fontSize = parseInt(i[0].attributes.size.nodeValue); var n = i[0].attributes.padding.nodeValue.split(","); this._padding = [ parseInt(n[0]), parseInt(n[1]), parseInt(n[2]), parseInt(n[3]) ]; var s = t.getElementsByTagName("char"), a = 0; for (a = 0; a < s.length; a++) { var r = s[a].attributes, o = parseInt(r.id.nodeValue), h = parseInt(r.xoffset.nodeValue) / 1, l = parseInt(r.yoffset.nodeValue) / 1, u = parseInt(r.xadvance.nodeValue) / 1, c = new M(); c.x = parseInt(r.x.nodeValue), c.y = parseInt(r.y.nodeValue), c.width = parseInt(r.width.nodeValue), c.height = parseInt(r.height.nodeValue); var _ = lt.create(e, c.x, c.y, c.width, c.height, h, l); this._maxWidth = Math.max(this._maxWidth, u + this.letterSpacing), this._fontCharDic[o] = _, this._fontWidthMap[o] = u; } } }, e.getCharTexture = function(t) { return this._fontCharDic[t.charCodeAt(0)]; }, e.destroy = function() { if (this._texture) { for (var t in this._fontCharDic) { var e = this._fontCharDic[t]; e && e.destroy(); } this._texture.destroy(), this._fontCharDic = null, this._fontWidthMap = null, this._texture = null; } }, e.setSpaceWidth = function(t) { this._spaceWidth = t; }, e.getCharWidth = function(t) { var e = t.charCodeAt(0); return this._fontWidthMap[e] ? this._fontWidthMap[e] + this.letterSpacing : " " == t ? this._spaceWidth + this.letterSpacing : 0; }, e.getTextWidth = function(t) { for (var e = 0, i = 0, n = t.length; i < n; i++) e += this.getCharWidth(t.charAt(i)); return e; }, e.getMaxWidth = function() { return this._maxWidth; }, e.getMaxHeight = function() { return this.fontSize; }, e.drawText = function(t, e, i, n, s, a) { var r, o = this.getTextWidth(t), h = 0; "center" === s && (h = (a - o) / 2), "right" === s && (h = a - o); for (var l = 0, u = 0, c = t.length; u < c; u++) (r = this.getCharTexture(t.charAt(u))) && (e.graphics.drawTexture(r, i + l + h, n), l += this.getCharWidth(t.charAt(u))); }, t; }(), c = function() { function t() { this.alpha = 1, this.visible = !0, this.scrollRect = null, this.blendMode = null, this._type = 0, this._tf = t._TF_EMPTY; } s(t, "laya.display.css.Style"); var e = t.prototype; return e.getTransform = function() { return this._tf; }, e.setTransform = function(e) { this._tf = "none" !== e && e ? e : t._TF_EMPTY; }, e.setTranslateX = function(e) { this._tf === t._TF_EMPTY && (this._tf = new d()), this._tf.translateX = e; }, e.setTranslateY = function(e) { this._tf === t._TF_EMPTY && (this._tf = new d()), this._tf.translateY = e; }, e.setScaleX = function(e) { this._tf === t._TF_EMPTY && (this._tf = new d()), this._tf.scaleX = e; }, e.setScale = function(e, i) { this._tf === t._TF_EMPTY && (this._tf = new d()), this._tf.scaleX = e, this._tf.scaleY = i; }, e.setScaleY = function(e) { this._tf === t._TF_EMPTY && (this._tf = new d()), this._tf.scaleY = e; }, e.setRotate = function(e) { this._tf === t._TF_EMPTY && (this._tf = new d()), this._tf.rotate = e; }, e.setSkewX = function(e) { this._tf === t._TF_EMPTY && (this._tf = new d()), this._tf.skewX = e; }, e.setSkewY = function(e) { this._tf === t._TF_EMPTY && (this._tf = new d()), this._tf.skewY = e; }, e.destroy = function() { this.scrollRect = null; }, e.render = function(t, e, i, n) {}, e.getCSSStyle = function() { return tt.EMPTY; }, e._enableLayout = function() { return !1; }, a(0, e, "scaleX", function() { return this._tf.scaleX; }, function(t) { this.setScaleX(t); }), a(0, e, "transform", function() { return this.getTransform(); }, function(t) { this.setTransform(t); }), a(0, e, "translateX", function() { return this._tf.translateX; }, function(t) { this.setTranslateX(t); }), a(0, e, "translateY", function() { return this._tf.translateY; }, function(t) { this.setTranslateY(t); }), a(0, e, "scaleY", function() { return this._tf.scaleY; }, function(t) { this.setScaleY(t); }), a(0, e, "block", function() { return 0 != (1 & this._type); }), a(0, e, "skewY", function() { return this._tf.skewY; }, function(t) { this.setSkewY(t); }), a(0, e, "rotate", function() { return this._tf.rotate; }, function(t) { this.setRotate(t); }), a(0, e, "skewX", function() { return this._tf.skewX; }, function(t) { this.setSkewX(t); }), a(0, e, "paddingLeft", function() { return 0; }), a(0, e, "paddingTop", function() { return 0; }), a(0, e, "absolute", function() { return !0; }), t.__init__ = function() { t._TF_EMPTY = new d(), t.EMPTY = new t(); }, t.EMPTY = null, t._TF_EMPTY = null, t; }(), _ = function() { function t(e) { this._type = 0, this._weight = 0, this._decoration = null, this._text = null, this.indent = 0, this._color = V.create(t.defaultColor), this.family = t.defaultFamily, this.stroke = t._STROKE, this.size = t.defaultSize, e && e !== t.EMPTY && e.copyTo(this); } s(t, "laya.display.css.Font"); var e = t.prototype; return e.set = function(t) { this._text = null; for (var e = t.split(" "), i = 0, n = e.length; i < n; i++) { var s = e[i]; switch (s) { case "italic": this.italic = !0; continue; case "bold": this.bold = !0; continue; } s.indexOf("px") > 0 && (this.size = parseInt(s), this.family = e[i + 1], i++); } }, e.toString = function() { return this._text = "", this.italic && (this._text += "italic "), this.bold && (this._text += "bold "), this._text += this.size + "px " + this.family; }, e.copyTo = function(e) { e._type = this._type, e._text = this._text, e._weight = this._weight, e._color = this._color, e.family = this.family, e.stroke = this.stroke != t._STROKE ? this.stroke.slice() : t._STROKE, e.indent = this.indent, e.size = this.size; }, a(0, e, "password", function() { return 0 != (1024 & this._type); }, function(t) { t ? this._type |= 1024 : this._type &= -1025; }), a(0, e, "color", function() { return this._color.strColor; }, function(t) { this._color = V.create(t); }), a(0, e, "italic", function() { return 0 != (512 & this._type); }, function(t) { t ? this._type |= 512 : this._type &= -513; }), a(0, e, "bold", function() { return 0 != (2048 & this._type); }, function(t) { t ? this._type |= 2048 : this._type &= -2049; }), a(0, e, "weight", function() { return "" + this._weight; }, function(t) { var e = 0; switch (t) { case "normal": break; case "bold": this.bold = !0, e = 700; break; case "bolder": e = 800; break; case "lighter": e = 100; break; default: e = parseInt(t); } this._weight = e, this._text = null; }), a(0, e, "decoration", function() { return this._decoration ? this._decoration.value : null; }, function(t) { var e = t.split(" "); switch (this._decoration || (this._decoration = {}), e[0]) { case "_": this._decoration.type = "underline"; break; case "-": this._decoration.type = "line-through"; break; case "overline": this._decoration.type = "overline"; break; default: this._decoration.type = e[0]; } e[1] && (this._decoration.color = V.create(e)), this._decoration.value = t; }), t.__init__ = function() { t.EMPTY = new t(null); }, t.EMPTY = null, t.defaultColor = "#000000", t.defaultSize = 12, t.defaultFamily = "Arial", t.defaultFont = "12px Arial", t._STROKE = [ 0, "#000000" ], t._ITALIC = 512, t._PASSWORD = 1024, t._BOLD = 2048, t; }(), d = function() { function t() { this.translateX = 0, this.translateY = 0, this.scaleX = 1, this.scaleY = 1, this.rotate = 0, this.skewX = 0, this.skewY = 0; } return s(t, "laya.display.css.TransformInfo"), t; }(), p = function() { function e() { if (this._one = null, this._cmds = null, this._render = this._renderEmpty, k.isConchNode) { this._nativeObj = new t._conchGraphics(), this.id = this._nativeObj.conchID; } } s(e, "laya.display.Graphics"); var n = e.prototype; return n.destroy = function() { this.clear(), this._graphicBounds && this._graphicBounds.destroy(), this._graphicBounds = null, this._vectorgraphArray = null, this._sp && (this._sp._renderType = 0), this._sp = null; }, n.clear = function(t) { void 0 === t && (t = !1); var i = 0, n = 0; if (t) { var s = this._one; if (this._cmds) { for (n = this._cmds.length, i = 0; i < n; i++) !(s = this._cmds[i]) || s.callee !== k._context._drawTexture && s.callee !== k._context._drawTextureWithTransform || (s[0] = null, e._cache.push(s)); this._cmds.length = 0; } else s && (!s || s.callee !== k._context._drawTexture && s.callee !== k._context._drawTextureWithTransform || (s[0] = null, e._cache.push(s))); } else this._cmds = null; if (this._one = null, this._render = this._renderEmpty, this._sp && (this._sp._renderType &= -514), this._repaint(), this._vectorgraphArray) { for (i = 0, n = this._vectorgraphArray.length; i < n; i++) q.getInstance().deleteShape(this._vectorgraphArray[i]); this._vectorgraphArray.length = 0; } }, n._clearBoundsCache = function() { this._graphicBounds && this._graphicBounds.reset(); }, n._initGraphicBounds = function() { this._graphicBounds || (this._graphicBounds = new f(), this._graphicBounds._graphics = this); }, n._repaint = function() { this._clearBoundsCache(), this._sp && this._sp.repaint(); }, n._isOnlyOne = function() { return !this._cmds || 0 === this._cmds.length; }, n.getBounds = function(t) { return void 0 === t && (t = !1), this._initGraphicBounds(), this._graphicBounds.getBounds(t); }, n.getBoundPoints = function(t) { return void 0 === t && (t = !1), this._initGraphicBounds(), this._graphicBounds.getBoundPoints(t); }, n._addCmd = function(t) { this._cmds = this._cmds || [], t.callee = t.shift(), this._cmds.push(t); }, n.setFilters = function(t) { this._saveToCmd(k._context._setFilters, t); }, n.drawTexture = function(t, i, n, s, a, r, o) { if (void 0 === i && (i = 0), void 0 === n && (n = 0), void 0 === s && (s = 0), void 0 === a && (a = 0), void 0 === o && (o = 1), !t || o < .01) return null; s || (s = t.sourceWidth), a || (a = t.sourceHeight), o = o < 0 ? 0 : o > 1 ? 1 : o; var h = !k.isWebGL && (B.onFirefox || B.onEdge || B.onIE || B.onSafari) ? .5 : 0, l = s / t.sourceWidth, u = a / t.sourceHeight; if (s = t.width * l, a = t.height * u, t.loaded && (s <= 0 || a <= 0)) return null; i += t.offsetX * l, n += t.offsetY * u, this._sp && (this._sp._renderType |= 512); var c; return i -= h, n -= h, s += 2 * h, a += 2 * h, e._cache.length ? ((c = e._cache.pop())[0] = t, c[1] = i, c[2] = n, c[3] = s, c[4] = a, c[5] = r, c[6] = o) : c = [ t, i, n, s, a, r, o ], c.callee = r || 1 != o ? k._context._drawTextureWithTransform : k._context._drawTexture, null != this._one || r || 1 != o ? this._saveToCmd(c.callee, c) : (this._one = c, this._render = this._renderOneImg), t.loaded || t.once("loaded", this, this._textureLoaded, [ t, c ]), this._repaint(), c; }, n.cleanByTexture = function(t, e, i, n, s) { if (void 0 === n && (n = 0), void 0 === s && (s = 0), !t) return this.clear(); if (this._one && this._render === this._renderOneImg) { n || (n = t.sourceWidth), s || (s = t.sourceHeight); var a = n / t.sourceWidth, r = s / t.sourceHeight; n = t.width * a, s = t.height * r, e += t.offsetX * a, i += t.offsetY * r, this._one[0] = t, this._one[1] = e, this._one[2] = i, this._one[3] = n, this._one[4] = s, this._repaint(); } else this.clear(), t && this.drawTexture(t, e, i, n, s); }, n.drawTextures = function(t, e) { t && this._saveToCmd(k._context._drawTextures, [ t, e ]); }, n.fillTexture = function(t, e, i, n, s, a, r) { if (void 0 === n && (n = 0), void 0 === s && (s = 0), void 0 === a && (a = "repeat"), t) { var o = [ t, e, i, n, s, a, r || I.EMPTY, {} ]; t.loaded || t.once("loaded", this, this._textureLoaded, [ t, o ]), this._saveToCmd(k._context._fillTexture, o); } }, n._textureLoaded = function(t, e) { e[3] = e[3] || t.width, e[4] = e[4] || t.height, this._repaint(); }, n.fillCircle = function(t, e, i, n, s, a, r) { i.bitmap.enableMerageInAtlas = !1; var o = new Float32Array(2 * (r + 1)), h = new Float32Array(2 * (r + 1)), l = new Uint16Array(3 * r), u = 2 * Math.PI / r, c = 0; o[0] = n, o[1] = s, h[0] = n / i.width, h[1] = s / i.height; for (var _ = 2, d = 0; d < r; d++) { var p = a * Math.cos(c) + n, f = a * Math.sin(c) + s; o[_] = p, o[_ + 1] = f, h[_] = p / i.width, h[_ + 1] = f / i.height, c += u, _ += 2; } for (_ = 0, d = 0; d < r; d++) l[_++] = 0, l[_++] = d + 1, l[_++] = d + 2 >= r + 1 ? 1 : d + 2; this.drawTriangles(i, t, e, o, h, l); }, n.drawTriangles = function(t, e, i, n, s, a, r, o, h, l) { void 0 === o && (o = 1), this._saveToCmd(k._context.drawTriangles, [ t, e, i, n, s, a, r, o, h, l ]); }, n._saveToCmd = function(t, e) { return this._sp && (this._sp._renderType |= 512), null == this._one ? (this._one = e, this._render = this._renderOne) : (this._sp && (this._sp._renderType &= -2), this._render = this._renderAll, 0 === (this._cmds || (this._cmds = [])).length && this._cmds.push(this._one), this._cmds.push(e)), e.callee = t, this._repaint(), e; }, n.clipRect = function(t, e, i, n) { this._saveToCmd(k._context._clipRect, [ t, e, i, n ]); }, n.fillText = function(t, e, i, n, s, a, r) { void 0 === r && (r = 0), this._saveToCmd(k._context._fillText, [ t, e, i, n || _.defaultFont, s, a ]); }, n.fillBorderText = function(t, e, i, n, s, a, r, o) { this._saveToCmd(k._context._fillBorderText, [ t, e, i, n || _.defaultFont, s, a, r, o ]); }, n.strokeText = function(t, e, i, n, s, a, r) { this._saveToCmd(k._context._strokeText, [ t, e, i, n || _.defaultFont, s, a, r ]); }, n.alpha = function(t) { t = t < 0 ? 0 : t > 1 ? 1 : t, this._saveToCmd(k._context._alpha, [ t ]); }, n.setAlpha = function(t) { t = t < 0 ? 0 : t > 1 ? 1 : t, this._saveToCmd(k._context._setAlpha, [ t ]); }, n.transform = function(t, e, i) { void 0 === e && (e = 0), void 0 === i && (i = 0), this._saveToCmd(k._context._transform, [ t, e, i ]); }, n.rotate = function(t, e, i) { void 0 === e && (e = 0), void 0 === i && (i = 0), this._saveToCmd(k._context._rotate, [ t, e, i ]); }, n.scale = function(t, e, i, n) { void 0 === i && (i = 0), void 0 === n && (n = 0), this._saveToCmd(k._context._scale, [ t, e, i, n ]); }, n.translate = function(t, e) { this._saveToCmd(k._context._translate, [ t, e ]); }, n.save = function() { this._saveToCmd(k._context._save, []); }, n.restore = function() { this._saveToCmd(k._context._restore, []); }, n.replaceText = function(t) { this._repaint(); var e = this._cmds; if (e) { for (var i = e.length - 1; i > -1; i--) if (this._isTextCmd(e[i].callee)) return e[i][0].toUpperCase ? e[i][0] = t : e[i][0].setText(t), !0; } else if (this._one && this._isTextCmd(this._one.callee)) return this._one[0].toUpperCase ? this._one[0] = t : this._one[0].setText(t), !0; return !1; }, n._isTextCmd = function(t) { return t === k._context._fillText || t === k._context._fillBorderText || t === k._context._strokeText; }, n.replaceTextColor = function(t) { this._repaint(); var e = this._cmds; if (e) for (var i = e.length - 1; i > -1; i--) this._isTextCmd(e[i].callee) && (e[i][4] = t, e[i][0].toUpperCase || (e[i][0].changed = !0)); else this._one && this._isTextCmd(this._one.callee) && (this._one[4] = t, this._one[0].toUpperCase || (this._one[0].changed = !0)); }, n.loadImage = function(t, e, n, s, a, r) { function o(t) { t && (h.drawTexture(t, e, n, s, a), null != r && r.call(h._sp, t)); } var h = this; void 0 === e && (e = 0), void 0 === n && (n = 0), void 0 === s && (s = 0), void 0 === a && (a = 0); var u = rt.getRes(t); u ? o(u) : i.loader.load(t, l.create(null, o), null, "image"); }, n._renderEmpty = function(t, e, i, n) {}, n._renderAll = function(t, e, i, n) { for (var s, a = this._cmds, r = 0, o = a.length; r < o; r++) (s = a[r]).callee.call(e, i, n, s); }, n._renderOne = function(t, e, i, n) { this._one.callee.call(e, i, n, this._one); }, n._renderOneImg = function(t, e, i, n) { this._one.callee.call(e, i, n, this._one), 2305 !== t._renderType && (t._renderType |= 1); }, n.drawLine = function(t, e, i, n, s, a) { void 0 === a && (a = 1); var r = 0; k.isWebGL && (r = q.getInstance().getId(), null == this._vectorgraphArray && (this._vectorgraphArray = []), this._vectorgraphArray.push(r)); var o = a % 2 == 0 ? 0 : .5, h = [ t + o, e + o, i + o, n + o, s, a, r ]; this._saveToCmd(k._context._drawLine, h); }, n.drawLines = function(t, e, i, n, s) { void 0 === s && (s = 1); var a = 0; if (i && !(i.length < 4)) { k.isWebGL && (a = q.getInstance().getId(), null == this._vectorgraphArray && (this._vectorgraphArray = []), this._vectorgraphArray.push(a)); var r = s % 2 == 0 ? 0 : .5, o = [ t + r, e + r, i, n, s, a ]; this._saveToCmd(k._context._drawLines, o); } }, n.drawCurves = function(t, e, i, n, s) { void 0 === s && (s = 1); var a = [ t, e, i, n, s ]; this._saveToCmd(k._context._drawCurves, a); }, n.drawRect = function(t, e, i, n, s, a, r) { void 0 === r && (r = 1); var o = a ? r / 2 : 0, h = a ? r : 0, l = [ t + o, e + o, i - h, n - h, s, a, r ]; this._saveToCmd(k._context._drawRect, l); }, n.drawCircle = function(t, e, i, n, s, a) { void 0 === a && (a = 1); var r = s ? a / 2 : 0, o = 0; k.isWebGL && (o = q.getInstance().getId(), null == this._vectorgraphArray && (this._vectorgraphArray = []), this._vectorgraphArray.push(o)); var h = [ t, e, i - r, n, s, a, o ]; this._saveToCmd(k._context._drawCircle, h); }, n.drawPie = function(t, e, i, n, s, a, r, o) { void 0 === o && (o = 1); var h = r ? o / 2 : 0, l = r ? o : 0, u = 0; k.isWebGL && (u = q.getInstance().getId(), null == this._vectorgraphArray && (this._vectorgraphArray = []), this._vectorgraphArray.push(u)); var c = [ t + h, e + h, i - l, n, s, a, r, o, u ]; c[3] = $.toRadian(n), c[4] = $.toRadian(s), this._saveToCmd(k._context._drawPie, c); }, n.drawPoly = function(t, e, i, n, s, a) { void 0 === a && (a = 1); var r = 0, o = !1; k.isWebGL && (r = q.getInstance().getId(), null == this._vectorgraphArray && (this._vectorgraphArray = []), this._vectorgraphArray.push(r), o = !(i.length > 6)); var h = s ? a % 2 == 0 ? 0 : .5 : 0, l = [ t + h, e + h, i, n, s, a, r, o ]; this._saveToCmd(k._context._drawPoly, l); }, n.drawPath = function(t, e, i, n, s) { var a = [ t, e, i, n, s ]; this._saveToCmd(k._context._drawPath, a); }, a(0, n, "cmds", function() { return this._cmds; }, function(t) { this._sp && (this._sp._renderType |= 512), this._cmds = t, this._render = this._renderAll, this._repaint(); }), e.__init__ = function() { if (k.isConchNode) { for (var t = laya.display.Graphics.prototype, e = B.window.ConchGraphics.prototype, i = [ "clear", "destroy", "alpha", "rotate", "transform", "scale", "translate", "save", "restore", "clipRect", "blendMode", "fillText", "fillBorderText", "_fands", "drawRect", "drawCircle", "drawPie", "drawPoly", "drawPath", "drawImageM", "drawLine", "drawLines", "_drawPs", "drawCurves", "replaceText", "replaceTextColor", "_fillImage", "fillTexture", "setSkinMesh", "drawParticle", "drawImageS" ], n = 0, s = i.length; n <= s; n++) { var a = i[n]; t[a] = e[a]; } t._saveToCmd = null, e.drawImageS && (t.drawTextures = function(t, e) { if (t && t.loaded && t.bitmap && t.source) { var i = t.uv, n = t.bitmap.width, s = t.bitmap.height; this.drawImageS(t.bitmap.source, i[0] * n, i[1] * s, (i[2] - i[0]) * n, (i[5] - i[3]) * s, t.offsetX, t.offsetY, t.width, t.height, e); } }), t.drawTexture = function(t, e, i, n, s, a, r) { if (void 0 === e && (e = 0), void 0 === i && (i = 0), void 0 === n && (n = 0), void 0 === s && (s = 0), void 0 === r && (r = 1), t) if (t.loaded) { if (t.loaded && t.bitmap && t.source && (n || (n = t.sourceWidth), s || (s = t.sourceHeight), r = r < 0 ? 0 : r > 1 ? 1 : r, n = n - t.sourceWidth + t.width, s = s - t.sourceHeight + t.height, !(n <= 0 || s <= 0))) { e += t.offsetX, i += t.offsetY; var o = t.uv, h = t.bitmap.width, l = t.bitmap.height; o[4] < o[0] && o[5] < o[1] ? this.drawImageM(t.bitmap.source, o[4] * h, o[5] * l, (o[0] - o[4]) * h, (o[1] - o[5]) * l, e, i, n, s, a, r) : this.drawImageM(t.bitmap.source, o[0] * h, o[1] * l, (o[2] - o[0]) * h, (o[5] - o[3]) * l, e, i, n, s, a, r), this._repaint(); } } else t.once("loaded", this, function() { this.drawTexture(t, e, i, n, s, a); }); }, t.fillTexture = function(t, e, i, n, s, a, r) { if (void 0 === n && (n = 0), void 0 === s && (s = 0), void 0 === a && (a = "repeat"), t && t.loaded) { var o, h = k._context.ctx, l = t.bitmap.width, u = t.bitmap.height, c = t.uv; o = t.uv != lt.DEF_UV ? h.createPattern(t.bitmap.source, a, c[0] * l, c[1] * u, (c[2] - c[0]) * l, (c[5] - c[3]) * u) : h.createPattern(t.bitmap.source, a); var _ = 0, d = 0; r && (e += r.x % t.width, i += r.y % t.height, _ -= r.x % t.width, d -= r.y % t.height), this._fillImage(o, e, i, _, d, n, s); } }; } }, e._cache = [], e; }(), f = function() { function t() { this._cacheBoundsType = !1; } s(t, "laya.display.GraphicsBounds"); var e = t.prototype; return e.destroy = function() { this._graphics = null, this._temp = null, this._rstBoundPoints = null, this._bounds = null; }, e.reset = function() { this._temp && (this._temp.length = 0); }, e.getBounds = function(t) { return void 0 === t && (t = !1), (!this._bounds || !this._temp || this._temp.length < 1 || t != this._cacheBoundsType) && (this._bounds = M._getWrapRec(this.getBoundPoints(t), this._bounds)), this._cacheBoundsType = t, this._bounds; }, e.getBoundPoints = function(t) { return void 0 === t && (t = !1), (!this._temp || this._temp.length < 1 || t != this._cacheBoundsType) && (this._temp = this._getCmdPoints(t)), this._cacheBoundsType = t, this._rstBoundPoints = $.copyArray(this._rstBoundPoints, this._temp); }, e._getCmdPoints = function(e) { void 0 === e && (e = !1); var i, n = k._context, s = this._graphics.cmds; if (i = this._temp || (this._temp = []), i.length = 0, s || null == this._graphics._one || (t._tempCmds.length = 0, t._tempCmds.push(this._graphics._one), s = t._tempCmds), !s) return i; var a; (a = t._tempMatrixArrays).length = 0; var r = t._initMatrix; r.identity(); for (var o, h, l = t._tempMatrix, u = NaN, c = NaN, _ = NaN, d = NaN, p = NaN, f = NaN, g = 0, m = s.length; g < m; g++) if ((o = s[g]).callee) switch (o.callee) { case n._save: case 7: a.push(r), r = r.clone(); break; case n._restore: case 8: r = a.pop(); break; case n._scale: case 5: l.identity(), l.translate(-o[2], -o[3]), l.scale(o[0], o[1]), l.translate(o[2], o[3]), this._switchMatrix(r, l); break; case n._rotate: case 3: l.identity(), l.translate(-o[1], -o[2]), l.rotate(o[0]), l.translate(o[1], o[2]), this._switchMatrix(r, l); break; case n._translate: case 6: l.identity(), l.translate(o[0], o[1]), this._switchMatrix(r, l); break; case n._transform: case 4: l.identity(), l.translate(-o[1], -o[2]), l.concat(o[0]), l.translate(o[1], o[2]), this._switchMatrix(r, l); break; case 16: case 24: t._addPointArrToRst(i, M._getBoundPointS(o[0], o[1], o[2], o[3]), r); break; case 17: r.copyTo(l), l.concat(o[4]), t._addPointArrToRst(i, M._getBoundPointS(o[0], o[1], o[2], o[3]), l); break; case n._drawTexture: h = o[0], e ? o[3] && o[4] ? t._addPointArrToRst(i, M._getBoundPointS(o[1], o[2], o[3], o[4]), r) : (h = o[0], t._addPointArrToRst(i, M._getBoundPointS(o[1], o[2], h.width, h.height), r)) : (u = (o[3] || h.sourceWidth) / h.width, c = (o[4] || h.sourceHeight) / h.height, _ = u * h.sourceWidth, d = c * h.sourceHeight, p = h.offsetX > 0 ? h.offsetX : 0, f = h.offsetY > 0 ? h.offsetY : 0, p *= u, f *= c, t._addPointArrToRst(i, M._getBoundPointS(o[1] - p, o[2] - f, _, d), r)); break; case n._fillTexture: o[3] && o[4] ? t._addPointArrToRst(i, M._getBoundPointS(o[1], o[2], o[3], o[4]), r) : (h = o[0], t._addPointArrToRst(i, M._getBoundPointS(o[1], o[2], h.width, h.height), r)); break; case n._drawTextureWithTransform: var v; o[5] ? (r.copyTo(l), l.concat(o[5]), v = l) : v = r, e ? o[3] && o[4] ? t._addPointArrToRst(i, M._getBoundPointS(o[1], o[2], o[3], o[4]), v) : (h = o[0], t._addPointArrToRst(i, M._getBoundPointS(o[1], o[2], h.width, h.height), v)) : (h = o[0], u = (o[3] || h.sourceWidth) / h.width, c = (o[4] || h.sourceHeight) / h.height, _ = u * h.sourceWidth, d = c * h.sourceHeight, p = h.offsetX > 0 ? h.offsetX : 0, f = h.offsetY > 0 ? h.offsetY : 0, p *= u, f *= c, t._addPointArrToRst(i, M._getBoundPointS(o[1] - p, o[2] - f, _, d), v)); break; case n._drawRect: case 13: t._addPointArrToRst(i, M._getBoundPointS(o[0], o[1], o[2], o[3]), r); break; case n._drawCircle: case n._fillCircle: case 14: t._addPointArrToRst(i, M._getBoundPointS(o[0] - o[2], o[1] - o[2], o[2] + o[2], o[2] + o[2]), r); break; case n._drawLine: case 20: t._tempPoints.length = 0; var y = NaN; y = .5 * o[5], o[0] == o[2] ? t._tempPoints.push(o[0] + y, o[1], o[2] + y, o[3], o[0] - y, o[1], o[2] - y, o[3]) : o[1] == o[3] ? t._tempPoints.push(o[0], o[1] + y, o[2], o[3] + y, o[0], o[1] - y, o[2], o[3] - y) : t._tempPoints.push(o[0], o[1], o[2], o[3]), t._addPointArrToRst(i, t._tempPoints, r); break; case n._drawCurves: case 22: t._addPointArrToRst(i, w.I.getBezierPoints(o[2]), r, o[0], o[1]); break; case n._drawPoly: case n._drawLines: case 18: t._addPointArrToRst(i, o[2], r, o[0], o[1]); break; case n._drawPath: case 19: t._addPointArrToRst(i, this._getPathPoints(o[2]), r, o[0], o[1]); break; case n._drawPie: case 15: t._addPointArrToRst(i, this._getPiePoints(o[0], o[1], o[2], o[3], o[4]), r); } return i.length > 200 ? i = $.copyArray(i, M._getWrapRec(i)._getBoundPoints()) : i.length > 8 && (i = C.scanPList(i)), i; }, e._switchMatrix = function(t, e) { e.concat(t), e.copyTo(t); }, e._getPiePoints = function(e, i, n, s, a) { var r = t._tempPoints; t._tempPoints.length = 0, r.push(e, i); var o = (a - s) % (2 * Math.PI) / 10, h = NaN, l = s; for (h = 0; h <= 10; h++) r.push(e + n * Math.cos(l), i + n * Math.sin(l)), l += o; return r; }, e._getPathPoints = function(e) { var i = 0, n = 0, s = t._tempPoints; s.length = 0, n = e.length; var a; for (i = 0; i < n; i++) (a = e[i]).length > 1 && (s.push(a[1], a[2]), a.length > 3 && s.push(a[3], a[4])); return s; }, t._addPointArrToRst = function(e, i, n, s, a) { void 0 === s && (s = 0), void 0 === a && (a = 0); var r = 0, o = 0; for (o = i.length, r = 0; r < o; r += 2) t._addPointToRst(e, i[r] + s, i[r + 1] + a, n); }, t._addPointToRst = function(t, e, i, n) { var s = I.TEMP; s.setTo(e || 0, i || 0), n.transformPoint(s), t.push(s.x, s.y); }, t._tempPoints = [], t._tempMatrixArrays = [], t._tempCmds = [], n(t, [ "_tempMatrix", function() { return this._tempMatrix = new T(); }, "_initMatrix", function() { return this._initMatrix = new T(); } ]), t; }(), g = function() { function t() {} s(t, "laya.events.Event"); var e = t.prototype; return e.setTo = function(t, e, i) { return this.type = t, this.currentTarget = e, this.target = i, this; }, e.stopPropagation = function() { this._stoped = !0; }, a(0, e, "stageY", function() { return i.stage.mouseY; }), a(0, e, "charCode", function() { return this.nativeEvent.charCode; }), a(0, e, "touches", function() { var t = this.nativeEvent.touches; if (t) for (var e = i.stage, n = 0, s = t.length; n < s; n++) { var a = t[n], r = I.TEMP; r.setTo(a.clientX, a.clientY), e._canvasTransform.invertTransformPoint(r), e.transform.invertTransformPoint(r), a.stageX = r.x, a.stageY = r.y; } return t; }), a(0, e, "keyLocation", function() { return this.nativeEvent.keyLocation; }), a(0, e, "ctrlKey", function() { return this.nativeEvent.ctrlKey; }), a(0, e, "altKey", function() { return this.nativeEvent.altKey; }), a(0, e, "shiftKey", function() { return this.nativeEvent.shiftKey; }), a(0, e, "stageX", function() { return i.stage.mouseX; }), t.EMPTY = new t(), t.MOUSE_DOWN = "mousedown", t.MOUSE_UP = "mouseup", t.CLICK = "click", t.RIGHT_MOUSE_DOWN = "rightmousedown", t.RIGHT_MOUSE_UP = "rightmouseup", t.RIGHT_CLICK = "rightclick", t.MOUSE_MOVE = "mousemove", t.MOUSE_OVER = "mouseover", t.MOUSE_OUT = "mouseout", t.MOUSE_WHEEL = "mousewheel", t.ROLL_OVER = "mouseover", t.ROLL_OUT = "mouseout", t.DOUBLE_CLICK = "doubleclick", t.CHANGE = "change", t.CHANGED = "changed", t.RESIZE = "resize", t.ADDED = "added", t.REMOVED = "removed", t.DISPLAY = "display", t.UNDISPLAY = "undisplay", t.ERROR = "error", t.COMPLETE = "complete", t.LOADED = "loaded", t.PROGRESS = "progress", t.INPUT = "input", t.RENDER = "render", t.OPEN = "open", t.MESSAGE = "message", t.CLOSE = "close", t.KEY_DOWN = "keydown", t.KEY_PRESS = "keypress", t.KEY_UP = "keyup", t.FRAME = "enterframe", t.DRAG_START = "dragstart", t.DRAG_MOVE = "dragmove", t.DRAG_END = "dragend", t.ENTER = "enter", t.SELECT = "select", t.BLUR = "blur", t.FOCUS = "focus", t.VISIBILITY_CHANGE = "visibilitychange", t.FOCUS_CHANGE = "focuschange", t.PLAYED = "played", t.PAUSED = "paused", t.STOPPED = "stopped", t.START = "start", t.END = "end", t.ENABLE_CHANGED = "enablechanged", t.ACTIVE_IN_HIERARCHY_CHANGED = "activeinhierarchychanged", t.COMPONENT_ADDED = "componentadded", t.COMPONENT_REMOVED = "componentremoved", t.LAYER_CHANGED = "layerchanged", t.HIERARCHY_LOADED = "hierarchyloaded", t.RECOVERED = "recovered", t.RELEASED = "released", t.LINK = "link", t.LABEL = "label", t.FULL_SCREEN_CHANGE = "fullscreenchange", t.DEVICE_LOST = "devicelost", t.MESH_CHANGED = "meshchanged", t.MATERIAL_CHANGED = "materialchanged", t.WORLDMATRIX_NEEDCHANGE = "worldmatrixneedchanged", t.ANIMATION_CHANGED = "animationchanged", t.TRIGGER_ENTER = "triggerenter", t.TRIGGER_STAY = "triggerstay", t.TRIGGER_EXIT = "triggerexit", t.TRAIL_FILTER_CHANGE = "trailfilterchange", t.DOMINO_FILTER_CHANGE = "dominofilterchange", t; }(), m = (function() { function t() {} s(t, "laya.events.Keyboard"), t.NUMBER_0 = 48, t.NUMBER_1 = 49, t.NUMBER_2 = 50, t.NUMBER_3 = 51, t.NUMBER_4 = 52, t.NUMBER_5 = 53, t.NUMBER_6 = 54, t.NUMBER_7 = 55, t.NUMBER_8 = 56, t.NUMBER_9 = 57, t.A = 65, t.B = 66, t.C = 67, t.D = 68, t.E = 69, t.F = 70, t.G = 71, t.H = 72, t.I = 73, t.J = 74, t.K = 75, t.L = 76, t.M = 77, t.N = 78, t.O = 79, t.P = 80, t.Q = 81, t.R = 82, t.S = 83, t.T = 84, t.U = 85, t.V = 86, t.W = 87, t.X = 88, t.Y = 89, t.Z = 90, t.F1 = 112, t.F2 = 113, t.F3 = 114, t.F4 = 115, t.F5 = 116, t.F6 = 117, t.F7 = 118, t.F8 = 119, t.F9 = 120, t.F10 = 121, t.F11 = 122, t.F12 = 123, t.F13 = 124, t.F14 = 125, t.F15 = 126, t.NUMPAD = 21, t.NUMPAD_0 = 96, t.NUMPAD_1 = 97, t.NUMPAD_2 = 98, t.NUMPAD_3 = 99, t.NUMPAD_4 = 100, t.NUMPAD_5 = 101, t.NUMPAD_6 = 102, t.NUMPAD_7 = 103, t.NUMPAD_8 = 104, t.NUMPAD_9 = 105, t.NUMPAD_ADD = 107, t.NUMPAD_DECIMAL = 110, t.NUMPAD_DIVIDE = 111, t.NUMPAD_ENTER = 108, t.NUMPAD_MULTIPLY = 106, t.NUMPAD_SUBTRACT = 109, t.SEMICOLON = 186, t.EQUAL = 187, t.COMMA = 188, t.MINUS = 189, t.PERIOD = 190, t.SLASH = 191, t.BACKQUOTE = 192, t.LEFTBRACKET = 219, t.BACKSLASH = 220, t.RIGHTBRACKET = 221, t.QUOTE = 222, t.ALTERNATE = 18, t.BACKSPACE = 8, t.CAPS_LOCK = 20, t.COMMAND = 15, t.CONTROL = 17, t.DELETE = 46, t.ENTER = 13, t.ESCAPE = 27, t.PAGE_UP = 33, t.PAGE_DOWN = 34, t.END = 35, t.HOME = 36, t.LEFT = 37, t.UP = 38, t.RIGHT = 39, t.DOWN = 40, t.SHIFT = 16, t.SPACE = 32, t.TAB = 9, t.INSERT = 45; }(), function() { function t() {} return s(t, "laya.events.KeyBoardManager"), t.__init__ = function() { t._addEvent("keydown"), t._addEvent("keypress"), t._addEvent("keyup"); }, t._addEvent = function(t) { B.document.addEventListener(t, function(e) { laya.events.KeyBoardManager._dispatch(e, t); }, !0); }, t._dispatch = function(e, n) { if (t.enabled) { t._event._stoped = !1, t._event.nativeEvent = e, t._event.keyCode = e.keyCode || e.which || e.charCode, "keydown" === n ? t._pressKeys[t._event.keyCode] = !0 : "keyup" === n && (t._pressKeys[t._event.keyCode] = null); for (var s = i.stage.focus && null != i.stage.focus.event && i.stage.focus.displayedInStage ? i.stage.focus : i.stage, a = s; a; ) a.event(n, t._event.setTo(n, a, s)), a = a.parent; } }, t.hasKeyDown = function(e) { return t._pressKeys[e]; }, t._pressKeys = {}, t.enabled = !0, n(t, [ "_event", function() { return this._event = new g(); } ]), t; }()), v = (function() { function t() {} s(t, "laya.events.KeyLocation"), t.STANDARD = 0, t.LEFT = 1, t.RIGHT = 2, t.NUM_PAD = 3; }(), function() { function t() { this.mouseX = 0, this.mouseY = 0, this.disableMouseEvent = !1, this.mouseDownTime = 0, this.mouseMoveAccuracy = 2, this._stage = null, this._target = null, this._lastMoveTimer = 0, this._isLeftMouse = !1, this._eventList = [], this._touchIDs = {}, this._id = 1, this._tTouchID = 0, this._event = new g(), this._matrix = new T(), this._point = new I(), this._rect = new M(), this._prePoint = new I(), this._curTouchID = NaN; } s(t, "laya.events.MouseManager"); var e = t.prototype; return e.__init__ = function(e, i) { var n = this; this._stage = e; var s = this, a = this._eventList; i.oncontextmenu = function(e) { if (t.enabled) return !1; }, i.addEventListener("mousedown", function(e) { t.enabled && (B.onIE || e.preventDefault(), a.push(e), s.mouseDownTime = B.now()); }), i.addEventListener("mouseup", function(e) { t.enabled && (e.preventDefault(), a.push(e), s.mouseDownTime = -B.now()); }, !0), i.addEventListener("mousemove", function(e) { if (t.enabled) { e.preventDefault(); var i = B.now(); if (i - s._lastMoveTimer < 10) return; s._lastMoveTimer = i, a.push(e); } }, !0), i.addEventListener("mouseout", function(e) { t.enabled && a.push(e); }), i.addEventListener("mouseover", function(e) { t.enabled && a.push(e); }), i.addEventListener("touchstart", function(e) { t.enabled && (a.push(e), t._isFirstTouch || bt.isInputting || e.preventDefault(), s.mouseDownTime = B.now()); }), i.addEventListener("touchend", function(e) { t.enabled ? (t._isFirstTouch || bt.isInputting || e.preventDefault(), t._isFirstTouch = !1, a.push(e), s.mouseDownTime = -B.now()) : n._curTouchID = NaN; }, !0), i.addEventListener("touchmove", function(e) { t.enabled && (e.preventDefault(), a.push(e)); }, !0), i.addEventListener("touchcancel", function(e) { t.enabled ? (e.preventDefault(), a.push(e)) : n._curTouchID = NaN; }, !0), i.addEventListener("mousewheel", function(e) { t.enabled && a.push(e); }), i.addEventListener("DOMMouseScroll", function(e) { t.enabled && a.push(e); }); }, e.initEvent = function(t, e) { this._event._stoped = !1, this._event.nativeEvent = e || t, this._target = null, this._point.setTo(t.pageX || t.clientX, t.pageY || t.clientY), this._stage._canvasTransform.invertTransformPoint(this._point), this.mouseX = this._point.x, this.mouseY = this._point.y, this._event.touchId = t.identifier || 0, this._tTouchID = this._event.touchId; var i; (i = y.I._event)._stoped = !1, i.nativeEvent = this._event.nativeEvent, i.touchId = this._event.touchId; }, e.checkMouseWheel = function(t) { this._event.delta = t.wheelDelta ? .025 * t.wheelDelta : -t.detail; for (var e = y.I.getLastOvers(), i = 0, n = e.length; i < n; i++) { var s = e[i]; s.event("mousewheel", this._event.setTo("mousewheel", s, this._target)); } }, e.onMouseMove = function(t) { y.I.onMouseMove(t, this._tTouchID); }, e.onMouseDown = function(t) { if (bt.isInputting && i.stage.focus && i.stage.focus.focus && !i.stage.focus.contains(this._target)) { var e = i.stage.focus._tf || i.stage.focus, n = t._tf || t; n instanceof laya.display.Input && n.multiline == e.multiline ? e._focusOut() : e.focus = !1; } y.I.onMouseDown(t, this._tTouchID, this._isLeftMouse); }, e.onMouseUp = function(t) { y.I.onMouseUp(t, this._tTouchID, this._isLeftMouse); }, e.check = function(t, e, i, n) { this._point.setTo(e, i), t.fromParentPoint(this._point), e = this._point.x, i = this._point.y; var s = t.scrollRect; if (s && (this._rect.setTo(s.x, s.y, s.width, s.height), !this._rect.contains(e, i))) return !1; if (!this.disableMouseEvent) { if (t.hitTestPrior && !t.mouseThrough && !this.hitTest(t, e, i)) return !1; for (var a = t._childs.length - 1; a > -1; a--) { var r = t._childs[a]; if (!r.destroyed && r.mouseEnabled && r.visible && this.check(r, e, i, n)) return !0; } } var o = !(!t.hitTestPrior || t.mouseThrough || this.disableMouseEvent) || this.hitTest(t, e, i); return o ? (this._target = t, n.call(this, t)) : n === this.onMouseUp && t === this._stage && (this._target = this._stage, n.call(this, this._target)), o; }, e.hitTest = function(t, e, i) { var n = !1; if (t.scrollRect && (e -= t.scrollRect.x, i -= t.scrollRect.y), t.hitArea instanceof laya.utils.HitArea) return t.hitArea.isHit(e, i); if (t.width > 0 && t.height > 0 || t.mouseThrough || t.hitArea) if (t.mouseThrough) n = t.getGraphicBounds().contains(e, i); else { var s = this._rect; t.hitArea ? s = t.hitArea : s.setTo(0, 0, t.width, t.height), n = s.contains(e, i); } return n; }, e.runEvent = function() { var e = this._eventList.length; if (e) { for (var i, n = 0, s = 0, a = 0; n < e; ) { var r = this._eventList[n]; switch ("mousemove" !== r.type && (this._prePoint.x = this._prePoint.y = -1e6), r.type) { case "mousedown": this._touchIDs[0] = this._id++, t._isTouchRespond ? t._isTouchRespond = !1 : (this._isLeftMouse = 0 === r.button, this.initEvent(r), this.check(this._stage, this.mouseX, this.mouseY, this.onMouseDown)); break; case "mouseup": this._isLeftMouse = 0 === r.button, this.initEvent(r), this.check(this._stage, this.mouseX, this.mouseY, this.onMouseUp); break; case "mousemove": Math.abs(this._prePoint.x - r.clientX) + Math.abs(this._prePoint.y - r.clientY) >= this.mouseMoveAccuracy && (this._prePoint.x = r.clientX, this._prePoint.y = r.clientY, this.initEvent(r), this.check(this._stage, this.mouseX, this.mouseY, this.onMouseMove)); break; case "touchstart": t._isTouchRespond = !0, this._isLeftMouse = !0; var o = r.changedTouches; for (s = 0, a = o.length; s < a; s++) i = o[s], (t.multiTouchEnabled || isNaN(this._curTouchID)) && (this._curTouchID = i.identifier, this._id % 200 == 0 && (this._touchIDs = {}), this._touchIDs[i.identifier] = this._id++, this.initEvent(i, r), this.check(this._stage, this.mouseX, this.mouseY, this.onMouseDown)); break; case "touchend": case "touchcancel": t._isTouchRespond = !0, this._isLeftMouse = !0; var h = r.changedTouches; for (s = 0, a = h.length; s < a; s++) if (i = h[s], t.multiTouchEnabled || i.identifier == this._curTouchID) { this._curTouchID = NaN, this.initEvent(i, r); this.check(this._stage, this.mouseX, this.mouseY, this.onMouseUp) || this.onMouseUp(null); } break; case "touchmove": var l = r.changedTouches; for (s = 0, a = l.length; s < a; s++) i = l[s], (t.multiTouchEnabled || i.identifier == this._curTouchID) && (this.initEvent(i, r), this.check(this._stage, this.mouseX, this.mouseY, this.onMouseMove)); break; case "wheel": case "mousewheel": case "DOMMouseScroll": this.checkMouseWheel(r); break; case "mouseout": y.I.stageMouseOut(); break; case "mouseover": this._stage.event("mouseover", this._event.setTo("mouseover", this._stage, this._stage)); } n++; } this._eventList.length = 0; } }, t.enabled = !0, t.multiTouchEnabled = !0, t._isTouchRespond = !1, t._isFirstTouch = !0, n(t, [ "instance", function() { return this.instance = new t(); } ]), t; }()), y = function() { function t() { this.preOvers = [], this.preDowns = [], this.preRightDowns = [], this.enable = !0, this._lastClickTime = 0, this._event = new g(); } s(t, "laya.events.TouchManager"); var e = t.prototype; return e._clearTempArrs = function() { t._oldArr.length = 0, t._newArr.length = 0, t._tEleArr.length = 0; }, e.getTouchFromArr = function(t, e) { var i = 0, n = 0; n = e.length; var s; for (i = 0; i < n; i++) if ((s = e[i]).id == t) return s; return null; }, e.removeTouchFromArr = function(t, e) { var i = 0; for (i = e.length - 1; i >= 0; i--) e[i].id == t && e.splice(i, 1); }, e.createTouchO = function(t, e) { var i; return i = Y.getItem("TouchData") || {}, i.id = e, i.tar = t, i; }, e.onMouseDown = function(e, i, n) { if (void 0 === n && (n = !1), this.enable) { var s, a, r; s = this.getTouchFromArr(i, this.preOvers), r = this.getEles(e, null, t._tEleArr), s ? s.tar = e : (a = this.createTouchO(e, i), this.preOvers.push(a)), B.onMobile && this.sendEvents(r, "mouseover"); var o; o = n ? this.preDowns : this.preRightDowns, (s = this.getTouchFromArr(i, o)) ? s.tar = e : (a = this.createTouchO(e, i), o.push(a)), this.sendEvents(r, n ? "mousedown" : "rightmousedown"), this._clearTempArrs(); } }, e.sendEvents = function(t, e) { var i = 0, n = 0; n = t.length, this._event._stoped = !1; var s; s = t[0]; var a; for (i = 0; i < n; i++) { if ((a = t[i]).destroyed) return; if (a.event(e, this._event.setTo(e, a, s)), this._event._stoped) break; } }, e.getEles = function(t, e, i) { for (i ? i.length = 0 : i = []; t && t != e; ) i.push(t), t = t.parent; return i; }, e.checkMouseOutAndOverOfMove = function(e, i, n) { if (void 0 === n && (n = 0), i != e) { var s, a, r = 0, o = 0; if (i.contains(e)) a = this.getEles(e, i, t._tEleArr), this.sendEvents(a, "mouseover"); else if (e.contains(i)) a = this.getEles(i, e, t._tEleArr), this.sendEvents(a, "mouseout"); else { (a = t._tEleArr).length = 0; var h; h = this.getEles(i, null, t._oldArr); var l; l = this.getEles(e, null, t._newArr), o = h.length; var u = 0; for (r = 0; r < o; r++) { if (s = h[r], (u = l.indexOf(s)) >= 0) { l.splice(u, l.length - u); break; } a.push(s); } a.length > 0 && this.sendEvents(a, "mouseout"), l.length > 0 && this.sendEvents(l, "mouseover"); } } }, e.onMouseMove = function(e, i) { if (this.enable) { var n, s; (n = this.getTouchFromArr(i, this.preOvers)) ? (this.checkMouseOutAndOverOfMove(e, n.tar), n.tar = e, s = this.getEles(e, null, t._tEleArr)) : (s = this.getEles(e, null, t._tEleArr), this.sendEvents(s, "mouseover"), this.preOvers.push(this.createTouchO(e, i))), this.sendEvents(s, "mousemove"), this._clearTempArrs(); } }, e.getLastOvers = function() { return t._tEleArr.length = 0, this.preOvers.length > 0 && this.preOvers[0].tar ? this.getEles(this.preOvers[0].tar, null, t._tEleArr) : (t._tEleArr.push(i.stage), t._tEleArr); }, e.stageMouseOut = function() { var t; t = this.getLastOvers(), this.preOvers.length = 0, this.sendEvents(t, "mouseout"); }, e.onMouseUp = function(e, i, n) { if (void 0 === n && (n = !1), this.enable) { var s, a, r, o, h, l = 0, u = 0, c = B.onMobile; a = this.getEles(e, null, t._tEleArr), this.sendEvents(a, n ? "mouseup" : "rightmouseup"); var _; if (_ = n ? this.preDowns : this.preRightDowns, s = this.getTouchFromArr(i, _)) { var d = !1, p = B.now(); if (d = p - this._lastClickTime < 300, this._lastClickTime = p, e == s.tar) h = a; else for (r = this.getEles(s.tar, null, t._oldArr), (h = t._newArr).length = 0, u = r.length, l = 0; l < u; l++) o = r[l], a.indexOf(o) >= 0 && h.push(o); h.length > 0 && this.sendEvents(h, n ? "click" : "rightclick"), n && d && this.sendEvents(h, "doubleclick"), this.removeTouchFromArr(i, _), s.tar = null, Y.recover("TouchData", s); } else ; (s = this.getTouchFromArr(i, this.preOvers)) && c && ((h = this.getEles(s.tar, null, h)) && h.length > 0 && this.sendEvents(h, "mouseout"), this.removeTouchFromArr(i, this.preOvers), s.tar = null, Y.recover("TouchData", s)), this._clearTempArrs(); } }, t._oldArr = [], t._newArr = [], t._tEleArr = [], n(t, [ "I", function() { return this.I = new t(); } ]), t; }(), x = function() { function t() { this._action = null; } s(t, "laya.filters.Filter"); var e = t.prototype; return i.imps(e, { "laya.filters.IFilter": !0 }), e.callNative = function(t) {}, a(0, e, "type", function() { return -1; }), a(0, e, "action", function() { return this._action; }), t.BLUR = 16, t.COLOR = 32, t.GLOW = 8, t._filterStart = null, t._filterEnd = null, t._EndTarget = null, t._recycleScope = null, t._filter = null, t._useSrc = null, t._endSrc = null, t._useOut = null, t._endOut = null, t; }(), b = function() { function t() { this.data = null; } s(t, "laya.filters.ColorFilterAction"); var e = t.prototype; return i.imps(e, { "laya.filters.IFilterAction": !0 }), e.apply = function(t) { var e = t.ctx.ctx, i = t.ctx.ctx.canvas; if (0 == i.width || 0 == i.height) return i; for (var n, s = e.getImageData(0, 0, i.width, i.height), a = s.data, r = 0, o = a.length; r < o; r += 4) n = this.getColor(a[r], a[r + 1], a[r + 2], a[r + 3]), 0 != a[r + 3] && (a[r] = n[0], a[r + 1] = n[1], a[r + 2] = n[2], a[r + 3] = n[3]); return e.putImageData(s, 0, 0), t; }, e.getColor = function(t, e, i, n) { var s = []; if (this.data._mat && this.data._alpha) { var a = this.data._mat, r = this.data._alpha; s[0] = a[0] * t + a[1] * e + a[2] * i + a[3] * n + r[0], s[1] = a[4] * t + a[5] * e + a[6] * i + a[7] * n + r[1], s[2] = a[8] * t + a[9] * e + a[10] * i + a[11] * n + r[2], s[3] = a[12] * t + a[13] * e + a[14] * i + a[15] * n + r[3]; } return s; }, t; }(), w = (function() { function t() {} s(t, "laya.maths.Arith"), t.formatR = function(t) { return t > Math.PI && (t -= 2 * Math.PI), t < -Math.PI && (t += 2 * Math.PI), t; }, t.isPOT = function(t, e) { return t > 0 && 0 == (t & t - 1) && e > 0 && 0 == (e & e - 1); }, t.setMatToArray = function(t, e) { t.a, t.b, t.c, t.d, t.tx, t.ty, e[0] = t.a, e[1] = t.b, e[4] = t.c, e[5] = t.d, e[12] = t.tx, e[13] = t.ty; }; }(), function() { function t() { this._controlPoints = [ new I(), new I(), new I() ], this._calFun = this.getPoint2; } s(t, "laya.maths.Bezier"); var e = t.prototype; return e._switchPoint = function(t, e) { var i = this._controlPoints.shift(); i.setTo(t, e), this._controlPoints.push(i); }, e.getPoint2 = function(t, e) { var i = this._controlPoints[0], n = this._controlPoints[1], s = this._controlPoints[2], a = Math.pow(1 - t, 2) * i.x + 2 * t * (1 - t) * n.x + Math.pow(t, 2) * s.x, r = Math.pow(1 - t, 2) * i.y + 2 * t * (1 - t) * n.y + Math.pow(t, 2) * s.y; e.push(a, r); }, e.getPoint3 = function(t, e) { var i = this._controlPoints[0], n = this._controlPoints[1], s = this._controlPoints[2], a = this._controlPoints[3], r = Math.pow(1 - t, 3) * i.x + 3 * n.x * t * (1 - t) * (1 - t) + 3 * s.x * t * t * (1 - t) + a.x * Math.pow(t, 3), o = Math.pow(1 - t, 3) * i.y + 3 * n.y * t * (1 - t) * (1 - t) + 3 * s.y * t * t * (1 - t) + a.y * Math.pow(t, 3); e.push(r, o); }, e.insertPoints = function(t, e) { var i = NaN, n = NaN; for (n = 1 / (t = t > 0 ? t : 5), i = 0; i <= 1; i += n) this._calFun(i, e); }, e.getBezierPoints = function(t, e, i) { void 0 === e && (e = 5), void 0 === i && (i = 2); var n = 0, s = 0; if ((s = t.length) < 2 * (i + 1)) return []; var a; switch (a = [], i) { case 2: this._calFun = this.getPoint2; break; case 3: this._calFun = this.getPoint3; break; default: return []; } for (;this._controlPoints.length <= i; ) this._controlPoints.push(new I()); for (n = 0; n < 2 * i; n += 2) this._switchPoint(t[n], t[n + 1]); for (n = 2 * i; n < s; n += 2) this._switchPoint(t[n], t[n + 1]), n / 2 % i == 0 && this.insertPoints(e, a); return a; }, n(t, [ "I", function() { return this.I = new t(); } ]), t; }()), C = function() { function t() {} return s(t, "laya.maths.GrahamScan"), t.multiply = function(t, e, i) { return (t.x - i.x) * (e.y - i.y) - (e.x - i.x) * (t.y - i.y); }, t.dis = function(t, e) { return (t.x - e.x) * (t.x - e.x) + (t.y - e.y) * (t.y - e.y); }, t._getPoints = function(e, i, n) { for (void 0 === i && (i = !1), t._mPointList || (t._mPointList = []); t._mPointList.length < e; ) t._mPointList.push(new I()); return n || (n = []), n.length = 0, i ? t.getFrom(n, t._mPointList, e) : t.getFromR(n, t._mPointList, e), n; }, t.getFrom = function(t, e, i) { var n = 0; for (n = 0; n < i; n++) t.push(e[n]); return t; }, t.getFromR = function(t, e, i) { var n = 0; for (n = 0; n < i; n++) t.push(e.pop()); return t; }, t.pListToPointList = function(e, i) { void 0 === i && (i = !1); var n = 0, s = e.length / 2, a = t._getPoints(s, i, t._tempPointList); for (n = 0; n < s; n++) a[n].setTo(e[n + n], e[n + n + 1]); return a; }, t.pointListToPlist = function(e) { var i, n = 0, s = e.length, a = t._temPList; for (a.length = 0, n = 0; n < s; n++) i = e[n], a.push(i.x, i.y); return a; }, t.scanPList = function(e) { return $.copyArray(e, t.pointListToPlist(t.scan(t.pListToPointList(e, !0)))); }, t.scan = function(e) { var i, n, s, a = 0, r = 0, o = 0, h = e.length, l = {}; for ((n = t._temArr).length = 0, a = (h = e.length) - 1; a >= 0; a--) s = (i = e[a]).x + "_" + i.y, l.hasOwnProperty(s) || (l[s] = !0, n.push(i)); for (h = n.length, $.copyArray(e, n), a = 1; a < h; a++) (e[a].y < e[o].y || e[a].y == e[o].y && e[a].x < e[o].x) && (o = a); for (i = e[0], e[0] = e[o], e[o] = i, a = 1; a < h - 1; a++) { for (o = a, r = a + 1; r < h; r++) (t.multiply(e[r], e[o], e[0]) > 0 || 0 == t.multiply(e[r], e[o], e[0]) && t.dis(e[0], e[r]) < t.dis(e[0], e[o])) && (o = r); i = e[a], e[a] = e[o], e[o] = i; } if (n = t._temArr, n.length = 0, e.length < 3) return $.copyArray(n, e); for (n.push(e[0], e[1], e[2]), a = 3; a < h; a++) { for (;n.length >= 2 && t.multiply(e[a], n[n.length - 1], n[n.length - 2]) >= 0; ) n.pop(); e[a] && n.push(e[a]); } return n; }, t._mPointList = null, t._tempPointList = [], t._temPList = [], t._temArr = [], t; }(), S = function() { function t() {} return s(t, "laya.maths.MathUtil"), t.subtractVector3 = function(t, e, i) { i[0] = t[0] - e[0], i[1] = t[1] - e[1], i[2] = t[2] - e[2]; }, t.lerp = function(t, e, i) { return t * (1 - i) + e * i; }, t.scaleVector3 = function(t, e, i) { i[0] = t[0] * e, i[1] = t[1] * e, i[2] = t[2] * e; }, t.lerpVector3 = function(t, e, i, n) { var s = t[0], a = t[1], r = t[2]; n[0] = s + i * (e[0] - s), n[1] = a + i * (e[1] - a), n[2] = r + i * (e[2] - r); }, t.lerpVector4 = function(t, e, i, n) { var s = t[0], a = t[1], r = t[2], o = t[3]; n[0] = s + i * (e[0] - s), n[1] = a + i * (e[1] - a), n[2] = r + i * (e[2] - r), n[3] = o + i * (e[3] - o); }, t.slerpQuaternionArray = function(t, e, i, n, s, a, r) { var o, h, l, u, c, _ = t[e + 0], d = t[e + 1], p = t[e + 2], f = t[e + 3], g = i[n + 0], m = i[n + 1], v = i[n + 2], y = i[n + 3]; return (h = _ * g + d * m + p * v + f * y) < 0 && (h = -h, g = -g, m = -m, v = -v, y = -y), 1 - h > 1e-6 ? (o = Math.acos(h), l = Math.sin(o), u = Math.sin((1 - s) * o) / l, c = Math.sin(s * o) / l) : (u = 1 - s, c = s), a[r + 0] = u * _ + c * g, a[r + 1] = u * d + c * m, a[r + 2] = u * p + c * v, a[r + 3] = u * f + c * y, a; }, t.getRotation = function(t, e, i, n) { return Math.atan2(n - e, i - t) / Math.PI * 180; }, t.sortBigFirst = function(t, e) { return t == e ? 0 : e > t ? 1 : -1; }, t.sortSmallFirst = function(t, e) { return t == e ? 0 : e > t ? -1 : 1; }, t.sortNumBigFirst = function(t, e) { return parseFloat(e) - parseFloat(t); }, t.sortNumSmallFirst = function(t, e) { return parseFloat(t) - parseFloat(e); }, t.sortByKey = function(e, i, n) { void 0 === i && (i = !1), void 0 === n && (n = !0); var s; return s = i ? n ? t.sortNumBigFirst : t.sortBigFirst : n ? t.sortNumSmallFirst : t.sortSmallFirst, function(t, i) { return s(t[e], i[e]); }; }, t; }(), T = function() { function t(t, e, i, n, s, a) { this.inPool = !1, this.bTransform = !1, void 0 === t && (t = 1), void 0 === e && (e = 0), void 0 === i && (i = 0), void 0 === n && (n = 1), void 0 === s && (s = 0), void 0 === a && (a = 0), this.a = t, this.b = e, this.c = i, this.d = n, this.tx = s, this.ty = a, this._checkTransform(); } s(t, "laya.maths.Matrix"); var e = t.prototype; return e.identity = function() { return this.a = this.d = 1, this.b = this.tx = this.ty = this.c = 0, this.bTransform = !1, this; }, e._checkTransform = function() { return this.bTransform = 1 !== this.a || 0 !== this.b || 0 !== this.c || 1 !== this.d; }, e.setTranslate = function(t, e) { return this.tx = t, this.ty = e, this; }, e.translate = function(t, e) { return this.tx += t, this.ty += e, this; }, e.scale = function(t, e) { this.a *= t, this.d *= e, this.c *= t, this.b *= e, this.tx *= t, this.ty *= e, this.bTransform = !0; }, e.rotate = function(t) { var e = Math.cos(t), i = Math.sin(t), n = this.a, s = this.c, a = this.tx; this.a = n * e - this.b * i, this.b = n * i + this.b * e, this.c = s * e - this.d * i, this.d = s * i + this.d * e, this.tx = a * e - this.ty * i, this.ty = a * i + this.ty * e, this.bTransform = !0; }, e.skew = function(t, e) { var i = Math.tan(t), n = Math.tan(e), s = this.a, a = this.b; return this.a += n * this.c, this.b += n * this.d, this.c += i * s, this.d += i * a, this; }, e.invertTransformPoint = function(t) { var e = this.a, i = this.b, n = this.c, s = this.d, a = this.tx, r = e * s - i * n, o = s / r, h = -i / r, l = -n / r, u = e / r, c = (n * this.ty - s * a) / r, _ = -(e * this.ty - i * a) / r; return t.setTo(o * t.x + l * t.y + c, h * t.x + u * t.y + _); }, e.transformPoint = function(t) { return t.setTo(this.a * t.x + this.c * t.y + this.tx, this.b * t.x + this.d * t.y + this.ty); }, e.transformPointN = function(t) { return t.setTo(this.a * t.x + this.c * t.y, this.b * t.x + this.d * t.y); }, e.transformPointArray = function(t, e) { for (var i = t.length, n = 0; n < i; n += 2) { var s = t[n], a = t[n + 1]; e[n] = this.a * s + this.c * a + this.tx, e[n + 1] = this.b * s + this.d * a + this.ty; } return e; }, e.transformPointArrayScale = function(t, e) { for (var i = t.length, n = 0; n < i; n += 2) { var s = t[n], a = t[n + 1]; e[n] = this.a * s + this.c * a, e[n + 1] = this.b * s + this.d * a; } return e; }, e.getScaleX = function() { return 0 === this.b ? this.a : Math.sqrt(this.a * this.a + this.b * this.b); }, e.getScaleY = function() { return 0 === this.c ? this.d : Math.sqrt(this.c * this.c + this.d * this.d); }, e.invert = function() { var t = this.a, e = this.b, i = this.c, n = this.d, s = this.tx, a = t * n - e * i; return this.a = n / a, this.b = -e / a, this.c = -i / a, this.d = t / a, this.tx = (i * this.ty - n * s) / a, this.ty = -(t * this.ty - e * s) / a, this; }, e.setTo = function(t, e, i, n, s, a) { return this.a = t, this.b = e, this.c = i, this.d = n, this.tx = s, this.ty = a, this; }, e.concat = function(t) { var e = this.a, i = this.c, n = this.tx; return this.a = e * t.a + this.b * t.c, this.b = e * t.b + this.b * t.d, this.c = i * t.a + this.d * t.c, this.d = i * t.b + this.d * t.d, this.tx = n * t.a + this.ty * t.c + t.tx, this.ty = n * t.b + this.ty * t.d + t.ty, this; }, e.scaleEx = function(t, e) { var i = this.a, n = this.b, s = this.c, a = this.d; 0 !== n || 0 !== s ? (this.a = t * i, this.b = t * n, this.c = e * s, this.d = e * a) : (this.a = t * i, this.b = 0 * a, this.c = 0 * i, this.d = e * a), this.bTransform = !0; }, e.rotateEx = function(t) { var e = Math.cos(t), i = Math.sin(t), n = this.a, s = this.b, a = this.c, r = this.d; 0 !== s || 0 !== a ? (this.a = e * n + i * a, this.b = e * s + i * r, this.c = -i * n + e * a, this.d = -i * s + e * r) : (this.a = e * n, this.b = i * r, this.c = -i * n, this.d = e * r), this.bTransform = !0; }, e.clone = function() { var e = t.create(); return e.a = this.a, e.b = this.b, e.c = this.c, e.d = this.d, e.tx = this.tx, e.ty = this.ty, e.bTransform = this.bTransform, e; }, e.copyTo = function(t) { return t.a = this.a, t.b = this.b, t.c = this.c, t.d = this.d, t.tx = this.tx, t.ty = this.ty, t.bTransform = this.bTransform, t; }, e.toString = function() { return this.a + "," + this.b + "," + this.c + "," + this.d + "," + this.tx + "," + this.ty; }, e.destroy = function() { if (!this.inPool) { var e = t._cache; this.inPool = !0, e._length || (e._length = 0), e[e._length++] = this, this.a = this.d = 1, this.b = this.c = this.tx = this.ty = 0, this.bTransform = !1; } }, t.mul = function(t, e, i) { var n = t.a, s = t.b, a = t.c, r = t.d, o = t.tx, h = t.ty, l = e.a, u = e.b, c = e.c, _ = e.d, d = e.tx, p = e.ty; return 0 !== u || 0 !== c ? (i.a = n * l + s * c, i.b = n * u + s * _, i.c = a * l + r * c, i.d = a * u + r * _, i.tx = l * o + c * h + d, i.ty = u * o + _ * h + p) : (i.a = n * l, i.b = s * _, i.c = a * l, i.d = r * _, i.tx = l * o + d, i.ty = _ * h + p), i; }, t.mul16 = function(t, e, i) { var n = t.a, s = t.b, a = t.c, r = t.d, o = t.tx, h = t.ty, l = e.a, u = e.b, c = e.c, _ = e.d, d = e.tx, p = e.ty; return 0 !== u || 0 !== c ? (i[0] = n * l + s * c, i[1] = n * u + s * _, i[4] = a * l + r * c, i[5] = a * u + r * _, i[12] = l * o + c * h + d, i[13] = u * o + _ * h + p) : (i[0] = n * l, i[1] = s * _, i[4] = a * l, i[5] = r * _, i[12] = l * o + d, i[13] = _ * h + p), i; }, t.mulPre = function(t, e, i, n, s, a, r, o) { var h = t.a, l = t.b, u = t.c, c = t.d, _ = t.tx, d = t.ty; return 0 !== i || 0 !== n ? (o.a = h * e + l * n, o.b = h * i + l * s, o.c = u * e + c * n, o.d = u * i + c * s, o.tx = e * _ + n * d + a, o.ty = i * _ + s * d + r) : (o.a = h * e, o.b = l * s, o.c = u * e, o.d = c * s, o.tx = e * _ + a, o.ty = s * d + r), o; }, t.mulPos = function(t, e, i, n, s, a, r, o) { var h = t.a, l = t.b, u = t.c, c = t.d, _ = t.tx, d = t.ty; return 0 !== l || 0 !== u ? (o.a = e * h + i * u, o.b = e * l + i * c, o.c = n * h + s * u, o.d = n * l + s * c, o.tx = h * a + u * r + _, o.ty = l * a + c * r + d) : (o.a = e * h, o.b = i * c, o.c = n * h, o.d = s * c, o.tx = h * a + _, o.ty = c * r + d), o; }, t.preMul = function(t, e, i) { var n = t.a, s = t.b, a = t.c, r = t.d, o = e.a, h = e.b, l = e.c, u = e.d, c = e.tx, _ = e.ty; return i.a = o * n, i.b = i.c = 0, i.d = u * r, i.tx = c * n + t.tx, i.ty = _ * r + t.ty, 0 === h && 0 === l && 0 === s && 0 === a || (i.a += h * a, i.d += l * s, i.b += o * s + h * r, i.c += l * n + u * a, i.tx += _ * a, i.ty += c * s), i; }, t.preMulXY = function(t, e, i, n) { var s = t.a, a = t.b, r = t.c, o = t.d; return n.a = s, n.b = a, n.c = r, n.d = o, n.tx = e * s + t.tx + i * r, n.ty = i * o + t.ty + e * a, n; }, t.create = function() { var e = t._cache, i = e._length ? e[--e._length] : new t(); return i.inPool = !1, i; }, t.EMPTY = new t(), t.TEMP = new t(), t._cache = [], t; }(), I = function() { function t(t, e) { void 0 === t && (t = 0), void 0 === e && (e = 0), this.x = t, this.y = e; } s(t, "laya.maths.Point"); var e = t.prototype; return e.setTo = function(t, e) { return this.x = t, this.y = e, this; }, e.distance = function(t, e) { return Math.sqrt((this.x - t) * (this.x - t) + (this.y - e) * (this.y - e)); }, e.toString = function() { return this.x + "," + this.y; }, e.normalize = function() { var t = Math.sqrt(this.x * this.x + this.y * this.y); if (t > 0) { var e = 1 / t; this.x *= e, this.y *= e; } }, t.TEMP = new t(), t.EMPTY = new t(), t; }(), M = function() { function t(t, e, i, n) { void 0 === t && (t = 0), void 0 === e && (e = 0), void 0 === i && (i = 0), void 0 === n && (n = 0), this.x = t, this.y = e, this.width = i, this.height = n; } s(t, "laya.maths.Rectangle"); var e = t.prototype; return e.setTo = function(t, e, i, n) { return this.x = t, this.y = e, this.width = i, this.height = n, this; }, e.copyFrom = function(t) { return this.x = t.x, this.y = t.y, this.width = t.width, this.height = t.height, this; }, e.contains = function(t, e) { return !(this.width <= 0 || this.height <= 0) && (t >= this.x && t < this.right && e >= this.y && e < this.bottom); }, e.intersects = function(t) { return !(t.x > this.x + this.width || t.x + t.width < this.x || t.y > this.y + this.height || t.y + t.height < this.y); }, e.intersection = function(e, i) { return this.intersects(e) ? (i || (i = new t()), i.x = Math.max(this.x, e.x), i.y = Math.max(this.y, e.y), i.width = Math.min(this.right, e.right) - i.x, i.height = Math.min(this.bottom, e.bottom) - i.y, i) : null; }, e.union = function(e, i) { return i || (i = new t()), this.clone(i), e.width <= 0 || e.height <= 0 ? i : (i.addPoint(e.x, e.y), i.addPoint(e.right, e.bottom), this); }, e.clone = function(e) { return e || (e = new t()), e.x = this.x, e.y = this.y, e.width = this.width, e.height = this.height, e; }, e.toString = function() { return this.x + "," + this.y + "," + this.width + "," + this.height; }, e.equals = function(t) { return !(!t || t.x !== this.x || t.y !== this.y || t.width !== this.width || t.height !== this.height); }, e.addPoint = function(t, e) { return this.x > t && (this.width += this.x - t, this.x = t), this.y > e && (this.height += this.y - e, this.y = e), this.width < t - this.x && (this.width = t - this.x), this.height < e - this.y && (this.height = e - this.y), this; }, e._getBoundPoints = function() { var e = t._temB; return e.length = 0, 0 == this.width || 0 == this.height ? e : (e.push(this.x, this.y, this.x + this.width, this.y, this.x, this.y + this.height, this.x + this.width, this.y + this.height), e); }, e.isEmpty = function() { return this.width <= 0 || this.height <= 0; }, a(0, e, "right", function() { return this.x + this.width; }), a(0, e, "bottom", function() { return this.y + this.height; }), t._getBoundPointS = function(e, i, n, s) { var a = t._temA; return a.length = 0, 0 == n || 0 == s ? a : (a.push(e, i, e + n, i, e, i + s, e + n, i + s), a); }, t._getWrapRec = function(e, i) { if (!e || e.length < 1) return i ? i.setTo(0, 0, 0, 0) : t.TEMP.setTo(0, 0, 0, 0); i = i || new t(); var n, s, a, r, o, h = e.length, l = I.TEMP; for (a = o = -(s = r = 99999), n = 0; n < h; n += 2) l.x = e[n], l.y = e[n + 1], s = s < l.x ? s : l.x, r = r < l.y ? r : l.y, a = a > l.x ? a : l.x, o = o > l.y ? o : l.y; return i.setTo(s, r, a - s, o - r); }, t.EMPTY = new t(), t.TEMP = new t(), t._temB = [], t._temA = [], t; }(), E = function() { function t() {} return s(t, "laya.media.SoundManager"), a(1, t, "useAudioMusic", function() { return t._useAudioMusic; }, function(e) { t._useAudioMusic = e, t._musicClass = e ? et : null; }), a(1, t, "autoStopMusic", function() { return t._autoStopMusic; }, function(e) { i.stage.off("blur", null, t._stageOnBlur), i.stage.off("focus", null, t._stageOnFocus), i.stage.off("visibilitychange", null, t._visibilityChange), t._autoStopMusic = e, e && (i.stage.on("blur", null, t._stageOnBlur), i.stage.on("focus", null, t._stageOnFocus), i.stage.on("visibilitychange", null, t._visibilityChange)); }), a(1, t, "muted", function() { return t._muted; }, function(e) { e != t._muted && (e && t.stopAllSound(), t.musicMuted = e, t._muted = e); }), a(1, t, "musicMuted", function() { return t._musicMuted; }, function(e) { e != t._musicMuted && (e ? (t._tMusic && t._musicChannel && !t._musicChannel.isStopped ? k.isConchApp ? t._musicChannel._audio && (t._musicChannel._audio.muted = !0) : t._musicChannel.pause() : t._musicChannel = null, t._musicMuted = e) : (t._musicMuted = e, t._tMusic && t._musicChannel && (k.isConchApp ? t._musicChannel._audio && (t._musicChannel._audio.muted = !1) : t._musicChannel.resume()))); }), a(1, t, "soundMuted", function() { return t._soundMuted; }, function(e) { t._soundMuted = e; }), t.addChannel = function(e) { t._channels.indexOf(e) >= 0 || t._channels.push(e); }, t.removeChannel = function(e) { var i = 0; for (i = t._channels.length - 1; i >= 0; i--) t._channels[i] == e && t._channels.splice(i, 1); }, t.disposeSoundIfNotUsed = function(e) { var i = 0; for (i = t._channels.length - 1; i >= 0; i--) if (t._channels[i].url == e) return; t.destroySound(e); }, t._visibilityChange = function() { i.stage.isVisibility ? t._stageOnFocus() : t._stageOnBlur(); }, t._stageOnBlur = function() { t._isActive = !1, t._musicChannel && (t._musicChannel.isStopped || (t._blurPaused = !0, t._musicChannel.pause())), t.stopAllSound(), i.stage.once("mousedown", null, t._stageOnFocus); }, t._recoverWebAudio = function() { st.ctx && "running" != st.ctx.state && st.ctx.resume && st.ctx.resume(); }, t._stageOnFocus = function() { t._isActive = !0, t._recoverWebAudio(), i.stage.off("mousedown", null, t._stageOnFocus), t._blurPaused && t._musicChannel && t._musicChannel.isStopped && (t._blurPaused = !1, t._musicChannel.resume()); }, t.playSound = function(e, n, s, a, r) { if (void 0 === n && (n = 1), void 0 === r && (r = 0), !t._isActive || !e) return null; if (t._muted) return null; if (t._recoverWebAudio(), (e = P.formatURL(e)) == t._tMusic) { if (t._musicMuted) return null; } else { if (k.isConchApp) { var o = $.getFileExtension(e); if ("wav" != o && "ogg" != o) return alert("The sound only supports wav or ogg format,for optimal performance reason,please refer to the official website document."), null; } if (t._soundMuted) return null; } var h; B.onMiniGame || B.onKGMiniGame || B.onQQMiniGame || B.onBLMiniGame || (h = i.loader.getRes(e)), a || (a = t._soundClass), h || ((h = new a()).load(e), B.onMiniGame || B.onKGMiniGame || B.onQQMiniGame || B.onBLMiniGame || rt.cacheRes(e, h)); var l; return (l = h.play(r, n)) ? (l.url = e, l.volume = e == t._tMusic ? t.musicVolume : t.soundVolume, l.completeHandler = s, l) : null; }, t.destroySound = function(t) { var e = i.loader.getRes(t); e && (rt.clearRes(t), e.dispose()); }, t.playMusic = function(e, i, n, s) { return void 0 === i && (i = 0), void 0 === s && (s = 0), e = P.formatURL(e), t._tMusic = e, t._musicChannel && t._musicChannel.stop(), t._musicChannel = t.playSound(e, i, n, t._musicClass, s); }, t.stopSound = function(e) { e = P.formatURL(e); var i, n = 0; for (n = t._channels.length - 1; n >= 0; n--) (i = t._channels[n]).url == e && i.stop(); }, t.stopAll = function() { t._tMusic = null; var e = 0; for (e = t._channels.length - 1; e >= 0; e--) t._channels[e].stop(); }, t.stopAllSound = function() { var e, i = 0; for (i = t._channels.length - 1; i >= 0; i--) (e = t._channels[i]).url != t._tMusic && e.stop(); }, t.stopMusic = function() { t._musicChannel && t._musicChannel.stop(), t._tMusic = null; }, t.setSoundVolume = function(e, i) { if (i) i = P.formatURL(i), t._setVolume(i, e); else { t.soundVolume = e; var n, s = 0; for (s = t._channels.length - 1; s >= 0; s--) (n = t._channels[s]).url != t._tMusic && (n.volume = e); } }, t.setMusicVolume = function(e) { t.musicVolume = e, t._setVolume(t._tMusic, e); }, t._setVolume = function(e, i) { e = P.formatURL(e); var n, s = 0; for (s = t._channels.length - 1; s >= 0; s--) (n = t._channels[s]).url == e && (n.volume = i); }, t.musicVolume = 1, t.soundVolume = 1, t.playbackRate = 1, t._useAudioMusic = !0, t._muted = !1, t._soundMuted = !1, t._musicMuted = !1, t._tMusic = null, t._musicChannel = null, t._channels = [], t._autoStopMusic = !1, t._blurPaused = !1, t._isActive = !0, t._soundClass = null, t._musicClass = null, t.autoReleaseSound = !0, t; }(), A = function() { function e() {} var i; return s(e, "laya.net.LocalStorage"), e.__init__ = function() { e._baseClass || (e._baseClass = i, i.init()), e.items = e._baseClass.items, e.support = e._baseClass.support; }, e.setItem = function(t, i) { e._baseClass.setItem(t, i); }, e.getItem = function(t) { return e._baseClass.getItem(t); }, e.setJSON = function(t, i) { e._baseClass.setJSON(t, i); }, e.getJSON = function(t) { return e._baseClass.getJSON(t); }, e.removeItem = function(t) { e._baseClass.removeItem(t); }, e.clear = function() { e._baseClass.clear(); }, e._baseClass = null, e.items = null, e.support = !1, e.__init$ = function() { i = function() { function e() {} return s(e, ""), e.init = function() { try { e.support = !0, e.items = t.localStorage, e.setItem("laya", "1"), e.removeItem("laya"); } catch (t) { e.support = !1; } e.support || console.log("LocalStorage is not supprot or browser is private mode."); }, e.setItem = function(t, i) { try { e.support && e.items.setItem(t, i); } catch (t) { console.warn("set localStorage failed", t); } }, e.getItem = function(t) { return e.support ? e.items.getItem(t) : null; }, e.setJSON = function(t, i) { try { e.support && e.items.setItem(t, JSON.stringify(i)); } catch (t) { console.warn("set localStorage failed", t); } }, e.getJSON = function(t) { return JSON.parse(e.support ? e.items.getItem(t) : null); }, e.removeItem = function(t) { e.support && e.items.removeItem(t); }, e.clear = function() { e.support && e.items.clear(); }, e.items = null, e.support = !1, e; }(); }, e; }(), L = (function() { function t() {} s(t, "laya.net.ResourceVersion"), t.enable = function(e, n, s) { void 0 === s && (s = 2), laya.net.ResourceVersion.type = s, i.loader.load(e, l.create(null, t.onManifestLoaded, [ n ]), null, "json"), P.customFormat = t.addVersionPrefix; }, t.onManifestLoaded = function(e, i) { t.manifest = i, e.run(), i || console.warn("资源版本清单文件不存在,不使用资源版本管理。忽略ERR_FILE_NOT_FOUND错误。"); }, t.addVersionPrefix = function(e) { return t.manifest && t.manifest[e] ? 2 == t.type ? t.manifest[e] : t.manifest[e] + "/" + e : e; }, t.FOLDER_VERSION = 1, t.FILENAME_VERSION = 2, t.manifest = null, t.type = 1; }(), function() { function t() { this.fontName = null, this.complete = null, this.err = null, this._fontTxt = null, this._url = null, this._div = null, this._txtWidth = NaN, this._http = null; } s(t, "laya.net.TTFLoader"); var e = t.prototype; return e.load = function(t) { this._url = t; var e = t.split(".ttf")[0].split("/"); this.fontName = e[e.length - 1], B.window.conch ? this._loadConch() : B.window.FontFace ? this._loadWithFontFace() : this._loadWithCSS(); }, e._loadConch = function() { this._http = new at(), this._http.on("error", this, this._onErr), this._http.on("complete", this, this._onHttpLoaded), this._http.send(this._url, null, "get", "arraybuffer"); }, e._onHttpLoaded = function(t) { B.window.conch.setFontFaceFromBuffer(this.fontName, t), this._clearHttp(), this._complete(); }, e._clearHttp = function() { this._http && (this._http.off("error", this, this._onErr), this._http.off("complete", this, this._onHttpLoaded), this._http = null); }, e._onErr = function() { this._clearHttp(), this.err && (this.err.runWith("fail:" + this._url), this.err = null); }, e._complete = function() { i.timer.clear(this, this._complete), i.timer.clear(this, this._checkComplete), this._div && this._div.parentNode && (this._div.parentNode.removeChild(this._div), this._div = null), this.complete && (this.complete.runWith(this), this.complete = null); }, e._checkComplete = function() { r.measureText("LayaTTFFont", this._fontTxt).width != this._txtWidth && this._complete(); }, e._loadWithFontFace = function() { var t = new B.window.FontFace(this.fontName, "url('" + this._url + "')"); B.window.document.fonts.add(t); var e = this; t.loaded.then(function() { e._complete(); }), t.load(); }, e._createDiv = function() { this._div = B.createElement("div"), this._div.innerHTML = "laya"; var t = this._div.style; t.fontFamily = this.fontName, t.position = "absolute", t.left = "-100px", t.top = "-100px", B.document.body.appendChild(this._div); }, e._loadWithCSS = function() { var t = this, e = B.createElement("style"); e.type = "text/css", B.document.body.appendChild(e), e.textContent = "@font-face { font-family:'" + this.fontName + "'; src:url('" + this._url + "');}", this._fontTxt = "40px " + this.fontName, this._txtWidth = r.measureText("LayaTTFFont", this._fontTxt).width; var n = this; e.onload = function() { i.timer.once(1e4, n, t._complete); }, i.timer.loop(20, this, this._checkComplete), this._createDiv(); }, t._testString = "LayaTTFFont", t; }()), P = function() { function t(e) { this._url = null, this._path = null, this._url = t.formatURL(e), this._path = t.getPath(e); } s(t, "laya.net.URL"); var e = t.prototype; return a(0, e, "path", function() { return this._path; }), a(0, e, "url", function() { return this._url; }), t.formatURL = function(e, i) { if (!e) return "null path"; if (e.indexOf(":") > 0) return e; null != t.customFormat && (e = t.customFormat(e, i)); var n = e.charAt(0); if ("." === n) return t.formatRelativePath((i || t.basePath) + e); if ("~" === n) return t.rootPath + e.substring(1); if ("d" === n) { if (0 === e.indexOf("data:image")) return e; } else if ("/" === n) return e; return (i || t.basePath) + e; }, t.formatRelativePath = function(t) { for (var e = t.split("/"), i = 0, n = e.length; i < n; i++) ".." == e[i] && (e.splice(i - 1, 2), i -= 2); return e.join("/"); }, t.isAbsolute = function(t) { return t.indexOf(":") > 0 || "/" == t.charAt(0); }, t.getPath = function(t) { var e = t.lastIndexOf("/"); return e > 0 ? t.substr(0, e + 1) : ""; }, t.getFileName = function(t) { var e = t.lastIndexOf("/"); return e > 0 ? t.substr(e + 1) : t; }, t.version = {}, t.basePath = "", t.rootPath = "", t.customFormat = function(e) { var i = t.version[e]; return !k.isConchApp && i && (e += "?v=" + i), e; }, t; }(), k = function() { function e(t, n) { function s(t) { i.stage._loop(), B.window.requestAnimationFrame(s); } this._timeId = 0; var a = e._mainCanvas.source.style; a.position = "absolute", a.top = a.left = "0px", a.background = "#000000", e._mainCanvas.source.id = "layaCanvas"; var r = laya.renders.Render.isWebGL; e._mainCanvas.source.width = t, e._mainCanvas.source.height = n, r && e.WebGL.init(e._mainCanvas, t, n), B.onKGMiniGame || B.container.appendChild(e._mainCanvas.source), (e._context = new R(t, n, r ? null : e._mainCanvas)).ctx.setIsMainContext(), B.window.requestAnimationFrame(s), i.stage.on("visibilitychange", this, this._onVisibilitychange); } s(e, "laya.renders.Render"); var n = e.prototype; return n._onVisibilitychange = function() { i.stage.isVisibility ? 0 != this._timeId && B.window.clearInterval(this._timeId) : this._timeId = B.window.setInterval(this._enterFrame, 1e3); }, n._enterFrame = function(t) { i.stage._loop(); }, a(1, e, "context", function() { return e._context; }), a(1, e, "canvas", function() { return e._mainCanvas.source; }), e._context = null, e._mainCanvas = null, e.WebGL = null, e.isConchNode = !1, e.isConchApp = !1, e.isConchWebGL = !1, e.isWebGL = !1, e.is3DMode = !1, e.optimizeTextureMemory = function(t, e) { return !0; }, e.__init$ = function() { t.ConchRenderType = t.ConchRenderType || 1, t.ConchRenderType |= t.conch ? 4 : 0, e.isConchNode = 5 == (5 & t.ConchRenderType), e.isConchApp = 4 == (4 & t.ConchRenderType), e.isConchWebGL = 6 == t.ConchRenderType; }, e; }(), R = function() { function t(e, i, n) { this.x = 0, this.y = 0, this._drawTexture = function(t, e, i) { i[0].loaded && this.ctx.drawTexture(i[0], i[1], i[2], i[3], i[4], t, e); }, this._fillTexture = function(t, e, i) { i[0].loaded && this.ctx.fillTexture(i[0], i[1] + t, i[2] + e, i[3], i[4], i[5], i[6], i[7]); }, this._drawTextureWithTransform = function(t, e, i) { i[0].loaded && this.ctx.drawTextureWithTransform(i[0], i[1], i[2], i[3], i[4], i[5], t, e, i[6]); }, this._fillQuadrangle = function(t, e, i) { this.ctx.fillQuadrangle(i[0], i[1], i[2], i[3], i[4]); }, this._drawRect = function(t, e, i) { var n = this.ctx; null != i[4] && (n.fillStyle = i[4], n.fillRect(t + i[0], e + i[1], i[2], i[3], null)), null != i[5] && (n.strokeStyle = i[5], n.lineWidth = i[6], n.strokeRect(t + i[0], e + i[1], i[2], i[3], i[6])); }, this._drawPie = function(t, e, i) { var n = this.ctx; k.isWebGL && n.setPathId(i[8]), n.beginPath(), k.isWebGL ? (n.movePath(i[0] + t, i[1] + e), n.moveTo(0, 0)) : n.moveTo(t + i[0], e + i[1]), n.arc(t + i[0], e + i[1], i[2], i[3], i[4]), n.closePath(), this._fillAndStroke(i[5], i[6], i[7], !0); }, this._clipRect = function(t, e, i) { this.ctx.clipRect(t + i[0], e + i[1], i[2], i[3]); }, this._fillRect = function(t, e, i) { this.ctx.fillRect(t + i[0], e + i[1], i[2], i[3], i[4]); }, this._drawCircle = function(e, i, n) { var s = this.ctx; k.isWebGL && s.setPathId(n[6]), X.drawCall++, s.beginPath(), k.isWebGL && s.movePath(n[0] + e, n[1] + i), s.arc(n[0] + e, n[1] + i, n[2], 0, t.PI2), s.closePath(), this._fillAndStroke(n[3], n[4], n[5], !0); }, this._fillCircle = function(e, i, n) { X.drawCall++; var s = this.ctx; s.beginPath(), s.fillStyle = n[3], s.arc(n[0] + e, n[1] + i, n[2], 0, t.PI2), s.fill(); }, this._setShader = function(t, e, i) { this.ctx.setShader(i[0]); }, this._drawLine = function(t, e, i) { var n = this.ctx; k.isWebGL && n.setPathId(i[6]), n.beginPath(), n.strokeStyle = i[4], n.lineWidth = i[5], k.isWebGL ? (n.movePath(t, e), n.moveTo(i[0], i[1]), n.lineTo(i[2], i[3])) : (n.moveTo(t + i[0], e + i[1]), n.lineTo(t + i[2], e + i[3])), n.stroke(); }, this._drawLines = function(t, e, i) { var n = this.ctx; k.isWebGL && n.setPathId(i[5]), n.beginPath(), t += i[0], e += i[1], k.isWebGL && n.movePath(t, e), n.strokeStyle = i[3], n.lineWidth = i[4]; var s = i[2], a = 2, r = s.length; if (k.isWebGL) for (n.moveTo(s[0], s[1]); a < r; ) n.lineTo(s[a++], s[a++]); else for (n.moveTo(t + s[0], e + s[1]); a < r; ) n.lineTo(t + s[a++], e + s[a++]); n.stroke(); }, this._drawLinesWebGL = function(t, e, i) { this.ctx.drawLines(t + this.x + i[0], e + this.y + i[1], i[2], i[3], i[4]); }, this._drawCurves = function(t, e, i) { this.ctx.drawCurves(t, e, i); }, this._draw = function(t, e, i) { i[0].call(null, this, t, e); }, this._transformByMatrix = function(t, e, i) { this.ctx.transformByMatrix(i[0]); }, this._setTransform = function(t, e, i) { this.ctx.setTransform(i[0], i[1], i[2], i[3], i[4], i[5]); }, this._setTransformByMatrix = function(t, e, i) { this.ctx.setTransformByMatrix(i[0]); }, this._save = function(t, e, i) { this.ctx.save(); }, this._restore = function(t, e, i) { this.ctx.restore(); }, this._translate = function(t, e, i) { this.ctx.translate(i[0], i[1]); }, this._transform = function(t, e, i) { this.ctx.translate(i[1] + t, i[2] + e); var n = i[0]; this.ctx.transform(n.a, n.b, n.c, n.d, n.tx, n.ty), this.ctx.translate(-t - i[1], -e - i[2]); }, this._rotate = function(t, e, i) { this.ctx.translate(i[1] + t, i[2] + e), this.ctx.rotate(i[0]), this.ctx.translate(-t - i[1], -e - i[2]); }, this._scale = function(t, e, i) { this.ctx.translate(i[2] + t, i[3] + e), this.ctx.scale(i[0], i[1]), this.ctx.translate(-t - i[2], -e - i[3]); }, this._alpha = function(t, e, i) { this.ctx.globalAlpha *= i[0]; }, this._setAlpha = function(t, e, i) { this.ctx.globalAlpha = i[0]; }, this._fillText = function(t, e, i) { this.ctx.fillText(i[0], i[1] + t, i[2] + e, i[3], i[4], i[5]); }, this._strokeText = function(t, e, i) { this.ctx.strokeText(i[0], i[1] + t, i[2] + e, i[3], i[4], i[5], i[6]); }, this._fillBorderText = function(t, e, i) { this.ctx.fillBorderText(i[0], i[1] + t, i[2] + e, i[3], i[4], i[5], i[6], i[7]); }, this._blendMode = function(t, e, i) { this.ctx.globalCompositeOperation = i[0]; }, this._beginClip = function(t, e, i) { this.ctx.beginClip && this.ctx.beginClip(t + i[0], e + i[1], i[2], i[3]); }, this._setIBVB = function(t, e, i) { this.ctx.setIBVB(i[0] + t, i[1] + e, i[2], i[3], i[4], i[5], i[6], i[7]); }, this._fillTrangles = function(t, e, i) { this.ctx.fillTrangles(i[0], i[1] + t, i[2] + e, i[3], i[4]); }, this._drawPath = function(t, e, i) { var n = this.ctx; k.isWebGL && n.setPathId(-1), n.beginPath(), t += i[0], e += i[1], k.isWebGL && n.movePath(t, e); for (var s = i[2], a = 0, r = s.length; a < r; a++) { var o = s[a]; switch (o[0]) { case "moveTo": k.isWebGL ? n.moveTo(o[1], o[2]) : n.moveTo(t + o[1], e + o[2]); break; case "lineTo": k.isWebGL ? n.lineTo(o[1], o[2]) : n.lineTo(t + o[1], e + o[2]); break; case "arcTo": k.isWebGL ? n.arcTo(o[1], o[2], o[3], o[4], o[5]) : n.arcTo(t + o[1], e + o[2], t + o[3], e + o[4], o[5]); break; case "closePath": n.closePath(); } } var h = i[3]; null != h && (n.fillStyle = h.fillStyle, n.fill()); var l = i[4]; null != l && (n.strokeStyle = l.strokeStyle, n.lineWidth = l.lineWidth || 1, n.lineJoin = l.lineJoin, n.lineCap = l.lineCap, n.miterLimit = l.miterLimit, n.stroke()); }, this.drawPoly = function(t, e, i) { this.ctx.drawPoly(t + this.x + i[0], e + this.y + i[1], i[2], i[3], i[4], i[5], i[6]); }, this._drawPoly = function(t, e, i) { var n = this.ctx, s = i[2], a = 2, r = s.length; if (k.isWebGL) for (n.setPathId(i[6]), n.beginPath(), t += i[0], e += i[1], n.movePath(t, e), n.moveTo(s[0], s[1]); a < r; ) n.lineTo(s[a++], s[a++]); else for (n.beginPath(), t += i[0], e += i[1], n.moveTo(t + s[0], e + s[1]); a < r; ) n.lineTo(t + s[a++], e + s[a++]); n.closePath(), this._fillAndStroke(i[3], i[4], i[5], i[7]); }, this._drawSkin = function(t, e, i) { var n = i[0]; if (n) { var s = this.ctx; n.render(s, t, e); } }, this._drawParticle = function(t, e, i) { this.ctx.drawParticle(t + this.x, e + this.y, i[0]); }, this._setFilters = function(t, e, i) { this.ctx.setFilters(i); }, n ? this.ctx = n.getContext("2d") : (n = yt.create("3D"), this.ctx = r.createWebGLContext2D(n), n._setContext(this.ctx)), n.size(e, i), this.canvas = n; } s(t, "laya.renders.RenderContext"); var e = t.prototype; return e.destroy = function() { this.canvas && (this.canvas.destroy(), this.canvas = null, this.ctx = null), this.ctx && (this.ctx.destroy(), this.ctx = null); }, e.drawTexture = function(t, e, i, n, s) { t.loaded && this.ctx.drawTexture(t, e, i, n, s, this.x, this.y); }, e._drawTextures = function(t, e, i) { i[0].loaded && this.ctx.drawTextures(i[0], i[1], t + this.x, e + this.y); }, e.drawTextureWithTransform = function(t, e, i, n, s, a, r) { t.loaded && this.ctx.drawTextureWithTransform(t, e, i, n, s, a, this.x, this.y, r); }, e.fillQuadrangle = function(t, e, i, n, s) { this.ctx.fillQuadrangle(t, e, i, n, s); }, e.drawCanvas = function(t, e, i, n, s) { this.ctx.drawCanvas(t, e + this.x, i + this.y, n, s); }, e.drawRect = function(t, e, i, n, s, a) { void 0 === a && (a = 1); var r = this.ctx; r.strokeStyle = s, r.lineWidth = a, r.strokeRect(t + this.x, e + this.y, i, n, a); }, e._fillAndStroke = function(t, e, i, n) { void 0 === n && (n = !1); var s = this.ctx; null != t && (s.fillStyle = t, k.isWebGL ? s.fill(n) : s.fill()), null != e && i > 0 && (s.strokeStyle = e, s.lineWidth = i, s.stroke()); }, e.clipRect = function(t, e, i, n) { this.ctx.clipRect(t + this.x, e + this.y, i, n); }, e.fillRect = function(t, e, i, n, s) { this.ctx.fillRect(t + this.x, e + this.y, i, n, s); }, e.drawCircle = function(e, i, n, s, a) { void 0 === a && (a = 1), X.drawCall++; var r = this.ctx; r.beginPath(), r.strokeStyle = s, r.lineWidth = a, r.arc(e + this.x, i + this.y, n, 0, t.PI2), r.stroke(); }, e.drawTriangles = function(t, e, i) { if (k.isWebGL) this.ctx.drawTriangles(i[0], t + i[1], e + i[2], i[3], i[4], i[5], i[6], i[7], i[8], i[9]); else { var n = i[5], s = 0, a = n.length, r = this.ctx; for (s = 0; s < a; s += 3) { var o = 2 * n[s], h = 2 * n[s + 1], l = 2 * n[s + 2]; r.drawTriangle(i[0], i[3], i[4], o, h, l, i[6], !0); } } }, e.fillCircle = function(e, i, n, s) { X.drawCall++; var a = this.ctx; a.beginPath(), a.fillStyle = s, a.arc(e + this.x, i + this.y, n, 0, t.PI2), a.fill(); }, e.setShader = function(t) { this.ctx.setShader(t); }, e.drawLine = function(t, e, i, n, s, a) { void 0 === a && (a = 1); var r = this.ctx; r.beginPath(), r.strokeStyle = s, r.lineWidth = a, r.moveTo(this.x + t, this.y + e), r.lineTo(this.x + i, this.y + n), r.stroke(); }, e.clear = function() { this.ctx.clear(); }, e.transformByMatrix = function(t) { this.ctx.transformByMatrix(t); }, e.setTransform = function(t, e, i, n, s, a) { this.ctx.setTransform(t, e, i, n, s, a); }, e.setTransformByMatrix = function(t) { this.ctx.setTransformByMatrix(t); }, e.save = function() { this.ctx.save(); }, e.restore = function() { this.ctx.restore(); }, e.translate = function(t, e) { this.ctx.translate(t, e); }, e.transform = function(t, e, i, n, s, a) { this.ctx.transform(t, e, i, n, s, a); }, e.rotate = function(t) { this.ctx.rotate(t); }, e.scale = function(t, e) { this.ctx.scale(t, e); }, e.alpha = function(t) { this.ctx.globalAlpha *= t; }, e.setAlpha = function(t) { this.ctx.globalAlpha = t; }, e.fillWords = function(t, e, i, n, s, a) { void 0 === a && (a = 0), this.ctx.fillWords(t, e, i, n, s, a); }, e.fillBorderWords = function(t, e, i, n, s, a, r) { this.ctx.fillBorderWords(t, e, i, n, s, a, r); }, e.fillText = function(t, e, i, n, s, a) { this.ctx.fillText(t, e + this.x, i + this.y, n, s, a); }, e.strokeText = function(t, e, i, n, s, a, r) { this.ctx.strokeText(t, e + this.x, i + this.y, n, s, a, r); }, e.blendMode = function(t) { this.ctx.globalCompositeOperation = t; }, e.flush = function() { this.ctx.flush && this.ctx.flush(); }, e.addRenderObject = function(t) { this.ctx.addRenderObject(t); }, e.beginClip = function(t, e, i, n) { this.ctx.beginClip && this.ctx.beginClip(t, e, i, n); }, e.endClip = function() { this.ctx.endClip && this.ctx.endClip(); }, e.fillTrangles = function(t, e, i) { this.ctx.fillTrangles(i[0], i[1], i[2], i[3], i.length > 4 ? i[4] : null); }, t.PI2 = 2 * Math.PI, t; }(), D = function() { function t(e, i) { switch (this._next = i || t.NORENDER, e) { case 0: return void (this._fun = this._no); case 1: return void (this._fun = this._image); case 2: return void (this._fun = this._alpha); case 4: return void (this._fun = this._transform); case 8: return void (this._fun = this._blend); case 16: return void (this._fun = this._canvas); case 64: return void (this._fun = this._mask); case 128: return void (this._fun = this._clip); case 256: return void (this._fun = this._style); case 512: return void (this._fun = this._graphics); case 2048: return void (this._fun = this._childs); case 1024: return void (this._fun = this._custom); case 513: case 517: return void (this._fun = this._image2); case 32: return void (this._fun = x._filter); case 69905: return void (this._fun = t._initRenderFun); } this.onCreate(e); } s(t, "laya.renders.RenderSprite"); var e = t.prototype; return e.onCreate = function(t) {}, e._style = function(t, e, i, n) { t._style.render(t, e, i, n); var s = this._next; s._fun.call(s, t, e, i, n); }, e._no = function(t, e, i, n) {}, e._custom = function(t, e, i, n) { t.customRender(e, i, n); var s = t._style._tf; this._next._fun.call(this._next, t, e, i - s.translateX, n - s.translateY); }, e._clip = function(e, i, n, s) { var a = this._next; if (a != t.NORENDER) { var r = e._style.scrollRect; i.ctx.save(), i.ctx.clipRect(n, s, r.width, r.height), a._fun.call(a, e, i, n - r.x, s - r.y), i.ctx.restore(); } }, e._blend = function(t, e, i, n) { var s = t._style; s.blendMode && (e.ctx.globalCompositeOperation = s.blendMode); var a = this._next; a._fun.call(a, t, e, i, n), e.ctx.globalCompositeOperation = "source-over"; }, e._mask = function(t, e, i, n) { var s = this._next; s._fun.call(s, t, e, i, n); var a = t.mask; a && (e.ctx.globalCompositeOperation = "destination-in", (a.numChildren > 0 || !a.graphics._isOnlyOne()) && (a.cacheAsBitmap = !0), a.render(e, i - t.pivotX, n - t.pivotY)), e.ctx.globalCompositeOperation = "source-over"; }, e._graphics = function(t, e, i, n) { var s = t._style._tf; t._graphics && t._graphics._render(t, e, i - s.translateX, n - s.translateY); var a = this._next; a._fun.call(a, t, e, i, n); }, e._image = function(t, e, i, n) { var s = t._style; e.ctx.drawTexture2(i, n, s._tf.translateX, s._tf.translateY, t.transform, s.alpha, s.blendMode, t._graphics._one); }, e._image2 = function(t, e, i, n) { var s = t._style._tf; e.ctx.drawTexture2(i, n, s.translateX, s.translateY, t.transform, 1, null, t._graphics._one); }, e._alpha = function(t, e, i, n) { var s; if ((s = t._style.alpha) > .01 || t._needRepaint()) { var a = e.ctx.globalAlpha; e.ctx.globalAlpha *= s; var r = this._next; r._fun.call(r, t, e, i, n), e.ctx.globalAlpha = a; } }, e._transform = function(e, i, n, s) { var a = e.transform, r = this._next; a && r != t.NORENDER ? (i.save(), i.transform(a.a, a.b, a.c, a.d, a.tx + n, a.ty + s), r._fun.call(r, e, i, 0, 0), i.restore()) : r._fun.call(r, e, i, n, s); }, e._childs = function(t, e, i, n) { var s = t._style, a = s._tf; if (i = i - a.translateX + s.paddingLeft, n = n - a.translateY + s.paddingTop, s._calculation) { var r = t._getWords(); if (r) { var o = s; o && (o.stroke ? e.fillBorderWords(r, i, n, o.font, o.color, o.strokeColor, o.stroke) : e.fillWords(r, i, n, o.font, o.color, "none" != o.textDecoration && o.underLine ? 1 : 0)); } } var h, l = t._childs, u = l.length; if (t.viewport || t.optimizeScrollRect && t._style.scrollRect) { var c = t.viewport || t._style.scrollRect, _ = c.x, d = c.y, p = c.right, f = c.bottom, g = NaN, m = NaN; for (v = 0; v < u; ++v) (h = l[v]).visible && (g = h._x) < p && g + h.width > _ && (m = h._y) < f && m + h.height > d && h.render(e, i, n); } else for (var v = 0; v < u; ++v) (h = l[v])._style.visible && h.render(e, i, n); }, e._canvas = function(t, e, i, n) { var s = t._$P.cacheCanvas; if (s) { "bitmap" === s.type ? X.canvasBitmap++ : X.canvasNormal++; var a = s.ctx; if (t._needRepaint() || !a) this._canvas_repaint(t, e, i, n); else { var r = s._cacheRec; e.drawCanvas(a.canvas, i + r.x, n + r.y, r.width, r.height); } } else this._next._fun.call(this._next, t, e, i, n); }, e._canvas_repaint = function(t, e, n, s) { var a = t._$P.cacheCanvas, r = this._next; if (a) { var o, h, l, u, c = a.ctx, _ = t._needRepaint() || !c, d = a.type; if ("bitmap" === d ? X.canvasBitmap++ : X.canvasNormal++, _) { a._cacheRec || (a._cacheRec = new M()); var p, f; k.isWebGL && "bitmap" !== d ? a._cacheRec.setTo(-t.pivotX, -t.pivotY, 1, 1) : ((u = t.getSelfBounds()).x = u.x - t.pivotX, u.y = u.y - t.pivotY, u.x = u.x - 16, u.y = u.y - 16, u.width = u.width + 32, u.height = u.height + 32, u.x = Math.floor(u.x + n) - n, u.y = Math.floor(u.y + s) - s, u.width = Math.floor(u.width), u.height = Math.floor(u.height), a._cacheRec.copyFrom(u)), u = a._cacheRec; var g = k.isWebGL ? 1 : B.pixelRatio * i.stage.clientScaleX, m = k.isWebGL ? 1 : B.pixelRatio * i.stage.clientScaleY; if (!k.isWebGL) { var v, y = 1, x = 1; for (v = t; v && v != i.stage; ) y *= v.scaleX, x *= v.scaleY, v = v.parent; k.isWebGL ? (y < 1 && (g *= y), x < 1 && (m *= x)) : (y > 1 && (g *= y), x > 1 && (m *= x)); } if (t.scrollRect) { var b = t.scrollRect; u.x -= b.x, u.y -= b.y; } if (p = u.width * g, f = u.height * m, h = u.x, l = u.y, k.isWebGL && "bitmap" === d && (p > 2048 || f > 2048)) return console.warn("cache bitmap size larger than 2048,cache ignored"), a.ctx && (Y.recover("RenderContext", a.ctx), a.ctx.canvas.size(0, 0), a.ctx = null), void r._fun.call(r, t, e, n, s); c || (c = a.ctx = Y.getItem("RenderContext") || new R(p, f, yt.create("AUTO"))), c.ctx.sprite = t, (o = c.canvas).clear(), (o.width != p || o.height != f) && o.size(p, f), "bitmap" === d ? o.context.asBitmap = !0 : "normal" === d && (o.context.asBitmap = !1); var w; if (1 != g || 1 != m) { var C = c.ctx; C.save(), C.scale(g, m), !k.isConchWebGL && k.isConchApp && (w = t._$P.cf) && C.setFilterMatrix && C.setFilterMatrix(w._mat, w._alpha), r._fun.call(r, t, c, -h, -l), C.restore(), k.isConchApp && !k.isConchWebGL || t._applyFilters(); } else C = c.ctx, !k.isConchWebGL && k.isConchApp && (w = t._$P.cf) && C.setFilterMatrix && C.setFilterMatrix(w._mat, w._alpha), r._fun.call(r, t, c, -h, -l), k.isConchApp && !k.isConchWebGL || t._applyFilters(); t._$P.staticCache && (a.reCache = !1), X.canvasReCache++; } else h = (u = a._cacheRec).x, l = u.y, o = c.canvas; e.drawCanvas(o, n + h, s + l, u.width, u.height); } else r._fun.call(r, t, c, n, s); }, t.__init__ = function() { var e, i = 0, n = 0; for (e = r.createRenderSprite(69905, null), n = t.renders.length = 4096, i = 0; i < n; i++) t.renders[i] = e; t.renders[0] = r.createRenderSprite(0, null), function(e, i) { for (var n = 0, s = 0; s < e.length; s++) n |= e[s], t.renders[n] = i; }([ 1, 512, 4, 2 ], new t(1, null)), t.renders[513] = r.createRenderSprite(513, null), t.renders[517] = new t(517, null); }, t._initRenderFun = function(e, i, n, s) { var a = e._renderType; (t.renders[a] = t._getTypeRender(a))._fun(e, i, n, s); }, t._getTypeRender = function(t) { for (var e = null, i = 2048; i > 1; ) i & t && (e = r.createRenderSprite(i, e)), i >>= 1; return e; }, t.IMAGE = 1, t.ALPHA = 2, t.TRANSFORM = 4, t.BLEND = 8, t.CANVAS = 16, t.FILTERS = 32, t.MASK = 64, t.CLIP = 128, t.STYLE = 256, t.GRAPHICS = 512, t.CUSTOM = 1024, t.CHILDS = 2048, t.INIT = 69905, t.renders = [], t.NORENDER = new t(0, null), t; }(), N = function() { function t() { this._repaint = !1; } s(t, "laya.resource.Context"); var e = t.prototype; return e.replaceReset = function() { var e = 0, i = 0; i = t.replaceKeys.length; var n; for (e = 0; e < i; e++) n = t.replaceKeys[e], this[t.newKeys[e]] = this[n]; }, e.replaceResotre = function() { this.__restore(), this.__reset(); }, e.setIsMainContext = function() {}, e.drawTextures = function(t, e, i, n) { X.drawCall += e.length / 2; for (var s = t.width, a = t.height, r = 0, o = e.length; r < o; r += 2) this.drawTexture(t, e[r], e[r + 1], s, a, i, n); }, e.drawCanvas = function(t, e, i, n, s) { X.drawCall++, this.drawImage(t.source, e, i, n, s); }, e.fillRect = function(t, e, i, n, s) { X.drawCall++, s && (this.fillStyle = s), this.__fillRect(t, e, i, n); }, e.fillText = function(t, e, i, n, s, a) { X.drawCall++, arguments.length > 3 && null != n && (this.font = n, this.fillStyle = s, this.textAlign = a, this.textBaseline = "top"), this.__fillText(t, e, i); }, e.fillBorderText = function(t, e, i, n, s, a, r, o) { X.drawCall++, this.font = n, this.fillStyle = s, this.textBaseline = "top", this.strokeStyle = a, this.lineWidth = r, this.textAlign = o, this.__strokeText(t, e, i), this.__fillText(t, e, i); }, e.strokeText = function(t, e, i, n, s, a, r) { X.drawCall++, arguments.length > 3 && null != n && (this.font = n, this.strokeStyle = s, this.lineWidth = a, this.textAlign = r, this.textBaseline = "top"), this.__strokeText(t, e, i); }, e.transformByMatrix = function(t) { this.transform(t.a, t.b, t.c, t.d, t.tx, t.ty); }, e.setTransformByMatrix = function(t) { this.setTransform(t.a, t.b, t.c, t.d, t.tx, t.ty); }, e.clipRect = function(t, e, i, n) { X.drawCall++, this.beginPath(), this.rect(t, e, i, n), this.clip(); }, e.drawTexture = function(t, e, i, n, s, a, r) { X.drawCall++; var o = t.uv, h = t.bitmap.width, l = t.bitmap.height; this.drawImage(t.source, o[0] * h, o[1] * l, (o[2] - o[0]) * h, (o[5] - o[3]) * l, e + a, i + r, n, s); }, e.drawTextureWithTransform = function(t, e, i, n, s, a, r, o, h) { X.drawCall++; var l = t.uv, u = t.bitmap.width, c = t.bitmap.height; this.save(), 1 != h && (this.globalAlpha *= h), a ? (this.transform(a.a, a.b, a.c, a.d, a.tx + r, a.ty + o), this.drawImage(t.source, l[0] * u, l[1] * c, (l[2] - l[0]) * u, (l[5] - l[3]) * c, e, i, n, s)) : this.drawImage(t.source, l[0] * u, l[1] * c, (l[2] - l[0]) * u, (l[5] - l[3]) * c, e + r, i + o, n, s), this.restore(); }, e.drawTexture2 = function(t, e, i, n, s, a, r, o) { var h = o[0]; if (h.loaded && h.bitmap && h.source) { X.drawCall++; var l = 1 !== a; if (l) { var u = this.globalAlpha; this.globalAlpha *= a; } var c = h.uv, _ = h.bitmap.width, d = h.bitmap.height; s ? (this.save(), this.transform(s.a, s.b, s.c, s.d, s.tx + t, s.ty + e), this.drawImage(h.source, c[0] * _, c[1] * d, (c[2] - c[0]) * _, (c[5] - c[3]) * d, o[1] - i, o[2] - n, o[3], o[4]), this.restore()) : this.drawImage(h.source, c[0] * _, c[1] * d, (c[2] - c[0]) * _, (c[5] - c[3]) * d, o[1] - i + t, o[2] - n + e, o[3], o[4]), l && (this.globalAlpha = u); } }, e.fillTexture = function(t, e, i, n, s, a, r, o) { if (!o.pat) { if (t.uv != lt.DEF_UV) { var h = new yt("2D"); h.getContext("2d"), h.size(t.width, t.height), h.context.drawTexture(t, 0, 0, t.width, t.height, 0, 0), t = new lt(h); } o.pat = this.createPattern(t.bitmap.source, a); } var l = e, u = i, c = 0, _ = 0; r && (l += r.x % t.width, u += r.y % t.height, c -= r.x % t.width, _ -= r.y % t.height), this.translate(l, u), this.fillRect(c, _, n, s, o.pat), this.translate(-l, -u); }, e.drawTriangle = function(t, e, i, n, s, a, r, o) { var h = t.bitmap, l = h.source, u = t.width, c = t.height, _ = h.width, d = h.height, p = i[n] * _, f = i[s] * _, g = i[a] * _, m = i[n + 1] * d, v = i[s + 1] * d, y = i[a + 1] * d, x = e[n], b = e[s], w = e[a], C = e[n + 1], S = e[s + 1], T = e[a + 1]; if (o) { var I = (x + b + w) / 3, M = (C + S + T) / 3, E = x - I, A = C - M, L = Math.sqrt(E * E + A * A); x = I + E / L * (L + 1), C = M + A / L * (L + 1), A = S - M, b = I + (E = b - I) / (L = Math.sqrt(E * E + A * A)) * (L + 1), S = M + A / L * (L + 1), A = T - M, w = I + (E = w - I) / (L = Math.sqrt(E * E + A * A)) * (L + 1), T = M + A / L * (L + 1); } this.save(), r && this.transform(r.a, r.b, r.c, r.d, r.tx, r.ty), this.beginPath(), this.moveTo(x, C), this.lineTo(b, S), this.lineTo(w, T), this.closePath(), this.clip(); var P = 1 / (p * v + m * g + f * y - v * g - m * f - p * y), k = x * v + m * w + b * y - v * w - m * b - x * y, R = p * b + x * g + f * w - b * g - x * f - p * w, D = p * v * w + m * b * g + x * f * y - x * v * g - m * f * w - p * b * y, N = C * v + m * T + S * y - v * T - m * S - C * y, F = p * S + C * g + f * T - S * g - C * f - p * T, B = p * v * T + m * S * g + C * f * y - C * v * g - m * f * T - p * S * y; this.transform(k * P, N * P, R * P, F * P, D * P, B * P), this.drawImage(l, t.uv[0] * _, t.uv[1] * d, u, c, t.uv[0] * _, t.uv[1] * d, u, c), this.restore(); }, e.flush = function() { return 0; }, e.fillWords = function(t, e, i, n, s, a) { n && (this.font = n), s && (this.fillStyle = s); this.textBaseline = "top", this.textAlign = "left"; for (var r = 0, o = t.length; r < o; r++) { var h = t[r]; if (this.__fillText(h.char, h.x + e, h.y + i), 1 === a) { var l = h.height, u = .5 * h.style.letterSpacing; u || (u = 0), this.beginPath(), this.strokeStyle = s, this.lineWidth = 1, this.moveTo(e + h.x - u + .5, i + h.y + l + .5), this.lineTo(e + h.x + h.width + u + .5, i + h.y + l + .5), this.stroke(); } } }, e.fillBorderWords = function(t, e, i, n, s, a, r) { n && (this.font = n), s && (this.fillStyle = s), this.textBaseline = "top", this.lineWidth = r, this.textAlign = "left", this.strokeStyle = a; for (var o = 0, h = t.length; o < h; o++) { var l = t[o]; this.__strokeText(l.char, l.x + e, l.y + i), this.__fillText(l.char, l.x + e, l.y + i); } }, e.destroy = function() { this.canvas.width = this.canvas.height = 0; }, e.clear = function() { this.clearRect(0, 0, this._canvas.width, this._canvas.height), this._repaint = !1; }, e.drawCurves = function(t, e, i) { this.beginPath(), this.strokeStyle = i[3], this.lineWidth = i[4]; var n = i[2]; t += i[0], e += i[1], this.moveTo(t + n[0], e + n[1]); for (var s = 2, a = n.length; s < a; ) this.quadraticCurveTo(t + n[s++], e + n[s++], t + n[s++], e + n[s++]); this.stroke(); }, t.__init__ = function(t) { var e = laya.resource.Context.prototype; if (!(t = t || CanvasRenderingContext2D.prototype).inited) { t.inited = !0, t.__fillText = t.fillText, t.__fillRect = t.fillRect, t.__strokeText = t.strokeText; [ "drawTextures", "drawTriangle", "fillWords", "fillBorderWords", "setIsMainContext", "fillRect", "strokeText", "fillTexture", "fillText", "transformByMatrix", "setTransformByMatrix", "clipRect", "drawTexture", "drawTexture2", "drawTextureWithTransform", "flush", "clear", "destroy", "drawCanvas", "fillBorderText", "drawCurves" ].forEach(function(i) { t[i] = e[i]; }); } }, t.replaceCanvasGetSet = function(t, e) { var i = Object.getOwnPropertyDescriptor(t, e); if (!i || !i.configurable) return !1; var n, s = {}; for (n in i) "set" != n && (s[n] = i[n]); var a = i.set; return s.set = function(t) { a.call(this, t); var e = this.getContext("2d"); e && "__reset" in e && e.__reset(); }, Object.defineProperty(t, e, s), !0; }, t.replaceGetSet = function(e, i) { var n = Object.getOwnPropertyDescriptor(e, i); if (!n || !n.configurable) return !1; var s, a = {}; for (s in n) "set" != s && (a[s] = n[s]); var r = n.set, o = "___" + i + "__"; return t.newKeys.push(o), a.set = function(t) { t != this[o] && (this[o] = t, r.call(this, t)); }, Object.defineProperty(e, i, a), !0; }, t._default = new t(), t.newKeys = [], n(t, [ "replaceKeys", function() { return this.replaceKeys = [ "font", "fillStyle", "textBaseline" ]; } ]), t; }(), F = function() { function t(e) { this._id = 0, this._name = null, this._resources = null, this._memorySize = 0, this._garbageCollectionRate = NaN, this._isOverflow = !1, this.autoRelease = !1, this.autoReleaseMaxSize = 0, this._id = ++t._uniqueIDCounter, this._name = e || "Content Manager", t._isResourceManagersSorted = !1, this._memorySize = 0, this._isOverflow = !1, this.autoRelease = !1, this.autoReleaseMaxSize = 536870912, this._garbageCollectionRate = .2, t._resourceManagers.push(this), this._resources = []; } s(t, "laya.resource.ResourceManager"); var e = t.prototype; return i.imps(e, { "laya.resource.IDispose": !0 }), e.getResourceByIndex = function(t) { return this._resources[t]; }, e.getResourcesLength = function() { return this._resources.length; }, e.addResource = function(t) { t.resourceManager && t.resourceManager.removeResource(t); return -1 === this._resources.indexOf(t) && (t._resourceManager = this, this._resources.push(t), this.addSize(t.memorySize), !0); }, e.removeResource = function(t) { var e = this._resources.indexOf(t); return -1 !== e && (this._resources.splice(e, 1), t._resourceManager = null, this._memorySize -= t.memorySize, !0); }, e.unload = function() { for (var t = this._resources.slice(0, this._resources.length), e = 0; e < t.length; e++) { t[e].destroy(); } t.length = 0; }, e.dispose = function() { if (this === t._systemResourceManager) throw new Error("systemResourceManager不能被释放!"); t._resourceManagers.splice(t._resourceManagers.indexOf(this), 1), t._isResourceManagersSorted = !1; for (var e = this._resources.slice(0, this._resources.length), i = 0; i < e.length; i++) { var n = e[i]; n.resourceManager.removeResource(n), n.destroy(); } e.length = 0; }, e.addSize = function(t) { t && (this.autoRelease && t > 0 && this._memorySize + t > this.autoReleaseMaxSize && this.garbageCollection((1 - this._garbageCollectionRate) * this.autoReleaseMaxSize), this._memorySize += t); }, e.garbageCollection = function(t) { var e = this._resources; (e = e.slice()).sort(function(t, e) { if (!t || !e) throw new Error("a或b不能为空!"); return t.released && e.released ? 0 : t.released ? 1 : e.released ? -1 : t._lastUseFrameCount - e._lastUseFrameCount; }); for (var i = X.loopCount, n = 0, s = e.length; n < s; n++) { var a = e[n]; if (!(i - a._lastUseFrameCount > 1)) return void (this._memorySize >= t && (this._isOverflow = !0)); if (a.releaseResource(), this._memorySize < t) return void (this._isOverflow = !1); } }, a(0, e, "id", function() { return this._id; }), a(0, e, "name", function() { return this._name; }, function(e) { !e && "" === e || this._name === e || (this._name = e, t._isResourceManagersSorted = !1); }), a(0, e, "memorySize", function() { return this._memorySize; }), a(1, t, "systemResourceManager", function() { return t._systemResourceManager; }), t.__init__ = function() { t.currentResourceManager = t.systemResourceManager; }, t.getLoadedResourceManagerByIndex = function(e) { return t._resourceManagers[e]; }, t.getLoadedResourceManagersCount = function() { return t._resourceManagers.length; }, t.recreateContentManagers = function(e) { void 0 === e && (e = !1); for (var i = t.currentResourceManager, n = 0; n < t._resourceManagers.length; n++) { t.currentResourceManager = t._resourceManagers[n]; for (var s = 0; s < t.currentResourceManager._resources.length; s++) t.currentResourceManager._resources[s].releaseResource(e), t.currentResourceManager._resources[s].activeResource(e); } t.currentResourceManager = i; }, t.releaseContentManagers = function(e) { void 0 === e && (e = !1); for (var i = t.currentResourceManager, n = 0; n < t._resourceManagers.length; n++) { t.currentResourceManager = t._resourceManagers[n]; for (var s = 0; s < t.currentResourceManager._resources.length; s++) { var a = t.currentResourceManager._resources[s]; !a.released && a.releaseResource(e); } } t.currentResourceManager = i; }, t._uniqueIDCounter = 0, t._isResourceManagersSorted = !1, t._resourceManagers = [], n(t, [ "_systemResourceManager", function() { return this._systemResourceManager = new t("System Resource Manager"); }, "currentResourceManager", function() { return this.currentResourceManager = t._systemResourceManager; } ]), t; }(), B = (function() { function t() {} s(t, "laya.system.System"), t.changeDefinition = function(t, e) { i[t] = e; var n = t + "=classObj"; i._runScript(n); }, t.__init__ = function() { k.isConchApp && (conch.disableConchResManager(), conch.disableConchAutoRestoreLostedDevice()); }; }(), function() { function n() {} return s(n, "laya.utils.Browser"), a(1, n, "pixelRatio", function() { return n.__init__(), n.userAgent.indexOf("Mozilla/6.0(Linux; Android 6.0; HUAWEI NXT-AL10 Build/HUAWEINXT-AL10)") > -1 ? 2 : r.getPixelRatio(); }), a(1, n, "height", function() { return n.__init__(), (i.stage && i.stage.canvasRotation ? n.clientWidth : n.clientHeight) * n.pixelRatio; }), a(1, n, "clientWidth", function() { return n.__init__(), n.window.innerWidth || n.document.body.clientWidth; }), a(1, n, "window", function() { return n.__init__(), n._window; }), a(1, n, "clientHeight", function() { return n.__init__(), n.window.innerHeight || n.document.body.clientHeight || n.document.documentElement.clientHeight; }), a(1, n, "width", function() { return n.__init__(), (i.stage && i.stage.canvasRotation ? n.clientHeight : n.clientWidth) * n.pixelRatio; }), a(1, n, "container", function() { return n.__init__(), n._container || ((n._container = n.createElement("div")).id = "layaContainer", n.document.body.appendChild(n._container)), n._container; }, function(t) { n._container = t; }), a(1, n, "document", function() { return n.__init__(), n._document; }), n.__init__ = function() { if (!n._window) { n._window = r.getWindow(), n._document = n.window.document, n._window.addEventListener("message", function(t) { laya.utils.Browser._onMessage(t); }, !1), n.document.__createElement = n.document.createElement, t.requestAnimationFrame = t.requestAnimationFrame || t.webkitRequestAnimationFrame || t.mozRequestAnimationFrame || t.oRequestAnimationFrame || t.msRequestAnimationFrame || function(e) { return t.setTimeout(e, 1e3 / 60); }; var i = t.document.body.style; i["-webkit-user-select"] = "none", i["-webkit-tap-highlight-color"] = "rgba(200,200,200,0)", n.userAgent = n.window.navigator.userAgent, n.onIOS = !!(n.u = n.userAgent).match(/\(i[^;]+;(U;)? CPU.+Mac OS X/), n.onMobile = n.u.indexOf("Mobile") > -1, n.onIPhone = n.u.indexOf("iPhone") > -1, n.onMac = n.u.indexOf("Mac OS X") > -1, n.onIPad = n.u.indexOf("iPad") > -1, n.onAndroid = n.u.indexOf("Android") > -1 || n.u.indexOf("Adr") > -1, n.onWP = n.u.indexOf("Windows Phone") > -1, n.onQQBrowser = n.u.indexOf("QQBrowser") > -1, n.onMQQBrowser = n.u.indexOf("MQQBrowser") > -1 || n.u.indexOf("Mobile") > -1 && n.u.indexOf("QQ") > -1, n.onIE = !!n.window.ActiveXObject || "ActiveXObject" in n.window, n.onWeiXin = n.u.indexOf("MicroMessenger") > -1, n.onPC = !n.onMobile, n.onSafari = n.u.indexOf("Safari") > -1, n.onFirefox = n.u.indexOf("Firefox") > -1, n.onEdge = n.u.indexOf("Edge") > -1, n.onMiniGame = n.u.indexOf("MiniGame") > -1, n.onTTMiniGame = n.u.indexOf("TTGame") > -1, n.onBDMiniGame = n.u.indexOf("SwanGame") > -1, n.u.indexOf("OPPO") > -1 && n.u.indexOf("MiniGame") > -1 ? (n.onQGMiniGame = !0, n.onMiniGame = !1) : laya.utils.Browser.window.hasOwnProperty("bl") && n.u.indexOf("MiniGame") > -1 ? (n.onBLMiniGame = !0, n.onMiniGame = !1) : laya.utils.Browser.window.hasOwnProperty("qq") && n.u.indexOf("MiniGame") > -1 ? (n.onQQMiniGame = !0, n.onMiniGame = !1) : n.u.indexOf("VVGame") > -1 && (n.onVVMiniGame = !0), n.onKGMiniGame = n.u.indexOf("QuickGame") > -1, n.onLimixiu = n.u.indexOf("limixiu") > -1, n.onIPhoneX = /iPhone/gi.test(n.window.navigator.userAgent) && 375 == Math.min(n.clientHeight, n.clientWidth) && 812 == Math.max(n.clientHeight, n.clientWidth), n.httpProtocol = "http:" == n.window.location.protocol, n.u.indexOf("AlipayMiniGame") > -1 && (n.onAlipayMiniGame = !0, n.onMiniGame = !1), n.onMiniGame && null == n.window.focus && console.error("请先初始化小游戏适配库,详细教程https://ldc.layabox.com/doc/?nav=zh-ts-5-0-0"), n.webAudioEnabled = !!(n.window.AudioContext || n.window.webkitAudioContext || n.window.mozAudioContext), n.soundType = n.webAudioEnabled ? "WEBAUDIOSOUND" : "AUDIOSOUND", nt = n.webAudioEnabled ? st : et, n.webAudioEnabled && st.initWebAudio(), et._initMusicAudio(), n.enableTouch = "ontouchstart" in t || t.DocumentTouch && e instanceof DocumentTouch, t.focus(), E._soundClass = nt, E._musicClass = et, k._mainCanvas = k._mainCanvas || yt.create("2D"), n.canvas || (n.canvas = yt.create("2D"), n.context = n.canvas.getContext("2d")); } }, n._onMessage = function(t) { if (t.data && "size" == t.data.name) { if (n.window.innerWidth = t.data.width, n.window.innerHeight = t.data.height, n.window.__innerHeight = t.data.clientHeight, !n.document.createEvent) return void console.warn("no document.createEvent"); var e = n.document.createEvent("HTMLEvents"); return e.initEvent("resize", !1, !1), void n.window.dispatchEvent(e); } }, n.createElement = function(t) { return n.__init__(), n.document.__createElement(t); }, n.getElementById = function(t) { return n.__init__(), n.document.getElementById(t); }, n.removeElement = function(t) { t && t.parentNode && t.parentNode.removeChild(t); }, n.now = function() { return r.now(); }, n._window = null, n._document = null, n._container = null, n.userAgent = null, n.u = null, n.onIOS = !1, n.onMac = !1, n.onMobile = !1, n.onIPhone = !1, n.onIPad = !1, n.onAndroid = !1, n.onWP = !1, n.onQQBrowser = !1, n.onMQQBrowser = !1, n.onSafari = !1, n.onFirefox = !1, n.onEdge = !1, n.onIE = !1, n.onWeiXin = !1, n.onMiniGame = !1, n.onTTMiniGame = !1, n.onBDMiniGame = !1, n.onKGMiniGame = !1, n.onQGMiniGame = !1, n.onVVMiniGame = !1, n.onQQMiniGame = !1, n.onAlipayMiniGame = !1, n.onLimixiu = !1, n.onBLMiniGame = !1, n.onPC = !1, n.httpProtocol = !1, n.webAudioEnabled = !1, n.soundType = null, n.enableTouch = !1, n.canvas = null, n.context = null, n.onIPhoneX = !1, n.__init$ = function() {}, n; }()), O = function() { function t(t) { this._xd_ = !0, this._allocated_ = 8, this._pos_ = 0, this._length = 0, t ? (this._u8d_ = new Uint8Array(t), this._d_ = new DataView(this._u8d_.buffer), this._length = this._d_.byteLength) : this.___resizeBuffer(this._allocated_); } s(t, "laya.utils.Byte"); var e = t.prototype; return e.___resizeBuffer = function(t) { try { var e = new Uint8Array(t); null != this._u8d_ && (this._u8d_.length <= t ? e.set(this._u8d_) : e.set(this._u8d_.subarray(0, t))), this._u8d_ = e, this._d_ = new DataView(e.buffer); } catch (e) { throw "___resizeBuffer err:" + t; } }, e.getString = function() { return this.rUTF(this.getUint16()); }, e.getFloat32Array = function(t, e) { var i = t + e; i = i > this._length ? this._length : i; var n = new Float32Array(this._d_.buffer.slice(t, i)); return this._pos_ = i, n; }, e.getUint8Array = function(t, e) { var i = t + e; i = i > this._length ? this._length : i; var n = new Uint8Array(this._d_.buffer.slice(t, i)); return this._pos_ = i, n; }, e.getInt16Array = function(t, e) { var i = t + e; i = i > this._length ? this._length : i; var n = new Int16Array(this._d_.buffer.slice(t, i)); return this._pos_ = i, n; }, e.getFloat32 = function() { if (this._pos_ + 4 > this._length) throw "getFloat32 error - Out of bounds"; var t = this._d_.getFloat32(this._pos_, this._xd_); return this._pos_ += 4, t; }, e.getFloat64 = function() { if (this._pos_ + 8 > this._length) throw "getFloat64 error - Out of bounds"; var t = this._d_.getFloat64(this._pos_, this._xd_); return this._pos_ += 8, t; }, e.writeFloat32 = function(t) { this.ensureWrite(this._pos_ + 4), this._d_.setFloat32(this._pos_, t, this._xd_), this._pos_ += 4; }, e.writeFloat64 = function(t) { this.ensureWrite(this._pos_ + 8), this._d_.setFloat64(this._pos_, t, this._xd_), this._pos_ += 8; }, e.getInt32 = function() { if (this._pos_ + 4 > this._length) throw "getInt32 error - Out of bounds"; var t = this._d_.getInt32(this._pos_, this._xd_); return this._pos_ += 4, t; }, e.getUint32 = function() { if (this._pos_ + 4 > this._length) throw "getUint32 error - Out of bounds"; var t = this._d_.getUint32(this._pos_, this._xd_); return this._pos_ += 4, t; }, e.writeInt32 = function(t) { this.ensureWrite(this._pos_ + 4), this._d_.setInt32(this._pos_, t, this._xd_), this._pos_ += 4; }, e.writeUint32 = function(t) { this.ensureWrite(this._pos_ + 4), this._d_.setUint32(this._pos_, t, this._xd_), this._pos_ += 4; }, e.getInt16 = function() { if (this._pos_ + 2 > this._length) throw "getInt16 error - Out of bounds"; var t = this._d_.getInt16(this._pos_, this._xd_); return this._pos_ += 2, t; }, e.getUint16 = function() { if (this._pos_ + 2 > this._length) throw "getUint16 error - Out of bounds"; var t = this._d_.getUint16(this._pos_, this._xd_); return this._pos_ += 2, t; }, e.writeUint16 = function(t) { this.ensureWrite(this._pos_ + 2), this._d_.setUint16(this._pos_, t, this._xd_), this._pos_ += 2; }, e.writeInt16 = function(t) { this.ensureWrite(this._pos_ + 2), this._d_.setInt16(this._pos_, t, this._xd_), this._pos_ += 2; }, e.getUint8 = function() { if (this._pos_ + 1 > this._length) throw "getUint8 error - Out of bounds"; return this._d_.getUint8(this._pos_++); }, e.writeUint8 = function(t) { this.ensureWrite(this._pos_ + 1), this._d_.setUint8(this._pos_, t), this._pos_++; }, e._getUInt8 = function(t) { return this._d_.getUint8(t); }, e._getUint16 = function(t) { return this._d_.getUint16(t, this._xd_); }, e._getMatrix = function() { return new T(this.getFloat32(), this.getFloat32(), this.getFloat32(), this.getFloat32(), this.getFloat32(), this.getFloat32()); }, e.rUTF = function(t) { for (var e = "", i = this._pos_ + t, n = 0, s = String.fromCharCode, a = this._u8d_; this._pos_ < i; ) (n = a[this._pos_++]) < 128 ? 0 != n && (e += s(n)) : e += s(n < 224 ? (63 & n) << 6 | 127 & a[this._pos_++] : n < 240 ? (31 & n) << 12 | (127 & a[this._pos_++]) << 6 | 127 & a[this._pos_++] : (15 & n) << 18 | (127 & a[this._pos_++]) << 12 | a[this._pos_++] << 6 & 127 | 127 & a[this._pos_++]), 0; return e; }, e.getCustomString = function(t) { for (var e = "", i = 0, n = 0, s = String.fromCharCode, a = this._u8d_; t > 0; ) if ((n = a[this._pos_]) < 128) e += s(n), this._pos_++, t--; else for (i = n - 128, this._pos_++, t -= i; i > 0; ) n = a[this._pos_++], e += s(a[this._pos_++] << 8 | n), i--; return e; }, e.clear = function() { this._pos_ = 0, this.length = 0; }, e.__getBuffer = function() { return this._d_.buffer; }, e.writeUTFBytes = function(t) { for (var e = 0, i = (t += "").length; e < i; e++) { var n = t.charCodeAt(e); n <= 127 ? this.writeByte(n) : n <= 2047 ? (this.ensureWrite(this._pos_ + 2), this._u8d_.set([ 192 | n >> 6, 128 | 63 & n ], this._pos_), this._pos_ += 2) : n <= 65535 ? (this.ensureWrite(this._pos_ + 3), this._u8d_.set([ 224 | n >> 12, 128 | n >> 6 & 63, 128 | 63 & n ], this._pos_), this._pos_ += 3) : (this.ensureWrite(this._pos_ + 4), this._u8d_.set([ 240 | n >> 18, 128 | n >> 12 & 63, 128 | n >> 6 & 63, 128 | 63 & n ], this._pos_), this._pos_ += 4); } }, e.writeUTFString = function(t) { var e = this.pos; this.writeUint16(1), this.writeUTFBytes(t); var i = this.pos - e - 2; if (i >= 65536) throw "writeUTFString byte len more than 65536"; this._d_.setUint16(e, i, this._xd_); }, e.readUTFString = function() { return this.readUTFBytes(this.getUint16()); }, e.getUTFString = function() { return this.readUTFString(); }, e.readUTFBytes = function(t) { if (void 0 === t && (t = -1), 0 == t) return ""; var e = this.bytesAvailable; if (t > e) throw "readUTFBytes error - Out of bounds"; return t = t > 0 ? t : e, this.rUTF(t); }, e.getUTFBytes = function(t) { return void 0 === t && (t = -1), this.readUTFBytes(t); }, e.writeByte = function(t) { this.ensureWrite(this._pos_ + 1), this._d_.setInt8(this._pos_, t), this._pos_ += 1; }, e.readByte = function() { if (this._pos_ + 1 > this._length) throw "readByte error - Out of bounds"; return this._d_.getInt8(this._pos_++); }, e.getByte = function() { return this.readByte(); }, e.ensureWrite = function(t) { this._length < t && (this._length = t), this._allocated_ < t && (this.length = t); }, e.writeArrayBuffer = function(t, e, i) { if (void 0 === e && (e = 0), void 0 === i && (i = 0), e < 0 || i < 0) throw "writeArrayBuffer error - Out of bounds"; 0 == i && (i = t.byteLength - e), this.ensureWrite(this._pos_ + i); var n = new Uint8Array(t); this._u8d_.set(n.subarray(e, e + i), this._pos_), this._pos_ += i; }, e.readArrayBuffer = function(t) { var e; return e = this._u8d_.buffer.slice(this._pos_, this._pos_ + t), this._pos_ = this._pos_ + t, e; }, a(0, e, "buffer", function() { var t = this._d_.buffer; return t.byteLength == this.length ? t : t.slice(0, this.length); }), a(0, e, "endian", function() { return this._xd_ ? "littleEndian" : "bigEndian"; }, function(t) { this._xd_ = "littleEndian" == t; }), a(0, e, "length", function() { return this._length; }, function(t) { this._allocated_ < t ? this.___resizeBuffer(this._allocated_ = Math.floor(Math.max(t, 2 * this._allocated_))) : this._allocated_ > t && this.___resizeBuffer(this._allocated_ = t), this._length = t; }), a(0, e, "pos", function() { return this._pos_; }, function(t) { this._pos_ = t; }), a(0, e, "bytesAvailable", function() { return this._length - this._pos_; }), t.getSystemEndian = function() { if (!t._sysEndian) { var e = new ArrayBuffer(2); new DataView(e).setInt16(0, 256, !0), t._sysEndian = 256 === new Int16Array(e)[0] ? "littleEndian" : "bigEndian"; } return t._sysEndian; }, t.BIG_ENDIAN = "bigEndian", t.LITTLE_ENDIAN = "littleEndian", t._sysEndian = null, t; }(), z = function() { function t() {} return s(t, "laya.utils.CacheManager"), t.regCacheByFunction = function(e, i) { t.unRegCacheByFunction(e, i); var n; n = { tryDispose: e, getCacheList: i }, t._cacheList.push(n); }, t.unRegCacheByFunction = function(e, i) { var n = 0, s = 0; for (s = t._cacheList.length, n = 0; n < s; n++) if (t._cacheList[n].tryDispose == e && t._cacheList[n].getCacheList == i) return void t._cacheList.splice(n, 1); }, t.forceDispose = function() { var e = 0, i = t._cacheList.length; for (e = 0; e < i; e++) t._cacheList[e].tryDispose(!0); }, t.beginCheck = function(e) { void 0 === e && (e = 15e3), i.timer.loop(e, null, t._checkLoop); }, t.stopCheck = function() { i.timer.clear(null, t._checkLoop); }, t._checkLoop = function() { var e = t._cacheList; if (!(e.length < 1)) { var i = B.now(), n = 0, s = 0; for (s = n = e.length; n > 0 && (t._index++, t._index = t._index % s, e[t._index].tryDispose(!1), !(B.now() - i > t.loopTimeLimit)); ) n--; } }, t.loopTimeLimit = 2, t._cacheList = [], t._index = 0, t; }(), U = function() { function t() {} return s(t, "laya.utils.ClassUtils"), t.regClass = function(e, i) { t._classMap[e] = i; }, t.getRegClass = function(e) { return t._classMap[e]; }, t.getInstance = function(e) { var i = t.getClass(e); return i ? new i() : (console.warn("[error] Undefined class:", e), null); }, t.createByJson = function(e, i, n, s, a) { "string" == typeof e && (e = JSON.parse(e)); var r = e.props; if (!i && !(i = a ? a.runWith(e) : t.getInstance(r.runtime || e.type))) return null; var o = e.child; if (o) for (var h = 0, l = o.length; h < l; h++) { var u = o[h]; if ("render" !== u.props.name && "render" !== u.props.renderType || !i._$set_itemRender) if ("Graphic" == u.type) t.addGraphicsToSprite(u, i); else if (t.isDrawType(u.type)) t.addGraphicToSprite(u, i, !0); else { var c = t.createByJson(u, null, n, s, a); "Script" == u.type ? c.hasOwnProperty("owner") ? c.owner = i : c.hasOwnProperty("target") && (c.target = i) : "mask" == u.props.renderType ? i.mask = c : i.addChild(c); } else i.itemRender = u; } if (r) for (var _ in r) { var d = r[_]; "var" === _ && n ? n[d] = i : d instanceof Array && "function" == typeof i[_] ? i[_].apply(i, d) : i[_] = d; } return s && e.customProps && s.runWith([ i, e ]), i.created && i.created(), i; }, t.addGraphicsToSprite = function(e, i) { var n; if ((n = e.child) && !(n.length < 1)) { var s; s = t._getGraphicsFromSprite(e, i); var a = 0, r = 0; e.props && (a = t._getObjVar(e.props, "x", 0), r = t._getObjVar(e.props, "y", 0)), 0 != a && 0 != r && s.translate(a, r); var o = 0, h = 0; for (h = n.length, o = 0; o < h; o++) t._addGraphicToGraphics(n[o], s); 0 != a && 0 != r && s.translate(-a, -r); } }, t.addGraphicToSprite = function(e, i, n) { void 0 === n && (n = !1); var s; s = n ? t._getGraphicsFromSprite(e, i) : i.graphics, t._addGraphicToGraphics(e, s); }, t._getGraphicsFromSprite = function(t, e) { var i; if (!t || !t.props) return e.graphics; var n; switch (n = t.props.renderType) { case "hit": case "unHit": var s; e.hitArea || (e.hitArea = new H()), (s = e.hitArea)[n] || (s[n] = new p()), i = s[n]; } return i || (i = e.graphics), i; }, t._getTransformData = function(e) { var i; (e.hasOwnProperty("pivotX") || e.hasOwnProperty("pivotY")) && (i = i || new T()).translate(-t._getObjVar(e, "pivotX", 0), -t._getObjVar(e, "pivotY", 0)); var n = t._getObjVar(e, "scaleX", 1), s = t._getObjVar(e, "scaleY", 1), a = t._getObjVar(e, "rotation", 0); t._getObjVar(e, "skewX", 0), t._getObjVar(e, "skewY", 0); return 1 == n && 1 == s && 0 == a || ((i = i || new T()).scale(n, s), i.rotate(.0174532922222222 * a)), i; }, t._addGraphicToGraphics = function(e, i) { var n; if (n = e.props) { var s; if (s = t.DrawTypeDic[e.type]) { var a; a = i; var r, o = t._getParams(n, s[1], s[2], s[3]); ((r = t._tM) || 1 != t._alpha) && (a.save(), r && a.transform(r), 1 != t._alpha && a.alpha(t._alpha)), a[s[0]].apply(a, o), (r || 1 != t._alpha) && a.restore(); } } }, t._adptLineData = function(t) { return t[2] = parseFloat(t[0]) + parseFloat(t[2]), t[3] = parseFloat(t[1]) + parseFloat(t[3]), t; }, t._adptTextureData = function(t) { return t[0] = rt.getRes(t[0]), t; }, t._adptLinesData = function(e) { return e[2] = t._getPointListByStr(e[2]), e; }, t.isDrawType = function(e) { return "Image" != e && t.DrawTypeDic.hasOwnProperty(e); }, t._getParams = function(e, i, n, s) { void 0 === n && (n = 0); var a; (a = t._temParam).length = i.length; var r = 0, o = 0; for (o = i.length, r = 0; r < o; r++) a[r] = t._getObjVar(e, i[r][0], i[r][1]); t._alpha = t._getObjVar(e, "alpha", 1); var h; return (h = t._getTransformData(e)) ? (n || (n = 0), h.translate(a[n], a[n + 1]), a[n] = a[n + 1] = 0, t._tM = h) : t._tM = null, s && t[s] && (a = t[s](a)), a; }, t._getPointListByStr = function(t) { var e, i = 0, n = 0; for (n = (e = t.split(",")).length, i = 0; i < n; i++) e[i] = parseFloat(e[i]); return e; }, t._getObjVar = function(t, e, i) { return t.hasOwnProperty(e) ? t[e] : i; }, t._temParam = [], t._classMap = { Sprite: "laya.display.Sprite", Text: "laya.display.Text", Animation: "laya.display.Animation", Skeleton: "laya.ani.bone.Skeleton", Particle2D: "laya.particle.Particle2D", div: "laya.html.dom.HTMLDivElement", p: "laya.html.dom.HTMLElement", img: "laya.html.dom.HTMLImageElement", span: "laya.html.dom.HTMLElement", br: "laya.html.dom.HTMLBrElement", style: "laya.html.dom.HTMLStyleElement", font: "laya.html.dom.HTMLElement", a: "laya.html.dom.HTMLElement", "#text": "laya.html.dom.HTMLElement" }, t.getClass = function(e) { var n = t._classMap[e] || e; return "string" == typeof n ? i.__classmap[n] : n; }, t._tM = null, t._alpha = NaN, n(t, [ "DrawTypeDic", function() { return this.DrawTypeDic = { Rect: [ "drawRect", [ [ "x", 0 ], [ "y", 0 ], [ "width", 0 ], [ "height", 0 ], [ "fillColor", null ], [ "lineColor", null ], [ "lineWidth", 1 ] ] ], Circle: [ "drawCircle", [ [ "x", 0 ], [ "y", 0 ], [ "radius", 0 ], [ "fillColor", null ], [ "lineColor", null ], [ "lineWidth", 1 ] ] ], Pie: [ "drawPie", [ [ "x", 0 ], [ "y", 0 ], [ "radius", 0 ], [ "startAngle", 0 ], [ "endAngle", 0 ], [ "fillColor", null ], [ "lineColor", null ], [ "lineWidth", 1 ] ] ], Image: [ "drawTexture", [ [ "x", 0 ], [ "y", 0 ], [ "width", 0 ], [ "height", 0 ] ] ], Texture: [ "drawTexture", [ [ "skin", null ], [ "x", 0 ], [ "y", 0 ], [ "width", 0 ], [ "height", 0 ] ], 1, "_adptTextureData" ], FillTexture: [ "fillTexture", [ [ "skin", null ], [ "x", 0 ], [ "y", 0 ], [ "width", 0 ], [ "height", 0 ], [ "repeat", null ] ], 1, "_adptTextureData" ], FillText: [ "fillText", [ [ "text", "" ], [ "x", 0 ], [ "y", 0 ], [ "font", null ], [ "color", null ], [ "textAlign", null ] ], 1 ], Line: [ "drawLine", [ [ "x", 0 ], [ "y", 0 ], [ "toX", 0 ], [ "toY", 0 ], [ "lineColor", null ], [ "lineWidth", 0 ] ], 0, "_adptLineData" ], Lines: [ "drawLines", [ [ "x", 0 ], [ "y", 0 ], [ "points", "" ], [ "lineColor", null ], [ "lineWidth", 0 ] ], 0, "_adptLinesData" ], Curves: [ "drawCurves", [ [ "x", 0 ], [ "y", 0 ], [ "points", "" ], [ "lineColor", null ], [ "lineWidth", 0 ] ], 0, "_adptLinesData" ], Poly: [ "drawPoly", [ [ "x", 0 ], [ "y", 0 ], [ "points", "" ], [ "fillColor", null ], [ "lineColor", null ], [ "lineWidth", 1 ] ], 0, "_adptLinesData" ] }; } ]), t; }(), V = function() { function t(e) { if (this._color = [], "string" == typeof e) { this.strColor = e, null === e && (e = "#000000"), "#" == e.charAt(0) && (e = e.substr(1)); var i = e.length; if (3 == i || 4 == i) { for (var n = "", s = 0; s < i; s++) n += e[s] + e[s]; e = n; } var a = this.numColor = parseInt(e, 16); if (8 == e.length) return void (this._color = [ parseInt(e.substr(0, 2), 16) / 255, ((16711680 & a) >> 16) / 255, ((65280 & a) >> 8) / 255, (255 & a) / 255 ]); } else a = this.numColor = e, this.strColor = $.toHexColor(a); this._color = [ ((16711680 & a) >> 16) / 255, ((65280 & a) >> 8) / 255, (255 & a) / 255, 1 ], this._color.__id = ++t._COLODID; } return s(t, "laya.utils.Color"), t._initDefault = function() { t._DEFAULT = {}; for (var e in t._COLOR_MAP) t._SAVE[e] = t._DEFAULT[e] = new t(t._COLOR_MAP[e]); return t._DEFAULT; }, t._initSaveMap = function() { t._SAVE_SIZE = 0, t._SAVE = {}; for (var e in t._DEFAULT) t._SAVE[e] = t._DEFAULT[e]; }, t.create = function(e) { var i = t._SAVE[e + ""]; return null != i ? i : (t._SAVE_SIZE < 1e3 || t._initSaveMap(), t._SAVE[e + ""] = new t(e)); }, t._SAVE = {}, t._SAVE_SIZE = 0, t._COLOR_MAP = { white: "#FFFFFF", red: "#FF0000", green: "#00FF00", blue: "#0000FF", black: "#000000", yellow: "#FFFF00", gray: "#AAAAAA" }, t._DEFAULT = t._initDefault(), t._COLODID = 1, t; }(), W = (function() { function t() { this._values = [], this._keys = []; } s(t, "laya.utils.Dictionary"); var e = t.prototype; e.set = function(t, e) { var i = this.indexOf(t); i >= 0 ? this._values[i] = e : (this._keys.push(t), this._values.push(e)); }, e.indexOf = function(t) { var e = this._keys.indexOf(t); return e >= 0 ? e : (t = "string" == typeof t ? Number(t) : "number" == typeof t ? t.toString() : t, this._keys.indexOf(t)); }, e.get = function(t) { var e = this.indexOf(t); return e < 0 ? null : this._values[e]; }, e.remove = function(t) { var e = this.indexOf(t); return e >= 0 && (this._keys.splice(e, 1), this._values.splice(e, 1), !0); }, e.clear = function() { this._values.length = 0, this._keys.length = 0; }, a(0, e, "values", function() { return this._values; }), a(0, e, "keys", function() { return this._keys; }); }(), function() { function t() { this.ratio = .92, this.maxOffset = 60, this._dragging = !1, this._clickOnly = !0; } s(t, "laya.utils.Dragging"); var e = t.prototype; return e.start = function(t, e, n, s, a, r, o, h) { void 0 === h && (h = .92), this.clearTimer(), this.target = t, this.area = e, this.hasInertia = n, this.elasticDistance = e ? s : 0, this.elasticBackTime = a, this.data = r, this._disableMouseEvent = o, this.ratio = h, this._parent = t.parent, this._clickOnly = !0, this._dragging = !0, this._elasticRateX = this._elasticRateY = 1, this._lastX = this._parent.mouseX, this._lastY = this._parent.mouseY, i.stage.on("mouseup", this, this.onStageMouseUp), i.stage.on("mouseout", this, this.onStageMouseUp), i.timer.frameLoop(1, this, this.loop); }, e.clearTimer = function() { i.timer.clear(this, this.loop), i.timer.clear(this, this.tweenMove), this._tween && (this._tween.recover(), this._tween = null); }, e.stop = function() { this._dragging && (v.instance.disableMouseEvent = !1, i.stage.off("mouseup", this, this.onStageMouseUp), i.stage.off("mouseout", this, this.onStageMouseUp), this._dragging = !1, this.target && this.area && this.backToArea(), this.clear()); }, e.loop = function() { var t = this._parent.getMousePoint(), e = t.x, n = t.y, s = e - this._lastX, a = n - this._lastY; if (this._clickOnly) { if (!(Math.abs(s * i.stage._canvasTransform.getScaleX()) > 1 || Math.abs(a * i.stage._canvasTransform.getScaleY()) > 1)) return; this._clickOnly = !1, this._offsets || (this._offsets = []), this._offsets.length = 0, this.target.event("dragstart", this.data), v.instance.disableMouseEvent = this._disableMouseEvent, this.target._set$P("$_MOUSEDOWN", !1); } else this._offsets.push(s, a); 0 === s && 0 === a || (this._lastX = e, this._lastY = n, this.target.x += s * this._elasticRateX, this.target.y += a * this._elasticRateY, this.area && this.checkArea(), this.target.event("dragmove", this.data)); }, e.checkArea = function() { if (this.elasticDistance <= 0) this.backToArea(); else { if (this.target.x < this.area.x) var t = this.area.x - this.target.x; else t = this.target.x > this.area.x + this.area.width ? this.target.x - this.area.x - this.area.width : 0; if (this._elasticRateX = Math.max(0, 1 - t / this.elasticDistance), this.target.y < this.area.y) var e = this.area.y - this.target.y; else e = this.target.y > this.area.y + this.area.height ? this.target.y - this.area.y - this.area.height : 0; this._elasticRateY = Math.max(0, 1 - e / this.elasticDistance); } }, e.backToArea = function() { this.target.x = Math.min(Math.max(this.target.x, this.area.x), this.area.x + this.area.width), this.target.y = Math.min(Math.max(this.target.y, this.area.y), this.area.y + this.area.height); }, e.onStageMouseUp = function(t) { if (v.instance.disableMouseEvent = !1, i.stage.off("mouseup", this, this.onStageMouseUp), i.stage.off("mouseout", this, this.onStageMouseUp), i.timer.clear(this, this.loop), !this._clickOnly && this.target) if (this.hasInertia) { this._offsets.length < 1 && this._offsets.push(this._parent.mouseX - this._lastX, this._parent.mouseY - this._lastY), this._offsetX = this._offsetY = 0; for (var e = this._offsets.length, n = Math.min(e, 6), s = this._offsets.length - n, a = e - 1; a > s; a--) this._offsetY += this._offsets[a--], this._offsetX += this._offsets[a]; this._offsetX = this._offsetX / n * 2, this._offsetY = this._offsetY / n * 2, Math.abs(this._offsetX) > this.maxOffset && (this._offsetX = this._offsetX > 0 ? this.maxOffset : -this.maxOffset), Math.abs(this._offsetY) > this.maxOffset && (this._offsetY = this._offsetY > 0 ? this.maxOffset : -this.maxOffset), i.timer.frameLoop(1, this, this.tweenMove); } else this.elasticDistance > 0 ? this.checkElastic() : this.clear(); }, e.checkElastic = function() { var t = NaN, e = NaN; if (this.target.x < this.area.x ? t = this.area.x : this.target.x > this.area.x + this.area.width && (t = this.area.x + this.area.width), this.target.y < this.area.y ? e = this.area.y : this.target.y > this.area.y + this.area.height && (e = this.area.y + this.area.height), isNaN(t) && isNaN(e)) this.clear(); else { var i = {}; isNaN(t) || (i.x = t), isNaN(e) || (i.y = e), this._tween = K.to(this.target, i, this.elasticBackTime, G.sineOut, l.create(this, this.clear), 0, !1, !1); } }, e.tweenMove = function() { this._offsetX *= this.ratio * this._elasticRateX, this._offsetY *= this.ratio * this._elasticRateY, this.target.x += this._offsetX, this.target.y += this._offsetY, this.area && this.checkArea(), this.target.event("dragmove", this.data), (Math.abs(this._offsetX) < 1 && Math.abs(this._offsetY) < 1 || this._elasticRateX < .5 || this._elasticRateY < .5) && (i.timer.clear(this, this.tweenMove), this.elasticDistance > 0 ? this.checkElastic() : this.clear()); }, e.clear = function() { if (this.target) { this.clearTimer(); var t = this.target; this.target = null, this._parent = null, t.event("dragend", this.data); } }, t; }()), G = function() { function t() {} return s(t, "laya.utils.Ease"), t.linearNone = function(t, e, i, n) { return i * t / n + e; }, t.linearIn = function(t, e, i, n) { return i * t / n + e; }, t.linearInOut = function(t, e, i, n) { return i * t / n + e; }, t.linearOut = function(t, e, i, n) { return i * t / n + e; }, t.bounceIn = function(e, i, n, s) { return n - t.bounceOut(s - e, 0, n, s) + i; }, t.bounceInOut = function(e, i, n, s) { return e < .5 * s ? .5 * t.bounceIn(2 * e, 0, n, s) + i : .5 * t.bounceOut(2 * e - s, 0, n, s) + .5 * n + i; }, t.bounceOut = function(t, e, i, n) { return (t /= n) < 1 / 2.75 ? i * (7.5625 * t * t) + e : t < 2 / 2.75 ? i * (7.5625 * (t -= 1.5 / 2.75) * t + .75) + e : t < 2.5 / 2.75 ? i * (7.5625 * (t -= 2.25 / 2.75) * t + .9375) + e : i * (7.5625 * (t -= 2.625 / 2.75) * t + .984375) + e; }, t.backIn = function(t, e, i, n, s) { return void 0 === s && (s = 1.70158), i * (t /= n) * t * ((s + 1) * t - s) + e; }, t.backInOut = function(t, e, i, n, s) { return void 0 === s && (s = 1.70158), (t /= .5 * n) < 1 ? .5 * i * (t * t * ((1 + (s *= 1.525)) * t - s)) + e : i / 2 * ((t -= 2) * t * ((1 + (s *= 1.525)) * t + s) + 2) + e; }, t.backOut = function(t, e, i, n, s) { return void 0 === s && (s = 1.70158), i * ((t = t / n - 1) * t * ((s + 1) * t + s) + 1) + e; }, t.elasticIn = function(e, i, n, s, a, r) { void 0 === a && (a = 0), void 0 === r && (r = 0); var o; return 0 == e ? i : 1 == (e /= s) ? i + n : (r || (r = .3 * s), !a || n > 0 && a < n || n < 0 && a < -n ? (a = n, o = r / 4) : o = r / t.PI2 * Math.asin(n / a), -a * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * s - o) * t.PI2 / r) + i); }, t.elasticInOut = function(e, i, n, s, a, r) { void 0 === a && (a = 0), void 0 === r && (r = 0); var o; return 0 == e ? i : 2 == (e /= .5 * s) ? i + n : (r || (r = s * (.3 * 1.5)), !a || n > 0 && a < n || n < 0 && a < -n ? (a = n, o = r / 4) : o = r / t.PI2 * Math.asin(n / a), e < 1 ? a * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * s - o) * t.PI2 / r) * -.5 + i : a * Math.pow(2, -10 * (e -= 1)) * Math.sin((e * s - o) * t.PI2 / r) * .5 + n + i); }, t.elasticOut = function(e, i, n, s, a, r) { void 0 === a && (a = 0), void 0 === r && (r = 0); var o; return 0 == e ? i : 1 == (e /= s) ? i + n : (r || (r = .3 * s), !a || n > 0 && a < n || n < 0 && a < -n ? (a = n, o = r / 4) : o = r / t.PI2 * Math.asin(n / a), a * Math.pow(2, -10 * e) * Math.sin((e * s - o) * t.PI2 / r) + n + i); }, t.strongIn = function(t, e, i, n) { return i * (t /= n) * t * t * t * t + e; }, t.strongInOut = function(t, e, i, n) { return (t /= .5 * n) < 1 ? .5 * i * t * t * t * t * t + e : .5 * i * ((t -= 2) * t * t * t * t + 2) + e; }, t.strongOut = function(t, e, i, n) { return i * ((t = t / n - 1) * t * t * t * t + 1) + e; }, t.sineInOut = function(t, e, i, n) { return .5 * -i * (Math.cos(Math.PI * t / n) - 1) + e; }, t.sineIn = function(e, i, n, s) { return -n * Math.cos(e / s * t.HALF_PI) + n + i; }, t.sineOut = function(e, i, n, s) { return n * Math.sin(e / s * t.HALF_PI) + i; }, t.quintIn = function(t, e, i, n) { return i * (t /= n) * t * t * t * t + e; }, t.quintInOut = function(t, e, i, n) { return (t /= .5 * n) < 1 ? .5 * i * t * t * t * t * t + e : .5 * i * ((t -= 2) * t * t * t * t + 2) + e; }, t.quintOut = function(t, e, i, n) { return i * ((t = t / n - 1) * t * t * t * t + 1) + e; }, t.quartIn = function(t, e, i, n) { return i * (t /= n) * t * t * t + e; }, t.quartInOut = function(t, e, i, n) { return (t /= .5 * n) < 1 ? .5 * i * t * t * t * t + e : .5 * -i * ((t -= 2) * t * t * t - 2) + e; }, t.quartOut = function(t, e, i, n) { return -i * ((t = t / n - 1) * t * t * t - 1) + e; }, t.cubicIn = function(t, e, i, n) { return i * (t /= n) * t * t + e; }, t.cubicInOut = function(t, e, i, n) { return (t /= .5 * n) < 1 ? .5 * i * t * t * t + e : .5 * i * ((t -= 2) * t * t + 2) + e; }, t.cubicOut = function(t, e, i, n) { return i * ((t = t / n - 1) * t * t + 1) + e; }, t.quadIn = function(t, e, i, n) { return i * (t /= n) * t + e; }, t.quadInOut = function(t, e, i, n) { return (t /= .5 * n) < 1 ? .5 * i * t * t + e : .5 * -i * (--t * (t - 2) - 1) + e; }, t.quadOut = function(t, e, i, n) { return -i * (t /= n) * (t - 2) + e; }, t.expoIn = function(t, e, i, n) { return 0 == t ? e : i * Math.pow(2, 10 * (t / n - 1)) + e - .001 * i; }, t.expoInOut = function(t, e, i, n) { return 0 == t ? e : t == n ? e + i : (t /= .5 * n) < 1 ? .5 * i * Math.pow(2, 10 * (t - 1)) + e : .5 * i * (2 - Math.pow(2, -10 * --t)) + e; }, t.expoOut = function(t, e, i, n) { return t == n ? e + i : i * (1 - Math.pow(2, -10 * t / n)) + e; }, t.circIn = function(t, e, i, n) { return -i * (Math.sqrt(1 - (t /= n) * t) - 1) + e; }, t.circInOut = function(t, e, i, n) { return (t /= .5 * n) < 1 ? .5 * -i * (Math.sqrt(1 - t * t) - 1) + e : .5 * i * (Math.sqrt(1 - (t -= 2) * t) + 1) + e; }, t.circOut = function(t, e, i, n) { return i * Math.sqrt(1 - (t = t / n - 1) * t) + e; }, t.HALF_PI = .5 * Math.PI, t.PI2 = 2 * Math.PI, t; }(), H = function() { function t() { this._hit = null, this._unHit = null; } s(t, "laya.utils.HitArea"); var e = t.prototype; return e.isHit = function(e, i) { return !!t.isHitGraphic(e, i, this.hit) && !t.isHitGraphic(e, i, this.unHit); }, e.contains = function(t, e) { return this.isHit(t, e); }, a(0, e, "hit", function() { return this._hit || (this._hit = new p()), this._hit; }, function(t) { this._hit = t; }), a(0, e, "unHit", function() { return this._unHit || (this._unHit = new p()), this._unHit; }, function(t) { this._unHit = t; }), t.isHitGraphic = function(e, i, n) { if (!n) return !1; var s; if (!(s = n.cmds) && n._one && ((s = t._cmds).length = 1, s[0] = n._one), !s) return !1; var a = 0, r = 0; r = s.length; var o; for (a = 0; a < r; a++) if (o = s[a]) { var h = k._context; switch (o.callee) { case h._translate: case 6: e -= o[0], i -= o[1]; } if (t.isHitCmd(e, i, o)) return !0; } return !1; }, t.isHitCmd = function(e, i, n) { if (!n) return !1; var s = k._context, a = !1; switch (n.callee) { case s._drawRect: case 13: t._rec.setTo(n[0], n[1], n[2], n[3]), a = t._rec.contains(e, i); break; case s._drawCircle: case s._fillCircle: case 14: a = (e -= n[0]) * e + (i -= n[1]) * i < n[2] * n[2]; break; case s._drawPoly: case 18: e -= n[0], i -= n[1], a = t.ptInPolygon(e, i, n[2]); } return a; }, t.ptInPolygon = function(e, i, n) { var s; (s = t._ptPoint).setTo(e, i); var a = 0, r = NaN, o = NaN, h = NaN, l = NaN, u = 0; u = n.length; for (var c = 0; c < u; c += 2) if (r = n[c], o = n[c + 1], h = n[(c + 2) % u], l = n[(c + 3) % u], o != l && !(s.y < Math.min(o, l) || s.y >= Math.max(o, l))) { (s.y - o) * (h - r) / (l - o) + r > s.x && a++; } return a % 2 == 1; }, t._cmds = [], n(t, [ "_rec", function() { return this._rec = new M(); }, "_ptPoint", function() { return this._ptPoint = new I(); } ]), t; }(), Y = (function() { function t(e, i, n, s) { this.char = e, this.charNum = e.charCodeAt(0), this._x = this._y = 0, this.width = i, this.height = n, this.style = s, this.isWord = !t._isWordRegExp.test(e); } s(t, "laya.utils.HTMLChar"); var e = t.prototype; i.imps(e, { "laya.display.ILayout": !0 }), e.setSprite = function(t) { this._sprite = t; }, e.getSprite = function() { return this._sprite; }, e._isChar = function() { return !0; }, e._getCSSStyle = function() { return this.style; }, a(0, e, "width", function() { return this._w; }, function(t) { this._w = t; }), a(0, e, "x", function() { return this._x; }, function(t) { this._sprite && (this._sprite.x = t), this._x = t; }), a(0, e, "y", function() { return this._y; }, function(t) { this._sprite && (this._sprite.y = t), this._y = t; }), a(0, e, "height", function() { return this._h; }, function(t) { this._h = t; }), t._isWordRegExp = new RegExp("[\\w.]", ""); }(), function() { function t() {} s(t, "laya.utils.Log"), t.enable = function() { t._logdiv || (t._logdiv = B.window.document.createElement("div"), B.window.document.body.appendChild(t._logdiv), t._logdiv.style.cssText = "pointer-events:none;border:white;overflow:hidden;z-index:1000000;background:rgba(100,100,100,0.6);color:white;position: absolute;left:0px;top:0px;width:50%;height:50%;"); }, t.toggle = function() { var e = t._logdiv.style; "1px" == e.width ? e.width = e.height = "50%" : e.width = e.height = "1px"; }, t.print = function(e) { t._logdiv && (t._count >= t.maxCount && t.clear(), t._count++, t._logdiv.innerText += e + "\n", t._logdiv.scrollTop = t._logdiv.scrollHeight); }, t.clear = function() { t._logdiv.innerText = "", t._count = 0; }, t._logdiv = null, t._count = 0, t.maxCount = 20; }(), function() { function t() {} s(t, "laya.utils.Mouse"), a(1, t, "cursor", function() { return t._style.cursor; }, function(e) { t._style.cursor = e; }), t.hide = function() { "none" != t.cursor && (t._preCursor = t.cursor, t.cursor = "none"); }, t.show = function() { "none" == t.cursor && (t.cursor = t._preCursor ? t._preCursor : "auto"); }, t._preCursor = null, n(t, [ "_style", function() { return this._style = B.document.body.style; } ]); }(), function() { function t() {} return s(t, "laya.utils.Pool"), t.getPoolBySign = function(e) { return t._poolDic[e] || (t._poolDic[e] = []); }, t.clearBySign = function(e) { t._poolDic[e] && (t._poolDic[e].length = 0); }, t.recover = function(e, i) { i.__InPool || (i.__InPool = !0, t.getPoolBySign(e).push(i)); }, t.getItemByClass = function(e, i) { var n = t.getPoolBySign(e), s = n.length ? n.pop() : new i(); return s.__InPool = !1, s; }, t.getItemByCreateFun = function(e, i, n) { var s = t.getPoolBySign(e), a = s.length ? s.pop() : i.call(n); return a.__InPool = !1, a; }, t.getItem = function(e) { var i = t.getPoolBySign(e), n = i.length ? i.pop() : null; return n && (n.__InPool = !1), n; }, t._poolDic = {}, t.InPoolSign = "__InPool", t; }()), X = (function() { function t() { this.sign = null, this.maxCount = 1e3; } s(t, "laya.utils.PoolCache"); var e = t.prototype; e.getCacheList = function() { return Y.getPoolBySign(this.sign); }, e.tryDispose = function(t) { var e; (e = Y.getPoolBySign(this.sign)).length > this.maxCount && e.splice(this.maxCount, e.length - this.maxCount); }, t.addPoolCacheManager = function(e, i) { void 0 === i && (i = 100); var n; (n = new t()).sign = e, n.maxCount = i, z.regCacheByFunction($.bind(n.tryDispose, n), $.bind(n.getCacheList, n)); }; }(), function() { function t() {} return s(t, "laya.utils.Stat"), a(1, t, "onclick", null, function(e) { t._sp && t._sp.on("click", t._sp, e), t._canvas && (t._canvas.source.onclick = e, t._canvas.source.style.pointerEvents = ""); }), t.show = function(e, i) { void 0 === e && (e = 0), void 0 === i && (i = 0), !k.isConchApp || k.isConchWebGL ? (k.isConchWebGL || B.onMiniGame || B.onLimixiu || B.onKGMiniGame || B.onBDMiniGame || B.onTTMiniGame || B.onQGMiniGame || B.onVVMiniGame || B.onBLMiniGame || B.onQQMiniGame || (t._useCanvas = !0), t._show = !0, t._fpsData.length = 60, t._view[0] = { title: "FPS(Canvas)", value: "_fpsStr", color: "yellow", units: "int" }, t._view[1] = { title: "Sprite", value: "_spriteStr", color: "white", units: "int" }, t._view[2] = { title: "DrawCall", value: "drawCall", color: "white", units: "int" }, t._view[3] = { title: "CurMem", value: "currentMemorySize", color: "yellow", units: "M" }, k.isWebGL ? (t._view[4] = { title: "Shader", value: "shaderCall", color: "white", units: "int" }, k.is3DMode ? (t._view[0].title = "FPS(3D)", t._view[5] = { title: "TriFaces", value: "trianglesFaces", color: "white", units: "int" }, t._view[6] = { title: "treeNodeColl", value: "treeNodeCollision", color: "white", units: "int" }, t._view[7] = { title: "treeSpriteColl", value: "treeSpriteCollision", color: "white", units: "int" }) : (t._view[0].title = "FPS(WebGL)", t._view[5] = { title: "Canvas", value: "_canvasStr", color: "white", units: "int" })) : t._view[4] = { title: "Canvas", value: "_canvasStr", color: "white", units: "int" }, t._useCanvas ? t.createUIPre(e, i) : t.createUI(e, i), t.enable()) : B.window.conch.showFPS && B.window.conch.showFPS(e, i); }, t.createUIPre = function(e, i) { var n = B.pixelRatio; (B.onQGMiniGame || B.onVVMiniGame) && (n = 3), t._width = 130 * n, t._vx = 75 * n, t._height = n * (12 * t._view.length + 3 * n) + 4, t._fontSize = 12 * n; for (var s = 0; s < t._view.length; s++) t._view[s].x = 4, t._view[s].y = s * t._fontSize + 2 * n; t._canvas || ((t._canvas = new yt("2D")).size(t._width, t._height), (t._ctx = t._canvas.getContext("2d")).textBaseline = "top", t._ctx.font = t._fontSize + "px Sans-serif", t._canvas.source.style.cssText = "pointer-events:none;background:rgba(150,150,150,0.8);z-index:100000;position: absolute;direction:ltr;left:" + e + "px;top:" + i + "px;width:" + t._width / n + "px;height:" + t._height / n + "px;"), t._first = !0, t.loop(), t._first = !1, B.onKGMiniGame || B.container.appendChild(t._canvas.source); }, t.createUI = function(e, i) { var n = t._sp, s = B.pixelRatio; (B.onQGMiniGame || B.onVVMiniGame) && (s = 3), n || (n = new ct(), (t._leftText = new gt()).pos(5, 5), t._leftText.color = "#ffffff", n.addChild(t._leftText), (t._txt = new gt()).pos(80 * s, 5), t._txt.color = "#ffffff", n.addChild(t._txt), t._sp = n), n.pos(e, i); for (var a = "", r = 0; r < t._view.length; r++) { a += t._view[r].title + "\n"; } t._leftText.text = a; var o = 138 * s, h = s * (12 * t._view.length + 3 * s) + 4; t._txt.fontSize = t._fontSize * s, t._leftText.fontSize = t._fontSize * s, n.size(o, h), n.graphics.clear(), n.graphics.setAlpha(.5), n.graphics.drawRect(0, 0, o, h, "#999999"), n.graphics.setAlpha(1), t.loop(); }, t.enable = function() { i.timer.frameLoop(1, t, t.loop); }, t.hide = function() { t._show = !1, i.timer.clear(t, t.loop), t._canvas && B.removeElement(t._canvas.source); }, t.clear = function() { t.trianglesFaces = t.drawCall = t.shaderCall = t.spriteCount = t.spriteRenderUseCacheCount = t.treeNodeCollision = t.treeSpriteCollision = t.canvasNormal = t.canvasBitmap = t.canvasReCache = 0; }, t.loop = function() { t._count++; var e = B.now(); if (!(e - t._timer < 1e3)) { var i = t._count; if (t.FPS = Math.round(1e3 * i / (e - t._timer)), t._show) { t.trianglesFaces = Math.round(t.trianglesFaces / i), t._useCanvas ? (t.drawCall = Math.round(t.drawCall / i) - 2, t.shaderCall = Math.round(t.shaderCall / i), t.spriteCount = Math.round(t.spriteCount / i) - 1) : (t.drawCall = Math.round(t.drawCall / i) - 2, t.shaderCall = Math.round(t.shaderCall / i) - 4, t.spriteCount = Math.round(t.spriteCount / i) - 4), t.spriteRenderUseCacheCount = Math.round(t.spriteRenderUseCacheCount / i), t.canvasNormal = Math.round(t.canvasNormal / i), t.canvasBitmap = Math.round(t.canvasBitmap / i), t.canvasReCache = Math.ceil(t.canvasReCache / i), t.treeNodeCollision = Math.round(t.treeNodeCollision / i), t.treeSpriteCollision = Math.round(t.treeSpriteCollision / i); var n = t.FPS > 0 ? Math.floor(1e3 / t.FPS).toString() : " "; t._fpsStr = t.FPS + (t.renderSlow ? " slow" : "") + " " + n, t._spriteStr = t.spriteCount + (t.spriteRenderUseCacheCount ? "/" + t.spriteRenderUseCacheCount : ""), t._canvasStr = t.canvasReCache + "/" + t.canvasNormal + "/" + t.canvasBitmap, t.currentMemorySize = F.systemResourceManager.memorySize, t._useCanvas ? t.renderInfoPre() : t.renderInfo(), t.clear(); } t._count = 0, t._timer = e; } }, t.renderInfoPre = function() { if (t._canvas) { var e = t._ctx; e.clearRect(t._first ? 0 : t._vx, 0, t._width, t._height); for (var i = 0; i < t._view.length; i++) { var n = t._view[i]; t._first && (e.fillStyle = "white", e.fillText(n.title, n.x, n.y, null, null, null)), e.fillStyle = n.color; var s = t[n.value]; "M" == n.units && (s = Math.floor(s / 1048576 * 100) / 100 + " M"), e.fillText(s + "", n.x + t._vx, n.y, null, null, null); } } }, t.renderInfo = function() { for (var e = "", i = 0; i < t._view.length; i++) { var n = t._view[i], s = t[n.value]; "M" == n.units && (s = Math.floor(s / 1048576 * 100) / 100 + " M"), "K" == n.units && (s = Math.floor(s / 1024 * 100) / 100 + " K"), e += s + "\n"; } t._txt.text = e; }, t.FPS = 0, t.loopCount = 0, t.shaderCall = 0, t.drawCall = 0, t.trianglesFaces = 0, t.spriteCount = 0, t.spriteRenderUseCacheCount = 0, t.treeNodeCollision = 0, t.treeSpriteCollision = 0, t.canvasNormal = 0, t.canvasBitmap = 0, t.canvasReCache = 0, t.renderSlow = !1, t.currentMemorySize = 0, t._fpsStr = null, t._canvasStr = null, t._spriteStr = null, t._fpsData = [], t._timer = 0, t._count = 0, t._view = [], t._fontSize = 12, t._txt = null, t._leftText = null, t._sp = null, t._show = !1, t._useCanvas = !1, t._canvas = null, t._ctx = null, t._first = !1, t._vx = NaN, t._width = 0, t._height = 100, t; }()), j = (function() { function t() { this._strsToID = {}, this._idToStrs = [], this._length = 0; } s(t, "laya.utils.StringKey"); var e = t.prototype; e.add = function(t) { var e = this._strsToID[t]; return null != e ? e : (this._idToStrs[this._length] = t, this._strsToID[t] = this._length++); }, e.getID = function(t) { var e = this._strsToID[t]; return null == e ? -1 : e; }, e.getName = function(t) { var e = this._idToStrs[t]; return null == e ? void 0 : e; }; }(), function() { function t() { this._delta = 0, this.scale = 1, this.currFrame = 0, this._mid = 1, this._map = [], this._laters = [], this._handlers = [], this._temp = [], this._count = 0, this.currTimer = this._now(), this._lastTimer = this._now(), this._init(); } var e; s(t, "laya.utils.Timer"); var n = t.prototype; return n._init = function() { i.timer && i.timer.frameLoop(1, this, this._update); }, n._now = function() { return Date.now(); }, n._update = function() { if (this.scale <= 0) this._lastTimer = this._now(); else { var t = this.currFrame = this.currFrame + this.scale, e = this._now(); this._delta = (e - this._lastTimer) * this.scale; var i = this.currTimer = this.currTimer + this._delta; this._lastTimer = e; var n = this._handlers; for (this._count = 0, r = 0, o = n.length; r < o; r++) if (null !== (h = n[r]).method) { var s = h.userFrame ? t : i; if (s >= h.exeTime) if (h.repeat) if (h.jumpFrame) for (;s >= h.exeTime; ) h.exeTime += h.delay, h.run(!1); else h.exeTime += h.delay, h.run(!1), s > h.exeTime && (h.exeTime += Math.ceil((s - h.exeTime) / h.delay) * h.delay); else h.run(!0); } else this._count++; (this._count > 30 || t % 200 == 0) && this._clearHandlers(); for (var a = this._laters, r = 0, o = a.length - 1; r <= o; r++) { var h = a[r]; null !== h.method && (this._map[h.key] = null, h.run(!1)), this._recoverHandler(h), r === o && (o = a.length - 1); } a.length = 0; } }, n._clearHandlers = function() { for (var t = this._handlers, e = 0, i = t.length; e < i; e++) { var n = t[e]; null !== n.method ? this._temp.push(n) : this._recoverHandler(n); } this._handlers = this._temp, this._temp = t, this._temp.length = 0; }, n._recoverHandler = function(e) { this._map[e.key] == e && (this._map[e.key] = null), e.clear(), t._pool.push(e); }, n._create = function(i, n, s, a, r, o, h) { if (!s) return r.apply(a, o), null; if (h) { var l = this._getHandler(a, r); if (l) return l.repeat = n, l.userFrame = i, l.delay = s, l.caller = a, l.method = r, l.args = o, l.exeTime = s + (i ? this.currFrame : this.currTimer + this._now() - this._lastTimer), l; } return l = t._pool.length > 0 ? t._pool.pop() : new e(), l.repeat = n, l.userFrame = i, l.delay = s, l.caller = a, l.method = r, l.args = o, l.exeTime = s + (i ? this.currFrame : this.currTimer + this._now() - this._lastTimer) + 1, this._indexHandler(l), this._handlers.push(l), l; }, n._indexHandler = function(t) { var e = t.caller, i = t.method, n = e ? e.$_GID || (e.$_GID = $.getGID()) : 0, s = i.$_TID || (i.$_TID = 1e5 * this._mid++); t.key = n + s, this._map[t.key] = t; }, n.once = function(t, e, i, n, s) { void 0 === s && (s = !0), this._create(!1, !1, t, e, i, n, s); }, n.loop = function(t, e, i, n, s, a) { void 0 === s && (s = !0), void 0 === a && (a = !1); var r = this._create(!1, !0, t, e, i, n, s); r && (r.jumpFrame = a); }, n.frameOnce = function(t, e, i, n, s) { void 0 === s && (s = !0), this._create(!0, !1, t, e, i, n, s); }, n.frameLoop = function(t, e, i, n, s) { void 0 === s && (s = !0), this._create(!0, !0, t, e, i, n, s); }, n.toString = function() { return "callLater:" + this._laters.length + " handlers:" + this._handlers.length + " pool:" + t._pool.length; }, n.clear = function(t, e) { var i = this._getHandler(t, e); i && (this._map[i.key] = null, i.key = 0, i.clear()); }, n.clearAll = function(t) { if (t) for (var e = 0, i = this._handlers.length; e < i; e++) { var n = this._handlers[e]; n.caller === t && (this._map[n.key] = null, n.key = 0, n.clear()); } }, n._getHandler = function(t, e) { var i = t ? t.$_GID || (t.$_GID = $.getGID()) : 0, n = e.$_TID || (e.$_TID = 1e5 * this._mid++); return this._map[i + n]; }, n.callLater = function(i, n, s) { if (null == this._getHandler(i, n)) { if (t._pool.length) var a = t._pool.pop(); else a = new e(); a.caller = i, a.method = n, a.args = s, this._indexHandler(a), this._laters.push(a); } }, n.runCallLater = function(t, e) { var i = this._getHandler(t, e); i && null != i.method && (this._map[i.key] = null, i.run(!0)); }, n.runTimer = function(t, e) { this.runCallLater(t, e); }, a(0, n, "delta", function() { return this._delta; }), t._pool = [], t.__init$ = function() { e = function() { function t() { this.key = 0, this.repeat = !1, this.delay = 0, this.userFrame = !1, this.exeTime = 0, this.caller = null, this.method = null, this.args = null, this.jumpFrame = !1; } s(t, ""); var e = t.prototype; return e.clear = function() { this.caller = null, this.method = null, this.args = null; }, e.run = function(t) { var e = this.caller; if (e && e.destroyed) return this.clear(); var i = this.method, n = this.args; t && this.clear(), null != i && (n ? i.apply(e, n) : i.call(e)); }, t; }(); }, t; }()), K = function() { function t() { this.gid = 0; } s(t, "laya.utils.Tween"); var e = t.prototype; return e.to = function(t, e, i, n, s, a, r) { return void 0 === a && (a = 0), void 0 === r && (r = !1), this._create(t, e, i, n, s, a, r, !0, !1, !0); }, e.from = function(t, e, i, n, s, a, r) { return void 0 === a && (a = 0), void 0 === r && (r = !1), this._create(t, e, i, n, s, a, r, !1, !1, !0); }, e._create = function(e, n, s, a, r, o, h, l, u, c) { if (!e) throw new Error("Tween:target is null"); this._target = e, this._duration = s, this._ease = a || n.ease || t.easeNone, this._complete = r || n.complete, this._delay = o, this._props = [], this._usedTimer = 0, this._startTimer = B.now(), this._usedPool = u, this._delayParam = null, this.update = n.update; var _ = e.$_GID || (e.$_GID = $.getGID()); return t.tweenMap[_] ? (h && t.clearTween(e), t.tweenMap[_].push(this)) : t.tweenMap[_] = [ this ], c ? o <= 0 ? this.firstStart(e, n, l) : (this._delayParam = [ e, n, l ], i.scaleTimer.once(o, this, this.firstStart, this._delayParam)) : this._initProps(e, n, l), this; }, e.firstStart = function(t, e, i) { this._delayParam = null, t.destroyed ? this.clear() : (this._initProps(t, e, i), this._beginLoop()); }, e._initProps = function(t, e, i) { for (var n in e) if ("number" == typeof t[n]) { var s = i ? t[n] : e[n], a = i ? e[n] : t[n]; this._props.push([ n, s, a - s ]), i || (t[n] = s); } }, e._beginLoop = function() { i.scaleTimer.frameLoop(1, this, this._doEase); }, e._doEase = function() { this._updateEase(B.now()); }, e._updateEase = function(e) { var i = this._target; if (i) { if (i.destroyed) return t.clearTween(i); var n = this._usedTimer = e - this._startTimer - this._delay; if (!(n < 0)) { if (n >= this._duration) return this.complete(); for (var s = n > 0 ? this._ease(n, 0, 1, this._duration) : 0, a = this._props, r = 0, o = a.length; r < o; r++) { var h = a[r]; i[h[0]] = h[1] + s * h[2]; } this.update && this.update.run(); } } }, e.complete = function() { if (this._target) { i.scaleTimer.runTimer(this, this.firstStart); for (var t = this._target, e = this._props, n = this._complete, s = 0, a = e.length; s < a; s++) { var r = e[s]; t[r[0]] = r[1] + r[2]; } this.update && this.update.run(), this.clear(), n && n.run(); } }, e.pause = function() { i.scaleTimer.clear(this, this._beginLoop), i.scaleTimer.clear(this, this._doEase), i.scaleTimer.clear(this, this.firstStart); var t = NaN; (t = B.now() - this._startTimer - this._delay) < 0 && (this._usedTimer = t); }, e.setStartTime = function(t) { this._startTimer = t; }, e.clear = function() { this._target && (this._remove(), this._clear()); }, e._clear = function() { this.pause(), i.scaleTimer.clear(this, this.firstStart), this._complete = null, this._target = null, this._ease = null, this._props = null, this._delayParam = null, this._usedPool && (this.update = null, Y.recover("tween", this)); }, e.recover = function() { this._usedPool = !0, this._clear(); }, e._remove = function() { var e = t.tweenMap[this._target.$_GID]; if (e) for (var i = 0, n = e.length; i < n; i++) if (e[i] === this) { e.splice(i, 1); break; } }, e.restart = function() { if (this.pause(), this._usedTimer = 0, this._startTimer = B.now(), this._delayParam) i.scaleTimer.once(this._delay, this, this.firstStart, this._delayParam); else { for (var t = this._props, e = 0, n = t.length; e < n; e++) { var s = t[e]; this._target[s[0]] = s[1]; } i.scaleTimer.once(this._delay, this, this._beginLoop); } }, e.resume = function() { this._usedTimer >= this._duration || (this._startTimer = B.now() - this._usedTimer - this._delay, this._delayParam ? this._usedTimer < 0 ? i.scaleTimer.once(-this._usedTimer, this, this.firstStart, this._delayParam) : this.firstStart.apply(this, this._delayParam) : this._beginLoop()); }, a(0, e, "progress", null, function(t) { var e = t * this._duration; this._startTimer = B.now() - this._delay - e; }), t.to = function(e, i, n, s, a, r, o, h) { return void 0 === r && (r = 0), void 0 === o && (o = !1), void 0 === h && (h = !0), Y.getItemByClass("tween", t)._create(e, i, n, s, a, r, o, !0, h, !0); }, t.from = function(e, i, n, s, a, r, o, h) { return void 0 === r && (r = 0), void 0 === o && (o = !1), void 0 === h && (h = !0), Y.getItemByClass("tween", t)._create(e, i, n, s, a, r, o, !1, h, !0); }, t.clearAll = function(e) { if (e && e.$_GID) { var i = t.tweenMap[e.$_GID]; if (i) { for (var n = 0, s = i.length; n < s; n++) i[n]._clear(); i.length = 0; } } }, t.clear = function(t) { t.clear(); }, t.clearTween = function(e) { t.clearAll(e); }, t.easeNone = function(t, e, i, n) { return i * t / n + e; }, t.tweenMap = {}, t; }(), $ = function() { function t() {} return s(t, "laya.utils.Utils"), t.toRadian = function(e) { return e * t._pi2; }, t.toAngle = function(e) { return e * t._pi; }, t.toHexColor = function(t) { if (t < 0 || isNaN(t)) return null; for (var e = t.toString(16); e.length < 6; ) e = "0" + e; return "#" + e; }, t.getGID = function() { return t._gid++; }, t.concatArray = function(t, e) { if (!e) return t; if (!t) return e; var i = 0, n = e.length; for (i = 0; i < n; i++) t.push(e[i]); return t; }, t.clearArray = function(t) { return t ? (t.length = 0, t) : t; }, t.copyArray = function(t, e) { if (t || (t = []), !e) return t; t.length = e.length; var i = 0, n = e.length; for (i = 0; i < n; i++) t[i] = e[i]; return t; }, t.getGlobalRecByPoints = function(t, e, i, n, s) { var a; a = new I(e, i), a = t.localToGlobal(a); var r; return r = new I(n, s), r = t.localToGlobal(r), M._getWrapRec([ a.x, a.y, r.x, r.y ]); }, t.getGlobalPosAndScale = function(e) { return t.getGlobalRecByPoints(e, 0, 0, 1, 1); }, t.bind = function(t, e) { return t.bind(e); }, t.measureText = function(t, e) { return r.measureText(t, e); }, t.updateOrder = function(t) { if (!t || t.length < 2) return !1; for (var e, i = 1, n = 0, s = t.length, a = NaN; i < s; ) { for (e = t[n = i], a = t[n]._zOrder; --n > -1 && t[n]._zOrder > a; ) t[n + 1] = t[n]; t[n + 1] = e, i++; } var r = e.parent.conchModel; if (r) if (null != r.updateZOrder) r.updateZOrder(); else { for (i = 0; i < s; i++) r.removeChild(t[i].conchModel); for (i = 0; i < s; i++) r.addChildAt(t[i].conchModel, i); } return !0; }, t.transPointList = function(t, e, i) { var n = 0, s = t.length; for (n = 0; n < s; n += 2) t[n] += e, t[n + 1] += i; }, t.parseInt = function(t, e) { void 0 === e && (e = 0); var i = B.window.parseInt(t, e); return isNaN(i) ? 0 : i; }, t.getFileExtension = function(e) { t._extReg.lastIndex = e.lastIndexOf("."); var i = t._extReg.exec(e); return i && i.length > 1 ? i[1].toLowerCase() : null; }, t.getTransformRelativeToWindow = function(t, e, n) { var s = i.stage, a = laya.utils.Utils.getGlobalPosAndScale(t), r = s._canvasTransform.clone(), o = r.tx, h = r.ty; r.rotate(-Math.PI / 180 * i.stage.canvasDegree), r.scale(i.stage.clientScaleX, i.stage.clientScaleY); var l = i.stage.canvasDegree % 180 != 0, u = NaN, c = NaN; l ? (u = n + a.y, c = e + a.x, u *= r.d, c *= r.a, 90 == i.stage.canvasDegree ? (u = o - u, c += h) : (u += o, c = h - c)) : (u = e + a.x, c = n + a.y, u *= r.a, c *= r.d, u += o, c += h); var _ = NaN, d = NaN; return l ? (_ = r.d * a.height, d = r.a * a.width) : (_ = r.a * a.width, d = r.d * a.height), { x: u, y: c, scaleX: _, scaleY: d }; }, t.fitDOMElementInArea = function(e, n, s, a, r, o) { e._fitLayaAirInitialized || (e._fitLayaAirInitialized = !0, e.style.transformOrigin = e.style.webKittransformOrigin = "left top", e.style.position = "absolute"); var h = t.getTransformRelativeToWindow(n, s, a); e.style.transform = e.style.webkitTransform = "scale(" + h.scaleX + "," + h.scaleY + ") rotate(" + i.stage.canvasDegree + "deg)", e.style.width = r + "px", e.style.height = o + "px", e.style.left = h.x + "px", e.style.top = h.y + "px"; }, t.isOkTextureList = function(t) { if (!t) return !1; var e, i = 0, n = t.length; for (i = 0; i < n; i++) if (!(e = t[i]) || !e.source) return !1; return !0; }, t.isOKCmdList = function(t) { if (!t) return !1; var e, i, n = 0, s = t.length, a = k._context; for (n = 0; n < s; n++) switch ((e = t[n]).callee) { case a._drawTexture: case a._fillTexture: case a._drawTextureWithTransform: if (!(i = e[0]) || !i.source) return !1; } return !0; }, t._gid = 1, t._pi = 180 / Math.PI, t._pi2 = Math.PI / 180, t._extReg = /\.(\w+)\??/g, t.parseXMLFromString = function(t) { var e; if (t = t.replace(/>\s+<"), (e = new DOMParser().parseFromString(t, "text/xml")).firstChild.textContent.indexOf("This page contains the following errors") > -1) throw new Error(e.firstChild.firstChild.textContent); return e; }, t; }(), q = function() { function t() { this.useDic = {}, this.shapeDic = {}, this.shapeLineDic = {}, this._id = 0, this._checkKey = !1, this._freeIdArray = [], k.isWebGL && z.regCacheByFunction($.bind(this.startDispose, this), $.bind(this.getCacheList, this)); } s(t, "laya.utils.VectorGraphManager"); var e = t.prototype; return e.getId = function() { return this._id++; }, e.addShape = function(t, e) { this.shapeDic[t] = e, this.useDic[t] || (this.useDic[t] = !0); }, e.addLine = function(t, e) { this.shapeLineDic[t] = e, this.shapeLineDic[t] || (this.shapeLineDic[t] = !0); }, e.getShape = function(t) { this._checkKey && null != this.useDic[t] && (this.useDic[t] = !0); }, e.deleteShape = function(t) { this.shapeDic[t] && (this.shapeDic[t] = null, delete this.shapeDic[t]), this.shapeLineDic[t] && (this.shapeLineDic[t] = null, delete this.shapeLineDic[t]), null != this.useDic[t] && delete this.useDic[t]; }, e.getCacheList = function() { var t, e = []; for (t in this.shapeDic) e.push(this.shapeDic[t]); for (t in this.shapeLineDic) e.push(this.shapeLineDic[t]); return e; }, e.startDispose = function(t) { var e; for (e in this.useDic) this.useDic[e] = !1; this._checkKey = !0; }, e.endDispose = function() { if (this._checkKey) { var t; for (t in this.useDic) this.useDic[t] || this.deleteShape(t); this._checkKey = !1; } }, t.getInstance = function() { return t.instance = t.instance || new t(); }, t.instance = null, t; }(), Z = function() { function t() { this._obj = null, this._obj = t.supportWeakMap ? new B.window.WeakMap() : {}, t.supportWeakMap || t._maps.push(this); } s(t, "laya.utils.WeakObject"); var e = t.prototype; return e.set = function(e, i) { if (null != e) if (t.supportWeakMap) { var n = e; "string" != typeof e && "number" != typeof e || (n = t._keys[e]) || (n = t._keys[e] = { k: e }), this._obj.set(n, i); } else "string" == typeof e || "number" == typeof e ? this._obj[e] = i : (e.$_GID || (e.$_GID = $.getGID()), this._obj[e.$_GID] = i); }, e.get = function(e) { if (null == e) return null; if (t.supportWeakMap) { var i = "string" == typeof e || "number" == typeof e ? t._keys[e] : e; return i ? this._obj.get(i) : null; } return "string" == typeof e || "number" == typeof e ? this._obj[e] : this._obj[e.$_GID]; }, e.del = function(e) { if (null != e) if (t.supportWeakMap) { var i = "string" == typeof e || "number" == typeof e ? t._keys[e] : e; if (!i) return; this._obj.delete(i); } else "string" == typeof e || "number" == typeof e ? delete this._obj[e] : delete this._obj[this._obj.$_GID]; }, e.has = function(e) { if (null == e) return !1; if (t.supportWeakMap) { var i = "string" == typeof e || "number" == typeof e ? t._keys[e] : e; return this._obj.has(i); } return "string" == typeof e || "number" == typeof e ? null != this._obj[e] : null != this._obj[this._obj.$_GID]; }, t.__init__ = function() { (t.supportWeakMap = null != B.window.WeakMap) || i.timer.loop(t.delInterval, null, t.clearCache); }, t.clearCache = function() { for (var e = 0, i = t._maps.length; e < i; e++) { t._maps[e]._obj = {}; } }, t.supportWeakMap = !1, t.delInterval = 3e5, t._keys = {}, t._maps = [], n(t, [ "I", function() { return this.I = new t(); } ]), t; }(), J = function() { function t() { this.id = NaN, this.save = [], this.toUpperCase = null, this.changed = !1, this._text = null; } s(t, "laya.utils.WordText"); var e = t.prototype; return e.setText = function(t) { this.changed = !0, this._text = t; }, e.toString = function() { return this._text; }, e.charCodeAt = function(t) { return this._text ? this._text.charCodeAt(t) : NaN; }, e.charAt = function(t) { return this._text ? this._text.charAt(t) : null; }, a(0, e, "length", function() { return this._text ? this._text.length : 0; }), t; }(), Q = function(t) { function e() { this._bits = 0, this._displayedInStage = !1, this._parent = null, this.conchModel = null, this.name = "", this._destroyed = !1, e.__super.call(this), this._childs = e.ARRAY_EMPTY, this._$P = e.PROP_EMPTY, this.timer = i.scaleTimer, this.conchModel = k.isConchNode ? this.createConchModel() : null; } s(e, "laya.display.Node", h); var n = e.prototype; return n._setBit = function(t, e) { if (1 == t) { this._getBit(t) != e && this._updateDisplayedInstage(); } e ? this._bits |= t : this._bits &= ~t; }, n._getBit = function(t) { return 0 != (this._bits & t); }, n._setUpNoticeChain = function() { this._getBit(1) && this._setUpNoticeType(1); }, n._setUpNoticeType = function(t) { var e = this; for (e._setBit(t, !0), e = e.parent; e; ) { if (e._getBit(t)) return; e._setBit(t, !0), e = e.parent; } }, n.on = function(t, e, i, n) { return "display" !== t && "undisplay" !== t || this._getBit(1) || this._setUpNoticeType(1), this._createListener(t, e, i, n, !1); }, n.once = function(t, e, i, n) { return "display" !== t && "undisplay" !== t || this._getBit(1) || this._setUpNoticeType(1), this._createListener(t, e, i, n, !0); }, n.createConchModel = function() { return null; }, n.destroy = function(t) { void 0 === t && (t = !0), this._destroyed = !0, this._parent && this._parent.removeChild(this), this._childs && (t ? this.destroyChildren() : this.removeChildren()), this._childs = null, this._$P = null, this.offAll(), this.timer.clearAll(this); }, n.destroyChildren = function() { if (this._childs) for (var t = this._childs.length - 1; t > -1; t--) this._childs[t].destroy(!0); }, n.addChild = function(t) { if (!t || this.destroyed || t === this) return t; if (t.zOrder && this._set$P("hasZorder", !0), t._parent === this) { var i = this.getChildIndex(t); i !== this._childs.length - 1 && (this._childs.splice(i, 1), this._childs.push(t), this.conchModel && (this.conchModel.removeChild(t.conchModel), this.conchModel.addChildAt(t.conchModel, this._childs.length - 1)), this._childChanged()); } else t.parent && t.parent.removeChild(t), this._childs === e.ARRAY_EMPTY && (this._childs = []), this._childs.push(t), this.conchModel && this.conchModel.addChildAt(t.conchModel, this._childs.length - 1), t.parent = this, this._childChanged(); return t; }, n.addChildren = function(t) { for (var e = arguments, i = 0, n = e.length; i < n; ) this.addChild(e[i++]); }, n.addChildAt = function(t, i) { if (!t || this.destroyed || t === this) return t; if (t.zOrder && this._set$P("hasZorder", !0), i >= 0 && i <= this._childs.length) { if (t._parent === this) { var n = this.getChildIndex(t); this._childs.splice(n, 1), this._childs.splice(i, 0, t), this.conchModel && (this.conchModel.removeChild(t.conchModel), this.conchModel.addChildAt(t.conchModel, i)), this._childChanged(); } else t.parent && t.parent.removeChild(t), this._childs === e.ARRAY_EMPTY && (this._childs = []), this._childs.splice(i, 0, t), this.conchModel && this.conchModel.addChildAt(t.conchModel, i), t.parent = this; return t; } throw new Error("appendChildAt:The index is out of bounds"); }, n.getChildIndex = function(t) { return this._childs.indexOf(t); }, n.getChildByName = function(t) { var e = this._childs; if (e) for (var i = 0, n = e.length; i < n; i++) { var s = e[i]; if (s.name === t) return s; } return null; }, n._get$P = function(t) { return this._$P[t]; }, n._set$P = function(t, i) { return this.destroyed || (this._$P === e.PROP_EMPTY && (this._$P = {}), this._$P[t] = i), i; }, n.getChildAt = function(t) { return this._childs[t]; }, n.setChildIndex = function(t, e) { var i = this._childs; if (e < 0 || e >= i.length) throw new Error("setChildIndex:The index is out of bounds."); var n = this.getChildIndex(t); if (n < 0) throw new Error("setChildIndex:node is must child of this object."); return i.splice(n, 1), i.splice(e, 0, t), this.conchModel && (this.conchModel.removeChild(t.conchModel), this.conchModel.addChildAt(t.conchModel, e)), this._childChanged(), t; }, n._childChanged = function(t) {}, n.removeChild = function(t) { if (!this._childs) return t; var e = this._childs.indexOf(t); return this.removeChildAt(e); }, n.removeSelf = function() { return this._parent && this._parent.removeChild(this), this; }, n.removeChildByName = function(t) { var e = this.getChildByName(t); return e && this.removeChild(e), e; }, n.removeChildAt = function(t) { var e = this.getChildAt(t); return e && (this._childs.splice(t, 1), this.conchModel && this.conchModel.removeChild(e.conchModel), e.parent = null), e; }, n.removeChildren = function(t, i) { if (void 0 === t && (t = 0), void 0 === i && (i = 2147483647), this._childs && this._childs.length > 0) { var n = this._childs; if (0 === t && i >= r) { var s = n; this._childs = e.ARRAY_EMPTY; } else s = n.splice(t, i - t); for (var a = 0, r = s.length; a < r; a++) s[a].parent = null, this.conchModel && this.conchModel.removeChild(s[a].conchModel); } return this; }, n.replaceChild = function(t, e) { var i = this._childs.indexOf(e); return i > -1 ? (this._childs.splice(i, 1, t), this.conchModel && (this.conchModel.removeChild(e.conchModel), this.conchModel.addChildAt(t.conchModel, i)), e.parent = null, t.parent = this, t) : null; }, n._updateDisplayedInstage = function() { var t; t = this; var e = i.stage; for (this._displayedInStage = !1; t; ) { if (t._getBit(1)) { this._displayedInStage = t._displayedInStage; break; } if (t == e || t._displayedInStage) { this._displayedInStage = !0; break; } t = t.parent; } }, n._setDisplay = function(t) { this._displayedInStage !== t && (this._displayedInStage = t, t ? this.event("display") : this.event("undisplay")); }, n._displayChild = function(t, e) { var i = t._childs; if (i) for (var n = 0, s = i.length; n < s; n++) { var a = i[n]; a._getBit(1) && (a._childs.length > 0 ? this._displayChild(a, e) : a._setDisplay(e)); } t._setDisplay(e); }, n.contains = function(t) { if (t === this) return !0; for (;t; ) { if (t.parent === this) return !0; t = t.parent; } return !1; }, n.timerLoop = function(t, e, i, n, s, a) { void 0 === s && (s = !0), void 0 === a && (a = !1), this.timer.loop(t, e, i, n, s, a); }, n.timerOnce = function(t, e, i, n, s) { void 0 === s && (s = !0), this.timer._create(!1, !1, t, e, i, n, s); }, n.frameLoop = function(t, e, i, n, s) { void 0 === s && (s = !0), this.timer._create(!0, !0, t, e, i, n, s); }, n.frameOnce = function(t, e, i, n, s) { void 0 === s && (s = !0), this.timer._create(!0, !1, t, e, i, n, s); }, n.clearTimer = function(t, e) { this.timer.clear(t, e); }, a(0, n, "numChildren", function() { return this._childs.length; }), a(0, n, "destroyed", function() { return this._destroyed; }), a(0, n, "parent", function() { return this._parent; }, function(t) { this._parent !== t && (t ? (this._parent = t, this.event("added"), this._getBit(1) && (this._setUpNoticeChain(), t.displayedInStage && this._displayChild(this, !0)), t._childChanged(this)) : (this.event("removed"), this._parent._childChanged(), this._getBit(1) && this._displayChild(this, !1), this._parent = t)); }), a(0, n, "displayedInStage", function() { return this._getBit(1) ? this._displayedInStage : (this._setUpNoticeType(1), this._displayedInStage); }), e.ARRAY_EMPTY = [], e.PROP_EMPTY = {}, e.NOTICE_DISPLAY = 1, e.MOUSEENABLE = 2, e; }(), tt = function(t) { function e(t) { this._bgground = null, this._border = null, this._rect = null, this.underLine = 0, this.lineHeight = 0, e.__super.call(this), this._padding = e._PADDING, this._spacing = e._SPACING, this._aligns = e._ALIGNS, this._font = _.EMPTY, this._ower = t; } s(e, "laya.display.css.CSSStyle", t); var i = e.prototype; return i.destroy = function() { this._ower = null, this._font = null, this._rect = null; }, i.inherit = function(t) { this._font = t._font, this._spacing = t._spacing === e._SPACING ? e._SPACING : t._spacing.slice(), this.lineHeight = t.lineHeight; }, i._widthAuto = function() { return 0 != (262144 & this._type); }, i.widthed = function(t) { return 0 != (8 & this._type); }, i._calculation = function(t, e) { function i(t, e, i) { return t * i[0] + e * i[1] + i[2]; } function n(t) { var e = a.width, n = s.width; r.width && (s.width = i(e, n, r.width)), r.height && (s.height = i(e, n, r.height)), r.left && (s.x = i(e, n, r.left)), r.top && (s.y = i(e, n, r.top)); } if (e.indexOf("%") < 0) return !1; var s = this._ower, a = s.parent, r = this._rect; null === r && (a._getCSSStyle()._type |= 524288, a.on("resize", this, n), this._rect = r = { input: {} }); var o = e.split(" "); return o[0] = parseFloat(o[0]) / 100, 1 == o.length ? o[1] = o[2] = 0 : (o[1] = parseFloat(o[1]) / 100, o[2] = parseFloat(o[2])), r[t] = o, r.input[t] = e, n(), !0; }, i.heighted = function(t) { return 0 != (8192 & this._type); }, i.size = function(t, e) { var i = this._ower, n = !1; -1 !== t && t != this._ower.width && (this._type |= 8, this._ower.width = t, n = !0), -1 !== e && e != this._ower.height && (this._type |= 8192, this._ower.height = e, n = !0), n && (i._layoutLater(), 524288 & this._type && i.event("resize", this)); }, i._getAlign = function() { return this._aligns[0]; }, i._getValign = function() { return this._aligns[1]; }, i._getCssFloat = function() { return 0 != (32768 & this._type) ? 32768 : 0; }, i._createFont = function() { return 4096 & this._type ? this._font : (this._type |= 4096, this._font = new _(this._font)); }, i.render = function(t, e, i, n) { var s = t.width, a = t.height; i -= t.pivotX, n -= t.pivotY, this._bgground && null != this._bgground.color && e.ctx.fillRect(i, n, s, a, this._bgground.color), this._border && this._border.color && e.drawRect(i, n, s, a, this._border.color.strColor, this._border.size); }, i.getCSSStyle = function() { return this; }, i.cssText = function(t) { this.attrs(e.parseOneCSS(t, ";")); }, i.attrs = function(t) { if (t) for (var e = 0, i = t.length; e < i; e++) { var n = t[e]; this[n[0]] = n[1]; } }, i.setTransform = function(t) { "none" === t ? this._tf = c._TF_EMPTY : this.attrs(e.parseOneCSS(t, ",")); }, i.translate = function(t, e) { this._tf === c._TF_EMPTY && (this._tf = new d()), this._tf.translateX = t, this._tf.translateY = e; }, i.scale = function(t, e) { this._tf === c._TF_EMPTY && (this._tf = new d()), this._tf.scaleX = t, this._tf.scaleY = e; }, i._enableLayout = function() { return 0 == (2 & this._type) && 0 == (4 & this._type); }, a(0, i, "block", t.prototype._$get_block, function(t) { t ? this._type |= 1 : this._type &= -2; }), a(0, i, "valign", function() { return e._valigndef[this._aligns[1]]; }, function(t) { this._aligns === e._ALIGNS && (this._aligns = [ 0, 0, 0 ]), this._aligns[1] = e._valigndef[t]; }), a(0, i, "height", null, function(t) { if (this._type |= 8192, "string" == typeof t) { if (this._calculation("height", t)) return; t = parseInt(t); } this.size(-1, t); }), a(0, i, "width", null, function(t) { if (this._type |= 8, "string" == typeof t) { var e = t.indexOf("auto"); if (e >= 0 && (this._type |= 262144, t = t.substr(0, e)), this._calculation("width", t)) return; t = parseInt(t); } this.size(t, -1); }), a(0, i, "fontWeight", function() { return this._font.weight; }, function(t) { this._createFont().weight = t; }), a(0, i, "left", null, function(t) { var e = this._ower; if ("string" == typeof t) { if ("center" === t ? t = "50% -50% 0" : "right" === t && (t = "100% -100% 0"), this._calculation("left", t)) return; t = parseInt(t); } e.x = t; }), a(0, i, "_translate", null, function(t) { this.translate(t[0], t[1]); }), a(0, i, "absolute", function() { return 0 != (4 & this._type); }), a(0, i, "top", null, function(t) { var e = this._ower; if ("string" == typeof t) { if ("middle" === t ? t = "50% -50% 0" : "bottom" === t && (t = "100% -100% 0"), this._calculation("top", t)) return; t = parseInt(t); } e.y = t; }), a(0, i, "align", function() { return e._aligndef[this._aligns[0]]; }, function(t) { this._aligns === e._ALIGNS && (this._aligns = [ 0, 0, 0 ]), this._aligns[0] = e._aligndef[t]; }), a(0, i, "bold", function() { return this._font.bold; }, function(t) { this._createFont().bold = t; }), a(0, i, "padding", function() { return this._padding; }, function(t) { this._padding = t; }), a(0, i, "leading", function() { return this._spacing[1]; }, function(t) { "string" == typeof t && (t = parseInt(t + "")), this._spacing === e._SPACING && (this._spacing = [ 0, 0 ]), this._spacing[1] = t; }), a(0, i, "lineElement", function() { return 0 != (65536 & this._type); }, function(t) { t ? this._type |= 65536 : this._type &= -65537; }), a(0, i, "cssFloat", function() { return 0 != (32768 & this._type) ? "right" : "left"; }, function(t) { this.lineElement = !1, "right" === t ? this._type |= 32768 : this._type &= -32769; }), a(0, i, "textDecoration", function() { return this._font.decoration; }, function(t) { this._createFont().decoration = t; }), a(0, i, "whiteSpace", function() { return 131072 & this._type ? "nowrap" : ""; }, function(t) { "nowrap" === t && (this._type |= 131072), "none" === t && (this._type &= -131073); }), a(0, i, "background", null, function(t) { t ? (this._bgground || (this._bgground = {}), this._bgground.color = t, this._ower.conchModel && this._ower.conchModel.bgColor(t), this._type |= 16384, this._ower._renderType |= 256) : this._bgground = null; }), a(0, i, "wordWrap", function() { return 0 == (131072 & this._type); }, function(t) { t ? this._type &= -131073 : this._type |= 131072; }), a(0, i, "color", function() { return this._font.color; }, function(t) { this._createFont().color = t; }), a(0, i, "password", function() { return this._font.password; }, function(t) { this._createFont().password = t; }), a(0, i, "backgroundColor", function() { return this._bgground ? this._bgground.color : null; }, function(t) { "none" === t ? this._bgground = null : (this._bgground || (this._bgground = {}), this._bgground.color = t), this._ower.conchModel && this._ower.conchModel.bgColor(t), this._ower._renderType |= 256; }), a(0, i, "font", function() { return this._font.toString(); }, function(t) { this._createFont().set(t); }), a(0, i, "weight", null, function(t) { this._createFont().weight = t; }), a(0, i, "letterSpacing", function() { return this._spacing[0]; }, function(t) { "string" == typeof t && (t = parseInt(t + "")), this._spacing === e._SPACING && (this._spacing = [ 0, 0 ]), this._spacing[0] = t; }), a(0, i, "fontSize", function() { return this._font.size; }, function(t) { this._createFont().size = t; }), a(0, i, "italic", function() { return this._font.italic; }, function(t) { this._createFont().italic = t; }), a(0, i, "fontFamily", function() { return this._font.family; }, function(t) { this._createFont().family = t; }), a(0, i, "stroke", function() { return this._font.stroke[0]; }, function(t) { this._createFont().stroke === _._STROKE && (this._font.stroke = [ 0, "#000000" ]), this._font.stroke[0] = t; }), a(0, i, "strokeColor", function() { return this._font.stroke[1]; }, function(t) { this._createFont().stroke === _._STROKE && (this._font.stroke = [ 0, "#000000" ]), this._font.stroke[1] = t; }), a(0, i, "border", function() { return this._border ? this._border.value : ""; }, function(t) { if ("none" != t) { this._border || (this._border = {}), this._border.value = t; var e = t.split(" "); if (this._border.color = V.create(e[e.length - 1]), 1 == e.length) return this._border.size = 1, void (this._border.type = "solid"); var i = 0; e[0].indexOf("px") > 0 ? (this._border.size = parseInt(e[0]), i++) : this._border.size = 1, this._border.type = e[i], this._ower._renderType |= 256; } else this._border = null; }), a(0, i, "borderColor", function() { return this._border && this._border.color ? this._border.color.strColor : null; }, function(t) { t ? (this._border || (this._border = { size: 1, type: "solid" }), this._border.color = null == t ? null : V.create(t), this._ower.conchModel && this._ower.conchModel.border(this._border.color.strColor), this._ower._renderType |= 256) : this._border = null; }), a(0, i, "position", function() { return 4 & this._type ? "absolute" : ""; }, function(t) { "absolute" == t ? this._type |= 4 : this._type &= -5; }), a(0, i, "display", null, function(t) { switch (t) { case "": this._type &= -3, this.visible = !0; break; case "none": this._type |= 2, this.visible = !1, this._ower._layoutLater(); } }), a(0, i, "paddingLeft", function() { return this.padding[3]; }), a(0, i, "paddingTop", function() { return this.padding[0]; }), a(0, i, "_scale", null, function(t) { this._ower.scale(t[0], t[1]); }), a(0, i, "_rotate", null, function(t) { this._ower.rotation = t; }), e.parseOneCSS = function(t, i) { for (var n, s = [], a = t.split(i), r = 0, o = a.length; r < o; r++) { var h = a[r], l = h.indexOf(":"), u = h.substr(0, l).replace(/^\s+|\s+$/g, ""); if (0 != u.length) { var c = h.substr(l + 1).replace(/^\s+|\s+$/g, ""), _ = [ u, c ]; switch (u) { case "italic": case "bold": _[1] = "true" == c; break; case "line-height": _[0] = "lineHeight", _[1] = parseInt(c); break; case "font-size": _[0] = "fontSize", _[1] = parseInt(c); break; case "padding": (n = c.split(" ")).length > 1 || (n[1] = n[2] = n[3] = n[0]), _[1] = [ parseInt(n[0]), parseInt(n[1]), parseInt(n[2]), parseInt(n[3]) ]; break; case "rotate": _[0] = "_rotate", _[1] = parseFloat(c); break; case "scale": n = c.split(" "), _[0] = "_scale", _[1] = [ parseFloat(n[0]), parseFloat(n[1]) ]; break; case "translate": n = c.split(" "), _[0] = "_translate", _[1] = [ parseInt(n[0]), parseInt(n[1]) ]; break; default: (_[0] = e._CSSTOVALUE[u]) || (_[0] = u); } s.push(_); } } return s; }, e.parseCSS = function(t, i) { for (var n; null != (n = e._parseCSSRegExp.exec(t)); ) e.styleSheets[n[1]] = e.parseOneCSS(n[2], ";"); }, e.EMPTY = new e(null), e._CSSTOVALUE = { "letter-spacing": "letterSpacing", "line-spacing": "lineSpacing", "white-space": "whiteSpace", "line-height": "lineHeight", "scale-x": "scaleX", "scale-y": "scaleY", "translate-x": "translateX", "translate-y": "translateY", "font-family": "fontFamily", "font-weight": "fontWeight", "vertical-align": "valign", "text-decoration": "textDecoration", "background-color": "backgroundColor", "border-color": "borderColor", float: "cssFloat" }, e._parseCSSRegExp = new RegExp("([.#]\\w+)\\s*{([\\s\\S]*?)}", "g"), e._aligndef = { left: 0, center: 1, right: 2, 0: "left", 1: "center", 2: "right" }, e._valigndef = { top: 0, middle: 1, bottom: 2, 0: "top", 1: "middle", 2: "bottom" }, e.styleSheets = {}, e.ALIGN_CENTER = 1, e.ALIGN_RIGHT = 2, e.VALIGN_MIDDLE = 1, e.VALIGN_BOTTOM = 2, e._CSS_BLOCK = 1, e._DISPLAY_NONE = 2, e._ABSOLUTE = 4, e._WIDTH_SET = 8, e._PADDING = [ 0, 0, 0, 0 ], e._RECT = [ -1, -1, -1, -1 ], e._SPACING = [ 0, 0 ], e._ALIGNS = [ 0, 0, 0 ], e.ADDLAYOUTED = 512, e._NEWFONT = 4096, e._HEIGHT_SET = 8192, e._BACKGROUND_SET = 16384, e._FLOAT_RIGHT = 32768, e._LINE_ELEMENT = 65536, e._NOWARP = 131072, e._WIDTHAUTO = 262144, e._LISTERRESZIE = 524288, e; }(c), et = function(t) { function e() { this.url = null, this.audio = null, this.loaded = !1, e.__super.call(this); } s(e, "laya.media.h5audio.AudioSound", h); var i = e.prototype; return i.dispose = function() { var t = e._audioCache[this.url]; Y.clearBySign("audio:" + this.url), t && (k.isConchApp || (t.src = ""), delete e._audioCache[this.url]); }, i.load = function(t) { function i() { s(), r.loaded = !0, r.event("complete"); } function n() { a.load = null, s(), r.event("error"); } function s() { a.removeEventListener("canplaythrough", i), a.removeEventListener("error", n); } t = P.formatURL(t), this.url = t; var a; if (t == E._tMusic ? (e._initMusicAudio(), (a = e._musicAudio).src != t && (e._audioCache[a.src] = null, a = null)) : a = e._audioCache[t], a && a.readyState >= 2) this.event("complete"); else { a || (t == E._tMusic ? (e._initMusicAudio(), a = e._musicAudio) : a = B.createElement("audio"), e._audioCache[t] = a, a.src = t), a.addEventListener("canplaythrough", i), a.addEventListener("error", n); var r = this; this.audio = a, a.load ? a.load() : n(); } }, i.play = function(t, i) { if (void 0 === t && (t = 0), void 0 === i && (i = 0), !this.url) return null; var n; if (!(n = this.url == E._tMusic ? e._musicAudio : e._audioCache[this.url])) return null; var s; s = Y.getItem("audio:" + this.url), k.isConchApp ? s || ((s = B.createElement("audio")).src = this.url) : this.url == E._tMusic ? (e._initMusicAudio(), (s = e._musicAudio).src = this.url) : s = s || n.cloneNode(!0); var a = new _t(s); return a.url = this.url, a.loops = i, a.startTime = t, a.play(), E.addChannel(a), a; }, a(0, i, "duration", function() { var t; return (t = e._audioCache[this.url]) ? t.duration : 0; }), e._initMusicAudio = function() { e._musicAudio || (e._musicAudio || (e._musicAudio = B.createElement("audio")), k.isConchApp || B.document.addEventListener("mousedown", e._makeMusicOK)); }, e._makeMusicOK = function() { B.document.removeEventListener("mousedown", e._makeMusicOK), e._musicAudio.src ? e._musicAudio.play() : (e._musicAudio.src = "", e._musicAudio.load()); }, e._audioCache = {}, e._musicAudio = null, e; }(), it = function(t) { function e() { this.url = null, this.loops = 0, this.startTime = NaN, this.isStopped = !1, this.completeHandler = null, e.__super.call(this); } s(e, "laya.media.SoundChannel", h); var i = e.prototype; return i.play = function() {}, i.stop = function() { this.completeHandler && this.completeHandler.run(); }, i.pause = function() {}, i.resume = function() {}, i.__runComplete = function(t) { t && t.run(); }, a(0, i, "volume", function() { return 1; }, function(t) {}), a(0, i, "position", function() { return 0; }), a(0, i, "duration", function() { return 0; }), e; }(), nt = function(t) { function e() { e.__super.call(this); } s(e, "laya.media.Sound", h); var i = e.prototype; return i.load = function(t) {}, i.play = function(t, e) { return void 0 === t && (t = 0), void 0 === e && (e = 0), null; }, i.dispose = function() {}, a(0, i, "duration", function() { return 0; }), e; }(), st = function(t) { function e() { this.url = null, this.loaded = !1, this.data = null, this.audioBuffer = null, this.__toPlays = null, this._disposed = !1, e.__super.call(this); } s(e, "laya.media.webaudio.WebAudioSound", h); var i = e.prototype; return i.load = function(t) { var i = this; if (t = P.formatURL(t), this.url = t, this.audioBuffer = e._dataCache[t], this.audioBuffer) this._loaded(this.audioBuffer); else if (e.e.on("loaded:" + t, this, this._loaded), e.e.on("err:" + t, this, this._err), !e.__loadingSound[t]) { e.__loadingSound[t] = !0; var n = new B.window.XMLHttpRequest(); n.open("GET", t, !0), n.responseType = "arraybuffer", n.onload = function() { i._disposed ? i._removeLoadEvents() : (i.data = n.response, e.buffs.push({ buffer: i.data, url: i.url }), e.decode()); }, n.onerror = function(t) { i._err(); }, n.send(); } }, i._err = function() { if (this._removeLoadEvents(), e.__loadingSound[this.url] = !1, this.event("error"), this.__toPlays) { var t, i = 0, n = 0; n = (t = this.__toPlays).length; var s; for (i = 0; i < n; i++) (s = t[i])[2] && !s[2].isStopped && s[2].event("error"); this.__toPlays.length = 0; } }, i._loaded = function(t) { this._removeLoadEvents(), this._disposed || (this.audioBuffer = t, e._dataCache[this.url] = this.audioBuffer, this.loaded = !0, this.event("complete")); }, i._removeLoadEvents = function() { e.e.off("loaded:" + this.url, this, this._loaded), e.e.off("err:" + this.url, this, this._err); }, i.__playAfterLoaded = function() { if (this.__toPlays) { var t, e = 0, i = 0; i = (t = this.__toPlays).length; var n; for (e = 0; e < i; e++) (n = t[e])[2] && !n[2].isStopped && this.play(n[0], n[1], n[2]); this.__toPlays.length = 0; } }, i.play = function(t, e, i) { return void 0 === t && (t = 0), void 0 === e && (e = 0), i = i || new dt(), this.audioBuffer || this.url && (this.__toPlays || (this.__toPlays = []), this.__toPlays.push([ t, e, i ]), this.once("complete", this, this.__playAfterLoaded), this.load(this.url)), i.url = this.url, i.loops = e, i.audioBuffer = this.audioBuffer, i.startTime = t, i.play(), E.addChannel(i), i; }, i.dispose = function() { this._disposed = !0, delete e._dataCache[this.url], delete e.__loadingSound[this.url], this.audioBuffer = null, this.data = null, this.__toPlays = []; }, a(0, i, "duration", function() { return this.audioBuffer ? this.audioBuffer.duration : 0; }), e.decode = function() { e.buffs.length <= 0 || e.isDecoding || (e.isDecoding = !0, e.tInfo = e.buffs.shift(), e.ctx.decodeAudioData(e.tInfo.buffer, e._done, e._fail)); }, e._done = function(t) { e.e.event("loaded:" + e.tInfo.url, t), e.isDecoding = !1, e.decode(); }, e._fail = function() { e.e.event("err:" + e.tInfo.url, null), e.isDecoding = !1, e.decode(); }, e._playEmptySound = function() { if (null != e.ctx) { var t = e.ctx.createBufferSource(); t.buffer = e._miniBuffer, t.connect(e.ctx.destination), t.start(0, 0, 0); } }, e._unlock = function() { e._unlocked || (e._playEmptySound(), "running" == e.ctx.state && (B.document.removeEventListener("mousedown", e._unlock, !0), B.document.removeEventListener("touchend", e._unlock, !0), B.document.removeEventListener("touchstart", e._unlock, !0), e._unlocked = !0)); }, e.initWebAudio = function() { "running" != e.ctx.state && (e._unlock(), B.document.addEventListener("mousedown", e._unlock, !0), B.document.addEventListener("touchend", e._unlock, !0), B.document.addEventListener("touchstart", e._unlock, !0)); }, e._dataCache = {}, e.buffs = [], e.isDecoding = !1, e._unlocked = !1, e.tInfo = null, e.__loadingSound = {}, n(e, [ "window", function() { return this.window = B.window; }, "webAudioEnabled", function() { return this.webAudioEnabled = e.window.AudioContext || e.window.webkitAudioContext || e.window.mozAudioContext; }, "ctx", function() { return this.ctx = e.webAudioEnabled ? new (e.window.AudioContext || e.window.webkitAudioContext || e.window.mozAudioContext)() : void 0; }, "_miniBuffer", function() { return this._miniBuffer = e.ctx.createBuffer(1, 1, 22050); }, "e", function() { return this.e = new h(); } ]), e; }(), at = function(t) { function e() { this._responseType = null, this._data = null, e.__super.call(this), this._http = new B.window.XMLHttpRequest(); } s(e, "laya.net.HttpRequest", h); var i = e.prototype; return i.send = function(t, e, i, n, s) { void 0 === i && (i = "get"), void 0 === n && (n = "text"), this._responseType = n, this._data = null, (B.onQGMiniGame || B.onVVMiniGame || B.onBDMiniGame || B.onQQMiniGame) && (t = encodeURI(t)); var a = this, r = this._http; if (r.open(i, t, !0), s) for (var o = 0; o < s.length; o++) r.setRequestHeader(s[o++], s[o]); else k.isConchApp || (e && "string" != typeof e ? r.setRequestHeader("Content-Type", "application/json") : r.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")); r.responseType = "arraybuffer" !== n ? "text" : "arraybuffer", r.onerror = function(t) { a._onError(t); }, r.onabort = function(t) { a._onAbort(t); }, r.onprogress = function(t) { a._onProgress(t); }, r.onload = function(t) { a._onLoad(t); }, r.send(e); }, i._onProgress = function(t) { t && t.lengthComputable && this.event("progress", t.loaded / t.total); }, i._onAbort = function(t) { this.error("Request was aborted by user"); }, i._onError = function(t) { this.error("Request failed Status:" + this._http.status + " text:" + this._http.statusText); }, i._onLoad = function(t) { var e = this._http, i = void 0 !== e.status ? e.status : 200; 200 === i || 204 === i || 0 === i ? this.complete() : this.error("[" + e.status + "]" + e.statusText + ":" + e.responseURL); }, i.error = function(t) { this.clear(), this.event("error", t); }, i.complete = function() { this.clear(); var t = !0; try { "json" === this._responseType ? this._data = JSON.parse(this._http.responseText) : "xml" === this._responseType ? this._data = $.parseXMLFromString(this._http.responseText) : this._data = this._http.response || this._http.responseText; } catch (e) { t = !1, this.error(e.message); } t && this.event("complete", this._data instanceof Array ? [ this._data ] : this._data); }, i.clear = function() { var t = this._http; t.onerror = t.onabort = t.onprogress = t.onload = null; }, a(0, i, "url", function() { return this._http.responseURL; }), a(0, i, "http", function() { return this._http; }), a(0, i, "data", function() { return this._data; }), e; }(), rt = function(t) { function e() { this._data = null, this._class = null, this._url = null, this._type = null, this._cache = !1, this._http = null, this._customParse = !1, e.__super.call(this); } s(e, "laya.net.Loader", h); var n = e.prototype; return n.load = function(t, i, n, s, a) { if (void 0 === n && (n = !0), void 0 === a && (a = !1), this._url = t, 0 === t.indexOf("data:image") ? this._type = i = "image" : (this._type = i || (i = this.getTypeFromUrl(t)), t = P.formatURL(t)), this._cache = n, this._data = null, !a && e.loadedMap[t]) return this._data = e.loadedMap[t], this.event("progress", 1), void this.event("complete", this._data); if (s && e.setGroup(t, s), null != e.parserMap[i]) return this._customParse = !0, void (e.parserMap[i] instanceof laya.utils.Handler ? e.parserMap[i].runWith(this) : e.parserMap[i].call(null, this)); if ("image" === i || "htmlimage" === i || "nativeimage" === i) return this._loadImage(t); if ("sound" === i) return this._loadSound(t); if ("ttf" === i) return this._loadTTF(t); var r; switch (i) { case "atlas": case "plf": r = "json"; break; case "font": r = "xml"; break; case "pkm": r = "arraybuffer"; break; default: r = i; } e.preLoadedMap[t] ? this.onLoaded(e.preLoadedMap[t]) : (B.onVVMiniGame ? this._http = new at() : this._http || (this._http = new at()), this._http.on("progress", this, this.onProgress), this._http.on("error", this, this.onError), this._http.on("complete", this, this.onLoaded), this._http.send(t, null, "get", r)); }, n.getTypeFromUrl = function(t) { var i = $.getFileExtension(t); return i ? e.typeMap[i] : (console.warn("Not recognize the resources suffix", t), "text"); }, n._loadTTF = function(t) { t = P.formatURL(t); var e = new L(); e.complete = l.create(this, this.onLoaded), e.load(t); }, n._loadImage = function(t) { function i() { n.onload = null, n.onerror = null, delete e.imgCache[t]; } t = P.formatURL(t); var n, s = this, a = function() { i(), s.onLoaded(n); }, r = function() { i(), s.event("error", "Load image failed"); }; "nativeimage" === this._type ? ((n = new B.window.Image()).crossOrigin = "", n.onload = a, n.onerror = r, n.src = t, e.imgCache[t] = n) : new wt.create(t, { onload: a, onerror: r, onCreate: function(i) { n = i, e.imgCache[t] = i; } }); }, n._loadSound = function(t) { function e() { i.offAll(); } var i = new E._soundClass(), n = this; i.on("complete", this, function() { e(), n.onLoaded(i); }), i.on("error", this, function() { e(), i.dispose(), n.event("error", "Load sound failed"); }), i.load(t); }, n.onProgress = function(t) { "atlas" === this._type ? this.event("progress", .3 * t) : this.event("progress", t); }, n.onError = function(t) { this.event("error", t); }, n.onLoaded = function(t) { var i = this._type; if ("plf" == i) this.parsePLFData(t), this.complete(t); else if ("image" === i) { var n = new lt(t); n.url = this._url, this.complete(n); } else if ("sound" === i || "htmlimage" === i || "nativeimage" === i) this.complete(t); else if ("atlas" === i) { if (!t.src && !t._setContext) { if (!this._data) { if (this._data = t, t.meta && t.meta.image) for (var s = t.meta.image.split(","), a = this._url.indexOf("/") >= 0 ? "/" : "\\", r = this._url.lastIndexOf(a), o = r >= 0 ? this._url.substr(0, r + 1) : "", h = 0, l = s.length; h < l; h++) s[h] = o + s[h]; else s = [ this._url.replace(".json", ".png") ]; s.reverse(), t.toLoads = s, t.pics = []; } return this.event("progress", .3 + 1 / s.length * .6), this._loadImage(s.pop()); } if (this._data.pics.push(t), this._data.toLoads.length > 0) return this.event("progress", .3 + 1 / this._data.toLoads.length * .6), this._loadImage(this._data.toLoads.pop()); var c = this._data.frames, _ = this._url.split("?")[0], d = this._data.meta && this._data.meta.prefix ? this._data.meta.prefix : _.substring(0, _.lastIndexOf(".")) + "/", p = this._data.pics, f = P.formatURL(this._url), g = e.atlasMap[f] || (e.atlasMap[f] = []); g.dir = d; var m = 1; if (this._data.meta && this._data.meta.scale && 1 != this._data.meta.scale) { m = parseFloat(this._data.meta.scale); for (var v in c) { var y = c[v], x = p[y.frame.idx ? y.frame.idx : 0], b = P.formatURL(d + v); x.scaleRate = m; var w; w = lt.create(x, y.frame.x, y.frame.y, y.frame.w, y.frame.h, y.spriteSourceSize.x, y.spriteSourceSize.y, y.sourceSize.w, y.sourceSize.h), e.cacheRes(b, w), w.url = b, g.push(b); } } else for (v in c) x = p[(y = c[v]).frame.idx ? y.frame.idx : 0], b = P.formatURL(d + v), e.cacheRes(b, lt.create(x, y.frame.x, y.frame.y, y.frame.w, y.frame.h, y.spriteSourceSize.x, y.spriteSourceSize.y, y.sourceSize.w, y.sourceSize.h)), e.loadedMap[b].url = b, g.push(b); delete this._data.pics, this.complete(this._data); } else if ("font" == i) { if (!t.src) return this._data = t, this.event("progress", .5), this._loadImage(this._url.replace(".fnt", ".png")); var C = new u(); C.parseFont(this._data, t); var S = this._url.split(".fnt")[0].split("/"), T = S[S.length - 1]; gt.registerBitmapFont(T, C), this._data = C, this.complete(this._data); } else if ("pkm" == i) { var I = wt.create(t, this._url), M = new lt(I); M.url = this._url, this.complete(M); } else this.complete(t); }, n.parsePLFData = function(t) { var i, n, s; for (i in t) switch (s = t[i], i) { case "json": case "text": for (n in s) e.preLoadedMap[P.formatURL(n)] = s[n]; break; default: for (n in s) e.preLoadedMap[P.formatURL(n)] = s[n]; } }, n.complete = function(t) { this._data = t, this._customParse ? this.event("loaded", t instanceof Array ? [ t ] : t) : (e._loaders.push(this), e._isWorking || e.checkNext()); }, n.endLoad = function(t) { t && (this._data = t), this._cache && e.cacheRes(this._url, this._data), this.event("progress", 1), this.event("complete", this.data instanceof Array ? [ this.data ] : this.data); }, a(0, n, "url", function() { return this._url; }), a(0, n, "data", function() { return this._data; }), a(0, n, "cache", function() { return this._cache; }), a(0, n, "type", function() { return this._type; }), e.checkNext = function() { e._isWorking = !0; for (var t = B.now(); e._startIndex < e._loaders.length; ) if (B.now(), e._loaders[e._startIndex].endLoad(), e._startIndex++, B.now() - t > e.maxTimeOut) return console.warn("loader callback cost a long time:" + (B.now() - t) + " url=" + e._loaders[e._startIndex - 1].url), void i.timer.frameOnce(1, null, e.checkNext); e._loaders.length = 0, e._startIndex = 0, e._isWorking = !1; }, e.clearRes = function(t, i) { void 0 === i && (i = !1), t = P.formatURL(t); var n = e.getAtlas(t); if (n) { for (var s = 0, a = n.length; s < a; s++) { var r = n[s], o = e.getRes(r); delete e.loadedMap[r], o && o.destroy(i); } n.length = 0, delete e.atlasMap[t], delete e.loadedMap[t]; } else { var h = e.loadedMap[t]; h && (delete e.loadedMap[t], h instanceof laya.resource.Texture && h.bitmap && h.destroy(i)); } }, e.clearTextureRes = function(t) { t = P.formatURL(t); var e = laya.net.Loader.getAtlas(t), i = e && e.length > 0 ? laya.net.Loader.getRes(e[0]) : laya.net.Loader.getRes(t); i && i.bitmap && (k.isConchApp && !k.isConchWebGL ? i.bitmap.source.releaseTexture && i.bitmap.source.releaseTexture() : null == i.bitmap._atlaser && i.bitmap.releaseResource(!0)); }, e.getRes = function(t) { return e.loadedMap[P.formatURL(t)]; }, e.getAtlas = function(t) { return e.atlasMap[P.formatURL(t)]; }, e.cacheRes = function(t, i) { t = P.formatURL(t), null != e.loadedMap[t] ? console.warn("Resources already exist,is repeated loading:", t) : e.loadedMap[t] = i; }, e.setGroup = function(t, i) { e.groupMap[i] || (e.groupMap[i] = []), e.groupMap[i].push(t); }, e.clearResByGroup = function(t) { if (e.groupMap[t]) { var i = e.groupMap[t], n = 0, s = i.length; for (n = 0; n < s; n++) e.clearRes(i[n]); i.length = 0; } }, e.TEXT = "text", e.JSON = "json", e.XML = "xml", e.BUFFER = "arraybuffer", e.IMAGE = "image", e.SOUND = "sound", e.ATLAS = "atlas", e.FONT = "font", e.TTF = "ttf", e.PLF = "plf", e.PKM = "pkm", e.typeMap = { png: "image", jpg: "image", jpeg: "image", txt: "text", json: "json", xml: "xml", als: "atlas", atlas: "atlas", mp3: "sound", ogg: "sound", wav: "sound", part: "json", fnt: "font", pkm: "pkm", ttf: "ttf", plf: "plf", ani: "json", sk: "arraybuffer" }, e.parserMap = {}, e.groupMap = {}, e.maxTimeOut = 100, e.loadedMap = {}, e.preLoadedMap = {}, e.atlasMap = {}, e._loaders = [], e._isWorking = !1, e._startIndex = 0, e.imgCache = {}, e; }(), ot = function(t) { function e() { this.retryNum = 1, this.retryDelay = 0, this.maxLoader = 5, this._loaders = [], this._loaderCount = 0, this._resInfos = [], this._infoPool = [], this._maxPriority = 5, this._failRes = {}, e.__super.call(this); for (var t = 0; t < this._maxPriority; t++) this._resInfos[t] = []; } var a; s(e, "laya.net.LoaderManager", h); var r = e.prototype; return r.create = function(t, e, i, n, s, a, r, o) { if (void 0 === a && (a = 1), void 0 === r && (r = !0), t instanceof Array) { var h = t, u = h.length, c = 0; if (i) var _ = l.create(i.caller, i.method, i.args, !1); for (var d = 0; d < u; d++) { var p = h[d]; "string" == typeof p && (p = h[d] = { url: p }), p.progress = 0; } for (d = 0; d < u; d++) { p = h[d]; var f = i ? l.create(null, function(t, e) { t.progress = e; for (var i = 0, n = 0; n < u; n++) i += h[n].progress; var s = i / u; _.runWith(s); }, [ p ], !1) : null, g = i || e ? l.create(null, function(t, i) { c++, t.progress = 1, c === u && e && e.run(); }, [ p ]) : null; this._create(p.url, g, f, p.clas || n, p.params || s, p.priority || a, r, p.group || o); } return !0; } return this._create(t, e, i, n, s, a, r, o); }, r._create = function(t, n, s, a, r, o, h, u) { void 0 === o && (o = 1), void 0 === h && (h = !0); var c = P.formatURL(t), _ = this.getRes(c); if (_) !_.hasOwnProperty("loaded") || _.loaded ? (s && s.runWith(1), n && n.run()) : n && i.loader._createListener(t, n.caller, n.method, n.args, !0, !1); else { var d = $.getFileExtension(t), p = e.createMap[d]; if (!p) throw new Error("LoaderManager:unknown file(" + t + ") extension with: " + d + "."); a || (a = p[0]); var f = p[1]; "atlas" == d ? this.load(t, n, s, f, o, h) : (a === lt && (f = "htmlimage"), (_ = a ? new a() : null).hasOwnProperty("_loaded") && (_._loaded = !1), _._setUrl(t), u && _._setGroup(u), this._createLoad(_, t, l.create(null, function(e) { _ && !_.destroyed && e && _.onAsynLoaded.call(_, t, e, r), n && n.run(), i.loader.event(t); }), s, f, o, !1, u, !0), h && this.cacheRes(c, _)); } return _; }, r.load = function(t, n, s, r, o, h, l, u) { var c = this; if (void 0 === o && (o = 1), void 0 === h && (h = !0), void 0 === u && (u = !1), t instanceof Array) return this._loadAssets(t, n, s, r, o, h, l); var _ = rt.getRes(t); if (null != _) i.timer.frameOnce(1, null, function() { s && s.runWith(1), n && n.runWith(_), c._loaderCount || c.event("complete"); }); else { var d = e._resMap[t]; d ? (n && d._createListener("complete", n.caller, n.method, n.args, !1, !1), s && d._createListener("progress", s.caller, s.method, s.args, !1, !1)) : ((d = this._infoPool.length ? this._infoPool.pop() : new a()).url = t, d.type = r, d.cache = h, d.group = l, d.ignoreCache = u, n && d.on("complete", n.caller, n.method, n.args), s && d.on("progress", s.caller, s.method, s.args), e._resMap[t] = d, o = o < this._maxPriority ? o : this._maxPriority - 1, this._resInfos[o].push(d), this._next()); } return this; }, r._createLoad = function(t, n, s, r, o, h, l, u, c) { var _ = this; if (void 0 === h && (h = 1), void 0 === l && (l = !0), void 0 === c && (c = !1), n instanceof Array) return this._loadAssets(n, s, r, o, h, l, u); var d = rt.getRes(n); if (null != d) i.timer.frameOnce(1, null, function() { r && r.runWith(1), s && s.runWith(d), _._loaderCount || _.event("complete"); }); else { var p = e._resMap[n]; p ? (s && p._createListener("complete", s.caller, s.method, s.args, !1, !1), r && p._createListener("progress", r.caller, r.method, r.args, !1, !1)) : ((p = this._infoPool.length ? this._infoPool.pop() : new a()).url = n, p.clas = t, p.type = o, p.cache = l, p.group = u, p.ignoreCache = c, s && p.on("complete", s.caller, s.method, s.args), r && p.on("progress", r.caller, r.method, r.args), e._resMap[n] = p, h = h < this._maxPriority ? h : this._maxPriority - 1, this._resInfos[h].push(p), this._next()); } return this; }, r._next = function() { if (!(this._loaderCount >= this.maxLoader)) { for (var t = 0; t < this._maxPriority; t++) for (var e = this._resInfos[t]; e.length > 0; ) { var i = e.shift(); if (i) return this._doLoad(i); } this._loaderCount || this.event("complete"); } }, r._doLoad = function(t) { function e(e) { i.offAll(), i._data = null, i._customParse = !1, n._loaders.push(i), n._endLoad(t, e instanceof Array ? [ e ] : e), n._loaderCount--, n._next(); } this._loaderCount++; var i = this._loaders.length ? this._loaders.pop() : new rt(); i.on("complete", null, e), i.on("progress", null, function(e) { t.event("progress", e); }), i.on("error", null, function(t) { e(null); }); var n = this; i._class = t.clas, i.load(t.url, t.type, t.cache, t.group, t.ignoreCache); }, r._endLoad = function(t, n) { var s = t.url; if (null == n) { var a = this._failRes[s] || 0; if (a < this.retryNum) return console.warn("[warn]Retry to load:", s), this._failRes[s] = a + 1, void i.timer.once(this.retryDelay, this, this._addReTry, [ t ], !1); console.warn("[error]Failed to load:", s), this.event("error", s); } this._failRes[s] && (this._failRes[s] = 0), delete e._resMap[s], t.event("complete", n), t.offAll(), this._infoPool.push(t); }, r._addReTry = function(t) { this._resInfos[this._maxPriority - 1].push(t), this._next(); }, r.clearRes = function(t, e) { void 0 === e && (e = !1), rt.clearRes(t, e); }, r.getRes = function(t) { return rt.getRes(t); }, r.cacheRes = function(t, e) { rt.cacheRes(t, e); }, r.clearTextureRes = function(t) { rt.clearTextureRes(t); }, r.setGroup = function(t, e) { rt.setGroup(t, e); }, r.clearResByGroup = function(t) { rt.clearResByGroup(t); }, r.clearUnLoaded = function() { for (var t = 0; t < this._maxPriority; t++) { for (var i = this._resInfos[t], n = i.length - 1; n > -1; n--) { var s = i[n]; s && (s.offAll(), this._infoPool.push(s)); } i.length = 0; } this._loaderCount = 0, e._resMap = {}; }, r.cancelLoadByUrls = function(t) { if (t) for (var e = 0, i = t.length; e < i; e++) this.cancelLoadByUrl(t[e]); }, r.cancelLoadByUrl = function(t) { for (var i = 0; i < this._maxPriority; i++) for (var n = this._resInfos[i], s = n.length - 1; s > -1; s--) { var a = n[s]; a && a.url === t && (n[s] = null, a.offAll(), this._infoPool.push(a)); } e._resMap[t] && delete e._resMap[t]; }, r._loadAssets = function(t, e, i, n, s, a, r) { void 0 === s && (s = 1), void 0 === a && (a = !0); for (var o = t.length, h = 0, u = 0, c = [], _ = !0, d = 0; d < o; d++) { var p = t[d]; "string" == typeof p && (p = { url: p, type: n, size: 1, priority: s }), p.size || (p.size = 1), p.progress = 0, u += p.size, c.push(p); var f = i ? l.create(null, function(t, e) { if (null != i) { t.progress = e; for (var n = 0, s = 0; s < c.length; s++) { var a = c[s]; n += a.size * a.progress; } var r = n / u; i.runWith(r); } }, [ p ], !1) : null, g = e || i ? l.create(null, function(t, i) { h++, t.progress = 1, i || (_ = !1), h === o && e && e.runWith(_); }, [ p ]) : null; this.load(p.url, g, f, p.type, p.priority || 1, a, p.group || r); } return this; }, e.cacheRes = function(t, e) { rt.cacheRes(t, e); }, e._resMap = {}, n(e, [ "createMap", function() { return this.createMap = { atlas: [ null, "atlas" ] }; } ]), e.__init$ = function() { a = function(t) { function e() { this.url = null, this.type = null, this.cache = !1, this.group = null, this.ignoreCache = !1, this.clas = null, e.__super.call(this); } return s(e, "", h), e; }(); }, e; }(), ht = (function(t) { function e(t) { e.__super.call(this), t || (t = [ .3, .59, .11, 0, 0, .3, .59, .11, 0, 0, .3, .59, .11, 0, 0, 0, 0, 0, 1, 0 ]), this._mat = new Float32Array(16), this._alpha = new Float32Array(4); for (var i = 0, n = 0, s = 0; s < 20; s++) s % 5 != 4 ? this._mat[i++] = t[s] : this._alpha[n++] = t[s]; this._action = r.createFilterAction(32), this._action.data = this; } s(e, "laya.filters.ColorFilter", x); var n = e.prototype; i.imps(n, { "laya.filters.IFilter": !0 }), n.callNative = function(t) { t._$P.cf = this; t.conchModel && t.conchModel.setFilterMatrix && t.conchModel.setFilterMatrix(this._mat, this._alpha); }, a(0, n, "type", function() { return 32; }), a(0, n, "action", function() { return this._action; }); }(), function(t) { function e(t, i, n) { this._endian = null, this._stamp = NaN, this._socket = null, this._connected = !1, this._addInputPosition = 0, this._input = null, this._output = null, this.timeout = 0, this.objectEncoding = 0, this.disableInput = !1, this._byteClass = null, this.protocols = [], void 0 === i && (i = 0), e.__super.call(this), this._byteClass = n || O, this.endian = "bigEndian", this.timeout = 2e4, this._addInputPosition = 0, t && i > 0 && i < 65535 && this.connect(t, i); } s(e, "laya.net.Socket", h); var i = e.prototype; i.connect = function(t, e) { var i = "ws://" + t + ":" + e; i = "https:" == B.window.location.protocol ? "wss://" + t + ":" + e : "ws://" + t + ":" + e, this.connectByUrl(i); }, i.connectByUrl = function(t) { var e = this; null != this._socket && this.close(), this._socket && this.cleanSocket(), this.protocols && 0 != this.protocols.length ? this._socket = new B.window.WebSocket(t, this.protocols) : this._socket = new B.window.WebSocket(t), this._socket.binaryType = "arraybuffer", this._output = new this._byteClass(), this._output.endian = this.endian, this._input = new this._byteClass(), this._input.endian = this.endian, this._addInputPosition = 0, this._socket.onopen = function(t) { e._onOpen(t); }, this._socket.onmessage = function(t) { e._onMessage(t); }, this._socket.onclose = function(t) { e._onClose(t); }, this._socket.onerror = function(t) { e._onError(t); }; }, i.cleanSocket = function() { try { this._socket.close(); } catch (t) {} this._connected = !1, this._socket.onopen = null, this._socket.onmessage = null, this._socket.onclose = null, this._socket.onerror = null, this._socket = null; }, i.close = function() { if (null != this._socket) try { this._socket.close(); } catch (t) {} }, i._onOpen = function(t) { this._connected = !0, this.event("open", t); }, i._onMessage = function(t) { if (t && t.data) { var e = t.data; if (this.disableInput && e) this.event("message", e); else { this._input.length > 0 && this._input.bytesAvailable < 1 && (this._input.clear(), this._addInputPosition = 0); var i = this._input.pos; !this._addInputPosition && (this._addInputPosition = 0), this._input.pos = this._addInputPosition, e && ("string" == typeof e ? this._input.writeUTFBytes(e) : this._input.writeArrayBuffer(e), this._addInputPosition = this._input.pos, this._input.pos = i), this.event("message", e); } } }, i._onClose = function(t) { this._connected = !1, this.event("close", t); }, i._onError = function(t) { this.event("error", t); }, i.send = function(t) { this._socket.send(t); }, i.flush = function() { if (this._output && this._output.length > 0) { var t; try { this._socket && this._socket.send(this._output.__getBuffer().slice(0, this._output.length)); } catch (e) { t = e; } this._output.endian = this.endian, this._output.clear(), t && this.event("error", t); } }, a(0, i, "input", function() { return this._input; }), a(0, i, "output", function() { return this._output; }), a(0, i, "connected", function() { return this._connected; }), a(0, i, "endian", function() { return this._endian; }, function(t) { this._endian = t, null != this._input && (this._input.endian = t), null != this._output && (this._output.endian = t); }), e.LITTLE_ENDIAN = "littleEndian", e.BIG_ENDIAN = "bigEndian"; }(), function(t) { function e() { this.worker = null, e.__super.call(this); var t = this; this.worker = new B.window.Worker(e.workerPath), this.worker.onmessage = function(e) { t.workerMessage(e.data); }; } s(e, "laya.net.WorkerLoader", h); var i = e.prototype; i.workerMessage = function(t) { if (t) switch (t.type) { case "Image": this.imageLoaded(t); break; case "Msg": this.event("image_msg", t.msg); } }, i.imageLoaded = function(t) { if (t && t.buffer && t.buffer.length < 10) return e._enable = !1, this._myTrace("buffer lost when postmessage ,disable workerloader"), this.event(t.url, null), void this.event("image_err", t.url + "\n" + t.msg); if (!t.dataType) return this.event(t.url, null), void this.event("image_err", t.url + "\n" + t.msg); var i, n, s; switch (t.dataType) { case "buffer": (s = (n = (i = new yt("2D")).source.getContext("2d")).createImageData(t.width, t.height)).data.set(t.buffer), i.size(s.width, s.height), n.putImageData(s, 0, 0), i.memorySize = 0; break; case "imagedata": n = (i = new yt("2D")).source.getContext("2d"), s = t.imagedata, i.size(s.width, s.height), n.putImageData(s, 0, 0), s = t.imagedata, i.memorySize = 0; break; case "imageBitmap": s = t.imageBitmap, k.isWebGL ? i = s : (n = (i = new yt("2D")).source.getContext("2d"), i.size(s.width, s.height), n.drawImage(s, 0, 0), i.src = t.url); } k.isWebGL && (i = new laya.webgl.resource.WebGLImage(i, t.url)), this.event(t.url, i); }, i._myTrace = function(t) { var e = arguments, i = [], n = 0, s = e.length; for (n = 0; n < s; n++) i.push(e[n]); this.event("image_msg", i.join(" ")); }, i.loadImage = function(t) { var e; (e = {}).type = "load", e.url = t, this.worker.postMessage(e); }, i._loadImage = function(t) { var i = this; if (!e._enable || t.toLowerCase().indexOf(".png") < 0) e._preLoadFun.call(i, t); else { t = P.formatURL(t); var n = function(s) { laya.net.WorkerLoader.I.off(t, i, n), s ? i.onLoaded(s) : e._preLoadFun.call(i, t); }; laya.net.WorkerLoader.I.on(t, i, n), laya.net.WorkerLoader.I.loadImage(t); } }, a(1, e, "enable", function() { return e._enable; }, function(t) { e.disableJSDecode && !B.window.createImageBitmap || (e._enable = t) && null == e._preLoadFun && (e._enable = e.__init__()); }), e.__init__ = function() { return null == e._preLoadFun && (!!B.window.Worker && (e._preLoadFun = rt.prototype._loadImage, rt.prototype._loadImage = e.prototype._loadImage, e.I || (e.I = new e()), !0)); }, e.workerSupported = function() { return !!B.window.Worker; }, e.IMAGE_LOADED = "image_loaded", e.IMAGE_ERR = "image_err", e.IMAGE_MSG = "image_msg", e.I = null, e._preLoadFun = null, e._enable = !1, e.workerPath = "libs/worker.js", e.disableJSDecode = !0; }(), function(t) { function e() { e.__super.call(this), this._$1__id = ++e._uniqueIDCounter, this.__loaded = !0, this._destroyed = !1, this._referenceCount = 0, e._idResourcesMap[this.id] = this, this._released = !0, this.lock = !1, this._memorySize = 0, this._lastUseFrameCount = -1, F.currentResourceManager && F.currentResourceManager.addResource(this); } s(e, "laya.resource.Resource", h); var n = e.prototype; return i.imps(n, { "laya.resource.ICreateResource": !0, "laya.resource.IDispose": !0 }), n._setUrl = function(t) { if (this._url !== t) { var i; this._url && ((i = e._urlResourcesMap[this._url]).splice(i.indexOf(this), 1), 0 === i.length && delete e._urlResourcesMap[this._url]), t && ((i = e._urlResourcesMap[t]) || (e._urlResourcesMap[t] = i = []), i.push(this)), this._url = t; } }, n._getGroup = function() { return this._group; }, n._setGroup = function(t) { if (this._group !== t) { var i; this._group && ((i = e._groupResourcesMap[this._group]).splice(i.indexOf(this), 1), 0 === i.length && delete e._groupResourcesMap[this._group]), t && ((i = e._groupResourcesMap[t]) || (e._groupResourcesMap[t] = i = []), i.push(this)), this._group = t; } }, n._addReference = function() { this._referenceCount++; }, n._removeReference = function() { this._referenceCount--; }, n._clearReference = function() { this._referenceCount = 0; }, n._endLoaded = function() { this.__loaded = !0, this.event("loaded", this); }, n.recreateResource = function() { this.completeCreate(); }, n.disposeResource = function() {}, n.activeResource = function(t) { void 0 === t && (t = !1), this._lastUseFrameCount = X.loopCount, !this._destroyed && this.__loaded && (this._released || t) && this.recreateResource(); }, n.releaseResource = function(t) { return void 0 === t && (t = !1), !(!t && this.lock) && (!(this._released && !t) && (this.disposeResource(), this._released = !0, this._lastUseFrameCount = -1, this.event("released", this), !0)); }, n.onAsynLoaded = function(t, e, i) { throw new Error("Resource: must override this function!"); }, n.destroy = function() { if (!this._destroyed) { null !== this._resourceManager && this._resourceManager.removeResource(this), this._destroyed = !0, this.lock = !1, this.releaseResource(), delete e._idResourcesMap[this.id]; var t; this._url && ((t = e._urlResourcesMap[this._url]) && (t.splice(t.indexOf(this), 1), 0 === t.length && delete e._urlResourcesMap[this.url]), rt.clearRes(this._url), this.__loaded || r.cancelLoadByUrl(this._url)), this._group && ((t = e._groupResourcesMap[this._group]).splice(t.indexOf(this), 1), 0 === t.length && delete e._groupResourcesMap[this.url]); } }, n.completeCreate = function() { this._released = !1, this.event("recovered", this); }, n.dispose = function() { this.destroy(); }, a(0, n, "memorySize", function() { return this._memorySize; }, function(t) { var e = t - this._memorySize; this._memorySize = t, this.resourceManager && this.resourceManager.addSize(e); }), a(0, n, "_loaded", null, function(t) { this.__loaded = t; }), a(0, n, "loaded", function() { return this.__loaded; }), a(0, n, "id", function() { return this._$1__id; }), a(0, n, "destroyed", function() { return this._destroyed; }), a(0, n, "group", function() { return this._getGroup(); }, function(t) { this._setGroup(t); }), a(0, n, "resourceManager", function() { return this._resourceManager; }), a(0, n, "url", function() { return this._url; }), a(0, n, "released", function() { return this._released; }), a(0, n, "referenceCount", function() { return this._referenceCount; }), e.getResourceByID = function(t) { return e._idResourcesMap[t]; }, e.getResourceByURL = function(t, i) { return void 0 === i && (i = 0), e._urlResourcesMap[t][i]; }, e.getResourceCountByURL = function(t) { return e._urlResourcesMap[t].length; }, e.destroyUnusedResources = function(t) { var i; if (t) { var n = e._groupResourcesMap[t]; if (n) for (var s = n.slice(), a = 0, r = s.length; a < r; a++) (i = s[a]).lock || 0 !== i._referenceCount || i.destroy(); } else for (var o in e._idResourcesMap) (i = e._idResourcesMap[o]).lock || 0 !== i._referenceCount || i.destroy(); }, e._uniqueIDCounter = 0, e._idResourcesMap = {}, e._urlResourcesMap = {}, e._groupResourcesMap = {}, e; }()), lt = function(e) { function n(t, e) { this.offsetX = 0, this.offsetY = 0, this.sourceWidth = 0, this.sourceHeight = 0, this._w = 0, this._h = 0, this._uvID = 0, this._atlasID = -1, this.scaleRate = 1, n.__super.call(this), t && null != t._addReference && t._addReference(), this.setTo(t, e); } s(n, "laya.resource.Texture", h); var o = n.prototype; return o._setUrl = function(t) { this.url = t; }, o.setTo = function(e, i) { if (e instanceof t.HTMLElement) { var s = yt.create("2D", e); this.bitmap = s; } else this.bitmap = e; if (this.uv = i || n.DEF_UV, e) { this._w = e.width, this._h = e.height, this.sourceWidth = this.sourceWidth || this._w, this.sourceHeight = this.sourceHeight || this._h, this._loaded = this._w > 0; var a = this; if (this._loaded) r.addToAtlas && r.addToAtlas(a); else { var o = e; o instanceof laya.resource.HTMLImage && o.image && o.image.addEventListener("load", function(t) { r.addToAtlas && r.addToAtlas(a); }, !1); } } }, o.active = function() { this.bitmap && this.bitmap.activeResource(); }, o.destroy = function(t) { if (void 0 === t && (t = !1), this.bitmap && this.bitmap.referenceCount > 0) { var e = this.bitmap; t ? (k.isConchApp && e.source && e.source.conchDestroy && this.bitmap.source.conchDestroy(), this.bitmap = null, e.dispose(), e._clearReference()) : (e._removeReference(), 0 == e.referenceCount && (k.isConchApp && e.source && e.source.conchDestroy && this.bitmap.source.conchDestroy(), this.bitmap = null, e.dispose())), this.url && this === i.loader.getRes(this.url) && i.loader.clearRes(this.url, t), this._loaded = !1; } }, o.load = function(t) { var e = this; this._loaded = !1, t = P.customFormat(t); var i = this.bitmap || (this.bitmap = wt.create(t)); i && i._addReference(); var n = this; i.onload = function() { i.onload = null, n._loaded = !0, e.sourceWidth = e._w = i.width, e.sourceHeight = e._h = i.height, n.event("loaded", this), r.addToAtlas && r.addToAtlas(n); }; }, o.addTextureToAtlas = function(t) { r.addTextureToAtlas(this); }, o.getPixels = function(t, e, i, n) { if (k.isConchApp) { var s = this.bitmap; if (s.source && s.source.getImageData) { var a = s.source.getImageData(t, e, i, n), o = new Uint8Array(a); return Array.from(o); } return null; } if (k.isWebGL) return r.getTexturePixels(this, t, e, i, n); B.canvas.size(i, n), B.canvas.clear(), B.context.drawTexture(this, -t, -e, this.width, this.height, 0, 0); return B.context.getImageData(0, 0, i, n).data; }, o.onAsynLoaded = function(t, e) { e && e._addReference(), this.setTo(e, this.uv); }, a(0, o, "source", function() { return this.bitmap ? (this.bitmap.activeResource(), this.bitmap.source) : null; }), a(0, o, "loaded", function() { return this._loaded; }), a(0, o, "released", function() { return !this.bitmap || this.bitmap.released; }), a(0, o, "width", function() { return this._w ? this._w : this.uv && this.uv !== n.DEF_UV ? (this.uv[2] - this.uv[0]) * this.bitmap.width : this.bitmap.width; }, function(t) { this._w = t, this.sourceWidth || (this.sourceWidth = t); }), a(0, o, "repeat", function() { return !k.isWebGL || !this.bitmap || this.bitmap.repeat; }, function(t) { t && k.isWebGL && this.bitmap && (this.bitmap.repeat = t, t && (this.bitmap.enableMerageInAtlas = !1)); }), a(0, o, "height", function() { return this._h ? this._h : this.uv && this.uv !== n.DEF_UV ? (this.uv[5] - this.uv[1]) * this.bitmap.height : this.bitmap.height; }, function(t) { this._h = t, this.sourceHeight || (this.sourceHeight = t); }), a(0, o, "isLinearSampling", function() { return !k.isWebGL || 9728 != this.bitmap.minFifter; }, function(t) { !t && k.isWebGL && (t || -1 != this.bitmap.minFifter || -1 != this.bitmap.magFifter || (this.bitmap.minFifter = 9728, this.bitmap.magFifter = 9728, this.bitmap.enableMerageInAtlas = !1)); }), n.moveUV = function(t, e, i) { for (var n = 0; n < 8; n += 2) i[n] += t, i[n + 1] += e; return i; }, n.create = function(t, e, i, s, a, o, h, l, u) { void 0 === o && (o = 0), void 0 === h && (h = 0), void 0 === l && (l = 0), void 0 === u && (u = 0); var c = t instanceof laya.resource.Texture, _ = c ? t.uv : n.DEF_UV, d = c ? t.bitmap : t, p = r.isAtlas(d); if (p) { var f = d._atlaser, g = t._atlasID; if (-1 == g) throw new Error("create texture error"); d = f._inAtlasTextureBitmapValue[g], _ = f._inAtlasTextureOriUVValue[g]; } var m = new n(d, null); d.width && e + s > d.width && (s = d.width - e), d.height && i + a > d.height && (a = d.height - i), m.width = s, m.height = a, m.offsetX = o, m.offsetY = h, m.sourceWidth = l || s, m.sourceHeight = u || a; var v = 1 / d.width, y = 1 / d.height; e *= v, i *= y, s *= v, a *= y; var x = m.uv[0], b = m.uv[1], w = m.uv[4], C = m.uv[5], S = w - x, T = C - b, I = n.moveUV(_[0], _[1], [ e, i, e + s, i, e + s, i + a, e, i + a ]); m.uv = [ x + I[0] * S, b + I[1] * T, w - (1 - I[2]) * S, b + I[3] * T, w - (1 - I[4]) * S, C - (1 - I[5]) * T, x + I[6] * S, C - (1 - I[7]) * T ], p && m.addTextureToAtlas(); var M = d.scaleRate; return M && 1 != M ? (m.sourceWidth /= M, m.sourceHeight /= M, m.width /= M, m.height /= M, m.scaleRate = M, m.offsetX /= M, m.offsetY /= M) : m.scaleRate = 1, m; }, n.createFromTexture = function(t, e, i, s, a) { var r = t.scaleRate; 1 != r && (e *= r, i *= r, s *= r, a *= r); var o = M.TEMP.setTo(e - t.offsetX, i - t.offsetY, s, a), h = o.intersection(n._rect1.setTo(0, 0, t.width, t.height), n._rect2); if (!h) return null; var l = n.create(t, h.x, h.y, h.width, h.height, h.x - o.x, h.y - o.y, s, a); return l.bitmap._removeReference(), l; }, n.DEF_UV = [ 0, 0, 1, 0, 1, 1, 0, 1 ], n.INV_UV = [ 0, 1, 1, 1, 1, 0, 0, 0 ], n._rect1 = new M(), n._rect2 = new M(), n; }(), ut = function(t) { function e() { this._labelDic = null, this._tweenDic = {}, this._tweenDataList = [], this._endTweenDataList = null, this._currTime = 0, this._lastTime = 0, this._startTime = 0, this._index = 0, this._gidIndex = 0, this._firstTweenDic = {}, this._startTimeSort = !1, this._endTimeSort = !1, this._loopKey = !1, this.scale = 1, this._frameRate = 60, this._frameIndex = 0, this._total = 0, e.__super.call(this); } var n; s(e, "laya.utils.TimeLine", h); var r = e.prototype; return r.to = function(t, e, i, n, s) { return void 0 === s && (s = 0), this._create(t, e, i, n, s, !0); }, r.from = function(t, e, i, n, s) { return void 0 === s && (s = 0), this._create(t, e, i, n, s, !1); }, r._create = function(t, e, i, s, a, r) { var o = Y.getItemByClass("tweenData", n); return o.isTo = r, o.type = 0, o.target = t, o.duration = i, o.data = e, o.startTime = this._startTime + a, o.endTime = o.startTime + o.duration, o.ease = s, this._startTime = Math.max(o.endTime, this._startTime), this._tweenDataList.push(o), this._startTimeSort = !0, this._endTimeSort = !0, this; }, r.addLabel = function(t, e) { var i = Y.getItemByClass("tweenData", n); return i.type = 1, i.data = t, i.endTime = i.startTime = this._startTime + e, this._labelDic || (this._labelDic = {}), this._labelDic[t] = i, this._tweenDataList.push(i), this; }, r.removeLabel = function(t) { if (this._labelDic && this._labelDic[t]) { var e = this._labelDic[t]; if (e) { var i = this._tweenDataList.indexOf(e); i > -1 && this._tweenDataList.splice(i, 1); } delete this._labelDic[t]; } }, r.gotoTime = function(t) { if (null != this._tweenDataList && 0 != this._tweenDataList.length) { var e, i; for (var n in this._firstTweenDic) if (i = this._firstTweenDic[n]) for (var s in i) i.diyTarget.hasOwnProperty(s) && (i.diyTarget[s] = i[s]); for (n in this._tweenDic) (e = this._tweenDic[n]).clear(), delete this._tweenDic[n]; this._index = 0, this._gidIndex = 0, this._currTime = t, this._lastTime = B.now(); var a; null == this._endTweenDataList || this._endTimeSort ? (this._endTimeSort = !1, this._endTweenDataList = a = this._tweenDataList.concat(), a.sort(function(t, e) { return t.endTime > e.endTime ? 1 : t.endTime < e.endTime ? -1 : 0; })) : a = this._endTweenDataList; for (var r, o = 0, h = a.length; o < h; o++) if (0 == (r = a[o]).type) { if (!(t >= r.endTime)) break; this._index = Math.max(this._index, o + 1); var u = r.data; if (r.isTo) for (var c in u) r.target[c] = u[c]; } for (o = 0, h = this._tweenDataList.length; o < h; o++) 0 == (r = this._tweenDataList[o]).type && t >= r.startTime && t < r.endTime && (this._index = Math.max(this._index, o + 1), this._gidIndex++, (e = Y.getItemByClass("tween", K))._create(r.target, r.data, r.duration, r.ease, l.create(this, this._animComplete, [ this._gidIndex ]), 0, !1, r.isTo, !0, !1), e.setStartTime(this._currTime - (t - r.startTime)), e._updateEase(this._currTime), e.gid = this._gidIndex, this._tweenDic[this._gidIndex] = e); } }, r.gotoLabel = function(t) { if (null != this._labelDic) { var e = this._labelDic[t]; e && this.gotoTime(e.startTime); } }, r.pause = function() { i.timer.clear(this, this._update); }, r.resume = function() { this.play(this._currTime, this._loopKey); }, r.play = function(t, e) { if (void 0 === t && (t = 0), void 0 === e && (e = !1), this._tweenDataList) { if (this._startTimeSort) { this._startTimeSort = !1, this._tweenDataList.sort(function(t, e) { return t.startTime > e.startTime ? 1 : t.startTime < e.startTime ? -1 : 0; }); for (var n = 0, s = this._tweenDataList.length; n < s; n++) { var a = this._tweenDataList[n]; if (null != a && 0 == a.type) { var r = a.target, o = r.$_GID || (r.$_GID = $.getGID()), h = null; null == this._firstTweenDic[o] ? ((h = {}).diyTarget = r, this._firstTweenDic[o] = h) : h = this._firstTweenDic[o]; for (var l in a.data) null == h[l] && (h[l] = r[l]); } } } "string" == typeof t ? this.gotoLabel(t) : this.gotoTime(t), this._loopKey = e, this._lastTime = B.now(), i.timer.frameLoop(1, this, this._update); } }, r._update = function() { if (this._currTime >= this._startTime) { if (!this._loopKey) { for (var t in this._tweenDic) (s = this._tweenDic[t]).complete(); return this._complete(), void this.pause(); } if (this._complete(), !this._tweenDataList) return; this.gotoTime(0); } var e = B.now(), i = e - this._lastTime, n = this._currTime += i * this.scale; this._lastTime = e; for (t in this._tweenDic) (s = this._tweenDic[t])._updateEase(n); var s; if (0 != this._tweenDataList.length && this._index < this._tweenDataList.length) { var a = this._tweenDataList[this._index]; n >= a.startTime && (this._index++, 0 == a.type ? (this._gidIndex++, (s = Y.getItemByClass("tween", K))._create(a.target, a.data, a.duration, a.ease, l.create(this, this._animComplete, [ this._gidIndex ]), 0, !1, a.isTo, !0, !1), s.setStartTime(n), s.gid = this._gidIndex, this._tweenDic[this._gidIndex] = s, s._updateEase(n)) : this.event("label", a.data)); } }, r._animComplete = function(t) { this._tweenDic[t] && delete this._tweenDic[t]; }, r._complete = function() { this.event("complete"); }, r.reset = function() { var t; if (this._labelDic) for (t in this._labelDic) delete this._labelDic[t]; for (t in this._tweenDic) this._tweenDic[t].clear(), delete this._tweenDic[t]; for (t in this._firstTweenDic) delete this._firstTweenDic[t]; if (this._endTweenDataList = null, this._tweenDataList && this._tweenDataList.length) { var e = 0, n = 0; for (n = this._tweenDataList.length, e = 0; e < n; e++) this._tweenDataList[e] && this._tweenDataList[e].destroy(); } this._tweenDataList.length = 0, this._currTime = 0, this._lastTime = 0, this._startTime = 0, this._index = 0, this._gidIndex = 0, this.scale = 1, i.timer.clear(this, this._update); }, r.destroy = function() { this.reset(), this._labelDic = null, this._tweenDic = null, this._tweenDataList = null, this._firstTweenDic = null; }, a(0, r, "index", function() { return this._frameIndex; }, function(t) { this._frameIndex = t, this.gotoTime(this._frameIndex / this._frameRate * 1e3); }), a(0, r, "total", function() { return this._total = Math.floor(this._startTime / 1e3 * this._frameRate), this._total; }), e.to = function(t, i, n, s, a) { return void 0 === a && (a = 0), new e().to(t, i, n, s, a); }, e.from = function(t, i, n, s, a) { return void 0 === a && (a = 0), new e().from(t, i, n, s, a); }, e.__init$ = function() { n = function() { function t() { this.type = 0, this.isTo = !0, this.startTime = NaN, this.endTime = NaN, this.target = null, this.duration = NaN, this.ease = null, this.data = null; } s(t, ""); return t.prototype.destroy = function() { this.target = null, this.ease = null, this.data = null, this.isTo = !0, this.type = 0, Y.recover("tweenData", this); }, t; }(); }, e; }(), ct = function(e) { function o() { this._transform = null, this._tfChanged = !1, this._x = 0, this._y = 0, this._width = 0, this._height = 0, this._repaint = 1, this._mouseEnableState = 0, this._zOrder = 0, this._graphics = null, this._renderType = 0, this._optimizeScrollRect = !1, this._texture = null, this.mouseThrough = !1, this.autoSize = !1, this.hitTestPrior = !1, this.viewport = null, o.__super.call(this), this._style = c.EMPTY; } s(o, "laya.display.Sprite", e); var h = o.prototype; return i.imps(h, { "laya.display.ILayout": !0 }), h.createConchModel = function() { return new ConchNode(); }, h.destroy = function(t) { void 0 === t && (t = !0), this._releaseMem(), e.prototype.destroy.call(this, t), this._style && this._style.destroy(), this._transform && this._transform.destroy(), this._transform = null, this._style = null, this._graphics = null; }, h.updateZOrder = function() { $.updateOrder(this._childs) && this.repaint(); }, h.reCache = function() { this._$P.cacheCanvas && (this._$P.cacheCanvas.reCache = !0), this._repaint = 1; }, h.setBounds = function(t) { this._set$P("uBounds", t); }, h.getBounds = function() { return this._$P.mBounds || this._set$P("mBounds", new M()), M._getWrapRec(this._boundPointsToParent(), this._$P.mBounds); }, h.getSelfBounds = function() { return this._$P.uBounds ? this._$P.uBounds : (this._$P.mBounds || this._set$P("mBounds", new M()), M._getWrapRec(this._getBoundPointsM(!1), this._$P.mBounds)); }, h._boundPointsToParent = function(t) { void 0 === t && (t = !1); var e = 0, i = 0; this._style && (e = this._style._tf.translateX, i = this._style._tf.translateY, t = t || 0 !== this._style._tf.rotate, this._style.scrollRect && (e += this._style.scrollRect.x, i += this._style.scrollRect.y)); var n = this._getBoundPointsM(t); if (!n || n.length < 1) return n; if (8 != n.length && (n = t ? C.scanPList(n) : M._getWrapRec(n, M.TEMP)._getBoundPoints()), !this.transform) return $.transPointList(n, this._x - e, this._y - i), n; var s = I.TEMP, a = 0, r = n.length; for (a = 0; a < r; a += 2) s.x = n[a], s.y = n[a + 1], this.toParentPoint(s), n[a] = s.x, n[a + 1] = s.y; return n; }, h.getGraphicBounds = function(t) { return void 0 === t && (t = !1), this._graphics ? this._graphics.getBounds(t) : M.TEMP.setTo(0, 0, 0, 0); }, h._getBoundPointsM = function(t) { if (void 0 === t && (t = !1), this._$P.uBounds) return this._$P.uBounds._getBoundPoints(); if (this._$P.temBM || this._set$P("temBM", []), this.scrollRect) { var e = $.clearArray(this._$P.temBM), i = M.TEMP; return i.copyFrom(this.scrollRect), $.concatArray(e, i._getBoundPoints()), e; } for (var n, s, a, r = this._graphics ? this._graphics.getBoundPoints() : $.clearArray(this._$P.temBM), o = 0, h = (a = this._childs).length; o < h; o++) (n = a[o]) instanceof laya.display.Sprite && 1 == n.visible && (s = n._boundPointsToParent(t)) && (r = r ? $.concatArray(r, s) : s); return r; }, h.getStyle = function() { return this._style === c.EMPTY && (this._style = new c()), this._style; }, h.setStyle = function(t) { this._style = t; }, h._adjustTransform = function() { this._tfChanged = !1; var t, e = this._style._tf, i = e.scaleX, n = e.scaleY; if (e.rotate || 1 !== i || 1 !== n || e.skewX || e.skewY) { (t = this._transform || (this._transform = T.create())).bTransform = !0; var s = .0174532922222222 * (e.rotate - e.skewX), a = .0174532922222222 * (e.rotate + e.skewY), r = Math.cos(a), o = Math.sin(a), h = Math.sin(s), l = Math.cos(s); return t.a = i * r, t.b = i * o, t.c = -n * h, t.d = n * l, t.tx = t.ty = 0, t; } return this._transform && this._transform.destroy(), this._transform = null, this._renderType &= -5, t; }, h.pos = function(t, e, i) { if (void 0 === i && (i = !1), this._x !== t || this._y !== e) { if (this.destroyed) return this; if (i) { this._x = t, this._y = e, this.conchModel && this.conchModel.pos(this._x, this._y); var n = this._parent; n && 0 === n._repaint && (n._repaint = 1, n.parentRepaint()), this._$P.maskParent && 0 === this._$P.maskParent._repaint && (this._$P.maskParent._repaint = 1, this._$P.maskParent.parentRepaint()); } else this.x = t, this.y = e; } return this; }, h.pivot = function(t, e) { return this.pivotX = t, this.pivotY = e, this; }, h.size = function(t, e) { return this.width = t, this.height = e, this; }, h.scale = function(t, e, i) { void 0 === i && (i = !1); var n = this.getStyle(), s = n._tf; if (s.scaleX != t || s.scaleY != e) { if (this.destroyed) return this; if (i) { n.setScale(t, e), this._tfChanged = !0, this.conchModel && this.conchModel.scale(t, e), this._renderType |= 4; var a = this._parent; a && 0 === a._repaint && (a._repaint = 1, a.parentRepaint()); } else this.scaleX = t, this.scaleY = e; } return this; }, h.skew = function(t, e) { return this.skewX = t, this.skewY = e, this; }, h.render = function(t, e, i) { X.spriteCount++, D.renders[this._renderType]._fun(this, t, e + this._x, i + this._y), this._repaint = 0; }, h.drawToCanvas = function(t, e, i, n) { if (k.isConchNode) { var s = yt.create("2D"); return new R(t, e, s).ctx.setCanvasType(1), this.conchModel.drawToCanvas(s.source, i, n), s; } return r.drawToCanvas(this, this._renderType, t, e, i, n); }, h.customRender = function(t, e, i) { this._renderType |= 1024; }, h._applyFilters = function() { if (!k.isWebGL) { var t; if ((t = this._$P.filters) && !(t.length < 1)) for (var e = 0, i = t.length; e < i; e++) t[e].action.apply(this._$P.cacheCanvas); } }, h._isHaveGlowFilter = function() { var t = 0, e = 0; if (this.filters) for (t = 0; t < this.filters.length; t++) if (8 == this.filters[t].type) return !0; for (t = 0, e = this._childs.length; t < e; t++) if (this._childs[t]._isHaveGlowFilter()) return !0; return !1; }, h.localToGlobal = function(t, e) { void 0 === e && (e = !1), !0 === e && (t = new I(t.x, t.y)); for (var n = this; n && n != i.stage; ) t = n.toParentPoint(t), n = n.parent; return t; }, h.globalToLocal = function(t, e) { void 0 === e && (e = !1), e && (t = new I(t.x, t.y)); for (var n = this, s = []; n && n != i.stage; ) s.push(n), n = n.parent; for (var a = s.length - 1; a >= 0; ) t = (n = s[a]).fromParentPoint(t), a--; return t; }, h.toParentPoint = function(t) { if (!t) return t; t.x -= this.pivotX, t.y -= this.pivotY, this.transform && this._transform.transformPoint(t), t.x += this._x, t.y += this._y; var e = this._style.scrollRect; return e && (t.x -= e.x, t.y -= e.y), t; }, h.fromParentPoint = function(t) { if (!t) return t; t.x -= this._x, t.y -= this._y; var e = this._style.scrollRect; return e && (t.x += e.x, t.y += e.y), this.transform && this._transform.invertTransformPoint(t), t.x += this.pivotX, t.y += this.pivotY, t; }, h.on = function(t, i, n, s) { return 1 !== this._mouseEnableState && this.isMouseEvent(t) ? (this.mouseEnabled = !0, this._setBit(2, !0), this._parent && this._$2__onDisplay(), this._createListener(t, i, n, s, !1)) : e.prototype.on.call(this, t, i, n, s); }, h.once = function(t, i, n, s) { return 1 !== this._mouseEnableState && this.isMouseEvent(t) ? (this.mouseEnabled = !0, this._setBit(2, !0), this._parent && this._$2__onDisplay(), this._createListener(t, i, n, s, !0)) : e.prototype.once.call(this, t, i, n, s); }, h._$2__onDisplay = function() { if (1 !== this._mouseEnableState) { var t = this; for (t = t.parent; t && 1 !== t._mouseEnableState && !t._getBit(2); ) t.mouseEnabled = !0, t._setBit(2, !0), t = t.parent; } }, h.loadImage = function(t, e, i, n, s, a) { var r = this; return void 0 === e && (e = 0), void 0 === i && (i = 0), void 0 === n && (n = 0), void 0 === s && (s = 0), this.graphics.loadImage(t, e, i, n, s, function(t) { r.destroyed || (r.size(e + (n || t.width), i + (s || t.height)), r.repaint(), a && a.runWith(t)); }), this; }, h.repaint = function() { this.conchModel && this.conchModel.repaint && this.conchModel.repaint(), 0 === this._repaint && (this._repaint = 1, this.parentRepaint()), this._$P && this._$P.maskParent && this._$P.maskParent.repaint(); }, h._needRepaint = function() { return 0 !== this._repaint && this._$P.cacheCanvas && this._$P.cacheCanvas.reCache; }, h._childChanged = function(t) { this._childs.length ? this._renderType |= 2048 : this._renderType &= -2049, t && this._get$P("hasZorder") && i.timer.callLater(this, this.updateZOrder), this.repaint(); }, h.parentRepaint = function() { var t = this._parent; t && 0 === t._repaint && (t._repaint = 1, t.parentRepaint()); }, h.startDrag = function(t, e, i, n, s, a, r) { void 0 === e && (e = !1), void 0 === i && (i = 0), void 0 === n && (n = 300), void 0 === a && (a = !1), void 0 === r && (r = .92), this._$P.dragging || this._set$P("dragging", new W()), this._$P.dragging.start(this, t, e, i, n, s, a, r); }, h.stopDrag = function() { this._$P.dragging && this._$P.dragging.stop(); }, h._releaseMem = function() { if (this._$P) { var t = this._$P.cacheCanvas; t && t.ctx && (Y.recover("RenderContext", t.ctx), t.ctx.canvas.size(0, 0), t.ctx = null); var e = this._$P._filterCache; e && (e.destroy(), e.recycle(), this._set$P("_filterCache", null)), this._$P._isHaveGlowFilter && this._set$P("_isHaveGlowFilter", !1), this._$P._isHaveGlowFilter = null; } }, h._setDisplay = function(t) { t || this._releaseMem(), e.prototype._setDisplay.call(this, t); }, h.hitTestPoint = function(t, e) { var i = this.globalToLocal(I.TEMP.setTo(t, e)); t = i.x, e = i.y; return (this._$P.hitArea ? this._$P.hitArea : this._width > 0 && this._height > 0 ? M.TEMP.setTo(0, 0, this._width, this._height) : this.getSelfBounds()).contains(t, e); }, h.getMousePoint = function() { return this.globalToLocal(I.TEMP.setTo(i.stage.mouseX, i.stage.mouseY)); }, h._getWords = function() { return null; }, h._addChildsToLayout = function(t) { var e = this._getWords(); if (null == e && 0 == this._childs.length) return !1; if (e) for (var i = 0, n = e.length; i < n; i++) t.push(e[i]); return this._childs.forEach(function(e, i, n) { e._style._enableLayout() && e._addToLayout(t); }), !0; }, h._addToLayout = function(t) { this._style.absolute || (this._style.block ? t.push(this) : this._addChildsToLayout(t) && (this.x = this.y = 0)); }, h._isChar = function() { return !1; }, h._getCSSStyle = function() { return this._style.getCSSStyle(); }, h._setAttributes = function(t, e) { switch (t) { case "x": this.x = parseFloat(e); break; case "y": this.y = parseFloat(e); break; case "width": this.width = parseFloat(e); break; case "height": this.height = parseFloat(e); break; default: this[t] = e; } }, h._layoutLater = function() { this.parent && this.parent._layoutLater(); }, a(0, h, "optimizeScrollRect", function() { return this._optimizeScrollRect; }, function(t) { this._optimizeScrollRect != t && (this._optimizeScrollRect = t, this.conchModel && this.conchModel.optimizeScrollRect(t)); }), a(0, h, "customRenderEnable", null, function(t) { if (t && (this._renderType |= 1024, k.isConchNode)) { o.CustomList.push(this); var e = new yt("2d"); e._setContext(new CanvasRenderingContext2D()), this.customContext = new R(0, 0, e), e.context.setCanvasType && e.context.setCanvasType(2), this.conchModel.custom(e.context); } }), a(0, h, "cacheAsBitmap", function() { return "none" !== this.cacheAs; }, function(t) { this.cacheAs = t ? this._$P.hasFilter ? "none" : "normal" : "none"; }), a(0, h, "cacheAs", function() { return null == this._$P.cacheCanvas ? "none" : this._$P.cacheCanvas.type; }, function(t) { var e = this._$P.cacheCanvas; if (t !== (e ? e.type : "none")) { if ("none" !== t) this._getBit(1) || this._setUpNoticeType(1), e || (e = this._set$P("cacheCanvas", Y.getItemByClass("cacheCanvas", Object))), e.type = t, e.reCache = !0, this._renderType |= 16, "bitmap" == t && this.conchModel && this.conchModel.cacheAs(1), this._set$P("cacheForFilters", !1); else if (this._$P._mask) ; else if (this._$P.hasFilter) this._set$P("cacheForFilters", !0); else { if (e) { var i = e; i && i.ctx && (Y.recover("RenderContext", i.ctx), i.ctx.canvas.size(0, 0), i.ctx = null), Y.recover("cacheCanvas", e); } this._$P.cacheCanvas = null, this._renderType &= -17, this.conchModel && this.conchModel.cacheAs(0); } this.repaint(); } }), a(0, h, "zOrder", function() { return this._zOrder; }, function(t) { this._zOrder != t && (this._zOrder = t, this.conchModel && this.conchModel.setZOrder && this.conchModel.setZOrder(t), this._parent && (t && this._parent._set$P("hasZorder", !0), i.timer.callLater(this._parent, this.updateZOrder))); }), a(0, h, "rotation", function() { return this._style._tf.rotate; }, function(t) { var e = this.getStyle(); if (e._tf.rotate !== t) { e.setRotate(t), this._tfChanged = !0, this.conchModel && this.conchModel.rotate(t), this._renderType |= 4; var i = this._parent; i && 0 === i._repaint && (i._repaint = 1, i.parentRepaint()); } }), a(0, h, "width", function() { return this.autoSize ? this.getSelfBounds().width : this._width; }, function(t) { this._width !== t && (this._width = t, this.conchModel && this.conchModel.size(t, this._height), this.repaint()); }), a(0, h, "x", function() { return this._x; }, function(t) { if (this._x !== t) { if (this.destroyed) return; this._x = t, this.conchModel && this.conchModel.pos(t, this._y); var e = this._parent; e && 0 === e._repaint && (e._repaint = 1, e.parentRepaint()), this._$P.maskParent && 0 === this._$P.maskParent._repaint && (this._$P.maskParent._repaint = 1, this._$P.maskParent.parentRepaint()); } }), a(0, h, "globalScaleY", function() { for (var t = 1, e = this; e && e !== i.stage; ) t *= e.scaleY, e = e.parent; return t; }), a(0, h, "hitArea", function() { return this._$P.hitArea; }, function(t) { this._set$P("hitArea", t); }), a(0, h, "staticCache", function() { return this._$P.staticCache; }, function(t) { this._set$P("staticCache", t), t || this.reCache(); }), a(0, h, "texture", function() { return this._texture; }, function(t) { this._texture != t && (this._texture = t, this.graphics.cleanByTexture(t, 0, 0)); }), a(0, h, "y", function() { return this._y; }, function(t) { if (this._y !== t) { if (this.destroyed) return; this._y = t, this.conchModel && this.conchModel.pos(this._x, t); var e = this._parent; e && 0 === e._repaint && (e._repaint = 1, e.parentRepaint()), this._$P.maskParent && 0 === this._$P.maskParent._repaint && (this._$P.maskParent._repaint = 1, this._$P.maskParent.parentRepaint()); } }), a(0, h, "height", function() { return this.autoSize ? this.getSelfBounds().height : this._height; }, function(t) { this._height !== t && (this._height = t, this.conchModel && this.conchModel.size(this._width, t), this.repaint()); }), a(0, h, "blendMode", function() { return this._style.blendMode; }, function(t) { this.getStyle().blendMode = t, this.conchModel && this.conchModel.blendMode(t), t && "source-over" != t ? this._renderType |= 8 : this._renderType &= -9, this.parentRepaint(); }), a(0, h, "scaleX", function() { return this._style._tf.scaleX; }, function(t) { var e = this.getStyle(); if (e._tf.scaleX !== t) { e.setScaleX(t), this._tfChanged = !0, this.conchModel && this.conchModel.scale(t, e._tf.scaleY), this._renderType |= 4; var i = this._parent; i && 0 === i._repaint && (i._repaint = 1, i.parentRepaint()); } }), a(0, h, "scaleY", function() { return this._style._tf.scaleY; }, function(t) { var e = this.getStyle(); if (e._tf.scaleY !== t) { e.setScaleY(t), this._tfChanged = !0, this.conchModel && this.conchModel.scale(e._tf.scaleX, t), this._renderType |= 4; var i = this._parent; i && 0 === i._repaint && (i._repaint = 1, i.parentRepaint()); } }), a(0, h, "stage", function() { return i.stage; }), a(0, h, "skewX", function() { return this._style._tf.skewX; }, function(t) { var e = this.getStyle(); if (e._tf.skewX !== t) { e.setSkewX(t), this._tfChanged = !0, this.conchModel && this.conchModel.skew(t, e._tf.skewY), this._renderType |= 4; var i = this._parent; i && 0 === i._repaint && (i._repaint = 1, i.parentRepaint()); } }), a(0, h, "scrollRect", function() { return this._style.scrollRect; }, function(t) { this.getStyle().scrollRect = t, this.repaint(), t ? (this._renderType |= 128, this.conchModel && this.conchModel.scrollRect(t.x, t.y, t.width, t.height)) : (this._renderType &= -129, this.conchModel && (o.RUNTIMEVERION < "0.9.1" ? this.conchModel.removeType(64) : this.conchModel.removeType(128))); }), a(0, h, "skewY", function() { return this._style._tf.skewY; }, function(t) { var e = this.getStyle(); if (e._tf.skewY !== t) { e.setSkewY(t), this._tfChanged = !0, this.conchModel && this.conchModel.skew(e._tf.skewX, t), this._renderType |= 4; var i = this._parent; i && 0 === i._repaint && (i._repaint = 1, i.parentRepaint()); } }), a(0, h, "transform", function() { return this._tfChanged ? this._adjustTransform() : this._transform; }, function(t) { this._tfChanged = !1, this._transform = t, t && (this._x = t.tx, this._y = t.ty, t.tx = t.ty = 0, this.conchModel && this.conchModel.transform(t.a, t.b, t.c, t.d, this._x, this._y)), t ? this._renderType |= 4 : (this._renderType &= -5, this.conchModel && this.conchModel.removeType(4)), this.parentRepaint(); }), a(0, h, "pivotX", function() { return this._style._tf.translateX; }, function(t) { this.getStyle().setTranslateX(t), this.conchModel && this.conchModel.pivot(t, this._style._tf.translateY), this.repaint(); }), a(0, h, "pivotY", function() { return this._style._tf.translateY; }, function(t) { this.getStyle().setTranslateY(t), this.conchModel && this.conchModel.pivot(this._style._tf.translateX, t), this.repaint(); }), a(0, h, "alpha", function() { return this._style.alpha; }, function(t) { this._style && this._style.alpha !== t && (t = t < 0 ? 0 : t > 1 ? 1 : t, this.getStyle().alpha = t, this.conchModel && this.conchModel.alpha(t), 1 !== t ? this._renderType |= 2 : this._renderType &= -3, this.parentRepaint()); }), a(0, h, "visible", function() { return this._style.visible; }, function(t) { this._style && this._style.visible !== t && (this.getStyle().visible = t, this.conchModel && this.conchModel.visible(t), this.parentRepaint()); }), a(0, h, "graphics", function() { return this._graphics || (this.graphics = r.createGraphics()); }, function(t) { this._graphics && (this._graphics._sp = null), this._graphics = t, t ? (this._renderType &= -2, this._renderType |= 512, t._sp = this, this.conchModel && this.conchModel.graphics(this._graphics)) : (this._renderType &= -513, this._renderType &= -2, this.conchModel && (o.RUNTIMEVERION < "0.9.1" ? this.conchModel.removeType(256) : this.conchModel.removeType(512))), this.repaint(); }), a(0, h, "filters", function() { return this._$P.filters; }, function(t) { t && 0 === t.length && (t = null), this._$P.filters != t && (this._set$P("filters", t ? t.slice() : null), k.isConchApp && (this.conchModel && (o.RUNTIMEVERION < "0.9.1" ? this.conchModel.removeType(16) : this.conchModel.removeType(32)), this._$P.filters && 1 == this._$P.filters.length && this._$P.filters[0].callNative(this)), k.isWebGL && (t && t.length ? this._renderType |= 32 : this._renderType &= -33), t && t.length > 0 ? (this._getBit(1) || this._setUpNoticeType(1), k.isWebGL && 1 == t.length && t[0] instanceof laya.filters.ColorFilter || ("bitmap" != this.cacheAs && (k.isConchNode || (this.cacheAs = "bitmap"), this._set$P("cacheForFilters", !0)), this._set$P("hasFilter", !0))) : (this._set$P("hasFilter", !1), this._$P.cacheForFilters && "bitmap" == this.cacheAs && (this.cacheAs = "none")), this.repaint()); }), a(0, h, "parent", e.prototype._$get_parent, function(t) { i.superSet(Q, this, "parent", t), t && this._getBit(2) && this._$2__onDisplay(); }), a(0, h, "mask", function() { return this._$P._mask; }, function(t) { t && this.mask && this.mask._$P.maskParent || (t ? (this.cacheAs = "bitmap", this._set$P("_mask", t), t._set$P("maskParent", this)) : (this.mask && this.mask._set$P("maskParent", null), this._set$P("_mask", t), this.cacheAs = "none"), this.conchModel && this.conchModel.mask(t ? t.conchModel : null), this._renderType |= 64, this.parentRepaint()); }), a(0, h, "mouseEnabled", function() { return this._mouseEnableState > 1; }, function(t) { this._mouseEnableState = t ? 2 : 1; }), a(0, h, "globalScaleX", function() { for (var t = 1, e = this; e && e !== i.stage; ) t *= e.scaleX, e = e.parent; return t; }), a(0, h, "mouseX", function() { return this.getMousePoint().x; }), a(0, h, "mouseY", function() { return this.getMousePoint().y; }), o.fromImage = function(t) { return new o().loadImage(t); }, o.CustomList = [], n(o, [ "RUNTIMEVERION", function() { return this.RUNTIMEVERION = t.conch ? conchConfig.getRuntimeVersion().substr(conchConfig.getRuntimeVersion().lastIndexOf("-") + 1) : ""; } ]), o; }(Q), _t = function(t) { function e(t) { this._audio = null, this._onEnd = null, this._resumePlay = null, e.__super.call(this), this._onEnd = $.bind(this.__onEnd, this), this._resumePlay = $.bind(this.__resumePlay, this), t.addEventListener("ended", this._onEnd), this._audio = t; } s(e, "laya.media.h5audio.AudioSoundChannel", it); var n = e.prototype; return n.__onEnd = function() { if (1 == this.loops) return this.completeHandler && (i.timer.once(10, this, this.__runComplete, [ this.completeHandler ], !1), this.completeHandler = null), this.stop(), void this.event("complete"); this.loops > 0 && this.loops--, this.startTime = 0, this.play(); }, n.__resumePlay = function() { if (this._audio && this._audio.removeEventListener("canplay", this._resumePlay), !this.isStopped) try { this._audio.currentTime = this.startTime, B.container.appendChild(this._audio), this._audio.play(); } catch (t) { this.event("error"); } }, n.play = function() { if (this.isStopped = !1, this._audio) { try { this._audio.playbackRate = E.playbackRate, this._audio.currentTime = this.startTime; } catch (t) { return void this._audio.addEventListener("canplay", this._resumePlay); } E.addChannel(this), B.container.appendChild(this._audio), "play" in this._audio && this._audio.play(); } }, n.stop = function() { this.isStopped = !0, E.removeChannel(this), this.completeHandler = null, this._audio && ("pause" in this._audio && k.isConchApp && this._audio.stop(), this._audio.pause(), this._audio.removeEventListener("ended", this._onEnd), this._audio.removeEventListener("canplay", this._resumePlay), B.onIE || this._audio != et._musicAudio && Y.recover("audio:" + this.url, this._audio), B.removeElement(this._audio), this._audio = null); }, n.pause = function() { this.isStopped = !0, E.removeChannel(this), "pause" in this._audio && this._audio.pause(); }, n.resume = function() { this._audio && (this.isStopped = !1, E.addChannel(this), "play" in this._audio && this._audio.play()); }, a(0, n, "position", function() { return this._audio ? this._audio.currentTime : 0; }), a(0, n, "duration", function() { return this._audio ? this._audio.duration : 0; }), a(0, n, "volume", function() { return this._audio ? this._audio.volume : 1; }, function(t) { this._audio && (this._audio.volume = t); }), e; }(), dt = function(t) { function e() { this.audioBuffer = null, this.gain = null, this.bufferSource = null, this._currentTime = 0, this._volume = 1, this._startTime = 0, this._pauseTime = 0, this._onPlayEnd = null, this.context = st.ctx, e.__super.call(this), this._onPlayEnd = $.bind(this.__onPlayEnd, this), this.context.createGain ? this.gain = this.context.createGain() : this.gain = this.context.createGainNode(); } s(e, "laya.media.webaudio.WebAudioSoundChannel", t); var n = e.prototype; return n.play = function() { if (E.addChannel(this), this.isStopped = !1, this._clearBufferSource(), this.audioBuffer) { if (this.startTime >= this.duration) return this.stop(); var t = this.context, e = this.gain, i = t.createBufferSource(); this.bufferSource = i, i.buffer = this.audioBuffer, i.connect(e), e && e.disconnect(), e.connect(t.destination), i.onended = this._onPlayEnd, this._startTime = B.now(), this.gain.gain.setTargetAtTime ? this.gain.gain.setTargetAtTime(this._volume, this.context.currentTime, .001) : this.gain.gain.value = this._volume, 0 == this.loops && (i.loop = !0), i.playbackRate.setTargetAtTime ? i.playbackRate.setTargetAtTime(E.playbackRate, this.context.currentTime, .001) : i.playbackRate.value = E.playbackRate, i.start(0, this.startTime), this._currentTime = 0; } }, n.__onPlayEnd = function() { if (1 == this.loops) return this.completeHandler && (i.timer.once(10, this, this.__runComplete, [ this.completeHandler ], !1), this.completeHandler = null), this.stop(), void this.event("complete"); this.loops > 0 && this.loops--, this.startTime = 0, this.play(); }, n._clearBufferSource = function() { if (this.bufferSource) { var t = this.bufferSource; t.stop ? t.stop(0) : t.noteOff(0), t.disconnect(0), t.onended = null, e._tryCleanFailed || this._tryClearBuffer(t), this.bufferSource = null; } }, n._tryClearBuffer = function(t) { if (B.onMac) try { t.buffer = st._miniBuffer; } catch (t) { e._tryCleanFailed = !0; } else try { t.buffer = null; } catch (t) { e._tryCleanFailed = !0; } }, n.stop = function() { t.prototype.stop.call(this), this._clearBufferSource(), this.audioBuffer = null, this.gain && this.gain.disconnect(), this.isStopped = !0, E.removeChannel(this), this.completeHandler = null, E.autoReleaseSound && i.timer.once(5e3, null, E.disposeSoundIfNotUsed, [ this.url ], !1); }, n.pause = function() { this.isStopped || (this._pauseTime = this.position), this._clearBufferSource(), this.gain && this.gain.disconnect(), this.isStopped = !0, E.removeChannel(this), E.autoReleaseSound && i.timer.once(5e3, null, E.disposeSoundIfNotUsed, [ this.url ], !1); }, n.resume = function() { this.startTime = this._pauseTime, this.play(); }, a(0, n, "position", function() { return this.bufferSource ? (B.now() - this._startTime) / 1e3 + this.startTime : 0; }), a(0, n, "duration", function() { return this.audioBuffer ? this.audioBuffer.duration : 0; }), a(0, n, "volume", function() { return this._volume; }, function(t) { this.isStopped || (this._volume = t, this.gain.gain.setTargetAtTime ? this.gain.gain.setTargetAtTime(t, this.context.currentTime, .001) : this.gain.gain.value = t); }), e._tryCleanFailed = !1, e.SetTargetDelay = .001, e; }(it), pt = function(t) { function e() { e.__super.call(this), this._w = 0, this._h = 0; } s(e, "laya.resource.Bitmap", ht); var i = e.prototype; return a(0, i, "width", function() { return this._w; }), a(0, i, "height", function() { return this._h; }), a(0, i, "source", function() { return this._source; }), e; }(), ft = function(t) { function e() { this.loop = !1, this.wrapMode = 0, this._index = 0, this._count = 0, this._isPlaying = !1, this._labels = null, this._isReverse = !1, this._frameRateChanged = !1, this._controlNode = null, this._actionName = null, e.__super.call(this), this._interval = o.animationInterval, this._setUpNoticeType(1); } s(e, "laya.display.AnimationPlayerBase", t); var i = e.prototype; return i.play = function(t, e, i, n) { void 0 === t && (t = 0), void 0 === e && (e = !0), void 0 === i && (i = ""), void 0 === n && (n = !0), this._isPlaying = !0, this.index = "string" == typeof t ? this._getFrameByLabel(t) : t, this.loop = e, this._actionName = i, this._isReverse = 1 == this.wrapMode, this.interval > 0 && this.timerLoop(this.interval, this, this._frameLoop, null, !0, !0); }, i._getFrameByLabel = function(t) { var e = 0; for (e = 0; e < this._count; e++) if (this._labels[e] && this._labels[e].indexOf(t) >= 0) return e; return 0; }, i._frameLoop = function() { if (this._isReverse) { if (this._index--, this._index < 0) { if (!this.loop) return this._index = 0, this.stop(), void this.event("complete"); 2 == this.wrapMode ? (this._index = this._count > 0 ? 1 : 0, this._isReverse = !1) : this._index = this._count - 1, this.event("complete"); } } else if (this._index++, this._index >= this._count) { if (!this.loop) return this._index--, this.stop(), void this.event("complete"); 2 == this.wrapMode ? (this._index = this._count - 2 >= 0 ? this._count - 2 : 0, this._isReverse = !0) : this._index = 0, this.event("complete"); } this.index = this._index; }, i._setControlNode = function(t) { this._controlNode && (this._controlNode.off("display", this, this._checkResumePlaying), this._controlNode.off("undisplay", this, this._checkResumePlaying)), this._controlNode = t, t && t != this && (t.on("display", this, this._checkResumePlaying), t.on("undisplay", this, this._checkResumePlaying)); }, i._setDisplay = function(e) { t.prototype._setDisplay.call(this, e), this._checkResumePlaying(); }, i._checkResumePlaying = function() { this._isPlaying && (this._controlNode.displayedInStage ? this.play(this._index, this.loop, this._actionName) : this.clearTimer(this, this._frameLoop)); }, i.stop = function() { this._isPlaying = !1, this.clearTimer(this, this._frameLoop); }, i.addLabel = function(t, e) { this._labels || (this._labels = {}), this._labels[e] || (this._labels[e] = []), this._labels[e].push(t); }, i.removeLabel = function(t) { if (t) { if (this._labels) for (var e in this._labels) this._removeLabelFromLabelList(this._labels[e], t); } else this._labels = null; }, i._removeLabelFromLabelList = function(t, e) { if (t) for (var i = t.length - 1; i >= 0; i--) t[i] == e && t.splice(i, 1); }, i.gotoAndStop = function(t) { this.index = "string" == typeof t ? this._getFrameByLabel(t) : t, this.stop(); }, i._displayToIndex = function(t) {}, i.clear = function() { this.stop(), this._labels = null; }, a(0, i, "interval", function() { return this._interval; }, function(t) { this._interval != t && (this._frameRateChanged = !0, this._interval = t, this._isPlaying && t > 0 && this.timerLoop(t, this, this._frameLoop, null, !0, !0)); }), a(0, i, "isPlaying", function() { return this._isPlaying; }), a(0, i, "index", function() { return this._index; }, function(t) { if (this._index = t, this._displayToIndex(t), this._labels && this._labels[t]) for (var e = this._labels[t], i = 0, n = e.length; i < n; i++) this.event("label", e[i]); }), a(0, i, "count", function() { return this._count; }), e.WRAP_POSITIVE = 0, e.WRAP_REVERSE = 1, e.WRAP_PINGPONG = 2, e; }(ct), gt = function(t) { function e() { this._clipPoint = null, this._currBitmapFont = null, this._text = null, this._isChanged = !1, this._textWidth = 0, this._textHeight = 0, this._lines = [], this._lineWidths = [], this._startX = NaN, this._startY = NaN, this._lastVisibleLineIndex = -1, this._words = null, this._charSize = {}, this.underline = !1, this._underlineColor = null, e.__super.call(this), this.overflow = e.VISIBLE, this._style = new tt(this), this._style.wordWrap = !1; } s(e, "laya.display.Text", t); var r = e.prototype; return r.destroy = function(e) { void 0 === e && (e = !0), t.prototype.destroy.call(this, e), this._lines = null, this._words && (this._words.length = 0, this._words = null); }, r._getBoundPointsM = function(t) { void 0 === t && (t = !1); var e = M.TEMP; return e.setTo(0, 0, this.width, this.height), e._getBoundPoints(); }, r.getGraphicBounds = function(t) { void 0 === t && (t = !1); var e = M.TEMP; return e.setTo(0, 0, this.width, this.height), e; }, r._getCSSStyle = function() { return this._style; }, r.lang = function(t, i, n, s, a, r, o, h, l, u, c) { if (t = e.langPacks && e.langPacks[t] ? e.langPacks[t] : t, arguments.length < 2) this._text = t; else { for (var _ = 0, d = arguments.length; _ < d; _++) t = t.replace("{" + _ + "}", arguments[_ + 1]); this._text = t; } }, r._isPassWordMode = function() { var t = this._style.password; return "prompt" in this && this.prompt == this._text && (t = !1), t; }, r._getPassWordTxt = function(t) { var e; e = ""; for (var i = t.length; i > 0; i--) e += "●"; return e; }, r.renderText = function(t, e) { var i = this.graphics; i.clear(!0); var n = (this.italic ? "italic " : "") + (this.bold ? "bold " : "") + this.fontSize + "px " + (B.onIPhone ? laya.display.Text._fontFamilyMap[this.font] || this.font : this.font); B.context.font = n; var s = this.padding, a = s[3], r = "left", o = this._lines, h = this.leading + this._charSize.height, l = this._currBitmapFont; l && (h = this.leading + l.getMaxHeight()); var u = s[0]; if (!l && this._width > 0 && this._textWidth <= this._width && ("right" == this.align ? (r = "right", a = this._width - s[1]) : "center" == this.align && (r = "center", a = .5 * this._width + s[3] - s[1])), this._height > 0) { var c = this._textHeight > this._height ? "top" : this.valign; "middle" === c ? u = .5 * (this._height - e * h) + s[0] - s[2] : "bottom" === c && (u = this._height - e * h - s[2]); } var _ = this._style; if (l && l.autoScaleSize) var d = l.fontSize / this.fontSize; if (this._clipPoint) if (i.save(), l && l.autoScaleSize) { var p = 0, f = 0; p = this._width ? this._width - s[3] - s[1] : this._textWidth, f = this._height ? this._height - s[0] - s[2] : this._textHeight, p *= d, f *= d, i.clipRect(s[3], s[0], p, f); } else i.clipRect(s[3], s[0], this._width ? this._width - s[3] - s[1] : this._textWidth, this._height ? this._height - s[0] - s[2] : this._textHeight); var g = _.password; "prompt" in this && this.prompt == this._text && (g = !1); for (var m = 0, v = 0, y = Math.min(this._lines.length, e + t) || 1, x = t; x < y; x++) { var b, w = o[x]; if (g) { var C = w.length; w = ""; for (var S = C; S > 0; S--) w += "●"; } if (void 0 === w && (w = ""), m = a - (this._clipPoint ? this._clipPoint.x : 0), v = u + h * x - (this._clipPoint ? this._clipPoint.y : 0), this.underline && this.drawUnderline(r, m, v, x), l) { var T = this.width; l.autoScaleSize && (T = this.width * d), l.drawText(w, this, m, v, this.align, T); } else k.isWebGL ? (this._words || (this._words = []), (b = this._words.length > x - t ? this._words[x - t] : new J()).setText(w)) : b = w, _.stroke ? i.fillBorderText(b, m, v, n, this.color, _.strokeColor, _.stroke, r) : i.fillText(b, m, v, n, this.color, r); } if (l && l.autoScaleSize) { var I = 1 / d; this.scale(I, I); } this._clipPoint && i.restore(), this._startX = a, this._startY = u; }, r.drawUnderline = function(t, e, i, n) { var s = this._lineWidths[n]; switch (t) { case "center": e -= s / 2; break; case "right": e -= s; } i += this._charSize.height, this._graphics.drawLine(e, i, e + s, i, this.underlineColor || this.color, 1); }, r.typeset = function() { if (this._isChanged = !1, !this._text) return this._clipPoint = null, this._textWidth = this._textHeight = 0, void this.graphics.clear(!0); if (k.isConchApp) { var t = "" + this._getCSSStyle().font; this._getCSSStyle().stroke && this._getCSSStyle().strokeColor && (t += " 1 " + this._getCSSStyle().strokeColor), B.context.font = t; } else B.context.font = this._getCSSStyle().font; this._lines.length = 0, this._lineWidths.length = 0, this._isPassWordMode() ? this.parseLines(this._getPassWordTxt(this._text)) : this.parseLines(this._text), this.evalTextSize(), this.checkEnabledViewportOrNot() ? this._clipPoint || (this._clipPoint = new I(0, 0)) : this._clipPoint = null; var i = this._lines.length; if (this.overflow != e.VISIBLE) { var n = this.overflow == e.HIDDEN ? Math.floor : Math.ceil; i = Math.min(i, n((this.height - this.padding[0] - this.padding[2]) / (this.leading + this._charSize.height))); } var s = this.scrollY / (this._charSize.height + this.leading) | 0; this.renderText(s, i), this.repaint(); }, r.evalTextSize = function() { var t = NaN, e = NaN; t = Math.max.apply(this, this._lineWidths), e = this._currBitmapFont ? this._lines.length * (this._currBitmapFont.getMaxHeight() + this.leading) + this.padding[0] + this.padding[2] : this._lines.length * (this._charSize.height + this.leading) + this.padding[0] + this.padding[2], t == this._textWidth && e == this._textHeight || (this._textWidth = t, this._textHeight = e, this._width && this._height || this.conchModel && this.conchModel.size(this._width || this._textWidth, this._height || this._textHeight)); }, r.checkEnabledViewportOrNot = function() { return this.overflow == e.SCROLL && (this._width > 0 && this._textWidth > this._width || this._height > 0 && this._textHeight > this._height); }, r.changeText = function(t) { this._text !== t && (this.lang(t + ""), this._graphics && this._graphics.replaceText(this._text) || this.typeset()); }, r.parseLines = function(t) { var i = this.wordWrap || this.overflow == e.HIDDEN; if (i) var n = this.getWordWrapWidth(); if (this._currBitmapFont) this._charSize.width = this._currBitmapFont.getMaxWidth(), this._charSize.height = this._currBitmapFont.getMaxHeight(); else { var s = B.context.measureText(e._testWord); k.isConchApp && 0 === s.width && 0 === s.height && (s = B.context.measureText("W")), this._charSize.width = s.width, this._charSize.height = s.height || this.fontSize; } for (var a = t.replace(/\r\n/g, "\n").split("\n"), r = 0, o = a.length; r < o; r++) { var h = a[r]; i ? this.parseLine(h, n) : (this._lineWidths.push(this.getTextWidth(h)), this._lines.push(h)); } }, r.parseLine = function(t, i) { B.context; var n, s = this._lines, a = 0, r = NaN, o = NaN, h = 0; if ((r = this.getTextWidth(t)) <= i) return s.push(t), void this._lineWidths.push(r); r = this._charSize.width, 0 == (a = Math.floor(i / r)) && (a = 1), o = r = this.getTextWidth(t.substring(0, a)); for (var l = a, u = t.length; l < u; l++) if (r = this.getTextWidth(t.charAt(l)), (o += r) > i) if (this.wordWrap) { var c = t.substring(h, l); if (c.charCodeAt(c.length - 1) < 255 ? (n = /(?:\w|-)+$/.exec(c)) && (l = n.index + h, 0 == n.index ? l += c.length : c = t.substring(h, l)) : e.RightToLeft && (n = /([\u0600-\u06FF])+$/.exec(c)) && (l = n.index + h, 0 == n.index ? l += c.length : c = t.substring(h, l)), s.push(c), this._lineWidths.push(o - r), h = l, !(l + a < u)) { s.push(t.substring(h, u)), this._lineWidths.push(this.getTextWidth(s[s.length - 1])), h = -1; break; } l += a, o = r = this.getTextWidth(t.substring(h, l)), l--; } else if (this.overflow == e.HIDDEN) return s.push(t.substring(0, l)), void this._lineWidths.push(this.getTextWidth(s[s.length - 1])); this.wordWrap && -1 != h && (s.push(t.substring(h, u)), this._lineWidths.push(this.getTextWidth(s[s.length - 1]))); }, r.getTextWidth = function(t) { return this._currBitmapFont ? this._currBitmapFont.getTextWidth(t) : B.context.measureText(t).width; }, r.getWordWrapWidth = function() { var t = this.padding, e = NaN; return (e = this._currBitmapFont && this._currBitmapFont.autoScaleSize ? this._width * (this._currBitmapFont.fontSize / this.fontSize) : this._width) <= 0 && (e = this.wordWrap ? 100 : B.width), e <= 0 && (e = 100), e - t[3] - t[1]; }, r.getCharPoint = function(t, e) { this._isChanged && i.timer.runCallLater(this, this.typeset); for (var n = 0, s = this._lines, a = 0, r = 0, o = s.length; r < o; r++) { if (n += s[r].length, t < n) { var h = r; break; } a = n; } var l = (this.italic ? "italic " : "") + (this.bold ? "bold " : "") + this.fontSize + "px " + this.font; B.context.font = l; var u = this.getTextWidth(this._text.substring(a, t)); return (e || new I()).setTo(this._startX + u - (this._clipPoint ? this._clipPoint.x : 0), this._startY + h * (this._charSize.height + this.leading) - (this._clipPoint ? this._clipPoint.y : 0)); }, a(0, r, "width", function() { return this._width ? this._width : this.textWidth + this.padding[1] + this.padding[3]; }, function(t) { t != this._width && (i.superSet(ct, this, "width", t), this.isChanged = !0); }), a(0, r, "textWidth", function() { return this._isChanged && i.timer.runCallLater(this, this.typeset), this._textWidth; }), a(0, r, "height", function() { return this._height ? this._height : this.textHeight; }, function(t) { t != this._height && (i.superSet(ct, this, "height", t), this.isChanged = !0); }), a(0, r, "textHeight", function() { return this._isChanged && i.timer.runCallLater(this, this.typeset), this._textHeight; }), a(0, r, "padding", function() { return this._getCSSStyle().padding; }, function(t) { this._getCSSStyle().padding = t, this.isChanged = !0; }), a(0, r, "bold", function() { return this._getCSSStyle().bold; }, function(t) { this._getCSSStyle().bold = t, this.isChanged = !0; }), a(0, r, "text", function() { return this._text || ""; }, function(t) { this._text !== t && (this.lang(t + ""), this.isChanged = !0, this.event("change")); }), a(0, r, "color", function() { return this._getCSSStyle().color; }, function(t) { this._getCSSStyle().color != t && (this._getCSSStyle().color = t, !this._isChanged && this._graphics ? this._graphics.replaceTextColor(this.color) : this.isChanged = !0); }), a(0, r, "font", function() { return this._getCSSStyle().fontFamily; }, function(t) { this._currBitmapFont && (this._currBitmapFont = null, this.scale(1, 1)), e._bitmapFonts && e._bitmapFonts[t] && (this._currBitmapFont = e._bitmapFonts[t]), this._getCSSStyle().fontFamily = t, this.isChanged = !0; }), a(0, r, "fontSize", function() { return this._getCSSStyle().fontSize; }, function(t) { this._getCSSStyle().fontSize = t, this.isChanged = !0; }), a(0, r, "italic", function() { return this._getCSSStyle().italic; }, function(t) { this._getCSSStyle().italic = t, this.isChanged = !0; }), a(0, r, "align", function() { return this._getCSSStyle().align; }, function(t) { this._getCSSStyle().align = t, this.isChanged = !0; }), a(0, r, "valign", function() { return this._getCSSStyle().valign; }, function(t) { this._getCSSStyle().valign = t, this.isChanged = !0; }), a(0, r, "wordWrap", function() { return this._getCSSStyle().wordWrap; }, function(t) { this._getCSSStyle().wordWrap = t, this.isChanged = !0; }), a(0, r, "leading", function() { return this._getCSSStyle().leading; }, function(t) { this._getCSSStyle().leading = t, this.isChanged = !0; }), a(0, r, "bgColor", function() { return this._getCSSStyle().backgroundColor; }, function(t) { this._getCSSStyle().backgroundColor = t, this.isChanged = !0; }), a(0, r, "borderColor", function() { return this._getCSSStyle().borderColor; }, function(t) { this._getCSSStyle().borderColor = t, this.isChanged = !0; }), a(0, r, "stroke", function() { return this._getCSSStyle().stroke; }, function(t) { this._getCSSStyle().stroke = t, this.isChanged = !0; }), a(0, r, "strokeColor", function() { return this._getCSSStyle().strokeColor; }, function(t) { this._getCSSStyle().strokeColor = t, this.isChanged = !0; }), a(0, r, "isChanged", null, function(t) { this._isChanged !== t && (this._isChanged = t, t && i.timer.callLater(this, this.typeset)); }), a(0, r, "scrollX", function() { return this._clipPoint ? this._clipPoint.x : 0; }, function(t) { if (!(this.overflow != e.SCROLL || this.textWidth < this._width) && this._clipPoint) { t = t < this.padding[3] ? this.padding[3] : t; var i = this._textWidth - this._width; t = t > i ? i : t; var n = this._height / (this._charSize.height + this.leading) | 1; this._clipPoint.x = t, this.renderText(this._lastVisibleLineIndex, n); } }), a(0, r, "scrollY", function() { return this._clipPoint ? this._clipPoint.y : 0; }, function(t) { if (!(this.overflow != e.SCROLL || this.textHeight < this._height) && this._clipPoint) { t = t < this.padding[0] ? this.padding[0] : t; var i = this._textHeight - this._height, n = (t = t > i ? i : t) / (this._charSize.height + this.leading) | 0; this._lastVisibleLineIndex = n; var s = 1 + (this._height / (this._charSize.height + this.leading) | 0); this._clipPoint.y = t, this.renderText(n, s); } }), a(0, r, "maxScrollX", function() { return this.textWidth < this._width ? 0 : this._textWidth - this._width; }), a(0, r, "maxScrollY", function() { return this.textHeight < this._height ? 0 : this._textHeight - this._height; }), a(0, r, "lines", function() { return this._isChanged && this.typeset(), this._lines; }), a(0, r, "underlineColor", function() { return this._underlineColor; }, function(t) { this._underlineColor = t, this._isChanged = !0, this.typeset(); }), e.registerBitmapFont = function(t, i) { e._bitmapFonts || (e._bitmapFonts = {}), e._bitmapFonts[t] = i; }, e.unregisterBitmapFont = function(t, i) { if (void 0 === i && (i = !0), e._bitmapFonts && e._bitmapFonts[t]) { var n = e._bitmapFonts[t]; i && n.destroy(), delete e._bitmapFonts[t]; } }, e.setTextRightToLeft = function() { var t; (t = B.canvas.source.style).display = "none", t.position = "absolute", t.direction = "rtl", k._mainCanvas.source.style.direction = "rtl", laya.display.Text.RightToLeft = !0, B.document.body.appendChild(B.canvas.source); }, e.supportFont = function(t) { B.context.font = "10px sans-serif"; var e = B.context.measureText("abcji").width; B.context.font = "10px " + t; var i = B.context.measureText("abcji").width; return console.log(e, i), e !== i; }, e._testWord = "游", e.langPacks = null, e.VISIBLE = "visible", e.SCROLL = "scroll", e.HIDDEN = "hidden", e.CharacterCache = !0, e.RightToLeft = !1, e._bitmapFonts = null, n(e, [ "_fontFamilyMap", function() { return this._fontFamilyMap = { "报隶": "报隶-简", "黑体": "黑体-简", "楷体": "楷体-简", "兰亭黑": "兰亭黑-简", "隶变": "隶变-简", "凌慧体": "凌慧体-简", "翩翩体": "翩翩体-简", "苹方": "苹方-简", "手札体": "手札体-简", "宋体": "宋体-简", "娃娃体": "娃娃体-简", "魏碑": "魏碑-简", "行楷": "行楷-简", "雅痞": "雅痞-简", "圆体": "圆体-简" }; } ]), e; }(ct), mt = function(t) { function e() { this.focus = null, this.designWidth = 0, this.designHeight = 0, this.canvasRotation = !1, this.canvasDegree = 0, this.renderingEnabled = !0, this.screenAdaptationEnabled = !0, this._screenMode = "none", this._scaleMode = "noscale", this._alignV = "top", this._alignH = "left", this._bgColor = "black", this._mouseMoveTime = 0, this._renderCount = 0, this._frameStartTime = NaN, this._isFocused = !1, this._isVisibility = !1, this._scenes = null, this._frameRate = "fast", this.useRetinalCanvas = !1, e.__super.call(this), this.offset = new I(), this._canvasTransform = new T(), this._previousOrientation = B.window.orientation; var t = this; this.transform = T.create(), this._scenes = [], this.mouseEnabled = !0, this.hitTestPrior = !0, this.autoSize = !1, this._displayedInStage = !0, this._isFocused = !0, this._isVisibility = !0, this.useRetinalCanvas = o.useRetinalCanvas; var i = B.window, n = this; i.addEventListener("focus", function() { t._isFocused = !0, n.event("focus"), n.event("focuschange"); }), i.addEventListener("blur", function() { t._isFocused = !1, n.event("blur"), n.event("focuschange"), n._isInputting() && (bt.inputElement.target.focus = !1); }); var s = "visibilityState", a = "visibilitychange", r = i.document; void 0 !== r.hidden ? (a = "visibilitychange", s = "visibilityState") : void 0 !== r.mozHidden ? (a = "mozvisibilitychange", s = "mozVisibilityState") : void 0 !== r.msHidden ? (a = "msvisibilitychange", s = "msVisibilityState") : void 0 !== r.webkitHidden && (a = "webkitvisibilitychange", s = "webkitVisibilityState"), i.document.addEventListener(a, function() { "hidden" == B.document[s] ? n._setStageVisible(!1) : n._setStageVisible(!0); }), i.document.addEventListener("qbrowserVisibilityChange", function(t) { n._setStageVisible(!t.hidden); }), i.addEventListener("resize", function() { var e = B.window.orientation; null != e && e != t._previousOrientation && n._isInputting() && (bt.inputElement.target.focus = !1), t._previousOrientation = e, n._isInputting() || n._resetCanvas(); }), i.addEventListener("orientationchange", function(t) { n._resetCanvas(); }), this.on("mousemove", this, this._onmouseMove), B.onMobile && this.on("mousedown", this, this._onmouseMove); } s(e, "laya.display.Stage", t); var h = e.prototype; return h._setStageVisible = function(t) { this._isVisibility != t && (this._isVisibility = t, this._isVisibility || this._isInputting() && (bt.inputElement.target.focus = !1), this.event("visibilitychange")); }, h._isInputting = function() { return B.onMobile && bt.isInputting; }, h._changeCanvasSize = function() { this.setScreenSize(B.clientWidth * B.pixelRatio, B.clientHeight * B.pixelRatio); }, h._resetCanvas = function() { if (this.screenAdaptationEnabled) { var t = k._mainCanvas; t.source.style; t.size(1, 1), i.timer.once(100, this, this._changeCanvasSize); } }, h.setScreenSize = function(t, e) { var i = !1; if ("none" !== this._screenMode) { if (i = (t / e < 1 ? "vertical" : "horizontal") !== this._screenMode) { var n = e; e = t, t = n; } } this.canvasRotation = i; var s = k._mainCanvas, a = s.source.style, h = this._canvasTransform.identity(), l = this._scaleMode, u = t / this.designWidth, c = e / this.designHeight, _ = o.useRetinalCanvas ? t : this.designWidth, d = o.useRetinalCanvas ? e : this.designHeight, p = t, f = e, g = B.pixelRatio; switch (this._width = this.designWidth, this._height = this.designHeight, l) { case "noscale": u = c = 1, p = this.designWidth, f = this.designHeight; break; case "showall": u = c = Math.min(u, c), _ = p = Math.round(this.designWidth * u), d = f = Math.round(this.designHeight * c); break; case "noborder": u = c = Math.max(u, c), p = Math.round(this.designWidth * u), f = Math.round(this.designHeight * c); break; case "full": u = c = 1, this._width = _ = t, this._height = d = e; break; case "fixedwidth": c = u, this._height = d = Math.round(e / u); break; case "fixedheight": u = c, this._width = _ = Math.round(t / c); break; case "fixedauto": t / e < this.designWidth / this.designHeight ? (c = u, this._height = d = Math.round(e / u)) : (u = c, this._width = _ = Math.round(t / c)); } this.conchModel && this.conchModel.size(this._width, this._height), o.useRetinalCanvas && (_ = t, d = e), u *= this.scaleX, c *= this.scaleY, 1 === u && 1 === c ? this.transform.identity() : (this.transform.a = this._formatData(u / (p / _)), this.transform.d = this._formatData(c / (f / d)), this.conchModel && this.conchModel.scale(this.transform.a, this.transform.d)), s.size(_, d), r.changeWebGLSize(_, d), h.scale(p / _ / g, f / d / g), "left" === this._alignH ? this.offset.x = 0 : "right" === this._alignH ? this.offset.x = (t - p) / g : this.offset.x = .5 * (t - p) / g, "top" === this._alignV ? this.offset.y = 0 : "bottom" === this._alignV ? this.offset.y = (e - f) / g : this.offset.y = .5 * (e - f) / g, this.offset.x = Math.round(this.offset.x), this.offset.y = Math.round(this.offset.y), h.translate(this.offset.x, this.offset.y), this.canvasDegree = 0, i && ("horizontal" === this._screenMode ? (h.rotate(Math.PI / 2), h.translate(e / g, 0), this.canvasDegree = 90) : (h.rotate(-Math.PI / 2), h.translate(0, t / g), this.canvasDegree = -90)), h.a = this._formatData(h.a), h.d = this._formatData(h.d), h.tx = this._formatData(h.tx), h.ty = this._formatData(h.ty), a.transformOrigin = a.webkitTransformOrigin = a.msTransformOrigin = a.mozTransformOrigin = a.oTransformOrigin = "0px 0px 0px", a.transform = a.webkitTransform = a.msTransform = a.mozTransform = a.oTransform = "matrix(" + h.toString() + ")", h.translate(parseInt(a.left) || 0, parseInt(a.top) || 0), this.visible = !0, this._repaint = 1, this.event("resize"); }, h._formatData = function(t) { return Math.abs(t) < 1e-6 ? 0 : Math.abs(1 - t) < .001 ? t > 0 ? 1 : -1 : t; }, h.getMousePoint = function() { return I.TEMP.setTo(this.mouseX, this.mouseY); }, h.repaint = function() { this._repaint = 1; }, h.parentRepaint = function() {}, h._loop = function() { return this.render(k.context, 0, 0), !0; }, h._onmouseMove = function(t) { this._mouseMoveTime = B.now(); }, h.getTimeFromFrameStart = function() { return B.now() - this._frameStartTime; }, h.render = function(e, n, s) { if ("sleep" === this._frameRate && !k.isConchApp) { var a = B.now(); if (!(a - this._frameStartTime >= 1e3)) return; this._frameStartTime = a; } if (this._renderCount++, k.isFlash && this.repaint(), this._style.visible) { this._frameStartTime = B.now(); var o = "slow" !== ("mouse" === this._frameRate ? this._frameStartTime - this._mouseMoveTime < 2e3 ? "fast" : "slow" : this._frameRate), h = this._renderCount % 2 == 0; if (X.renderSlow = !o, o || h || k.isConchApp) { X.loopCount++, v.instance.runEvent(), i.timer._update(), r.update3DLoop(); var l, u = 0, c = 0; if (k.isConchNode) for (u = 0, c = this._scenes.length; u < c; u++) (l = this._scenes[u]) && l._updateSceneConch(); else for (u = 0, c = this._scenes.length; u < c; u++) (l = this._scenes[u]) && l._updateScene(); if (k.isConchNode) { var _ = ct.CustomList; for (u = 0, c = _.length; u < c; u++) { var d = _[u]; d.customRender(d.customContext, 0, 0); } return; } } k.isConchNode || this.renderingEnabled && (o || !h || k.isConchWebGL) && (k.isWebGL ? (e.clear(), t.prototype.render.call(this, e, n, s), X._show && X._sp && X._sp.render(e, n, s), r.clear(this._bgColor), r.beginFlush(), e.flush(), r.endFinish(), q.instance && q.getInstance().endDispose()) : (r.clear(this._bgColor), t.prototype.render.call(this, e, n, s), X._show && X._sp && X._sp.render(e, n, s))); } else this._renderCount % 5 == 0 && (X.loopCount++, v.instance.runEvent(), i.timer._update()); }, h._requestFullscreen = function() { var t = B.document.documentElement; t.requestFullscreen ? t.requestFullscreen() : t.mozRequestFullScreen ? t.mozRequestFullScreen() : t.webkitRequestFullscreen ? t.webkitRequestFullscreen() : t.msRequestFullscreen && t.msRequestFullscreen(); }, h._fullScreenChanged = function() { i.stage.event("fullscreenchange"); }, h.exitFullscreen = function() { var t = B.document; t.exitFullscreen ? t.exitFullscreen() : t.mozCancelFullScreen ? t.mozCancelFullScreen() : t.webkitExitFullscreen && t.webkitExitFullscreen(); }, a(0, h, "clientScaleX", function() { return this._transform ? this._transform.getScaleX() : 1; }), a(0, h, "desginHeight", function() { return console.debug("desginHeight已经弃用,请使用designHeight代替"), this.designHeight; }), a(0, h, "frameRate", function() { return this._frameRate; }, function(t) { if (this._frameRate = t, k.isConchApp) switch (this._frameRate) { case "slow": B.window.conch && B.window.conchConfig.setSlowFrame && B.window.conchConfig.setSlowFrame(!0); break; case "fast": B.window.conch && B.window.conchConfig.setSlowFrame && B.window.conchConfig.setSlowFrame(!1); break; case "mouse": B.window.conch && B.window.conchConfig.setMouseFrame && B.window.conchConfig.setMouseFrame(2e3); break; case "sleep": B.window.conch && B.window.conchConfig.setLimitFPS && B.window.conchConfig.setLimitFPS(1); break; default: throw new Error("Stage:frameRate invalid."); } }), a(0, h, "clientScaleY", function() { return this._transform ? this._transform.getScaleY() : 1; }), a(0, h, "width", t.prototype._$get_width, function(t) { this.designWidth = t, i.superSet(ct, this, "width", t), i.timer.callLater(this, this._changeCanvasSize); }), a(0, h, "alignH", function() { return this._alignH; }, function(t) { this._alignH = t, i.timer.callLater(this, this._changeCanvasSize); }), a(0, h, "isFocused", function() { return this._isFocused; }), a(0, h, "height", t.prototype._$get_height, function(t) { this.designHeight = t, i.superSet(ct, this, "height", t), i.timer.callLater(this, this._changeCanvasSize); }), a(0, h, "transform", function() { return this._tfChanged && this._adjustTransform(), this._transform = this._transform || T.create(); }, t.prototype._$set_transform), a(0, h, "isVisibility", function() { return this._isVisibility; }), a(0, h, "desginWidth", function() { return console.debug("desginWidth已经弃用,请使用designWidth代替"), this.designWidth; }), a(0, h, "scaleMode", function() { return this._scaleMode; }, function(t) { this._scaleMode = t, i.timer.callLater(this, this._changeCanvasSize); }), a(0, h, "alignV", function() { return this._alignV; }, function(t) { this._alignV = t, i.timer.callLater(this, this._changeCanvasSize); }), a(0, h, "bgColor", function() { return this._bgColor; }, function(t) { this._bgColor = t, this.conchModel && this.conchModel.bgColor(t), k.isWebGL && (t ? e._wgColor = V.create(t)._color : B.onMiniGame || B.onQGMiniGame || B.onVVMiniGame || (e._wgColor = null)), B.onLimixiu ? e._wgColor = V.create(t)._color : k.canvas.style.background = t || "none"; }), a(0, h, "mouseX", function() { return Math.round(v.instance.mouseX / this.clientScaleX); }), a(0, h, "mouseY", function() { return Math.round(v.instance.mouseY / this.clientScaleY); }), a(0, h, "screenMode", function() { return this._screenMode; }, function(t) { this._screenMode = t; }), a(0, h, "visible", t.prototype._$get_visible, function(t) { if (this.visible !== t) { i.superSet(ct, this, "visible", t); k._mainCanvas.source.style.visibility = t ? "visible" : "hidden"; } }), a(0, h, "fullScreenEnabled", null, function(t) { var e = B.document, i = k.canvas; t ? (i.addEventListener("mousedown", this._requestFullscreen), i.addEventListener("touchstart", this._requestFullscreen), e.addEventListener("fullscreenchange", this._fullScreenChanged), e.addEventListener("mozfullscreenchange", this._fullScreenChanged), e.addEventListener("webkitfullscreenchange", this._fullScreenChanged), e.addEventListener("msfullscreenchange", this._fullScreenChanged)) : (i.removeEventListener("mousedown", this._requestFullscreen), i.removeEventListener("touchstart", this._requestFullscreen), e.removeEventListener("fullscreenchange", this._fullScreenChanged), e.removeEventListener("mozfullscreenchange", this._fullScreenChanged), e.removeEventListener("webkitfullscreenchange", this._fullScreenChanged), e.removeEventListener("msfullscreenchange", this._fullScreenChanged)); }), e.SCALE_NOSCALE = "noscale", e.SCALE_EXACTFIT = "exactfit", e.SCALE_SHOWALL = "showall", e.SCALE_NOBORDER = "noborder", e.SCALE_FULL = "full", e.SCALE_FIXED_WIDTH = "fixedwidth", e.SCALE_FIXED_HEIGHT = "fixedheight", e.SCALE_FIXED_AUTO = "fixedauto", e.ALIGN_LEFT = "left", e.ALIGN_RIGHT = "right", e.ALIGN_CENTER = "center", e.ALIGN_TOP = "top", e.ALIGN_MIDDLE = "middle", e.ALIGN_BOTTOM = "bottom", e.SCREEN_NONE = "none", e.SCREEN_HORIZONTAL = "horizontal", e.SCREEN_VERTICAL = "vertical", e.FRAME_FAST = "fast", e.FRAME_SLOW = "slow", e.FRAME_MOUSE = "mouse", e.FRAME_SLEEP = "sleep", e.FRAME_MOUSE_THREDHOLD = 2e3, n(e, [ "_wgColor", function() { return this._wgColor = [ 0, 0, 0, 1 ]; } ]), e; }(ct), vt = (function(t) { function e() { this.url = null, this._channel = null, this._tar = null, this._playEvents = null, this._stopEvents = null, e.__super.call(this), this.visible = !1, this.on("added", this, this._onParentChange), this.on("removed", this, this._onParentChange); } s(e, "laya.media.SoundNode", ct); var i = e.prototype; i._onParentChange = function() { this.target = this.parent; }, i.play = function(t, e) { void 0 === t && (t = 1), isNaN(t) && (t = 1), this.url && (this.stop(), this._channel = E.playSound(this.url, t, e)); }, i.stop = function() { this._channel && !this._channel.isStopped && this._channel.stop(), this._channel = null; }, i._setPlayAction = function(t, e, i, n) { void 0 === n && (n = !0), this[i] && t && (n ? t.on(e, this, this[i]) : t.off(e, this, this[i])); }, i._setPlayActions = function(t, e, i, n) { if (void 0 === n && (n = !0), t && e) { var s = e.split(","), a = 0, r = 0; for (r = s.length, a = 0; a < r; a++) this._setPlayAction(t, s[a], i, n); } }, a(0, i, "playEvent", null, function(t) { this._playEvents = t, t && this._tar && this._setPlayActions(this._tar, t, "play"); }), a(0, i, "target", null, function(t) { this._tar && (this._setPlayActions(this._tar, this._playEvents, "play", !1), this._setPlayActions(this._tar, this._stopEvents, "stop", !1)), this._tar = t, this._tar && (this._setPlayActions(this._tar, this._playEvents, "play", !0), this._setPlayActions(this._tar, this._stopEvents, "stop", !0)); }), a(0, i, "stopEvent", null, function(t) { this._stopEvents = t, t && this._tar && this._setPlayActions(this._tar, t, "stop"); }); }(), function(t) { function e() { this._src = null, this._onload = null, this._onerror = null, e.__super.call(this); } s(e, "laya.resource.FileBitmap", pt); var i = e.prototype; return a(0, i, "src", function() { return this._src; }, function(t) { this._src = t; }), a(0, i, "onload", null, function(t) {}), a(0, i, "onerror", null, function(t) {}), e; }()), yt = function(t) { function e(t, i) { this._is2D = !1, e.__super.call(this); var n = this; if (this._source = this, "2D" === t || "AUTO" === t && !k.isWebGL) { this._is2D = !0, this._source = i || B.createElement("canvas"), this._w = this._source.width, this._h = this._source.height; var s = this; s.getContext = function(t, e) { if (n._ctx) return n._ctx; var i = n._ctx = n._source.getContext(t, e); return i && (i._canvas = s, k.isFlash || B.onLimixiu || (i.size = function(t, e) {})), i; }; } this.lock = !0; } s(e, "laya.resource.HTMLCanvas", pt); var i = e.prototype; return i.clear = function() { this._ctx && this._ctx.clear(); }, i.destroy = function() { this._ctx && this._ctx.destroy(), this._ctx = null, laya.resource.Resource.prototype.destroy.call(this); }, i.release = function() {}, i._setContext = function(t) { this._ctx = t; }, i.getContext = function(t, i) { return this._ctx ? this._ctx : this._ctx = e._createContext(this); }, i.getMemSize = function() { return 0; }, i.size = function(t, e) { (this._w != t || this._h != e || this._source && (this._source.width != t || this._source.height != e)) && (this._w = t, this._h = e, this.memorySize = this._w * this._h * 4, this._ctx && this._ctx.size(t, e), this._source && (this._source.height = e, this._source.width = t)); }, i.getCanvas = function() { return this._source; }, i.toBase64 = function(t, e, i) { if (this._source) if (k.isConchApp && this._source.toBase64) this._source.toBase64(t, e, i); else { var n = this._source.toDataURL(t, e); i.call(this, n); } }, a(0, i, "context", function() { return this._ctx; }), a(0, i, "asBitmap", null, function(t) {}), e.create = function(t, i) { return new e(t, i); }, e.TYPE2D = "2D", e.TYPE3D = "3D", e.TYPEAUTO = "AUTO", e._createContext = null, e; }(), xt = (function(t) { function e(t, i, n, s, a, r, o, h) { throw e.__super.call(this), new Error("不允许new!"); } s(e, "laya.resource.HTMLSubImage", pt), e.create = function(t, i, n, s, a, r, o, h) { return void 0 === h && (h = !1), new e(t, i, n, s, a, r, o, h); }; }(), function(t) { function e() { this._frames = null, this._url = null, e.__super.call(this), this._setControlNode(this); } s(e, "laya.display.Animation", t); var n = e.prototype; n.destroy = function(t) { void 0 === t && (t = !0), this.stop(), laya.display.Sprite.prototype.destroy.call(this, t), this._frames = null, this._labels = null; }, n.play = function(t, e, i, n) { void 0 === t && (t = 0), void 0 === e && (e = !0), void 0 === i && (i = ""), void 0 === n && (n = !0), i && this._setFramesFromCache(i, n), this._isPlaying = !0, this.index = "string" == typeof t ? this._getFrameByLabel(t) : t, this.loop = e, this._actionName = i, this._isReverse = 1 == this.wrapMode, this._frames && this.interval > 0 && this.timerLoop(this.interval, this, this._frameLoop, null, !0, !0); }, n._setFramesFromCache = function(t, i) { if (void 0 === i && (i = !1), this._url && (t = this._url + "#" + t), t && e.framesMap[t]) { var n; return (n = e.framesMap[t]) instanceof Array ? (this._frames = e.framesMap[t], this._count = this._frames.length) : (n.nodeRoot && (e.framesMap[t] = this._parseGraphicAnimationByData(n), n = e.framesMap[t]), this._frames = n.frames, this._count = this._frames.length, this._frameRateChanged || (this._interval = n.interval), this._labels = this._copyLabels(n.labels)), !0; } return i && console.log("ani not found:", t), !1; }, n._copyLabels = function(t) { if (!t) return null; var e; e = {}; var i; for (i in t) e[i] = $.copyArray([], t[i]); return e; }, n._frameLoop = function() { this._style.visible && this._style.alpha > .01 && t.prototype._frameLoop.call(this); }, n._displayToIndex = function(t) { this._frames && (this.graphics = this._frames[t]); }, n.clear = function() { this.stop(), this.graphics = null, this._frames = null, this._labels = null; }, n.loadImages = function(t, i) { return void 0 === i && (i = ""), this._url = "", this._setFramesFromCache(i) || (this.frames = e.framesMap[i] ? e.framesMap[i] : e.createFrames(t, i)), this; }, n.loadAtlas = function(t, n, s) { function a(i) { t === i && (r.frames = e.framesMap[s] ? e.framesMap[s] : e.createFrames(t, s), n && n.run()); } void 0 === s && (s = ""), this._url = ""; var r = this; return r._setFramesFromCache(s) || (rt.getAtlas(t) ? a(t) : i.loader.load(t, l.create(null, a, [ t ]), null, "atlas")), this; }, n.loadAnimation = function(t, e, n) { this._url = t; return this._actionName || (this._actionName = ""), this._setFramesFromCache(this._actionName) ? (this._setFramesFromCache(this._actionName, !0), this.index = 0, e && e.run()) : !n || rt.getAtlas(n) ? this._loadAnimationData(t, e, n) : i.loader.load(n, l.create(this, this._loadAnimationData, [ t, e, n ]), null, "atlas"), this; }, n._loadAnimationData = function(t, n, s) { function a(i) { if (rt.getRes(i) && t === i) { var s; if (e.framesMap[t + "#"]) o._setFramesFromCache(r._actionName, !0), r.index = 0, r._checkResumePlaying(); else { var a = o._parseGraphicAnimation(rt.getRes(t)); if (!a) return; var h, l = a.animationList, u = 0, c = l.length; for (u = 0; u < c; u++) s = l[u], e.framesMap[t + "#" + s.name] = s, h || (h = s); h && (e.framesMap[t + "#"] = h, o._setFramesFromCache(r._actionName, !0), r.index = 0), r._checkResumePlaying(); } n && n.run(); } } var r = this; if (!s || rt.getAtlas(s)) { var o = this; rt.getRes(t) ? a(t) : i.loader.load(t, l.create(null, a, [ t ]), null, "json"), rt.clearRes(t); } else console.warn("atlas load fail:" + s); }, n._parseGraphicAnimation = function(t) { return Ct.parseAnimationData(t); }, n._parseGraphicAnimationByData = function(t) { return Ct.parseAnimationByData(t); }, a(0, n, "frames", function() { return this._frames; }, function(t) { this._frames = t, t && (this._count = t.length, this._isPlaying ? this.play(this._index, this.loop, this._actionName) : this.index = this._index); }), a(0, n, "autoPlay", null, function(t) { t ? this.play() : this.stop(); }), a(0, n, "source", null, function(t) { t.indexOf(".ani") > -1 ? this.loadAnimation(t) : t.indexOf(".json") > -1 || t.indexOf("als") > -1 || t.indexOf("atlas") > -1 ? this.loadAtlas(t) : this.loadImages(t.split(",")); }), a(0, n, "autoAnimation", null, function(t) { this.play(0, !0, t, !1); }), e.createFrames = function(t, i) { var n, s, a = 0, o = 0; if ("string" == typeof t) { var h = rt.getAtlas(t); if (h && h.length) for (n = [], a = 0, o = h.length; a < o; a++) (s = new r.createGraphics()).drawTexture(rt.getRes(h[a]), 0, 0), n.push(s); } else if (t instanceof Array) for (n = [], a = 0, o = t.length; a < o; a++) (s = new r.createGraphics()).loadImage(t[a], 0, 0), n.push(s); return i && (e.framesMap[i] = n), n; }, e.clearCache = function(t) { var i, n = e.framesMap, s = t + "#"; for (i in n) i !== t && 0 != i.indexOf(s) || delete e.framesMap[i]; }, e.framesMap = {}; }(ft), function(t) { function e() { this._targetDic = null, this._animationData = null, this._animationNewFrames = null, e.__super.call(this), null == e._sortIndexFun && (e._sortIndexFun = S.sortByKey("index", !1, !0)); } s(e, "laya.display.FrameAnimation", t); var i = e.prototype; return i._setUp = function(t, e) { this._labels = null, this._animationNewFrames = null, this._targetDic = t, this._animationData = e, this.interval = 1e3 / e.frameRate, e.parsed ? (this._count = e.count, this._labels = e.labels, this._animationNewFrames = e.animationNewFrames) : (this._animationNewFrames = [], this._calculateDatas()), e.parsed = !0, e.labels = this._labels, e.count = this._count, e.animationNewFrames = this._animationNewFrames; }, i.clear = function() { t.prototype.clear.call(this), this._targetDic = null, this._animationData = null; }, i._displayToIndex = function(t) { if (this._animationData) { t < 0 && (t = 0), t > this._count && (t = this._count); var e = this._animationData.nodes, i = 0, n = e.length; for (i = 0; i < n; i++) this._displayNodeToFrame(e[i], t); } }, i._displayNodeToFrame = function(t, e, i) { i || (i = this._targetDic); var n = i[t.target]; if (n) { var s, a, r, o = t.frames, h = t.keys, l = 0, u = h.length; for (l = 0; l < u; l++) r = (a = o[s = h[l]]).length > e ? a[e] : a[a.length - 1], n[s] = r; } }, i._calculateDatas = function() { if (this._animationData) { var t, e = this._animationData.nodes, i = 0, n = e.length; for (this._count = 0, i = 0; i < n; i++) t = e[i], this._calculateNodeKeyFrames(t); this._count += 1; } }, i._calculateNodeKeyFrames = function(t) { var i, n, s = t.keyframes, a = t.target; t.frames || (t.frames = {}), t.keys ? t.keys.length = 0 : t.keys = [], t.initValues || (t.initValues = {}); for (i in s) n = s[i], t.frames[i] || (t.frames[i] = []), this._targetDic && this._targetDic[a] && (t.initValues[i] = this._targetDic[a][i]), n.sort(e._sortIndexFun), t.keys.push(i), this._calculateNodePropFrames(n, t.frames[i], i, a); }, i.resetToInitState = function() { if (this._targetDic && this._animationData) { var t, e, i = this._animationData.nodes, n = 0, s = i.length; for (n = 0; n < s; n++) if (t = i[n], e = t.initValues) { var a = this._targetDic[t.target]; if (a) { var r; for (r in e) a[r] = e[r]; } } } }, i._calculateNodePropFrames = function(t, e, i, n) { var s = 0, a = t.length - 1; for (e.length = t[a].index + 1, s = 0; s < a; s++) this._dealKeyFrame(t[s]), this._calculateFrameValues(t[s], t[s + 1], e); 0 == a && (e[t[0].index] = t[0].value, this._animationNewFrames && (this._animationNewFrames[t[0].index] = !0)), this._dealKeyFrame(t[s]); }, i._dealKeyFrame = function(t) { t.label && "" != t.label && this.addLabel(t.label, t.index); }, i._calculateFrameValues = function(t, e, i) { var n, s = 0, a = t.index, r = e.index, o = t.value, h = e.value - t.value, l = r - a; if (r > this._count && (this._count = r), t.tween) for (null == (n = G[t.tweenMethod]) && (n = G.linearNone), s = a; s < r; s++) i[s] = n(s - a, o, h, l), this._animationNewFrames && (this._animationNewFrames[s] = !0); else for (s = a; s < r; s++) i[s] = o; this._animationNewFrames && (this._animationNewFrames[t.index] = !0, this._animationNewFrames[e.index] = !0), i[e.index] = e.value; }, e._sortIndexFun = null, e; }(ft)), bt = function(t) { function e() { this._focus = !1, this._multiline = !1, this._editable = !0, this._restrictPattern = null, this._type = "text", this._prompt = "", this._promptColor = "#A9A9A9", this._originColor = "#000000", this._content = "", e.__super.call(this), this._maxChars = 1e5, this._width = 100, this._height = 20, this.multiline = !1, this.overflow = gt.SCROLL, this.on("mousedown", this, this._onMouseDown), this.on("undisplay", this, this._onUnDisplay); } s(e, "laya.display.Input", t); var r = e.prototype; return r.setSelection = function(t, e) { this.focus = !0, laya.display.Input.inputElement.selectionStart = t, laya.display.Input.inputElement.selectionEnd = e; }, r._onUnDisplay = function(t) { this.focus = !1; }, r._onMouseDown = function(t) { this.focus = !0; }, r._syncInputTransform = function() { var t = this.nativeInput, n = $.getTransformRelativeToWindow(this, this.padding[3], this.padding[0]), s = this._width - this.padding[1] - this.padding[3], a = this._height - this.padding[0] - this.padding[2]; k.isConchApp ? (t.setScale(n.scaleX, n.scaleY), t.setSize(s, a), t.setPos(n.x, n.y)) : (e.inputContainer.style.transform = e.inputContainer.style.webkitTransform = "scale(" + n.scaleX + "," + n.scaleY + ") rotate(" + i.stage.canvasDegree + "deg)", t.style.width = s + "px", t.style.height = a + "px", e.inputContainer.style.left = n.x + "px", e.inputContainer.style.top = n.y + "px"); }, r.select = function() { this.nativeInput.select(); }, r._setInputMethod = function() { e.input.parentElement && e.inputContainer.removeChild(e.input), e.area.parentElement && e.inputContainer.removeChild(e.area), e.inputElement = this._multiline ? e.area : e.input, e.inputContainer.appendChild(e.inputElement), gt.RightToLeft && (e.inputElement.style.direction = "rtl"); }, r._focusIn = function() { laya.display.Input.isInputting = !0; var t = this.nativeInput; this._focus = !0; var e = t.style; e.whiteSpace = this.wordWrap ? "pre-wrap" : "nowrap", this._setPromptColor(), t.readOnly = !this._editable, k.isConchApp && (t.setType(this._type), t.setForbidEdit(!this._editable)), t.maxLength = this._maxChars; this.padding; if (t.type = this._type, t.value = this._content, t.placeholder = this._prompt, i.stage.off("keydown", this, this._onKeyDown), i.stage.on("keydown", this, this._onKeyDown), i.stage.focus = this, this.event("focus"), B.onPC && t.focus(), !(B.onMiniGame || B.onBDMiniGame || B.onTTMiniGame || B.onQGMiniGame || B.onVVMiniGame || B.onBLMiniGame || B.onQQMiniGame)) { this._text; this._text = null; } this.typeset(), t.setColor(this._originColor), t.setBgColor && t.setBgColor(this.bgColor), t.setFontSize(this.fontSize), t.setFontFace(B.onIPhone ? gt._fontFamilyMap[this.font] || this.font : this.font), k.isConchApp && t.setMultiAble && t.setMultiAble(this._multiline), e.lineHeight = this.leading + this.fontSize + "px", e.fontStyle = this.italic ? "italic" : "normal", e.fontWeight = this.bold ? "bold" : "normal", e.textAlign = this.align, e.padding = "0 0", this._syncInputTransform(), !k.isConchApp && B.onPC && i.timer.frameLoop(1, this, this._syncInputTransform); }, r._setPromptColor = function() { (e.promptStyleDOM = B.getElementById("promptStyle")) || ((e.promptStyleDOM = B.createElement("style")).setAttribute("id", "promptStyle"), B.document.head.appendChild(e.promptStyleDOM)), e.promptStyleDOM.innerText = "input::-webkit-input-placeholder, textarea::-webkit-input-placeholder {color:" + this._promptColor + "}input:-moz-placeholder, textarea:-moz-placeholder {color:" + this._promptColor + "}input::-moz-placeholder, textarea::-moz-placeholder {color:" + this._promptColor + "}input:-ms-input-placeholder, textarea:-ms-input-placeholder {color:" + this._promptColor + "}"; }, r._focusOut = function() { laya.display.Input.isInputting = !1, this._focus = !1, this._text = null, this._content = this.nativeInput.value, this._content ? (i.superSet(gt, this, "text", this._content), i.superSet(gt, this, "color", this._originColor)) : (i.superSet(gt, this, "text", this._prompt), i.superSet(gt, this, "color", this._promptColor)), i.stage.off("keydown", this, this._onKeyDown), i.stage.focus = null, this.event("blur"), k.isConchApp && this.nativeInput.blur(), B.onPC && i.timer.clear(this, this._syncInputTransform); }, r._onKeyDown = function(t) { 13 === t.keyCode && (B.onMobile && !this._multiline && (this.focus = !1), this.event("enter")); }, r.changeText = function(e) { this._content = e, this._focus ? (this.nativeInput.value = e || "", this.event("change")) : t.prototype.changeText.call(this, e); }, a(0, r, "color", t.prototype._$get_color, function(t) { this._focus && this.nativeInput.setColor(t), i.superSet(gt, this, "color", this._content ? t : this._promptColor), this._originColor = t; }), a(0, r, "inputElementYAdjuster", function() { return console.warn("deprecated: 由于即使设置了该值,在各平台和浏览器之间也不一定一致,inputElementYAdjuster已弃用。"), 0; }, function(t) { console.warn("deprecated: 由于即使设置了该值,在各平台和浏览器之间也不一定一致,inputElementYAdjuster已弃用。"); }), a(0, r, "multiline", function() { return this._multiline; }, function(t) { this._multiline = t, this.valign = t ? "top" : "middle"; }), a(0, r, "maxChars", function() { return this._maxChars; }, function(t) { t <= 0 && (t = 1e5), this._maxChars = t; }), a(0, r, "text", function() { return this._focus ? this.nativeInput.value : this._content || ""; }, function(t) { i.superSet(gt, this, "color", this._originColor), t += "", this._focus ? (this.nativeInput.value = t || "", this.event("change")) : (this._multiline || (t = t.replace(/\r?\n/g, "")), this._content = t, t ? i.superSet(gt, this, "text", t) : (i.superSet(gt, this, "text", this._prompt), i.superSet(gt, this, "color", this.promptColor))); }), a(0, r, "nativeInput", function() { return this._multiline ? e.area : e.input; }), a(0, r, "prompt", function() { return this._prompt; }, function(t) { !this._text && t && i.superSet(gt, this, "color", this._promptColor), this.promptColor = this._promptColor, this._text ? i.superSet(gt, this, "text", this._text == this._prompt ? t : this._text) : i.superSet(gt, this, "text", t), this._prompt = gt.langPacks && gt.langPacks[t] ? gt.langPacks[t] : t; }), a(0, r, "focus", function() { return this._focus; }, function(t) { var i = this.nativeInput; this._focus !== t && (t ? (i.target ? i.target._focusOut() : this._setInputMethod(), i.target = this, this._focusIn()) : (i.target = null, this._focusOut(), B.document.body.scrollTop = 0, i.blur(), k.isConchApp ? i.setPos(-1e4, -1e4) : e.inputContainer.contains(i) && e.inputContainer.removeChild(i))); }), a(0, r, "restrict", function() { return this._restrictPattern ? this._restrictPattern.source : ""; }, function(t) { t ? ((t = "[^" + t + "]").indexOf("^^") > -1 && (t = t.replace("^^", "")), this._restrictPattern = new RegExp(t, "g")) : this._restrictPattern = null; }), a(0, r, "editable", function() { return this._editable; }, function(t) { this._editable = t, k.isConchApp && e.input.setForbidEdit(!t); }), a(0, r, "promptColor", function() { return this._promptColor; }, function(t) { this._promptColor = t, this._content || i.superSet(gt, this, "color", t); }), a(0, r, "type", function() { return this._type; }, function(t) { this._getCSSStyle().password = "password" == t, this._type = t, k.isConchApp && this.nativeInput.setType(t); }), a(0, r, "inputElementXAdjuster", function() { return console.warn("deprecated: 由于即使设置了该值,在各平台和浏览器之间也不一定一致,inputElementXAdjuster已弃用。"), 0; }, function(t) { console.warn("deprecated: 由于即使设置了该值,在各平台和浏览器之间也不一定一致,inputElementXAdjuster已弃用。"); }), a(0, r, "asPassword", function() { return this._getCSSStyle().password; }, function(t) { this._getCSSStyle().password = t, this._type = "password", console.warn('deprecated: 使用type="password"替代设置asPassword, asPassword将在下次重大更新时删去'), this.isChanged = !0; }), e.__init__ = function() { if (e._createInputElement(), B.onMobile) { var t = !1; (B.onMiniGame || B.onBDMiniGame || B.onKGMiniGame || B.onTTMiniGame || B.onQGMiniGame || B.onVVMiniGame || B.onBLMiniGame || B.onQQMiniGame) && (t = !0), k.canvas.addEventListener(e.IOS_IFRAME ? t ? "touchend" : "click" : "touchend", e._popupInputMethod); } }, e._popupInputMethod = function(t) { if (laya.display.Input.isInputting) { laya.display.Input.inputElement.focus(); } }, e._createInputElement = function() { e._initInput(e.area = B.createElement("textarea")), e._initInput(e.input = B.createElement("input")), (e.inputContainer = B.createElement("div")).style.position = "absolute", e.inputContainer.style.zIndex = 1e5, B.container.appendChild(e.inputContainer), e.inputContainer.setPos = function(t, i) { e.inputContainer.style.left = t + "px", e.inputContainer.style.top = i + "px"; }; }, e._initInput = function(t) { var i = t.style; i.cssText = "position:absolute;overflow:hidden;resize:none;transform-origin:0 0;-webkit-transform-origin:0 0;-moz-transform-origin:0 0;-o-transform-origin:0 0;", i.resize = "none", i.backgroundColor = "transparent", i.border = "none", i.outline = "none", i.zIndex = 1, t.addEventListener("input", e._processInputting), t.addEventListener("mousemove", e._stopEvent), t.addEventListener("mousedown", e._stopEvent), t.addEventListener("touchmove", e._stopEvent), t.setFontFace = function(e) { t.style.fontFamily = e; }, k.isConchApp || (t.setColor = function(e) { t.style.color = e; }, t.setFontSize = function(e) { t.style.fontSize = e + "px"; }); }, e._processInputting = function(t) { var e = laya.display.Input.inputElement.target; if (e) { var i = laya.display.Input.inputElement.value; e._restrictPattern && (i = i.replace(/\u2006|\x27/g, ""), e._restrictPattern.test(i) && (i = i.replace(e._restrictPattern, ""), laya.display.Input.inputElement.value = i)), e._text = i, e.event("input"); } }, e._stopEvent = function(t) { "touchmove" == t.type && t.preventDefault(), t.stopPropagation && t.stopPropagation(); }, e.TYPE_TEXT = "text", e.TYPE_PASSWORD = "password", e.TYPE_EMAIL = "email", e.TYPE_URL = "url", e.TYPE_NUMBER = "number", e.TYPE_RANGE = "range", e.TYPE_DATE = "date", e.TYPE_MONTH = "month", e.TYPE_WEEK = "week", e.TYPE_TIME = "time", e.TYPE_DATE_TIME = "datetime", e.TYPE_DATE_TIME_LOCAL = "datetime-local", e.TYPE_SEARCH = "search", e.input = null, e.area = null, e.inputElement = null, e.inputContainer = null, e.confirmButton = null, e.promptStyleDOM = null, e.inputHeight = 45, e.isInputting = !1, e.stageMatrix = null, n(e, [ "IOS_IFRAME", function() { return this.IOS_IFRAME = B.onIOS && B.window.top != B.window.self; } ]), e; }(gt), wt = function(t) { function e(t, i) { this._recreateLock = !1, this._needReleaseAgain = !1, this._enableMerageInAtlas = !0, e.__super.call(this), this._init_(t, i); } s(e, "laya.resource.HTMLImage", vt); var i = e.prototype; return i._init_ = function(t, e) { this._src = t, this._source = new B.window.Image(), e && (e.onload && (this.onload = e.onload), e.onerror && (this.onerror = e.onerror), e.onCreate && e.onCreate(this)), 0 != t.indexOf("data:image") && (this._source.crossOrigin = ""), t && (this._source.src = t); }, i.recreateResource = function() { var t = this; if ("" === this._src) throw new Error("src no null!"); if (this._needReleaseAgain = !1, this._source) { if (this._recreateLock) return; this.memorySize = this._w * this._h * 4, this._recreateLock = !1, this.completeCreate(); } else { this._recreateLock = !0; var e = this; this._source = new B.window.Image(), this._source.crossOrigin = "", this._source.onload = function() { if (e._needReleaseAgain) return e._needReleaseAgain = !1, e._source.onload = null, void (e._source = null); e._source.onload = null, e.memorySize = t._w * t._h * 4, e._recreateLock = !1, e.completeCreate(); }, this._source.src = this._src; } }, i.disposeResource = function() { this._recreateLock && (this._needReleaseAgain = !0), this._source && (this._source = null, this.memorySize = 0); }, i.onresize = function() { this._w = this._source.width, this._h = this._source.height; }, a(0, i, "onload", null, function(t) { var e = this; this._onload = t, this._source && (this._source.onload = null != this._onload ? function() { e.onresize(), e._onload(); } : null); }), a(0, i, "onerror", null, function(t) { var e = this; this._onerror = t, this._source && (this._source.onerror = null != this._onerror ? function() { e._onerror(); } : null); }), a(0, i, "enableMerageInAtlas", function() { return this._enableMerageInAtlas; }, function(t) { this._enableMerageInAtlas = t, k.isConchApp && this._source && (this._source.enableMerageInAtlas = t); }), e.create = function(t, i) { return new e(t, i); }, e; }(), Ct = (function(t) { function e() { this._target = null, this._playEvents = null, this._initData = {}, this._aniKeys = null, this._effectClass = null, e.__super.call(this); } s(e, "laya.display.EffectAnimation", t); var i = e.prototype; i._onOtherBegin = function(t) { t != this && this.stop(); }, i.addEvent = function() { this._target && this._playEvents && (this._setControlNode(this._target), this._target.on(this._playEvents, this, this._onPlayAction)); }, i._onPlayAction = function() { this.play(0, !1); }, i.play = function(t, e, i, n) { void 0 === t && (t = 0), void 0 === e && (e = !0), void 0 === i && (i = ""), void 0 === n && (n = !0), this._target && (this._target.event("effectanimationbegin", [ this ]), this._recordInitData(), laya.display.AnimationPlayerBase.prototype.play.call(this, t, e, i, n)); }, i._recordInitData = function() { if (this._aniKeys) { var t = 0, e = 0; e = this._aniKeys.length; var i; for (t = 0; t < e; t++) i = this._aniKeys[t], this._initData[i] = this._target[i]; } }, i._displayToIndex = function(t) { if (this._animationData) { t < 0 && (t = 0), t > this._count && (t = this._count); var e = this._animationData.nodes, i = 0, n = e.length; for (n = n > 1 ? 1 : n, i = 0; i < n; i++) this._displayNodeToFrame(e[i], t); } }, i._displayNodeToFrame = function(t, e, i) { if (this._target) { var n; n = this._target; var s, a, r, o, h = t.frames, l = t.keys, u = 0, c = l.length; o = t.secondFrames; var _, d, p, f, g = 0; for (u = 0; u < c; u++) a = h[s = l[u]], -1 == (g = o[s]) ? r = this._initData[s] : e < g ? (p = (d = t.keyframes[s])[0]).tween ? (null == (_ = G[p.tweenMethod]) && (_ = G.linearNone), f = d[1], r = _(e, this._initData[s], f.value - this._initData[s], f.index)) : r = this._initData[s] : r = a.length > e ? a[e] : a[a.length - 1], n[s] = r; } }, i._calculateNodeKeyFrames = function(e) { t.prototype._calculateNodeKeyFrames.call(this, e); var i, n, s, a = e.keyframes; e.target; s = {}, e.secondFrames = s; for (i in a) (n = a[i]).length <= 1 ? s[i] = -1 : s[i] = n[1].index; }, a(0, i, "target", function() { return this._target; }, function(t) { this._target && this._target.off("effectanimationbegin", this, this._onOtherBegin), this._target = t, this._target && this._target.on("effectanimationbegin", this, this._onOtherBegin), this.addEvent(); }), a(0, i, "playEvent", null, function(t) { this._playEvents = t, t && this.addEvent(); }), a(0, i, "effectData", null, function(t) { if (t) { var e; (e = t.animations) && e[0] && (this._setUp({}, e[0]), e[0].nodes && e[0].nodes[0] && (this._aniKeys = e[0].nodes[0].keys)); } }), a(0, i, "effectClass", null, function(t) { if (this._effectClass = U.getClass(t), this._effectClass) { var e; if (e = this._effectClass.uiView) { var i; (i = e.animations) && i[0] && (this._setUp({}, i[0]), i[0].nodes && i[0].nodes[0] && (this._aniKeys = i[0].nodes[0].keys)); } } }), e.EffectAnimationBegin = "effectanimationbegin"; }(xt), function(t) { function e() { this.animationList = null, this.animationDic = null, this._nodeList = null, this._nodeDefaultProps = null, this._gList = null, this._nodeIDAniDic = {}, this._rootNode = null, this._nodeGDic = null, e.__super.call(this); } var i; s(e, "laya.utils.GraphicAnimation", t); var a = e.prototype; return a._parseNodeList = function(t) { this._nodeList || (this._nodeList = []), this._nodeDefaultProps[t.compId] = t.props, t.compId && this._nodeList.push(t.compId); var e = t.child; if (e) { var i = 0, n = e.length; for (i = 0; i < n; i++) this._parseNodeList(e[i]); } }, a._calGraphicData = function(t) { if (this._setUp(null, t), this._createGraphicData(), this._nodeIDAniDic) { var e; for (e in this._nodeIDAniDic) this._nodeIDAniDic[e] = null; } }, a._createGraphicData = function() { var t = [], e = 0, i = this.count, n = this._animationNewFrames; n || (n = []); var s; for (e = 0; e < i; e++) !n[e] && s || (s = this._createFrameGraphic(e)), t.push(s); this._gList = t; }, a._createFrameGraphic = function(t) { var i = r.createGraphics(); return e._rootMatrix || (e._rootMatrix = new T()), this._updateNodeGraphic(this._rootNode, t, e._rootMatrix, i), i; }, a._updateNodeGraphic = function(t, e, i, n, s) { void 0 === s && (s = 1); var a, r = (a = this._nodeGDic[t.compId] = this._getNodeGraphicData(t.compId, e, this._nodeGDic[t.compId])).alpha * s; if (!(r < .01)) { a.resultTransform || (a.resultTransform = T.create()); var o; o = a.resultTransform, T.mul(a.transform, i, o); var h; a.skin && (h = this._getTextureByUrl(a.skin)) && (o._checkTransform() ? (n.drawTexture(h, 0, 0, a.width, a.height, o, r), a.resultTransform = null) : n.drawTexture(h, o.tx, o.ty, a.width, a.height, null, r)); var l; if (l = t.child) { var u = 0, c = 0; for (c = l.length, u = 0; u < c; u++) this._updateNodeGraphic(l[u], e, o, n, r); } } }, a._updateNoChilds = function(t, e) { if (t.skin) { var i = this._getTextureByUrl(t.skin); if (i) { var n = t.transform; n._checkTransform(); !n.bTransform ? e.drawTexture(i, n.tx, n.ty, t.width, t.height, null, t.alpha) : e.drawTexture(i, 0, 0, t.width, t.height, n.clone(), t.alpha); } } }, a._updateNodeGraphic2 = function(t, e, i) { var n; if (n = this._nodeGDic[t.compId] = this._getNodeGraphicData(t.compId, e, this._nodeGDic[t.compId]), t.child) { var s = n.transform; s._checkTransform(); var a = !1, r = !1; r = (a = !s.bTransform) && (0 != s.tx || 0 != s.ty); var o = !1; (o = s.bTransform || 1 != n.alpha) && i.save(), 1 != n.alpha && i.alpha(n.alpha), a ? r && i.translate(s.tx, s.ty) : i.transform(s.clone()); var h; h = t.child; var l; if (n.skin && (l = this._getTextureByUrl(n.skin)) && i.drawTexture(l, 0, 0, n.width, n.height), h) { var u = 0, c = 0; for (c = h.length, u = 0; u < c; u++) this._updateNodeGraphic2(h[u], e, i); } o ? i.restore() : a ? r && i.translate(-s.tx, -s.ty) : i.transform(s.clone().invert()); } else this._updateNoChilds(n, i); }, a._calculateNodeKeyFrames = function(e) { t.prototype._calculateNodeKeyFrames.call(this, e), this._nodeIDAniDic[e.target] = e; }, a.getNodeDataByID = function(t) { return this._nodeIDAniDic[t]; }, a._getParams = function(t, i, n, s) { var a = e._temParam; a.length = i.length; var r = 0, o = i.length; for (r = 0; r < o; r++) a[r] = this._getObjVar(t, i[r][0], n, i[r][1], s); return a; }, a._getObjVar = function(t, e, i, n, s) { if (t.hasOwnProperty(e)) { var a = t[e]; if (i >= a.length && (i = a.length - 1), void 0 != t[e][i]) return t[e][i]; } return s.hasOwnProperty(e) ? s[e] : n; }, a._getNodeGraphicData = function(t, n, s) { s || (s = i.create()), s.transform ? s.transform.identity() : s.transform = T.create(); var a = this.getNodeDataByID(t); if (!a) return s; var r = a.frames, o = this._getParams(r, e._drawTextureCmd, n, this._nodeDefaultProps[t]), h = o[0], l = NaN, u = NaN, c = o[5], _ = o[6], d = o[13], p = o[14], f = o[7], g = o[8], m = o[9], v = o[11], y = o[12]; l = o[3], u = o[4], 0 != l && 0 != u || (h = null), -1 == l && (l = 0), -1 == u && (u = 0); var x; s.skin = h, s.width = l, s.height = u, h && ((x = this._getTextureByUrl(h)) ? (l || (l = x.sourceWidth), u || (u = x.sourceHeight)) : console.warn("lost skin:", h, ",you may load pics first")), s.alpha = o[10]; var b; b = s.transform, 0 != d && (c = d * l), 0 != p && (_ = p * u), 0 == c && 0 == _ || b.translate(-c, -_); var w = null; if (m || 1 !== f || 1 !== g || v || y) { (w = e._tempMt).identity(), w.bTransform = !0; var C = .0174532922222222 * (m - v), S = .0174532922222222 * (m + y), I = Math.cos(S), M = Math.sin(S), E = Math.sin(C), A = Math.cos(C); w.a = f * I, w.b = f * M, w.c = -g * E, w.d = g * A, w.tx = w.ty = 0; } return w && (b = T.mul(b, w, b)), b.translate(o[1], o[2]), s; }, a._getTextureByUrl = function(t) { return rt.getRes(t); }, a.setAniData = function(t, i) { if (t.animations) { this._nodeDefaultProps = {}, this._nodeGDic = {}, this._nodeList && (this._nodeList.length = 0), this._rootNode = t, this._parseNodeList(t); var n, s = {}, a = [], r = t.animations, o = 0, h = r.length; for (o = 0; o < h; o++) if (n = r[o], this._labels = null, (!i || i == n.name) && n) { try { this._calGraphicData(n); } catch (t) { console.warn("parse animation fail:" + n.name + ",empty animation created"), this._gList = []; } var l = {}; l.interval = 1e3 / n.frameRate, l.frames = this._gList, l.labels = this._labels, l.name = n.name, a.push(l), s[n.name] = l; } this.animationList = a, this.animationDic = s; } e._temParam.length = 0; }, a.parseByData = function(t) { var e, i; e = t.nodeRoot, i = t.aniO, delete t.nodeRoot, delete t.aniO, this._nodeDefaultProps = {}, this._nodeGDic = {}, this._nodeList && (this._nodeList.length = 0), this._rootNode = e, this._parseNodeList(e), this._labels = null; try { this._calGraphicData(i); } catch (t) { console.warn("parse animation fail:" + i.name + ",empty animation created"), this._gList = []; } var n = t; return n.interval = 1e3 / i.frameRate, n.frames = this._gList, n.labels = this._labels, n.name = i.name, n; }, a.setUpAniData = function(t) { if (t.animations) { var e, i = {}, n = [], s = t.animations, a = 0, r = s.length; for (a = 0; a < r; a++) if (e = s[a]) { var o = {}; o.name = e.name, o.aniO = e, o.nodeRoot = t, n.push(o), i[e.name] = o; } this.animationList = n, this.animationDic = i; } }, a._clear = function() { if (this.animationList = null, this.animationDic = null, this._gList = null, this._nodeGDic) { var t, e; for (t in this._nodeGDic) (e = this._nodeGDic[t]) && e.recover(); } this._nodeGDic = null; }, e.parseAnimationByData = function(t) { e._I || (e._I = new e()); var i; return i = e._I.parseByData(t), e._I._clear(), i; }, e.parseAnimationData = function(t) { e._I || (e._I = new e()), e._I.setUpAniData(t); var i; return i = {}, i.animationList = e._I.animationList, i.animationDic = e._I.animationDic, e._I._clear(), i; }, e._drawTextureCmd = [ [ "skin", null ], [ "x", 0 ], [ "y", 0 ], [ "width", -1 ], [ "height", -1 ], [ "pivotX", 0 ], [ "pivotY", 0 ], [ "scaleX", 1 ], [ "scaleY", 1 ], [ "rotation", 0 ], [ "alpha", 1 ], [ "skewX", 0 ], [ "skewY", 0 ], [ "anchorX", 0 ], [ "anchorY", 0 ] ], e._temParam = [], e._I = null, e._rootMatrix = null, n(e, [ "_tempMt", function() { return this._tempMt = new T(); } ]), e.__init$ = function() { i = function() { function t() { this.skin = null, this.transform = null, this.resultTransform = null, this.width = NaN, this.height = NaN, this.alpha = 1; } s(t, ""); return t.prototype.recover = function() { this.skin = null, this.width = 0, this.height = 0, this.alpha = 1, this.transform && (this.transform.destroy(), this.transform = null), this.resultTransform && (this.resultTransform.destroy(), this.resultTransform = null), Y.recover("GraphicNode", this); }, t.create = function() { return Y.getItemByClass("GraphicNode", t); }, t; }(); }, e; }(xt)); i.__init([ ot, h, Ct, k, B, j, A, ut ]); }(window, document, Laya), function(t, e, i) { i.un, i.uns, i.static; var n = i.class; i.getset, i.__newvec; new (function() { function t() {} return n(t, "LayaMain"), t; }())(); }(window, document, Laya), "function" == typeof define && define.amd && define("laya.core", [ "require", "exports" ], function(t, e) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }); for (var i in Laya) { var n = Laya[i]; n && n.__isclass && (e[i] = n); } }), function(t, e, i) { i.un, i.uns; var n = i.static, s = i.class, a = i.getset, r = (i.__newvec, laya.utils.Browser), o = (laya.events.Event, laya.events.EventDispatcher), h = laya.resource.HTMLImage, l = laya.utils.Handler, u = laya.display.Input, c = laya.net.Loader, _ = laya.net.LocalStorage, d = (laya.maths.Matrix, laya.renders.Render), p = laya.utils.RunDriver, f = (laya.media.Sound, laya.media.SoundChannel), g = laya.media.SoundManager, m = laya.net.URL, v = laya.utils.Utils, y = function() { function e() {} return s(e, "laya.wx.mini.MiniAdpter"), e.getJson = function(t) { return JSON.parse(t); }, e.init = function(n, s) { if (void 0 === n && (n = !1), void 0 === s && (s = !1), !e._inited && (e._inited = !0, (e.window = t).hasOwnProperty("wx") && !(e.window.navigator.userAgent.indexOf("MiniGame") < 0))) { e.isZiYu = s, e.isPosMsgYu = n, e.EnvConfig = {}; try { laya.webgl.resource.WebGLCanvas.premulAlpha = !0; } catch (t) {} if (e.isZiYu || (x.setNativeFileDir("/layaairGame"), x.existDir(x.fileNativeDir, l.create(e, e.onMkdirCallBack))), "ios 10.1.1" === (e.systemInfo = e.window.wx.getSystemInfoSync()).system.toLowerCase()) try { laya.webgl.resource.WebGLCharImage.canUseCanvas = !1; } catch (t) {} e.window.focus = function() {}, i._getUrlPath = function() {}, i.getUrlPath = function() {}, e.window.logtime = function(t) {}, e.window.alertTimeLog = function(t) {}, e.window.resetShareInfo = function() {}, e.window.CanvasRenderingContext2D = function() {}, e.window.CanvasRenderingContext2D.prototype = e.window.wx.createCanvas().getContext("2d").__proto__, e.window.document.body.appendChild = function() {}, e.EnvConfig.pixelRatioInt = 0, p.getPixelRatio = e.pixelRatio, e._preCreateElement = r.createElement, r.createElement = e.createElement, p.createShaderCondition = e.createShaderCondition, v.parseXMLFromString = e.parseXMLFromString, u._createInputElement = w._createInputElement, e.EnvConfig.load = c.prototype.load, c.prototype.load = S.prototype.load, c.prototype._loadImage = b.prototype._loadImage, _._baseClass = C, C.__init__(), e.onReciveData(); } }, e.onReciveData = function() { laya.wx.mini.MiniAdpter.isZiYu && e.window.wx.onMessage(function(t) { "opendatacontext" == t.isLoad ? t.url && (x.ziyuFileData[t.url] = t.atlasdata, x.ziyuFileTextureData[t.imgReadyUrl] = t.imgNativeUrl) : "openJsondatacontext" == t.isLoad ? t.url && (x.ziyuFileData[t.url] = t.atlasdata) : "openJsondatacontextPic" == t.isLoad && (x.ziyuFileTextureData[t.imgReadyUrl] = t.imgNativeUrl); }); }, e.measureText = function(t) { var i = e._measureText(t); return i || (i = { width: 16 }, console.warn("-------微信获取文字宽度失败----等待修复---------")), i; }, e.getUrlEncode = function(t, e) { return "arraybuffer" == e ? "" : "utf8"; }, e.downLoadFile = function(t, e, i, n) { void 0 === e && (e = ""), void 0 === n && (n = "utf8"); x.getFileInfo(t) ? null != i && i.runWith([ 0 ]) : x.downLoadFile(t, e, i, n); }, e.remove = function(t, e) { x.deleteFile("", t, e, "", 0); }, e.removeAll = function() { x.deleteAll(); }, e.hasNativeFile = function(t) { return x.isLocalNativeFile(t); }, e.getFileInfo = function(t) { return x.getFileInfo(t); }, e.getFileList = function() { return x.filesListObj; }, e.exitMiniProgram = function() { e.window.wx.exitMiniProgram(); }, e.onMkdirCallBack = function(t, e) { t || (x.filesListObj = JSON.parse(e.data), x.fakeObj = x.filesListObj); }, e.pixelRatio = function() { if (!e.EnvConfig.pixelRatioInt) try { return e.EnvConfig.pixelRatioInt = e.systemInfo.pixelRatio, e.systemInfo.pixelRatio; } catch (t) {} return e.EnvConfig.pixelRatioInt; }, e.createElement = function(t) { if ("canvas" == t) { var i; return 1 == e.idx ? e.isZiYu ? (i = e.window.sharedCanvas).style = {} : i = e.window.canvas : i = e.window.wx.createCanvas(), e.idx++, i; } if ("textarea" == t || "input" == t) return e.onCreateInput(t); if ("div" == t) { var n = e._preCreateElement(t); return n.contains = function(t) { return null; }, n.removeChild = function(t) {}, n; } return e._preCreateElement(t); }, e.onCreateInput = function(t) { var i = e._preCreateElement(t); return i.focus = w.wxinputFocus, i.blur = w.wxinputblur, i.style = {}, i.value = 0, i.parentElement = {}, i.placeholder = {}, i.type = {}, i.setColor = function(t) {}, i.setType = function(t) {}, i.setFontFace = function(t) {}, i.addEventListener = function(t) {}, i.contains = function(t) { return null; }, i.removeChild = function(t) {}, i; }, e.createShaderCondition = function(t) { var e = this; return function() { return e[t.replace("this.", "")]; }; }, e.sendAtlasToOpenDataContext = function(t) { if (!laya.wx.mini.MiniAdpter.isZiYu) { var i = c.getRes(m.formatURL(t)); if (!i) throw "传递的url没有获取到对应的图集数据信息,请确保图集已经过!"; i.meta.image.split(","); if (i.meta && i.meta.image) for (var n = i.meta.image.split(","), s = t.indexOf("/") >= 0 ? "/" : "\\", a = t.lastIndexOf(s), r = a >= 0 ? t.substr(0, a + 1) : "", o = 0, h = n.length; o < h; o++) n[o] = r + n[o]; else n = [ t.replace(".json", ".png") ]; for (o = 0; o < n.length; o++) { var l = n[o]; e.postInfoToContext(t, l, i); } } }, e.postInfoToContext = function(t, i, n) { var s = { frames: n.frames, meta: n.meta }, a = i, r = x.getFileInfo(m.formatURL(i)); if (r) var o = r.md5, h = x.getFileNativePath(o); else h = a; if (!h) throw "获取图集的磁盘url路径不存在!"; e.window.wx.postMessage({ url: t, atlasdata: s, imgNativeUrl: h, imgReadyUrl: a, isLoad: "opendatacontext" }); }, e.sendSinglePicToOpenDataContext = function(t) { var i = m.formatURL(t), n = x.getFileInfo(i); if (n) { var s = n.md5, a = x.getFileNativePath(s); t = i; } else a = t; if (!a) throw "获取图集的磁盘url路径不存在!"; e.window.wx.postMessage({ url: t, imgNativeUrl: a, imgReadyUrl: t, isLoad: "openJsondatacontextPic" }); }, e.sendJsonDataToDataContext = function(t) { if (!laya.wx.mini.MiniAdpter.isZiYu) { var i = c.getRes(t); if (!i) throw "传递的url没有获取到对应的图集数据信息,请确保图集已经过!"; e.window.wx.postMessage({ url: t, atlasdata: i, isLoad: "openJsondatacontext" }); } }, e.EnvConfig = null, e.window = null, e._preCreateElement = null, e._inited = !1, e.systemInfo = null, e.isZiYu = !1, e.isPosMsgYu = !1, e.autoCacheFile = !0, e.minClearSize = 5242880, e.subNativeFiles = null, e.subNativeheads = [], e.subMaps = [], e.AutoCacheDownFile = !1, e._measureText = null, e.parseXMLFromString = function(e) { var i; e = e.replace(/>\s+<"); try { i = new t.Parser.DOMParser().parseFromString(e, "text/xml"); } catch (t) { throw "需要引入xml解析库文件"; } return i; }, e.idx = 1, n(e, [ "nativefiles", function() { return this.nativefiles = [ "layaNativeDir", "wxlocal" ]; } ]), e; }(), x = function() { function t() {} return s(t, "laya.wx.mini.MiniFileMgr"), t.isLocalNativeFile = function(t) { for (var e = 0, i = y.nativefiles.length; e < i; e++) if (-1 != t.indexOf(y.nativefiles[e])) return !0; return !1; }, t.getFileInfo = function(e) { var i = t.fakeObj[e]; return null == i ? null : i; }, t.read = function(e, i, n, s, a, r) { void 0 === i && (i = "utf8"), void 0 === s && (s = ""), void 0 === a && (a = !1), void 0 === r && (r = ""); var o; o = "" == s || -1 == s.indexOf("http://") && -1 == s.indexOf("https://") ? e : t.getFileNativePath(e), t.fs.readFile({ filePath: o, encoding: i, success: function(t) { null != n && n.runWith([ 0, t ]); }, fail: function(e) { e && "" != s ? t.downFiles(s, i, n, s, a, r) : null != n && n.runWith([ 1 ]); } }); }, t.downFiles = function(e, i, n, s, a, r, o) { void 0 === i && (i = "ascii"), void 0 === s && (s = ""), void 0 === a && (a = !1), void 0 === r && (r = ""), void 0 === o && (o = !0); t.wxdown({ url: e, success: function(h) { 200 === h.statusCode ? t.readFile(h.tempFilePath, i, n, s, a, r, o) : 403 === h.statusCode ? null != n && n.runWith([ 0, e ]) : null != n && n.runWith([ 1, h ]); }, fail: function(t) { null != n && n.runWith([ 1, t ]); } }).onProgressUpdate(function(t) { null != n && n.runWith([ 2, t.progress ]); }); }, t.readFile = function(e, i, n, s, a, r, o) { void 0 === i && (i = "utf8"), void 0 === s && (s = ""), void 0 === a && (a = !1), void 0 === r && (r = ""), void 0 === o && (o = !0), t.fs.readFile({ filePath: e, encoding: i, success: function(r) { (-1 != e.indexOf("http://") || -1 != e.indexOf("https://")) && (y.autoCacheFile || a) ? (null != n && n.runWith([ 0, r ]), t.copyFile(e, s, null, i, o)) : null != n && n.runWith([ 0, r ]); }, fail: function(t) { t && null != n && n.runWith([ 1, t ]); } }); }, t.downOtherFiles = function(e, i, n, s, a) { void 0 === n && (n = ""), void 0 === s && (s = !1), void 0 === a && (a = !0), t.wxdown({ url: e, success: function(e) { 200 === e.statusCode ? (y.autoCacheFile || s) && -1 == n.indexOf("wx.qlogo.cn") && -1 == n.indexOf(".php") ? (null != i && i.runWith([ 0, e.tempFilePath ]), t.copyFile(e.tempFilePath, n, null, "", a)) : null != i && i.runWith([ 0, e.tempFilePath ]) : null != i && i.runWith([ 1, e ]); }, fail: function(t) { null != i && i.runWith([ 1, t ]); } }); }, t.downLoadFile = function(e, n, s, a) { void 0 === n && (n = ""), void 0 === a && (a = "ascii"), y.window.navigator.userAgent.indexOf("MiniGame") < 0 ? i.loader.load(e, s) : "image" == n || "sound" == n ? t.downOtherFiles(e, s, e, !0, !1) : t.downFiles(e, a, s, e, !0, n, !1); }, t.copyFile = function(e, i, n, s, a) { void 0 === s && (s = ""), void 0 === a && (a = !0); var o = e.split("/"), h = o[o.length - 1], l = t.getFileInfo(i), u = t.getFileNativePath(h); t.fakeObj[i] = { md5: h, readyUrl: i, size: 0, times: r.now(), encoding: s }; var c = t.getCacheUseSize(); l ? l.readyUrl != i ? t.fs.getFileInfo({ filePath: e, success: function(r) { a && c + 4194304 + r.size >= 52428800 && (r.size > y.minClearSize && (y.minClearSize = r.size), t.onClearCacheRes()), t.deleteFile(e, i, n, s, r.size); }, fail: function(t) { null != n && n.runWith([ 1, t ]); } }) : null != n && n.runWith([ 0 ]) : t.fs.getFileInfo({ filePath: e, success: function(r) { a && c + 4194304 + r.size >= 52428800 && (r.size > y.minClearSize && (y.minClearSize = r.size), t.onClearCacheRes()), t.fs.copyFile({ srcPath: e, destPath: u, success: function(e) { t.onSaveFile(i, h, !0, s, n, r.size); }, fail: function(t) { null != n && n.runWith([ 1, t ]); } }); }, fail: function(t) { null != n && n.runWith([ 1, t ]); } }); }, t.onClearCacheRes = function() { var e = y.minClearSize, i = []; for (var n in t.filesListObj) i.push(t.filesListObj[n]); t.sortOn(i, "times", 16); for (var s = 0, a = 1, r = i.length; a < r; a++) { var o = i[a]; if (s >= e) break; s += o.size, t.deleteFile("", o.readyUrl); } }, t.sortOn = function(t, e, i) { return void 0 === i && (i = 0), 16 == i ? t.sort(function(t, i) { return t[e] - i[e]; }) : 18 == i ? t.sort(function(t, i) { return i[e] - t[e]; }) : t.sort(function(t, i) { return t[e] - i[e]; }); }, t.getFileNativePath = function(t) { return laya.wx.mini.MiniFileMgr.fileNativeDir + "/" + t; }, t.deleteFile = function(e, i, n, s, a) { void 0 === i && (i = ""), void 0 === s && (s = ""), void 0 === a && (a = 0); var r = t.getFileInfo(i), o = t.getFileNativePath(r.md5); t.fs.unlink({ filePath: o, success: function(r) { var o = "" != e; if ("" != e) { var h = t.getFileNativePath(e); t.fs.copyFile({ srcPath: e, destPath: h, success: function(a) { t.onSaveFile(i, e, o, s, n, a.size); }, fail: function(t) { null != n && n.runWith([ 1, t ]); } }); } else t.onSaveFile(i, e, o, s, n, a); }, fail: function(t) {} }); }, t.deleteAll = function() { var e = []; for (var i in t.filesListObj) e.push(t.filesListObj[i]); for (var n = 1, s = e.length; n < s; n++) { var a = e[n]; t.deleteFile("", a.readyUrl); } laya.wx.mini.MiniFileMgr.filesListObj && laya.wx.mini.MiniFileMgr.filesListObj.fileUsedSize && (laya.wx.mini.MiniFileMgr.filesListObj.fileUsedSize = 0), laya.wx.mini.MiniFileMgr.writeFilesList("", JSON.stringify({}), !1); }, t.onSaveFile = function(e, i, n, s, a, o) { void 0 === n && (n = !0), void 0 === s && (s = ""), void 0 === o && (o = 0); var h = e; if (null == t.filesListObj.fileUsedSize && (t.filesListObj.fileUsedSize = 0), n) { t.getFileNativePath(i); t.filesListObj[h] = { md5: i, readyUrl: e, size: o, times: r.now(), encoding: s }, t.filesListObj.fileUsedSize = parseInt(t.filesListObj.fileUsedSize) + o, t.writeFilesList(h, JSON.stringify(t.filesListObj), !0), null != a && a.runWith([ 0 ]); } else if (t.filesListObj[h]) { var l = parseInt(t.filesListObj[h].size); t.filesListObj.fileUsedSize = parseInt(t.filesListObj.fileUsedSize) - l, delete t.filesListObj[h], t.writeFilesList(h, JSON.stringify(t.filesListObj), !1), null != a && a.runWith([ 0 ]); } }, t.writeFilesList = function(e, i, n) { var s = t.fileNativeDir + "/" + t.fileListName; t.fs.writeFile({ filePath: s, encoding: "utf8", data: i, success: function(t) {}, fail: function(t) {} }), !y.isZiYu && y.isPosMsgYu && y.window.wx.postMessage && y.window.wx.postMessage({ url: e, data: t.filesListObj[e], isLoad: "filenative", isAdd: n }); }, t.getCacheUseSize = function() { return t.filesListObj && t.filesListObj.fileUsedSize ? t.filesListObj.fileUsedSize : 0; }, t.existDir = function(e, i) { t.fs.mkdir({ dirPath: e, success: function(t) { null != i && i.runWith([ 0, { data: JSON.stringify({}) } ]); }, fail: function(e) { -1 != e.errMsg.indexOf("file already exists") ? t.readSync(t.fileListName, "utf8", i) : null != i && i.runWith([ 1, e ]); } }); }, t.readSync = function(e, i, n, s) { void 0 === i && (i = "utf8"), void 0 === s && (s = ""); var a, r = t.getFileNativePath(e); try { a = t.fs.readFileSync(r, i), null != n && n.runWith([ 0, { data: a } ]); } catch (t) { null != n && n.runWith([ 1 ]); } }, t.setNativeFileDir = function(e) { t.fileNativeDir = y.window.wx.env.USER_DATA_PATH + e; }, t.filesListObj = {}, t.fakeObj = {}, t.fileNativeDir = null, t.fileListName = "layaairfiles.txt", t.ziyuFileData = {}, t.ziyuFileTextureData = {}, t.loadPath = "", t.DESCENDING = 2, t.NUMERIC = 16, n(t, [ "fs", function() { return this.fs = y.window.wx.getFileSystemManager(); }, "wxdown", function() { return this.wxdown = y.window.wx.downloadFile; } ]), t; }(), b = function() { function t() {} s(t, "laya.wx.mini.MiniImage"); return t.prototype._loadImage = function(e) { if (y.isZiYu) t.onCreateImage(e, this, !0); else { var i = !1; if (x.isLocalNativeFile(e)) { if (-1 != e.indexOf("http://") || -1 != e.indexOf("https://")) if ("" != x.loadPath) e = e.split(x.loadPath)[1]; else { var n = "" != m.rootPath ? m.rootPath : m.basePath, s = e; "" != n && (e = e.split(n)[1]), e || (e = s); } if (y.subNativeFiles && 0 == y.subNativeheads.length) for (var a in y.subNativeFiles) { var r = y.subNativeFiles[a]; y.subNativeheads = y.subNativeheads.concat(r); for (var o = 0; o < r.length; o++) y.subMaps[r[o]] = a + "/" + r[o]; } if (y.subNativeFiles && -1 != e.indexOf("/")) { var h = e.split("/")[0] + "/"; if (h && -1 != y.subNativeheads.indexOf(h)) { var u = y.subMaps[h]; e = e.replace(h, u); } } } else i = !0, e = m.formatURL(e); x.getFileInfo(e) ? t.onCreateImage(e, this, !i) : -1 != e.indexOf("http://") || -1 != e.indexOf("https://") ? y.isZiYu ? t.onCreateImage(e, this, !0) : x.downOtherFiles(e, new l(t, t.onDownImgCallBack, [ e, this ]), e) : t.onCreateImage(e, this, !0); } }, t.onDownImgCallBack = function(e, i, n, s) { void 0 === s && (s = ""), n ? i.onError(null) : t.onCreateImage(e, i, !1, s); }, t.onCreateImage = function(t, e, i, n) { function s() { u.onload = null, u.onerror = null, delete e.imgCache[t]; } void 0 === i && (i = !1), void 0 === n && (n = ""); var a; if (y.autoCacheFile) if (i) if (y.isZiYu) { var o = m.formatURL(t); a = x.ziyuFileTextureData[o] ? x.ziyuFileTextureData[o] : t; } else a = t; else if ("" != n) a = n; else { var l = x.getFileInfo(t).md5; a = x.getFileNativePath(l); } else a = i ? t : n; null == e.imgCache && (e.imgCache = {}); var u, c = function() { s(), e.onLoaded(u); }, _ = function() { s(), delete x.filesListObj[t], delete x.fakeObj[t], e.event("error", "Load image failed"); }; "nativeimage" == e._type ? ((u = new r.window.Image()).crossOrigin = "", u.onload = c, u.onerror = _, u.src = a, e.imgCache[t] = u) : new h.create(a, { onload: c, onerror: _, onCreate: function(i) { u = i, e.imgCache[t] = i; } }); }, t; }(), w = function() { function e() {} return s(e, "laya.wx.mini.MiniInput"), e._createInputElement = function() { u._initInput(u.area = r.createElement("textarea")), u._initInput(u.input = r.createElement("input")), u.inputContainer = r.createElement("div"), u.inputContainer.style.position = "absolute", u.inputContainer.style.zIndex = 1e5, r.container.appendChild(u.inputContainer), u.inputContainer.setPos = function(t, e) { u.inputContainer.style.left = t + "px", u.inputContainer.style.top = e + "px"; }, i.stage.on("resize", null, e._onStageResize), wx.onWindowResize && wx.onWindowResize(function(e) { t.dispatchEvent && t.dispatchEvent("resize"); }), g._soundClass = T, g._musicClass = T; var n = y.systemInfo.model, s = y.systemInfo.system; -1 != n.indexOf("iPhone") && (r.onIPhone = !0, r.onIOS = !0, r.onIPad = !0, r.onAndroid = !1), -1 == s.indexOf("Android") && -1 == s.indexOf("Adr") || (r.onAndroid = !0, r.onIPhone = !1, r.onIOS = !1, r.onIPad = !1); }, e._onStageResize = function() { i.stage._canvasTransform.identity().scale(r.width / d.canvas.width / p.getPixelRatio(), r.height / d.canvas.height / p.getPixelRatio()); }, e.wxinputFocus = function(t) { var e = u.inputElement.target; e && !e.editable || (y.window.wx.offKeyboardConfirm(), y.window.wx.offKeyboardInput(), y.window.wx.showKeyboard({ defaultValue: e.text, maxLength: e.maxChars, multiple: e.multiline, confirmHold: !0, confirmType: "done", success: function(t) {}, fail: function(t) {} }), y.window.wx.onKeyboardConfirm(function(t) { var i = t ? t.value : ""; e.text = i, e.event("input"), laya.wx.mini.MiniInput.inputEnter(); }), y.window.wx.onKeyboardInput(function(t) { var i = t ? t.value : ""; e.multiline || -1 == i.indexOf("\n") ? (e.text = i, e.event("input")) : laya.wx.mini.MiniInput.inputEnter(); })); }, e.inputEnter = function() { u.inputElement.target.focus = !1; }, e.wxinputblur = function() { e.hideKeyboard(); }, e.hideKeyboard = function() { y.window.wx.offKeyboardConfirm(), y.window.wx.offKeyboardInput(), y.window.wx.hideKeyboard({ success: function(t) { console.log("隐藏键盘"); }, fail: function(t) { console.log("隐藏键盘出错:" + (t ? t.errMsg : "")); } }); }, e; }(), C = function() { function t() {} return s(t, "laya.wx.mini.MiniLocalStorage"), t.__init__ = function() { t.items = t; }, t.setItem = function(t, e) { try { wx.setStorageSync(t, e); } catch (i) { wx.setStorage({ key: t, data: e }); } }, t.getItem = function(t) { return wx.getStorageSync(t); }, t.setJSON = function(e, i) { t.setItem(e, i); }, t.getJSON = function(e) { return t.getItem(e); }, t.removeItem = function(t) { wx.removeStorageSync(t); }, t.clear = function() { wx.clearStorageSync(); }, t.getStorageInfoSync = function() { try { var t = wx.getStorageInfoSync(); return console.log(t.keys), console.log(t.currentSize), console.log(t.limitSize), t; } catch (t) {} return null; }, t.support = !0, t.items = null, t; }(), S = (function() { function t() {} s(t, "laya.wx.mini.MiniLocation"), t.__init__ = function() { y.window.navigator.geolocation.getCurrentPosition = t.getCurrentPosition, y.window.navigator.geolocation.watchPosition = t.watchPosition, y.window.navigator.geolocation.clearWatch = t.clearWatch; }, t.getCurrentPosition = function(t, e, i) { var n; (n = {}).success = function(e) { null != t && t(e); }, n.fail = e, y.window.wx.getLocation(n); }, t.watchPosition = function(e, n, s) { t._curID++; var a; return a = {}, a.success = e, a.error = n, t._watchDic[t._curID] = a, i.timer.loop(1e3, null, t._myLoop), t._curID; }, t.clearWatch = function(e) { delete t._watchDic[e], t._hasWatch() || i.timer.clear(null, t._myLoop); }, t._hasWatch = function() { var e; for (e in t._watchDic) if (t._watchDic[e]) return !0; return !1; }, t._myLoop = function() { t.getCurrentPosition(t._mySuccess, t._myError); }, t._mySuccess = function(e) { var i = {}; i.coords = e, i.timestamp = r.now(); var n; for (n in t._watchDic) t._watchDic[n].success && t._watchDic[n].success(i); }, t._myError = function(e) { var i; for (i in t._watchDic) t._watchDic[i].error && t._watchDic[i].error(e); }, t._watchDic = {}, t._curID = 0; }(), function() { function t(t, e) { this.videoend = !1, this.videourl = "", this.videoElement = null, this.onPlayFunc = null, this.onEndedFunC = null, this._duration = NaN, this.position = NaN, void 0 === t && (t = 320), void 0 === e && (e = 240), this.videoElement = y.window.wx.createVideo({ width: t, height: e, autoplay: !0 }); } s(t, "laya.wx.mini.MiniVideo"); var e = t.prototype; e.on = function(t, e, i) { "loadedmetadata" == t ? (this.onPlayFunc = i.bind(e), this.videoElement.onPlay = this.onPlayFunction.bind(this)) : "ended" == t && (this.onEndedFunC = i.bind(e), this.videoElement.onEnded = this.onEndedFunction.bind(this)), this.videoElement.onTimeUpdate = this.onTimeUpdateFunc.bind(this); }, e.onTimeUpdateFunc = function(t) { this.position = t.position, this._duration = t.duration; }, e.onPlayFunction = function() { this.videoElement && (this.videoElement.readyState = 200), console.log("=====视频加载完成========"), null != this.onPlayFunc && this.onPlayFunc(); }, e.onEndedFunction = function() { this.videoElement && (this.videoend = !0, console.log("=====视频播放完毕========"), null != this.onEndedFunC && this.onEndedFunC()); }, e.off = function(t, e, i) { "loadedmetadata" == t ? (this.onPlayFunc = i.bind(e), this.videoElement.offPlay = this.onPlayFunction.bind(this)) : "ended" == t && (this.onEndedFunC = i.bind(e), this.videoElement.offEnded = this.onEndedFunction.bind(this)); }, e.load = function(t) { this.videoElement && (this.videoElement.src = t); }, e.play = function() { this.videoElement && (this.videoend = !1, this.videoElement.play()); }, e.pause = function() { this.videoElement && (this.videoend = !0, this.videoElement.pause()); }, e.size = function(t, e) { this.videoElement && (this.videoElement.width = t, this.videoElement.height = e); }, e.destroy = function() { this.videoElement && this.videoElement.destroy(), this.videoElement = null, this.onEndedFunC = null, this.onPlayFunc = null, this.videoend = !1, this.videourl = null; }, e.reload = function() { this.videoElement && (this.videoElement.src = this.videourl); }, a(0, e, "duration", function() { return this._duration; }), a(0, e, "paused", function() { return !!this.videoElement && this.videoElement.paused; }), a(0, e, "loop", function() { return !!this.videoElement && this.videoElement.loop; }, function(t) { this.videoElement && (this.videoElement.loop = t); }), a(0, e, "currentTime", function() { return this.videoElement ? this.videoElement.initialTime : 0; }, function(t) { this.videoElement && (this.videoElement.initialTime = t); }), a(0, e, "ended", function() { return this.videoend; }), a(0, e, "muted", function() { return !!this.videoElement && this.videoElement.muted; }, function(t) { this.videoElement && (this.videoElement.muted = t); }), a(0, e, "videoWidth", function() { return this.videoElement ? this.videoElement.width : 0; }), a(0, e, "videoHeight", function() { return this.videoElement ? this.videoElement.height : 0; }), a(0, e, "playbackRate", function() { return this.videoElement ? this.videoElement.playbackRate : 0; }, function(t) { this.videoElement && (this.videoElement.playbackRate = t); }), a(0, e, "x", function() { return this.videoElement ? this.videoElement.x : 0; }, function(t) { this.videoElement && (this.videoElement.x = t); }), a(0, e, "y", function() { return this.videoElement ? this.videoElement.y : 0; }, function(t) { this.videoElement && (this.videoElement.y = t); }), a(0, e, "currentSrc", function() { return this.videoElement.src; }), t.__init__ = function() { laya.device.media.Video = t; }; }(), function(t) { function e() { e.__super.call(this); } s(e, "laya.wx.mini.MiniAccelerator", t); var i = e.prototype; i.on = function(i, n, s, a) { return t.prototype.on.call(this, i, n, s, a), e.startListen(this.onDeviceOrientationChange), this; }, i.off = function(i, n, s, a) { return void 0 === a && (a = !1), this.hasListener(i) || e.stopListen(), t.prototype.off.call(this, i, n, s, a); }, e.__init__ = function() { try { var t; if (!(t = laya.device.motion.Accelerator)) return; t.prototype.on = e.prototype.on, t.prototype.off = e.prototype.off; } catch (t) {} }, e.startListen = function(t) { if (e._callBack = t, !e._isListening) { e._isListening = !0; try { y.window.wx.onAccelerometerChange(laya.wx.mini.MiniAccelerator.onAccelerometerChange); } catch (t) {} } }, e.stopListen = function() { e._isListening = !1; try { y.window.wx.stopAccelerometer({}); } catch (t) {} }, e.onAccelerometerChange = function(t) { var i; (i = {}).acceleration = t, i.accelerationIncludingGravity = t, i.rotationRate = {}, null != e._callBack && e._callBack(i); }, e._isListening = !1, e._callBack = null; }(o), function(t) { function e() { e.__super.call(this); } s(e, "laya.wx.mini.MiniLoader", o); var i = e.prototype; return i.load = function(t, i, n, s, a) { void 0 === n && (n = !0), void 0 === a && (a = !1); if (this._url = t, 0 === t.indexOf("data:image") ? this._type = i = "image" : this._type = i || (i = this.getTypeFromUrl(t)), this._cache = n, this._data = null, !a && c.loadedMap[m.formatURL(t)]) return this._data = c.loadedMap[m.formatURL(t)], this.event("progress", 1), void this.event("complete", this._data); if (null != c.parserMap[i]) return this._customParse = !0, void (c.parserMap[i] instanceof laya.utils.Handler ? c.parserMap[i].runWith(this) : c.parserMap[i].call(null, this)); var r = y.getUrlEncode(t, i), o = v.getFileExtension(t); if (-1 != e._fileTypeArr.indexOf(o) || "image" == i) y.EnvConfig.load.call(this, t, i, n, s, a); else { if (y.isZiYu && !x.ziyuFileData[t] && (t = m.formatURL(t)), y.isZiYu && x.ziyuFileData[t]) { var h = x.ziyuFileData[t]; return void this.onLoaded(h); } if (x.getFileInfo(m.formatURL(t))) { var u = x.getFileInfo(m.formatURL(t)); u.encoding = null == u.encoding ? "utf8" : u.encoding; var _ = x.getFileNativePath(u.md5); x.readFile(_, u.encoding, new l(e, e.onReadNativeCallBack, [ r, t, i, n, s, a, this ]), m.formatURL(t)); } else { if (x.isLocalNativeFile(t)) { if (y.subNativeFiles && 0 == y.subNativeheads.length) for (var d in y.subNativeFiles) { var p = y.subNativeFiles[d]; y.subNativeheads = y.subNativeheads.concat(p); for (var f = 0; f < p.length; f++) y.subMaps[p[f]] = d + "/" + p[f]; } if (y.subNativeFiles && -1 != t.indexOf("/")) { var g = t.split("/")[0] + "/"; if (g && -1 != y.subNativeheads.indexOf(g)) { var b = y.subMaps[g]; t = t.replace(g, b); } } return void ("sound" == i ? this._loadSound(t) : x.read(t, r, new l(e, e.onReadNativeCallBack, [ r, t, i, n, s, a, this ]))); } var w = t; -1 != m.formatURL(t).indexOf(y.window.wx.env.USER_DATA_PATH) || -1 == t.indexOf("http://") && -1 == t.indexOf("https://") || y.AutoCacheDownFile ? (u = x.getFileInfo(t)) ? (u.encoding = null == u.encoding ? "utf8" : u.encoding, x.readFile(u.url, r, new l(e, e.onReadNativeCallBack, [ r, t, i, n, s, a, this ]), t)) : "image" == this.type || "htmlimage" == this.type ? y.EnvConfig.load.call(this, t, i, n, s, a) : (t = m.formatURL(t), "image" != i && (-1 == t.indexOf("http://") && -1 == t.indexOf("https://") || x.isLocalNativeFile(t)) ? x.readFile(t, r, new l(e, e.onReadNativeCallBack, [ r, t, i, n, s, a, this ]), t) : x.downFiles(t, r, new l(e, e.onReadNativeCallBack, [ r, t, i, n, s, a, this ]), t, !0)) : "sound" == i ? this._loadSound(t) : y.EnvConfig.load.call(this, w, i, n, s, a); } } }, i._loadSound = function(t) { var i; if (x.isLocalNativeFile(t)) { var n = "" != m.rootPath ? m.rootPath : m.basePath, s = t; "" == n || -1 == t.indexOf("http://") && -1 == t.indexOf("https://") || (i = t.split(n)[1]), i || (i = s), laya.wx.mini.MiniLoader.onDownLoadCallBack(t, this, 0); } else { var a = m.formatURL(t); !x.isLocalNativeFile(t) && -1 == a.indexOf("http://") && -1 == a.indexOf("https://") || -1 != a.indexOf(y.window.wx.env.USER_DATA_PATH) ? laya.wx.mini.MiniLoader.onDownLoadCallBack(t, this, 0) : x.downOtherFiles(encodeURI(a), l.create(e, laya.wx.mini.MiniLoader.onDownLoadCallBack, [ a, this ]), a); } }, e.onDownLoadCallBack = function(t, e, i, n) { if (i) e.event("error", "Load sound failed"); else { var s; if (y.autoCacheFile) if (n) s = n; else if (x.isLocalNativeFile(t)) { var a = "" != m.rootPath ? m.rootPath : m.basePath, r = t; "" == a || -1 == t.indexOf("http://") && -1 == t.indexOf("https://") || (s = t.split(a)[1]), s || (s = r); } else { var o = x.getFileInfo(t); if (o && o.md5) { var h = o.md5; s = x.getFileNativePath(h); } else s = t; } t = s; var l = new g._soundClass(); l.load(encodeURI(t)), e.onLoaded(l); } }, e.onReadNativeCallBack = function(t, e, i, n, s, a, r, o, h) { if (void 0 === n && (n = !0), void 0 === a && (a = !1), void 0 === o && (o = 0), o) 1 == o && (console.log("-----------本地加载失败,尝试外网加载----url:" + e), y.EnvConfig.load.call(r, e, i, n, s, a)); else { var l; l = "json" == i || "atlas" == i ? y.getJson(h.data) : "xml" == i ? v.parseXMLFromString(h.data) : h.data, !y.isZiYu && y.isPosMsgYu && "arraybuffer" != i && y.window.wx && y.window.wx.postMessage({ url: e, data: l, isLoad: "filedata" }), r.onLoaded(l); } }, n(e, [ "_fileTypeArr", function() { return this._fileTypeArr = [ "png", "jpg", "bmp", "jpeg", "gif" ]; } ]), e; }()), T = function(t) { function e() { this._sound = null, this.url = null, this.loaded = !1, this.readyUrl = null, e.__super.call(this); } s(e, "laya.wx.mini.MiniSound", o); var i = e.prototype; return i.load = function(t) { if (x.isLocalNativeFile(t)) { if (-1 != t.indexOf("http://") || -1 != t.indexOf("https://")) if ("" != x.loadPath) t = t.split(x.loadPath)[1]; else { var i = "" != m.rootPath ? m.rootPath : m.basePath; "" != i && (t = t.split(i)[1]); } } else t = m.formatURL(t); if (this.url = t, this.readyUrl = t, e._audioCache[this.readyUrl]) this.event("complete"); else if (y.autoCacheFile && x.getFileInfo(t)) this.onDownLoadCallBack(t, 0); else if (y.autoCacheFile) if (x.isLocalNativeFile(t)) { var n = t; if ("" != (i = "" != m.rootPath ? m.rootPath : m.basePath) && (t = t.split(i)[1]), t || (t = n), y.subNativeFiles && 0 == y.subNativeheads.length) for (var s in y.subNativeFiles) { var a = y.subNativeFiles[s]; y.subNativeheads = y.subNativeheads.concat(a); for (var r = 0; r < a.length; r++) y.subMaps[a[r]] = s + "/" + a[r]; } if (y.subNativeFiles && -1 != t.indexOf("/")) { var o = t.split("/")[0] + "/"; if (o && -1 != y.subNativeheads.indexOf(o)) { var h = y.subMaps[o]; t = t.replace(o, h); } } this.onDownLoadCallBack(t, 0); } else x.downOtherFiles(encodeURI(t), l.create(this, this.onDownLoadCallBack, [ t ]), t); else this.onDownLoadCallBack(t, 0); }, i.onDownLoadCallBack = function(t, i) { if (i) this.event("error"); else { var n; if (y.autoCacheFile) { if (x.isLocalNativeFile(t)) { var s = "" != m.rootPath ? m.rootPath : m.basePath, a = t; "" == s || -1 == t.indexOf("http://") && -1 == t.indexOf("https://") || (n = t.split(s)[1]), n || (n = a); } else { var r = x.getFileInfo(t); if (r && r.md5) { var o = r.md5; n = x.getFileNativePath(o); } else n = encodeURI(t); } this._sound = e._createSound(), this._sound.src = this.url = n; } else this._sound = e._createSound(), this._sound.src = encodeURI(t); this._sound.onCanplay(e.bindToThis(this.onCanPlay, this)), this._sound.onError(e.bindToThis(this.onError, this)); } }, i.onError = function(t) { this.event("error"), this._sound.offError(null); }, i.onCanPlay = function() { this.loaded = !0, this.event("complete"), this._sound.offCanplay(null); }, i.play = function(t, i) { void 0 === t && (t = 0), void 0 === i && (i = 0); var n; if (this.url == g._tMusic ? (e._musicAudio || (e._musicAudio = e._createSound()), n = e._musicAudio) : n = e._audioCache[this.readyUrl] ? e._audioCache[this.readyUrl]._sound : e._createSound(), y.autoCacheFile && x.getFileInfo(this.url)) { var s = x.getFileInfo(this.url).md5; n.src = this.url = x.getFileNativePath(s); } else n.src = encodeURI(this.url); var a = new I(n, this); return a.url = this.url, a.loops = i, a.loop = 0 === i, a.startTime = t, a.play(), g.addChannel(a), a; }, i.dispose = function() { var t = e._audioCache[this.readyUrl]; t && (t.src = "", t._sound && (t._sound.destroy(), t._sound = null, t = null), delete e._audioCache[this.readyUrl]), this._sound && (this._sound.destroy(), this._sound = null), this.url = this.readyUrl = null; }, a(0, i, "duration", function() { return this._sound.duration; }), e._createSound = function() { return e._id++, y.window.wx.createInnerAudioContext(); }, e.bindToThis = function(t, e) { return t.bind(e); }, e._musicAudio = null, e._id = 0, e._audioCache = {}, e; }(), I = function(t) { function e(t, i) { this._audio = null, this._onEnd = null, this._miniSound = null, e.__super.call(this), this._audio = t, this._miniSound = i, this._onEnd = e.bindToThis(this.__onEnd, this), t.onEnded(this._onEnd); } s(e, "laya.wx.mini.MiniSoundChannel", f); var n = e.prototype; return n.__onEnd = function() { if (1 == this.loops) return this.completeHandler && (i.timer.once(10, this, this.__runComplete, [ this.completeHandler ], !1), this.completeHandler = null), this.stop(), void this.event("complete"); this.loops > 0 && this.loops--, this.startTime = 0, this.play(); }, n.play = function() { this.isStopped = !1, g.addChannel(this), this._audio.play(); }, n.stop = function() { this.isStopped = !0, g.removeChannel(this), this.completeHandler = null, this._audio && (this._audio.stop(), this._audio.offEnded(null), this._audio.destroy(), this._audio = null, this._miniSound = null, this._onEnd = null); }, n.pause = function() { this.isStopped = !0, this._audio.pause(); }, n.resume = function() { this._audio && (this.isStopped = !1, g.addChannel(this), this._audio.play()); }, a(0, n, "startTime", null, function(t) { this._audio && (this._audio.startTime = t); }), a(0, n, "autoplay", function() { return this._audio.autoplay; }, function(t) { this._audio.autoplay = t; }), a(0, n, "position", function() { return this._audio ? this._audio.currentTime : 0; }), a(0, n, "duration", function() { return this._audio ? this._audio.duration : 0; }), a(0, n, "loop", function() { return this._audio.loop; }, function(t) { this._audio.loop = t; }), a(0, n, "volume", function() { return this._audio ? this._audio.volume : 1; }, function(t) { this._audio && (this._audio.volume = t); }), e.bindToThis = function(t, e) { return t.bind(e); }, e; }(); }(window, document, Laya), "function" == typeof define && define.amd && define("laya.core", [ "require", "exports" ], function(t, e) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }); for (var i in Laya) { var n = Laya[i]; n && n.__isclass && (e[i] = n); } }), function(t, e, i) { i.un, i.uns; var n = i.static, s = i.class, a = i.getset, r = (i.__newvec, laya.utils.Browser), o = (laya.events.Event, laya.events.EventDispatcher), h = laya.resource.HTMLImage, l = laya.utils.Handler, u = laya.display.Input, c = laya.net.Loader, _ = laya.net.LocalStorage, d = (laya.maths.Matrix, laya.renders.Render), p = laya.utils.RunDriver, f = laya.media.SoundChannel, g = laya.media.SoundManager, m = laya.net.URL, v = laya.utils.Utils, y = function() { function e() {} return s(e, "laya.bd.mini.BMiniAdapter"), e.getJson = function(t) { return JSON.parse(t); }, e.init = function(n, s) { if (void 0 === n && (n = !1), void 0 === s && (s = !1), !(e._inited || (e._inited = !0, (e.window = t).navigator.userAgent.indexOf("SwanGame") < 0))) { e.isZiYu = s, e.isPosMsgYu = n, e.EnvConfig = {}; try { laya.webgl.resource.WebGLCanvas.premulAlpha = !0; } catch (t) {} e.isZiYu || (x.setNativeFileDir("/layaairGame"), x.existDir(x.fileNativeDir, l.create(e, e.onMkdirCallBack))), e.isZiYu || (e.systemInfo = e.window.swan.getSystemInfoSync()), e.window.focus = function() {}, i.getUrlPath = function() {}, i._getUrlPath = function() {}, e.window.logtime = function(t) {}, e.window.alertTimeLog = function(t) {}, e.window.resetShareInfo = function() {}, e.window.CanvasRenderingContext2D = function() {}, e.window.CanvasRenderingContext2D.prototype = e.window.swan.createCanvas().getContext("2d").__proto__, e.window.document.body.appendChild = function() {}, e.EnvConfig.pixelRatioInt = 0, p.getPixelRatio = e.pixelRatio, e._preCreateElement = r.createElement, r.createElement = e.createElement, p.createShaderCondition = e.createShaderCondition, v.parseXMLFromString = e.parseXMLFromString, u._createInputElement = w._createInputElement, e.EnvConfig.load = c.prototype.load, c.prototype.load = S.prototype.load, c.prototype._loadImage = b.prototype._loadImage, _._baseClass = C, C.__init__(), e.onReciveData(); } }, e.onReciveData = function() { laya.bd.mini.BMiniAdapter.isZiYu && e.window.swan.onMessage(function(t) { "opendatacontext" == t.isLoad ? t.url && (x.ziyuFileData[t.url] = t.atlasdata, x.ziyuFileTextureData[t.imgReadyUrl] = t.imgNativeUrl) : "openJsondatacontext" == t.isLoad ? t.url && (x.ziyuFileData[t.url] = t.atlasdata) : "openJsondatacontextPic" == t.isLoad && (x.ziyuFileTextureData[t.imgReadyUrl] = t.imgNativeUrl); }); }, e.measureText = function(t) { var i = e._measureText(t); return i || (i = { width: 16 }, console.warn("-------微信获取文字宽度失败----等待修复---------")), i; }, e.getUrlEncode = function(t, e) { return "arraybuffer" == e ? "" : "utf8"; }, e.downLoadFile = function(t, e, i, n) { void 0 === e && (e = ""), void 0 === n && (n = "utf8"); x.getFileInfo(t) ? null != i && i.runWith([ 0 ]) : x.downLoadFile(t, e, i, n); }, e.remove = function(t, e) { x.deleteFile("", t, e, "", 0); }, e.removeAll = function() { x.deleteAll(); }, e.hasNativeFile = function(t) { return x.isLocalNativeFile(t); }, e.getFileInfo = function(t) { return x.getFileInfo(t); }, e.getFileList = function() { return x.filesListObj; }, e.exitMiniProgram = function() { e.window.swan.exitMiniProgram(); }, e.onMkdirCallBack = function(t, i) { t || (x.filesListObj = JSON.parse(i.data), x.fakeObj = x.filesListObj), e.onChuLiYuJiaZai(); }, e.onChuLiYuJiaZai = function() { if (e.window.preloadResources) for (var t = e.window.preloadResources, i = 0, n = t.length; i < n; i++) { var s = t[i], a = !1; try { x.fs.accessSync(s.filePath), a = !0; } catch (t) {} if (a && s.filePath) { console.log("获取预加载的资源路径 url:" + s.url); var o = s.filePath.split(x.fileNativeDir + "/")[1]; x.fakeObj[s.url] = { md5: o, readyUrl: s.url, size: 0, times: r.now(), encoding: "utf8" }, e.nativefiles.push(s.url); } } }, e.pixelRatio = function() { if (!e.EnvConfig.pixelRatioInt) try { return e.EnvConfig.pixelRatioInt = e.systemInfo.pixelRatio, e.systemInfo.pixelRatio; } catch (t) {} return e.EnvConfig.pixelRatioInt; }, e.createElement = function(t) { if ("canvas" == t) { var i; return 1 == e.idx ? e.isZiYu ? (i = sharedCanvas).style = {} : i = e.window.canvas : i = e.window.swan.createCanvas(), e.idx++, i; } if ("textarea" == t || "input" == t) return e.onCreateInput(t); if ("div" == t) { var n = e._preCreateElement(t); return n.contains = function(t) { return null; }, n.removeChild = function(t) {}, n; } return e._preCreateElement(t); }, e.onCreateInput = function(t) { var i = e._preCreateElement(t); return i.focus = w.wxinputFocus, i.blur = w.wxinputblur, i.style = {}, i.value = 0, i.parentElement = {}, i.placeholder = {}, i.type = {}, i.setColor = function(t) {}, i.setType = function(t) {}, i.setFontFace = function(t) {}, i.addEventListener = function(t) {}, i.contains = function(t) { return null; }, i.removeChild = function(t) {}, i; }, e.createShaderCondition = function(t) { var e = this; return function() { return e[t.replace("this.", "")]; }; }, e.sendAtlasToOpenDataContext = function(t) { if (!laya.bd.mini.BMiniAdapter.isZiYu) { var i = c.getRes(m.formatURL(t)); if (!i) throw "传递的url没有获取到对应的图集数据信息,请确保图集已经过!"; i.meta.image.split(","); if (i.meta && i.meta.image) for (var n = i.meta.image.split(","), s = t.indexOf("/") >= 0 ? "/" : "\\", a = t.lastIndexOf(s), r = a >= 0 ? t.substr(0, a + 1) : "", o = 0, h = n.length; o < h; o++) n[o] = r + n[o]; else n = [ t.replace(".json", ".png") ]; for (o = 0; o < n.length; o++) { var l = n[o]; e.postInfoToContext(t, l, i); } } }, e.postInfoToContext = function(t, i, n) { var s = { frames: n.frames, meta: n.meta }, a = i, r = x.getFileInfo(m.formatURL(i)); if (r) var o = r.md5, h = x.getFileNativePath(o); else h = a; if (!h) throw "获取图集的磁盘url路径不存在!"; e.window.swan.getOpenDataContext().postMessage({ url: t, atlasdata: s, imgNativeUrl: h, imgReadyUrl: a, isLoad: "opendatacontext" }); }, e.sendSinglePicToOpenDataContext = function(t) { var i = m.formatURL(t), n = x.getFileInfo(i); if (n) { var s = n.md5, a = x.getFileNativePath(s); t = i; } else a = t; if (!a) throw "获取图集的磁盘url路径不存在!"; e.window.swan.postMessage({ url: t, imgNativeUrl: a, imgReadyUrl: t, isLoad: "openJsondatacontextPic" }); }, e.sendJsonDataToDataContext = function(t) { if (!laya.bd.mini.BMiniAdapter.isZiYu) { var i = c.getRes(t); if (!i) throw "传递的url没有获取到对应的图集数据信息,请确保图集已经过!"; e.window.swan.postMessage({ url: t, atlasdata: i, isLoad: "openJsondatacontext" }); } }, e.EnvConfig = null, e.window = null, e._preCreateElement = null, e._inited = !1, e.systemInfo = {}, e.isZiYu = !1, e.isPosMsgYu = !1, e.autoCacheFile = !0, e.minClearSize = 5242880, e.subNativeFiles = null, e.subNativeheads = [], e.subMaps = [], e.AutoCacheDownFile = !1, e._measureText = null, e.parseXMLFromString = function(e) { var i; e = e.replace(/>\s+<"); try { i = new t.Parser.DOMParser().parseFromString(e, "text/xml"); } catch (t) { throw "需要引入xml解析库文件"; } return i; }, e.idx = 1, n(e, [ "nativefiles", function() { return this.nativefiles = [ "layaNativeDir", "wxlocal" ]; } ]), e; }(), x = function() { function t() {} return s(t, "laya.bd.mini.MiniFileMgr", null, "MiniFileMgr$1"), t.isLocalNativeFile = function(t) { for (var e = 0, i = y.nativefiles.length; e < i; e++) if (-1 != t.indexOf(y.nativefiles[e])) return !0; return !1; }, t.getFileInfo = function(e) { var i = e.split("?")[0], n = t.fakeObj[i]; return null == n ? null : n; }, t.read = function(e, i, n, s, a, r) { void 0 === i && (i = "utf8"), void 0 === s && (s = ""), void 0 === a && (a = !1), void 0 === r && (r = ""); var o; o = "" == s || -1 == s.indexOf("http://") && -1 == s.indexOf("https://") ? e : t.getFileNativePath(e), t.fs.readFile({ filePath: o, encoding: i, success: function(t) { null != n && n.runWith([ 0, t ]); }, fail: function(e) { e && "" != s ? t.downFiles(s, i, n, s, a, r) : null != n && n.runWith([ 1 ]); } }); }, t.downFiles = function(e, i, n, s, a, r) { void 0 === i && (i = "utf8"), void 0 === s && (s = ""), void 0 === a && (a = !1), void 0 === r && (r = ""); t.wxdown({ url: e, success: function(e) { 200 === e.statusCode && t.readFile(e.tempFilePath, i, n, s, a, r); }, fail: function(t) { null != n && n.runWith([ 1, t ]); } }).onProgressUpdate(function(t) { null != n && n.runWith([ 2, t.progress ]); }); }, t.readFile = function(e, i, n, s, a, r) { void 0 === i && (i = "utf8"), void 0 === s && (s = ""), void 0 === a && (a = !1), void 0 === r && (r = ""), t.fs.readFile({ filePath: e, encoding: i, success: function(r) { (-1 != s.indexOf("http://") || -1 != s.indexOf("https://")) && (y.autoCacheFile || a) ? (null != n && n.runWith([ 0, r ]), t.copyFile(e, s, null, i)) : null != n && n.runWith([ 0, r ]); }, fail: function(t) { t && null != n && n.runWith([ 1, t ]); } }); }, t.downOtherFiles = function(e, i, n, s) { void 0 === n && (n = ""), void 0 === s && (s = !1), t.wxdown({ url: e, success: function(e) { 200 === e.statusCode && (y.autoCacheFile || s ? (null != i && i.runWith([ 0, e.tempFilePath ]), t.copyFile(e.tempFilePath, n, null)) : null != i && i.runWith([ 0, e.tempFilePath ])); }, fail: function(t) { null != i && i.runWith([ 1, t ]); } }); }, t.downLoadFile = function(e, i, n, s) { void 0 === i && (i = ""), void 0 === s && (s = "utf8"), "image" == i || "sound" == i ? t.downOtherFiles(e, n, e, !0) : t.downFiles(e, s, n, e, !0, i); }, t.copyFile = function(e, i, n, s) { void 0 === s && (s = ""); var a = e.split("/"), o = a[a.length - 1], h = (i.split("?")[0], t.getFileInfo(i)), l = t.getFileNativePath(o); t.fakeObj[i] = { md5: o, readyUrl: i, size: 0, times: r.now(), encoding: s }; var u = t.getCacheUseSize(); h ? h.readyUrl != i ? t.fs.getFileInfo({ filePath: e, success: function(a) { u + 4194304 + a.size >= 52428800 && (a.size > y.minClearSize && (y.minClearSize = a.size), t.onClearCacheRes()), t.deleteFile(e, i, n, s, a.size); }, fail: function(t) { null != n && n.runWith([ 1, t ]); } }) : null != n && n.runWith([ 0 ]) : t.fs.getFileInfo({ filePath: e, success: function(a) { u + 4194304 + a.size >= 52428800 && (a.size > y.minClearSize && (y.minClearSize = a.size), t.onClearCacheRes()), t.fs.copyFile({ srcPath: e, destPath: l, success: function(e) { t.onSaveFile(i, o, !0, s, n, a.size); }, fail: function(t) { null != n && n.runWith([ 1, t ]); } }); }, fail: function(t) { null != n && n.runWith([ 1, t ]); } }); }, t.onClearCacheRes = function() { var e = y.minClearSize, i = []; for (var n in t.filesListObj) "fileUsedSize" != n && i.push(t.filesListObj[n]); t.sortOn(i, "times", 16); for (var s = 0, a = 1, r = i.length; a < r; a++) { var o = i[a]; if (s >= e) break; s += o.size, t.deleteFile("", o.readyUrl); } }, t.sortOn = function(t, e, i) { return void 0 === i && (i = 0), 16 == i ? t.sort(function(t, i) { return t[e] - i[e]; }) : 18 == i ? t.sort(function(t, i) { return i[e] - t[e]; }) : t.sort(function(t, i) { return t[e] - i[e]; }); }, t.getFileNativePath = function(t) { return laya.bd.mini.MiniFileMgr.fileNativeDir + "/" + t; }, t.deleteFile = function(e, i, n, s, a) { void 0 === i && (i = ""), void 0 === s && (s = ""), void 0 === a && (a = 0); var r = t.getFileInfo(i); if (r) { var o = t.getFileNativePath(r.md5), h = "" != e; laya.bd.mini.MiniFileMgr.onSaveFile(i, e, h, s, n, a), t.fs.unlink({ filePath: o, success: function(i) { if ("" != e) { var s = t.getFileNativePath(e); t.fs.copyFile({ srcPath: e, destPath: s, success: function(t) {}, fail: function(t) { null != n && n.runWith([ 1, t ]); } }); } }, fail: function(t) {} }); } }, t.deleteAll = function() { var e = []; for (var i in t.filesListObj) "fileUsedSize" != i && e.push(t.filesListObj[i]); for (var n = 1, s = e.length; n < s; n++) { var a = e[n]; t.deleteFile("", a.readyUrl); } laya.bd.mini.MiniFileMgr.filesListObj && laya.bd.mini.MiniFileMgr.filesListObj.fileUsedSize && (laya.bd.mini.MiniFileMgr.filesListObj.fileUsedSize = 0), laya.bd.mini.MiniFileMgr.writeFilesList("", JSON.stringify({}), !1); }, t.onSaveFile = function(e, i, n, s, a, o) { void 0 === n && (n = !0), void 0 === s && (s = ""), void 0 === o && (o = 0); var h = e.split("?")[0]; if (null == t.filesListObj.fileUsedSize && (t.filesListObj.fileUsedSize = 0), n) { t.getFileNativePath(i); t.filesListObj[h] = { md5: i, readyUrl: e, size: o, times: r.now(), encoding: s }, t.filesListObj.fileUsedSize = parseInt(t.filesListObj.fileUsedSize) + o, t.writeFilesList(h, JSON.stringify(t.filesListObj), !0), null != a && a.runWith([ 0 ]); } else if (t.filesListObj[h]) { var l = parseInt(t.filesListObj[h].size); t.filesListObj.fileUsedSize = parseInt(t.filesListObj.fileUsedSize) - l, delete t.filesListObj[h], t.writeFilesList(h, JSON.stringify(t.filesListObj), !1), null != a && a.runWith([ 0 ]); } }, t.writeFilesList = function(e, i, n) { var s = t.fileNativeDir + "/" + t.fileListName; t.fs.writeFile({ filePath: s, encoding: "utf8", data: i, success: function(t) {}, fail: function(t) {} }), !y.isZiYu && y.isPosMsgYu; }, t.getCacheUseSize = function() { return t.filesListObj && t.filesListObj.fileUsedSize ? t.filesListObj.fileUsedSize : 0; }, t.existDir = function(e, i) { t.fs.mkdir({ dirPath: e, success: function(t) { null != i && i.runWith([ 0, { data: JSON.stringify({}) } ]); }, fail: function(e) { -1 != e.errMsg.indexOf("file already exists") ? t.readSync(t.fileListName, "utf8", i) : null != i && i.runWith([ 1, e ]); } }); }, t.readSync = function(e, i, n, s) { void 0 === i && (i = "utf8"), void 0 === s && (s = ""); var a, r = t.getFileNativePath(e); try { a = t.fs.readFileSync(r, i), null != n && n.runWith([ 0, { data: a } ]); } catch (t) { null != n && n.runWith([ 1 ]); } }, t.setNativeFileDir = function(e) { t.fileNativeDir = swan.env.USER_DATA_PATH + e; }, t.filesListObj = {}, t.fakeObj = {}, t.fileNativeDir = null, t.fileListName = "layaairfiles.txt", t.ziyuFileData = {}, t.loadPath = "", t.DESCENDING = 2, t.NUMERIC = 16, n(t, [ "fs", function() { return this.fs = swan.getFileSystemManager(); }, "wxdown", function() { return this.wxdown = swan.downloadFile; } ]), t; }(), b = function() { function t() {} s(t, "laya.bd.mini.MiniImage", null, "MiniImage$1"); return t.prototype._loadImage = function(e) { if (y.isZiYu) t.onCreateImage(e, this, !0); else { var i = !1; if (x.isLocalNativeFile(e)) { if (-1 != e.indexOf("http://") || -1 != e.indexOf("https://")) if ("" != x.loadPath) e = e.split(x.loadPath)[1]; else { var n = "" != m.rootPath ? m.rootPath : m.basePath; "" != n && (e = e.split(n)[1]); } } else i = !0, e = m.formatURL(e); x.getFileInfo(m.formatURL(e)) ? t.onCreateImage(e, this, !i) : -1 != e.indexOf("http://") || -1 != e.indexOf("https://") ? y.isZiYu ? t.onCreateImage(e, this, !0) : x.downOtherFiles(encodeURI(e), new l(t, t.onDownImgCallBack, [ e, this ]), e) : t.onCreateImage(e, this, !0); } }, t.onDownImgCallBack = function(e, i, n, s) { void 0 === s && (s = ""), n ? i.onError(null) : t.onCreateImage(e, i, !1, s); }, t.onCreateImage = function(t, e, i, n) { function s() { l.onload = null, l.onerror = null, delete e.imgCache[t]; } void 0 === i && (i = !1), void 0 === n && (n = ""); var a; if (y.autoCacheFile) if (i) a = t; else if ("" != n) a = n; else { var o = x.getFileInfo(t).md5; a = x.getFileNativePath(o); } else a = i ? t : n; null == e.imgCache && (e.imgCache = {}); var l, u = function() { s(), e.onLoaded(l); }, c = function() { s(); try { delete x.fakeObj[t], delete x.filesListObj[t]; } catch (t) {} e.event("error", "Load image failed"); }; "nativeimage" == e._type ? ((l = new r.window.Image()).crossOrigin = "", l.onload = u, l.onerror = c, l.src = a, e.imgCache[t] = l) : new h.create(a, { onload: u, onerror: c, onCreate: function(i) { l = i, e.imgCache[t] = i; } }); }, t; }(), w = function() { function e() {} return s(e, "laya.bd.mini.MiniInput", null, "MiniInput$1"), e._createInputElement = function() { u._initInput(u.area = r.createElement("textarea")), u._initInput(u.input = r.createElement("input")), u.inputContainer = r.createElement("div"), u.inputContainer.style.position = "absolute", u.inputContainer.style.zIndex = 1e5, r.container.appendChild(u.inputContainer), u.inputContainer.setPos = function(t, e) { u.inputContainer.style.left = t + "px", u.inputContainer.style.top = e + "px"; }, i.stage.on("resize", null, e._onStageResize), swan.onWindowResize && swan.onWindowResize(function(e) { t.dispatchEvent && t.dispatchEvent("resize"); }), g._soundClass = T, g._musicClass = T; var n = y.systemInfo.model, s = y.systemInfo.system; -1 != n.indexOf("iPhone") && (r.onIPhone = !0, r.onIOS = !0, r.onIPad = !0, r.onAndroid = !1), -1 == s.indexOf("Android") && -1 == s.indexOf("Adr") || (r.onAndroid = !0, r.onIPhone = !1, r.onIOS = !1, r.onIPad = !1); }, e._onStageResize = function() { i.stage._canvasTransform.identity().scale(r.width / d.canvas.width / p.getPixelRatio(), r.height / d.canvas.height / p.getPixelRatio()); }, e.wxinputFocus = function(t) { var e = u.inputElement.target; e && !e.editable || (y.window.swan.offKeyboardConfirm(), y.window.swan.offKeyboardInput(), y.window.swan.showKeyboard({ defaultValue: e.text, maxLength: e.maxChars, multiple: e.multiline, confirmHold: !0, confirmType: "done", success: function(t) {}, fail: function(t) {} }), y.window.swan.onKeyboardConfirm(function(t) { var i = t ? t.value : ""; e.text = i, e.event("input"), laya.bd.mini.MiniInput.inputEnter(); }), y.window.swan.onKeyboardInput(function(t) { var i = t ? t.value : ""; e.multiline || -1 == i.indexOf("\n") ? (e.text = i, e.event("input")) : laya.bd.mini.MiniInput.inputEnter(); })); }, e.inputEnter = function() { u.inputElement.target.focus = !1; }, e.wxinputblur = function() { e.hideKeyboard(); }, e.hideKeyboard = function() { y.window.swan.offKeyboardConfirm(), y.window.swan.offKeyboardInput(), y.window.swan.hideKeyboard({ success: function(t) { console.log("隐藏键盘"); }, fail: function(t) { console.log("隐藏键盘出错:" + (t ? t.errMsg : "")); } }); }, e; }(), C = function() { function t() {} return s(t, "laya.bd.mini.MiniLocalStorage", null, "MiniLocalStorage$1"), t.__init__ = function() { t.items = t; }, t.setItem = function(t, e) { swan.setStorageSync(t, e); }, t.getItem = function(t) { return swan.getStorageSync(t); }, t.setJSON = function(e, i) { t.setItem(e, i); }, t.getJSON = function(e) { return t.getItem(e); }, t.removeItem = function(t) { swan.removeStorageSync(t); }, t.clear = function() { swan.clearStorageSync(); }, t.getStorageInfoSync = function() { try { var t = swan.getStorageInfoSync(); return console.log(t.keys), console.log(t.currentSize), console.log(t.limitSize), t; } catch (t) {} return null; }, t.support = !0, t.items = null, t; }(), S = (function() { function t() {} s(t, "laya.bd.mini.MiniLocation", null, "MiniLocation$1"), t.__init__ = function() { y.window.navigator.geolocation.getCurrentPosition = t.getCurrentPosition, y.window.navigator.geolocation.watchPosition = t.watchPosition, y.window.navigator.geolocation.clearWatch = t.clearWatch; }, t.getCurrentPosition = function(t, e, i) { var n; (n = {}).success = function(e) { null != t && t(e); }, n.fail = e, y.window.wx.getLocation(n); }, t.watchPosition = function(e, n, s) { t._curID++; var a; return a = {}, a.success = e, a.error = n, t._watchDic[t._curID] = a, i.timer.loop(1e3, null, t._myLoop), t._curID; }, t.clearWatch = function(e) { delete t._watchDic[e], t._hasWatch() || i.timer.clear(null, t._myLoop); }, t._hasWatch = function() { var e; for (e in t._watchDic) if (t._watchDic[e]) return !0; return !1; }, t._myLoop = function() { t.getCurrentPosition(t._mySuccess, t._myError); }, t._mySuccess = function(e) { var i = {}; i.coords = e, i.timestamp = r.now(); var n; for (n in t._watchDic) t._watchDic[n].success && t._watchDic[n].success(i); }, t._myError = function(e) { var i; for (i in t._watchDic) t._watchDic[i].error && t._watchDic[i].error(e); }, t._watchDic = {}, t._curID = 0; }(), function(t) { function e() { e.__super.call(this); } s(e, "laya.bd.mini.MiniAccelerator", t, "MiniAccelerator$1"); var i = e.prototype; i.on = function(i, n, s, a) { return t.prototype.on.call(this, i, n, s, a), e.startListen(this.onDeviceOrientationChange), this; }, i.off = function(i, n, s, a) { return void 0 === a && (a = !1), this.hasListener(i) || e.stopListen(), t.prototype.off.call(this, i, n, s, a); }, e.__init__ = function() { try { var t; if (!(t = laya.device.motion.Accelerator)) return; t.prototype.on = e.prototype.on, t.prototype.off = e.prototype.off; } catch (t) {} }, e.startListen = function(t) { if (e._callBack = t, !e._isListening) { e._isListening = !0; try { wx.onAccelerometerChange(e.onAccelerometerChange); } catch (t) {} } }, e.stopListen = function() { e._isListening = !1; try { wx.stopAccelerometer({}); } catch (t) {} }, e.onAccelerometerChange = function(t) { var i; (i = {}).acceleration = t, i.accelerationIncludingGravity = t, i.rotationRate = {}, null != e._callBack && e._callBack(i); }, e._isListening = !1, e._callBack = null; }(o), function(t) { function e() { e.__super.call(this); } s(e, "laya.bd.mini.MiniLoader", o, "MiniLoader$1"); return e.prototype.load = function(t, i, n, s, a) { void 0 === n && (n = !0), void 0 === a && (a = !1); if (this._url = t, 0 === t.indexOf("data:image") ? this._type = i = "image" : this._type = i || (i = this.getTypeFromUrl(t)), this._cache = n, this._data = null, !a && c.loadedMap[m.formatURL(t)]) return this._data = c.loadedMap[m.formatURL(t)], this.event("progress", 1), void this.event("complete", this._data); if (null != c.parserMap[i]) return this._customParse = !0, void (c.parserMap[i] instanceof laya.utils.Handler ? c.parserMap[i].runWith(this) : c.parserMap[i].call(null, this)); var r = y.getUrlEncode(t, i), o = v.getFileExtension(t); if (-1 != e._fileTypeArr.indexOf(o) || "image" == i) y.EnvConfig.load.call(this, t, i, n, s, a); else { if (y.isZiYu && x.ziyuFileData[t]) { var h = x.ziyuFileData[t]; return void this.onLoaded(h); } if (x.getFileInfo(m.formatURL(t))) { var u = x.getFileInfo(m.formatURL(t)); u.encoding = null == u.encoding ? "utf8" : u.encoding; var _ = x.getFileNativePath(u.md5); x.readFile(_, u.encoding, new l(e, e.onReadNativeCallBack, [ r, t, i, n, s, a, this ]), t); } else { if (x.isLocalNativeFile(t)) { if (y.subNativeFiles && 0 == y.subNativeheads.length) for (var d in y.subNativeFiles) { var p = y.subNativeFiles[d]; y.subNativeheads = y.subNativeheads.concat(p); for (var f = 0; f < p.length; f++) y.subMaps[p[f]] = d + "/" + p[f]; } if (y.subNativeFiles && -1 != t.indexOf("/")) { var g = t.split("/")[0] + "/"; if (g && -1 != y.subNativeheads.indexOf(g)) { var b = y.subMaps[g]; t = t.replace(g, b); } } return void x.read(t, r, new l(e, e.onReadNativeCallBack, [ r, t, i, n, s, a, this ])); } var w = t; -1 != m.formatURL(t).indexOf(y.window.swan.env.USER_DATA_PATH) || -1 == t.indexOf("http://") && -1 == t.indexOf("https://") || y.AutoCacheDownFile ? (u = x.getFileInfo(t)) ? (u.encoding = null == u.encoding ? "utf8" : u.encoding, x.readFile(u.url, r, new l(e, e.onReadNativeCallBack, [ r, t, i, n, s, a, this ]), t)) : "image" == this.type || "htmlimage" == this.type ? y.EnvConfig.load.call(this, t, i, n, s, a) : (t = m.formatURL(t), "image" != i && (-1 == t.indexOf("http://") && -1 == t.indexOf("https://") || x.isLocalNativeFile(t)) ? x.readFile(t, r, new l(e, e.onReadNativeCallBack, [ r, t, i, n, s, a, this ]), t) : x.downFiles(t, r, new l(e, e.onReadNativeCallBack, [ r, t, i, n, s, a, this ]), t, n)) : y.EnvConfig.load.call(this, w, i, n, s, a); } } }, e.onReadNativeCallBack = function(t, e, i, n, s, a, r, o, h) { if (void 0 === n && (n = !0), void 0 === a && (a = !1), void 0 === o && (o = 0), o) 1 == o && y.EnvConfig.load.call(r, e, i, n, s, a); else { var l; l = "json" == i || "atlas" == i ? y.getJson(h.data) : "xml" == i ? v.parseXMLFromString(h.data) : h.data, !y.isZiYu && y.isPosMsgYu, r.onLoaded(l); } }, n(e, [ "_fileTypeArr", function() { return this._fileTypeArr = [ "png", "jpg", "bmp", "jpeg", "gif" ]; } ]), e; }()), T = function(t) { function e() { this._sound = null, this.url = null, this.loaded = !1, this.readyUrl = null, e.__super.call(this); } s(e, "laya.bd.mini.MiniSound", o, "MiniSound$1"); var i = e.prototype; return i.load = function(t) { t = m.formatURL(t), this.url = t, this.readyUrl = t, e._audioCache[this.readyUrl] ? this.event("complete") : y.autoCacheFile && x.getFileInfo(t) ? this.onDownLoadCallBack(t, 0) : y.autoCacheFile ? x.downOtherFiles(t, l.create(this, this.onDownLoadCallBack, [ t ]), t) : this.onDownLoadCallBack(t, 0); }, i.onDownLoadCallBack = function(t, i) { if (i) this.event("error"); else { var n; if (y.autoCacheFile) { var s = x.getFileInfo(t).md5; n = x.getFileNativePath(s), this._sound = e._createSound(), this._sound.src = this.url = n; } else this._sound = e._createSound(), this._sound.src = t; this._sound.onCanplay(e.bindToThis(this.onCanPlay, this)), this._sound.onError(e.bindToThis(this.onError, this)); } }, i.onError = function(t) { try { console.log("-----1---------------minisound-----id:" + e._id), console.log(t); } catch (t) { console.log("-----2---------------minisound-----id:" + e._id), console.log(t); } this.event("error"), this._sound.offError(null); }, i.onCanPlay = function() { this.loaded = !0, this.event("complete"), this._sound.offCanplay(null); }, i.play = function(t, i) { void 0 === t && (t = 0), void 0 === i && (i = 0); var n; if (this.url == g._tMusic ? (e._musicAudio || (e._musicAudio = e._createSound()), n = e._musicAudio) : n = e._audioCache[this.readyUrl] ? e._audioCache[this.readyUrl]._sound : e._createSound(), y.autoCacheFile && x.getFileInfo(this.url)) { var s = x.getFileInfo(this.url).md5; n.src = this.url = x.getFileNativePath(s); } else n.src = this.url; var a = new I(n, this); return a.url = this.url, a.loops = i, a.loop = 0 === i, a.startTime = t, a.play(), g.addChannel(a), a; }, i.dispose = function() { var t = e._audioCache[this.readyUrl]; t && (t.src = "", t._sound && (t._sound.destroy(), t._sound = null, t = null), delete e._audioCache[this.readyUrl]); }, a(0, i, "duration", function() { return this._sound.duration; }), e._createSound = function() { return e._id++, y.window.swan.createInnerAudioContext(); }, e.bindToThis = function(t, e) { return t.bind(e); }, e._musicAudio = null, e._id = 0, e._audioCache = {}, e; }(), I = function(t) { function e(t, i) { this._audio = null, this._onEnd = null, this._miniSound = null, e.__super.call(this), this._audio = t, this._miniSound = i, this._onEnd = e.bindToThis(this.__onEnd, this), t.onEnded(this._onEnd); } s(e, "laya.bd.mini.MiniSoundChannel", f, "MiniSoundChannel$1"); var n = e.prototype; return n.__onEnd = function() { if (1 == this.loops) return this.completeHandler && (i.timer.once(10, this, this.__runComplete, [ this.completeHandler ], !1), this.completeHandler = null), this.stop(), void this.event("complete"); this.loops > 0 && this.loops--, this.startTime = 0, this.play(); }, n.play = function() { this.isStopped = !1, g.addChannel(this), this._audio.play(); }, n.stop = function() { this.isStopped = !0, g.removeChannel(this), this.completeHandler = null, this._audio && (this._audio.pause(), this._audio.offEnded(null), this._audio = null, this._miniSound = null, this._onEnd = null); }, n.pause = function() { this.isStopped = !0, this._audio.pause(); }, n.resume = function() { this._audio && (this.isStopped = !1, g.addChannel(this), this._audio.play()); }, a(0, n, "autoplay", function() { return this._audio.autoplay; }, function(t) { this._audio.autoplay = t; }), a(0, n, "position", function() { return this._audio ? this._audio.currentTime : 0; }), a(0, n, "duration", function() { return this._audio ? this._audio.duration : 0; }), a(0, n, "loop", function() { return this._audio.loop; }, function(t) { this._audio.loop = t; }), a(0, n, "volume", function() { return this._audio ? this._audio.volume : 1; }, function(t) { this._audio && (this._audio.volume = t); }), e.bindToThis = function(t, e) { return t.bind(e); }, e; }(); }(window, document, Laya), "function" == typeof define && define.amd && define("laya.core", [ "require", "exports" ], function(t, e) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }); for (var i in Laya) { var n = Laya[i]; n && n.__isclass && (e[i] = n); } }), function(t, e, i) { i.un, i.uns; var n = i.static, s = i.class, a = i.getset, r = (i.__newvec, laya.utils.Browser), o = i.Config, h = (laya.events.Event, laya.events.EventDispatcher), l = laya.resource.HTMLImage, u = laya.utils.Handler, c = laya.display.Input, _ = laya.net.Loader, d = (laya.net.LocalStorage, laya.maths.Matrix, laya.renders.Render), p = laya.utils.RunDriver, f = laya.media.SoundChannel, g = laya.media.SoundManager, m = laya.net.URL, v = laya.utils.Utils, y = function() { function t() {} return s(t, "laya.vv.mini.MiniFileMgr", null, "MiniFileMgr$4"), t.isLocalNativeFile = function(t) { for (var e = 0, i = w.nativefiles.length; e < i; e++) if (-1 != t.indexOf(w.nativefiles[e])) return !0; return !1; }, t.getFileInfo = function(e) { var i = t.filesListObj[e]; return null == i ? null : i; }, t.read = function(e, i, n, s, a, r) { void 0 === i && (i = "ascill"), void 0 === s && (s = ""), void 0 === a && (a = !1), void 0 === r && (r = ""); var o; o = "" == s || -1 == s.indexOf("http://") && -1 == s.indexOf("https://") ? e : t.getFileNativePath(e), t.fs.readFile({ uri: o, encoding: i, success: function(t) { t.data || (t.data = t.text), null != n && n.runWith([ 0, t ]); }, fail: function(e) { e && "" != s ? t.downFiles(s, i, n, s, a, r) : null != n && n.runWith([ 1 ]); } }); }, t.downFiles = function(e, i, n, s, a, r, o) { void 0 === i && (i = "utf8"), void 0 === s && (s = ""), void 0 === a && (a = !1), void 0 === r && (r = ""), void 0 === o && (o = !0); t.wxdown({ url: e, success: function(h) { 0 == h.errCode && (h.statusCode = 200), 200 === h.statusCode ? t.readFile(h.tempFilePath, i, n, s, a, r, o) : 403 === h.statusCode ? null != n && n.runWith([ 0, e ]) : null != n && n.runWith([ 1, h ]); }, fail: function(t) { null != n && n.runWith([ 1, t ]); } }).onProgressUpdate(function(t) { null != n && n.runWith([ 2, t.progress ]); }); }, t.readFile = function(e, i, n, s, a, r, o) { void 0 === i && (i = "ascill"), void 0 === s && (s = ""), void 0 === a && (a = !1), void 0 === r && (r = ""), void 0 === o && (o = !0), t.fs.readFile({ uri: e, encoding: i, success: function(r) { -1 != e.indexOf("http://") || -1 != e.indexOf("https://") ? (w.autoCacheFile || a) && t.copyFile(e, s, n, i, o) : (r.data || (r.data = r.text), null != n && n.runWith([ 0, r ])); }, fail: function(t) { t && null != n && n.runWith([ 1, t ]); } }); }, t.downOtherFiles = function(e, i, n, s, a) { void 0 === n && (n = ""), void 0 === s && (s = !1), void 0 === a && (a = !0), t.wxdown({ url: e, success: function(e) { 0 == e.errCode && (e.statusCode = 200), 200 === e.statusCode ? (w.autoCacheFile || s) && -1 == n.indexOf(".php") ? (null != i && i.runWith([ 0, e.tempFilePath ]), t.copyFile(e.tempFilePath, n, null, "", a)) : null != i && i.runWith([ 0, e.tempFilePath ]) : null != i && i.runWith([ 1, e ]); }, fail: function(t) { null != i && i.runWith([ 1, t ]); } }); }, t.downLoadFile = function(e, n, s, a) { void 0 === n && (n = ""), void 0 === a && (a = "utf8"), w.window.navigator.userAgent.indexOf("VVGame") < 0 ? i.loader.load(e, s) : "image" == n || "sound" == n ? t.downOtherFiles(e, s, e, !0, !1) : t.downFiles(e, a, s, e, !0, n, !1); }, t.copyFile = function(e, i, n, s, a) { void 0 === s && (s = ""), void 0 === a && (a = !0); var r = e.split("/"), o = r[r.length - 1], h = t.getFileInfo(i), l = t.getFileNativePath(o), u = t.getCacheUseSize(); h ? h.readyUrl != i ? t.fs.getFileInfo({ uri: e, success: function(r) { r.length && (r.size = r.length), a && u + 4194304 + r.size >= 52428800 && (r.size > w.minClearSize && (w.minClearSize = r.size), t.onClearCacheRes()), t.deleteFile(e, i, n, s, r.size); }, fail: function(t) { null != n && n.runWith([ 1, t ]); } }) : null != n && n.runWith([ 0 ]) : t.fs.getFileInfo({ uri: e, success: function(r) { r.length && (r.size = r.length), a && u + 4194304 + r.size >= 52428800 && (r.size > w.minClearSize && (w.minClearSize = r.size), t.onClearCacheRes()), t.fs.copyFile({ srcUri: e, dstUri: l, success: function(e) { t.onSaveFile(i, o, !0, s, n, r.size); }, fail: function(t) { null != n && n.runWith([ 1, t ]); } }); }, fail: function(t) { null != n && n.runWith([ 1, t ]); } }); }, t.onClearCacheRes = function() { var e = w.minClearSize, i = []; for (var n in t.filesListObj) "fileUsedSize" != n && i.push(t.filesListObj[n]); t.sortOn(i, "times", 16); for (var s = 0, a = 1, r = i.length; a < r; a++) { var o = i[a]; if (s >= e) break; s += o.size, t.deleteFile("", o.readyUrl); } }, t.sortOn = function(t, e, i) { return void 0 === i && (i = 0), 16 == i ? t.sort(function(t, i) { return t[e] - i[e]; }) : 18 == i ? t.sort(function(t, i) { return i[e] - t[e]; }) : t.sort(function(t, i) { return t[e] - i[e]; }); }, t.getFileNativePath = function(t) { return laya.vv.mini.MiniFileMgr.fileNativeDir + "/" + t; }, t.deleteFile = function(e, i, n, s, a) { void 0 === i && (i = ""), void 0 === s && (s = ""), void 0 === a && (a = 0); var r = t.getFileInfo(i), o = t.getFileNativePath(r.md5); t.fs.deleteFile({ uri: o, success: function(r) { var o = "" != e; if ("" != e) { var h = t.getFileNativePath(e); t.fs.copyFile({ srcUri: e, dstUri: h, success: function(a) { t.onSaveFile(i, e, o, s, n, a.size); }, fail: function(t) { null != n && n.runWith([ 1, t ]); } }); } else t.onSaveFile(i, e, o, s, n, a); }, fail: function(t) {} }); }, t.deleteAll = function() { var e = []; for (var i in t.filesListObj) "fileUsedSize" != i && e.push(t.filesListObj[i]); for (var n = 1, s = e.length; n < s; n++) { var a = e[n]; t.deleteFile("", a.readyUrl); } laya.vv.mini.MiniFileMgr.filesListObj && laya.vv.mini.MiniFileMgr.filesListObj.fileUsedSize && (laya.vv.mini.MiniFileMgr.filesListObj.fileUsedSize = 0), laya.vv.mini.MiniFileMgr.writeFilesList("", JSON.stringify({}), !1); }, t.onSaveFile = function(e, i, n, s, a, o) { void 0 === n && (n = !0), void 0 === s && (s = ""), void 0 === o && (o = 0); var h = e; if (null == t.filesListObj.fileUsedSize && (t.filesListObj.fileUsedSize = 0), n) { t.getFileNativePath(i); t.filesListObj[h] = { md5: i, readyUrl: e, size: o, times: r.now(), encoding: s }, t.filesListObj.fileUsedSize = parseInt(t.filesListObj.fileUsedSize) + o, t.writeFilesList(h, JSON.stringify(t.filesListObj), !0), null != a && a.runWith([ 0 ]); } else if (t.filesListObj[h]) { var l = parseInt(t.filesListObj[h].size); t.filesListObj.fileUsedSize = parseInt(t.filesListObj.fileUsedSize) - l, delete t.filesListObj[h], t.writeFilesList(h, JSON.stringify(t.filesListObj), !1), null != a && a.runWith([ 0 ]); } }, t.writeFilesList = function(e, i, n) { var s = t.fileNativeDir + "/" + t.fileListName; t.fs.writeFile({ uri: s, encoding: "utf8", data: i, success: function(t) {}, fail: function(t) {} }), !w.isZiYu && w.isPosMsgYu && w.window.qg.postMessage && w.window.qg.postMessage({ url: e, data: t.filesListObj[e], isLoad: "filenative", isAdd: n }); }, t.getCacheUseSize = function() { return t.filesListObj && t.filesListObj.fileUsedSize ? t.filesListObj.fileUsedSize : 0; }, t.existDir = function(e, i) { t.fs.mkdir({ uri: e, success: function(t) { null != i && i.runWith([ 0, { data: JSON.stringify({}) } ]); }, fail: function(e, n) { if (300 == n) { var s = {}; s.errMsg = "file already exists"; } -1 != s.errMsg.indexOf("file already exists") ? t.readSync(t.fileListName, "utf8", i) : null != i && i.runWith([ 1, s ]); } }); }, t.readSync = function(e, i, n, s) { void 0 === i && (i = "ascill"), void 0 === s && (s = ""); var a, r = t.getFileNativePath(e); try { -1 != (a = t.fs.readFileSync({ uri: r, encoding: i })).indexOf("No such file or directory") && (a = JSON.stringify({})), null != n && n.runWith([ 0, { data: a } ]); } catch (t) { null != n && n.runWith([ 1 ]); } }, t.setNativeFileDir = function(e) { t.fileNativeDir = w.window.qg.env.USER_DATA_PATH + e; }, t.filesListObj = {}, t.fileNativeDir = null, t.fileListName = "layaairfiles.txt", t.ziyuFileData = {}, t.ziyuFileTextureData = {}, t.loadPath = "", t.DESCENDING = 2, t.NUMERIC = 16, n(t, [ "fs", function() { return this.fs = w.window.qg; }, "wxdown", function() { return this.wxdown = w.window.qg.download; } ]), t; }(), x = function() { function t() {} s(t, "laya.vv.mini.MiniImage", null, "MiniImage$4"); return t.prototype._loadImage = function(e) { if (w.isZiYu) t.onCreateImage(e, this, !0); else { var i = !1; if (y.isLocalNativeFile(e)) { if (-1 != e.indexOf("http://") || -1 != e.indexOf("https://")) if ("" != y.loadPath) e = e.split(y.loadPath)[1]; else { var n = "" != m.rootPath ? m.rootPath : m.basePath, s = e; "" != n && (e = e.split(n)[1]), e || (e = s); } if (w.subNativeFiles && 0 == w.subNativeheads.length) for (var a in w.subNativeFiles) { var r = w.subNativeFiles[a]; w.subNativeheads = w.subNativeheads.concat(r); for (var o = 0; o < r.length; o++) w.subMaps[r[o]] = a + "/" + r[o]; } if (w.subNativeFiles && -1 != e.indexOf("/")) { var h = e.split("/")[0] + "/"; if (h && -1 != w.subNativeheads.indexOf(h)) { var l = w.subMaps[h]; e = e.replace(h, l); } } } else i = !0, e = m.formatURL(e); y.getFileInfo(e) ? t.onCreateImage(e, this, !i) : -1 != e.indexOf("http://") || -1 != e.indexOf("https://") ? w.isZiYu ? t.onCreateImage(e, this, !0) : y.downOtherFiles(e, new u(t, t.onDownImgCallBack, [ e, this ]), e) : t.onCreateImage(e, this, !0); } }, t.onDownImgCallBack = function(e, i, n, s) { void 0 === s && (s = ""), n ? i.onError(null) : t.onCreateImage(e, i, !1, s); }, t.onCreateImage = function(t, e, i, n) { function s() { u.onload = null, u.onerror = null, delete e.imgCache[t]; } void 0 === i && (i = !1), void 0 === n && (n = ""); var a; if (w.autoCacheFile) if (i) if (w.isZiYu) { var o = m.formatURL(t); a = y.ziyuFileTextureData[o] ? y.ziyuFileTextureData[o] : t; } else a = t; else if ("" != n) a = n; else { var h = y.getFileInfo(t).md5; a = y.getFileNativePath(h); } else a = i ? t : n; null == e.imgCache && (e.imgCache = {}); var u, c = function() { s(), e.onLoaded(u); }, _ = function() { s(), e.event("error", "Load image failed"); }; "nativeimage" == e._type ? ((u = new r.window.Image()).crossOrigin = "", u.onload = c, u.onerror = _, u.src = a, e.imgCache[t] = u) : new l.create(a, { onload: c, onerror: _, onCreate: function(i) { u = i, e.imgCache[t] = i; } }); }, t; }(), b = function() { function t() {} return s(t, "laya.vv.mini.MiniInput", null, "MiniInput$4"), t._createInputElement = function() { c._initInput(c.area = r.createElement("textarea")), c._initInput(c.input = r.createElement("input")), c.inputContainer = r.createElement("div"), c.inputContainer.style.position = "absolute", c.inputContainer.style.zIndex = 1e5, r.container.appendChild(c.inputContainer), c.inputContainer.setPos = function(t, e) { c.inputContainer.style.left = t + "px", c.inputContainer.style.top = e + "px"; }, i.stage.on("resize", null, t._onStageResize), w.window.qg.onWindowResize && w.window.qg.onWindowResize(function(t) { w.window.dispatchEvent && w.window.dispatchEvent("resize"); }), g._soundClass = S, g._musicClass = S, r.onAndroid = !0, r.onIPhone = !1, r.onIOS = !1, r.onIPad = !1; }, t._onStageResize = function() { i.stage._canvasTransform.identity().scale(r.width / d.canvas.width / p.getPixelRatio(), r.height / d.canvas.height / p.getPixelRatio()); }, t.wxinputFocus = function(t) { var e = c.inputElement.target; e && !e.editable || (w.window.qg.offKeyboardConfirm(), w.window.qg.offKeyboardInput(), w.window.qg.showKeyboard({ defaultValue: e.text, maxLength: e.maxChars, multiple: e.multiline, confirmHold: !0, confirmType: "done", success: function(t) {}, fail: function(t) {} }), w.window.qg.onKeyboardConfirm(function(t) { var i = t ? t.value : ""; e.text = i, e.event("input"), laya.vv.mini.MiniInput.inputEnter(); }), w.window.qg.onKeyboardInput(function(t) { var i = t ? t.value : ""; e.multiline || -1 == i.indexOf("\n") ? (e.text = i, e.event("input")) : laya.vv.mini.MiniInput.inputEnter(); })); }, t.inputEnter = function() { c.inputElement.target.focus = !1; }, t.wxinputblur = function() { t.hideKeyboard(); }, t.hideKeyboard = function() { w.window.qg.offKeyboardConfirm(), w.window.qg.offKeyboardInput(), w.window.qg.hideKeyboard({ success: function(t) { console.log("隐藏键盘"); }, fail: function(t) { console.log("隐藏键盘出错:" + (t ? t.errMsg : "")); } }); }, t; }(), w = (function() { function t() {} s(t, "laya.vv.mini.MiniLocalStorage", null, "MiniLocalStorage$4"), t.__init__ = function() { t.items = t; }, t.setItem = function(t, e) { try { w.window.qg.setStorageSync({ key: t, data: e }); } catch (i) { w.window.qg.setStorage({ key: t, data: e }); } }, t.getItem = function(t) { return w.window.qg.getStorageSync({ key: t }); }, t.setJSON = function(e, i) { t.setItem(e, JSON.stringify(i)); }, t.getJSON = function(e) { try { return JSON.parse(t.getItem(e)); } catch (i) { return t.getItem(e); } }, t.removeItem = function(t) { w.window.qg.removeStorageSync(t); }, t.clear = function() { w.window.qg.clearStorageSync(); }, t.getStorageInfoSync = function() { try { return w.window.qg.getStorageInfoSync(); } catch (t) {} return null; }, t.support = !0, t.items = null; }(), function() { function t() {} s(t, "laya.vv.mini.MiniLocation", null, "MiniLocation$4"), t.__init__ = function() { w.window.navigator.geolocation.getCurrentPosition = t.getCurrentPosition, w.window.navigator.geolocation.watchPosition = t.watchPosition, w.window.navigator.geolocation.clearWatch = t.clearWatch; }, t.getCurrentPosition = function(t, e, i) { var n; (n = {}).success = function(e) { null != t && t(e); }, n.fail = e, w.window.qg.getLocation(n); }, t.watchPosition = function(e, n, s) { t._curID++; var a; return a = {}, a.success = e, a.error = n, t._watchDic[t._curID] = a, i.timer.loop(1e3, null, t._myLoop), t._curID; }, t.clearWatch = function(e) { delete t._watchDic[e], t._hasWatch() || i.timer.clear(null, t._myLoop); }, t._hasWatch = function() { var e; for (e in t._watchDic) if (t._watchDic[e]) return !0; return !1; }, t._myLoop = function() { t.getCurrentPosition(t._mySuccess, t._myError); }, t._mySuccess = function(e) { var i = {}; i.coords = e, i.timestamp = r.now(); var n; for (n in t._watchDic) t._watchDic[n].success && t._watchDic[n].success(i); }, t._myError = function(e) { var i; for (i in t._watchDic) t._watchDic[i].error && t._watchDic[i].error(e); }, t._watchDic = {}, t._curID = 0; }(), function() { function t(t, e) { this.videoend = !1, this.videourl = "", this.videoElement = null, this.onPlayFunc = null, this.onEndedFunC = null, this._duration = NaN, this.position = NaN, void 0 === t && (t = 320), void 0 === e && (e = 240), this.videoElement = w.window.qg.createVideo({ width: t, height: e, autoplay: !0 }); } s(t, "laya.vv.mini.MiniVideo", null, "MiniVideo$2"); var e = t.prototype; e.on = function(t, e, i) { "loadedmetadata" == t ? (this.onPlayFunc = i.bind(e), this.videoElement.onPlay = this.onPlayFunction.bind(this)) : "ended" == t && (this.onEndedFunC = i.bind(e), this.videoElement.onEnded = this.onEndedFunction.bind(this)), this.videoElement.onTimeUpdate = this.onTimeUpdateFunc.bind(this); }, e.onTimeUpdateFunc = function(t) { this.position = t.position, this._duration = t.duration; }, e.onPlayFunction = function() { this.videoElement && (this.videoElement.readyState = 200), console.log("=====视频加载完成========"), null != this.onPlayFunc && this.onPlayFunc(); }, e.onEndedFunction = function() { this.videoElement && (this.videoend = !0, console.log("=====视频播放完毕========"), null != this.onEndedFunC && this.onEndedFunC()); }, e.off = function(t, e, i) { "loadedmetadata" == t ? (this.onPlayFunc = i.bind(e), this.videoElement.offPlay = this.onPlayFunction.bind(this)) : "ended" == t && (this.onEndedFunC = i.bind(e), this.videoElement.offEnded = this.onEndedFunction.bind(this)); }, e.load = function(t) { this.videoElement && (this.videoElement.src = t); }, e.play = function() { this.videoElement && (this.videoend = !1, this.videoElement.play()); }, e.pause = function() { this.videoElement && (this.videoend = !0, this.videoElement.pause()); }, e.size = function(t, e) { this.videoElement && (this.videoElement.width = t, this.videoElement.height = e); }, e.destroy = function() { this.videoElement && this.videoElement.destroy(), this.videoElement = null, this.onEndedFunC = null, this.onPlayFunc = null, this.videoend = !1, this.videourl = null; }, e.reload = function() { this.videoElement && (this.videoElement.src = this.videourl); }, a(0, e, "duration", function() { return this._duration; }), a(0, e, "paused", function() { return !!this.videoElement && this.videoElement.paused; }), a(0, e, "loop", function() { return !!this.videoElement && this.videoElement.loop; }, function(t) { this.videoElement && (this.videoElement.loop = t); }), a(0, e, "currentTime", function() { return this.videoElement ? this.videoElement.initialTime : 0; }, function(t) { this.videoElement && (this.videoElement.initialTime = t); }), a(0, e, "ended", function() { return this.videoend; }), a(0, e, "muted", function() { return !!this.videoElement && this.videoElement.muted; }, function(t) { this.videoElement && (this.videoElement.muted = t); }), a(0, e, "videoWidth", function() { return this.videoElement ? this.videoElement.width : 0; }), a(0, e, "videoHeight", function() { return this.videoElement ? this.videoElement.height : 0; }), a(0, e, "playbackRate", function() { return this.videoElement ? this.videoElement.playbackRate : 0; }, function(t) { this.videoElement && (this.videoElement.playbackRate = t); }), a(0, e, "x", function() { return this.videoElement ? this.videoElement.x : 0; }, function(t) { this.videoElement && (this.videoElement.x = t); }), a(0, e, "y", function() { return this.videoElement ? this.videoElement.y : 0; }, function(t) { this.videoElement && (this.videoElement.y = t); }), a(0, e, "currentSrc", function() { return this.videoElement.src; }), t.__init__ = function() { laya.device.media.Video = t; }; }(), function() { function a() {} return s(a, "laya.vv.mini.VVMiniAdapter"), a.getJson = function(t) { return JSON.parse(t); }, a.init = function(e, n) { if (void 0 === e && (e = !1), void 0 === n && (n = !1), !a._inited && (a._inited = !0, (a.window = t).hasOwnProperty("qg") && !(a.window.navigator.userAgent.indexOf("VVGame") < 0))) { a.isZiYu = n, a.isPosMsgYu = e, a.EnvConfig = {}; try { laya.webgl.resource.WebGLCanvas.premulAlpha = !0; } catch (t) {} laya.vv.mini.VVMiniAdapter.window.qg.env || (laya.vv.mini.VVMiniAdapter.window.qg.env = {}, laya.vv.mini.VVMiniAdapter.window.qg.env.USER_DATA_PATH = "internal://files"), a.isZiYu || (y.setNativeFileDir("/layaairGame"), y.existDir(y.fileNativeDir, u.create(a, a.onMkdirCallBack))), a.systemInfo = a.window.qg.getSystemInfoSync(), a.window.focus = function() {}, i._getUrlPath = function() {}, i.getUrlPath = function() {}, a.window.logtime = function(t) {}, a.window.alertTimeLog = function(t) {}, a.window.resetShareInfo = function() {}, a.window.CanvasRenderingContext2D = function() {}, a.window.CanvasRenderingContext2D.prototype = a.window.qg.createCanvas().getContext("2d").__proto__, a.window.document.body.appendChild = function() {}, a.EnvConfig.pixelRatioInt = 0, p.getPixelRatio = a.pixelRatio, a._preCreateElement = r.createElement, r.createElement = a.createElement, p.createShaderCondition = a.createShaderCondition, v.parseXMLFromString = a.parseXMLFromString, c._createInputElement = b._createInputElement, a.EnvConfig.load = _.prototype.load, _.prototype.load = C.prototype.load, _.prototype._loadImage = x.prototype._loadImage, a.onReciveData(), o.useRetinalCanvas = !0, o.CborderSize = 0; } }, a.onReciveData = function() { laya.vv.mini.VVMiniAdapter.isZiYu && a.window.qg.onMessage && a.window.qg.onMessage(function(t) { "opendatacontext" == t.isLoad ? t.url && (y.ziyuFileData[t.url] = t.atlasdata, y.ziyuFileTextureData[t.imgReadyUrl] = t.imgNativeUrl) : "openJsondatacontext" == t.isLoad ? t.url && (y.ziyuFileData[t.url] = t.atlasdata) : "openJsondatacontextPic" == t.isLoad && (y.ziyuFileTextureData[t.imgReadyUrl] = t.imgNativeUrl); }); }, a.measureText = function(t) { var e = a._measureText(t); return e || (e = { width: 16 }, console.warn("-------微信获取文字宽度失败----等待修复---------")), e; }, a.getUrlEncode = function(t, e) { return "arraybuffer" == e ? "binary" : "utf8"; }, a.downLoadFile = function(t, e, i, n) { void 0 === e && (e = ""), void 0 === n && (n = "utf8"); y.getFileInfo(t) ? null != i && i.runWith([ 0 ]) : y.downLoadFile(t, e, i, n); }, a.remove = function(t, e) { y.deleteFile("", t, e, "", 0); }, a.removeAll = function() { y.deleteAll(); }, a.hasNativeFile = function(t) { return y.isLocalNativeFile(t); }, a.getFileInfo = function(t) { return y.getFileInfo(t); }, a.getFileList = function() { return y.filesListObj; }, a.exitMiniProgram = function() { a.window.qg.exitMiniProgram(); }, a.onMkdirCallBack = function(t, e) { t || (y.filesListObj = JSON.parse(e.data)); }, a.pixelRatio = function() { if (!a.EnvConfig.pixelRatioInt) try { return a.systemInfo.pixelRatio = a.window.devicePixelRatio, a.EnvConfig.pixelRatioInt = a.systemInfo.pixelRatio, a.systemInfo.pixelRatio; } catch (t) {} return a.EnvConfig.pixelRatioInt; }, a.createElement = function(t) { if ("canvas" == t) { var i; return 1 == a.idx ? a.isZiYu ? (i = {}).style = {} : i = e.getElementById("canvas") : i = a.window.qg.createCanvas(), a.idx++, i; } if ("textarea" == t || "input" == t) return a.onCreateInput(t); if ("div" == t) { var n = a._preCreateElement(t); return n.contains = function(t) { return null; }, n.removeChild = function(t) {}, n; } return a._preCreateElement(t); }, a.onCreateInput = function(t) { var e = a._preCreateElement(t); return e.focus = b.wxinputFocus, e.blur = b.wxinputblur, e.style = {}, e.value = 0, e.parentElement = {}, e.placeholder = {}, e.type = {}, e.setColor = function(t) {}, e.setType = function(t) {}, e.setFontFace = function(t) {}, e.addEventListener = function(t) {}, e.contains = function(t) { return null; }, e.removeChild = function(t) {}, e; }, a.createShaderCondition = function(t) { var e = this; return function() { return e[t.replace("this.", "")]; }; }, a.sendAtlasToOpenDataContext = function(t) { if (!laya.vv.mini.VVMiniAdapter.isZiYu) { var e = _.getRes(m.formatURL(t)); if (!e) throw "传递的url没有获取到对应的图集数据信息,请确保图集已经过!"; e.meta.image.split(","); if (e.meta && e.meta.image) for (var i = e.meta.image.split(","), n = t.indexOf("/") >= 0 ? "/" : "\\", s = t.lastIndexOf(n), r = s >= 0 ? t.substr(0, s + 1) : "", o = 0, h = i.length; o < h; o++) i[o] = r + i[o]; else i = [ t.replace(".json", ".png") ]; for (o = 0; o < i.length; o++) { var l = i[o]; a.postInfoToContext(t, l, e); } } }, a.postInfoToContext = function(t, e, i) { var n = { frames: i.frames, meta: i.meta }, s = e, r = y.getFileInfo(m.formatURL(e)); if (r) var o = r.md5, h = y.getFileNativePath(o); else h = s; if (!h || !a.window.qg.postMessage) throw "获取图集的磁盘url路径不存在!"; a.window.qg.postMessage({ url: t, atlasdata: n, imgNativeUrl: h, imgReadyUrl: s, isLoad: "opendatacontext" }); }, a.sendSinglePicToOpenDataContext = function(t) { var e = m.formatURL(t), i = y.getFileInfo(e); if (i) { var n = i.md5, s = y.getFileNativePath(n); t = e; } else s = t; if (!s || !a.window.qg.postMessage) throw "获取图集的磁盘url路径不存在!"; a.window.qg.postMessage({ url: t, imgNativeUrl: s, imgReadyUrl: t, isLoad: "openJsondatacontextPic" }); }, a.sendJsonDataToDataContext = function(t) { if (!laya.vv.mini.VVMiniAdapter.isZiYu && a.window.qg.postMessage) { var e = _.getRes(t); if (!e) throw "传递的url没有获取到对应的图集数据信息,请确保图集已经过!"; a.window.qg.postMessage({ url: t, atlasdata: e, isLoad: "openJsondatacontext" }); } }, a.EnvConfig = null, a.window = null, a._preCreateElement = null, a._inited = !1, a.systemInfo = null, a.isZiYu = !1, a.isPosMsgYu = !1, a.autoCacheFile = !0, a.minClearSize = 5242880, a.subNativeFiles = null, a.subNativeheads = [], a.subMaps = [], a.AutoCacheDownFile = !1, a._measureText = null, a.parseXMLFromString = function(e) { var i; e = e.replace(/>\s+<"); try { i = new t.Parser.DOMParser().parseFromString(e, "text/xml"); } catch (t) { throw "需要引入xml解析库文件"; } return i; }, a.idx = 1, n(a, [ "nativefiles", function() { return this.nativefiles = [ "layaNativeDir", "files" ]; } ]), a; }()), C = (function(t) { function e() { e.__super.call(this); } s(e, "laya.vv.mini.MiniAccelerator", t, "MiniAccelerator$4"); var i = e.prototype; i.on = function(i, n, s, a) { return t.prototype.on.call(this, i, n, s, a), e.startListen(this.onAccelerometerChange), this; }, i.off = function(i, n, s, a) { return void 0 === a && (a = !1), this.hasListener(i) || e.stopListen(), t.prototype.off.call(this, i, n, s, a); }, e.__init__ = function() { try { var t; if (!(t = laya.device.motion.Accelerator)) return; t.prototype.on = e.prototype.on, t.prototype.off = e.prototype.off; } catch (t) {} }, e.startListen = function(t) { if (e._callBack = t, !e._isListening) { e._isListening = !0; try { w.window.qg.subscribeAccelerometer(laya.vv.mini.MiniAccelerator.onAccelerometerChange); } catch (t) {} } }, e.stopListen = function() { e._isListening = !1; try { w.window.qg.unsubscribeAccelerometer(); } catch (t) {} }, e.onAccelerometerChange = function(t) { var i; (i = {}).acceleration = t, i.accelerationIncludingGravity = t, i.rotationRate = {}, null != e._callBack && e._callBack(i); }, e._isListening = !1, e._callBack = null; }(h), function(t) { function e() { e.__super.call(this); } s(e, "laya.vv.mini.MiniLoader", h, "MiniLoader$4"); return e.prototype.load = function(t, i, n, s, a) { void 0 === n && (n = !0), void 0 === a && (a = !1); if (this._url = t, 0 === t.indexOf("data:image") ? this._type = i = "image" : this._type = i || (i = this.getTypeFromUrl(t)), this._cache = n, this._data = null, !a && _.loadedMap[m.formatURL(t)]) return this._data = _.loadedMap[m.formatURL(t)], this.event("progress", 1), void this.event("complete", this._data); if (null != _.parserMap[i]) return this._customParse = !0, void (_.parserMap[i] instanceof laya.utils.Handler ? _.parserMap[i].runWith(this) : _.parserMap[i].call(null, this)); var r = w.getUrlEncode(t, i), o = v.getFileExtension(t); if (-1 != e._fileTypeArr.indexOf(o) || "image" == i) w.EnvConfig.load.call(this, t, i, n, s, a); else { if (w.isZiYu && !y.ziyuFileData[t] && (t = m.formatURL(t)), w.isZiYu && y.ziyuFileData[t]) { var h = y.ziyuFileData[t]; return void this.onLoaded(h); } if (y.getFileInfo(m.formatURL(t))) { var l = y.getFileInfo(m.formatURL(t)); l.encoding = null == l.encoding ? "utf8" : l.encoding; var c = y.getFileNativePath(l.md5); y.readFile(c, l.encoding, new u(e, e.onReadNativeCallBack, [ r, t, i, n, s, a, this ]), m.formatURL(t)); } else { if (y.isLocalNativeFile(t)) { if (w.subNativeFiles && 0 == w.subNativeheads.length) for (var d in w.subNativeFiles) { var p = w.subNativeFiles[d]; w.subNativeheads = w.subNativeheads.concat(p); for (var f = 0; f < p.length; f++) w.subMaps[p[f]] = d + "/" + p[f]; } if (w.subNativeFiles && -1 != t.indexOf("/")) { var g = t.split("/")[0] + "/"; if (g && -1 != w.subNativeheads.indexOf(g)) { var x = w.subMaps[g]; t = t.replace(g, x); } } return void y.read(t, r, new u(e, e.onReadNativeCallBack, [ r, t, i, n, s, a, this ])); } var b = t; -1 != m.formatURL(t).indexOf(w.window.qg.env.USER_DATA_PATH) || -1 == t.indexOf("http://") && -1 == t.indexOf("https://") || w.AutoCacheDownFile ? (l = y.getFileInfo(t)) ? (l.encoding = null == l.encoding ? "utf8" : l.encoding, y.readFile(l.url, r, new u(e, e.onReadNativeCallBack, [ r, t, i, n, s, a, this ]), t)) : "image" == this.type || "htmlimage" == this.type ? w.EnvConfig.load.call(this, t, i, n, s, a) : (t = m.formatURL(t), "image" != i && (-1 == t.indexOf("http://") && -1 == t.indexOf("https://") || y.isLocalNativeFile(t)) ? y.readFile(t, r, new u(e, e.onReadNativeCallBack, [ r, t, i, n, s, a, this ]), t) : y.downFiles(t, r, new u(e, e.onReadNativeCallBack, [ r, t, i, n, s, a, this ]), t, !0)) : w.EnvConfig.load.call(this, b, i, n, s, a); } } }, e.onReadNativeCallBack = function(t, e, i, n, s, a, r, o, h) { if (void 0 === n && (n = !0), void 0 === a && (a = !1), void 0 === o && (o = 0), o) 1 == o && (console.log("-----------本地加载失败,尝试外网加载----"), w.EnvConfig.load.call(r, e, i, n, s, a)); else { var l; l = "json" == i || "atlas" == i ? w.getJson(h.data) : "xml" == i ? v.parseXMLFromString(h.data) : h.data, !w.isZiYu && w.isPosMsgYu && "arraybuffer" != i && w.window.qg.postMessage && w.window.qg.postMessage({ url: e, data: l, isLoad: "filedata" }), r.onLoaded(l); } }, n(e, [ "_fileTypeArr", function() { return this._fileTypeArr = [ "png", "jpg", "bmp", "jpeg", "gif" ]; } ]), e; }()), S = function(t) { function e() { this._sound = null, this.url = null, this.loaded = !1, this.readyUrl = null, e.__super.call(this); } s(e, "laya.vv.mini.MiniSound", h, "MiniSound$4"); var n = e.prototype; return n.load = function(t) { if (y.isLocalNativeFile(t)) { if (-1 != t.indexOf("http://") || -1 != t.indexOf("https://")) if ("" != y.loadPath) t = t.split(y.loadPath)[1]; else { var i = "" != m.rootPath ? m.rootPath : m.basePath; "" != i && (t = t.split(i)[1]); } } else t = m.formatURL(t); if (this.url = t, this.readyUrl = t, e._audioCache[this.readyUrl]) this.event("complete"); else if (w.autoCacheFile && y.getFileInfo(t)) this.onDownLoadCallBack(t, 0); else if (w.autoCacheFile) if (y.isLocalNativeFile(t)) { var n = t; if ("" != (i = "" != m.rootPath ? m.rootPath : m.basePath) && (t = t.split(i)[1]), t || (t = n), w.subNativeFiles && 0 == w.subNativeheads.length) for (var s in w.subNativeFiles) { var a = w.subNativeFiles[s]; w.subNativeheads = w.subNativeheads.concat(a); for (var r = 0; r < a.length; r++) w.subMaps[a[r]] = s + "/" + a[r]; } if (w.subNativeFiles && -1 != t.indexOf("/")) { var o = t.split("/")[0] + "/"; if (o && -1 != w.subNativeheads.indexOf(o)) { var h = w.subMaps[o]; t = t.replace(o, h); } } this.onDownLoadCallBack(t, 0); } else !y.isLocalNativeFile(t) && -1 == t.indexOf("http://") && -1 == t.indexOf("https://") || -1 != t.indexOf("http://usr/") ? this.onDownLoadCallBack(t, 0) : y.downOtherFiles(t, u.create(this, this.onDownLoadCallBack, [ t ]), t); else this.onDownLoadCallBack(t, 0); }, n.onDownLoadCallBack = function(t, n, s) { if (n) this.event("error"); else { var a; if (w.autoCacheFile) { if (s) a = s; else if (y.isLocalNativeFile(t)) { var r = "" != m.rootPath ? m.rootPath : m._basePath, o = t; "" == r || -1 == t.indexOf("http://") && -1 == t.indexOf("https://") || (a = t.split(r)[1]), a || (a = o); } else { var h = y.getFileInfo(t); if (h && h.md5) { var l = h.md5; a = y.getFileNativePath(l); } else a = t; } this._sound = e._createSound(), this._sound.src = this.url = a; } else this._sound = e._createSound(), this._sound.src = t; this._sound.onCanplay ? (this._sound.onCanplay(e.bindToThis(this.onCanPlay, this)), this._sound.onError(e.bindToThis(this.onError, this))) : (i.timer.clear(this, this.onCheckComplete), i.timer.frameLoop(2, this, this.onCheckComplete)); } }, n.onCheckComplete = function() { this._sound && this._sound.duration > 0 && this.onCanPlay(), i.timer.clear(this, this.onCheckComplete); }, n.onError = function(t) { try { console.log("-----1---------------minisound-----id:" + e._id), console.log(t); } catch (t) { console.log("-----2---------------minisound-----id:" + e._id), console.log(t); } this.event("error"), this._sound.offError && this._sound.offError(null); }, n.onCanPlay = function() { this.loaded = !0, this.event("complete"), this._sound.offCanplay && this._sound.offCanplay(null); }, n.play = function(t, i) { void 0 === t && (t = 0), void 0 === i && (i = 0); var n; if (this.url == g._tMusic ? (e._musicAudio || (e._musicAudio = e._createSound()), n = e._musicAudio) : n = e._audioCache[this.readyUrl] ? e._audioCache[this.readyUrl]._sound : e._createSound(), w.autoCacheFile && y.getFileInfo(this.url)) { var s = y.getFileInfo(this.url).md5; n.src = this.url = y.getFileNativePath(s); } else n.src = this.url; var a = new T(n, this); return a.url = this.url, a.loops = i, a.loop = 0 === i, a.startTime = t, a.play(), g.addChannel(a), a; }, n.dispose = function() { var t = e._audioCache[this.readyUrl]; t && (t.src = "", t._sound && (t._sound.destroy(), t._sound = null, t = null), delete e._audioCache[this.readyUrl]); }, a(0, n, "duration", function() { return this._sound.duration; }), e._createSound = function() { return e._id++, w.window.qg.createInnerAudioContext(); }, e.bindToThis = function(t, e) { return t.bind(e); }, e._musicAudio = null, e._id = 0, e._audioCache = {}, e; }(), T = function(t) { function e(t, i) { this._audio = null, this._onEnd = null, this._miniSound = null, e.__super.call(this), this._audio = t, this._miniSound = i, this._onEnd = e.bindToThis(this.__onEnd, this), t.onEnded(this._onEnd); } s(e, "laya.vv.mini.MiniSoundChannel", f, "MiniSoundChannel$4"); var n = e.prototype; return n.__onEnd = function() { if (S._audioCache[this.url] = this._miniSound, 1 == this.loops) return this.completeHandler && (i.timer.once(10, this, this.__runComplete, [ this.completeHandler ], !1), this.completeHandler = null), this.stop(), void this.event("complete"); this.loops > 0 && this.loops--, this.startTime = 0, this.play(); }, n.play = function() { this.isStopped = !1, g.addChannel(this), this._audio.play(); }, n.stop = function() { this.isStopped = !0, g.removeChannel(this), this.completeHandler = null, this._audio && (this._audio.stop(), this._audio.offEnded(null), this._miniSound.dispose(), this._audio = null, this._miniSound = null, this._onEnd = null); }, n.pause = function() { this.isStopped = !0, this._audio.pause(); }, n.resume = function() { this._audio && (this.isStopped = !1, g.addChannel(this), this._audio.play()); }, a(0, n, "startTime", null, function(t) { this._audio && (this._audio.startTime = t); }), a(0, n, "autoplay", function() { return this._audio.autoplay; }, function(t) { this._audio.autoplay = t; }), a(0, n, "position", function() { return this._audio ? this._audio.currentTime : 0; }), a(0, n, "duration", function() { return this._audio ? this._audio.duration : 0; }), a(0, n, "loop", function() { return this._audio.loop; }, function(t) { this._audio.loop = t; }), a(0, n, "volume", function() { return this._audio ? this._audio.volume : 1; }, function(t) { this._audio && (this._audio.volume = t); }), e.bindToThis = function(t, e) { return t.bind(e); }, e; }(); }(window, document, Laya), "function" == typeof define && define.amd && define("laya.core", [ "require", "exports" ], function(t, e) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }); for (var i in Laya) { var n = Laya[i]; n && n.__isclass && (e[i] = n); } }), function(t, e, i) { i.un, i.uns; var n = i.static, s = i.class, a = i.getset, r = i.__newvec, o = laya.maths.Arith, h = laya.maths.Bezier, l = laya.resource.Bitmap, u = laya.utils.Browser, c = laya.utils.Byte, _ = laya.utils.Color, d = (laya.filters.ColorFilter, i.Config), p = laya.resource.Context, f = (laya.events.Event, laya.filters.Filter), g = laya.display.Graphics, m = laya.resource.HTMLCanvas, v = (laya.utils.HTMLChar, laya.resource.HTMLImage), y = laya.resource.HTMLSubImage, x = (laya.utils.Handler, laya.net.Loader, laya.maths.Matrix), b = laya.maths.Point, w = laya.maths.Rectangle, C = laya.renders.Render, S = (laya.renders.RenderContext, laya.renders.RenderSprite), T = laya.resource.Resource, I = laya.resource.ResourceManager, M = laya.utils.RunDriver, E = laya.display.Sprite, A = laya.display.Stage, L = laya.utils.Stat, P = laya.utils.StringKey, k = (laya.display.css.Style, laya.system.System), R = laya.display.Text, D = laya.resource.Texture, N = (laya.display.css.TransformInfo, laya.net.URL, laya.utils.Utils), F = laya.utils.VectorGraphManager; laya.utils.WordText; i.interface("laya.webgl.shapes.IShape"), i.interface("laya.webgl.submit.ISubmit"), i.interface("laya.webgl.text.ICharSegment"), i.interface("laya.webgl.canvas.save.ISaveData"), i.interface("laya.webgl.resource.IMergeAtlasBitmap"), i.interface("laya.filters.IFilterActionGL", "laya.filters.IFilterAction"); var B = function() { function t() {} s(t, "laya.filters.webgl.FilterActionGL"); var e = t.prototype; return i.imps(e, { "laya.filters.IFilterActionGL": !0 }), e.setValue = function(t) {}, e.setValueMix = function(t) {}, e.apply3d = function(t, e, i, n, s) { return null; }, e.apply = function(t) { return null; }, a(0, e, "typeMix", function() { return 0; }), t; }(), O = function() { function t() {} return s(t, "laya.webgl.shader.ShaderValue"), t; }(), z = function() { function t(t, e, n) { this._atlasID = 0, this._width = 0, this._height = 0, this._texCount = 0, this._rowInfo = null, this._cells = null, this._failSize = new i(), void 0 === t && (t = 0), void 0 === e && (e = 0), void 0 === n && (n = 0), this._cells = null, this._rowInfo = null, this._init(t, e), this._atlasID = n; } var e, i; s(t, "laya.webgl.atlas.AtlasGrid"); var n = t.prototype; return n.getAltasID = function() { return this._atlasID; }, n.setAltasID = function(t) { t >= 0 && (this._atlasID = t); }, n.addTex = function(t, e, i) { var n = this._get(e, i); return 0 == n.ret ? n : (this._fill(n.x, n.y, e, i, t), this._texCount++, n); }, n._release = function() { null != this._cells && (this._cells.length = 0, this._cells = null), this._rowInfo && (this._rowInfo.length = 0, this._rowInfo = null); }, n._init = function(t, i) { if (this._width = t, this._height = i, this._release(), 0 == this._width) return !1; this._cells = new Uint8Array(this._width * this._height * 3), this._rowInfo = r(this._height); for (var n = 0; n < this._height; n++) this._rowInfo[n] = new e(); return this._clear(), !0; }, n._get = function(t, e) { var i = new V(); if (t >= this._failSize.width && e >= this._failSize.height) return i; for (var n = -1, s = -1, a = this._width, r = this._height, o = this._cells, h = 0; h < r; h++) if (!(this._rowInfo[h].spaceCount < t)) for (var l = 0; l < a; ) { var u = 3 * (h * a + l); if (0 != o[u] || o[u + 1] < t || o[u + 2] < e) l += o[u + 1]; else { n = l, s = h; for (var c = 0; c < t; c++) if (o[3 * c + u + 2] < e) { n = -1; break; } if (!(n < 0)) return i.ret = !0, i.x = n, i.y = s, i; l += o[u + 1]; } } return i; }, n._fill = function(t, e, i, n, s) { var a = this._width, r = this._height; this._check(t + i <= a && e + n <= r); for (var o = e; o < n + e; ++o) { this._check(this._rowInfo[o].spaceCount >= i), this._rowInfo[o].spaceCount -= i; for (var h = 0; h < i; h++) { var l = 3 * (t + o * a + h); this._check(0 == this._cells[l]), this._cells[l] = s, this._cells[l + 1] = i, this._cells[l + 2] = n; } } if (t > 0) for (o = 0; o < n; ++o) { var u = 0; for (h = t - 1; h >= 0 && 0 == this._cells[3 * ((e + o) * a + h)]; --h, ++u) ; for (h = u; h > 0; --h) this._cells[3 * ((e + o) * a + t - h) + 1] = h, this._check(h > 0); } if (e > 0) for (h = t; h < t + i; ++h) { for (u = 0, o = e - 1; o >= 0 && 0 == this._cells[3 * (h + o * a)]; --o, u++) ; for (o = u; o > 0; --o) this._cells[3 * (h + (e - o) * a) + 2] = o, this._check(o > 0); } }, n._check = function(t) { 0 == t && console.log("xtexMerger 错误啦"); }, n._clear = function() { this._texCount = 0; for (var t = 0; t < this._height; t++) this._rowInfo[t].spaceCount = this._width; for (var e = 0; e < this._height; e++) for (var i = 0; i < this._width; i++) { var n = 3 * (e * this._width + i); this._cells[n] = 0, this._cells[n + 1] = this._width - i, this._cells[n + 2] = this._width - e; } this._failSize.width = this._width + 1, this._failSize.height = this._height + 1; }, t.__init$ = function() { e = function() { function t() { this.spaceCount = 0; } return s(t, ""), t; }(), i = function() { function t() { this.width = 0, this.height = 0; } return s(t, ""), t; }(); }, t; }(), U = function() { function t(t, e, i, n) { this._currentAtlasCount = 0, this._maxAtlaserCount = 0, this._width = 0, this._height = 0, this._gridSize = 0, this._gridNumX = 0, this._gridNumY = 0, this._init = !1, this._curAtlasIndex = 0, this._setAtlasParam = !1, this._atlaserArray = null, this._needGC = !1, this._setAtlasParam = !0, this._width = t, this._height = e, this._gridSize = i, this._maxAtlaserCount = n, this._gridNumX = t / i, this._gridNumY = e / i, this._curAtlasIndex = 0, this._atlaserArray = []; } s(t, "laya.webgl.atlas.AtlasResourceManager"); var e = t.prototype; return e.setAtlasParam = function(e, i, n, s) { if (1 == this._setAtlasParam) return t._sid_ = 0, this._width = e, this._height = i, this._gridSize = n, this._maxAtlaserCount = s, this._gridNumX = e / n, this._gridNumY = i / n, this._curAtlasIndex = 0, this.freeAll(), !0; throw console.log("设置大图合集参数错误,只能在开始页面设置各种参数"), -1; }, e.pushData = function(e) { var i = e.bitmap, n = -1, s = null, a = 0, r = 0, o = 0; for (a = 0, r = this._atlaserArray.length; a < r && (o = (this._curAtlasIndex + a) % r, s = this._atlaserArray[o], -1 == (n = s.findBitmapIsExist(i))); a++) ; if (-1 != n) { var h = s.InAtlasWebGLImagesOffsetValue[n]; return f = h[0], g = h[1], s.addToAtlas(e, f, g), !0; } this._setAtlasParam = !1; for (var l = Math.ceil((e.bitmap.width + 2) / this._gridSize), u = Math.ceil((e.bitmap.height + 2) / this._gridSize), c = !1, _ = 0; _ < 2; _++) { var d = this._maxAtlaserCount; for (a = 0; a < d; a++) { o = (this._curAtlasIndex + a) % d, this._atlaserArray.length - 1 >= o || this._atlaserArray.push(new Mt(this._gridNumX, this._gridNumY, this._width, this._height, t._sid_++)); var p = this._atlaserArray[o], f = 0, g = 0, m = p.addTex(1, l, u); if (m.ret) { f = m.x * this._gridSize + 1, g = m.y * this._gridSize + 1, i.lock = !0, p.addToAtlasTexture(i, f, g), p.addToAtlas(e, f, g), c = !0, this._curAtlasIndex = o; break; } } if (c) break; this._atlaserArray.push(new Mt(this._gridNumX, this._gridNumY, this._width, this._height, t._sid_++)), this._needGC = !0, this.garbageCollection(), this._curAtlasIndex = this._atlaserArray.length - 1; } return c || console.log(">>>AtlasManager pushData error"), c; }, e.addToAtlas = function(t) { laya.webgl.atlas.AtlasResourceManager.instance.pushData(t); }, e.garbageCollection = function() { if (!0 === this._needGC) { for (var t = this._atlaserArray.length - this._maxAtlaserCount, e = 0; e < t; e++) this._atlaserArray[e].dispose(), console.log("AtlasResourceManager:Dispose the inner Atlas。"); console.log(">>>>altas garbageCollection =" + t), this._atlaserArray.splice(0, t), this._needGC = !1; } return !0; }, e.freeAll = function() { for (var t = 0, e = this._atlaserArray.length; t < e; t++) this._atlaserArray[t].dispose(); this._atlaserArray.length = 0, this._curAtlasIndex = 0; }, e.getAtlaserCount = function() { return this._atlaserArray.length; }, e.getAtlaserByIndex = function(t) { return this._atlaserArray[t]; }, a(1, t, "instance", function() { return t._Instance || (t._Instance = new t(laya.webgl.atlas.AtlasResourceManager.atlasTextureWidth, laya.webgl.atlas.AtlasResourceManager.atlasTextureHeight, 16, laya.webgl.atlas.AtlasResourceManager.maxTextureCount)), t._Instance; }), a(1, t, "enabled", function() { return d.atlasEnable; }), a(1, t, "atlasLimitWidth", function() { return t._atlasLimitWidth; }, function(e) { t._atlasLimitWidth = e; }), a(1, t, "atlasLimitHeight", function() { return t._atlasLimitHeight; }, function(e) { t._atlasLimitHeight = e; }), t._enable = function() { d.atlasEnable = !0; }, t._disable = function() { d.atlasEnable = !1; }, t.__init__ = function() { t.atlasTextureWidth = 2048, t.atlasTextureHeight = 2048, t.maxTextureCount = 6, t.atlasLimitWidth = 512, t.atlasLimitHeight = 512; }, t._atlasLimitWidth = 0, t._atlasLimitHeight = 0, t.gridSize = 16, t.atlasTextureWidth = 0, t.atlasTextureHeight = 0, t.maxTextureCount = 0, t._atlasRestore = 0, t.BOARDER_TYPE_NO = 0, t.BOARDER_TYPE_RIGHT = 1, t.BOARDER_TYPE_LEFT = 2, t.BOARDER_TYPE_BOTTOM = 4, t.BOARDER_TYPE_TOP = 8, t.BOARDER_TYPE_ALL = 15, t._sid_ = 0, t._Instance = null, t; }(), V = function() { function t() { this.x = 0, this.y = 0, this.ret = !1, this.ret = !1, this.x = 0, this.y = 0; } return s(t, "laya.webgl.atlas.MergeFillInfo"), t; }(), W = function() { function t() {} return s(t, "laya.webgl.canvas.BlendMode"), t._init_ = function(e) { t.fns = [ t.BlendNormal, t.BlendAdd, t.BlendMultiply, t.BlendScreen, t.BlendOverlay, t.BlendLight, t.BlendMask, t.BlendDestinationOut ], t.targetFns = [ t.BlendNormalTarget, t.BlendAddTarget, t.BlendMultiplyTarget, t.BlendScreenTarget, t.BlendOverlayTarget, t.BlendLightTarget, t.BlendMask, t.BlendDestinationOut ]; }, t.BlendNormal = function(t) { t.blendFunc(1, 771); }, t.BlendAdd = function(t) { t.blendFunc(1, 772); }, t.BlendMultiply = function(t) { t.blendFunc(774, 771); }, t.BlendScreen = function(t) { t.blendFunc(1, 1); }, t.BlendOverlay = function(t) { t.blendFunc(1, 769); }, t.BlendLight = function(t) { t.blendFunc(1, 1); }, t.BlendNormalTarget = function(t) { t.blendFunc(1, 771); }, t.BlendAddTarget = function(t) { t.blendFunc(1, 772); }, t.BlendMultiplyTarget = function(t) { t.blendFunc(774, 771); }, t.BlendScreenTarget = function(t) { t.blendFunc(1, 1); }, t.BlendOverlayTarget = function(t) { t.blendFunc(1, 769); }, t.BlendLightTarget = function(t) { t.blendFunc(1, 1); }, t.BlendMask = function(t) { t.blendFunc(0, 770); }, t.BlendDestinationOut = function(t) { t.blendFunc(0, 0); }, t.activeBlendFunction = null, t.NAMES = [ "normal", "add", "multiply", "screen", "overlay", "light", "mask", "destination-out" ], t.TOINT = { normal: 0, add: 1, multiply: 2, screen: 3, lighter: 1, overlay: 4, light: 5, mask: 6, "destination-out": 7 }, t.NORMAL = "normal", t.ADD = "add", t.MULTIPLY = "multiply", t.SCREEN = "screen", t.LIGHT = "light", t.OVERLAY = "overlay", t.DESTINATIONOUT = "destination-out", t.fns = [], t.targetFns = [], t; }(), G = function() { function t(t) { this._color = _.create("black"), this.setValue(t); } s(t, "laya.webgl.canvas.DrawStyle"); var e = t.prototype; return e.setValue = function(t) { if (t) { if ("string" == typeof t) return void (this._color = _.create(t)); if (t instanceof laya.utils.Color) return void (this._color = t); } }, e.reset = function() { this._color = _.create("black"); }, e.equal = function(t) { return "string" == typeof t ? this._color.strColor === t : t instanceof laya.utils.Color && this._color.numColor === t.numColor; }, e.toColorStr = function() { return this._color.strColor; }, t.create = function(e) { if (e) { var i; if ("string" == typeof e ? i = _.create(e) : e instanceof laya.utils.Color && (i = e), i) return i._drawStyle || (i._drawStyle = new t(e)); } return laya.webgl.canvas.DrawStyle.DEFAULT; }, n(t, [ "DEFAULT", function() { return this.DEFAULT = new t("#000000"); } ]), t; }(), H = function() { function t() { this._x = 0, this._y = 0, this.dirty = !1, this.offset = 0, this.count = 0, this.geoStart = 0, this.tempArray = [], this.closePath = !1, this.geomatrys = []; xt.mainContext; this.ib = Jt.create(35048), this.vb = Qt.create(5); } s(t, "laya.webgl.canvas.Path"); var e = t.prototype; return e.addPoint = function(t, e) { this.tempArray.push(t, e); }, e.getEndPointX = function() { return this.tempArray[this.tempArray.length - 2]; }, e.getEndPointY = function() { return this.tempArray[this.tempArray.length - 1]; }, e.polygon = function(t, e, i, n, s, a) { var r; return this.geomatrys.push(this._curGeomatry = r = new Pt(t, e, i, n, s, a)), n || (r.fill = !1), void 0 == a && (r.borderWidth = 0), r; }, e.setGeomtry = function(t) { this.geomatrys.push(this._curGeomatry = t); }, e.drawLine = function(t, e, i, n, s) { var a; return this.closePath ? this.geomatrys.push(this._curGeomatry = a = new Lt(t, e, i, n, s)) : this.geomatrys.push(this._curGeomatry = a = new At(t, e, i, n, s)), a.fill = !1, a; }, e.update = function() { var t = this.ib._byteLength, e = this.geomatrys.length; this.offset = t; for (var i = this.geoStart; i < e; i++) this.geomatrys[i].getData(this.ib, this.vb, this.vb._byteLength / 20); this.geoStart = e, this.count = (this.ib._byteLength - t) / ft.BYTES_PIDX; }, e.reset = function() { this.vb.clear(), this.ib.clear(), this.offset = this.count = this.geoStart = 0, this.geomatrys.length = 0; }, e.recover = function() { this._curGeomatry = null, this.vb.destory(), this.vb = null, this.ib.destory(), this.ib = null; }, t; }(), Y = function() { function t() {} s(t, "laya.webgl.canvas.save.SaveBase"); var e = t.prototype; return i.imps(e, { "laya.webgl.canvas.save.ISaveData": !0 }), e.isSaveMark = function() { return !1; }, e.restore = function(e) { this._dataObj[this._valueName] = this._value, t._cache[t._cache._length++] = this, this._newSubmit && (e._curSubmit = at.RENDERBASE, e._renderKey = 0); }, t._createArray = function() { var t = []; return t._length = 0, t; }, t._init = function() { var e = t._namemap = {}; return e[1] = "ALPHA", e[2] = "fillStyle", e[8] = "font", e[256] = "lineWidth", e[512] = "strokeStyle", e[8192] = "_mergeID", e[1024] = e[2048] = e[4096] = [], e[16384] = "textBaseline", e[32768] = "textAlign", e[65536] = "_nBlendType", e[1048576] = "shader", e[2097152] = "filters", e; }, t.save = function(e, i, n, s) { if ((e._saveMark._saveuse & i) !== i) { e._saveMark._saveuse |= i; var a = t._cache, r = a._length > 0 ? a[--a._length] : new t(); r._value = n[r._valueName = t._namemap[i]], r._dataObj = n, r._newSubmit = s; var o = e._save; o[o._length++] = r; } }, t._cache = laya.webgl.canvas.save.SaveBase._createArray(), t._namemap = t._init(), t; }(), X = function() { function t() { this._clipRect = new w(); } s(t, "laya.webgl.canvas.save.SaveClipRect"); var e = t.prototype; return i.imps(e, { "laya.webgl.canvas.save.ISaveData": !0 }), e.isSaveMark = function() { return !1; }, e.restore = function(e) { e._clipRect = this._clipSaveRect, t._cache[t._cache._length++] = this, this._submitScissor.submitLength = e._submits._length - this._submitScissor.submitIndex, e._curSubmit = at.RENDERBASE, e._renderKey = 0; }, t.save = function(e, i) { if (131072 != (131072 & e._saveMark._saveuse)) { e._saveMark._saveuse |= 131072; var n = t._cache, s = n._length > 0 ? n[--n._length] : new t(); s._clipSaveRect = e._clipRect, e._clipRect = s._clipRect.copyFrom(e._clipRect), s._submitScissor = i; var a = e._save; a[a._length++] = s; } }, n(t, [ "_cache", function() { return this._cache = Y._createArray(); } ]), t; }(), j = function() { function t() { this._contextX = 0, this._contextY = 0, this._clipRect = new w(), this._rect = new w(), this._matrix = new x(); } s(t, "laya.webgl.canvas.save.SaveClipRectStencil"); var e = t.prototype; return i.imps(e, { "laya.webgl.canvas.save.ISaveData": !0 }), e.isSaveMark = function() { return !1; }, e.restore = function(e) { ut.restore(e, this._rect, this._saveMatrix, this._contextX, this._contextY), e._clipRect = this._clipSaveRect, e._curMat = this._saveMatrix, e._x = this._contextX, e._y = this._contextY, t._cache[t._cache._length++] = this, e._curSubmit = at.RENDERBASE; }, t.save = function(e, i, n, s, a, r, o, h, l, u) { if (262144 != (262144 & e._saveMark._saveuse)) { e._saveMark._saveuse |= 262144; var c = t._cache, _ = c._length > 0 ? c[--c._length] : new t(); _._clipSaveRect = e._clipRect, _._clipRect.setTo(o, h, l, u), e._clipRect = _._clipRect, _._rect.x = n, _._rect.y = s, _._rect.width = a, _._rect.height = r, _._contextX = e._x, _._contextY = e._y, _._saveMatrix = e._curMat, e._curMat.copyTo(_._matrix), e._curMat = _._matrix, _._submitStencil = i; var d = e._save; d[d._length++] = _; } }, n(t, [ "_cache", function() { return this._cache = Y._createArray(); } ]), t; }(), K = function() { function t() { this._saveuse = 0; } s(t, "laya.webgl.canvas.save.SaveMark"); var e = t.prototype; return i.imps(e, { "laya.webgl.canvas.save.ISaveData": !0 }), e.isSaveMark = function() { return !0; }, e.restore = function(e) { e._saveMark = this._preSaveMark, t._no[t._no._length++] = this; }, t.Create = function(e) { var i = t._no, n = i._length > 0 ? i[--i._length] : new t(); return n._saveuse = 0, n._preSaveMark = e._saveMark, e._saveMark = n, n; }, n(t, [ "_no", function() { return this._no = Y._createArray(); } ]), t; }(), $ = function() { function t() { this._matrix = new x(); } s(t, "laya.webgl.canvas.save.SaveTransform"); var e = t.prototype; return i.imps(e, { "laya.webgl.canvas.save.ISaveData": !0 }), e.isSaveMark = function() { return !1; }, e.restore = function(e) { e._curMat = this._savematrix, t._no[t._no._length++] = this; }, t.save = function(e) { var i = e._saveMark; if (2048 != (2048 & i._saveuse)) { i._saveuse |= 2048; var n = t._no, s = n._length > 0 ? n[--n._length] : new t(); s._savematrix = e._curMat, e._curMat = e._curMat.copyTo(s._matrix); var a = e._save; a[a._length++] = s; } }, n(t, [ "_no", function() { return this._no = Y._createArray(); } ]), t; }(), q = function() { function t() {} s(t, "laya.webgl.canvas.save.SaveTranslate"); var e = t.prototype; return i.imps(e, { "laya.webgl.canvas.save.ISaveData": !0 }), e.isSaveMark = function() { return !1; }, e.restore = function(e) { e._curMat; e._x = this._x, e._y = this._y, t._no[t._no._length++] = this; }, t.save = function(e) { var i = t._no, n = i._length > 0 ? i[--i._length] : new t(); n._x = e._x, n._y = e._y; var s = e._save; s[s._length++] = n; }, n(t, [ "_no", function() { return this._no = Y._createArray(); } ]), t; }(), Z = function() { function t() { this.target = null, this.repaint = !1, this._width = NaN, this._height = NaN, this._sp = null, this._clipRect = new w(); } s(t, "laya.webgl.resource.RenderTargetMAX"); var e = t.prototype; return e.setSP = function(t) { this._sp = t; }, e.size = function(t, e) { var n = this; this._width !== t || this._height !== e ? (this.repaint = !0, this._width = t, this._height = e, this.target ? this.target.size(t, e) : this.target = Ft.create(t, e), this.target.hasListener("recovered") || this.target.on("recovered", this, function(t) { i.timer.callLater(n._sp, n._sp.repaint); })) : this.target.size(t, e); }, e._flushToTarget = function(t, e) { if (!e._destroy) { var i = vt.worldScissorTest, n = vt.worldClipRect; vt.worldClipRect = this._clipRect, this._clipRect.x = this._clipRect.y = 0, this._clipRect.width = this._width, this._clipRect.height = this._height, vt.worldScissorTest = !1, xt.mainContext.disable(3089); var s = vt.worldAlpha, a = vt.worldMatrix4, r = vt.worldMatrix, o = vt.worldFilters, h = vt.worldShaderDefines; if (vt.worldMatrix = x.EMPTY, vt.restoreTempArray(), vt.worldMatrix4 = vt.TEMPMAT4_ARRAY, vt.worldAlpha = 1, vt.worldFilters = null, vt.worldShaderDefines = null, Nt.activeShader = null, e.start(), d.showCanvasMark ? e.clear(0, 1, 0, .3) : e.clear(0, 0, 0, 0), t.flush(), e.end(), Nt.activeShader = null, vt.worldAlpha = s, vt.worldMatrix4 = a, vt.worldMatrix = r, vt.worldFilters = o, vt.worldShaderDefines = h, vt.worldScissorTest = i, i) { var l = vt.height - n.y - n.height; xt.mainContext.scissor(n.x, l, n.width, n.height), xt.mainContext.enable(3089); } vt.worldClipRect = n; } }, e.flush = function(t) { this.repaint && (this._flushToTarget(t, this.target), this.repaint = !1); }, e.drawTo = function(t, e, i, n, s) { t.drawTexture(this.target.getTexture(), e, i, n, s, 0, 0); }, e.destroy = function() { this.target && (this.target.destroy(), this.target = null, this._sp = null); }, t; }(), J = function() { function t() { this.ALPHA = 1, this.shaderType = 0, this.defines = new Et(); } s(t, "laya.webgl.shader.d2.Shader2D"); return t.prototype.destroy = function() { this.defines = null, this.filters = null, this.glTexture = null, this.strokeStyle = null, this.fillStyle = null; }, t.__init__ = function() { Kt.addInclude("parts/ColorFilter_ps_uniform.glsl", "uniform vec4 colorAlpha;\nuniform mat4 colorMat;"), Kt.addInclude("parts/ColorFilter_ps_logic.glsl", "mat4 alphaMat =colorMat;\n\nalphaMat[0][3] *= gl_FragColor.a;\nalphaMat[1][3] *= gl_FragColor.a;\nalphaMat[2][3] *= gl_FragColor.a;\n\ngl_FragColor = gl_FragColor * alphaMat;\ngl_FragColor += colorAlpha/255.0*gl_FragColor.a;\n"), Kt.addInclude("parts/GlowFilter_ps_uniform.glsl", "uniform vec4 u_color;\nuniform float u_strength;\nuniform float u_blurX;\nuniform float u_blurY;\nuniform float u_offsetX;\nuniform float u_offsetY;\nuniform float u_textW;\nuniform float u_textH;"), Kt.addInclude("parts/GlowFilter_ps_logic.glsl", "const float c_IterationTime = 10.0;\nfloat floatIterationTotalTime = c_IterationTime * c_IterationTime;\nvec4 vec4Color = vec4(0.0,0.0,0.0,0.0);\nvec2 vec2FilterDir = vec2(-(u_offsetX)/u_textW,-(u_offsetY)/u_textH);\nvec2 vec2FilterOff = vec2(u_blurX/u_textW/c_IterationTime * 2.0,u_blurY/u_textH/c_IterationTime * 2.0);\nfloat maxNum = u_blurX * u_blurY;\nvec2 vec2Off = vec2(0.0,0.0);\nfloat floatOff = c_IterationTime/2.0;\nfor(float i = 0.0;i<=c_IterationTime; ++i){\n\tfor(float j = 0.0;j<=c_IterationTime; ++j){\n\t\tvec2Off = vec2(vec2FilterOff.x * (i - floatOff),vec2FilterOff.y * (j - floatOff));\n\t\tvec4Color += texture2D(texture, v_texcoord + vec2FilterDir + vec2Off)/floatIterationTotalTime;\n\t}\n}\ngl_FragColor = vec4(u_color.rgb,vec4Color.a * u_strength);\ngl_FragColor.rgb *= gl_FragColor.a;"), Kt.addInclude("parts/BlurFilter_ps_logic.glsl", "gl_FragColor = blur();\ngl_FragColor.w*=alpha;"), Kt.addInclude("parts/BlurFilter_ps_uniform.glsl", "uniform vec4 strength_sig2_2sig2_gauss1;\nuniform vec2 blurInfo;\n\n#define PI 3.141593\n\n//float sigma=strength/3.0;//3σ以外影响很小。即当σ=1的时候,半径为3\n//float sig2 = sigma*sigma;\n//float _2sig2 = 2.0*sig2;\n//return 1.0/(2*PI*sig2)*exp(-(x*x+y*y)/_2sig2)\n//float gauss1 = 1.0/(2.0*PI*sig2);\n\nfloat getGaussian(float x, float y){\n return strength_sig2_2sig2_gauss1.w*exp(-(x*x+y*y)/strength_sig2_2sig2_gauss1.z);\n}\n\nvec4 blur(){\n const float blurw = 9.0;\n vec4 vec4Color = vec4(0.0,0.0,0.0,0.0);\n vec2 halfsz=vec2(blurw,blurw)/2.0/blurInfo; \n vec2 startpos=v_texcoord-halfsz;\n vec2 ctexcoord = startpos;\n vec2 step = 1.0/blurInfo; //每个像素 \n \n for(float y = 0.0;y<=blurw; ++y){\n ctexcoord.x=startpos.x;\n for(float x = 0.0;x<=blurw; ++x){\n //TODO 纹理坐标的固定偏移应该在vs中处理\n vec4Color += texture2D(texture, ctexcoord)*getGaussian(x-blurw/2.0,y-blurw/2.0);\n ctexcoord.x+=step.x;\n }\n ctexcoord.y+=step.y;\n }\n return vec4Color;\n}"), Kt.addInclude("parts/ColorAdd_ps_uniform.glsl", "uniform vec4 colorAdd;\n"), Kt.addInclude("parts/ColorAdd_ps_logic.glsl", "gl_FragColor = vec4(colorAdd.rgb,colorAdd.a*gl_FragColor.a);\ngl_FragColor.xyz *= colorAdd.a;"); var t, e; t = "attribute vec4 position;\nattribute vec2 texcoord;\nuniform vec2 size;\n\n#ifdef WORLDMAT\nuniform mat4 mmat;\n#endif\nvarying vec2 v_texcoord;\nvoid main() {\n #ifdef WORLDMAT\n vec4 pos=mmat*position;\n gl_Position =vec4((pos.x/size.x-0.5)*2.0,(0.5-pos.y/size.y)*2.0,pos.z,1.0);\n #else\n gl_Position =vec4((position.x/size.x-0.5)*2.0,(0.5-position.y/size.y)*2.0,position.z,1.0);\n #endif\n \n v_texcoord = texcoord;\n}", e = 'precision mediump float;\n//precision highp float;\nvarying vec2 v_texcoord;\nuniform sampler2D texture;\nuniform float alpha;\n#include?BLUR_FILTER "parts/BlurFilter_ps_uniform.glsl";\n#include?COLOR_FILTER "parts/ColorFilter_ps_uniform.glsl";\n#include?GLOW_FILTER "parts/GlowFilter_ps_uniform.glsl";\n#include?COLOR_ADD "parts/ColorAdd_ps_uniform.glsl";\n\nvoid main() {\n vec4 color= texture2D(texture, v_texcoord);\n color.a*=alpha;\n color.rgb*=alpha;\n gl_FragColor=color;\n #include?COLOR_ADD "parts/ColorAdd_ps_logic.glsl"; \n #include?BLUR_FILTER "parts/BlurFilter_ps_logic.glsl";\n #include?COLOR_FILTER "parts/ColorFilter_ps_logic.glsl";\n #include?GLOW_FILTER "parts/GlowFilter_ps_logic.glsl";\n}', Kt.preCompile2D(0, 1, t, e, null), t = "attribute vec4 position;\nuniform vec2 size;\nuniform mat4 mmat;\nvoid main() {\n vec4 pos=mmat*position;\n gl_Position =vec4((pos.x/size.x-0.5)*2.0,(0.5-pos.y/size.y)*2.0,pos.z,1.0);\n}", e = 'precision mediump float;\nuniform vec4 color;\nuniform float alpha;\n#include?COLOR_FILTER "parts/ColorFilter_ps_uniform.glsl";\nvoid main() {\n\tvec4 a = vec4(color.r, color.g, color.b, color.a);\n\ta.w = alpha;\n\ta.xyz *= alpha;\n\tgl_FragColor = a;\n\t#include?COLOR_FILTER "parts/ColorFilter_ps_logic.glsl";\n}', Kt.preCompile2D(0, 2, t, e, null), t = "attribute vec4 position;\nattribute vec3 a_color;\nuniform mat4 mmat;\nuniform mat4 u_mmat2;\nuniform vec2 u_pos;\nuniform vec2 size;\nvarying vec3 color;\nvoid main(){\n vec4 tPos = vec4(position.x + u_pos.x,position.y + u_pos.y,position.z,position.w);\n vec4 pos=mmat*u_mmat2*tPos;\n gl_Position =vec4((pos.x/size.x-0.5)*2.0,(0.5-pos.y/size.y)*2.0,pos.z,1.0);\n color=a_color;\n}", e = "precision mediump float;\n//precision mediump float;\nvarying vec3 color;\nuniform float alpha;\nvoid main(){\n\t//vec4 a=vec4(color.r, color.g, color.b, 1);\n\t//a.a*=alpha;\n gl_FragColor=vec4(color.r, color.g, color.b, alpha);\n\tgl_FragColor.rgb*=alpha;\n}", Kt.preCompile2D(0, 4, t, e, null), t = "attribute vec4 position;\nattribute vec2 texcoord;\nuniform vec2 size;\n\n#ifdef WORLDMAT\nuniform mat4 mmat;\n#endif\nvarying vec2 v_texcoord;\nvoid main() {\n #ifdef WORLDMAT\n vec4 pos=mmat*position;\n gl_Position =vec4((pos.x/size.x-0.5)*2.0,(0.5-pos.y/size.y)*2.0,pos.z,1.0);\n #else\n gl_Position =vec4((position.x/size.x-0.5)*2.0,(0.5-position.y/size.y)*2.0,position.z,1.0);\n #endif\n \n v_texcoord = texcoord;\n}", e = '#ifdef FSHIGHPRECISION\nprecision highp float;\n#else\nprecision mediump float;\n#endif\n//precision highp float;\nvarying vec2 v_texcoord;\nuniform sampler2D texture;\nuniform float alpha;\nuniform vec4 u_TexRange;\nuniform vec2 u_offset;\n#include?BLUR_FILTER "parts/BlurFilter_ps_uniform.glsl";\n#include?COLOR_FILTER "parts/ColorFilter_ps_uniform.glsl";\n#include?GLOW_FILTER "parts/GlowFilter_ps_uniform.glsl";\n#include?COLOR_ADD "parts/ColorAdd_ps_uniform.glsl";\n\nvoid main() {\n vec2 newTexCoord;\n newTexCoord.x = mod(u_offset.x + v_texcoord.x,u_TexRange.y) + u_TexRange.x;\n newTexCoord.y = mod(u_offset.y + v_texcoord.y,u_TexRange.w) + u_TexRange.z;\n vec4 color= texture2D(texture, newTexCoord);\n color.a*=alpha;\n gl_FragColor=color;\n #include?COLOR_ADD "parts/ColorAdd_ps_logic.glsl"; \n #include?BLUR_FILTER "parts/BlurFilter_ps_logic.glsl";\n #include?COLOR_FILTER "parts/ColorFilter_ps_logic.glsl";\n #include?GLOW_FILTER "parts/GlowFilter_ps_logic.glsl";\n}', Kt.preCompile2D(0, 256, t, e, null), t = "attribute vec2 position;\nattribute vec2 texcoord;\nattribute vec4 color;\nuniform vec2 size;\nuniform float offsetX;\nuniform float offsetY;\nuniform mat4 mmat;\nuniform mat4 u_mmat2;\nvarying vec2 v_texcoord;\nvarying vec4 v_color;\nvoid main() {\n vec4 pos=mmat*u_mmat2*vec4(offsetX+position.x,offsetY+position.y,0,1 );\n gl_Position = vec4((pos.x/size.x-0.5)*2.0,(0.5-pos.y/size.y)*2.0,pos.z,1.0);\n v_color = color;\n v_color.rgb *= v_color.a;\n v_texcoord = texcoord; \n}", e = "precision mediump float;\nvarying vec2 v_texcoord;\nvarying vec4 v_color;\nuniform sampler2D texture;\nuniform float alpha;\nvoid main() {\n\tvec4 t_color = texture2D(texture, v_texcoord);\n\tgl_FragColor = t_color.rgba * v_color;\n\tgl_FragColor *= alpha;\n}", Kt.preCompile2D(0, 512, t, e, null); }, t; }(), Q = function() { function t(t, e, i) { this._value = 0, this._name2int = t, this._int2name = e, this._int2nameMap = i; } s(t, "laya.webgl.shader.ShaderDefines"); var e = t.prototype; return e.add = function(t) { return "string" == typeof t && (t = this._name2int[t]), this._value |= t, this._value; }, e.addInt = function(t) { return this._value |= t, this._value; }, e.remove = function(t) { return "string" == typeof t && (t = this._name2int[t]), this._value &= ~t, this._value; }, e.isDefine = function(t) { return (this._value & t) === t; }, e.getValue = function() { return this._value; }, e.setValue = function(t) { this._value = t; }, e.toNameDic = function() { var e = this._int2nameMap[this._value]; return e || t._toText(this._value, this._int2name, this._int2nameMap); }, t._reg = function(t, e, i, n) { i[t] = e, n[e] = t; }, t._toText = function(t, e, i) { var n = i[t]; if (n) return n; for (var s = {}, a = 1, r = 0; r < 32 && !((a = 1 << r) > t); r++) if (t & a) { var o = e[a]; o && (s[o] = ""); } return i[t] = s, s; }, t._toInt = function(t, e) { for (var i = t.split("."), n = 0, s = 0, a = i.length; s < a; s++) { var r = e[i[s]]; if (!r) throw new Error("Defines to int err:" + t + "/" + i[s]); n |= r; } return n; }, t; }(), tt = function() { function t() { this.mVBBuffer = null, this.mIBBuffer = null, this.mVBData = null, this.mIBData = null, this.mEleNum = 0, this.mTexture = null, this.transform = null, this._vs = null, this._ps = null, this._indexStart = -1, this._verticles = null, this._uvs = null, this._tempMatrix = new x(); } s(t, "laya.webgl.shader.d2.skinAnishader.SkinMesh"); var e = t.prototype; return e.init = function(e, i, n) { if (i) this._vs = i; else { this._vs = []; var s = e.width, a = e.height; this._vs.push(0, 0, 0, 0, 1, 1, 1, 1), this._vs.push(s, 0, 1, 0, 1, 1, 1, 1), this._vs.push(s, a, 1, 1, 1, 1, 1, 1), this._vs.push(0, a, 0, 1, 1, 1, 1, 1); } n ? this._ps = n : (t._defaultPS || (t._defaultPS = []).push(0, 1, 3, 3, 1, 2), this._ps = t._defaultPS), this.mVBData = new Float32Array(this._vs), this.mIBData = new Uint16Array(this._ps.length), this.mIBData.start = -1, this.mEleNum = this._ps.length, this.mTexture = e; }, e.init2 = function(t, e, i, n, s) { this.transform && (this.transform = null), i ? this._ps = i : (this._ps = [], this._ps.push(0, 1, 3, 3, 1, 2)), this._verticles = n, this._uvs = s, this.mEleNum = this._ps.length, this.mTexture = t, (C.isConchNode || C.isConchApp) && (this._initMyData(), this.mVBData = new Float32Array(this._vs)); }, e._initMyData = function() { var e = 0, i = 0, n = 4 * this._verticles.length; this._vs = t._tempVS; var s = !1; if (C.isConchNode || C.isConchApp ? (this._vs.length = n, s = !0) : this._vs.length < n && (this._vs.length = n, s = !0), t._tVSLen = n, s) for (;e < n; ) this._vs[e] = this._verticles[i], this._vs[e + 1] = this._verticles[i + 1], this._vs[e + 2] = this._uvs[i], this._vs[e + 3] = this._uvs[i + 1], this._vs[e + 4] = 1, this._vs[e + 5] = 1, this._vs[e + 6] = 1, this._vs[e + 7] = 1, e += 8, i += 2; else for (;e < n; ) this._vs[e] = this._verticles[i], this._vs[e + 1] = this._verticles[i + 1], this._vs[e + 2] = this._uvs[i], this._vs[e + 3] = this._uvs[i + 1], e += 8, i += 2; }, e.getData2 = function(e, i, n) { this.mVBBuffer = e, this.mIBBuffer = i, this._initMyData(), e.appendEx2(this._vs, Float32Array, t._tVSLen, 4), this._indexStart = i._byteLength; var s; (s = t._tempIB).length < this._ps.length && (s.length = this._ps.length); for (var a = 0, r = this._ps.length; a < r; a++) s[a] = this._ps[a] + n; i.appendEx2(s, Uint16Array, this._ps.length, 2); }, e.getData = function(t, e, i) { if (this.mVBBuffer = t, this.mIBBuffer = e, t.append(this.mVBData), this._indexStart = e._byteLength, this.mIBData.start != i) { for (var n = 0, s = this._ps.length; n < s; n++) this.mIBData[n] = this._ps[n] + i; this.mIBData.start = i; } e.append(this.mIBData); }, e.render = function(t, e, i) { if (C.isWebGL && this.mTexture) { t._renderKey = 0, t._shader2D.glTexture = null, et.getInstance().addSkinMesh(this); var n = at.createShape(t, this.mIBBuffer, this.mVBBuffer, this.mEleNum, this._indexStart, St.create(512, 0)); this.transform || (this.transform = x.EMPTY), this.transform.translate(e, i), x.mul(this.transform, t._curMat, this._tempMatrix), this.transform.translate(-e, -i); var s = n.shaderValue, a = s.u_mmat2 || vt.getMatrArray(); vt.mat2MatArray(this._tempMatrix, a), s.textureHost = this.mTexture, s.offsetX = 0, s.offsetY = 0, s.u_mmat2 = a, s.ALPHA = t._shader2D.ALPHA, t._submits[t._submits._length++] = n; } else C.isConchApp && this.mTexture && (this.transform || (this.transform = x.EMPTY), t.setSkinMesh && t.setSkinMesh(e, i, this._ps, this.mVBData, this.mEleNum, 0, this.mTexture, this.transform)); }, t._tempVS = [], t._tempIB = [], t._defaultPS = null, t._tVSLen = 0, t; }(), et = function() { function t() { this.ib = null, this.vb = null; xt.mainContext; this.ib = Jt.create(35048), this.vb = Qt.create(8); } s(t, "laya.webgl.shader.d2.skinAnishader.SkinMeshBuffer"); var e = t.prototype; return e.addSkinMesh = function(t) { t.getData2(this.vb, this.ib, this.vb._byteLength / 32); }, e.reset = function() { this.vb.clear(), this.ib.clear(); }, t.getInstance = function() { return t.instance = t.instance || new t(); }, t.instance = null, t; }(), it = function() { function t(t, e, i, n, s, a, r, o, h) { this.r0 = 0, this.fill = !0, this.r1 = Math.PI / 2, void 0 === h && (h = 0), this.x = t, this.y = e, this.width = i, this.height = n, this.edges = s, this.color = a, this.borderWidth = r, this.borderColor = o; } s(t, "laya.webgl.shapes.BasePoly"); var e = t.prototype; return i.imps(e, { "laya.webgl.shapes.IShape": !0 }), e.getData = function(t, e, i) {}, e.rebuild = function(t) {}, e.setMatrix = function(t) {}, e.needUpdate = function(t) { return !0; }, e.sector = function(t, e, i) { var n = this.x, s = this.y, a = this.edges, r = (this.r1 - this.r0) / a, o = this.width, h = this.height, l = this.color, u = (l >> 16 & 255) / 255, c = (l >> 8 & 255) / 255, _ = (255 & l) / 255; t.push(n, s, u, c, _); for (var d = 0; d < a + 1; d++) t.push(n + Math.sin(r * d + this.r0) * o, s + Math.cos(r * d + this.r0) * h), t.push(u, c, _); for (d = 0; d < a; d++) e.push(i, i + d + 1, i + d + 2); }, e.createLine2 = function(t, e, i, n, s, a) { var r, o, h, l, u, c, _, d, p, f, g, m, v, y, x, b, w, C, S, T, I = t.concat(), M = s, E = this.borderColor, A = (E >> 16 & 255) / 255, L = (E >> 8 & 255) / 255, P = (255 & E) / 255, k = I.length / 2, R = n, D = i / 2; h = I[0], l = I[1], f = h - (u = I[2]), p = (p = -(l - (c = I[3]))) / (T = Math.sqrt(p * p + f * f)) * D, f = f / T * D, M.push(h - p + this.x, l - f + this.y, A, L, P, h + p + this.x, l + f + this.y, A, L, P); for (var N = 1; N < k - 1; N++) h = I[2 * (N - 1)], l = I[2 * (N - 1) + 1], u = I[2 * N], c = I[2 * N + 1], _ = I[2 * (N + 1)], d = I[2 * (N + 1) + 1], f = h - u, m = u - _, x = (-(p = (p = -(l - c)) / (T = Math.sqrt(p * p + f * f)) * D) + h) * (-(f = f / T * D) + c) - (-p + u) * (-f + l), C = (-(g = (g = -(c - d)) / (T = Math.sqrt(g * g + m * m)) * D) + _) * (-(m = m / T * D) + c) - (-g + u) * (-m + d), S = (v = -f + l - (-f + c)) * (w = -g + u - (-g + _)) - (b = -m + d - (-m + c)) * (y = -p + u - (-p + h)), Math.abs(S) < .1 ? (S += 10.1, M.push(u - p + this.x, c - f + this.y, A, L, P, u + p + this.x, c + f + this.y, A, L, P)) : (((r = (y * C - w * x) / S) - u) * (r - u) + ((o = (b * x - v * C) / S) - c) + (o - c), M.push(r + this.x, o + this.y, A, L, P, u - (r - u) + this.x, c - (o - c) + this.y, A, L, P)); h = I[I.length - 4], l = I[I.length - 3], f = h - (u = I[I.length - 2]), p = (p = -(l - (c = I[I.length - 1]))) / (T = Math.sqrt(p * p + f * f)) * D, f = f / T * D, M.push(u - p + this.x, c - f + this.y, A, L, P, u + p + this.x, c + f + this.y, A, L, P); var F = a; for (N = 1; N < F; N++) e.push(R + 2 * (N - 1), R + 2 * (N - 1) + 1, R + 2 * N + 1, R + 2 * N + 1, R + 2 * N, R + 2 * (N - 1)); return M; }, e.createLine = function(t, e, i, n) { var s = t.concat(), a = t, r = this.borderColor, o = (r >> 16 & 255) / 255, h = (r >> 8 & 255) / 255, l = (255 & r) / 255; s.splice(0, 5); var u, c, _, d, p, f, g, m, v, y, x, b, w, C, S, T, I, M, E, A, L = s.length / 5, P = n, k = i / 2; _ = s[0], d = s[1], y = _ - (p = s[5]), v = (v = -(d - (f = s[6]))) / (A = Math.sqrt(v * v + y * y)) * k, y = y / A * k, a.push(_ - v, d - y, o, h, l, _ + v, d + y, o, h, l); for (var R = 1; R < L - 1; R++) _ = s[5 * (R - 1)], d = s[5 * (R - 1) + 1], p = s[5 * R], f = s[5 * R + 1], g = s[5 * (R + 1)], m = s[5 * (R + 1) + 1], y = _ - p, b = p - g, S = (-(v = (v = -(d - f)) / (A = Math.sqrt(v * v + y * y)) * k) + _) * (-(y = y / A * k) + f) - (-v + p) * (-y + d), M = (-(x = (x = -(f - m)) / (A = Math.sqrt(x * x + b * b)) * k) + g) * (-(b = b / A * k) + f) - (-x + p) * (-b + m), E = (w = -y + d - (-y + f)) * (I = -x + p - (-x + g)) - (T = -b + m - (-b + f)) * (C = -v + p - (-v + _)), Math.abs(E) < .1 ? (E += 10.1, a.push(p - v, f - y, o, h, l, p + v, f + y, o, h, l)) : (((u = (C * M - I * S) / E) - p) * (u - p) + ((c = (T * S - w * M) / E) - f) + (c - f), a.push(u, c, o, h, l, p - (u - p), f - (c - f), o, h, l)); _ = s[s.length - 10], d = s[s.length - 9], y = _ - (p = s[s.length - 5]), v = (v = -(d - (f = s[s.length - 4]))) / (A = Math.sqrt(v * v + y * y)) * k, y = y / A * k, a.push(p - v, f - y, o, h, l, p + v, f + y, o, h, l); var D = this.edges + 1; for (R = 1; R < D; R++) e.push(P + 2 * (R - 1), P + 2 * (R - 1) + 1, P + 2 * R + 1, P + 2 * R + 1, P + 2 * R, P + 2 * (R - 1)); return a; }, e.createLoopLine = function(t, e, i, n, s, a) { var r = t.concat(), o = s || t, h = this.borderColor, l = (h >> 16 & 255) / 255, u = (h >> 8 & 255) / 255, c = (255 & h) / 255; r.splice(0, 5); var _ = [ r[0], r[1] ], d = [ r[r.length - 5], r[r.length - 4] ], p = d[0] + .5 * (_[0] - d[0]), f = d[1] + .5 * (_[1] - d[1]); r.unshift(p, f, 0, 0, 0), r.push(p, f, 0, 0, 0); var g, m, v, y, x, b, w, C, S, T, I, M, E, A, L, P, k, R, D, N, F = r.length / 5, B = n, O = i / 2; v = r[0], y = r[1], T = v - (x = r[5]), S = (S = -(y - (b = r[6]))) / (N = Math.sqrt(S * S + T * T)) * O, T = T / N * O, o.push(v - S, y - T, l, u, c, v + S, y + T, l, u, c); for (var z = 1; z < F - 1; z++) v = r[5 * (z - 1)], y = r[5 * (z - 1) + 1], x = r[5 * z], b = r[5 * z + 1], w = r[5 * (z + 1)], C = r[5 * (z + 1) + 1], T = v - x, M = x - w, L = (-(S = (S = -(y - b)) / (N = Math.sqrt(S * S + T * T)) * O) + v) * (-(T = T / N * O) + b) - (-S + x) * (-T + y), R = (-(I = (I = -(b - C)) / (N = Math.sqrt(I * I + M * M)) * O) + w) * (-(M = M / N * O) + b) - (-I + x) * (-M + C), D = (E = -T + y - (-T + b)) * (k = -I + x - (-I + w)) - (P = -M + C - (-M + b)) * (A = -S + x - (-S + v)), Math.abs(D) < .1 ? (D += 10.1, o.push(x - S, b - T, l, u, c, x + S, b + T, l, u, c)) : (((g = (A * R - k * L) / D) - x) * (g - x) + ((m = (P * L - E * R) / D) - b) + (m - b), o.push(g, m, l, u, c, x - (g - x), b - (m - b), l, u, c)); a && (e = a); var U = this.edges + 1; for (z = 1; z < U; z++) e.push(B + 2 * (z - 1), B + 2 * (z - 1) + 1, B + 2 * z + 1, B + 2 * z + 1, B + 2 * z, B + 2 * (z - 1)); return e.push(B + 2 * (z - 1), B + 2 * (z - 1) + 1, B + 1, B + 1, B, B + 2 * (z - 1)), o; }, t; }(), nt = function() { function t() {} return s(t, "laya.webgl.shapes.Earcut"), t.earcut = function(e, i, n) { n = n || 2; var s = i && i.length, a = s ? i[0] * n : e.length, r = t.linkedList(e, 0, a, n, !0), o = []; if (!r) return o; var h, l, u, c, _, d, p; if (s && (r = t.eliminateHoles(e, i, r, n)), e.length > 80 * n) { h = u = e[0], l = c = e[1]; for (var f = n; f < a; f += n) _ = e[f], d = e[f + 1], _ < h && (h = _), d < l && (l = d), _ > u && (u = _), d > c && (c = d); p = 0 !== (p = Math.max(u - h, c - l)) ? 1 / p : 0; } return t.earcutLinked(r, o, n, h, l, p), o; }, t.linkedList = function(e, i, n, s, a) { var r, o; if (a === t.signedArea(e, i, n, s) > 0) for (r = i; r < n; r += s) o = t.insertNode(r, e[r], e[r + 1], o); else for (r = n - s; r >= i; r -= s) o = t.insertNode(r, e[r], e[r + 1], o); return o && t.equals(o, o.next) && (t.removeNode(o), o = o.next), o; }, t.filterPoints = function(e, i) { if (!e) return e; i || (i = e); var n, s = e; do { if (n = !1, s.steiner || !t.equals(s, s.next) && 0 !== t.area(s.prev, s, s.next)) s = s.next; else { if (t.removeNode(s), (s = i = s.prev) === s.next) break; n = !0; } } while (n || s !== i); return i; }, t.earcutLinked = function(e, i, n, s, a, r, o) { if (e) { !o && r && t.indexCurve(e, s, a, r); for (var h, l, u = e; e.prev !== e.next; ) if (h = e.prev, l = e.next, r ? t.isEarHashed(e, s, a, r) : t.isEar(e)) i.push(h.i / n), i.push(e.i / n), i.push(l.i / n), t.removeNode(e), e = l.next, u = l.next; else if ((e = l) === u) { o ? 1 === o ? (e = t.cureLocalIntersections(e, i, n), t.earcutLinked(e, i, n, s, a, r, 2)) : 2 === o && t.splitEarcut(e, i, n, s, a, r) : t.earcutLinked(t.filterPoints(e, null), i, n, s, a, r, 1); break; } } }, t.isEar = function(e) { var i = e.prev, n = e, s = e.next; if (t.area(i, n, s) >= 0) return !1; for (var a = e.next.next; a !== e.prev; ) { if (t.pointInTriangle(i.x, i.y, n.x, n.y, s.x, s.y, a.x, a.y) && t.area(a.prev, a, a.next) >= 0) return !1; a = a.next; } return !0; }, t.isEarHashed = function(e, i, n, s) { var a = e.prev, r = e, o = e.next; if (t.area(a, r, o) >= 0) return !1; for (var h = a.x < r.x ? a.x < o.x ? a.x : o.x : r.x < o.x ? r.x : o.x, l = a.y < r.y ? a.y < o.y ? a.y : o.y : r.y < o.y ? r.y : o.y, u = a.x > r.x ? a.x > o.x ? a.x : o.x : r.x > o.x ? r.x : o.x, c = a.y > r.y ? a.y > o.y ? a.y : o.y : r.y > o.y ? r.y : o.y, _ = t.zOrder(h, l, i, n, s), d = t.zOrder(u, c, i, n, s), p = e.nextZ; p && p.z <= d; ) { if (p !== e.prev && p !== e.next && t.pointInTriangle(a.x, a.y, r.x, r.y, o.x, o.y, p.x, p.y) && t.area(p.prev, p, p.next) >= 0) return !1; p = p.nextZ; } for (p = e.prevZ; p && p.z >= _; ) { if (p !== e.prev && p !== e.next && t.pointInTriangle(a.x, a.y, r.x, r.y, o.x, o.y, p.x, p.y) && t.area(p.prev, p, p.next) >= 0) return !1; p = p.prevZ; } return !0; }, t.cureLocalIntersections = function(e, i, n) { var s = e; do { var a = s.prev, r = s.next.next; !t.equals(a, r) && t.intersects(a, s, s.next, r) && t.locallyInside(a, r) && t.locallyInside(r, a) && (i.push(a.i / n), i.push(s.i / n), i.push(r.i / n), t.removeNode(s), t.removeNode(s.next), s = e = r), s = s.next; } while (s !== e); return s; }, t.splitEarcut = function(e, i, n, s, a, r) { var o = e; do { for (var h = o.next.next; h !== o.prev; ) { if (o.i !== h.i && t.isValidDiagonal(o, h)) { var l = t.splitPolygon(o, h); return o = t.filterPoints(o, o.next), l = t.filterPoints(l, l.next), t.earcutLinked(o, i, n, s, a, r), void t.earcutLinked(l, i, n, s, a, r); } h = h.next; } o = o.next; } while (o !== e); }, t.eliminateHoles = function(e, i, n, s) { var a, r, o, h, l, u = []; for (a = 0, r = i.length; a < r; a++) o = i[a] * s, h = a < r - 1 ? i[a + 1] * s : e.length, (l = t.linkedList(e, o, h, s, !1)) === l.next && (l.steiner = !0), u.push(t.getLeftmost(l)); for (u.sort(t.compareX), a = 0; a < u.length; a++) t.eliminateHole(u[a], n), n = t.filterPoints(n, n.next); return n; }, t.compareX = function(t, e) { return t.x - e.x; }, t.eliminateHole = function(e, i) { if (i = t.findHoleBridge(e, i)) { var n = t.splitPolygon(i, e); t.filterPoints(n, n.next); } }, t.findHoleBridge = function(e, i) { var n, s = i, a = e.x, r = e.y, o = -1 / 0; do { if (r <= s.y && r >= s.next.y && s.next.y !== s.y) { var h = s.x + (r - s.y) * (s.next.x - s.x) / (s.next.y - s.y); if (h <= a && h > o) { if (o = h, h === a) { if (r === s.y) return s; if (r === s.next.y) return s.next; } n = s.x < s.next.x ? s : s.next; } } s = s.next; } while (s !== i); if (!n) return null; if (a === o) return n.prev; var l, u = n, c = n.x, _ = n.y, d = 1 / 0; for (s = n.next; s !== u; ) a >= s.x && s.x >= c && a !== s.x && t.pointInTriangle(r < _ ? a : o, r, c, _, r < _ ? o : a, r, s.x, s.y) && ((l = Math.abs(r - s.y) / (a - s.x)) < d || l === d && s.x > n.x) && t.locallyInside(s, e) && (n = s, d = l), s = s.next; return n; }, t.indexCurve = function(e, i, n, s) { var a = e; do { null === a.z && (a.z = t.zOrder(a.x, a.y, i, n, s)), a.prevZ = a.prev, a.nextZ = a.next, a = a.next; } while (a !== e); a.prevZ.nextZ = null, a.prevZ = null, t.sortLinked(a); }, t.sortLinked = function(t) { var e, i, n, s, a, r, o, h, l = 1; do { for (i = t, t = null, a = null, r = 0; i; ) { for (r++, n = i, o = 0, e = 0; e < l && (o++, n = n.nextZ); e++) ; for (h = l; o > 0 || h > 0 && n; ) 0 !== o && (0 === h || !n || i.z <= n.z) ? (s = i, i = i.nextZ, o--) : (s = n, n = n.nextZ, h--), a ? a.nextZ = s : t = s, s.prevZ = a, a = s; i = n; } a.nextZ = null, l *= 2; } while (r > 1); return t; }, t.zOrder = function(t, e, i, n, s) { return t = 32767 * (t - i) * s, e = 32767 * (e - n) * s, t = 16711935 & (t | t << 8), t = 252645135 & (t | t << 4), t = 858993459 & (t | t << 2), t = 1431655765 & (t | t << 1), e = 16711935 & (e | e << 8), e = 252645135 & (e | e << 4), e = 858993459 & (e | e << 2), e = 1431655765 & (e | e << 1), t | e << 1; }, t.getLeftmost = function(t) { var e = t, i = t; do { e.x < i.x && (i = e), e = e.next; } while (e !== t); return i; }, t.pointInTriangle = function(t, e, i, n, s, a, r, o) { return (s - r) * (e - o) - (t - r) * (a - o) >= 0 && (t - r) * (n - o) - (i - r) * (e - o) >= 0 && (i - r) * (a - o) - (s - r) * (n - o) >= 0; }, t.isValidDiagonal = function(e, i) { return e.next.i !== i.i && e.prev.i !== i.i && !t.intersectsPolygon(e, i) && t.locallyInside(e, i) && t.locallyInside(i, e) && t.middleInside(e, i); }, t.area = function(t, e, i) { return (e.y - t.y) * (i.x - e.x) - (e.x - t.x) * (i.y - e.y); }, t.equals = function(t, e) { return t.x === e.x && t.y === e.y; }, t.intersects = function(e, i, n, s) { return !!(t.equals(e, i) && t.equals(n, s) || t.equals(e, s) && t.equals(n, i)) || t.area(e, i, n) > 0 != t.area(e, i, s) > 0 && t.area(n, s, e) > 0 != t.area(n, s, i) > 0; }, t.intersectsPolygon = function(e, i) { var n = e; do { if (n.i !== e.i && n.next.i !== e.i && n.i !== i.i && n.next.i !== i.i && t.intersects(n, n.next, e, i)) return !0; n = n.next; } while (n !== e); return !1; }, t.locallyInside = function(e, i) { return t.area(e.prev, e, e.next) < 0 ? t.area(e, i, e.next) >= 0 && t.area(e, e.prev, i) >= 0 : t.area(e, i, e.prev) < 0 || t.area(e, e.next, i) < 0; }, t.middleInside = function(t, e) { var i = t, n = !1, s = (t.x + e.x) / 2, a = (t.y + e.y) / 2; do { i.y > a != i.next.y > a && i.next.y !== i.y && s < (i.next.x - i.x) * (a - i.y) / (i.next.y - i.y) + i.x && (n = !n), i = i.next; } while (i !== t); return n; }, t.splitPolygon = function(t, e) { var i = new st(t.i, t.x, t.y), n = new st(e.i, e.x, e.y), s = t.next, a = e.prev; return t.next = e, e.prev = t, i.next = s, s.prev = i, n.next = i, i.prev = n, a.next = n, n.prev = a, n; }, t.insertNode = function(t, e, i, n) { var s = new st(t, e, i); return n ? (s.next = n.next, s.prev = n, n.next.prev = s, n.next = s) : (s.prev = s, s.next = s), s; }, t.removeNode = function(t) { t.next.prev = t.prev, t.prev.next = t.next, t.prevZ && (t.prevZ.nextZ = t.nextZ), t.nextZ && (t.nextZ.prevZ = t.prevZ); }, t.signedArea = function(t, e, i, n) { for (var s = 0, a = e, r = i - n; a < i; a += n) s += (t[r] - t[a]) * (t[a + 1] + t[r + 1]), r = a; return s; }, t; }(), st = function() { function t(t, e, i) { this.i = null, this.x = null, this.y = null, this.prev = null, this.next = null, this.z = null, this.prevZ = null, this.nextZ = null, this.steiner = null, this.i = t, this.x = e, this.y = i, this.prev = null, this.next = null, this.z = null, this.prevZ = null, this.nextZ = null, this.steiner = !1; } return s(t, "laya.webgl.shapes.EarcutNode"), t; }(), at = (function() { function t(t, e, i, n, s, a, r) { this.lineWidth = t, this.lineColor = e, this.lineAlpha = i, this.fillColor = n, this.fillAlpha = s, this.shape = r, this.fill = a; } s(t, "laya.webgl.shapes.GeometryData"); var e = t.prototype; e.clone = function() { return new t(this.lineWidth, this.lineColor, this.lineAlpha, this.fillColor, this.fillAlpha, this.fill, this.shape); }, e.getIndexData = function() { return null; }, e.getVertexData = function() { return null; }, e.destroy = function() { this.shape = null; }; }(), function() { function t(t) { if (t instanceof Float32Array) this.points = t; else if (t instanceof Array) { t.length; this.points = new Float32Array(t); } } s(t, "laya.webgl.shapes.Vertex"); var e = t.prototype; i.imps(e, { "laya.webgl.shapes.IShape": !0 }), e.getData = function(t, e, i) {}, e.needUpdate = function(t) { return !1; }, e.rebuild = function(t) {}, e.setMatrix = function(t) {}; }(), function() { function t(t) { void 0 === t && (t = 1e4), this._renderType = t; } s(t, "laya.webgl.submit.Submit"); var e = t.prototype; return i.imps(e, { "laya.webgl.submit.ISubmit": !0 }), e.releaseRender = function() { var e = t._cache; e[e._length++] = this, this.shaderValue.release(), this._vb = null; }, e.getRenderType = function() { return this._renderType; }, e.renderSubmit = function() { if (0 === this._numEle) return 1; var t = this.shaderValue.textureHost; if (t) { var e = t.source; if (!t.bitmap || !e) return 1; this.shaderValue.texture = e; } this._vb.bind_upload(this._ib); var i = xt.mainContext; return this.shaderValue.upload(), W.activeBlendFunction !== this._blendFn && (i.enable(3042), this._blendFn(i), W.activeBlendFunction = this._blendFn), L.drawCall++, L.trianglesFaces += this._numEle / 3, i.drawElements(4, this._numEle, 5123, this._startIdx), 1; }, t.__init__ = function() { var e = t.RENDERBASE = new t(-1); e.shaderValue = new St(0, 0), e.shaderValue.ALPHA = -1234; }, t.createSubmit = function(e, i, n, s, a) { var r = t._cache._length ? t._cache[--t._cache._length] : new t(); null == n && ((n = r._selfVb || (r._selfVb = Qt.create(-1))).clear(), s = 0), r._ib = i, r._vb = n, r._startIdx = s * ft.BYTES_PIDX, r._numEle = 0; var o = e._nBlendType; r._blendFn = e._targets ? W.targetFns[o] : W.fns[o], r.shaderValue = a, r.shaderValue.setValue(e._shader2D); var h = e._shader2D.filters; return h && r.shaderValue.setFilters(h), r; }, t.createShape = function(e, i, n, s, a, r) { var o = t._cache._length ? t._cache[--t._cache._length] : new t(); o._ib = i, o._vb = n, o._numEle = s, o._startIdx = a, o.shaderValue = r, o.shaderValue.setValue(e._shader2D); var h = e._nBlendType; return o._blendFn = e._targets ? W.targetFns[h] : W.fns[h], o; }, t.TYPE_2D = 1e4, t.TYPE_CANVAS = 10003, t.TYPE_CMDSETRT = 10004, t.TYPE_CUSTOM = 10005, t.TYPE_BLURRT = 10006, t.TYPE_CMDDESTORYPRERT = 10007, t.TYPE_DISABLESTENCIL = 10008, t.TYPE_OTHERIBVB = 10009, t.TYPE_PRIMITIVE = 10010, t.TYPE_RT = 10011, t.TYPE_BLUR_RT = 10012, t.TYPE_TARGET = 10013, t.TYPE_CHANGE_VALUE = 10014, t.TYPE_SHAPE = 10015, t.TYPE_TEXTURE = 10016, t.TYPE_FILLTEXTURE = 10017, t.RENDERBASE = null, t._cache = (t._cache = [], t._cache._length = 0, t._cache), t; }()), rt = function() { function t() { this.fun = null, this.args = null; } s(t, "laya.webgl.submit.SubmitCMD"); var e = t.prototype; return i.imps(e, { "laya.webgl.submit.ISubmit": !0 }), e.renderSubmit = function() { return this.fun.apply(null, this.args), 1; }, e.getRenderType = function() { return 0; }, e.releaseRender = function() { var e = t._cache; e[e._length++] = this; }, t.create = function(e, i) { var n = t._cache._length ? t._cache[--t._cache._length] : new t(); return n.fun = i, n.args = e, n; }, t._cache = (t._cache = [], t._cache._length = 0, t._cache), t; }(), ot = function() { function t() { this.variables = {}; } s(t, "laya.webgl.submit.SubmitCMDScope"); var e = t.prototype; return e.getValue = function(t) { return this.variables[t]; }, e.addValue = function(t, e) { return this.variables[t] = e; }, e.setValue = function(t, e) { return this.variables.hasOwnProperty(t) ? this.variables[t] = e : null; }, e.clear = function() { for (var t in this.variables) delete this.variables[t]; }, e.recycle = function() { this.clear(), t.POOL.push(this); }, t.create = function() { var e = t.POOL.pop(); return e || (e = new t()), e; }, t.POOL = [], t; }(), ht = function() { function t() { this.offset = 0, this.startIndex = 0, this._mat = x.create(); } s(t, "laya.webgl.submit.SubmitOtherIBVB"); var e = t.prototype; return i.imps(e, { "laya.webgl.submit.ISubmit": !0 }), e.releaseRender = function() { var e = t._cache; e[e._length++] = this; }, e.getRenderType = function() { return 10009; }, e.renderSubmit = function() { var e = this._shaderValue.textureHost; if (e) { var i = e.source; if (!e.bitmap || !i) return 1; this._shaderValue.texture = i; } this._vb.bind_upload(this._ib); var n = vt.worldMatrix4, s = x.TEMP; x.mulPre(this._mat, n[0], n[1], n[4], n[5], n[12], n[13], s); var a = vt.worldMatrix4 = t.tempMatrix4; a[0] = s.a, a[1] = s.b, a[4] = s.c, a[5] = s.d, a[12] = s.tx, a[13] = s.ty, this._shader._offset = this.offset, this._shaderValue.refresh(), this._shader.upload(this._shaderValue), this._shader._offset = 0; var r = xt.mainContext; return W.activeBlendFunction !== this._blendFn && (r.enable(3042), this._blendFn(r), W.activeBlendFunction = this._blendFn), L.drawCall++, L.trianglesFaces += this._numEle / 3, r.drawElements(4, this._numEle, 5123, this.startIndex), vt.worldMatrix4 = n, Nt.activeShader = null, 1; }, t.create = function(e, i, n, s, a, r, o, h, l) { void 0 === l && (l = 0); var u = t._cache._length ? t._cache[--t._cache._length] : new t(); u._ib = n, u._vb = i, u._numEle = s, u._shader = a, u._shaderValue = r; var c = e._nBlendType; switch (u._blendFn = e._targets ? W.targetFns[c] : W.fns[c], l) { case 0: u.offset = 0, u.startIndex = h / (ft.BYTES_PE * i.vertexStride) * 1.5, u.startIndex *= ft.BYTES_PIDX; break; case 1: u.startIndex = o, u.offset = h; } return u; }, t._cache = (t._cache = [], t._cache._length = 0, t._cache), t.tempMatrix4 = [ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 ], t; }(), lt = function() { function t() { this.submitIndex = 0, this.submitLength = 0, this.context = null, this.clipRect = new w(), this.screenRect = new w(); } s(t, "laya.webgl.submit.SubmitScissor"); var e = t.prototype; return i.imps(e, { "laya.webgl.submit.ISubmit": !0 }), e._scissor = function(t, e, i, n) { var s = vt.worldMatrix4, a = s[0], r = s[5]; if (t = t * a + s[12], e = e * r + s[13], i *= a, n *= r, i < 1 || n < 1) return !1; var o = t + i, h = e + n; t < 0 && (t = 0, i = o - t), e < 0 && (e = 0, n = h - e); var l = vt.worldClipRect; if (t = Math.max(t, l.x), e = Math.max(e, l.y), i = Math.min(o, l.right) - t, n = Math.min(h, l.bottom) - e, i < 1 || n < 1) return !1; var u = vt.worldScissorTest; return this.screenRect.copyFrom(l), l.x = t, l.y = e, l.width = i, l.height = n, vt.worldScissorTest = !0, e = vt.height - e - n, xt.mainContext.scissor(t, e, i, n), xt.mainContext.enable(3089), this.context.submitElement(this.submitIndex, this.submitIndex + this.submitLength), u ? (e = vt.height - this.screenRect.y - this.screenRect.height, xt.mainContext.scissor(this.screenRect.x, e, this.screenRect.width, this.screenRect.height), xt.mainContext.enable(3089)) : (xt.mainContext.disable(3089), vt.worldScissorTest = !1), l.copyFrom(this.screenRect), !0; }, e._scissorWithTagart = function(t, e, i, n) { if (i < 1 || n < 1) return !1; var s = t + i, a = e + n; t < 0 && (t = 0, i = s - t), e < 0 && (e = 0, n = a - e); var r = vt.worldClipRect; if (t = Math.max(t, r.x), e = Math.max(e, r.y), i = Math.min(s, r.right) - t, n = Math.min(a, r.bottom) - e, i < 1 || n < 1) return !1; var o = vt.worldScissorTest; return this.screenRect.copyFrom(r), vt.worldScissorTest = !0, r.x = t, r.y = e, r.width = i, r.height = n, e = vt.height - e - n, xt.mainContext.scissor(t, e, i, n), xt.mainContext.enable(3089), this.context.submitElement(this.submitIndex, this.submitIndex + this.submitLength), o ? (e = vt.height - this.screenRect.y - this.screenRect.height, xt.mainContext.scissor(this.screenRect.x, e, this.screenRect.width, this.screenRect.height), xt.mainContext.enable(3089)) : (xt.mainContext.disable(3089), vt.worldScissorTest = !1), r.copyFrom(this.screenRect), !0; }, e.renderSubmit = function() { return this.submitLength = Math.min(this.context._submits._length - 1, this.submitLength), this.submitLength < 1 || this.clipRect.width < 1 || this.clipRect.height < 1 ? this.submitLength + 1 : (this.context._targets ? this._scissorWithTagart(this.clipRect.x, this.clipRect.y, this.clipRect.width, this.clipRect.height) : this._scissor(this.clipRect.x, this.clipRect.y, this.clipRect.width, this.clipRect.height), this.submitLength + 1); }, e.getRenderType = function() { return 0; }, e.releaseRender = function() { var e = t._cache; e[e._length++] = this, this.context = null; }, t.create = function(e) { var i = t._cache._length ? t._cache[--t._cache._length] : new t(); return i.context = e, i; }, t._cache = (t._cache = [], t._cache._length = 0, t._cache), t; }(), ut = function() { function t() { this.step = 0, this.blendMode = null, this.level = 0; } s(t, "laya.webgl.submit.SubmitStencil"); var e = t.prototype; return i.imps(e, { "laya.webgl.submit.ISubmit": !0 }), e.renderSubmit = function() { switch (this.step) { case 1: this.do1(); break; case 2: this.do2(); break; case 3: this.do3(); break; case 4: this.do4(); break; case 5: this.do5(); break; case 6: this.do6(); break; case 7: this.do7(); break; case 8: this.do8(); } return 1; }, e.getRenderType = function() { return 0; }, e.releaseRender = function() { var e = t._cache; e[e._length++] = this; }, e.do1 = function() { var t = xt.mainContext; t.enable(2960), t.clear(1024), t.colorMask(!1, !1, !1, !1), t.stencilFunc(514, this.level, 255), t.stencilOp(7680, 7680, 7682); }, e.do2 = function() { var t = xt.mainContext; t.stencilFunc(514, this.level + 1, 255), t.colorMask(!0, !0, !0, !0), t.stencilOp(7680, 7680, 7680); }, e.do3 = function() { var t = xt.mainContext; t.colorMask(!0, !0, !0, !0), t.stencilOp(7680, 7680, 7680), t.clear(1024), t.disable(2960); }, e.do4 = function() { var t = xt.mainContext; 0 == this.level && (t.enable(2960), t.clear(1024)), t.colorMask(!1, !1, !1, !1), t.stencilFunc(519, 0, 255), t.stencilOp(7680, 7680, 7682); }, e.do5 = function() { var t = xt.mainContext; t.stencilFunc(514, this.level, 255), t.colorMask(!0, !0, !0, !0), t.stencilOp(7680, 7680, 7680); }, e.do6 = function() { var t = xt.mainContext; W.targetFns[W.TOINT[this.blendMode]](t); }, e.do7 = function() { var t = xt.mainContext; t.colorMask(!1, !1, !1, !1), t.stencilOp(7680, 7680, 7683); }, e.do8 = function() { var t = xt.mainContext; t.colorMask(!0, !0, !0, !0), t.stencilFunc(514, this.level, 255), t.stencilOp(7680, 7680, 7680); }, t.restore = function(e, i, n, s, a) { var r; if (e._renderKey = 0, t._mask > 0 && t._mask--, 0 == t._mask) r = laya.webgl.submit.SubmitStencil.create(3), e.addRenderObject(r), e._curSubmit = at.RENDERBASE; else { r = laya.webgl.submit.SubmitStencil.create(7), e.addRenderObject(r); var o = e._vb; o._byteLength; if (gt.fillRectImgVb(o, null, i.x, i.y, i.width, i.height, D.DEF_UV, n, s, a, 0, 0)) { e._shader2D.glTexture = null; var h = e._curSubmit = at.createSubmit(e, e._ib, o, (o._byteLength - 64) / 32 * 3, St.create(2, 0)); h.shaderValue.ALPHA = 1, e._submits[e._submits._length++] = h, e._curSubmit._numEle += 6, e._curSubmit = at.RENDERBASE; } else alert("clipRect calc stencil rect error"); r = laya.webgl.submit.SubmitStencil.create(8), e.addRenderObject(r); } }, t.restore2 = function(e, i) { var n; e._renderKey = 0, t._mask > 0 && t._mask--, 0 == t._mask ? (n = laya.webgl.submit.SubmitStencil.create(3), e.addRenderObject(n), e._curSubmit = at.RENDERBASE) : (n = laya.webgl.submit.SubmitStencil.create(7), e.addRenderObject(n), e._submits[e._submits._length++] = i, n = laya.webgl.submit.SubmitStencil.create(8), e.addRenderObject(n)); }, t.create = function(e) { var i = t._cache._length ? t._cache[--t._cache._length] : new t(); return i.step = e, 5 == e && ++t._mask, i.level = t._mask, i; }, t._cache = (t._cache = [], t._cache._length = 0, t._cache), t._mask = 0, t; }(), ct = function() { function t() { this._renderType = 0, this._vb = null, this._ib = null, this._startIdx = 0, this._numEle = 0, this.shaderValue = null, this.blendType = 0, this.proName = null, this.scope = null; } s(t, "laya.webgl.submit.SubmitTarget"); var e = t.prototype; return i.imps(e, { "laya.webgl.submit.ISubmit": !0 }), e.renderSubmit = function() { this._vb.bind_upload(this._ib); var t = this.scope.getValue(this.proName); return t && (this.shaderValue.texture = t.source, this.shaderValue.strength && !this.shaderValue.blurInfo && (this.shaderValue.blurInfo = [ t.width, t.height ]), this.shaderValue.upload(), this.blend(), L.drawCall++, L.trianglesFaces += this._numEle / 3, xt.mainContext.drawElements(4, this._numEle, 5123, this._startIdx)), 1; }, e.blend = function() { if (W.activeBlendFunction !== W.fns[this.blendType]) { var t = xt.mainContext; t.enable(3042), W.fns[this.blendType](t), W.activeBlendFunction = W.fns[this.blendType]; } }, e.getRenderType = function() { return 0; }, e.releaseRender = function() { var e = t._cache; e[e._length++] = this; }, t.create = function(e, i, n, s, a, r) { var o = t._cache._length ? t._cache[--t._cache._length] : new t(); return o._ib = i, o._vb = n, o.proName = r, o._startIdx = s * ft.BYTES_PIDX, o._numEle = 0, o.blendType = e._nBlendType, o.shaderValue = a, o.shaderValue.setValue(e._shader2D), o; }, t._cache = (t._cache = [], t._cache._length = 0, t._cache), t; }(), _t = function() { function t() { this._sourceStr = null; } s(t, "laya.webgl.text.CharSegment"); var e = t.prototype; return i.imps(e, { "laya.webgl.text.ICharSegment": !0 }), e.textToSpit = function(t) { this._sourceStr = t; }, e.getChar = function(t) { return this._sourceStr.charAt(t); }, e.getCharCode = function(t) { return this._sourceStr.charCodeAt(t); }, e.length = function() { return this._sourceStr.length; }, t; }(), dt = function() { function t() {} var e; return s(t, "laya.webgl.text.DrawText"), t.__init__ = function() { t._charsTemp = new Array(), t._drawValue = new e(), t._charSeg = new _t(); }, t.customCharSeg = function(e) { t._charSeg = e; }, t.getChar = function(e, i, n) { var s = Yt.createOneChar(e, n); return -1 != i && (t._charsCache[i] = s), s; }, t._drawSlow = function(e, i, n, s, a, r, o, h, l, u, c, _, d, p, f) { var g, m, v = t._drawValue.value(r, h, l, u, d, p, f), y = 0, x = 0, b = t._charsTemp, w = 0, C = NaN; if (s) for (b.length = s.length, y = 0, x = s.length; y < x; y++) C = (m = s[y]).charNum + v.txtID, b[y] = g = t._charsCache[C] || t.getChar(m.char, C, v), g.active(); else { var S = n instanceof laya.utils.WordText ? n.toString() : n; if (R.CharacterCache) { t._charSeg.textToSpit(S); var T = t._charSeg.length(); for (b.length = T, y = 0, x = T; y < x; y++) C = t._charSeg.getCharCode(y) + v.txtID, b[y] = g = t._charsCache[C] || t.getChar(t._charSeg.getChar(y), C, v), g.active(), w += g.cw; } else b.length = 0, (g = t.getChar(S, -1, v)).active(), w += g.cw, b[0] = g; } var I = 0; null !== o && "left" !== o && (I = -("center" == o ? w / 2 : w)); var M, E, A = NaN, L = 0; if (s) for (y = 0, x = b.length; y < x; y++) (g = b[y]).isSpace || (m = s[y], A = g.borderSize, M = g.texture, i._drawText(M, c + I + m.x * d - A, _ + m.y * p - A, M.width, M.height, a, 0, 0, 0, 0)); else { for (y = 0, x = b.length; y < x; y++) (g = b[y]).isSpace || (A = g.borderSize, M = g.texture, i._drawText(M, c + I - A, _ - A, M.width, M.height, a, 0, 0, 0, 0), e && ((E = e[L++]) || (E = e[L - 1] = []), E[0] = M, E[1] = I - A, E[2] = -A)), I += g.cw; e && (e.length = L); } }, t._drawFast = function(t, e, i, n, s) { for (var a, r, o = 0, h = t.length; o < h; o++) (a = (r = t[o])[0]).active(), e._drawText(a, n + r[1], s + r[2], a.width, a.height, i, 0, 0, 0, 0); }, t.drawText = function(e, n, s, a, r, o, h, l, u, c, _, p) { if (void 0 === p && (p = 0), !(n && 0 === n.length || s && 0 === s.length)) { var f = a.a, g = a.d; (0 !== a.b || 0 !== a.c) && (f = g = 1); var m = 1 !== f || 1 !== g; if (m && i.stage.transform) { var v = i.stage.transform; m = v.a === f && v.d === g; } else m = !1; if (m) { var y = (a = a.copyTo(Ct._tmpMatrix)).tx, x = a.ty; a.scale(1 / f, 1 / g), a._checkTransform(), c *= f, _ *= g, c += y - a.tx, _ += x - a.ty; } else f = g = 1; if (s) t._drawSlow(null, e, n, s, a, r, o, h, l, u, c, _, f, g, p); else { if (null === n.toUpperCase) { var b = f + 1e5 * g, w = n; return void (w.changed || w.id !== b ? (w.id = b, w.changed = !1, t._drawSlow(w.save, e, n, s, a, r, o, h, l, u, c, _, f, g, p)) : t._drawFast(w.save, e, a, c, _)); } var C = n + r.toString() + h + l + u + f + g + o, S = t._textsCache[C]; R.CharacterCache ? S ? t._drawFast(S, e, a, c, _) : (t._textsCache.__length || (t._textsCache.__length = 0), t._textsCache.__length > d.WebGLTextCacheCount && ((t._textsCache = {}).__length = 0, t._curPoolIndex = 0), t._textCachesPool[t._curPoolIndex] ? (S = t._textsCache[C] = t._textCachesPool[t._curPoolIndex], S.length = 0) : t._textCachesPool[t._curPoolIndex] = S = t._textsCache[C] = [], t._textsCache.__length++, t._curPoolIndex++, t._drawSlow(S, e, n, s, a, r, o, h, l, u, c, _, f, g, p)) : t._drawSlow(S, e, n, s, a, r, o, h, l, u, c, _, f, g, p); } } }, t._charsTemp = null, t._textCachesPool = [], t._curPoolIndex = 0, t._charsCache = {}, t._textsCache = {}, t._drawValue = null, t.d = [], t._charSeg = null, t.__init$ = function() { e = function() { function t() {} s(t, ""); return t.prototype.value = function(e, i, n, s, a, r, o) { this.font = e, this.fillColor = i, this.borderColor = n, this.lineWidth = s, this.scaleX = a, this.scaleY = r, this.underLine = o; var h = e.toString() + a + r + s + i + n + o; return this.txtID = t._keymap[h], this.txtID || (this.txtID = 1e-7 * ++t._keymapCount, t._keymap[h] = this.txtID), this; }, t.clear = function() { t._keymap = {}, t._keymapCount = 1; }, t._keymap = {}, t._keymapCount = 1, t; }(); }, t; }(), pt = function() { function t(e) { this._index = 0, this._size = 14, this._italic = -2, t._cache2 = t._cache2 || [], this.setFont(e || "14px Arial"); } s(t, "laya.webgl.text.FontInContext"); var e = t.prototype; return e.setFont = function(e) { var i = t._cache2[e]; if (i) this._words = i[0], this._size = i[1]; else { this._words = e.split(" "); for (var n = 0, s = this._words.length; n < s; n++) if (this._words[n].indexOf("px") > 0) { this._index = n; break; } this._size = parseInt(this._words[this._index]), t._cache2[e] = [ this._words, this._size ]; } this._text = null, this._italic = -2; }, e.getItalic = function() { return -2 === this._italic && (this._italic = this.hasType("italic")), this._italic; }, e.hasType = function(t) { for (var e = 0, i = this._words.length; e < i; e++) if (this._words[e] === t) return e; return -1; }, e.removeType = function(t) { for (var e = 0, i = this._words.length; e < i; e++) if (this._words[e] === t) { this._words.splice(e, 1), this._index > e && this._index--; break; } this._text = null, this._italic = -2; }, e.copyTo = function(t) { return t._text = this._text, t._size = this._size, t._index = this._index, t._words = this._words.slice(), t._italic = -2, t; }, e.toString = function() { return this._text ? this._text : this._text = this._words.join(" "); }, a(0, e, "size", function() { return this._size; }, function(t) { this._size = t, this._words[this._index] = t + "px", this._text = null; }), t.create = function(e) { var i = t._cache[e]; return i || (i = t._cache[e] = new t(e)); }, t.EMPTY = new t(), t._cache = {}, t._cache2 = null, t; }(), ft = function() { function t() {} return s(t, "laya.webgl.utils.CONST3D2D"), t.defaultMatrix4 = [ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 ], t.defaultMinusYMatrix4 = [ 1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 ], t.uniformMatrix3 = [ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0 ], t._TMPARRAY = [], t._OFFSETX = 0, t._OFFSETY = 0, n(t, [ "BYTES_PE", function() { return this.BYTES_PE = Float32Array.BYTES_PER_ELEMENT; }, "BYTES_PIDX", function() { return this.BYTES_PIDX = Uint16Array.BYTES_PER_ELEMENT; } ]), t; }(), gt = function() { function t() {} return s(t, "laya.webgl.utils.GlUtils"), t.make2DProjection = function(t, e, i) { return [ 2 / t, 0, 0, 0, 0, -2 / e, 0, 0, 0, 0, 2 / i, 0, -1, 1, 0, 1 ]; }, t.fillIBQuadrangle = function(t, e) { if (e > 65535 / 4) throw Error("IBQuadrangle count:" + e + " must<:" + Math.floor(65535 / 4)); e = Math.floor(e), t._resizeBuffer(6 * (e + 1) * 2, !1), t.byteLength = t.bufferLength; for (var i = t.getUint16Array(), n = 0, s = 0; s < e; s++) i[n++] = 4 * s, i[n++] = 4 * s + 2, i[n++] = 4 * s + 1, i[n++] = 4 * s, i[n++] = 4 * s + 3, i[n++] = 4 * s + 2; return t.setNeedUpload(), !0; }, t.expandIBQuadrangle = function(e, i) { e.bufferLength >= 6 * i * 2 || t.fillIBQuadrangle(e, i); }, t.mathCeilPowerOfTwo = function(t) { return t--, t |= t >> 1, t |= t >> 2, t |= t >> 4, t |= t >> 8, t |= t >> 16, ++t; }, t.fillQuadrangleImgVb = function(t, e, i, n, s, a, r, o) { var h = 16 + (t._byteLength >> 2); t.byteLength = h << 2; var l = t.getFloat32Array(); l[(h -= 16) + 2] = s[0], l[h + 3] = s[1], l[h + 6] = s[2], l[h + 7] = s[3], l[h + 10] = s[4], l[h + 11] = s[5], l[h + 14] = s[6], l[h + 15] = s[7]; var u = a.a, c = a.b, _ = a.c, d = a.d; if (1 !== u || 0 !== c || 0 !== _ || 1 !== d) { a.bTransform = !0; var p = a.tx + r, f = a.ty + o; l[h] = (n[0] + e) * u + (n[1] + i) * _ + p, l[h + 1] = (n[0] + e) * c + (n[1] + i) * d + f, l[h + 4] = (n[2] + e) * u + (n[3] + i) * _ + p, l[h + 5] = (n[2] + e) * c + (n[3] + i) * d + f, l[h + 8] = (n[4] + e) * u + (n[5] + i) * _ + p, l[h + 9] = (n[4] + e) * c + (n[5] + i) * d + f, l[h + 12] = (n[6] + e) * u + (n[7] + i) * _ + p, l[h + 13] = (n[6] + e) * c + (n[7] + i) * d + f; } else a.bTransform = !1, e += a.tx + r, i += a.ty + o, l[h] = e + n[0], l[h + 1] = i + n[1], l[h + 4] = e + n[2], l[h + 5] = i + n[3], l[h + 8] = e + n[4], l[h + 9] = i + n[5], l[h + 12] = e + n[6], l[h + 13] = i + n[7]; return t._upload = !0, !0; }, t.fillTranglesVB = function(t, e, i, n, s, a, r) { var o = (t._byteLength >> 2) + n.length; t.byteLength = o << 2; var h = t.getFloat32Array(); o -= n.length; for (var l = n.length, u = s.a, c = s.b, _ = s.c, d = s.d, p = 0; p < l; p += 4) if (h[o + p + 2] = n[p + 2], h[o + p + 3] = n[p + 3], 1 !== u || 0 !== c || 0 !== _ || 1 !== d) { s.bTransform = !0; var f = s.tx + a, g = s.ty + r; h[o + p] = (n[p] + e) * u + (n[p + 1] + i) * _ + f, h[o + p + 1] = (n[p] + e) * c + (n[p + 1] + i) * d + g; } else s.bTransform = !1, e += s.tx + a, i += s.ty + r, h[o + p] = e + n[p], h[o + p + 1] = i + n[p + 1]; return t._upload = !0, !0; }, t.copyPreImgVb = function(t, e, i) { var n = t._byteLength >> 2; t.byteLength = n + 16 << 2; for (var s = t.getFloat32Array(), a = 0, r = n - 16; a < 4; a++) s[n] = s[r] + e, ++r, s[++n] = s[r] + i, ++r, s[++n] = s[r], ++r, s[++n] = s[r], ++n, ++r; t._upload = !0; }, t.fillRectImgVb = function(t, e, i, n, s, a, r, o, h, l, u, c, _) { void 0 === _ && (_ = !1); var d, p, f, g, m, v, y, x, b, w, C, S, T, I, M, E, A = 1, L = o.a, P = o.b, k = o.c, R = o.d, D = e && e.width < 99999999; if (1 !== L || 0 !== P || 0 !== k || 1 !== R ? (o.bTransform = !0, 0 === P && 0 === k && (A = 23, b = s + i, w = a + n, d = L * i + (C = o.tx + h), f = L * b + C, p = R * n + (S = o.ty + l), g = R * w + S)) : (A = 23, o.bTransform = !1, f = (d = i + o.tx + h) + s, g = (p = n + o.ty + l) + a), D && (m = e.x, v = e.y, y = e.width + m, x = e.height + v), 1 !== A) { if (Math.min(d, f) >= y) return !1; if (Math.min(p, g) >= x) return !1; if (Math.max(f, d) <= m) return !1; if (Math.max(g, p) <= v) return !1; } var N = t._byteLength >> 2; t.byteLength = N + 16 << 2; var F = t.getFloat32Array(); switch (F[N + 2] = r[0], F[N + 3] = r[1], F[N + 6] = r[2], F[N + 7] = r[3], F[N + 10] = r[4], F[N + 11] = r[5], F[N + 14] = r[6], F[N + 15] = r[7], A) { case 1: C = o.tx + h, S = o.ty + l; var B = L * i, O = k * n, z = R * n, U = P * i, V = L * (b = s + i), W = k * (w = a + n), G = R * w, H = P * b; _ ? (T = B + O + C, M = Math.round(T) - T, I = z + U + S, E = Math.round(I) - I, F[N] = T + M, F[N + 1] = I + E, F[N + 4] = V + O + C + M, F[N + 5] = z + H + S + E, F[N + 8] = V + W + C + M, F[N + 9] = G + H + S + E, F[N + 12] = B + W + C + M, F[N + 13] = G + U + S + E) : (F[N] = B + O + C, F[N + 1] = z + U + S, F[N + 4] = V + O + C, F[N + 5] = z + H + S, F[N + 8] = V + W + C, F[N + 9] = G + H + S, F[N + 12] = B + W + C, F[N + 13] = G + U + S); break; case 23: _ ? (T = d + u, M = Math.round(T) - T, I = p, E = Math.round(I) - I, F[N] = T + M, F[N + 1] = I + E, F[N + 4] = f + u + M, F[N + 5] = p + E, F[N + 8] = f + M, F[N + 9] = g + E, F[N + 12] = d + M, F[N + 13] = g + E) : (F[N] = d + u, F[N + 1] = p, F[N + 4] = f + u, F[N + 5] = p, F[N + 8] = f, F[N + 9] = g, F[N + 12] = d, F[N + 13] = g); } return t._upload = !0, !0; }, t.fillLineVb = function(e, i, n, s, a, r, o, h) { var l = .5 * o, u = t._fillLineArray, c = -(s - r), _ = n - a, d = Math.sqrt(c * c + _ * _); c /= d, _ /= d, c *= l, _ *= l, u[0] = n - c, u[1] = s - _, u[4] = n + c, u[5] = s + _, u[8] = a + c, u[9] = r + _, u[12] = a - c, u[13] = r - _, h && h.transformPointArray(u, u); var p = 16 + (e._byteLength >> 2); return e.byteLength = p << 2, e.insertData(u, p - 16), !0; }, t._fillLineArray = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], t; }(), mt = (function() { function t() {} s(t, "laya.webgl.utils.MatirxArray"), t.ArrayMul = function(e, i, n) { if (e) if (i) for (var s = NaN, a = NaN, r = NaN, o = NaN, h = 0; h < 4; h++) s = e[h], a = e[h + 4], r = e[h + 8], o = e[h + 12], n[h] = s * i[0] + a * i[1] + r * i[2] + o * i[3], n[h + 4] = s * i[4] + a * i[5] + r * i[6] + o * i[7], n[h + 8] = s * i[8] + a * i[9] + r * i[10] + o * i[11], n[h + 12] = s * i[12] + a * i[13] + r * i[14] + o * i[15]; else t.copyArray(e, n); else t.copyArray(i, n); }, t.copyArray = function(t, e) { if (t && e) for (var i = 0; i < t.length; i++) e[i] = t[i]; }; }(), function() { function t(t, e, i) { this._stride = 0, this.vertNum = 0, this.indexNum = 0, this._applied = !1, this._vb = null, this._ib = null, this._vao = null, this._attribInfo = null, this._quadNum = 0, this.canReuse = !1, this._stride = t, this._vb = new Qt(t, 35048), e && this._vb._resizeBuffer(e, !1), this._ib = new Jt(), i && this._ib._resizeBuffer(i, !1); } s(t, "laya.webgl.utils.Mesh2D"); var e = t.prototype; return e.cloneWithNewVB = function() { var e = new t(this._stride, 0, 0); return e._ib = this._ib, e._quadNum = this._quadNum, e._attribInfo = this._attribInfo, e; }, e.cloneWithNewVBIB = function() { var e = new t(this._stride, 0, 0); return e._attribInfo = this._attribInfo, e; }, e.getVBW = function() { return this._vb.setNeedUpload(), this._vb; }, e.getVBR = function() { return this._vb; }, e.getIBR = function() { return this._ib; }, e.getIBW = function() { return this._ib.setNeedUpload(), this._ib; }, e.createQuadIB = function(t) { this._quadNum = t, this._ib._resizeBuffer(6 * t * 2, !1), this._ib.byteLength = this._ib.bufferLength; for (var e = this._ib.getUint16Array(), i = 0, n = 0, s = 0; s < t; s++) e[i++] = n, e[i++] = n + 2, e[i++] = n + 1, e[i++] = n, e[i++] = n + 3, e[i++] = n + 2, n += 4; this._ib.setNeedUpload(); }, e.setAttributes = function(t) { if (this._attribInfo = t, this._attribInfo.length % 3 != 0) throw "Mesh2D setAttributes error!"; }, e.getEleNum = function() { return this._ib.getBuffer().byteLength / 2; }, e.releaseMesh = function() {}, e.destroy = function() {}, e.clearVB = function() { this._vb.clear(); }, t._gvaoid = 0, t; }()), vt = function() { function t() {} return s(t, "laya.webgl.utils.RenderState2D"), t.getMatrArray = function() { return [ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 ]; }, t.mat2MatArray = function(e, i) { var n = e, s = i; return s[0] = n.a, s[1] = n.b, s[2] = t.EMPTYMAT4_ARRAY[2], s[3] = t.EMPTYMAT4_ARRAY[3], s[4] = n.c, s[5] = n.d, s[6] = t.EMPTYMAT4_ARRAY[6], s[7] = t.EMPTYMAT4_ARRAY[7], s[8] = t.EMPTYMAT4_ARRAY[8], s[9] = t.EMPTYMAT4_ARRAY[9], s[10] = t.EMPTYMAT4_ARRAY[10], s[11] = t.EMPTYMAT4_ARRAY[11], s[12] = n.tx, s[13] = n.ty, s[14] = t.EMPTYMAT4_ARRAY[14], s[15] = t.EMPTYMAT4_ARRAY[15], i; }, t.restoreTempArray = function() { t.TEMPMAT4_ARRAY[0] = 1, t.TEMPMAT4_ARRAY[1] = 0, t.TEMPMAT4_ARRAY[4] = 0, t.TEMPMAT4_ARRAY[5] = 1, t.TEMPMAT4_ARRAY[12] = 0, t.TEMPMAT4_ARRAY[13] = 0; }, t.clear = function() { t.worldScissorTest = !1, t.worldShaderDefines = null, t.worldFilters = null, t.worldAlpha = 1, t.worldClipRect.x = t.worldClipRect.y = 0, t.worldClipRect.width = t.width, t.worldClipRect.height = t.height, t.curRenderTarget = null; }, t._MAXSIZE = 99999999, t.EMPTYMAT4_ARRAY = [ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 ], t.TEMPMAT4_ARRAY = [ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 ], t.worldMatrix4 = t.TEMPMAT4_ARRAY, t.worldAlpha = 1, t.worldScissorTest = !1, t.worldFilters = null, t.worldShaderDefines = null, t.curRenderTarget = null, t.width = 0, t.height = 0, n(t, [ "worldMatrix", function() { return this.worldMatrix = new x(); }, "worldClipRect", function() { return this.worldClipRect = new w(0, 0, 99999999, 99999999); } ]), t; }(), yt = function() { function t(t, i, n, s, a) { function r(t) { var i = [], n = new e(i); return o._compileToTree(n, t.split("\n"), 0, i, a), n; } var o = this, h = u.now(); this._VS = r(i), this._PS = r(n), this._nameMap = s, u.now() - h > 2 && console.log("ShaderCompile use time:" + (u.now() - h) + " size:" + i.length + "/" + n.length); } var e, i; s(t, "laya.webgl.utils.ShaderCompile"); var a = t.prototype; return a._compileToTree = function(i, n, s, a, r) { var o, h, l, u, c, _, d, p = 0, f = 0, g = 0, m = 0; for (f = s; f < n.length; f++) if (!((l = n[f]).length < 1) && 0 !== (p = l.indexOf("//"))) { if (p >= 0 && (l = l.substr(0, p)), o = d || new e(a), d = null, o.text = l, o.noCompile = !0, (p = l.indexOf("#")) >= 0) { for (u = "#", m = p + 1, g = l.length; m < g; m++) { var v = l.charAt(m); if (" " === v || "\t" === v || "?" === v) break; u += v; } switch (o.name = u, u) { case "#ifdef": case "#ifndef": if (o.src = l, o.noCompile = null != l.match(/[!&|()=<>]/), o.noCompile ? console.log("function():Boolean{return " + l.substr(p + o.name.length) + "}") : (_ = l.replace(/^\s*/, "").split(/\s+/), o.setCondition(_[1], "#ifdef" === u ? 1 : 2), o.text = "//" + o.text), o.setParent(i), i = o, r) for (_ = l.substr(m).split(t._splitToWordExps3), m = 0; m < _.length; m++) (l = _[m]).length && (r[l] = !0); continue; case "#if": if (o.src = l, o.noCompile = !0, o.setParent(i), i = o, r) for (_ = l.substr(m).split(t._splitToWordExps3), m = 0; m < _.length; m++) (l = _[m]).length && "defined" != l && (r[l] = !0); continue; case "#else": o.src = l, h = (i = i.parent).childs[i.childs.length - 1], o.noCompile = h.noCompile, o.noCompile || (o.condition = h.condition, o.conditionType = 1 == h.conditionType ? 2 : 1, o.text = "//" + o.text + " " + h.text + " " + o.conditionType), o.setParent(i), i = o; continue; case "#endif": h = (i = i.parent).childs[i.childs.length - 1], o.noCompile = h.noCompile, o.noCompile || (o.text = "//" + o.text), o.setParent(i); continue; case "#include": _ = t.splitToWords(l, null); var y = t.includes[_[1]]; if (!y) throw "ShaderCompile error no this include file:" + _[1]; if ((p = _[0].indexOf("?")) < 0) { o.setParent(i), l = y.getWith("with" == _[2] ? _[3] : null), this._compileToTree(o, l.split("\n"), 0, a, r), o.text = ""; continue; } o.setCondition(_[0].substr(p + 1), 1), o.text = y.getWith("with" == _[2] ? _[3] : null); break; case "#import": c = (_ = t.splitToWords(l, null))[1], a.push({ node: o, file: t.includes[c], ofs: o.text.length }); continue; } } else { if ((h = i.childs[i.childs.length - 1]) && !h.name) { a.length > 0 && t.splitToWords(l, h), d = o, h.text += "\n" + l; continue; } a.length > 0 && t.splitToWords(l, o); } o.setParent(i); } }, a.createShader = function(t, e, i) { var n = {}, s = ""; if (t) for (var a in t) s += "#define " + a + "\n", n[a] = !0; var r = this._VS.toscript(n, []), o = this._PS.toscript(n, []); return (i || Kt.create)(s + r.join("\n"), s + o.join("\n"), e, this._nameMap); }, t._parseOne = function(e, i, n, s, a, r) { var o = { type: t.shaderParamsMap[n[s + 1]], name: n[s + 2], size: isNaN(parseInt(n[s + 3])) ? 1 : parseInt(n[s + 3]) }; return r && ("attribute" == a ? e.push(o) : i.push(o)), ":" == n[s + 3] && (o.type = n[s + 4], s += 2), s += 2; }, t.addInclude = function(e, n) { if (!n || 0 === n.length) throw new Error("add shader include file err:" + e); if (t.includes[e]) throw new Error("add shader include file err, has add:" + e); t.includes[e] = new i(n); }, t.preGetParams = function(e, i) { var n = [ e, i ], s = {}, a = [], r = [], o = {}, h = []; s.attributes = a, s.uniforms = r, s.defines = o; for (var l = 0, u = 0, c = 0; c < 2; c++) { n[c] = n[c].replace(t._removeAnnotation, ""); var _, d = n[c].match(t._reg); for (l = 0, u = d.length; l < u; l++) { var p = d[l]; if ("attribute" == p || "uniform" == p) l = t._parseOne(a, r, d, l, p, !0); else { if ("#define" == p) { h[p = d[++l]] = 1; continue; } if ("#ifdef" == p) { o[_ = d[++l]] = o[_] || []; for (l++; l < u; l++) if ("attribute" == (p = d[l]) || "uniform" == p) l = t._parseOne(a, r, d, l, p, h[_]); else if ("#else" == p) for (l++; l < u; l++) if ("attribute" == (p = d[l]) || "uniform" == p) l = t._parseOne(a, r, d, l, p, !h[_]); else if ("#endif" == p) break; } } } } return s; }, t.splitToWords = function(t, e) { for (var i, n, s = [], a = -1, r = 0, o = t.length; r < o; r++) if (i = t.charAt(r), " \t=+-*/&%!<>()'\",;".indexOf(i) >= 0) { if (a >= 0 && r - a > 1 && (n = t.substr(a, r - a), s.push(n)), '"' == i || "'" == i) { var h = t.indexOf(i, r + 1); if (h < 0) throw "Sharder err:" + t; s.push(t.substr(r + 1, h - r - 1)), r = h, a = -1; continue; } "(" == i && e && s.length > 0 && (n = s[s.length - 1] + ";", "vec4;main;".indexOf(n) < 0 && (e.useFuns += n)), a = -1; } else a < 0 && (a = r); return a < o && o - a > 1 && (n = t.substr(a, o - a), s.push(n)), s; }, t.IFDEF_NO = 0, t.IFDEF_YES = 1, t.IFDEF_ELSE = 2, t.IFDEF_PARENT = 3, t._removeAnnotation = new RegExp("(/\\*([^*]|[\\r\\\n]|(\\*+([^*/]|[\\r\\n])))*\\*+/)|(//.*)", "g"), t._reg = new RegExp("(\".*\")|('.*')|([#\\w\\*-\\.+/()=<>{}\\\\]+)|([,;:\\\\])", "g"), t._splitToWordExps = new RegExp("[(\".*\")]+|[('.*')]+|([ \\t=\\+\\-*/&%!<>!%(),;])", "g"), t.includes = {}, n(t, [ "shaderParamsMap", function() { return this.shaderParamsMap = { float: 5126, int: 5124, bool: 35670, vec2: 35664, vec3: 35665, vec4: 35666, ivec2: 35667, ivec3: 35668, ivec4: 35669, bvec2: 35671, bvec3: 35672, bvec4: 35673, mat2: 35674, mat3: 35675, mat4: 35676, sampler2D: 35678, samplerCube: 35680 }; }, "_splitToWordExps3", function() { return this._splitToWordExps3 = new RegExp("[ \\t=\\+\\-*/&%!<>!%(),;\\|]", "g"); } ]), t.__init$ = function() { e = function() { function t(t) { this.childs = [], this.text = "", this.parent = null, this.name = null, this.noCompile = !1, this.includefiles = null, this.condition = null, this.conditionType = 0, this.useFuns = "", this.z = 0, this.src = null, this.includefiles = t; } s(t, ""); var e = t.prototype; return e.setParent = function(t) { t.childs.push(this), this.z = t.z + 1, this.parent = t; }, e.setCondition = function(t, e) { t && (this.conditionType = e, t = t.replace(/(\s*$)/g, ""), this.condition = function() { return this[t]; }, this.condition.__condition = t); }, e.toscript = function(e, i) { return this._toscript(e, i, ++t.__id); }, e._toscript = function(t, e, i) { if (this.childs.length < 1 && !this.text) return e; e.length; if (this.condition) { var n = !!this.condition.call(t); if (2 === this.conditionType && (n = !n), !n) return e; } if (this.text && e.push(this.text), this.childs.length > 0 && this.childs.forEach(function(n, s, a) { n._toscript(t, e, i); }), this.includefiles.length > 0 && this.useFuns.length > 0) for (var s, a = 0, r = this.includefiles.length; a < r; a++) this.includefiles[a].curUseID != i && (s = this.includefiles[a].file.getFunsScript(this.useFuns)).length > 0 && (this.includefiles[a].curUseID = i, e[0] = s + e[0]); return e; }, t.__id = 1, t; }(), i = function() { function e(e) { this.script = null, this.codes = {}, this.funs = {}, this.curUseID = -1, this.funnames = "", this.script = e; for (var i = 0, n = 0, s = 0; ;) { if ((i = e.indexOf("#begin", i)) < 0) break; for (s = i + 5; ;) { if ((s = e.indexOf("#end", s)) < 0) break; if ("i" !== e.charAt(s + 4)) break; s += 5; } if (s < 0) throw "add include err,no #end:" + e; n = e.indexOf("\n", i); var a = t.splitToWords(e.substr(i, n - i), null); "code" == a[1] ? this.codes[a[2]] = e.substr(n + 1, s - n - 1) : "function" == a[1] && (n = e.indexOf("function", i), n += "function".length, this.funs[a[3]] = e.substr(n + 1, s - n - 1), this.funnames += a[3] + ";"), i = s + 1; } } s(e, ""); var i = e.prototype; return i.getWith = function(t) { var e = t ? this.codes[t] : this.script; if (!e) throw "get with error:" + t; return e; }, i.getFunsScript = function(t) { var e = ""; for (var i in this.funs) t.indexOf(i + ";") >= 0 && (e += this.funs[i]); return e; }, e; }(); }, t; }(), xt = function() { function t() {} return s(t, "laya.webgl.WebGL"), t._uint8ArraySlice = function() { for (var t = this.length, e = new Uint8Array(this.length), i = 0; i < t; i++) e[i] = this[i]; return e; }, t._float32ArraySlice = function() { for (var t = this.length, e = new Float32Array(this.length), i = 0; i < t; i++) e[i] = this[i]; return e; }, t._uint16ArraySlice = function(t) { var e, i = arguments, n = 0, s = 0; if (0 === i.length) for (n = this.length, e = new Uint16Array(n), s = 0; s < n; s++) e[s] = this[s]; else if (2 === i.length) { var a = i[0], r = i[1]; if (r > a) for (n = r - a, e = new Uint16Array(n), s = a; s < r; s++) e[s - a] = this[s]; else e = new Uint16Array(0); } return e; }, t.expandContext = function() { var t = p.prototype, e = CanvasRenderingContext2D.prototype; e.fillTrangles = t.fillTrangles, $t.__int__(null), e.setIBVB = function(t, e, i, n, s, a, r, o, h, l) { void 0 === h && (h = 0), void 0 === l && (l = 0), null === i && (this._ib = this._ib || Jt.QuadrangleIB, i = this._ib, gt.expandIBQuadrangle(i, n._byteLength / 64 + 8)), this._setIBVB(t, e, i, n, s, a, r, o, h, l); }, e.fillTrangles = function(t, e, i, n, s) { this._curMat = this._curMat || x.create(), this._vb = this._vb || Qt.create(), this._ib || (this._ib = Jt.create(), gt.fillIBQuadrangle(this._ib, r / 4)); var a = this._vb, r = n.length >> 4; gt.fillTranglesVB(a, e, i, n, s || this._curMat, 0, 0), gt.expandIBQuadrangle(this._ib, a._byteLength / 64 + 8); var o = new St(1, 0); o.textureHost = t; var h = new Zt("attribute vec2 position; attribute vec2 texcoord; uniform vec2 size; uniform mat4 mmat; varying vec2 v_texcoord; void main() { vec4 p=vec4(position.xy,0.0,1.0);vec4 pos=mmat*p; gl_Position =vec4((pos.x/size.x-0.5)*2.0,(0.5-pos.y/size.y)*2.0,pos.z,1.0); v_texcoord = texcoord; }", "precision mediump float; varying vec2 v_texcoord; uniform sampler2D texture; void main() {vec4 color= texture2D(texture, v_texcoord); color.a*=1.0; gl_FragColor= color;}"); a._vertType = 3, this._setIBVB(e, i, this._ib, a, 6 * r, s, h, o, 0, 0); }; }, t.enable = function() { if (u.__init__(), C.isConchApp && !C.isConchWebGL) return M.skinAniSprite = function() { return new tt(); }, t.expandContext(), !1; if (M.getWebGLContext = function(t) { for (var e, i = [ "webgl", "experimental-webgl", "webkit-3d", "moz-webgl" ], n = 0; n < i.length; n++) { try { e = t.getContext(i[n], { stencil: d.isStencil, alpha: d.isAlpha, antialias: d.isAntialias, premultipliedAlpha: d.premultipliedAlpha, preserveDrawingBuffer: d.preserveDrawingBuffer }); } catch (t) {} if (e) return e; } return null; }, null == (t.mainContext = M.getWebGLContext(C._mainCanvas))) return !1; if (C.isWebGL) return !0; v.create = function(t, e) { return new te(t, e); }, y.create = function(t, e, i, n, s, a, r) { return new jt(t, e, i, n, s, a, r); }, C.WebGL = t, C.isWebGL = !0, dt.__init__(), M.createRenderSprite = function(t, e) { return new Tt(t, e); }, M.createWebGLContext2D = function(t) { return new Ct(t); }, M.changeWebGLSize = function(t, e) { laya.webgl.WebGL.onStageResize(t, e); }, M.createGraphics = function() { return new wt(); }; var e = M.createFilterAction; return M.createFilterAction = e || function(t) { return new It(); }, M.clear = function(t) { vt.worldScissorTest && laya.webgl.WebGL.mainContext.disable(3089); var e = C.context.ctx, i = 0 == e._submits._length || d.preserveDrawingBuffer ? _.create(t)._color : A._wgColor; i && e.clearBG(i[0], i[1], i[2], i[3]), vt.clear(); }, M.addToAtlas = function(t, e) { void 0 === e && (e = !1); var n = t.bitmap; C.optimizeTextureMemory(t.url, t) ? i.__typeof(n, "laya.webgl.resource.IMergeAtlasBitmap") && n.allowMerageInAtlas && n.on("recovered", t, t.addTextureToAtlas) : n.enableMerageInAtlas = !1; }, M.isAtlas = function(t) { return t instanceof laya.webgl.atlas.AtlasWebGLCanvas; }, U._enable(), M.beginFlush = function() { for (var t = U.instance, e = t.getAtlaserCount(), i = 0; i < e; i++) { var n = t.getAtlaserByIndex(i).texture; n._flashCacheImageNeedFlush && M.flashFlushImage(n); } }, M.drawToCanvas = function(t, e, i, n, s, a) { (i <= 0 || n <= 0) && console.log("[error] canvasWidth and canvasHeight should greater than zero"), i |= 0, n |= 0, s |= 0, a |= 0; var r = Ft.create(i, n, 6408, 5121, 0, !1); r.start(), r.clear(0, 0, 0, 0), C.context.clear(), S.renders[e]._fun(t, C.context, s, vt.height - n + a), C.context.flush(), r.end(); var o = r.getData(0, 0, i, n); if (r.recycle(), o.byteLength == i * n * 4) { var h = new Ht(); h._canvas = u.createElement("canvas"), h.size(i, n); var l = h._canvas.getContext("2d"); u.canvas.size(i, n); var c = u.context, _ = c.createImageData(i, n); return _.data.set(new Uint8ClampedArray(o.buffer)), h._imgData = _, c.putImageData(_, 0, 0), l.save(), l.translate(0, n), l.scale(1, -1), l.drawImage(u.canvas.source, 0, 0), l.restore(), h; } console.log("drawToCanvas error: w:" + i + ",h:" + n + ",datalen:" + o.byteLength); }, M.createFilterAction = function(t) { var e; switch (t) { case 32: e = new It(); } return e; }, M.addTextureToAtlas = function(t) { t._uvID++, U._atlasRestore++, t.bitmap.enableMerageInAtlas && U.instance.addToAtlas(t); }, M.getTexturePixels = function(t, e, i, n, s) { C.context.ctx.clear(); var a = new E(); a.graphics.drawTexture(t, -e, -i); var r = Ft.create(n, s); r.start(), r.clear(0, 0, 0, 0), a.render(C.context, 0, 0), C.context.ctx.flush(), r.end(); for (var o = r.getData(0, 0, n, s), h = [], l = 0, u = s - 1; u >= 0; u--) for (var c = 0; c < n; c++) l = 4 * (u * n + c), h.push(o[l]), h.push(o[l + 1]), h.push(o[l + 2]), h.push(o[l + 3]); return h; }, M.skinAniSprite = function() { return new tt(); }, m.create = function(t, e) { var i = new Ht(); return i._imgData = e, i.flipY = !1, i; }, f._filterStart = function(t, e, i, n, s) { var a = t.getValue("bounds"), r = Ft.create(a.width, a.height); if (r.start(), r.clear(0, 0, 0, 0), t.addValue("src", r), t.addValue("ScissorTest", vt.worldScissorTest), vt.worldScissorTest) { var o = new w(); o.copyFrom(i.ctx._clipRect), t.addValue("clipRect", o), vt.worldScissorTest = !1, laya.webgl.WebGL.mainContext.disable(3089); } }, f._filterEnd = function(t, e, i, n, s) { var a = t.getValue("bounds"); t.getValue("src").end(); var r = Ft.create(a.width, a.height); r.start(), r.clear(0, 0, 0, 0), t.addValue("out", r), e._set$P("_filterCache", r), e._set$P("_isHaveGlowFilter", t.getValue("_isHaveGlowFilter")); }, f._EndTarget = function(t, e) { t.getValue("src").recycle(); t.getValue("out").end(); if (t.getValue("ScissorTest")) { vt.worldScissorTest = !0, laya.webgl.WebGL.mainContext.enable(3089), e.ctx.save(); var i = t.getValue("clipRect"); e.ctx.clipRect(i.x, i.y, i.width, i.height); } }, f._useSrc = function(t) { var e = t.getValue("out"); e.end(), (e = t.getValue("src")).start(), e.clear(0, 0, 0, 0); }, f._endSrc = function(t) { t.getValue("src").end(); }, f._useOut = function(t) { var e = t.getValue("src"); e.end(), (e = t.getValue("out")).start(), e.clear(0, 0, 0, 0); }, f._endOut = function(t) { t.getValue("out").end(); }, f._recycleScope = function(t) { t.recycle(); }, f._filter = function(t, e, i, n) { var s = this._next; if (s) { var a = t.filters, r = a.length; if (1 == r && 32 == a[0].type) return e.ctx.save(), e.ctx.setFilters([ a[0] ]), s._fun.call(s, t, e, i, n), void e.ctx.restore(); var o, h, l = ot.create(), u = b.TEMP, c = e.ctx._getTransformMatrix(), _ = x.create(); c.copyTo(_); var d = 0, p = 0, g = !1, m = t._$P._filterCache ? t._$P._filterCache : null; if (!m || t._repaint) { g = t._isHaveGlowFilter(), l.addValue("_isHaveGlowFilter", g), g && (d = 50, p = 25), (h = new w()).copyFrom(t.getSelfBounds()), h.x += t.x, h.y += t.y, h.x -= t.pivotX + 4, h.y -= t.pivotY + 4; var v = h.x, y = h.y; if (h.width += d + 8, h.height += d + 8, u.x = h.x * _.a + h.y * _.c, u.y = h.y * _.d + h.x * _.b, h.x = u.x, h.y = u.y, u.x = h.width * _.a + h.height * _.c, u.y = h.height * _.d + h.width * _.b, h.width = u.x, h.height = u.y, h.width <= 0 || h.height <= 0) return; m && m.recycle(), l.addValue("bounds", h); var C = rt.create([ l, t, e, 0, 0 ], f._filterStart); e.addRenderObject(C), e.ctx._renderKey = 0, e.ctx._shader2D.glTexture = null; var S = t.x - v + p, T = t.y - y + p; s._fun.call(s, t, e, S, T), C = rt.create([ l, t, e, 0, 0 ], f._filterEnd), e.addRenderObject(C); for (var I = 0; I < r; I++) { 0 != I && (C = rt.create([ l ], f._useSrc), e.addRenderObject(C), o = St.create(1, 0), x.TEMP.identity(), e.ctx.drawTarget(l, 0, 0, h.width, h.height, x.TEMP, "out", o, null, W.TOINT.overlay), C = rt.create([ l ], f._useOut), e.addRenderObject(C)); a[I].action.apply3d(l, t, e, 0, 0); } C = rt.create([ l, e ], f._EndTarget), e.addRenderObject(C); } else { if ((g = !!t._$P._isHaveGlowFilter && t._$P._isHaveGlowFilter) && (d = 50, p = 25), (h = t.getBounds()).width <= 0 || h.height <= 0) return; h.width += d, h.height += d, u.x = h.x * _.a + h.y * _.c, u.y = h.y * _.d + h.x * _.b, h.x = u.x, h.y = u.y, u.x = h.width * _.a + h.height * _.c, u.y = h.height * _.d + h.width * _.b, h.width = u.x, h.height = u.y, l.addValue("out", m); } i = i - p - t.x, n = n - p - t.y, u.setTo(i, n), _.transformPoint(u), i = u.x + h.x, n = u.y + h.y, o = St.create(1, 0), x.TEMP.identity(), e.ctx.drawTarget(l, i, n, h.width, h.height, x.TEMP, "out", o, null, W.TOINT.overlay), C = rt.create([ l ], f._recycleScope), e.addRenderObject(C), _.destroy(); } }, Float32Array.prototype.slice || (Float32Array.prototype.slice = t._float32ArraySlice), Uint16Array.prototype.slice || (Uint16Array.prototype.slice = t._uint16ArraySlice), Uint8Array.prototype.slice || (Uint8Array.prototype.slice = t._uint8ArraySlice), !0; }, t.onStageResize = function(e, i) { null != t.mainContext && (t.mainContext.viewport(0, 0, e, i), vt.width = e, vt.height = i); }, t.onInvalidGLRes = function() { U.instance.freeAll(), I.releaseContentManagers(!0), t.doNodeRepaint(i.stage), t.mainContext.viewport(0, 0, vt.width, vt.height), i.stage.event("devicelost"); }, t.doNodeRepaint = function(e) { 0 == e.numChildren && e.repaint(); for (var i = 0; i < e.numChildren; i++) t.doNodeRepaint(e.getChildAt(i)); }, t.init = function(e, i, n) { t.mainCanvas = e, m._createContext = function(t) { return new Ct(t); }, Ht._createContext = function(t) { return new Ct(t); }; var s = laya.webgl.WebGL.mainContext; if (null != s.getShaderPrecisionFormat) { var a = s.getShaderPrecisionFormat(35633, 36338), r = s.getShaderPrecisionFormat(35632, 36338); t.shaderHighPrecision = !(!a.precision || !r.precision); } else t.shaderHighPrecision = !1; if (t.compressAstc = s.getExtension("WEBGL_compressed_texture_astc"), t.compressAtc = s.getExtension("WEBGL_compressed_texture_atc"), t.compressEtc = s.getExtension("WEBGL_compressed_texture_etc"), t.compressEtc1 = s.getExtension("WEBGL_compressed_texture_etc1"), t.compressPvrtc = s.getExtension("WEBGL_compressed_texture_pvrtc"), t.compressS3tc = s.getExtension("WEBGL_compressed_texture_s3tc"), t.compressS3tc_srgb = s.getExtension("WEBGL_compressed_texture_s3tc_srgb"), s.deleteTexture1 = s.deleteTexture, s.deleteTexture = function(t) { t == bt.curBindTexValue && (bt.curBindTexValue = null), s.deleteTexture1(t); }, t.onStageResize(i, n), null == t.mainContext) throw new Error("webGL getContext err!"); k.__init__(), U.__init__(), Et.__init__(), at.__init__(), Ct.__init__(), St.__init__(), J.__init__(), $t.__int__(s), W._init_(s), C.isConchApp && conch.setOnInvalidGLRes(t.onInvalidGLRes); }, t.compressAstc = null, t.compressAtc = null, t.compressEtc = null, t.compressEtc1 = null, t.compressPvrtc = null, t.compressS3tc = null, t.compressS3tc_srgb = null, t.mainCanvas = null, t.mainContext = null, t.antialias = !0, t.shaderHighPrecision = !1, t._bg_null = [ 0, 0, 0, 0 ], t; }(), bt = function() { function t() {} return s(t, "laya.webgl.WebGLContext"), t.UseProgram = function(e) { return t._useProgram !== e && (xt.mainContext.useProgram(e), t._useProgram = e, !0); }, t.setDepthTest = function(e, i) { i !== t._depthTest && (t._depthTest = i, i ? e.enable(2929) : e.disable(2929)); }, t.setDepthMask = function(e, i) { i !== t._depthMask && (t._depthMask = i, e.depthMask(i)); }, t.setDepthFunc = function(e, i) { i !== t._depthFunc && (t._depthFunc = i, e.depthFunc(i)); }, t.setBlend = function(e, i) { i !== t._blend && (t._blend = i, i ? e.enable(3042) : e.disable(3042)); }, t.setBlendFunc = function(e, i, n) { (i !== t._sFactor || n !== t._dFactor) && (t._sFactor = i, t._dFactor = n, e.blendFunc(i, n)); }, t.setCullFace = function(e, i) { i !== t._cullFace && (t._cullFace = i, i ? e.enable(2884) : e.disable(2884)); }, t.setFrontFace = function(e, i) { i !== t._frontFace && (t._frontFace = i, e.frontFace(i)); }, t.bindTexture = function(e, i, n) { e.bindTexture(i, n), t.curBindTexTarget = i, t.curBindTexValue = n; }, t.DEPTH_BUFFER_BIT = 256, t.STENCIL_BUFFER_BIT = 1024, t.COLOR_BUFFER_BIT = 16384, t.POINTS = 0, t.LINES = 1, t.LINE_LOOP = 2, t.LINE_STRIP = 3, t.TRIANGLES = 4, t.TRIANGLE_STRIP = 5, t.TRIANGLE_FAN = 6, t.ZERO = 0, t.ONE = 1, t.SRC_COLOR = 768, t.ONE_MINUS_SRC_COLOR = 769, t.SRC_ALPHA = 770, t.ONE_MINUS_SRC_ALPHA = 771, t.DST_ALPHA = 772, t.ONE_MINUS_DST_ALPHA = 773, t.DST_COLOR = 774, t.ONE_MINUS_DST_COLOR = 775, t.SRC_ALPHA_SATURATE = 776, t.FUNC_ADD = 32774, t.BLEND_EQUATION = 32777, t.BLEND_EQUATION_RGB = 32777, t.BLEND_EQUATION_ALPHA = 34877, t.FUNC_SUBTRACT = 32778, t.FUNC_REVERSE_SUBTRACT = 32779, t.BLEND_DST_RGB = 32968, t.BLEND_SRC_RGB = 32969, t.BLEND_DST_ALPHA = 32970, t.BLEND_SRC_ALPHA = 32971, t.CONSTANT_COLOR = 32769, t.ONE_MINUS_CONSTANT_COLOR = 32770, t.CONSTANT_ALPHA = 32771, t.ONE_MINUS_CONSTANT_ALPHA = 32772, t.BLEND_COLOR = 32773, t.ARRAY_BUFFER = 34962, t.ELEMENT_ARRAY_BUFFER = 34963, t.ARRAY_BUFFER_BINDING = 34964, t.ELEMENT_ARRAY_BUFFER_BINDING = 34965, t.STREAM_DRAW = 35040, t.STATIC_DRAW = 35044, t.DYNAMIC_DRAW = 35048, t.BUFFER_SIZE = 34660, t.BUFFER_USAGE = 34661, t.CURRENT_VERTEX_ATTRIB = 34342, t.FRONT = 1028, t.BACK = 1029, t.CULL_FACE = 2884, t.FRONT_AND_BACK = 1032, t.BLEND = 3042, t.DITHER = 3024, t.STENCIL_TEST = 2960, t.DEPTH_TEST = 2929, t.SCISSOR_TEST = 3089, t.POLYGON_OFFSET_FILL = 32823, t.SAMPLE_ALPHA_TO_COVERAGE = 32926, t.SAMPLE_COVERAGE = 32928, t.NO_ERROR = 0, t.INVALID_ENUM = 1280, t.INVALID_VALUE = 1281, t.INVALID_OPERATION = 1282, t.OUT_OF_MEMORY = 1285, t.CW = 2304, t.CCW = 2305, t.LINE_WIDTH = 2849, t.ALIASED_POINT_SIZE_RANGE = 33901, t.ALIASED_LINE_WIDTH_RANGE = 33902, t.CULL_FACE_MODE = 2885, t.FRONT_FACE = 2886, t.DEPTH_RANGE = 2928, t.DEPTH_WRITEMASK = 2930, t.DEPTH_CLEAR_VALUE = 2931, t.DEPTH_FUNC = 2932, t.STENCIL_CLEAR_VALUE = 2961, t.STENCIL_FUNC = 2962, t.STENCIL_FAIL = 2964, t.STENCIL_PASS_DEPTH_FAIL = 2965, t.STENCIL_PASS_DEPTH_PASS = 2966, t.STENCIL_REF = 2967, t.STENCIL_VALUE_MASK = 2963, t.STENCIL_WRITEMASK = 2968, t.STENCIL_BACK_FUNC = 34816, t.STENCIL_BACK_FAIL = 34817, t.STENCIL_BACK_PASS_DEPTH_FAIL = 34818, t.STENCIL_BACK_PASS_DEPTH_PASS = 34819, t.STENCIL_BACK_REF = 36003, t.STENCIL_BACK_VALUE_MASK = 36004, t.STENCIL_BACK_WRITEMASK = 36005, t.VIEWPORT = 2978, t.SCISSOR_BOX = 3088, t.COLOR_CLEAR_VALUE = 3106, t.COLOR_WRITEMASK = 3107, t.UNPACK_ALIGNMENT = 3317, t.PACK_ALIGNMENT = 3333, t.MAX_TEXTURE_SIZE = 3379, t.MAX_VIEWPORT_DIMS = 3386, t.SUBPIXEL_BITS = 3408, t.RED_BITS = 3410, t.GREEN_BITS = 3411, t.BLUE_BITS = 3412, t.ALPHA_BITS = 3413, t.DEPTH_BITS = 3414, t.STENCIL_BITS = 3415, t.POLYGON_OFFSET_UNITS = 10752, t.POLYGON_OFFSET_FACTOR = 32824, t.TEXTURE_BINDING_2D = 32873, t.SAMPLE_BUFFERS = 32936, t.SAMPLES = 32937, t.SAMPLE_COVERAGE_VALUE = 32938, t.SAMPLE_COVERAGE_INVERT = 32939, t.NUM_COMPRESSED_TEXTURE_FORMATS = 34466, t.COMPRESSED_TEXTURE_FORMATS = 34467, t.DONT_CARE = 4352, t.FASTEST = 4353, t.NICEST = 4354, t.GENERATE_MIPMAP_HINT = 33170, t.BYTE = 5120, t.UNSIGNED_BYTE = 5121, t.SHORT = 5122, t.UNSIGNED_SHORT = 5123, t.INT = 5124, t.UNSIGNED_INT = 5125, t.FLOAT = 5126, t.DEPTH_COMPONENT = 6402, t.ALPHA = 6406, t.RGB = 6407, t.RGBA = 6408, t.LUMINANCE = 6409, t.LUMINANCE_ALPHA = 6410, t.UNSIGNED_SHORT_4_4_4_4 = 32819, t.UNSIGNED_SHORT_5_5_5_1 = 32820, t.UNSIGNED_SHORT_5_6_5 = 33635, t.FRAGMENT_SHADER = 35632, t.VERTEX_SHADER = 35633, t.MAX_VERTEX_ATTRIBS = 34921, t.MAX_VERTEX_UNIFORM_VECTORS = 36347, t.MAX_VARYING_VECTORS = 36348, t.MAX_COMBINED_TEXTURE_IMAGE_UNITS = 35661, t.MAX_VERTEX_TEXTURE_IMAGE_UNITS = 35660, t.MAX_TEXTURE_IMAGE_UNITS = 34930, t.MAX_FRAGMENT_UNIFORM_VECTORS = 36349, t.SHADER_TYPE = 35663, t.DELETE_STATUS = 35712, t.LINK_STATUS = 35714, t.VALIDATE_STATUS = 35715, t.ATTACHED_SHADERS = 35717, t.ACTIVE_UNIFORMS = 35718, t.ACTIVE_ATTRIBUTES = 35721, t.SHADING_LANGUAGE_VERSION = 35724, t.CURRENT_PROGRAM = 35725, t.NEVER = 512, t.LESS = 513, t.EQUAL = 514, t.LEQUAL = 515, t.GREATER = 516, t.NOTEQUAL = 517, t.GEQUAL = 518, t.ALWAYS = 519, t.KEEP = 7680, t.REPLACE = 7681, t.INCR = 7682, t.DECR = 7683, t.INVERT = 5386, t.INCR_WRAP = 34055, t.DECR_WRAP = 34056, t.VENDOR = 7936, t.RENDERER = 7937, t.VERSION = 7938, t.NEAREST = 9728, t.LINEAR = 9729, t.NEAREST_MIPMAP_NEAREST = 9984, t.LINEAR_MIPMAP_NEAREST = 9985, t.NEAREST_MIPMAP_LINEAR = 9986, t.LINEAR_MIPMAP_LINEAR = 9987, t.TEXTURE_MAG_FILTER = 10240, t.TEXTURE_MIN_FILTER = 10241, t.TEXTURE_WRAP_S = 10242, t.TEXTURE_WRAP_T = 10243, t.TEXTURE_2D = 3553, t.TEXTURE = 5890, t.TEXTURE_CUBE_MAP = 34067, t.TEXTURE_BINDING_CUBE_MAP = 34068, t.TEXTURE_CUBE_MAP_POSITIVE_X = 34069, t.TEXTURE_CUBE_MAP_NEGATIVE_X = 34070, t.TEXTURE_CUBE_MAP_POSITIVE_Y = 34071, t.TEXTURE_CUBE_MAP_NEGATIVE_Y = 34072, t.TEXTURE_CUBE_MAP_POSITIVE_Z = 34073, t.TEXTURE_CUBE_MAP_NEGATIVE_Z = 34074, t.MAX_CUBE_MAP_TEXTURE_SIZE = 34076, t.TEXTURE0 = 33984, t.TEXTURE1 = 33985, t.TEXTURE2 = 33986, t.TEXTURE3 = 33987, t.TEXTURE4 = 33988, t.TEXTURE5 = 33989, t.TEXTURE6 = 33990, t.TEXTURE7 = 33991, t.TEXTURE8 = 33992, t.TEXTURE9 = 33993, t.TEXTURE10 = 33994, t.TEXTURE11 = 33995, t.TEXTURE12 = 33996, t.TEXTURE13 = 33997, t.TEXTURE14 = 33998, t.TEXTURE15 = 33999, t.TEXTURE16 = 34e3, t.TEXTURE17 = 34001, t.TEXTURE18 = 34002, t.TEXTURE19 = 34003, t.TEXTURE20 = 34004, t.TEXTURE21 = 34005, t.TEXTURE22 = 34006, t.TEXTURE23 = 34007, t.TEXTURE24 = 34008, t.TEXTURE25 = 34009, t.TEXTURE26 = 34010, t.TEXTURE27 = 34011, t.TEXTURE28 = 34012, t.TEXTURE29 = 34013, t.TEXTURE30 = 34014, t.TEXTURE31 = 34015, t.ACTIVE_TEXTURE = 34016, t.REPEAT = 10497, t.CLAMP_TO_EDGE = 33071, t.MIRRORED_REPEAT = 33648, t.FLOAT_VEC2 = 35664, t.FLOAT_VEC3 = 35665, t.FLOAT_VEC4 = 35666, t.INT_VEC2 = 35667, t.INT_VEC3 = 35668, t.INT_VEC4 = 35669, t.BOOL = 35670, t.BOOL_VEC2 = 35671, t.BOOL_VEC3 = 35672, t.BOOL_VEC4 = 35673, t.FLOAT_MAT2 = 35674, t.FLOAT_MAT3 = 35675, t.FLOAT_MAT4 = 35676, t.SAMPLER_2D = 35678, t.SAMPLER_CUBE = 35680, t.VERTEX_ATTRIB_ARRAY_ENABLED = 34338, t.VERTEX_ATTRIB_ARRAY_SIZE = 34339, t.VERTEX_ATTRIB_ARRAY_STRIDE = 34340, t.VERTEX_ATTRIB_ARRAY_TYPE = 34341, t.VERTEX_ATTRIB_ARRAY_NORMALIZED = 34922, t.VERTEX_ATTRIB_ARRAY_POINTER = 34373, t.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = 34975, t.COMPILE_STATUS = 35713, t.LOW_FLOAT = 36336, t.MEDIUM_FLOAT = 36337, t.HIGH_FLOAT = 36338, t.LOW_INT = 36339, t.MEDIUM_INT = 36340, t.HIGH_INT = 36341, t.FRAMEBUFFER = 36160, t.RENDERBUFFER = 36161, t.RGBA4 = 32854, t.RGB5_A1 = 32855, t.RGB565 = 36194, t.DEPTH_COMPONENT16 = 33189, t.STENCIL_INDEX = 6401, t.STENCIL_INDEX8 = 36168, t.DEPTH_STENCIL = 34041, t.RENDERBUFFER_WIDTH = 36162, t.RENDERBUFFER_HEIGHT = 36163, t.RENDERBUFFER_INTERNAL_FORMAT = 36164, t.RENDERBUFFER_RED_SIZE = 36176, t.RENDERBUFFER_GREEN_SIZE = 36177, t.RENDERBUFFER_BLUE_SIZE = 36178, t.RENDERBUFFER_ALPHA_SIZE = 36179, t.RENDERBUFFER_DEPTH_SIZE = 36180, t.RENDERBUFFER_STENCIL_SIZE = 36181, t.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = 36048, t.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = 36049, t.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = 36050, t.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = 36051, t.COLOR_ATTACHMENT0 = 36064, t.DEPTH_ATTACHMENT = 36096, t.STENCIL_ATTACHMENT = 36128, t.DEPTH_STENCIL_ATTACHMENT = 33306, t.NONE = 0, t.FRAMEBUFFER_COMPLETE = 36053, t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 36054, t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 36055, t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS = 36057, t.FRAMEBUFFER_UNSUPPORTED = 36061, t.FRAMEBUFFER_BINDING = 36006, t.RENDERBUFFER_BINDING = 36007, t.MAX_RENDERBUFFER_SIZE = 34024, t.INVALID_FRAMEBUFFER_OPERATION = 1286, t.UNPACK_FLIP_Y_WEBGL = 37440, t.UNPACK_PREMULTIPLY_ALPHA_WEBGL = 37441, t.CONTEXT_LOST_WEBGL = 37442, t.UNPACK_COLORSPACE_CONVERSION_WEBGL = 37443, t.BROWSER_DEFAULT_WEBGL = 37444, t._useProgram = null, t._depthTest = !0, t._depthMask = !0, t._blend = !1, t._cullFace = !1, t.curBindTexTarget = null, t.curBindTexValue = null, n(t, [ "_depthFunc", function() { return this._depthFunc = 513; }, "_sFactor", function() { return this._sFactor = 1; }, "_dFactor", function() { return this._dFactor = 0; }, "_frontFace", function() { return this._frontFace = 2305; } ]), t; }(), wt = function(t) { function e() { e.__super.call(this); } s(e, "laya.webgl.display.GraphicsGL", g); var i = e.prototype; return i.setShader = function(t) { this._saveToCmd(C.context._setShader, [ t ]); }, i.setIBVB = function(t, e, i, n, s, a) { this._saveToCmd(C.context._setIBVB, [ t, e, i, n, s, a ]); }, i.drawParticle = function(t, e, i) { var n = M.createParticleTemplate2D(i); n.x = t, n.y = e, this._saveToCmd(C.context._drawParticle, [ n ]); }, e; }(), Ct = function(t) { function e(t) { this._x = 0, this._y = 0, this._id = ++e._COUNT, this._path = null, this._drawCount = 1, this._maxNumEle = 0, this._clear = !1, this._isMain = !1, this._atlasResourceChange = 0, this._submits = null, this._curSubmit = null, this._ib = null, this._vb = null, this._nBlendType = 0, this._saveMark = null, this._shader2D = null, this.meshlist = [], this.mId = -1, this.mHaveKey = !1, this.mHaveLineKey = !1, this.mX = 0, this.mY = 0, e.__super.call(this), this._width = 99999999, this._height = 99999999, this._clipRect = e.MAXCLIPRECT, this.mOutPoint, this._canvas = t, e._contextcount++, C.isFlash ? (this._ib = Jt.create(35044), gt.fillIBQuadrangle(this._ib, 16)) : this._ib = Jt.QuadrangleIB, this.clear(); } var r; s(e, "laya.webgl.canvas.WebGLContext2D", p); var o = e.prototype; return o.setIsMainContext = function() { this._isMain = !0; }, o.clearBG = function(t, e, i, n) { var s = xt.mainContext; s.clearColor(t, e, i, n), s.clear(16384); }, o._getSubmits = function() { return this._submits; }, o._releaseMem = function() { if (this._submits) { this._curMat.destroy(), this._curMat = null, this._shader2D.destroy(), this._shader2D = null; for (var t = 0, e = this._submits._length; t < e; t++) this._submits[t].releaseRender(); this._submits.length = 0, this._submits._length = 0, this._submits = null, this._curSubmit = null, this._path && this._path.recover(), this._path = null, this._other && (this._other.font = null), this._save = null, this._vb && (this._vb.releaseResource(), this._vb.destroy(), this._vb.destory(), this._vb = null); } }, o.destroy = function() { --e._contextcount, this.sprite = null, this._releaseMem(), this._targets && this._targets.destroy(), this._targets = null, this._canvas = null, this._ib && this._ib != Jt.QuadrangleIB && this._ib.releaseResource(); }, o.clear = function() { this._submits || (this._other = r.DEFAULT, this._curMat = x.create(), this._vb = Qt.create(-1), this._submits = [], this._save = [ K.Create(this) ], this._save.length = 10, this._shader2D = new J(), this._triangleMesh = Dt.getAMesh()), this._vb.clear(), this._targets && (this._targets.repaint = !0), this._other = r.DEFAULT, this._clear = !0, this._repaint = !1, this._drawCount = 1, this._renderKey = 0, this._other.lineWidth = this._shader2D.ALPHA = 1, this._nBlendType = 0, this._clipRect = e.MAXCLIPRECT, this._curSubmit = at.RENDERBASE, this._shader2D.glTexture = null, this._shader2D.fillStyle = this._shader2D.strokeStyle = G.DEFAULT; for (var t = 0, i = this._submits._length; t < i; t++) this._submits[t].releaseRender(); this._submits._length = 0, this._curMat.identity(), this._other.clear(), this._saveMark = this._save[0], this._save._length = 1; }, o.size = function(t, e) { if (this._width != t || this._height != e) if (0 == t || 0 == e) { 0 != this._vb._byteLength && (this._width = t, this._height = e, this._vb.clear(), this._vb.upload()); for (var i = 0, n = this._submits._length; i < n; i++) this._submits[i].releaseRender(); this._submits.length = 0, this._submits._length = 0, this._curSubmit = null, this._path && this._path.recover(), this._path = null, this.sprite = null, this._targets && this._targets.destroy(), this._targets = null; } else this._width = t, this._height = e, this._targets && this._targets.size(t, e), this._canvas.memorySize -= this._canvas.memorySize; 0 === t && 0 === e && this._releaseMem(); }, o._getTransformMatrix = function() { return this._curMat; }, o.translate = function(t, e) { 0 === t && 0 === e || (q.save(this), this._curMat.bTransform && ($.save(this), this._curMat.transformPointN(b.TEMP.setTo(t, e)), t = b.TEMP.x, e = b.TEMP.y), this._x += t, this._y += e); }, o.save = function() { this._save[this._save._length++] = K.Create(this); }, o.restore = function() { var t = this._save._length; if (!(t < 1)) for (var e = t - 1; e >= 0; e--) { var i = this._save[e]; if (i.restore(this), i.isSaveMark()) return void (this._save._length = e); } }, o._fillText = function(t, e, i, n, s, a, r, o, h, l) { void 0 === l && (l = 0); var u = this._shader2D, c = this._curSubmit.shaderValue, d = s ? pt.create(s) : this._other.font; if (U.enabled) u.ALPHA !== c.ALPHA && (u.glTexture = null), dt.drawText(this, t, e, this._curMat, d, h || this._other.textAlign, a, r, o, i, n, l); else { this._shader2D.defines.getValue(); var p = a ? _.create(a)._color : u.colorAdd; u.ALPHA === c.ALPHA && p === u.colorAdd && c.colorAdd === u.colorAdd || (u.glTexture = null, u.colorAdd = p), dt.drawText(this, t, e, this._curMat, d, h || this._other.textAlign, a, r, o, i, n, l); } }, o.fillWords = function(t, e, i, n, s, a) { this._fillText(null, t, e, i, n, s, null, -1, null, a); }, o.fillBorderWords = function(t, e, i, n, s, a, r) { this._fillBorderText(null, t, e, i, n, s, a, r, null); }, o.fillText = function(t, e, i, n, s, a) { this._fillText(t, null, e, i, n, s, null, -1, a); }, o.strokeText = function(t, e, i, n, s, a, r) { this._fillText(t, null, e, i, n, null, s, a || 1, r); }, o.fillBorderText = function(t, e, i, n, s, a, r, o) { this._fillBorderText(t, null, e, i, n, s, a, r, o); }, o._fillBorderText = function(t, i, n, s, a, r, o, h, l) { if (!U.enabled) return this._fillText(t, i, n, s, a, null, o, h || 1, l), void this._fillText(t, i, n, s, a, r, null, -1, l); var u = this._shader2D, c = this._curSubmit.shaderValue; u.ALPHA !== c.ALPHA && (u.glTexture = null); var _ = a ? (e._fontTemp.setFont(a), e._fontTemp) : this._other.font; dt.drawText(this, t, i, this._curMat, _, l || this._other.textAlign, r, o, h || 1, n, s, 0); }, o.fillRect = function(t, e, i, n, s) { var a = this._vb; if (gt.fillRectImgVb(a, this._clipRect, t, e, i, n, D.DEF_UV, this._curMat, this._x, this._y, 0, 0)) { this._renderKey = 0; var r = this._shader2D.fillStyle; s && (this._shader2D.fillStyle = G.create(s)); var o = this._shader2D, h = this._curSubmit.shaderValue; if (o.fillStyle !== h.fillStyle || o.ALPHA !== h.ALPHA) { o.glTexture = null; var l = this._curSubmit = at.createSubmit(this, this._ib, a, (a._byteLength - 64) / 32 * 3, St.create(2, 0)); l.shaderValue.color = o.fillStyle._color._color, l.shaderValue.ALPHA = o.ALPHA, this._submits[this._submits._length++] = l; } this._curSubmit._numEle += 6, this._shader2D.fillStyle = r; } }, o.fillTexture = function(t, e, n, s, a, r, o, h) { if (t.loaded && t.bitmap && t.source) { var l = this._vb, u = t.bitmap.width, c = t.bitmap.height, _ = t.uv, d = o.x % t.width, p = o.y % t.height; if (u != h.w || c != h.h) { if (!h.w && !h.h) switch (h.oy = h.ox = 0, r) { case "repeat": h.width = s, h.height = a; break; case "repeat-x": h.width = s, p < 0 ? t.height + p > a ? h.height = a : h.height = t.height + p : (h.oy = p, t.height + p > a ? h.height = a - p : h.height = t.height); break; case "repeat-y": d < 0 ? t.width + d > s ? h.width = s : h.width = t.width + d : (h.ox = d, t.width + d > s ? h.width = s - d : h.width = t.width), h.height = a; break; case "no-repeat": d < 0 ? t.width + d > s ? h.width = s : h.width = t.width + d : (h.ox = d, t.width + d > s ? h.width = s - d : h.width = t.width), p < 0 ? t.height + p > a ? h.height = a : h.height = t.height + p : (h.oy = p, t.height + p > a ? h.height = a - p : h.height = t.height); break; default: h.width = s, h.height = a; } h.w = u, h.h = c, h.uv = [ 0, 0, h.width / u, 0, h.width / u, h.height / c, 0, h.height / c ]; } if (e += h.ox, n += h.oy, d -= h.ox, p -= h.oy, gt.fillRectImgVb(l, this._clipRect, e, n, h.width, h.height, h.uv, this._curMat, this._x, this._y, 0, 0)) { this._renderKey = 0; var f = Rt.create(this, this._ib, l, (l._byteLength - 64) / 32 * 3, St.create(256, 0)); this._submits[this._submits._length++] = f; var g = f.shaderValue; g.textureHost = t; var m = _[0] * u, v = _[1] * c, y = (_[2] - _[0]) * u, x = (_[5] - _[3]) * c, b = -d / u, w = -p / c; g.u_TexRange[0] = m / u, g.u_TexRange[1] = y / u, g.u_TexRange[2] = v / c, g.u_TexRange[3] = x / c, g.u_offset[0] = b, g.u_offset[1] = w, U.enabled && !this._isMain && f.addTexture(t, (l._byteLength >> 2) - 16), this._curSubmit = f, f._renderType = 10017, f._numEle += 6; } } else this.sprite && i.timer.callLater(this, this._repaintSprite); }, o.setShader = function(t) { Y.save(this, 1048576, this._shader2D, !0), this._shader2D.shader = t; }, o.setFilters = function(t) { Y.save(this, 2097152, this._shader2D, !0), this._shader2D.filters = t, this._curSubmit = at.RENDERBASE, this._renderKey = 0, this._drawCount++; }, o.drawTexture = function(t, e, i, n, s, a, r) { this._drawTextureM(t, e, i, n, s, a, r, null, 1); }, o.addTextureVb = function(t, e, i) { var n = this._curSubmit._vb || this._vb, s = n._byteLength >> 2; n.byteLength = s + 16 << 2; for (var a = n.getFloat32Array(), r = 0; r < 16; r += 4) a[s++] = t[r] + e, a[s++] = t[r + 1] + i, a[s++] = t[r + 2], a[s++] = t[r + 3]; this._curSubmit._numEle += 6, this._maxNumEle = Math.max(this._maxNumEle, this._curSubmit._numEle), n._upload = !0; }, o.willDrawTexture = function(t, e) { if (!(t.loaded && t.bitmap && t.source)) return this.sprite && i.timer.callLater(this, this._repaintSprite), 0; var n = t.bitmap, s = n.id + this._shader2D.ALPHA * e + 10016; if (s == this._renderKey) return s; var a = this._shader2D, r = a.ALPHA, o = this._curSubmit.shaderValue; a.ALPHA *= e, this._renderKey = s, this._drawCount++, a.glTexture = n; var h = this._vb, l = null, u = h._byteLength / 32 * 3; return l = Rt.create(this, this._ib, h, u, St.create(1, 0)), this._submits[this._submits._length++] = l, l.shaderValue.textureHost = t, l._renderType = 10016, l._preIsSameTextureShader = 10016 === this._curSubmit._renderType && a.ALPHA === o.ALPHA, this._curSubmit = l, a.ALPHA = r, s; }, o.drawTextures = function(t, n, s, a) { if (t.loaded && t.bitmap && t.source) { var r = this._clipRect; if (this._clipRect = e.MAXCLIPRECT, this._drawTextureM(t, n[0], n[1], t.width, t.height, s, a, null, 1)) { if (this._clipRect = r, L.drawCall++, !(n.length < 4)) { for (var o = this._curSubmit._vb || this._vb, h = this._curMat.a, l = this._curMat.d, u = 2, c = n.length; u < c; u += 2) gt.copyPreImgVb(o, (n[u] - n[u - 2]) * h, (n[u + 1] - n[u - 1]) * l), this._curSubmit._numEle += 6; this._maxNumEle = Math.max(this._maxNumEle, this._curSubmit._numEle); } } else alert("drawTextures err"); } else this.sprite && i.timer.callLater(this, this._repaintSprite); }, o._drawTextureM = function(t, e, n, s, a, r, o, h, l) { if (!t.loaded || !t.source) return this.sprite && i.timer.callLater(this, this._repaintSprite), !1; var u = this._curSubmit._vb || this._vb, c = t.bitmap; e += r, n += o, this._drawCount++; var _ = c.id + this._shader2D.ALPHA * l + 10016; if (_ != this._renderKey) { this._renderKey = _; var d = this._curSubmit.shaderValue, p = this._shader2D, f = p.ALPHA; p.ALPHA *= l, p.glTexture = c; var g = this._vb, m = null, v = g._byteLength / 32 * 3; m = Rt.create(this, this._ib, g, v, St.create(1, 0)), this._submits[this._submits._length++] = m, m.shaderValue.textureHost = t, m._renderType = 10016, m._preIsSameTextureShader = 10016 === this._curSubmit._renderType && p.ALPHA === d.ALPHA, this._curSubmit = m, u = this._curSubmit._vb || this._vb, p.ALPHA = f; } return !!gt.fillRectImgVb(u, this._clipRect, e, n, s || t.width, a || t.height, t.uv, h || this._curMat, this._x, this._y, 0, 0) && (U.enabled && !this._isMain && this._curSubmit.addTexture(t, (u._byteLength >> 2) - 16), this._curSubmit._numEle += 6, this._maxNumEle = Math.max(this._maxNumEle, this._curSubmit._numEle), !0); }, o._repaintSprite = function() { this.sprite && this.sprite.repaint(); }, o._drawText = function(t, e, i, n, s, a, r, o, h, l) { var u = t.bitmap; this._drawCount++; var c = u.id + this._shader2D.ALPHA + 10016; if (c != this._renderKey) { this._renderKey = c; var _ = this._curSubmit.shaderValue, d = this._shader2D; d.glTexture = u; var p = this._vb, f = null, g = p._byteLength / 32 * 3; (f = U.enabled ? Rt.create(this, this._ib, p, g, St.create(1, 0)) : Rt.create(this, this._ib, p, g, qt.create()))._preIsSameTextureShader = 10016 === this._curSubmit._renderType && d.ALPHA === _.ALPHA, this._submits[this._submits._length++] = f, f.shaderValue.textureHost = t, f._renderType = 10016, this._curSubmit = f; } t.active(); var m = this._curSubmit._vb || this._vb; gt.fillRectImgVb(m, this._clipRect, e + r, i + o, n || t.width, s || t.height, t.uv, a || this._curMat, this._x, this._y, h, l, !0) && (U.enabled && !this._isMain && this._curSubmit.addTexture(t, (m._byteLength >> 2) - 16), this._curSubmit._numEle += 6, this._maxNumEle = Math.max(this._maxNumEle, this._curSubmit._numEle)); }, o.drawTextureWithTransform = function(t, i, n, s, a, r, o, h, l) { if (r) { var u = this._curMat, c = this._x, _ = this._y; (0 !== o || 0 !== h) && (this._x = o * u.a + h * u.c, this._y = h * u.d + o * u.b), r && u.bTransform ? (x.mul(r, u, e._tmpMatrix), (r = e._tmpMatrix)._checkTransform()) : (this._x += u.tx, this._y += u.ty), this._drawTextureM(t, i, n, s, a, 0, 0, r, l), this._x = c, this._y = _; } else this._drawTextureM(t, i, n, s, a, o, h, null, l); }, o.fillQuadrangle = function(t, e, i, n, s) { var a = this._curSubmit, r = this._vb, o = this._shader2D, h = a.shaderValue; if (this._renderKey = 0, t.bitmap) { var l = t.bitmap; o.glTexture == l && o.ALPHA === h.ALPHA || (o.glTexture = l, (a = this._curSubmit = at.createSubmit(this, this._ib, r, r._byteLength / 32 * 3, St.create(1, 0))).shaderValue.glTexture = l, this._submits[this._submits._length++] = a), gt.fillQuadrangleImgVb(r, e, i, n, t.uv, s || this._curMat, this._x, this._y); } else a.shaderValue.fillStyle && a.shaderValue.fillStyle.equal(t) && o.ALPHA === h.ALPHA || (o.glTexture = null, (a = this._curSubmit = at.createSubmit(this, this._ib, r, r._byteLength / 32 * 3, St.create(2, 0))).shaderValue.defines.add(2), a.shaderValue.fillStyle = G.create(t), this._submits[this._submits._length++] = a), gt.fillQuadrangleImgVb(r, e, i, n, D.DEF_UV, s || this._curMat, this._x, this._y); a._numEle += 6; }, o.drawTexture2 = function(t, i, n, s, a, r, o, h) { if (0 != r) { var l = this._curMat; if (this._x = t * l.a + i * l.c, this._y = i * l.d + t * l.b, a && (l.bTransform || a.bTransform ? (x.mul(a, l, e._tmpMatrix), a = e._tmpMatrix) : (this._x += a.tx + l.tx, this._y += a.ty + l.ty, a = x.EMPTY)), 1 !== r || o) { var u = this._shader2D.ALPHA, c = this._nBlendType; this._shader2D.ALPHA = r, o && (this._nBlendType = W.TOINT(o)), this._drawTextureM(h[0], h[1] - n, h[2] - s, h[3], h[4], 0, 0, a, 1), this._shader2D.ALPHA = u, this._nBlendType = c; } else this._drawTextureM(h[0], h[1] - n, h[2] - s, h[3], h[4], 0, 0, a, 1); this._x = this._y = 0; } }, o.drawCanvas = function(t, e, i, n, s) { var a = t.context; if (this._renderKey = 0, a._targets) this._submits[this._submits._length++] = kt.create(a, 0, null), this._curSubmit = at.RENDERBASE, a._targets.drawTo(this, e, i, n, s); else { var r = this._submits[this._submits._length++] = kt.create(a, this._shader2D.ALPHA, this._shader2D.filters), o = n / t.width, h = s / t.height, l = r._matrix; this._curMat.copyTo(l), 1 != o && 1 != h && l.scale(o, h); var u = l.tx, c = l.ty; l.tx = l.ty = 0, l.transformPoint(b.TEMP.setTo(e, i)), l.translate(b.TEMP.x + u, b.TEMP.y + c), this._curSubmit = at.RENDERBASE; } d.showCanvasMark && (this.save(), this.lineWidth = 4, this.strokeStyle = a._targets ? "yellow" : "green", this.strokeRect(e - 1, i - 1, n + 2, s + 2, 1), this.strokeRect(e, i, n, s, 1), this.restore()); }, o.drawTarget = function(t, e, i, n, s, a, r, o, h, l) { void 0 === l && (l = -1); var u = this._vb; if (gt.fillRectImgVb(u, this._clipRect, e, i, n, s, h || D.DEF_UV, a || this._curMat, this._x, this._y, 0, 0)) { this._renderKey = 0; this._shader2D.glTexture = null; this._curSubmit.shaderValue; var c = this._curSubmit = ct.create(this, this._ib, u, (u._byteLength - 64) / 32 * 3, o, r); c.blendType = -1 == l ? this._nBlendType : l, c.scope = t, this._submits[this._submits._length++] = c, this._curSubmit._numEle += 6; } }, o.mixRGBandAlpha = function(t) { return this._mixRGBandAlpha(t, this._shader2D.ALPHA); }, o._mixRGBandAlpha = function(t, e) { var i = (4278190080 & t) >>> 24; return 0 != i ? i *= e : i = 255 * e, 16777215 & t | i << 24; }, o.drawTriangles = function(t, n, s, a, r, o, h, l, u, c) { if (!t.loaded || !t.source) return this.sprite && i.timer.callLater(this, this._repaintSprite), !1; this._drawCount++; t.bitmap; var _ = this._mixRGBandAlpha(4294967295, l), d = (a.length, o.length); this._renderKey = -1; var p = this._curSubmit = Rt.create(this, this._triangleMesh.getIBR(), this._triangleMesh.getVBR(), this._triangleMesh.indexNum, St.create(1, 0)); return p.shaderValue.textureHost = t, p._renderType = 10016, this._submits[this._submits._length++] = p, h ? (e._tmpMatrix.a = h.a, e._tmpMatrix.b = h.b, e._tmpMatrix.c = h.c, e._tmpMatrix.d = h.d, e._tmpMatrix.tx = h.tx + n, e._tmpMatrix.ty = h.ty + s, x.mul(e._tmpMatrix, this._curMat, e._tmpMatrix)) : (e._tmpMatrix.a = this._curMat.a, e._tmpMatrix.b = this._curMat.b, e._tmpMatrix.c = this._curMat.c, e._tmpMatrix.d = this._curMat.d, e._tmpMatrix.tx = this._curMat.tx + n, e._tmpMatrix.ty = this._curMat.ty + s), this._triangleMesh.addData(a, r, o, e._tmpMatrix, _, this), this._curSubmit._numEle += d, this._maxNumEle = Math.max(this._maxNumEle, this._curSubmit._numEle), !0; }, o.transform = function(t, e, i, n, s, a) { $.save(this), x.mul(x.TEMP.setTo(t, e, i, n, s, a), this._curMat, this._curMat), this._curMat._checkTransform(); }, o.setTransformByMatrix = function(t) { t.copyTo(this._curMat); }, o.transformByMatrix = function(t) { $.save(this), x.mul(t, this._curMat, this._curMat), this._curMat._checkTransform(); }, o.rotate = function(t) { $.save(this), this._curMat.rotateEx(t); }, o.scale = function(t, e) { $.save(this), this._curMat.scaleEx(t, e); }, o.clipRect = function(t, e, i, n) { if (0 != this._curMat.b || 0 != this._curMat.c) { this._renderKey = 0; var s = ut.create(4); this.addRenderObject(s); var a = this._vb, r = a._byteLength >> 2; if (gt.fillRectImgVb(a, null, t, e, i, n, D.DEF_UV, this._curMat, this._x, this._y, 0, 0)) { this._shader2D.glTexture = null; var o = this._curSubmit = at.createSubmit(this, this._ib, a, (a._byteLength - 64) / 32 * 3, St.create(2, 0)); o.shaderValue.ALPHA = 1, this._submits[this._submits._length++] = o, this._curSubmit._numEle += 6; } else alert("clipRect calc stencil rect error"); var h = ut.create(5); this.addRenderObject(h); var l = a.getFloat32Array(), u = Math.min(Math.min(Math.min(l[r + 0], l[r + 4]), l[r + 8]), l[r + 12]), c = Math.max(Math.max(Math.max(l[r + 0], l[r + 4]), l[r + 8]), l[r + 12]), _ = Math.min(Math.min(Math.min(l[r + 1], l[r + 5]), l[r + 9]), l[r + 13]), d = Math.max(Math.max(Math.max(l[r + 1], l[r + 5]), l[r + 9]), l[r + 13]); j.save(this, h, t, e, i, n, u, _, c - u, d - _), this._curSubmit = at.RENDERBASE; } else { i *= this._curMat.a, n *= this._curMat.d; var p = b.TEMP; this._curMat.transformPoint(p.setTo(t, e)), i < 0 && (p.x = p.x + i, i = -i), n < 0 && (p.y = p.y + n, n = -n), this._renderKey = 0; var f = this._curSubmit = lt.create(this); this._submits[this._submits._length++] = f, f.submitIndex = this._submits._length, f.submitLength = 9999999, X.save(this, f); var g = this._clipRect, m = g.x, v = g.y, y = p.x + i, x = p.y + n; m < p.x && (g.x = p.x), v < p.y && (g.y = p.y), g.width = Math.min(y, m + g.width) - g.x, g.height = Math.min(x, v + g.height) - g.y, this._shader2D.glTexture = null, f.clipRect.copyFrom(g), this._curSubmit = at.RENDERBASE; } }, o.setIBVB = function(t, e, i, n, s, a, r, o, h, l, u) { if (void 0 === h && (h = 0), void 0 === l && (l = 0), void 0 === u && (u = 0), null === i) { if (C.isFlash) { var c = n; c._selfIB || (c._selfIB = Jt.create(35044)), c._selfIB.clear(), i = c._selfIB; } else i = this._ib; gt.expandIBQuadrangle(i, n._byteLength / (4 * n.vertexStride * 4)); } if (!o || !r) throw Error("setIBVB must input:shader shaderValues"); var _ = ht.create(this, n, i, s, r, o, h, l, u); a || (a = x.EMPTY), a.translate(t, e), x.mul(a, this._curMat, _._mat), a.translate(-t, -e), this._submits[this._submits._length++] = _, this._curSubmit = at.RENDERBASE, this._renderKey = 0; }, o.addRenderObject = function(t) { this._submits[this._submits._length++] = t; }, o.fillTrangles = function(t, e, i, n, s) { var a = this._curSubmit, r = this._vb, o = this._shader2D, h = a.shaderValue, l = n.length >> 4, u = t.bitmap; this._renderKey = 0, o.glTexture == u && o.ALPHA === h.ALPHA || ((a = this._curSubmit = at.createSubmit(this, this._ib, r, r._byteLength / 32 * 3, St.create(1, 0))).shaderValue.textureHost = t, this._submits[this._submits._length++] = a), gt.fillTranglesVB(r, e, i, n, s || this._curMat, this._x, this._y), a._numEle += 6 * l; }, o.submitElement = function(t, e) { var i = this._submits; for (e < 0 && (e = i._length); t < e; ) t += i[t].renderSubmit(); }, o.finish = function() { xt.mainContext.finish(); }, o.flush = function() { var t = Math.max(this._vb._byteLength / 64, this._maxNumEle / 6) + 8; if (t > this._ib.bufferLength / 12 && gt.expandIBQuadrangle(this._ib, t), !this._isMain && U.enabled && U._atlasRestore > this._atlasResourceChange) { this._atlasResourceChange = U._atlasRestore; for (var e = this._submits, i = 0, n = e._length; i < n; i++) { var s = e[i]; 10016 === s.getRenderType() && s.checkTexture(); } } this.submitElement(0, this._submits._length), this._path && this._path.reset(), et.instance && et.getInstance().reset(); var a = 0; for (i = 0, a = this.meshlist.length; i < a; i++) { var r = this.meshlist[i]; r.canReuse ? r.releaseMesh() : r.destroy(); } return this.meshlist.length = 0, this._curSubmit = at.RENDERBASE, this._renderKey = 0, this._triangleMesh = Dt.getAMesh(), this.meshlist.push(this._triangleMesh), this._submits._length; }, o.setPathId = function(t) { if (this.mId = t, -1 != this.mId) { this.mHaveKey = !1; var e = F.getInstance(); e.shapeDic[this.mId] && (this.mHaveKey = !0), this.mHaveLineKey = !1, e.shapeLineDic[this.mId] && (this.mHaveLineKey = !0); } }, o.movePath = function(t, e) { var i = t, n = e; t = this._curMat.a * i + this._curMat.c * n + this._curMat.tx, e = this._curMat.b * i + this._curMat.d * n + this._curMat.ty, this.mX += t, this.mY += e; }, o.beginPath = function() { var t = this._getPath(); t.tempArray.length = 0, t.closePath = !1, this.mX = 0, this.mY = 0; }, o.closePath = function() { this._path.closePath = !0; }, o.fill = function(t) { void 0 === t && (t = !1); var e = this._getPath(); this.drawPoly(0, 0, e.tempArray, this.fillStyle._color.numColor, 0, 0, t); }, o.stroke = function() { var t = this._getPath(); if (this.lineWidth > 0) { if (-1 == this.mId) t.drawLine(0, 0, t.tempArray, this.lineWidth, this.strokeStyle._color.numColor); else if (this.mHaveLineKey) { var e = F.getInstance().shapeLineDic[this.mId]; e.rebuild(t.tempArray), t.setGeomtry(e); } else F.getInstance().addLine(this.mId, t.drawLine(0, 0, t.tempArray, this.lineWidth, this.strokeStyle._color.numColor)); t.update(); var i = [ this.mX, this.mY ], n = at.createShape(this, t.ib, t.vb, t.count, t.offset, St.create(4, 0)); n.shaderValue.ALPHA = this._shader2D.ALPHA, n.shaderValue.u_pos = i, n.shaderValue.u_mmat2 = vt.TEMPMAT4_ARRAY, this._submits[this._submits._length++] = n, this._renderKey = -1; } }, o.line = function(t, e, i, n, s, a) { var r = this._curSubmit, o = this._vb; if (gt.fillLineVb(o, this._clipRect, t, e, i, n, s, a)) { this._renderKey = 0; var h = this._shader2D, l = r.shaderValue; h.strokeStyle === l.strokeStyle && h.ALPHA === l.ALPHA || (h.glTexture = null, (r = this._curSubmit = at.createSubmit(this, this._ib, o, (o._byteLength - 64) / 32 * 3, St.create(2, 0))).shaderValue.strokeStyle = h.strokeStyle, r.shaderValue.mainID = 2, r.shaderValue.ALPHA = h.ALPHA, this._submits[this._submits._length++] = r), r._numEle += 6; } }, o.moveTo = function(t, e, i) { void 0 === i && (i = !0); var n = this._getPath(); if (i) { var s = t, a = e; t = this._curMat.a * s + this._curMat.c * a, e = this._curMat.b * s + this._curMat.d * a; } n.addPoint(t, e); }, o.lineTo = function(t, e, i) { void 0 === i && (i = !0); var n = this._getPath(); if (i) { var s = t, a = e; t = this._curMat.a * s + this._curMat.c * a, e = this._curMat.b * s + this._curMat.d * a; } n.addPoint(t, e); }, o.drawCurves = function(t, e, i) { this.setPathId(-1), this.beginPath(), this.strokeStyle = i[3], this.lineWidth = i[4]; var n = i[2]; t += i[0], e += i[1], this.movePath(t, e), this.moveTo(n[0], n[1]); for (var s = 2, a = n.length; s < a; ) this.quadraticCurveTo(n[s++], n[s++], n[s++], n[s++]); this.stroke(); }, o.arcTo = function(t, i, n, s, a) { if (-1 == this.mId || !this.mHaveKey) { var r = 0, o = 0, h = 0, l = this._getPath(); this._curMat.copyTo(e._tmpMatrix), e._tmpMatrix.tx = e._tmpMatrix.ty = 0, e._tempPoint.setTo(l.getEndPointX(), l.getEndPointY()), e._tmpMatrix.invertTransformPoint(e._tempPoint); var u = e._tempPoint.x - t, c = e._tempPoint.y - i, _ = Math.sqrt(u * u + c * c); if (!(_ <= 1e-6)) { var d = u / _, p = c / _, f = n - t, g = s - i, m = f * f + g * g, v = Math.sqrt(m); if (!(v <= 1e-6)) { var y = f / v, x = g / v, b = d + y, w = p + x, C = Math.sqrt(b * b + w * w); if (!(C <= 1e-6)) { var S = b / C, T = w / C, I = Math.acos(S * d + T * p), M = Math.PI / 2 - I, E = (_ = a / Math.tan(M)) * d + t, A = _ * p + i, L = Math.sqrt(_ * _ + a * a), P = t + S * L, k = i + T * L, R = 0, D = 0, N = 0; if (d * x - p * y >= 0) { var F = (R = 2 * M) / e.SEGNUM; D = Math.sin(F), N = Math.cos(F); } else F = (R = 2 * -M) / e.SEGNUM, D = Math.sin(F), N = Math.cos(F); o = this._curMat.a * E + this._curMat.c * A, h = this._curMat.b * E + this._curMat.d * A, o == this._path.getEndPointX() && h == this._path.getEndPointY() || l.addPoint(o, h); var B = E - P, O = A - k; for (r = 0; r < e.SEGNUM; r++) { var z = B * N + O * D, U = -B * D + O * N; o = z + P, h = U + k, t = this._curMat.a * o + this._curMat.c * h, h = i = this._curMat.b * o + this._curMat.d * h, (o = t) == this._path.getEndPointX() && h == this._path.getEndPointY() || l.addPoint(o, h), B = z, O = U; } } } } } }, o.arc = function(t, e, i, n, s, a, r) { if (void 0 === a && (a = !1), void 0 === r && (r = !0), -1 != this.mId) { var o = F.getInstance().shapeDic[this.mId]; if (o && this.mHaveKey && !o.needUpdate(this._curMat)) return; t = 0, e = 0; } var h = 0, l = 0, u = 0, c = 0, _ = 0, d = 0, p = 0, f = 0; if (l = s - n, a) if (Math.abs(l) >= 2 * Math.PI) l = 2 * -Math.PI; else for (;l > 0; ) l -= 2 * Math.PI; else if (Math.abs(l) >= 2 * Math.PI) l = 2 * Math.PI; else for (;l < 0; ) l += 2 * Math.PI; u = l / (f = i < 101 ? Math.max(10, l * i / 5) : i < 201 ? Math.max(10, l * i / 20) : Math.max(10, l * i / 40)) / 2, c = Math.abs(4 / 3 * (1 - Math.cos(u)) / Math.sin(u)), a && (c = -c); var g = this._getPath(), m = NaN, v = NaN; for (p = 0; p <= f; p++) h = n + l * (p / f), _ = t + Math.cos(h) * i, d = e + Math.sin(h) * i, r && (m = _, v = d, _ = this._curMat.a * m + this._curMat.c * v, d = this._curMat.b * m + this._curMat.d * v), _ == this._path.getEndPointX() && d == this._path.getEndPointY() || g.addPoint(_, d); _ = t + Math.cos(s) * i, d = e + Math.sin(s) * i, r && (m = _, v = d, _ = this._curMat.a * m + this._curMat.c * v, d = this._curMat.b * m + this._curMat.d * v), _ == this._path.getEndPointX() && d == this._path.getEndPointY() || g.addPoint(_, d); }, o.quadraticCurveTo = function(t, e, i, n) { var s = h.I, a = i, r = n; i = this._curMat.a * a + this._curMat.c * r, n = this._curMat.b * a + this._curMat.d * r, a = t, r = e, t = this._curMat.a * a + this._curMat.c * r, e = this._curMat.b * a + this._curMat.d * r; for (var o = s.getBezierPoints([ this._path.getEndPointX(), this._path.getEndPointY(), t, e, i, n ], 30, 2), l = 0, u = o.length / 2; l < u; l++) this.lineTo(o[2 * l], o[2 * l + 1], !1); this.lineTo(i, n, !1); }, o.rect = function(t, e, i, n) { this._other = this._other.make(), this._other.path || (this._other.path = new H()), this._other.path.rect(t, e, i, n); }, o.strokeRect = function(t, e, i, n, s) { var a = .5 * s; this.line(t - a, e, t + i + a, e, s, this._curMat), this.line(t + i, e, t + i, e + n, s, this._curMat), this.line(t, e, t, e + n, s, this._curMat), this.line(t - a, e + n, t + i + a, e + n, s, this._curMat); }, o.clip = function() {}, o.drawPoly = function(t, e, i, n, s, a, r) { void 0 === r && (r = !1), this._renderKey = 0, this._shader2D.glTexture = null; var o = this._getPath(); if (-1 == this.mId) o.polygon(t, e, i, n, s || 1, a); else if (this.mHaveKey) { var h = F.getInstance().shapeDic[this.mId]; h.setMatrix(this._curMat), h.rebuild(o.tempArray), o.setGeomtry(h); } else { var l = o.polygon(t, e, i, n, s || 1, a); F.getInstance().addShape(this.mId, l), l.setMatrix(this._curMat); } o.update(); var u, c = [ this.mX, this.mY ]; if (u = at.createShape(this, o.ib, o.vb, o.count, o.offset, St.create(4, 0)), u.shaderValue.ALPHA = this._shader2D.ALPHA, u.shaderValue.u_pos = c, u.shaderValue.u_mmat2 = vt.EMPTYMAT4_ARRAY, this._submits[this._submits._length++] = u, s > 0) { if (this.mHaveLineKey) { var _ = F.getInstance().shapeLineDic[this.mId]; _.rebuild(o.tempArray), o.setGeomtry(_); } else F.getInstance().addShape(this.mId, o.drawLine(t, e, i, s, a)); o.update(), (u = at.createShape(this, o.ib, o.vb, o.count, o.offset, St.create(4, 0))).shaderValue.ALPHA = this._shader2D.ALPHA, u.shaderValue.u_mmat2 = vt.EMPTYMAT4_ARRAY, this._submits[this._submits._length++] = u; } }, o.drawParticle = function(t, e, i) { i.x = t, i.y = e, this._submits[this._submits._length++] = i; }, o._getPath = function() { return this._path || (this._path = new H()); }, a(0, o, "globalCompositeOperation", function() { return W.NAMES[this._nBlendType]; }, function(t) { var e = W.TOINT[t]; null == e || this._nBlendType === e || (Y.save(this, 65536, this, !0), this._curSubmit = at.RENDERBASE, this._renderKey = 0, this._nBlendType = e); }), a(0, o, "strokeStyle", function() { return this._shader2D.strokeStyle; }, function(t) { this._shader2D.strokeStyle.equal(t) || (Y.save(this, 512, this._shader2D, !1), this._shader2D.strokeStyle = G.create(t)); }), a(0, o, "globalAlpha", function() { return this._shader2D.ALPHA; }, function(t) { (t = Math.floor(1e3 * t) / 1e3) != this._shader2D.ALPHA && (Y.save(this, 1, this._shader2D, !0), this._shader2D.ALPHA = t); }), a(0, o, "asBitmap", null, function(t) { if (t) { if (this._targets || (this._targets = new Z()), this._targets.repaint = !0, !this._width || !this._height) throw Error("asBitmap no size!"); this._targets.setSP(this.sprite), this._targets.size(this._width, this._height); } else this._targets = null; }), a(0, o, "fillStyle", function() { return this._shader2D.fillStyle; }, function(t) { this._shader2D.fillStyle.equal(t) || (Y.save(this, 2, this._shader2D, !1), this._shader2D.fillStyle = G.create(t)); }), a(0, o, "textAlign", function() { return this._other.textAlign; }, function(t) { this._other.textAlign === t || (this._other = this._other.make(), Y.save(this, 32768, this._other, !1), this._other.textAlign = t); }), a(0, o, "lineWidth", function() { return this._other.lineWidth; }, function(t) { this._other.lineWidth === t || (this._other = this._other.make(), Y.save(this, 256, this._other, !1), this._other.lineWidth = t); }), a(0, o, "textBaseline", function() { return this._other.textBaseline; }, function(t) { this._other.textBaseline === t || (this._other = this._other.make(), Y.save(this, 16384, this._other, !1), this._other.textBaseline = t); }), a(0, o, "font", null, function(t) { t != this._other.font.toString() && (this._other = this._other.make(), Y.save(this, 8, this._other, !1), this._other.font === pt.EMPTY ? this._other.font = new pt(t) : this._other.font.setFont(t)); }), e.__init__ = function() { r.DEFAULT = new r(); }, e._tempPoint = new b(), e._SUBMITVBSIZE = 32e3, e._MAXSIZE = 99999999, e._RECTVBSIZE = 16, e.MAXCLIPRECT = new w(0, 0, 99999999, 99999999), e._COUNT = 0, e._tmpMatrix = new x(), e.SEGNUM = 32, e._contextcount = 0, n(e, [ "_fontTemp", function() { return this._fontTemp = new pt(); }, "_drawStyleTemp", function() { return this._drawStyleTemp = new G(null); } ]), e.__init$ = function() { r = function() { function t() { this.lineWidth = 1, this.path = null, this.textAlign = null, this.textBaseline = null, this.font = pt.EMPTY; } s(t, ""); var e = t.prototype; return e.clear = function() { this.lineWidth = 1, this.path && this.path.clear(), this.textAlign = this.textBaseline = null, this.font = pt.EMPTY; }, e.make = function() { return this === t.DEFAULT ? new t() : this; }, t.DEFAULT = null, t; }(); }, e; }(), St = function(t) { function e(t, i) { this.size = [ 0, 0 ], this.alpha = 1, this.ALPHA = 1, this.subID = 0, this._cacheID = 0, e.__super.call(this), this.defines = new Et(), this.position = e._POSITION, this.mainID = t, this.subID = i, this.textureHost = null, this.texture = null, this.fillStyle = null, this.color = null, this.strokeStyle = null, this.colorAdd = null, this.glTexture = null, this.u_mmat2 = null, this._cacheID = t | i, this._inClassCache = e._cache[this._cacheID], t > 0 && !this._inClassCache && (this._inClassCache = e._cache[this._cacheID] = [], this._inClassCache._length = 0), this.clear(); } s(e, "laya.webgl.shader.d2.value.Value2D", O); var i = e.prototype; return i.setValue = function(t) {}, i.refresh = function() { var t = this.size; return t[0] = vt.width, t[1] = vt.height, this.alpha = this.ALPHA * vt.worldAlpha, this.mmat = vt.worldMatrix4, this; }, i._ShaderWithCompile = function() { return Kt.withCompile2D(0, this.mainID, this.defines.toNameDic(), this.mainID | this.defines._value, Zt.create); }, i._withWorldShaderDefines = function() { var t = vt.worldShaderDefines, e = Kt.sharders[this.mainID | this.defines._value | t.getValue()]; if (!e) { var i, n, s = {}; i = this.defines.toNameDic(); for (n in i) s[n] = ""; i = t.toNameDic(); for (n in i) s[n] = ""; e = Kt.withCompile2D(0, this.mainID, s, this.mainID | this.defines._value | t.getValue(), Zt.create); } var a = vt.worldFilters; if (!a) return e; for (var r, o = a.length, h = 0; h < o; h++) (r = a[h]) && r.action.setValue(this); return e; }, i.upload = function() { var t = vt; this.alpha = this.ALPHA * t.worldAlpha, vt.worldMatrix4 !== vt.TEMPMAT4_ARRAY && this.defines.add(128), xt.shaderHighPrecision && this.defines.add(1024); var e, i = t.worldShaderDefines ? this._withWorldShaderDefines() : Kt.sharders[this.mainID | this.defines._value] || this._ShaderWithCompile(); this.size[0] = t.width, this.size[1] = t.height, this.mmat = t.worldMatrix4, Nt.activeShader !== i ? (i._shaderValueWidth !== t.width || i._shaderValueHeight !== t.height ? (i._shaderValueWidth = t.width, i._shaderValueHeight = t.height) : e = i._params2dQuick2 || i._make2dQuick2(), i.upload(this, e)) : (i._shaderValueWidth !== t.width || i._shaderValueHeight !== t.height ? (i._shaderValueWidth = t.width, i._shaderValueHeight = t.height) : e = i._params2dQuick1 || i._make2dQuick1(), i.upload(this, e)); }, i.setFilters = function(t) { if (this.filters = t, t) for (var e, i = t.length, n = 0; n < i; n++) (e = t[n]) && (this.defines.add(e.type), e.action.setValue(this)); }, i.clear = function() { this.defines.setValue(this.subID); }, i.release = function() { this._inClassCache[this._inClassCache._length++] = this, this.fillStyle = null, this.strokeStyle = null, this.clear(); }, e._initone = function(t, i) { e._typeClass[t] = i, e._cache[t] = [], e._cache[t]._length = 0; }, e.__init__ = function() { e._POSITION = [ 2, 5126, !1, 4 * ft.BYTES_PE, 0 ], e._TEXCOORD = [ 2, 5126, !1, 4 * ft.BYTES_PE, 2 * ft.BYTES_PE ], e._initone(2, zt), e._initone(4, Wt), e._initone(256, Ut), e._initone(512, Ot), e._initone(1, Vt), e._initone(65, qt), e._initone(9, Vt); }, e.create = function(t, i) { var n = e._cache[t | i]; return n._length ? n[--n._length] : new e._typeClass[t | i](i); }, e._POSITION = null, e._TEXCOORD = null, e._cache = [], e._typeClass = [], e.TEMPMAT4_ARRAY = [ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 ], e; }(), Tt = function(t) { function e(t, i) { e.__super.call(this, t, i); } s(e, "laya.webgl.utils.RenderSprite3D", S); var i = e.prototype; return i.onCreate = function(t) { switch (t) { case 8: return void (this._fun = this._blend); case 4: return void (this._fun = this._transform); } }, i._mask = function(t, i, n, s) { var a, r, o = this._next, h = t.mask; if (h) { i.ctx.save(); var l = i.ctx.globalCompositeOperation, u = new w(); if (u.copyFrom(h.getBounds()), u.width = Math.round(u.width), u.height = Math.round(u.height), u.x = Math.round(u.x), u.y = Math.round(u.y), u.width > 0 && u.height > 0) { var c = t._style._tf, _ = ot.create(); _.addValue("bounds", u), a = rt.create([ _, i ], laya.webgl.utils.RenderSprite3D.tmpTarget), i.addRenderObject(a), h.render(i, -u.x, -u.y), a = rt.create([ _ ], laya.webgl.utils.RenderSprite3D.endTmpTarget), i.addRenderObject(a), i.ctx.save(), i.clipRect(n - c.translateX + u.x, s - c.translateY + u.y, u.width, u.height), o._fun.call(o, t, i, n, s), i.ctx.restore(), r = ut.create(6), l = i.ctx.globalCompositeOperation, r.blendMode = "mask", i.addRenderObject(r), x.TEMP.identity(); var d = St.create(1, 0), p = D.INV_UV, f = u.width, g = u.height; (u.width < 32 || u.height < 32) && ((p = e.tempUV)[0] = 0, p[1] = 0, p[2] = u.width >= 32 ? 1 : u.width / 32, p[3] = 0, p[4] = u.width >= 32 ? 1 : u.width / 32, p[5] = u.height >= 32 ? 1 : u.height / 32, p[6] = 0, p[7] = u.height >= 32 ? 1 : u.height / 32, u.width = u.width >= 32 ? u.width : 32, u.height = u.height >= 32 ? u.height : 32, p[1] *= -1, p[3] *= -1, p[5] *= -1, p[7] *= -1, p[1] += 1, p[3] += 1, p[5] += 1, p[7] += 1), i.ctx.drawTarget(_, n + u.x - c.translateX, s + u.y - c.translateY, f, g, x.TEMP, "tmpTarget", d, p, 6), a = rt.create([ _ ], laya.webgl.utils.RenderSprite3D.recycleTarget), i.addRenderObject(a), (r = ut.create(6)).blendMode = l, i.addRenderObject(r); } i.ctx.restore(); } else o._fun.call(o, t, i, n, s); }, i._blend = function(t, e, i, n) { var s = t._style, a = this._next; s.blendMode ? (e.ctx.save(), e.ctx.globalCompositeOperation = s.blendMode, a._fun.call(a, t, e, i, n), e.ctx.restore()) : a._fun.call(a, t, e, i, n); }, i._transform = function(t, e, i, n) { var s = t.transform, a = this._next; if (s && a != S.NORENDER) { var r = e.ctx; t._style; s.tx = i, s.ty = n; var o = r._getTransformMatrix(), h = o.clone(); x.mul(s, o, o), o._checkTransform(), s.tx = s.ty = 0, a._fun.call(a, t, e, 0, 0), h.copyTo(o), h.destroy(); } else a._fun.call(a, t, e, i, n); }, e.tmpTarget = function(t, e) { var i = t.getValue("bounds"), n = Ft.create(i.width, i.height); n.start(), n.clear(0, 0, 0, 0), t.addValue("tmpTarget", n); }, e.endTmpTarget = function(t) { t.getValue("tmpTarget").end(); }, e.recycleTarget = function(t) { t.getValue("tmpTarget").recycle(), t.recycle(); }, n(e, [ "tempUV", function() { return this.tempUV = new Array(8); } ]), e; }(), It = function(t) { function e() { this.data = null, e.__super.call(this); } s(e, "laya.filters.webgl.ColorFilterActionGL", B); var n = e.prototype; return i.imps(n, { "laya.filters.IFilterActionGL": !0 }), n.setValue = function(t) { t.colorMat = this.data._mat, t.colorAlpha = this.data._alpha; }, n.apply3d = function(t, e, i, n, s) { var a = t.getValue("bounds"), r = St.create(1, 0); r.setFilters([ this.data ]); var o = x.TEMP; o.identity(), i.ctx.drawTarget(t, 0, 0, a.width, a.height, o, "src", r); }, e; }(), Mt = function(t) { function e(t, i, n, s, a) { this._atlasCanvas = null, this._inAtlasTextureKey = null, this._inAtlasTextureBitmapValue = null, this._inAtlasTextureOriUVValue = null, this._InAtlasWebGLImagesKey = null, this._InAtlasWebGLImagesOffsetValue = null, e.__super.call(this, t, i, a), this._inAtlasTextureKey = [], this._inAtlasTextureBitmapValue = [], this._inAtlasTextureOriUVValue = [], this._InAtlasWebGLImagesKey = {}, this._InAtlasWebGLImagesOffsetValue = [], this._atlasCanvas = new Gt(), this._atlasCanvas._atlaser = this, this._atlasCanvas.width = n, this._atlasCanvas.height = s, this._atlasCanvas.activeResource(), this._atlasCanvas.lock = !0; } s(e, "laya.webgl.atlas.Atlaser", z); var i = e.prototype; return i.computeUVinAtlasTexture = function(t, e, i, n) { var s = U.atlasTextureWidth, a = U.atlasTextureHeight, r = i / s, o = n / a, h = (i + t.bitmap.width) / s, l = (n + t.bitmap.height) / a, u = t.bitmap.width / s, c = t.bitmap.height / a; t.uv = [ r + e[0] * u, o + e[1] * c, h - (1 - e[2]) * u, o + e[3] * c, h - (1 - e[4]) * u, l - (1 - e[5]) * c, r + e[6] * u, l - (1 - e[7]) * c ]; }, i.findBitmapIsExist = function(t) { if (t instanceof laya.webgl.resource.WebGLImage) { var e = t, i = e.url, n = this._InAtlasWebGLImagesKey[i || e.id]; if (n) return n.offsetInfoID; } return -1; }, i.addToAtlasTexture = function(t, e, i) { if (t instanceof laya.webgl.resource.WebGLImage) { var n = t, s = n.url; this._InAtlasWebGLImagesKey[s || n.id] = { bitmap: t, offsetInfoID: this._InAtlasWebGLImagesOffsetValue.length }, this._InAtlasWebGLImagesOffsetValue.push([ e, i ]); } this._atlasCanvas.texSubImage2D(e, i, t.atlasImgData || t.atlasSource), t.clearAtlasSource(); }, i.addToAtlas = function(t, e, i) { t._atlasID = this._inAtlasTextureKey.length; var n = t.uv.slice(), s = t.bitmap; this._inAtlasTextureKey.push(t), this._inAtlasTextureOriUVValue.push(n), this._inAtlasTextureBitmapValue.push(s), this.computeUVinAtlasTexture(t, n, e, i), t.bitmap = this._atlasCanvas; }, i.clear = function() { for (var t = 0, e = this._inAtlasTextureKey.length; t < e; t++) this._inAtlasTextureKey[t].bitmap = this._inAtlasTextureBitmapValue[t], this._inAtlasTextureKey[t].uv = this._inAtlasTextureOriUVValue[t], this._inAtlasTextureKey[t]._atlasID = -1, this._inAtlasTextureKey[t].bitmap.lock = !1, this._inAtlasTextureKey[t].bitmap.releaseResource(); this._inAtlasTextureKey.length = 0, this._inAtlasTextureBitmapValue.length = 0, this._inAtlasTextureOriUVValue.length = 0, this._InAtlasWebGLImagesKey = null, this._InAtlasWebGLImagesOffsetValue.length = 0; }, i.dispose = function() { this.clear(), this._atlasCanvas.destroy(); }, a(0, i, "InAtlasWebGLImagesOffsetValue", function() { return this._InAtlasWebGLImagesOffsetValue; }), a(0, i, "texture", function() { return this._atlasCanvas; }), a(0, i, "inAtlasWebGLImagesKey", function() { return this._InAtlasWebGLImagesKey; }), e; }(), Et = function(t) { function e() { e.__super.call(this, e.__name2int, e.__int2name, e.__int2nameMap); } return s(e, "laya.webgl.shader.d2.ShaderDefines2D", Q), e.__init__ = function() { e.reg("TEXTURE2D", 1), e.reg("COLOR2D", 2), e.reg("PRIMITIVE", 4), e.reg("GLOW_FILTER", 8), e.reg("BLUR_FILTER", 16), e.reg("COLOR_FILTER", 32), e.reg("COLOR_ADD", 64), e.reg("WORLDMAT", 128), e.reg("FILLTEXTURE", 256), e.reg("FSHIGHPRECISION", 1024); }, e.reg = function(t, i) { Q._reg(t, i, e.__name2int, e.__int2name); }, e.toText = function(t, e, i) { return Q._toText(t, e, i); }, e.toInt = function(t) { return Q._toInt(t, e.__name2int); }, e.TEXTURE2D = 1, e.COLOR2D = 2, e.PRIMITIVE = 4, e.FILTERGLOW = 8, e.FILTERBLUR = 16, e.FILTERCOLOR = 32, e.COLORADD = 64, e.WORLDMAT = 128, e.FILLTEXTURE = 256, e.SKINMESH = 512, e.SHADERDEFINE_FSHIGHPRECISION = 1024, e.__name2int = {}, e.__int2name = [], e.__int2nameMap = [], e; }(), At = (function(t) { function e(t, i, n, s, a, r, o) { e.__super.call(this, t, i, n, s, 40, a, r, o); } s(e, "laya.webgl.shapes.Ellipse", it); }(), function(t) { function e(t, i, n, s, a) { this._points = [], this.rebuild(n), e.__super.call(this, t, i, 0, 0, 0, a, s, a, 0); } s(e, "laya.webgl.shapes.Line", it); var i = e.prototype; return i.rebuild = function(t) { var e = t.length; e != this._points.length && (this.mUint16Array = new Uint16Array(6 * (e / 2 - 1)), this.mFloat32Array = new Float32Array(5 * e)), this._points.length = 0; for (var i = NaN, n = NaN, s = -1, a = -1, r = t.length / 2, o = 0; o < r; o++) i = t[2 * o], n = t[2 * o + 1], (Math.abs(s - i) > .01 || Math.abs(a - n) > .01) && this._points.push(i, n), s = i, a = n; }, i.getData = function(t, e, i) { var n = [], s = []; this.borderWidth > 0 && this.createLine2(this._points, n, this.borderWidth, i, s, this._points.length / 2), this.mUint16Array.set(n, 0), this.mFloat32Array.set(s, 0), t.append(this.mUint16Array), e.append(this.mFloat32Array); }, e; }()), Lt = function(t) { function e(t, i, n, s, a) { this._points = []; for (var r = NaN, o = NaN, h = -1, l = -1, u = n.length / 2 - 1, c = 0; c < u; c++) r = n[2 * c], o = n[2 * c + 1], (Math.abs(h - r) > .01 || Math.abs(l - o) > .01) && this._points.push(r, o), h = r, l = o; r = n[2 * u], o = n[2 * u + 1], h = this._points[0], l = this._points[1], (Math.abs(h - r) > .01 || Math.abs(l - o) > .01) && this._points.push(r, o), e.__super.call(this, t, i, 0, 0, this._points.length / 2, 0, s, a); } s(e, "laya.webgl.shapes.LoopLine", it); var i = e.prototype; return i.getData = function(t, e, i) { if (this.borderWidth > 0) { for (var n = this.color, s = (n >> 16 & 255) / 255, a = (n >> 8 & 255) / 255, r = (255 & n) / 255, o = [], h = 0, l = 0, u = [], c = Math.floor(this._points.length / 2), _ = 0; _ < c; _++) h = this._points[2 * _], l = this._points[2 * _ + 1], o.push(this.x + h, this.y + l, s, a, r); this.createLoopLine(o, u, this.borderWidth, i + o.length / 5), t.append(new Uint16Array(u)), e.append(new Float32Array(o)); } }, i.createLoopLine = function(t, e, i, n, s, a) { t.length; var r = t.concat(), o = s || t, h = this.borderColor, l = (h >> 16 & 255) / 255, u = (h >> 8 & 255) / 255, c = (255 & h) / 255, _ = [ r[0], r[1] ], d = [ r[r.length - 5], r[r.length - 4] ], p = d[0] + .5 * (_[0] - d[0]), f = d[1] + .5 * (_[1] - d[1]); r.unshift(p, f, 0, 0, 0), r.push(p, f, 0, 0, 0); var g, m, v, y, x, b, w, C, S, T, I, M, E, A, L, P, k, R, D, N, F = r.length / 5, B = n, O = i / 2; v = r[0], y = r[1], T = v - (x = r[5]), S = (S = -(y - (b = r[6]))) / (N = Math.sqrt(S * S + T * T)) * O, T = T / N * O, o.push(v - S, y - T, l, u, c, v + S, y + T, l, u, c); for (var z = 1; z < F - 1; z++) v = r[5 * (z - 1)], y = r[5 * (z - 1) + 1], x = r[5 * z], b = r[5 * z + 1], w = r[5 * (z + 1)], C = r[5 * (z + 1) + 1], T = v - x, M = x - w, L = (-(S = (S = -(y - b)) / (N = Math.sqrt(S * S + T * T)) * O) + v) * (-(T = T / N * O) + b) - (-S + x) * (-T + y), R = (-(I = (I = -(b - C)) / (N = Math.sqrt(I * I + M * M)) * O) + w) * (-(M = M / N * O) + b) - (-I + x) * (-M + C), D = (E = -T + y - (-T + b)) * (k = -I + x - (-I + w)) - (P = -M + C - (-M + b)) * (A = -S + x - (-S + v)), Math.abs(D) < .1 ? (D += 10.1, o.push(x - S, b - T, l, u, c, x + S, b + T, l, u, c)) : (((g = (A * R - k * L) / D) - x) * (g - x) + ((m = (P * L - E * R) / D) - b) + (m - b), o.push(g, m, l, u, c, x - (g - x), b - (m - b), l, u, c)); a && (e = a); var U = this.edges + 1; for (z = 1; z < U; z++) e.push(B + 2 * (z - 1), B + 2 * (z - 1) + 1, B + 2 * z + 1, B + 2 * z + 1, B + 2 * z, B + 2 * (z - 1)); return e.push(B + 2 * (z - 1), B + 2 * (z - 1) + 1, B + 1, B + 1, B, B + 2 * (z - 1)), o; }, e; }(), Pt = function(t) { function e(t, i, n, s, a, r) { this._points = null, this._start = -1, this._repaint = !1, this.earcutTriangles = null, this._mat = x.create(), this._points = n.slice(0, n.length), e.__super.call(this, t, i, 0, 0, this._points.length / 2, s, a, r); } s(e, "laya.webgl.shapes.Polygon", it); var i = e.prototype; return i.rebuild = function(t) { this._repaint || (this._points.length = 0, this._points = this._points.concat(t)); }, i.setMatrix = function(t) { t.copyTo(this._mat); }, i.needUpdate = function(t) { return this._repaint = this._mat.a == t.a && this._mat.b == t.b && this._mat.c == t.c && this._mat.d == t.d && this._mat.tx == t.tx && this._mat.ty == t.ty, !this._repaint; }, i.getData = function(t, e, i) { var n, s = 0, a = this._points, r = 0; if (this.mUint16Array && this.mFloat32Array && this._repaint) { if (this._start != i) { for (this._start = i, n = [], r = this.earcutTriangles.length, s = 0; s < r; s++) n.push(this.earcutTriangles[s] + i); this.mUint16Array = new Uint16Array(n); } } else { this._start = i, n = []; var o = [], h = [], l = this.color, u = (l >> 16 & 255) / 255, c = (l >> 8 & 255) / 255, _ = (255 & l) / 255; for (r = Math.floor(a.length / 2), s = 0; s < r; s++) o.push(this.x + a[2 * s], this.y + a[2 * s + 1], u, c, _), h.push(this.x + a[2 * s], this.y + a[2 * s + 1]); for (this.earcutTriangles = nt.earcut(h, null, 2), r = this.earcutTriangles.length, s = 0; s < r; s++) n.push(this.earcutTriangles[s] + i); this.mUint16Array = new Uint16Array(n), this.mFloat32Array = new Float32Array(o); } t.append(this.mUint16Array), e.append(this.mFloat32Array); }, e; }(), kt = function(t) { function e() { this._matrix = new x(), this._matrix4 = ft.defaultMatrix4.concat(), e.__super.call(this, 1e4), this.shaderValue = new St(0, 0); } s(e, "laya.webgl.submit.SubmitCanvas", at); var i = e.prototype; return i.renderSubmit = function() { if (this._ctx_src._targets) return this._ctx_src._targets.flush(this._ctx_src), 1; var t = vt.worldAlpha, e = vt.worldMatrix4, i = vt.worldMatrix, n = vt.worldFilters, s = vt.worldShaderDefines, a = this.shaderValue, r = this._matrix, o = this._matrix4, h = x.TEMP; return x.mul(r, i, h), o[0] = h.a, o[1] = h.b, o[4] = h.c, o[5] = h.d, o[12] = h.tx, o[13] = h.ty, vt.worldMatrix = h.clone(), vt.worldMatrix4 = o, vt.worldAlpha = vt.worldAlpha * a.alpha, a.filters && a.filters.length && (vt.worldFilters = a.filters, vt.worldShaderDefines = a.defines), this._ctx_src.flush(), vt.worldAlpha = t, vt.worldMatrix4 = e, vt.worldMatrix.destroy(), vt.worldMatrix = i, vt.worldFilters = n, vt.worldShaderDefines = s, 1; }, i.releaseRender = function() { var t = e._cache; this._ctx_src = null, t[t._length++] = this; }, i.getRenderType = function() { return 10003; }, e.create = function(t, i, n) { var s = e._cache._length ? e._cache[--e._cache._length] : new e(); s._ctx_src = t; var a = s.shaderValue; return a.alpha = i, a.defines.setValue(0), n && n.length && a.setFilters(n), s; }, e._cache = (e._cache = [], e._cache._length = 0, e._cache), e; }(), Rt = function(t) { function e(t) { this._preIsSameTextureShader = !1, this._isSameTexture = !0, this._texs = new Array(), this._texsID = new Array(), this._vbPos = new Array(), void 0 === t && (t = 1e4), e.__super.call(this, t); } s(e, "laya.webgl.submit.SubmitTexture", at); var i = e.prototype; return i.releaseRender = function() { var t = e._cache; t[t._length++] = this, this.shaderValue.release(), this._preIsSameTextureShader = !1, this._vb = null, this._texs.length = 0, this._vbPos.length = 0, this._isSameTexture = !0; }, i.addTexture = function(t, e) { this._texsID[this._texs.length] = t._uvID, this._texs.push(t), this._vbPos.push(e); }, i.checkTexture = function() { if (this._texs.length < 1) this._isSameTexture = !0; else { var t = this.shaderValue.textureHost.bitmap; if (null !== t) for (var e = this._vb.getFloat32Array(), i = 0, n = this._texs.length; i < n; i++) { var s = this._texs[i]; s.active(); var a = s.uv; if (this._texsID[i] !== s._uvID) { this._texsID[i] = s._uvID; var r = this._vbPos[i]; e[r + 2] = a[0], e[r + 3] = a[1], e[r + 6] = a[2], e[r + 7] = a[3], e[r + 10] = a[4], e[r + 11] = a[5], e[r + 14] = a[6], e[r + 15] = a[7], this._vb.setNeedUpload(); } s.bitmap !== t && (this._isSameTexture = !1); } } }, i.renderSubmit = function() { if (0 === this._numEle) return e._shaderSet = !1, 1; var t = this.shaderValue.textureHost; if (t) { var i = t.source; if (!t.bitmap || !i) return e._shaderSet = !1, 1; this.shaderValue.texture = i; } this._vb.bind_upload(this._ib); var n = xt.mainContext; if (W.activeBlendFunction !== this._blendFn && (n.enable(3042), this._blendFn(n), W.activeBlendFunction = this._blendFn), L.drawCall++, L.trianglesFaces += this._numEle / 3, this._preIsSameTextureShader && Nt.activeShader && e._shaderSet ? Nt.activeShader.uploadTexture2D(this.shaderValue.texture) : this.shaderValue.upload(), e._shaderSet = !0, this._texs.length > 1 && !this._isSameTexture) for (var s = t.bitmap, a = 0, r = Nt.activeShader, o = 0, h = this._texs.length; o < h; o++) { var l = this._texs[o]; l.bitmap === s && o + 1 !== h || (r.uploadTexture2D(l.source), n.drawElements(4, 6 * (o - a + 1), 5123, this._startIdx + 6 * a * ft.BYTES_PIDX), s = l.bitmap, a = o); } else n.drawElements(4, this._numEle, 5123, this._startIdx); return 1; }, e.create = function(t, i, n, s, a) { var r = e._cache._length ? e._cache[--e._cache._length] : new e(); null == n && ((n = r._selfVb || (r._selfVb = Qt.create(-1))).clear(), s = 0), r._ib = i, r._vb = n, r._startIdx = s * ft.BYTES_PIDX, r._numEle = 0; var o = t._nBlendType; r._blendFn = t._targets ? W.targetFns[o] : W.fns[o], r.shaderValue = a, r.shaderValue.setValue(t._shader2D); var h = t._shader2D.filters; return h && r.shaderValue.setFilters(h), r; }, e._cache = (e._cache = [], e._cache._length = 0, e._cache), e._shaderSet = !0, e; }(), Dt = function(t) { function e() { e.__super.call(this, laya.webgl.utils.MeshTexture.const_stride, 0, 0), this.canReuse = !0, this.setAttributes(laya.webgl.utils.MeshTexture._fixattriInfo); } s(e, "laya.webgl.utils.MeshTexture", mt); var i = e.prototype; return i.addData = function(t, i, n, s, a, r) { for (var o = t.length / 2, h = this._vb.needSize(o * e.const_stride) >> 2, l = this._vb.getFloat32Array(), u = 0, c = 0; c < o; c++) { var _ = t[u], d = t[u + 1], p = _ * s.a + d * s.c + s.tx, f = _ * s.b + d * s.d + s.ty; l[h++] = p, l[h++] = f, l[h++] = i[u], l[h++] = i[u + 1], u += 2; } this._vb.setNeedUpload(); var g = this.vertNum; if (g > 0) { var m = n.length; m > e.tmpIdx.length && (e.tmpIdx = new Uint16Array(m)); for (var v = 0; v < m; v++) e.tmpIdx[v] = n[v] + g; this._ib.appendU16Array(e.tmpIdx, n.length); } else this._ib.append(n); this._ib.setNeedUpload(), this.vertNum += o, this.indexNum += n.length; }, i.releaseMesh = function() { this._vb._byteLength = 0, this._ib._byteLength = 0, this.vertNum = 0, this.indexNum = 0, laya.webgl.utils.MeshTexture._POOL.push(this); }, i.destroy = function() { this._ib.destroy(), this._vb.destroy(); }, e.getAMesh = function() { return laya.webgl.utils.MeshTexture._POOL.length ? laya.webgl.utils.MeshTexture._POOL.pop() : new e(); }, e.const_stride = 16, e._POOL = [], n(e, [ "_fixattriInfo", function() { return this._fixattriInfo = [ 5126, 2, 0, 5126, 2, 8 ]; }, "tmpIdx", function() { return this.tmpIdx = new Uint16Array(4); } ]), e; }(), Nt = function(t) { function e() { e.__super.call(this), this.lock = !0; } return s(e, "laya.webgl.shader.BaseShader", T), e.activeShader = null, e.bindShader = null, e; }(), Ft = function(t) { function e(t, i, n, s, a, r, o, h, l) { this._type = 0, this._svWidth = NaN, this._svHeight = NaN, this._preRenderTarget = null, this._alreadyResolved = !1, this._looked = !1, this._surfaceFormat = 0, this._surfaceType = 0, this._depthStencilFormat = 0, this._mipMap = !1, this._repeat = !1, this._minFifter = 0, this._magFifter = 0, this._destroy = !1, void 0 === n && (n = 6408), void 0 === s && (s = 5121), void 0 === a && (a = 34041), void 0 === r && (r = !1), void 0 === o && (o = !1), void 0 === h && (h = -1), void 0 === l && (l = -1), this._type = 1, this._w = t, this._h = i, this._surfaceFormat = n, this._surfaceType = s, this._depthStencilFormat = a, C.isConchWebGL && 34041 === this._depthStencilFormat && (this._depthStencilFormat = 33189), this._mipMap = r, this._repeat = o, this._minFifter = h, this._magFifter = l, this._createWebGLRenderTarget(), this.bitmap.lock = !0, e.__super.call(this, this.bitmap, D.INV_UV); } s(e, "laya.webgl.resource.RenderTarget2D", t); var n = e.prototype; return i.imps(n, { "laya.resource.IDispose": !0 }), n.getType = function() { return this._type; }, n.getTexture = function() { return this; }, n.size = function(t, e) { this._w == t && this._h == e || (this._w = t, this._h = e, this.release(), 0 != this._w && 0 != this._h && this._createWebGLRenderTarget()); }, n.release = function() { this.destroy(); }, n.recycle = function() { e.POOL.push(this); }, n.start = function() { var t = xt.mainContext; return this._preRenderTarget = vt.curRenderTarget, vt.curRenderTarget = this, t.bindFramebuffer(36160, this.bitmap.frameBuffer), this._alreadyResolved = !1, 1 == this._type && (t.viewport(0, 0, this._w, this._h), this._svWidth = vt.width, this._svHeight = vt.height, vt.width = this._w, vt.height = this._h, Nt.activeShader = null), this; }, n.clear = function(t, e, i, n) { void 0 === t && (t = 0), void 0 === e && (e = 0), void 0 === i && (i = 0), void 0 === n && (n = 1); var s = xt.mainContext; s.clearColor(t, e, i, n); var a = 16384; switch (this._depthStencilFormat) { case 33189: a |= 256; break; case 36168: a |= 1024; break; case 34041: a |= 256, a |= 1024; } s.clear(a); }, n.end = function() { var t = xt.mainContext; t.bindFramebuffer(36160, this._preRenderTarget ? this._preRenderTarget.bitmap.frameBuffer : null), this._alreadyResolved = !0, vt.curRenderTarget = this._preRenderTarget, 1 == this._type ? (t.viewport(0, 0, this._svWidth, this._svHeight), vt.width = this._svWidth, vt.height = this._svHeight, Nt.activeShader = null) : t.viewport(0, 0, i.stage.width, i.stage.height); }, n.getData = function(t, e, i, n) { var s = xt.mainContext; s.bindFramebuffer(36160, this.bitmap.frameBuffer); if (!(36053 === s.checkFramebufferStatus(36160))) return s.bindFramebuffer(36160, null), null; var a = new Uint8Array(this._w * this._h * 4); return s.readPixels(t, e, i, n, this._surfaceFormat, this._surfaceType, a), s.bindFramebuffer(36160, null), a; }, n.destroy = function(e) { void 0 === e && (e = !1), this._destroy || (this._loaded = !1, this.bitmap.offAll(), this.bitmap.disposeResource(), this.bitmap.dispose(), this.offAll(), this.bitmap = null, this._alreadyResolved = !1, this._destroy = !0, t.prototype.destroy.call(this)); }, n.dispose = function() {}, n._createWebGLRenderTarget = function() { this.bitmap = new Xt(this.width, this.height, this._surfaceFormat, this._surfaceType, this._depthStencilFormat, this._mipMap, this._repeat, this._minFifter, this._magFifter), this.bitmap.activeResource(), this._alreadyResolved = !0, this._destroy = !1, this._loaded = !0, this.bitmap.on("recovered", this, function(t) { this.event("recovered"); }); }, a(0, n, "surfaceFormat", function() { return this._surfaceFormat; }), a(0, n, "magFifter", function() { return this._magFifter; }), a(0, n, "surfaceType", function() { return this._surfaceType; }), a(0, n, "mipMap", function() { return this._mipMap; }), a(0, n, "depthStencilFormat", function() { return this._depthStencilFormat; }), a(0, n, "minFifter", function() { return this._minFifter; }), a(0, n, "source", function() { return this._alreadyResolved ? i.superGet(D, this, "source") : null; }), e.create = function(t, i, n, s, a, r, o, h, l) { void 0 === n && (n = 6408), void 0 === s && (s = 5121), void 0 === a && (a = 34041), void 0 === r && (r = !1), void 0 === o && (o = !1), void 0 === h && (h = -1), void 0 === l && (l = -1); var u = e.POOL.pop(); return u || (u = new e(t, i)), u.bitmap && u._w == t && u._h == i && u._surfaceFormat == n && u._surfaceType == s && u._depthStencilFormat == a && u._mipMap == r && u._repeat == o && u._minFifter == h && u._magFifter == l || (u._w = t, u._h = i, u._surfaceFormat = n, u._surfaceType = s, u._depthStencilFormat = a, C.isConchWebGL && 34041 === u._depthStencilFormat && (u._depthStencilFormat = 33189), u._mipMap = r, u._repeat = o, u._minFifter = h, u._magFifter = l, u.release(), u._createWebGLRenderTarget()), u; }, e.TYPE2D = 1, e.TYPE3D = 2, e.POOL = [], e; }(D), Bt = function(t) { function e() { this._glBuffer = null, this._buffer = null, this._bufferType = 0, this._bufferUsage = 0, this._byteLength = 0, e.__super.call(this), e._gl = xt.mainContext; } s(e, "laya.webgl.utils.Buffer", T); var i = e.prototype; return i._bind = function() { this.activeResource(), e._bindActive[this._bufferType] !== this._glBuffer && (34962 === this._bufferType && (e._bindVertexBuffer = this._glBuffer), e._gl.bindBuffer(this._bufferType, e._bindActive[this._bufferType] = this._glBuffer), Nt.activeShader = null); }, i.recreateResource = function() { this._glBuffer || (this._glBuffer = e._gl.createBuffer()), this.completeCreate(); }, i.disposeResource = function() { this._glBuffer && (xt.mainContext.deleteBuffer(this._glBuffer), this._glBuffer = null), this.memorySize = 0; }, a(0, i, "bufferUsage", function() { return this._bufferUsage; }), e._gl = null, e._bindActive = {}, e._bindVertexBuffer = null, e._enableAtributes = [], e; }(), Ot = function(t) { function e(t) { this.texcoord = null, this.offsetX = 300, this.offsetY = 0, e.__super.call(this, 512, 0); var i = 8 * ft.BYTES_PE; this.position = [ 2, 5126, !1, i, 0 ], this.texcoord = [ 2, 5126, !1, i, 2 * ft.BYTES_PE ], this.color = [ 4, 5126, !1, i, 4 * ft.BYTES_PE ]; } return s(e, "laya.webgl.shader.d2.skinAnishader.SkinSV", St), e; }(), zt = function(t) { function e(t) { e.__super.call(this, 2, 0), this.color = []; } s(e, "laya.webgl.shader.d2.value.Color2dSV", St); return e.prototype.setValue = function(t) { t.fillStyle && (this.color = t.fillStyle._color._color), t.strokeStyle && (this.color = t.strokeStyle._color._color); }, e; }(), Ut = function(t) { function e(t) { this.u_colorMatrix = null, this.strength = 0, this.colorMat = null, this.colorAlpha = null, this.u_TexRange = [ 0, 1, 0, 1 ], this.u_offset = [ 0, 0 ], this.texcoord = St._TEXCOORD, e.__super.call(this, 256, 0); } s(e, "laya.webgl.shader.d2.value.FillTextureSV", St); var i = e.prototype; return i.setValue = function(t) { this.ALPHA = t.ALPHA, t.filters && this.setFilters(t.filters); }, i.clear = function() { this.texture = null, this.shader = null, this.defines.setValue(0); }, e; }(), Vt = function(t) { function e(t) { this.u_colorMatrix = null, this.strength = 0, this.blurInfo = null, this.colorMat = null, this.colorAlpha = null, this.texcoord = St._TEXCOORD, void 0 === t && (t = 0), e.__super.call(this, 1, t); } s(e, "laya.webgl.shader.d2.value.TextureSV", St); var i = e.prototype; return i.setValue = function(t) { this.ALPHA = t.ALPHA, t.filters && this.setFilters(t.filters); }, i.clear = function() { this.texture = null, this.shader = null, this.defines.setValue(0); }, e; }(), Wt = function(t) { function e(t) { this.a_color = null, this.u_pos = [ 0, 0 ], e.__super.call(this, 4, 0), this.position = [ 2, 5126, !1, 5 * ft.BYTES_PE, 0 ], this.a_color = [ 3, 5126, !1, 5 * ft.BYTES_PE, 2 * ft.BYTES_PE ]; } return s(e, "laya.webgl.shader.d2.value.PrimitiveSV", St), e; }(), Gt = function(t) { function e() { this._atlaser = null, this._flashCacheImage = null, this._flashCacheImageNeedFlush = !1, e.__super.call(this); } s(e, "laya.webgl.atlas.AtlasWebGLCanvas", t); var i = e.prototype; return i.recreateResource = function() { var t = xt.mainContext, e = this._source = t.createTexture(), i = bt.curBindTexTarget, n = bt.curBindTexValue; bt.bindTexture(t, 3553, e), t.texImage2D(3553, 0, 6408, this._w, this._h, 0, 6408, 5121, null), t.texParameteri(3553, 10241, 9729), t.texParameteri(3553, 10240, 9729), t.texParameteri(3553, 10242, 33071), t.texParameteri(3553, 10243, 33071), i && n && bt.bindTexture(t, i, n), this.memorySize = this._w * this._h * 4, this.completeCreate(); }, i.disposeResource = function() { this._source && (xt.mainContext.deleteTexture(this._source), this._source = null, this.memorySize = 0); }, i.texSubImage2D = function(t, e, i) { if (C.isFlash) { this._flashCacheImage || (this._flashCacheImage = v.create(""), this._flashCacheImage._image.createCanvas(this._w, this._h)); var n = i.bitmapdata; this._flashCacheImage._image.copyPixels(n, 0, 0, n.width, n.height, t, e), this._flashCacheImageNeedFlush || (this._flashCacheImageNeedFlush = !0); } else { var s = xt.mainContext, a = bt.curBindTexTarget, r = bt.curBindTexValue; bt.bindTexture(s, 3553, this._source), C.isConchWebGL ? (i !== ConchTextCanvas && (t - 1 >= 0 && s.texSubImage2DEx(!0, 3553, 0, t - 1, e, 6408, 5121, i), t + 1 <= this._w && s.texSubImage2DEx(!0, 3553, 0, t + 1, e, 6408, 5121, i), e - 1 >= 0 && s.texSubImage2DEx(!0, 3553, 0, t, e - 1, 6408, 5121, i), e + 1 <= this._h && s.texSubImage2DEx(!0, 3553, 0, t, e + 1, 6408, 5121, i)), s.texSubImage2DEx(!0, 3553, 0, t, e, 6408, 5121, i)) : (s.pixelStorei(37441, !0), t - 1 >= 0 && s.texSubImage2D(3553, 0, t - 1, e, 6408, 5121, i), t + 1 <= this._w && s.texSubImage2D(3553, 0, t + 1, e, 6408, 5121, i), e - 1 >= 0 && s.texSubImage2D(3553, 0, t, e - 1, 6408, 5121, i), e + 1 <= this._h && s.texSubImage2D(3553, 0, t, e + 1, 6408, 5121, i), s.texSubImage2D(3553, 0, t, e, 6408, 5121, i), s.pixelStorei(37441, !1)), a && r && bt.bindTexture(s, a, r); } }, i.texSubImage2DPixel = function(t, e, i, n, s) { var a = xt.mainContext, r = bt.curBindTexTarget, o = bt.curBindTexValue; bt.bindTexture(a, 3553, this._source); var h = new Uint8Array(s.data); C.isConchWebGL ? a.texSubImage2DEx(!0, 3553, 0, t, e, i, n, 6408, 5121, h) : (a.pixelStorei(37441, !0), a.texSubImage2D(3553, 0, t, e, i, n, 6408, 5121, h), a.pixelStorei(37441, !1)), r && o && bt.bindTexture(a, r, o); }, a(0, i, "width", t.prototype._$get_width, function(t) { this._w = t; }), a(0, i, "height", t.prototype._$get_height, function(t) { this._h = t; }), e; }(l), Ht = function(t) { function e() { this.flipY = !0, this.alwaysChange = !1, e.__super.call(this); } s(e, "laya.webgl.resource.WebGLCanvas", l); var i = e.prototype; return i.getCanvas = function() { return this._canvas; }, i.clear = function() { this._ctx && this._ctx.clear(); }, i.destroy = function() { this._ctx && this._ctx.destroy(), this._ctx = null, laya.resource.Resource.prototype.destroy.call(this); }, i._setContext = function(t) { this._ctx = t; }, i.getContext = function(t, i) { return this._ctx ? this._ctx : this._ctx = e._createContext(this); }, i.size = function(t, e) { this._w == t && this._h == e || (this._w = t, this._h = e, this._ctx && this._ctx.size(t, e), this._canvas && (this._canvas.height = e, this._canvas.width = t)); }, i.activeResource = function(t) { void 0 === t && (t = !1), this._source || this.recreateResource(); }, i.recreateResource = function() { this.createWebGlTexture(), this.completeCreate(); }, i.disposeResource = function() { this._source && !this.iscpuSource && (xt.mainContext.deleteTexture(this._source), this._source = null, this.memorySize = 0); }, i.createWebGlTexture = function() { var t = xt.mainContext; this._canvas; var i = this._source = t.createTexture(); this.iscpuSource = !1; var n = bt.curBindTexTarget, s = bt.curBindTexValue; bt.bindTexture(t, 3553, i), t.pixelStorei(37440, this.flipY ? 1 : 0), C.isConchWebGL ? t.texImage2DEx(e.premulAlpha, 3553, 0, 6408, 6408, 5121, this._imgData) : (e.premulAlpha && t.pixelStorei(37441, !0), t.texImage2D(3553, 0, 6408, 6408, 5121, this._imgData), e.premulAlpha && t.pixelStorei(37441, !1)), t.texParameteri(3553, 10240, 9729), t.texParameteri(3553, 10241, 9729), t.texParameteri(3553, 10242, 33071), t.texParameteri(3553, 10243, 33071), t.pixelStorei(37440, 0), this.memorySize = this._w * this._h * 4, n && s && bt.bindTexture(t, n, s); }, i.reloadCanvasData = function() { var t = xt.mainContext; if (!this._source) throw "reloadCanvasData error, gl texture not created!"; var i = bt.curBindTexTarget, n = bt.curBindTexValue; bt.bindTexture(t, 3553, this._source), C.isConchWebGL ? t.texImage2DEx(e.premulAlpha, 3553, 0, 6408, 6408, 5121, this._imgData) : (e.premulAlpha && t.pixelStorei(37441, !0), t.texImage2D(3553, 0, 6408, 6408, 5121, this._imgData), e.premulAlpha && t.pixelStorei(37441, !1)), t.pixelStorei(37440, 0), i && n && bt.bindTexture(t, i, n); }, i.texSubImage2D = function(t, e, i) { var n = xt.mainContext, s = bt.curBindTexTarget, a = bt.curBindTexValue; bt.bindTexture(n, 3553, this._source), C.isConchWebGL ? n.texSubImage2DEx(!0, 3553, 0, e, i, 6408, 5121, t._source) : (n.pixelStorei(37441, !0), n.texSubImage2D(3553, 0, e, i, 6408, 5121, t._source), n.pixelStorei(37441, !1)), s && a && bt.bindTexture(n, s, a); }, i.toBase64 = function(t, e, i) { var n = null; this._canvas && (n = this._canvas.toDataURL(t, e)), i.call(this, n); }, a(0, i, "context", function() { return this._ctx; }), a(0, i, "source", function() { return this.alwaysChange && this.reloadCanvasData(), this._source; }), a(0, i, "asBitmap", null, function(t) { this._ctx && (this._ctx.asBitmap = t); }), e._createContext = null, e.premulAlpha = !1, e; }(), Yt = function(t) { function e(t, i) { e.__super.call(this), this.char = t, this.isSpace = " " === t, this.xs = i.scaleX, this.ys = i.scaleY, this.font = i.font.toString(), this.fontSize = i.font.size, this.fillColor = i.fillColor, this.borderColor = i.borderColor, this.lineWidth = i.lineWidth, this.underLine = i.underLine; var n, s = C.isConchApp; s ? ((n = ConchTextCanvas)._source = ConchTextCanvas, n._source.canvas = ConchTextCanvas) : n = u.canvas.source, this.canvas = n, this._enableMerageInAtlas = !0, this._ctx = s ? n : this.canvas.getContext("2d", void 0); var a = N.measureText(this.char, this.font); this.cw = a.width * this.xs, this.ch = (a.height || this.fontSize) * this.ys, this.onresize(this.cw + 2 * d.CborderSize, this.ch + 2 * d.CborderSize), this.texture = new D(this); } s(e, "laya.webgl.resource.WebGLCharImage", l); var n = e.prototype; return i.imps(n, { "laya.webgl.resource.IMergeAtlasBitmap": !0 }), n.active = function() { this.texture.active(); }, n.recreateResource = function() { var t = C.isConchApp; if (this.onresize(this.cw + 2 * d.CborderSize, this.ch + 2 * d.CborderSize), this.canvas && (this.canvas.height = this._h, this.canvas.width = this._w), t) { var i = this.fontSize; 1 == this.xs && 1 == this.ys || (i = parseInt(i * (this.xs > this.ys ? this.xs : this.ys) + "")); var n = "normal 100 " + this.font; n = n.replace(e._fontSizeReg, i), this.borderColor && (n += " 1 " + this.borderColor), this._ctx.font = n, this._ctx.textBaseline = "top", this._ctx.fillStyle = this.fillColor, this._ctx.fillText(this.char, d.CborderSize, d.CborderSize, null, null, null); } else { if (this._ctx.save(), this._ctx.lineJoin = "round", this._ctx.clearRect(0, 0, this.cw + 2 * d.CborderSize, this.ch + 2 * d.CborderSize), this._ctx.font = this.font, R.RightToLeft && (this._ctx.textAlign = "end"), this._ctx.textBaseline = "top", 1 != this.xs || 1 != this.ys ? this._ctx.setTransform(this.xs, 0, 0, this.ys, d.CborderSize, d.CborderSize) : this._ctx.setTransform(1, 0, 0, 1, d.CborderSize, d.CborderSize), this.fillColor && this.borderColor ? (this._ctx.strokeStyle = this.borderColor, this._ctx.lineWidth = this.lineWidth, this._ctx.strokeText(this.char, 0, 0, null, null, 0, null), this._ctx.fillStyle = this.fillColor, this._ctx.fillText(this.char, 0, 0, null, null, null)) : -1 === this.lineWidth ? (this._ctx.fillStyle = this.fillColor ? this.fillColor : "white", this._ctx.fillText(this.char, 0, 0, null, null, null)) : (this._ctx.strokeStyle = this.borderColor ? this.borderColor : "white", this._ctx.lineWidth = this.lineWidth, this._ctx.strokeText(this.char, 0, 0, null, null, 0, null)), this.underLine) { this._ctx.lineWidth = 1, this._ctx.strokeStyle = this.fillColor, this._ctx.beginPath(), this._ctx.moveTo(0, this.fontSize + 1); var s = this._ctx.measureText(this.char).width + 1; this._ctx.lineTo(s, this.fontSize + 1), this._ctx.stroke(); } this._ctx.restore(); } this.borderSize = d.CborderSize, this.completeCreate(); }, n.onresize = function(t, e) { this._w = t, this._h = e, this._allowMerageInAtlas = !0; }, n.clearAtlasSource = function() {}, a(0, n, "allowMerageInAtlas", function() { return this._allowMerageInAtlas; }), a(0, n, "atlasSource", function() { return this.canvas; }), a(0, n, "atlasImgData", function() { return !e.canUseCanvas && this._ctx.getImageData ? this._ctx.getImageData(0, 0, this._w, this._h) : null; }), a(0, n, "enableMerageInAtlas", function() { return this._enableMerageInAtlas; }, function(t) { this._enableMerageInAtlas = t; }), e.createOneChar = function(t, i) { return new e(t, i); }, e.canUseCanvas = !0, e._fontSizeReg = new RegExp("\\d+(?=px)", "g"), e; }(), Xt = function(t) { function e(t, i, n, s, a, r, o, h, l) { void 0 === n && (n = 6408), void 0 === s && (s = 5121), void 0 === a && (a = 34041), void 0 === r && (r = !1), void 0 === o && (o = !1), void 0 === h && (h = -1), void 0 === l && (l = 1), e.__super.call(this), this._w = t, this._h = i, this._surfaceFormat = n, this._surfaceType = s, this._depthStencilFormat = a, C.isConchWebGL && 34041 === this._depthStencilFormat && (this._depthStencilFormat = 33189), this._mipMap = r, this._repeat = o, this._minFifter = h, this._magFifter = l; } s(e, "laya.webgl.resource.WebGLRenderTarget", l); var i = e.prototype; return i.recreateResource = function() { var t = xt.mainContext; this._frameBuffer || (this._frameBuffer = t.createFramebuffer()), this._source || (this._source = t.createTexture()); var e = bt.curBindTexTarget, i = bt.curBindTexValue; bt.bindTexture(t, 3553, this._source), t.texImage2D(3553, 0, 6408, this._w, this._h, 0, this._surfaceFormat, this._surfaceType, null); var n = this._minFifter, s = this._magFifter, a = this._repeat ? 10497 : 33071, r = o.isPOT(this._w, this._h); if (r ? (this._mipMap ? -1 !== n || (n = 9987) : -1 !== n || (n = 9729), -1 !== s || (s = 9729), t.texParameteri(3553, 10241, n), t.texParameteri(3553, 10240, s), t.texParameteri(3553, 10242, a), t.texParameteri(3553, 10243, a), this._mipMap && t.generateMipmap(3553)) : (-1 !== n || (n = 9729), -1 !== s || (s = 9729), t.texParameteri(3553, 10241, n), t.texParameteri(3553, 10240, s), t.texParameteri(3553, 10242, 33071), t.texParameteri(3553, 10243, 33071)), t.bindFramebuffer(36160, this._frameBuffer), t.framebufferTexture2D(36160, 36064, 3553, this._source, 0), this._depthStencilFormat) switch (this._depthStencilBuffer || (this._depthStencilBuffer = t.createRenderbuffer()), t.bindRenderbuffer(36161, this._depthStencilBuffer), t.renderbufferStorage(36161, this._depthStencilFormat, this._w, this._h), this._depthStencilFormat) { case 33189: t.framebufferRenderbuffer(36160, 36096, 36161, this._depthStencilBuffer); break; case 36168: t.framebufferRenderbuffer(36160, 36128, 36161, this._depthStencilBuffer); break; case 34041: t.framebufferRenderbuffer(36160, 33306, 36161, this._depthStencilBuffer); } t.bindFramebuffer(36160, null), e && i && bt.bindTexture(t, e, i), t.bindRenderbuffer(36161, null), r && this._mipMap ? this.memorySize = this._w * this._h * 4 * (1 + 1 / 3) : this.memorySize = this._w * this._h * 4, this.completeCreate(); }, i.disposeResource = function() { this._frameBuffer && (xt.mainContext.deleteTexture(this._source), xt.mainContext.deleteFramebuffer(this._frameBuffer), xt.mainContext.deleteRenderbuffer(this._depthStencilBuffer), this._source = null, this._frameBuffer = null, this._depthStencilBuffer = null, this.memorySize = 0); }, a(0, i, "depthStencilBuffer", function() { return this._depthStencilBuffer; }), a(0, i, "frameBuffer", function() { return this._frameBuffer; }), e; }(), jt = function(t) { function e(t, i, n, s, a, r, o) { this.offsetX = 0, this.offsetY = 0, e.__super.call(this), this.repeat = !0, this.mipmap = !1, this.minFifter = -1, this.magFifter = -1, this.atlasImage = r, this.canvas = t, this._ctx = t.getContext("2d", void 0), this._w = s, this._h = a, this.offsetX = i, this.offsetY = n, this.src = o, this._enableMerageInAtlas = !0, U.enabled && this._w < U.atlasLimitWidth && this._h < U.atlasLimitHeight ? this._allowMerageInAtlas = !0 : this._allowMerageInAtlas = !1; } s(e, "laya.webgl.resource.WebGLSubImage", l); var n = e.prototype; return i.imps(n, { "laya.webgl.resource.IMergeAtlasBitmap": !0 }), n.size = function(t, e) { this._w = t, this._h = e, this._ctx && this._ctx.size(t, e), this.canvas && (this.canvas.height = e, this.canvas.width = t); }, n.recreateResource = function() { this.size(this._w, this._h), this._ctx.drawImage(this.atlasImage, this.offsetX, this.offsetY, this._w, this._h, 0, 0, this._w, this._h), this._allowMerageInAtlas && this._enableMerageInAtlas ? this.memorySize = 0 : this.createWebGlTexture(), this.completeCreate(); }, n.createWebGlTexture = function() { var t = xt.mainContext; if (!this.canvas) throw "create GLTextur err:no data:" + this.canvas; var e = this._source = t.createTexture(), i = bt.curBindTexTarget, n = bt.curBindTexValue; bt.bindTexture(t, 3553, e), C.isConchWebGL ? t.texImage2DEx(!0, 3553, 0, 6408, 6408, 5121, this.canvas) : (t.pixelStorei(37441, !0), t.texImage2D(3553, 0, 6408, 6408, 5121, this.canvas), t.pixelStorei(37441, !1)); var s = this.minFifter, a = this.magFifter, r = this.repeat ? 10497 : 33071, h = o.isPOT(this.width, this.height); h ? (this.mipmap ? -1 !== s || (s = 9987) : -1 !== s || (s = 9729), -1 !== a || (a = 9729), t.texParameteri(3553, 10240, a), t.texParameteri(3553, 10241, s), t.texParameteri(3553, 10242, r), t.texParameteri(3553, 10243, r), this.mipmap && t.generateMipmap(3553)) : (-1 !== s || (s = 9729), -1 !== a || (a = 9729), t.texParameteri(3553, 10241, s), t.texParameteri(3553, 10240, a), t.texParameteri(3553, 10242, 33071), t.texParameteri(3553, 10243, 33071)), i && n && bt.bindTexture(t, i, n), this.canvas = null, h && this.mipmap ? this.memorySize = this._w * this._h * 4 * (1 + 1 / 3) : this.memorySize = this._w * this._h * 4; }, n.disposeResource = function() { U.enabled && this._allowMerageInAtlas || !this._source || (xt.mainContext.deleteTexture(this._source), this._source = null, this.memorySize = 0); }, n.clearAtlasSource = function() {}, a(0, n, "allowMerageInAtlas", function() { return this._allowMerageInAtlas; }), a(0, n, "atlasSource", function() { return this.canvas; }), a(0, n, "enableMerageInAtlas", function() { return this._allowMerageInAtlas; }, function(t) { this._allowMerageInAtlas = t; }), e; }(), Kt = function(t) { function e(t, i, n, s) { if (this._curActTexIndex = 0, this.tag = {}, this._program = null, this._params = null, this._paramsMap = {}, this._offset = 0, e.__super.call(this), !t || !i) throw "Shader Error"; this._id = ++e._count, this._vs = t, this._ps = i, this._nameMap = s || {}, null != n && (e.sharders[n] = this); } s(e, "laya.webgl.shader.Shader", Nt); var i = e.prototype; return i.recreateResource = function() { this._compile(), this.completeCreate(), this.memorySize = 0; }, i.disposeResource = function() { xt.mainContext.deleteShader(this._vshader), xt.mainContext.deleteShader(this._pshader), xt.mainContext.deleteProgram(this._program), this._vshader = this._pshader = this._program = null, this._params = null, this._paramsMap = {}, this.memorySize = 0, this._curActTexIndex = 0; }, i._compile = function() { if (this._vs && this._ps && !this._params) { this._reCompile = !0, this._params = []; var t = [ this._vs, this._ps ], i = xt.mainContext; if (this._program = i.createProgram(), this._vshader = e._createShader(i, t[0], 35633), this._pshader = e._createShader(i, t[1], 35632), i.attachShader(this._program, this._vshader), i.attachShader(this._program, this._pshader), i.linkProgram(this._program), !C.isConchApp && !i.getProgramParameter(this._program, 35714)) throw i.getProgramInfoLog(this._program); var n, s = 0, a = 0, r = 0; for (r = C.isConchApp ? i.getProgramParameterEx(this._vs, this._ps, "", 35721) : i.getProgramParameter(this._program, 35721), s = 0; s < r; s++) { var o = null; n = { vartype: "attribute", glfun: null, ivartype: 0, attrib: o = C.isConchApp ? i.getActiveAttribEx(this._vs, this._ps, "", s) : i.getActiveAttrib(this._program, s), location: i.getAttribLocation(this._program, o.name), name: o.name, type: o.type, isArray: !1, isSame: !1, preValue: null, indexOfParams: 0 }, this._params.push(n); } var h = 0; for (h = C.isConchApp ? i.getProgramParameterEx(this._vs, this._ps, "", 35718) : i.getProgramParameter(this._program, 35718), s = 0; s < h; s++) { var l = null; l = C.isConchApp ? i.getActiveUniformEx(this._vs, this._ps, "", s) : i.getActiveUniform(this._program, s), (n = { vartype: "uniform", glfun: null, ivartype: 1, attrib: o, location: i.getUniformLocation(this._program, l.name), name: l.name, type: l.type, isArray: !1, isSame: !1, preValue: null, indexOfParams: 0 }).name.indexOf("[0]") > 0 && (n.name = n.name.substr(0, n.name.length - 3), n.isArray = !0, n.location = i.getUniformLocation(this._program, n.name)), this._params.push(n); } for (s = 0, a = this._params.length; s < a; s++) if (n = this._params[s], n.indexOfParams = s, n.index = 1, n.value = [ n.location, null ], n.codename = n.name, n.name = this._nameMap[n.codename] ? this._nameMap[n.codename] : n.codename, this._paramsMap[n.name] = n, n._this = this, n.uploadedValue = [], "attribute" !== n.vartype) switch (n.type) { case 5124: n.fun = n.isArray ? this._uniform1iv : this._uniform1i; break; case 5126: n.fun = n.isArray ? this._uniform1fv : this._uniform1f; break; case 35664: n.fun = n.isArray ? this._uniform_vec2v : this._uniform_vec2; break; case 35665: n.fun = n.isArray ? this._uniform_vec3v : this._uniform_vec3; break; case 35666: n.fun = n.isArray ? this._uniform_vec4v : this._uniform_vec4; break; case 35678: n.fun = this._uniform_sampler2D; break; case 35680: n.fun = this._uniform_samplerCube; break; case 35676: n.glfun = i.uniformMatrix4fv, n.fun = this._uniformMatrix4fv; break; case 35670: n.fun = this._uniform1i; break; case 35674: case 35675: default: throw new Error("compile shader err!"); } else n.fun = this._attribute; } }, i.getUniform = function(t) { return this._paramsMap[t]; }, i._attribute = function(t, e) { var i = xt.mainContext, n = Bt._enableAtributes, s = t.location; return n[s] || i.enableVertexAttribArray(s), i.vertexAttribPointer(s, e[0], e[1], e[2], e[3], e[4] + this._offset), n[s] = Bt._bindVertexBuffer, 1; }, i._uniform1f = function(t, e) { var i = t.uploadedValue; return i[0] !== e ? (xt.mainContext.uniform1f(t.location, i[0] = e), 1) : 0; }, i._uniform1fv = function(t, e) { if (e.length < 4) { var i = t.uploadedValue; return i[0] !== e[0] || i[1] !== e[1] || i[2] !== e[2] || i[3] !== e[3] ? (xt.mainContext.uniform1fv(t.location, e), i[0] = e[0], i[1] = e[1], i[2] = e[2], i[3] = e[3], 1) : 0; } return xt.mainContext.uniform1fv(t.location, e), 1; }, i._uniform_vec2 = function(t, e) { var i = t.uploadedValue; return i[0] !== e[0] || i[1] !== e[1] ? (xt.mainContext.uniform2f(t.location, i[0] = e[0], i[1] = e[1]), 1) : 0; }, i._uniform_vec2v = function(t, e) { if (e.length < 2) { var i = t.uploadedValue; return i[0] !== e[0] || i[1] !== e[1] || i[2] !== e[2] || i[3] !== e[3] ? (xt.mainContext.uniform2fv(t.location, e), i[0] = e[0], i[1] = e[1], i[2] = e[2], i[3] = e[3], 1) : 0; } return xt.mainContext.uniform2fv(t.location, e), 1; }, i._uniform_vec3 = function(t, e) { var i = t.uploadedValue; return i[0] !== e[0] || i[1] !== e[1] || i[2] !== e[2] ? (xt.mainContext.uniform3f(t.location, i[0] = e[0], i[1] = e[1], i[2] = e[2]), 1) : 0; }, i._uniform_vec3v = function(t, e) { return xt.mainContext.uniform3fv(t.location, e), 1; }, i._uniform_vec4 = function(t, e) { var i = t.uploadedValue; return i[0] !== e[0] || i[1] !== e[1] || i[2] !== e[2] || i[3] !== e[3] ? (xt.mainContext.uniform4f(t.location, i[0] = e[0], i[1] = e[1], i[2] = e[2], i[3] = e[3]), 1) : 0; }, i._uniform_vec4v = function(t, e) { return xt.mainContext.uniform4fv(t.location, e), 1; }, i._uniformMatrix2fv = function(t, e) { return xt.mainContext.uniformMatrix2fv(t.location, !1, e), 1; }, i._uniformMatrix3fv = function(t, e) { return xt.mainContext.uniformMatrix3fv(t.location, !1, e), 1; }, i._uniformMatrix4fv = function(t, e) { return xt.mainContext.uniformMatrix4fv(t.location, !1, e), 1; }, i._uniform1i = function(t, e) { var i = t.uploadedValue; return i[0] !== e ? (xt.mainContext.uniform1i(t.location, i[0] = e), 1) : 0; }, i._uniform1iv = function(t, e) { return xt.mainContext.uniform1iv(t.location, e), 1; }, i._uniform_ivec2 = function(t, e) { var i = t.uploadedValue; return i[0] !== e[0] || i[1] !== e[1] ? (xt.mainContext.uniform2i(t.location, i[0] = e[0], i[1] = e[1]), 1) : 0; }, i._uniform_ivec2v = function(t, e) { return xt.mainContext.uniform2iv(t.location, e), 1; }, i._uniform_vec3i = function(t, e) { var i = t.uploadedValue; return i[0] !== e[0] || i[1] !== e[1] || i[2] !== e[2] ? (xt.mainContext.uniform3i(t.location, i[0] = e[0], i[1] = e[1], i[2] = e[2]), 1) : 0; }, i._uniform_vec3vi = function(t, e) { return xt.mainContext.uniform3iv(t.location, e), 1; }, i._uniform_vec4i = function(t, e) { var i = t.uploadedValue; return i[0] !== e[0] || i[1] !== e[1] || i[2] !== e[2] || i[3] !== e[3] ? (xt.mainContext.uniform4i(t.location, i[0] = e[0], i[1] = e[1], i[2] = e[2], i[3] = e[3]), 1) : 0; }, i._uniform_vec4vi = function(t, e) { return xt.mainContext.uniform4iv(t.location, e), 1; }, i._uniform_sampler2D = function(t, i) { var n = xt.mainContext, s = t.uploadedValue; return null == s[0] ? (s[0] = this._curActTexIndex, n.uniform1i(t.location, this._curActTexIndex), n.activeTexture(e._TEXTURES[this._curActTexIndex]), bt.bindTexture(n, 3553, i), this._curActTexIndex++, 1) : (n.activeTexture(e._TEXTURES[s[0]]), bt.bindTexture(n, 3553, i), 0); }, i._uniform_samplerCube = function(t, i) { var n = xt.mainContext, s = t.uploadedValue; return null == s[0] ? (s[0] = this._curActTexIndex, n.uniform1i(t.location, this._curActTexIndex), n.activeTexture(e._TEXTURES[this._curActTexIndex]), bt.bindTexture(n, 34067, i), this._curActTexIndex++, 1) : (n.activeTexture(e._TEXTURES[s[0]]), bt.bindTexture(n, 34067, i), 0); }, i._noSetValue = function(t) { console.log("no....:" + t.name); }, i.uploadOne = function(t, e) { this.activeResource(), bt.UseProgram(this._program); var i = this._paramsMap[t]; i.fun.call(this, i, e); }, i.uploadTexture2D = function(t) { L.shaderCall++; var e = xt.mainContext; e.activeTexture(33984), bt.bindTexture(e, 3553, t); }, i.upload = function(t, e) { Nt.activeShader = Nt.bindShader = this, this._lastUseFrameCount === L.loopCount || this.activeResource(), bt.UseProgram(this._program), this._reCompile ? (e = this._params, this._reCompile = !1) : e = e || this._params; xt.mainContext; for (var i, n, s = e.length, a = 0, r = 0; r < s; r++) null !== (n = t[(i = e[r]).name]) && (a += i.fun.call(this, i, n)); L.shaderCall += a; }, i.uploadArray = function(t, e, i) { Nt.activeShader = this, Nt.bindShader = this, this.activeResource(), bt.UseProgram(this._program); this._params; for (var n, s, a = 0, r = e - 2; r >= 0; r -= 2) (s = this._paramsMap[t[r]]) && null != (n = t[r + 1]) && (i && i[s.name] && i[s.name].bind(), a += s.fun.call(this, s, n)); L.shaderCall += a; }, i.getParams = function() { return this._params; }, e.getShader = function(t) { return e.sharders[t]; }, e.create = function(t, i, n, s) { return new e(t, i, n, s); }, e.withCompile = function(t, i, n, s) { if (n && e.sharders[n]) return e.sharders[n]; var a = e._preCompileShader[2e-4 * t]; if (!a) throw new Error("withCompile shader err!" + t); return a.createShader(i, n, s); }, e.withCompile2D = function(t, i, n, s, a) { if (s && e.sharders[s]) return e.sharders[s]; var r = e._preCompileShader[2e-4 * t + i]; if (!r) throw new Error("withCompile shader err!" + t + " " + i); return r.createShader(n, s, a); }, e.addInclude = function(t, e) { yt.addInclude(t, e); }, e.preCompile = function(t, i, n, s) { var a = 2e-4 * t; e._preCompileShader[a] = new yt(a, i, n, s); }, e.preCompile2D = function(t, i, n, s, a) { var r = 2e-4 * t + i; e._preCompileShader[r] = new yt(r, n, s, a); }, e._createShader = function(t, e, i) { var n = t.createShader(i); return t.shaderSource(n, e), t.compileShader(n), n; }, e._TEXTURES = [ 33984, 33985, 33986, 33987, 33988, 33989, 33990, , 33991, 33992 ], e._count = 0, e._preCompileShader = {}, e.SHADERNAME2ID = 2e-4, e.sharders = (e.sharders = [], e.sharders.length = 32, e.sharders), n(e, [ "nameKey", function() { return this.nameKey = new P(); } ]), e; }(), $t = function(t) { function e() { this._maxsize = 0, this._upload = !0, this._uploadSize = 0, e.__super.call(this), this.lock = !0; } s(e, "laya.webgl.utils.Buffer2D", t); var i = e.prototype; return i.needSize = function(t) { var e = this._byteLength; if (t) { var i = this._byteLength + t; i <= this._buffer.byteLength || this._resizeBuffer(i << 1, !0), this._byteLength = i; } return e; }, i._bufferData = function() { this._maxsize = Math.max(this._maxsize, this._byteLength), L.loopCount % 30 == 0 && (this._buffer.byteLength > this._maxsize + 64 && (this.memorySize = this._buffer.byteLength, this._buffer = this._buffer.slice(0, this._maxsize + 64), this._checkArrayUse()), this._maxsize = this._byteLength), this._uploadSize < this._buffer.byteLength && (this._uploadSize = this._buffer.byteLength, Bt._gl.bufferData(this._bufferType, this._uploadSize, this._bufferUsage), this.memorySize = this._uploadSize), Bt._gl.bufferSubData(this._bufferType, 0, this._buffer); }, i._bufferSubData = function(t, e, i) { if (void 0 === t && (t = 0), void 0 === e && (e = 0), void 0 === i && (i = 0), this._maxsize = Math.max(this._maxsize, this._byteLength), L.loopCount % 30 == 0 && (this._buffer.byteLength > this._maxsize + 64 && (this.memorySize = this._buffer.byteLength, this._buffer = this._buffer.slice(0, this._maxsize + 64), this._checkArrayUse()), this._maxsize = this._byteLength), this._uploadSize < this._buffer.byteLength && (this._uploadSize = this._buffer.byteLength, Bt._gl.bufferData(this._bufferType, this._uploadSize, this._bufferUsage), this.memorySize = this._uploadSize), e || i) { var n = this._buffer.slice(e, i); Bt._gl.bufferSubData(this._bufferType, t, n); } else Bt._gl.bufferSubData(this._bufferType, t, this._buffer); }, i._checkArrayUse = function() {}, i._bind_upload = function() { return !!this._upload && (this._upload = !1, this._bind(), this._bufferData(), !0); }, i._bind_subUpload = function(t, e, i) { return void 0 === t && (t = 0), void 0 === e && (e = 0), void 0 === i && (i = 0), !!this._upload && (this._upload = !1, this._bind(), this._bufferSubData(t, e, i), !0); }, i._resizeBuffer = function(t, e) { if (t < this._buffer.byteLength) return this; if (this.memorySize = t, e && this._buffer && this._buffer.byteLength > 0) { var i = new ArrayBuffer(t); new Uint8Array(i).set(new Uint8Array(this._buffer), 0), this._buffer = i; } else this._buffer = new ArrayBuffer(t); return this._checkArrayUse(), this._upload = !0, this; }, i.append = function(t) { this._upload = !0; var e, i = 0; i = t.byteLength, t instanceof Uint8Array ? (this._resizeBuffer(this._byteLength + i, !0), e = new Uint8Array(this._buffer, this._byteLength)) : t instanceof Uint16Array ? (this._resizeBuffer(this._byteLength + i, !0), e = new Uint16Array(this._buffer, this._byteLength)) : t instanceof Float32Array && (this._resizeBuffer(this._byteLength + i, !0), e = new Float32Array(this._buffer, this._byteLength)), e.set(t, 0), this._byteLength += i, this._checkArrayUse(); }, i.appendU16Array = function(t, e) { this._resizeBuffer(this._byteLength + 2 * e, !0); for (var i = new Uint16Array(this._buffer, this._byteLength, e), n = 0; n < e; n++) i[n] = t[n]; this._byteLength += 2 * e, this._checkArrayUse(); }, i.appendEx = function(t, e) { this._upload = !0; var i = 0; i = t.byteLength, this._resizeBuffer(this._byteLength + i, !0), new e(this._buffer, this._byteLength).set(t, 0), this._byteLength += i, this._checkArrayUse(); }, i.appendEx2 = function(t, e, i, n) { void 0 === n && (n = 1), this._upload = !0; var s, a = 0; a = i * n, this._resizeBuffer(this._byteLength + a, !0), s = new e(this._buffer, this._byteLength); var r = 0; for (r = 0; r < i; r++) s[r] = t[r]; this._byteLength += a, this._checkArrayUse(); }, i.getBuffer = function() { return this._buffer; }, i.setNeedUpload = function() { this._upload = !0; }, i.getNeedUpload = function() { return this._upload; }, i.upload = function() { var t = this._bind_upload(); return Bt._gl.bindBuffer(this._bufferType, null), Bt._bindActive[this._bufferType] = null, Nt.activeShader = null, t; }, i.subUpload = function(t, e, i) { void 0 === t && (t = 0), void 0 === e && (e = 0), void 0 === i && (i = 0); var n = this._bind_subUpload(); return Bt._gl.bindBuffer(this._bufferType, null), Bt._bindActive[this._bufferType] = null, Nt.activeShader = null, n; }, i.disposeResource = function() { t.prototype.disposeResource.call(this), this._upload = !0, this._uploadSize = 0; }, i.clear = function() { this._byteLength = 0, this._upload = !0; }, a(0, i, "bufferLength", function() { return this._buffer.byteLength; }), a(0, i, "byteLength", null, function(t) { this._byteLength !== t && (t <= this._buffer.byteLength || this._resizeBuffer(2 * t + 256, !0), this._byteLength = t); }), e.__int__ = function(t) { Jt.QuadrangleIB = Jt.create(35044), gt.fillIBQuadrangle(Jt.QuadrangleIB, 16); }, e.FLOAT32 = 4, e.SHORT = 2, e; }(Bt), qt = (function(t) { function e(t) { this.u_blurX = !1, this.u_color = null, this.u_offset = null, this.u_strength = NaN, this.u_texW = 0, this.u_texH = 0, e.__super.call(this, 9); } s(e, "laya.webgl.shader.d2.value.GlowSV", t); var i = e.prototype; i.setValue = function(e) { t.prototype.setValue.call(this, e); }, i.clear = function() { t.prototype.clear.call(this); }; }(Vt), function(t) { function e(t) { e.__super.call(this, 64), this.defines.add(64); } s(e, "laya.webgl.shader.d2.value.TextSV", t); var i = e.prototype; return i.release = function() { e.pool[e._length++] = this, this.clear(); }, i.clear = function() { t.prototype.clear.call(this); }, e.create = function() { return e._length ? e.pool[--e._length] : new e(null); }, e.pool = [], e._length = 0, e; }(Vt)), Zt = function(t) { function e(t, i, n, s) { this._params2dQuick1 = null, this._params2dQuick2 = null, this._shaderValueWidth = NaN, this._shaderValueHeight = NaN, e.__super.call(this, t, i, n, s); } s(e, "laya.webgl.shader.d2.Shader2X", t); var i = e.prototype; return i.upload2dQuick1 = function(t) { this.upload(t, this._params2dQuick1 || this._make2dQuick1()); }, i._make2dQuick1 = function() { if (!this._params2dQuick1) { this.activeResource(), this._params2dQuick1 = []; for (var t, e = this._params, i = 0, n = e.length; i < n; i++) t = e[i], (C.isFlash || "size" !== t.name && "position" !== t.name && "texcoord" !== t.name) && this._params2dQuick1.push(t); } return this._params2dQuick1; }, i.disposeResource = function() { t.prototype.disposeResource.call(this), this._params2dQuick1 = null, this._params2dQuick2 = null; }, i.upload2dQuick2 = function(t) { this.upload(t, this._params2dQuick2 || this._make2dQuick2()); }, i._make2dQuick2 = function() { if (!this._params2dQuick2) { this.activeResource(), this._params2dQuick2 = []; for (var t, e = this._params, i = 0, n = e.length; i < n; i++) t = e[i], (C.isFlash || "size" !== t.name) && this._params2dQuick2.push(t); } return this._params2dQuick2; }, e.create = function(t, i, n, s) { return new e(t, i, n, s); }, e; }(Kt), Jt = function(t) { function e(t) { this._uint8Array = null, this._uint16Array = null, void 0 === t && (t = 35044), e.__super.call(this), this._bufferUsage = t, this._bufferType = 34963, C.isFlash || (this._buffer = new ArrayBuffer(8)); } s(e, "laya.webgl.utils.IndexBuffer2D", $t); var i = e.prototype; return i._checkArrayUse = function() { this._uint8Array && (this._uint8Array = new Uint8Array(this._buffer)), this._uint16Array && (this._uint16Array = new Uint16Array(this._buffer)); }, i.getUint8Array = function() { return this._uint8Array || (this._uint8Array = new Uint8Array(this._buffer)); }, i.getUint16Array = function() { return this._uint16Array || (this._uint16Array = new Uint16Array(this._buffer)); }, i.destory = function() { this._uint16Array = null, this._uint8Array = null, this._buffer = null; }, e.QuadrangleIB = null, e.create = function(t) { return void 0 === t && (t = 35044), new e(t); }, e; }(), Qt = function(t) { function e(t, i) { this._floatArray32 = null, this._vertexStride = 0, e.__super.call(this), this._vertexStride = t, this._bufferUsage = i, this._bufferType = 34962, C.isFlash || (this._buffer = new ArrayBuffer(8)), this.getFloat32Array(); } s(e, "laya.webgl.utils.VertexBuffer2D", t); var i = e.prototype; return i.getFloat32Array = function() { return this._floatArray32 || (this._floatArray32 = new Float32Array(this._buffer)); }, i.bind = function(t) { t && t._bind(), this._bind(); }, i.insertData = function(t, e) { this.getFloat32Array().set(t, e), this._upload = !0; }, i.bind_upload = function(t) { t._bind_upload() || t._bind(), this._bind_upload() || this._bind(); }, i._checkArrayUse = function() { this._floatArray32 && (this._floatArray32 = new Float32Array(this._buffer)); }, i.disposeResource = function() { return void t.prototype.disposeResource.call(this); }, i.destory = function() { this._byteLength = 0, this._upload = !0, this._buffer = null, this._floatArray32 = null; }, a(0, i, "vertexStride", function() { return this._vertexStride; }), e.create = function(t, i) { return void 0 === i && (i = 35048), new e(t, i); }, e; }($t), te = function(t) { function e(t, i, n, s) { if (this._format = 0, this._mipmap = !1, this._allowMerageInAtlas = !1, this._enableMerageInAtlas = !1, this.repeat = !1, this._image = null, this.minFifter = 0, this.magFifter = 0, void 0 === n && (n = 6408), void 0 === s && (s = !0), e.__super.call(this, t, i), this._format = n, this._mipmap = s, this.repeat = !1, this.minFifter = -1, this.magFifter = -1, "string" == typeof t) this._url = t, this._src = t, this._image = new u.window.Image(), i && (i.onload && (this.onload = i.onload), i.onerror && (this.onerror = i.onerror), i.onCreate && i.onCreate(this)), this._image.crossOrigin = t && 0 == t.indexOf("data:") ? null : "", t && (this._image.src = t); else if (t instanceof ArrayBuffer) { this._src = i, this._url = this._src; var a = new c(t); a.readUTFBytes(4), a.readUTFBytes(2), a.getInt16(); a.endian = "bigEndian", this._w = a.getInt16(), this._h = a.getInt16(); a.getInt16(), a.getInt16(); this._image = new Uint8Array(t, a.pos), this._format = xt.compressEtc1.COMPRESSED_RGB_ETC1_WEBGL, U.enabled && this._w < U.atlasLimitWidth && this._h < U.atlasLimitHeight ? this._allowMerageInAtlas = !0 : this._allowMerageInAtlas = !1; } else this._src = i, this._url = this._src, this._image = t.source || t, this.onresize(); this._$5__enableMerageInAtlas = !0; } s(e, "laya.webgl.resource.WebGLImage", v); var n = e.prototype; return i.imps(n, { "laya.webgl.resource.IMergeAtlasBitmap": !0 }), n._init_ = function(t, e) {}, n._createWebGlTexture = function() { if (!this._image) throw "create GLTextur err:no data:" + this._image; var t = xt.mainContext, e = this._source = t.createTexture(), i = bt.curBindTexTarget, n = bt.curBindTexValue; if (bt.bindTexture(t, 3553, e), C.isConchWebGL) switch (this._format) { case 6408: t.texImage2DEx(!0, 3553, 0, this._format, 6408, 5121, this._image); break; case xt.compressEtc1.COMPRESSED_RGB_ETC1_WEBGL: t.compressedTexImage2D(3553, 0, this._format, this._w, this._h, 0, this._image); } else { switch (t.pixelStorei(37441, !0), this._format) { case 6408: t.texImage2D(3553, 0, this._format, 6408, 5121, this._image); break; case xt.compressEtc1.COMPRESSED_RGB_ETC1_WEBGL: t.compressedTexImage2D(3553, 0, this._format, this._w, this._h, 0, this._image); } t.pixelStorei(37441, !1); } var s = this.minFifter, a = this.magFifter, r = this.repeat ? 10497 : 33071, h = o.isPOT(this._w, this._h); h ? (this.mipmap ? -1 !== s || (s = 9987) : -1 !== s || (s = 9729), -1 !== a || (a = 9729), t.texParameteri(3553, 10241, s), t.texParameteri(3553, 10240, a), t.texParameteri(3553, 10242, r), t.texParameteri(3553, 10243, r), this.mipmap && t.generateMipmap(3553)) : (-1 !== s || (s = 9729), -1 !== a || (a = 9729), t.texParameteri(3553, 10241, s), t.texParameteri(3553, 10240, a), t.texParameteri(3553, 10242, 33071), t.texParameteri(3553, 10243, 33071)), i && n && bt.bindTexture(t, i, n), this._image.onload = null, this._image = null, h && this.mipmap ? this.memorySize = this._w * this._h * 4 * (1 + 1 / 3) : this.memorySize = this._w * this._h * 4, this._recreateLock = !1; }, n.recreateResource = function() { var t = this; if (null != this._src && "" !== this._src) if (this._needReleaseAgain = !1, this._image) { if (this._recreateLock) return; this._allowMerageInAtlas && this._$5__enableMerageInAtlas ? (this.memorySize = 0, this._recreateLock = !1) : this._createWebGlTexture(), this.completeCreate(); } else { this._recreateLock = !0; var e = this; this._image = new u.window.Image(), this._image.crossOrigin = 0 == this._src.indexOf("data:") ? null : "", this._image.onload = function() { if (e._needReleaseAgain) return e._needReleaseAgain = !1, e._image.onload = null, void (e._image = null); e._allowMerageInAtlas && e._enableMerageInAtlas ? (t.memorySize = 0, t._recreateLock = !1) : e._createWebGlTexture(), e.completeCreate(); }, this._image.src = this._src; } }, n.disposeResource = function() { this._recreateLock && (this._needReleaseAgain = !0), this._source && (xt.mainContext.deleteTexture(this._source), this._source = null, this._image = null, this.memorySize = 0); }, n.onresize = function() { this._w = this._image.width, this._h = this._image.height, U.enabled && this._w < U.atlasLimitWidth && this._h < U.atlasLimitHeight ? this._allowMerageInAtlas = !0 : this._allowMerageInAtlas = !1; }, n.clearAtlasSource = function() { this._image = null; }, a(0, n, "format", function() { return this._format; }), a(0, n, "enableMerageInAtlas", function() { return this._$5__enableMerageInAtlas; }, function(t) { this._$5__enableMerageInAtlas = t; }), a(0, n, "mipmap", function() { return this._mipmap; }), a(0, n, "allowMerageInAtlas", function() { return this._allowMerageInAtlas; }), a(0, n, "atlasSource", function() { return this._image; }), a(0, n, "onload", null, function(t) { var e = this; this._onload = t, this._image && (this._image.onload = null != this._onload ? function() { e.onresize(), e._onload(); } : null); }), a(0, n, "onerror", null, function(t) { var e = this; this._onerror = t, this._image && (this._image.onerror = null != this._onerror ? function() { e._onerror(); } : null); }), e; }(); i.__init([ dt, z, Ct, yt ]); }(window, document, Laya), "function" == typeof define && define.amd && define("laya.core", [ "require", "exports" ], function(t, e) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }); for (var i in Laya) { var n = Laya[i]; n && n.__isclass && (e[i] = n); } }), function(t, e, i) { i.un, i.uns; var n = i.static, s = i.class, a = i.getset, r = i.__newvec, o = laya.maths.Bezier, h = laya.utils.Browser, l = laya.utils.Byte, u = (laya.events.Event, laya.events.EventDispatcher), c = laya.display.Graphics, _ = laya.resource.HTMLCanvas, d = laya.utils.Handler, p = laya.net.Loader, f = laya.maths.MathUtil, g = laya.maths.Matrix, m = (laya.display.Node, laya.maths.Point, laya.maths.Rectangle), v = laya.renders.Render, y = (laya.renders.RenderContext, laya.resource.Resource), x = laya.utils.RunDriver, b = (laya.media.SoundChannel, laya.media.SoundManager), w = laya.display.Sprite, C = laya.utils.Stat, S = laya.resource.Texture, T = (laya.net.URL, laya.utils.Utils), I = function() { function t() { this.nodes = null, this.name = null, this.playTime = NaN, this.bone3DMap = null, this.totalKeyframeDatasLength = 0; } return s(t, "laya.ani.AnimationContent"), t; }(), M = function() { function t() { this.name = null, this.parentIndex = 0, this.parent = null, this.keyframeWidth = 0, this.lerpType = 0, this.interpolationMethod = null, this.childs = null, this.keyFrame = null, this.playTime = NaN, this.extenData = null, this.dataOffset = 0; } return s(t, "laya.ani.AnimationNodeContent"), t; }(), E = function() { function t() {} return s(t, "laya.ani.AnimationParser01"), t.parse = function(t, e) { var i = e.__getBuffer(), n = 0, s = 0, a = 0, r = 0, o = 0, h = 0, u = 0, c = e.readUTFString(); t._aniClassName = c; var _, d = e.readUTFString().split("\n"), p = e.getUint8(), f = e.getUint32(), g = e.getUint32(); f > 0 && (_ = i.slice(f, g)); var m = new l(_); for (g > 0 && (t._publicExtData = i.slice(g, i.byteLength)), t._useParent = !!e.getUint8(), t._anis.length = p, n = 0; n < p; n++) { var v = t._anis[n] = new I(); v.nodes = new Array(); var y = v.name = d[e.getUint16()]; t._aniMap[y] = n, v.bone3DMap = {}, v.playTime = e.getFloat32(); var x = v.nodes.length = e.getUint8(); for (v.totalKeyframeDatasLength = 0, s = 0; s < x; s++) { var b = v.nodes[s] = new M(); b.childs = []; var w = e.getInt16(); w >= 0 && (b.name = d[w], v.bone3DMap[b.name] = s), b.keyFrame = new Array(), b.parentIndex = e.getInt16(), -1 == b.parentIndex ? b.parent = null : b.parent = v.nodes[b.parentIndex], b.lerpType = e.getUint8(); var C = e.getUint32(); m.pos = C; var S = b.keyframeWidth = m.getUint16(); if (v.totalKeyframeDatasLength += S, 0 === b.lerpType || 1 === b.lerpType) for (b.interpolationMethod = [], b.interpolationMethod.length = S, a = 0; a < S; a++) b.interpolationMethod[a] = it.interpolation[m.getUint8()]; null != b.parent && b.parent.childs.push(b); var T = e.getUint16(); T > 0 && (b.extenData = i.slice(e.pos, e.pos + T), e.pos += T); var E = e.getUint16(); b.keyFrame.length = E; var A, L = 0; for (a = 0, r = E; a < r; a++) { if (A = b.keyFrame[a] = new Z(), A.duration = e.getFloat32(), A.startTime = L, 2 === b.lerpType) { A.interpolationData = []; var P = e.getUint8(), k = 0; switch (k = e.getFloat32()) { case 254: for (A.interpolationData.length = S, u = 0; u < S; u++) A.interpolationData[u] = 0; break; case 255: for (A.interpolationData.length = S, u = 0; u < S; u++) A.interpolationData[u] = 5; break; default: for (A.interpolationData.push(k), h = 1; h < P; h++) A.interpolationData.push(e.getFloat32()); } } for (A.data = new Float32Array(S), o = 0; o < S; o++) A.data[o] = e.getFloat32(), A.data[o] > -1e-8 && A.data[o] < 1e-8 && (A.data[o] = 0); L += A.duration; } A.startTime = v.playTime, b.playTime = v.playTime, t._calculateKeyFrame(b, E, S); } } }, t; }(), A = function() { function t() {} return s(t, "laya.ani.AnimationParser02"), t.READ_DATA = function() { t._DATA.offset = t._reader.getUint32(), t._DATA.size = t._reader.getUint32(); }, t.READ_BLOCK = function() { for (var e = t._BLOCK.count = t._reader.getUint16(), i = t._BLOCK.blockStarts = [], n = t._BLOCK.blockLengths = [], s = 0; s < e; s++) i.push(t._reader.getUint32()), n.push(t._reader.getUint32()); }, t.READ_STRINGS = function() { var e = t._reader.getUint32(), i = t._reader.getUint16(), n = t._reader.pos; t._reader.pos = e + t._DATA.offset; for (var s = 0; s < i; s++) t._strings[s] = t._reader.readUTFString(); t._reader.pos = n; }, t.parse = function(e, i) { t._templet = e, t._reader = i; i.__getBuffer(); t.READ_DATA(), t.READ_BLOCK(), t.READ_STRINGS(); for (var n = 0, s = t._BLOCK.count; n < s; n++) { var a = i.getUint16(), r = t._strings[a], o = t["READ_" + r]; if (null == o) throw new Error("model file err,no this function:" + a + " " + r); o.call(); } }, t.READ_ANIMATIONS = function() { var e = t._reader, i = e.__getBuffer(), n = 0, s = 0, a = 0, r = 0, o = e.getUint16(), h = []; for (h.length = o, n = 0; n < o; n++) h[n] = it.interpolation[e.getByte()]; var l = e.getUint8(); for (t._templet._anis.length = l, n = 0; n < l; n++) { var u = t._templet._anis[n] = {}; u.nodes = new Array(); var c = u.name = t._strings[e.getUint16()]; t._templet._aniMap[c] = n, u.bone3DMap = {}, u.playTime = e.getFloat32(); var _ = u.nodes.length = e.getInt16(); for (u.totalKeyframeDatasLength = 0, s = 0; s < _; s++) { var d = u.nodes[s] = {}; d.keyframeWidth = o, d.childs = []; var p = e.getUint16(); p >= 0 && (d.name = t._strings[p], u.bone3DMap[d.name] = s), d.keyFrame = new Array(), d.parentIndex = e.getInt16(), -1 == d.parentIndex ? d.parent = null : d.parent = u.nodes[d.parentIndex], u.totalKeyframeDatasLength += o, d.interpolationMethod = h, null != d.parent && d.parent.childs.push(d); var f = e.getUint16(); d.keyFrame.length = f; var g = null, m = null; for (a = 0, r = f; a < r; a++) { (g = d.keyFrame[a] = {}).startTime = e.getFloat32(), m && (m.duration = g.startTime - m.startTime); var v = t._DATA.offset, y = e.getUint32(), x = 4 * o, b = i.slice(v + y, v + y + x); g.data = new Float32Array(b), m = g; } g.duration = 0, d.playTime = u.playTime, t._templet._calculateKeyFrame(d, f, o); } } }, t._templet = null, t._reader = null, t._strings = [], n(t, [ "_BLOCK", function() { return this._BLOCK = { count: 0 }; }, "_DATA", function() { return this._DATA = { offset: 0, size: 0 }; } ]), t; }(), L = (function() { function t() {} s(t, "laya.ani.AnimationState"), t.stopped = 0, t.paused = 1, t.playing = 2; }(), function() { function t() { this.name = null, this.root = null, this.parentBone = null, this.length = 10, this.transform = null, this.inheritScale = !0, this.inheritRotation = !0, this.rotation = NaN, this.resultRotation = NaN, this.d = -1, this._tempMatrix = null, this._sprite = null, this.resultTransform = new $(), this.resultMatrix = new g(), this._children = []; } s(t, "laya.ani.bone.Bone"); var e = t.prototype; return e.setTempMatrix = function(t) { this._tempMatrix = t; var e = 0, i = 0; for (e = 0, i = this._children.length; e < i; e++) this._children[e].setTempMatrix(this._tempMatrix); }, e.update = function(t) { if(!this.transform.hasOwnProperty("skX")){ this.transform.skX = 0; } this.rotation = this.transform.skX; var e; if (t) e = this.resultTransform.getMatrix(), g.mul(e, t, this.resultMatrix), this.resultRotation = this.rotation; else if (this.resultRotation = this.rotation + this.parentBone.resultRotation, this.parentBone) if (this.inheritRotation && this.inheritScale) e = this.resultTransform.getMatrix(), g.mul(e, this.parentBone.resultMatrix, this.resultMatrix); else { var i = this.parentBone, n = NaN, s = NaN, a = NaN, r = this.parentBone.resultMatrix; e = this.resultTransform.getMatrix(); var o = r.a * e.tx + r.c * e.ty + r.tx, h = r.b * e.tx + r.d * e.ty + r.ty, l = new g(); this.inheritRotation ? (n = Math.atan2(i.resultMatrix.b, i.resultMatrix.a), s = Math.cos(n), a = Math.sin(n), l.setTo(s, a, -a, s, 0, 0), g.mul(this._tempMatrix, l, g.TEMP), g.TEMP.copyTo(l), e = this.resultTransform.getMatrix(), g.mul(e, l, this.resultMatrix), this.resultTransform.scX * this.resultTransform.scY < 0 && this.resultMatrix.rotate(.5 * Math.PI), this.resultMatrix.tx = o, this.resultMatrix.ty = h) : (this.inheritScale, e = this.resultTransform.getMatrix(), g.TEMP.identity(), g.TEMP.d = this.d, g.mul(e, g.TEMP, this.resultMatrix), this.resultMatrix.tx = o, this.resultMatrix.ty = h); } else (e = this.resultTransform.getMatrix()).copyTo(this.resultMatrix); var u = 0, c = 0; for (u = 0, c = this._children.length; u < c; u++) this._children[u].update(); }, e.updateChild = function() { var t = 0, e = 0; for (t = 0, e = this._children.length; t < e; t++) this._children[t].update(); }, e.setRotation = function(t) { this._sprite && (this._sprite.rotation = 180 * t / Math.PI); }, e.updateDraw = function(e, n) { t.ShowBones && !t.ShowBones[this.name] || (this._sprite ? (this._sprite.x = e + this.resultMatrix.tx, this._sprite.y = n + this.resultMatrix.ty) : (this._sprite = new w(), this._sprite.graphics.drawCircle(0, 0, 5, "#ff0000"), this._sprite.graphics.drawLine(0, 0, this.length, 0, "#00ff00"), this._sprite.graphics.fillText(this.name, 0, 0, "20px Arial", "#00ff00", "center"), i.stage.addChild(this._sprite), this._sprite.x = e + this.resultMatrix.tx, this._sprite.y = n + this.resultMatrix.ty)); var s = 0, a = 0; for (s = 0, a = this._children.length; s < a; s++) this._children[s].updateDraw(e, n); }, e.addChild = function(t) { this._children.push(t), t.parentBone = this; }, e.findBone = function(t) { if (this.name == t) return this; var e, i, n = 0, s = 0; for (n = 0, s = this._children.length; n < s; n++) if (e = this._children[n], i = e.findBone(t)) return i; return null; }, e.localToWorld = function(t) { var e = t[0], i = t[1]; t[0] = e * this.resultMatrix.a + i * this.resultMatrix.c + this.resultMatrix.tx, t[1] = e * this.resultMatrix.b + i * this.resultMatrix.d + this.resultMatrix.ty; }, t.ShowBones = {}, t; }()), P = function() { function t() { this.name = null, this.parent = null, this.attachmentName = null, this.srcDisplayIndex = -1, this.type = "src", this.templet = null, this.currSlotData = null, this.currTexture = null, this.currDisplayData = null, this.displayIndex = -1, this.originalIndex = -1, this._diyTexture = null, this._parentMatrix = null, this._resultMatrix = null, this._replaceDic = {}, this._curDiyUV = null, this._curDiyVS = null, this._skinSprite = null, this.deformData = null, this._mVerticleArr = null; } s(t, "laya.ani.bone.BoneSlot"); var e = t.prototype; return e.showSlotData = function(t, e) { void 0 === e && (e = !0), this.currSlotData = t, e && (this.displayIndex = this.srcDisplayIndex), this.currDisplayData = null, this.currTexture = null; }, e.showDisplayByName = function(t) { this.currSlotData && this.showDisplayByIndex(this.currSlotData.getDisplayByName(t)); }, e.replaceDisplayByName = function(t, e) { if (this.currSlotData) { var i = 0; i = this.currSlotData.getDisplayByName(t); var n = 0; n = this.currSlotData.getDisplayByName(e), this.replaceDisplayByIndex(i, n); } }, e.replaceDisplayByIndex = function(t, e) { this.currSlotData && (this._replaceDic[t] = e, this.originalIndex == t && this.showDisplayByIndex(t)); }, e.showDisplayByIndex = function(t) { if (this.originalIndex = t, null != this._replaceDic[t] && (t = this._replaceDic[t]), this.currSlotData && t > -1 && t < this.currSlotData.displayArr.length) { if (this.displayIndex = t, this.currDisplayData = this.currSlotData.displayArr[t], this.currDisplayData) { var e = this.currDisplayData.name; this.currTexture = this.templet.getTexture(e), this.currTexture && 0 == this.currDisplayData.type && this.currDisplayData.uvs && (!v.isConchApp || v.isConchApp && w.RUNTIMEVERION > "0.9.15") && (this.currTexture = this.currDisplayData.createTexture(this.currTexture)); } } else this.displayIndex = -1, this.currDisplayData = null, this.currTexture = null; }, e.replaceSkin = function(t) { this._diyTexture = t, this._curDiyUV && (this._curDiyUV.length = 0), this.currDisplayData && this._diyTexture == this.currDisplayData.texture && (this._diyTexture = null); }, e.setParentMatrix = function(t) { this._parentMatrix = t; }, e.draw = function(e, i, n, s) { if (void 0 === n && (n = !1), void 0 === s && (s = 1), (null != this._diyTexture || null != this.currTexture) && null != this.currDisplayData || this.currDisplayData && 3 == this.currDisplayData.type) { var a = this.currTexture; this._diyTexture && (a = this._diyTexture); var r; switch (this.currDisplayData.type) { case 0: if (e) { var o = this.getDisplayMatrix(); if (this._parentMatrix) { var h = !1; if (o) { g.mul(o, this._parentMatrix, g.TEMP); var l; if (n ? (null == this._resultMatrix && (this._resultMatrix = new g()), l = this._resultMatrix) : l = new g(), !v.isWebGL && this.currDisplayData.uvs || v.isWebGL && this._diyTexture && this.currDisplayData.uvs) { var u = t._tempMatrix; u.identity(), this.currDisplayData.uvs[1] > this.currDisplayData.uvs[5] && (u.d = -1), this.currDisplayData.uvs[0] > this.currDisplayData.uvs[4] && this.currDisplayData.uvs[1] > this.currDisplayData.uvs[5] && (h = !0, u.rotate(-Math.PI / 2)), g.mul(u, g.TEMP, l); } else g.TEMP.copyTo(l); h ? e.drawTexture(a, -this.currDisplayData.height / 2, -this.currDisplayData.width / 2, this.currDisplayData.height, this.currDisplayData.width, l) : e.drawTexture(a, -this.currDisplayData.width / 2, -this.currDisplayData.height / 2, this.currDisplayData.width, this.currDisplayData.height, l); } } } break; case 1: if (n ? (null == this._skinSprite && (this._skinSprite = t.createSkinMesh()), r = this._skinSprite) : r = t.createSkinMesh(), null == r) return; var c; if (null == this.currDisplayData.bones) { var _ = this.currDisplayData.weights; this.deformData && (_ = this.deformData); var d; this._diyTexture ? (this._curDiyUV || (this._curDiyUV = []), 0 == this._curDiyUV.length && (this._curDiyUV = q.getRelativeUV(this.currTexture.uv, this.currDisplayData.uvs, this._curDiyUV), this._curDiyUV = q.getAbsoluteUV(this._diyTexture.uv, this._curDiyUV, this._curDiyUV)), d = this._curDiyUV) : d = this.currDisplayData.uvs, this._mVerticleArr = _; this.currDisplayData.triangles.length; c = this.currDisplayData.triangles, r.init2(a, null, c, this._mVerticleArr, d); var p = this.getDisplayMatrix(); if (this._parentMatrix && p) { g.mul(p, this._parentMatrix, g.TEMP); var f; n ? (null == this._resultMatrix && (this._resultMatrix = new g()), f = this._resultMatrix) : f = new g(), g.TEMP.copyTo(f), r.transform = f; } } else this.skinMesh(i, r, s); e.drawSkin(r); break; case 2: if (n ? (null == this._skinSprite && (this._skinSprite = t.createSkinMesh()), r = this._skinSprite) : r = t.createSkinMesh(), null == r) return; this.skinMesh(i, r, s), e.drawSkin(r); } } }, e.skinMesh = function(t, e, i) { var n, s = this.currTexture, a = this.currDisplayData.bones; this._diyTexture ? (s = this._diyTexture, this._curDiyUV || (this._curDiyUV = []), 0 == this._curDiyUV.length && (this._curDiyUV = q.getRelativeUV(this.currTexture.uv, this.currDisplayData.uvs, this._curDiyUV), this._curDiyUV = q.getAbsoluteUV(this._diyTexture.uv, this._curDiyUV, this._curDiyUV)), n = this._curDiyUV) : n = this.currDisplayData.uvs; var r, o, h = this.currDisplayData.weights, l = this.currDisplayData.triangles, u = 0, c = 0, _ = 0, d = NaN, p = NaN, f = 0, g = 0, m = [], v = 0, y = 0; if (this.deformData && this.deformData.length > 0) { var x = 0; for (v = 0, y = a.length; v < y; ) { for (_ = a[v++] + v, u = 0, c = 0; v < _; v++) o = t[a[v]], d = h[f] + this.deformData[x++], p = h[f + 1] + this.deformData[x++], g = h[f + 2], u += (d * o.a + p * o.c + o.tx) * g, c += (d * o.b + p * o.d + o.ty) * g, f += 3; m.push(u, c); } } else for (v = 0, y = a.length; v < y; ) { for (_ = a[v++] + v, u = 0, c = 0; v < _; v++) o = t[a[v]], d = h[f], p = h[f + 1], g = h[f + 2], u += (d * o.a + p * o.c + o.tx) * g, c += (d * o.b + p * o.d + o.ty) * g, f += 3; m.push(u, c); } this._mVerticleArr = m, r = l, e.init2(s, null, r, this._mVerticleArr, n); }, e.drawBonePoint = function(t) { t && this._parentMatrix && t.drawCircle(this._parentMatrix.tx, this._parentMatrix.ty, 5, "#ff0000"); }, e.getDisplayMatrix = function() { return this.currDisplayData ? this.currDisplayData.transform.getMatrix() : null; }, e.getMatrix = function() { return this._resultMatrix; }, e.copy = function() { var e = new t(); return e.type = "copy", e.name = this.name, e.attachmentName = this.attachmentName, e.srcDisplayIndex = this.srcDisplayIndex, e.parent = this.parent, e.displayIndex = this.displayIndex, e.templet = this.templet, e.currSlotData = this.currSlotData, e.currTexture = this.currTexture, e.currDisplayData = this.currDisplayData, e; }, t.createSkinMesh = function() { return v.isWebGL || v.isConchApp ? x.skinAniSprite() : v.isWebGL ? null : st.useSimpleMeshInCanvas ? new nt() : new et(); }, n(t, [ "_tempMatrix", function() { return this._tempMatrix = new g(); } ]), t; }(), k = function() { function t() { this.mesh = null, this.transform = null, this.context = null, this.mode = 0; } s(t, "laya.ani.bone.canvasmesh.CanvasMeshRender"); var e = t.prototype; return e.renderToContext = function(t) { this.context = t.ctx || t, this.mesh && (0 == this.mode ? this._renderWithIndexes(this.mesh) : this._renderNoIndexes(this.mesh)); }, e._renderNoIndexes = function(t) { var e = 0, i = t.vertices.length / 2, n = 0; for (e = 0; e < i - 2; e++) n = 2 * e, this._renderDrawTriangle(t, n, n + 2, n + 4); }, e._renderWithIndexes = function(t) { var e = t.indexes, i = 0, n = e.length; for (i = 0; i < n; i += 3) { var s = 2 * e[i], a = 2 * e[i + 1], r = 2 * e[i + 2]; this._renderDrawTriangle(t, s, a, r); } }, e._renderDrawTriangle = function(t, e, i, n) { var s = this.context, a = t.uvs, r = t.vertices, o = t.texture, h = o.bitmap, l = h.source, u = o.width, c = o.height, _ = h.width, d = h.height, p = NaN, f = NaN, g = NaN, m = NaN, v = NaN, y = NaN; if (t.useUvTransform) { var x = t.uvTransform; p = (a[e] * x.a + a[e + 1] * x.c + x.tx) * _, f = (a[i] * x.a + a[i + 1] * x.c + x.tx) * _, g = (a[n] * x.a + a[n + 1] * x.c + x.tx) * _, m = (a[e] * x.b + a[e + 1] * x.d + x.ty) * d, v = (a[i] * x.b + a[i + 1] * x.d + x.ty) * d, y = (a[n] * x.b + a[n + 1] * x.d + x.ty) * d; } else p = a[e] * _, f = a[i] * _, g = a[n] * _, m = a[e + 1] * d, v = a[i + 1] * d, y = a[n + 1] * d; var b = r[e], w = r[i], C = r[n], S = r[e + 1], T = r[i + 1], I = r[n + 1]; if (t.canvasPadding > 0) { var M = t.canvasPadding, E = t.canvasPadding, A = (b + w + C) / 3, L = (S + T + I) / 3, P = b - A, k = S - L, R = Math.sqrt(P * P + k * k); b = A + P / R * (R + M), S = L + k / R * (R + E), k = T - L, w = A + (P = w - A) / (R = Math.sqrt(P * P + k * k)) * (R + M), T = L + k / R * (R + E), k = I - L, C = A + (P = C - A) / (R = Math.sqrt(P * P + k * k)) * (R + M), I = L + k / R * (R + E); } if (s.save(), this.transform) { var D = this.transform; s.transform(D.a, D.b, D.c, D.d, D.tx, D.ty); } s.beginPath(), s.moveTo(b, S), s.lineTo(w, T), s.lineTo(C, I), s.closePath(), s.clip(); var N = 1 / (p * v + m * g + f * y - v * g - m * f - p * y), F = b * v + m * C + w * y - v * C - m * w - b * y, B = p * w + b * g + f * C - w * g - b * f - p * C, O = p * v * C + m * w * g + b * f * y - b * v * g - m * f * C - p * w * y, z = S * v + m * I + T * y - v * I - m * T - S * y, U = p * T + S * g + f * I - T * g - S * f - p * I, V = p * v * I + m * T * g + S * f * y - S * v * g - m * f * I - p * T * y; s.transform(F * N, z * N, B * N, U * N, O * N, V * N), s.drawImage(l, o.uv[0] * _, o.uv[1] * d, u, c, o.uv[0] * _, o.uv[1] * d, u, c), s.restore(); }, t; }(), R = function() { function t() { this.texture = null, this.uvs = [ 0, 0, 1, 0, 1, 1, 0, 1 ], this.vertices = [ 0, 0, 100, 0, 100, 100, 0, 100 ], this.indexes = [ 0, 1, 3, 3, 1, 2 ], this.uvTransform = null, this.useUvTransform = !1, this.canvasPadding = 1; } s(t, "laya.ani.bone.canvasmesh.MeshData"); return t.prototype.getBounds = function() { return m._getWrapRec(this.vertices); }, t; }(), D = function() { function t() { this.skinName = null, this.deformSlotDataList = []; } return s(t, "laya.ani.bone.DeformAniData"), t; }(), N = function() { function t() { this.deformSlotDisplayList = []; } return s(t, "laya.ani.bone.DeformSlotData"), t; }(), F = function() { function t() { this.boneSlot = null, this.slotIndex = -1, this.attachment = null, this.deformData = null, this.frameIndex = 0, this.timeList = [], this.vectices = [], this.tweenKeyList = []; } s(t, "laya.ani.bone.DeformSlotDisplayData"); var e = t.prototype; return e.binarySearch1 = function(t, e) { var i = 0, n = t.length - 2; if (0 == n) return 1; for (var s = n >>> 1; ;) { if (t[Math.floor(s + 1)] <= e ? i = s + 1 : n = s, i == n) return i + 1; s = i + n >>> 1; } return 0; }, e.apply = function(t, e, i) { if (void 0 === i && (i = 1), t += .05, !(this.timeList.length <= 0)) { var n = 0; if (!(t < this.timeList[0])) { var s = this.vectices[0].length, a = [], r = this.binarySearch1(this.timeList, t); if (this.frameIndex = r, t >= this.timeList[this.timeList.length - 1]) { var o = this.vectices[this.vectices.length - 1]; if (i < 1) for (n = 0; n < s; n++) a[n] += (o[n] - a[n]) * i; else for (n = 0; n < s; n++) a[n] = o[n]; this.deformData = a; } else { this.tweenKeyList[this.frameIndex]; var h = this.vectices[this.frameIndex - 1], l = this.vectices[this.frameIndex], u = this.timeList[this.frameIndex - 1], c = this.timeList[this.frameIndex]; i = this.tweenKeyList[r - 1] ? (t - u) / (c - u) : 0; var _ = NaN; for (n = 0; n < s; n++) _ = h[n], a[n] = _ + (l[n] - _) * i; this.deformData = a; } } } }, t; }(), B = function() { function t() { this.time = NaN, this.drawOrder = []; } return s(t, "laya.ani.bone.DrawOrderData"), t; }(), O = function() { function t() { this.name = null, this.intValue = 0, this.floatValue = NaN, this.stringValue = null, this.audioValue = null, this.time = NaN; } return s(t, "laya.ani.bone.EventData"), t; }(), z = function() { function t(t, e) { this._targetBone = null, this._bones = null, this._data = null, this.name = null, this.mix = NaN, this.bendDirection = NaN, this.isSpine = !0, this._sp = null, this.isDebug = !1, this._data = t, this._targetBone = e[t.targetBoneIndex], this.isSpine = t.isSpine, null == this._bones && (this._bones = []), this._bones.length = 0; for (var i = 0, n = t.boneIndexs.length; i < n; i++) this._bones.push(e[t.boneIndexs[i]]); this.name = t.name, this.mix = t.mix, this.bendDirection = t.bendDirection; } s(t, "laya.ani.bone.IkConstraint"); var e = t.prototype; return e.apply = function() { switch (this._bones.length) { case 1: this._applyIk1(this._bones[0], this._targetBone.resultMatrix.tx, this._targetBone.resultMatrix.ty, this.mix); break; case 2: this.isSpine ? this._applyIk2(this._bones[0], this._bones[1], this._targetBone.resultMatrix.tx, this._targetBone.resultMatrix.ty, this.bendDirection, this.mix) : this._applyIk3(this._bones[0], this._bones[1], this._targetBone.resultMatrix.tx, this._targetBone.resultMatrix.ty, this.bendDirection, this.mix); } }, e._applyIk1 = function(e, i, n, s) { var a = e.parentBone, r = 1 / (a.resultMatrix.a * a.resultMatrix.d - a.resultMatrix.b * a.resultMatrix.c), o = i - a.resultMatrix.tx, h = n - a.resultMatrix.ty, l = (o * a.resultMatrix.d - h * a.resultMatrix.c) * r - e.transform.x, u = (h * a.resultMatrix.a - o * a.resultMatrix.b) * r - e.transform.y, c = Math.atan2(u, l) * t.radDeg - 0 - e.transform.skX; e.transform.scX < 0 && (c += 180), c > 180 ? c -= 360 : c < -180 && (c += 360), e.transform.skX = e.transform.skY = e.transform.skX + c * s, e.update(); }, e.updatePos = function(t, e) { this._sp && this._sp.pos(t, e); }, e._applyIk2 = function(e, n, s, a, r, o) { if (0 != o) { var h = e.resultTransform.x, l = e.resultTransform.y, u = e.transform.scX, c = e.transform.scY, _ = n.transform.scX, d = 0, p = 0, f = 0; u < 0 ? (u = -u, d = 180, f = -1) : (d = 0, f = 1), c < 0 && (c = -c, f = -f), _ < 0 ? (_ = -_, p = 180) : p = 0; var g = n.resultTransform.x, m = NaN, v = NaN, y = NaN, x = e.resultMatrix.a, b = e.resultMatrix.c, C = e.resultMatrix.b, S = e.resultMatrix.d, T = Math.abs(u - c) <= 1e-4; T ? (v = x * g + b * (m = n.resultTransform.y) + e.resultMatrix.tx, y = C * g + S * m + e.resultMatrix.ty) : (m = 0, v = x * g + e.resultMatrix.tx, y = C * g + e.resultMatrix.ty), this.isDebug && (this._sp || (this._sp = new w(), i.stage.addChild(this._sp)), this._sp.graphics.clear(), this._sp.graphics.drawCircle(s, a, 15, "#ffff00"), this._sp.graphics.drawCircle(v, y, 15, "#ff00ff")), e.setRotation(Math.atan2(y - e.resultMatrix.ty, v - e.resultMatrix.tx)); var I = e.parentBone; x = I.resultMatrix.a, b = I.resultMatrix.c, C = I.resultMatrix.b; var M = 1 / (x * (S = I.resultMatrix.d) - b * C), E = s - I.resultMatrix.tx, A = a - I.resultMatrix.ty, L = (E * S - A * b) * M - h, P = (A * x - E * C) * M - l, k = ((E = v - I.resultMatrix.tx) * S - (A = y - I.resultMatrix.ty) * b) * M - h, R = (A * x - E * C) * M - l, D = Math.sqrt(k * k + R * R), N = n.length * _, F = NaN, B = NaN; if (T) { var O = (L * L + P * P - D * D - (N *= u) * N) / (2 * D * N); O < -1 ? O = -1 : O > 1 && (O = 1), B = Math.acos(O) * r, x = D + N * O, b = N * Math.sin(B), F = Math.atan2(P * x - L * b, L * x + P * b); } else { var z = (x = u * N) * x, U = (b = c * N) * b, V = L * L + P * P, W = Math.atan2(P, L), G = -2 * U * D, H = U - z; if ((S = G * G - 4 * H * (C = U * D * D + z * V - z * U)) > 0) { var Y = Math.sqrt(S); G < 0 && (Y = -Y); var X = (Y = -(G + Y) / 2) / H, j = C / Y, K = Math.abs(X) < Math.abs(j) ? X : j; K * K <= V && (A = Math.sqrt(V - K * K) * r, F = W - Math.atan2(A, K), B = Math.atan2(A / c, (K - D) / u)); } var $ = 0, q = Number.MAX_VALUE, Z = 0, J = 0, Q = 0, tt = 0, et = 0, it = 0; (S = (E = D + x) * E) > tt && (Q = 0, tt = S, et = E), (S = (E = D - x) * E) < q && ($ = Math.PI, q = S, Z = E); var nt = Math.acos(-x * D / (z - U)); (S = (E = x * Math.cos(nt) + D) * E + (A = b * Math.sin(nt)) * A) < q && ($ = nt, q = S, Z = E, J = A), S > tt && (Q = nt, tt = S, et = E, it = A), V <= (q + tt) / 2 ? (F = W - Math.atan2(J * r, Z), B = $ * r) : (F = W - Math.atan2(it * r, et), B = Q * r); } var st = Math.atan2(m, g) * f, at = e.resultTransform.skX; (F = (F - st) * t.radDeg + d - at) > 180 ? F -= 360 : F < -180 && (F += 360), e.resultTransform.x = h, e.resultTransform.y = l, e.resultTransform.skX = e.resultTransform.skY = at + F * o, at = n.resultTransform.skX, (B = ((B + st) * t.radDeg - 0) * f + p - (at %= 360)) > 180 ? B -= 360 : B < -180 && (B += 360), n.resultTransform.x = g, n.resultTransform.y = m, n.resultTransform.skX = n.resultTransform.skY = n.resultTransform.skY + B * o, e.update(); } }, e._applyIk3 = function(e, n, s, a, r, o) { if (0 != o) { var h = NaN, l = NaN, u = n.resultMatrix.a * n.length, c = n.resultMatrix.b * n.length, _ = u * u + c * c, d = Math.sqrt(_), p = e.resultMatrix.tx, f = e.resultMatrix.ty, g = n.resultMatrix.tx, m = n.resultMatrix.ty, v = g - p, y = m - f, x = v * v + y * y, b = Math.sqrt(x), C = (v = s - e.resultMatrix.tx) * v + (y = a - e.resultMatrix.ty) * y, S = Math.sqrt(C); if (d + b <= S || S + d <= b || S + b <= d) { var T = NaN; g = p + (T = d + b <= S ? 1 : -1) * (s - p) * b / S, m = f + T * (a - f) * b / S; } else { var I = (x - _ + C) / (2 * C), M = Math.sqrt(x - I * I * C) / S, E = p + v * I, A = f + y * I, L = -y * M, P = v * M; r > 0 ? (g = E - L, m = A - P) : (g = E + L, m = A + P); } h = g, l = m, this.isDebug && (this._sp || (this._sp = new w(), i.stage.addChild(this._sp)), this._sp.graphics.clear(), this._sp.graphics.drawCircle(p, f, 15, "#ff00ff"), this._sp.graphics.drawCircle(s, a, 15, "#ffff00"), this._sp.graphics.drawCircle(h, l, 15, "#ff00ff")); var k = NaN; k = Math.atan2(l - e.resultMatrix.ty, h - e.resultMatrix.tx), e.setRotation(k); var R; (R = t._tempMatrix).identity(), R.rotate(k), R.scale(e.resultMatrix.getScaleX(), e.resultMatrix.getScaleY()), R.translate(e.resultMatrix.tx, e.resultMatrix.ty), R.copyTo(e.resultMatrix), e.updateChild(); var D = NaN; D = Math.atan2(a - l, s - h), n.setRotation(D); var N; (N = t._tempMatrix).identity(), N.rotate(D), N.scale(n.resultMatrix.getScaleX(), n.resultMatrix.getScaleY()), N.translate(h, l), R.copyTo(n.resultMatrix), n.updateChild(); } }, n(t, [ "radDeg", function() { return this.radDeg = 180 / Math.PI; }, "degRad", function() { return this.degRad = Math.PI / 180; }, "_tempMatrix", function() { return this._tempMatrix = new g(); } ]), t; }(), U = function() { function t() { this.name = null, this.targetBoneName = null, this.bendDirection = 1, this.mix = 1, this.isSpine = !0, this.targetBoneIndex = -1, this.boneNames = [], this.boneIndexs = []; } return s(t, "laya.ani.bone.IkConstraintData"), t; }(), V = function() { function t() {} return s(t, "laya.ani.bone.MeshTools"), t.findEdge = function(t, e, i) { void 0 === e && (e = 0), void 0 === i && (i = !0); var n = 0, s = 0, a = 0; for (s = t.length, a = -1, n = 0; n < s; n += 2) (a < 0 || i == t[a + e] < t[n + e]) && (a = n); return a; }, t.findBestTriangle = function(e) { var i = 0; i = t.findEdge(e, 1, !0); var n = 0; n = t.findEdge(e, 1, !1); var s = 0; s = t.findEdge(e, 0, !0); var a = 0; a = t.findEdge(e, 0, !1); var r; return r = t._bestTriangle, r.length = 0, r.push(s, a), r.indexOf(i) < 0 && r.push(i), r.indexOf(n) < 0 && r.push(n), r; }, t.solveMesh = function(e, i) { (i = i || []).length = 0; var n; n = e.uvs; var s; s = e.vertices; var a, r, o = 0, h = 0, l = 0; o = (r = t.findBestTriangle(n))[0], h = r[1], l = r[2], t._absArr.length = 0; return t.isNormalUV(e.texture.uv) && t.adptTexture(e), a = t.solvePoints(e.texture.uv, n[o], n[o + 1], n[h] - n[o], n[h + 1] - n[o + 1], n[l] - n[o], n[l + 1] - n[o + 1], t._absArr), t.transPoints(a, s[o], s[o + 1], s[h] - s[o], s[h + 1] - s[o + 1], s[l] - s[o], s[l + 1] - s[o + 1], i); }, t.findWrapRect = function(e) { var i = 0; i = t.findEdge(e, 1, !0); var n = 0; n = t.findEdge(e, 1, !1); var s = 0; s = t.findEdge(e, 0, !0); var a = 0; a = t.findEdge(e, 0, !1); var r = NaN; r = e[s]; var o = NaN; o = e[a]; var h = NaN; h = e[i + 1]; var l = NaN; return [ o, l = e[n + 1], r - o, h - l ]; }, t.adptTexture = function(e) { var i; i = t.findWrapRect(e.uvs); var n, s, a = (n = e.texture).width, r = n.height; s = S.create(n, i[0] * a, i[1] * r, i[2] * a, i[3] * r), e.texture = s; }, t.isNormalUV = function(t) { return 0 == t[0] && 0 == t[1] && 1 == t[4] && 1 == t[5]; }, t.solvePoints = function(e, i, n, s, a, r, o, h) { h = h || []; var l = 0, u = 0; u = e.length; var c; for (l = 0; l < u; l += 2) c = t.solve2(e[l], e[l + 1], i, n, s, a, r, o), h.push(c[0], c[1]); return h; }, t.transPoints = function(e, i, n, s, a, r, o, h) { h = h || []; var l = 0, u = 0; u = e.length; for (l = 0; l < u; l += 2) t.transPoint(e[l], e[l + 1], i, n, s, a, r, o, h); return h; }, t.transPoint = function(t, e, i, n, s, a, r, o, h) { var l = NaN, u = NaN; return l = i + s * t + r * e, u = n + a * t + o * e, (h = h || []).push(l, u), h; }, t.solve2 = function(e, i, n, s, a, r, o, h, l, u) { void 0 === l && (l = !1), u = u || []; var c = NaN, _ = NaN; if (0 == a) return t.solve2(e, i, n, s, o, h, a, r, !0, u); var d = NaN, p = NaN; return d = e - n, p = i - s, _ = (p - d * r / a) / (h - o * r / a), c = (d - _ * o) / a, l ? u.push(_, c) : u.push(c, _), u; }, t.solve = function(e, i, n, s) { return t.solve2(e.x, e.y, i.x, i.y, n.x, n.y, s.x, s.y); }, t._bestTriangle = [], t._absArr = [], t; }(), W = function() { function t(t, e) { this.target = null, this.data = null, this.bones = null, this.position = NaN, this.spacing = NaN, this.rotateMix = NaN, this.translateMix = NaN, this._debugKey = !1, this._spaces = null, this._segments = [], this._curves = [], this.data = t, this.position = t.position, this.spacing = t.spacing, this.rotateMix = t.rotateMix, this.translateMix = t.translateMix, this.bones = []; for (var i = this.data.bones, n = 0, s = i.length; n < s; n++) this.bones.push(e[i[n]]); } s(t, "laya.ani.bone.PathConstraint"); var e = t.prototype; return e.apply = function(t, e) { if (this.target) { var i = this.translateMix, n = this.translateMix, s = n > 0, a = this.data.spacingMode, r = "length" == a, o = this.data.rotateMode, h = "tangent" == o, l = "chainScale" == o, u = [], c = this.bones.length, _ = h ? c : c + 1, d = []; this._spaces = d, d[0] = this.position; var p = this.spacing; if (l || r) for (var f = 0, g = _ - 1; f < g; ) { var m = this.bones[f], v = m.length, y = v * m.resultMatrix.a, x = v * m.resultMatrix.b; v = Math.sqrt(y * y + x * x), l && (u[f] = v), d[++f] = r ? Math.max(0, v + p) : p; } else for (f = 1; f < _; f++) d[f] = p; var b = this.computeWorldPositions(this.target, t, e, _, h, "percent" == this.data.positionMode, "percent" == a); if (this._debugKey) { for (f = 0; f < b.length; f++) e.drawCircle(b[f++], b[f++], 5, "#00ff00"); var w = []; for (f = 0; f < b.length; f++) w.push(b[f++], b[f++]); e.drawLines(0, 0, w, "#ff0000"); } var C = b[0], S = b[1], T = this.data.offsetRotation, I = "chain" == o && 0 == T, M = NaN; for (f = 0, M = 3; f < c; f++, M += 3) { (m = this.bones[f]).resultMatrix.tx += (C - m.resultMatrix.tx) * i, m.resultMatrix.ty += (S - m.resultMatrix.ty) * i; var E = (y = b[M]) - C, A = (x = b[M + 1]) - S; if (l && 0 != (v = u[f])) { var L = (Math.sqrt(E * E + A * A) / v - 1) * n + 1; m.resultMatrix.a *= L, m.resultMatrix.c *= L; } if (C = y, S = x, s) { var P = m.resultMatrix.a, k = m.resultMatrix.c, R = m.resultMatrix.b, D = m.resultMatrix.d, N = NaN, F = NaN, B = NaN; N = h ? b[M - 1] : 0 == d[f + 1] ? b[M + 2] : Math.atan2(A, E), N -= Math.atan2(R, P) - T / 180 * Math.PI, I && (F = Math.cos(N), B = Math.sin(N), C += ((v = m.length) * (F * P - B * R) - E) * n, S += (v * (B * P + F * R) - A) * n), N > Math.PI ? N -= 2 * Math.PI : N < -Math.PI && (N += 2 * Math.PI), N *= n, F = Math.cos(N), B = Math.sin(N), m.resultMatrix.a = F * P - B * R, m.resultMatrix.c = F * k - B * D, m.resultMatrix.b = B * P + F * R, m.resultMatrix.d = B * k + F * D; } } } }, e.computeWorldVertices2 = function(e, i, n, s, a, r) { var o, h, l = e.currDisplayData.bones, u = e.currDisplayData.weights, c = e.currDisplayData.triangles, _ = 0, d = 0, p = 0, f = 0, g = 0, m = 0, v = 0, y = 0, x = 0, b = 0, w = 0; if (null != l) { for (_ = 0; _ < n; _ += 2) d += (f = l[d]) + 1, p += f; var C = i; for (g = r, m = 3 * p; g < s; g += 2) { for (v = 0, y = 0, f = l[d++], f += d; d < f; d++, m += 3) { o = C[l[d]].resultMatrix, x = u[m], b = u[m + 1]; var S = u[m + 2]; v += (x * o.a + b * o.c + o.tx) * S, y += (x * o.b + b * o.d + o.ty) * S; } a[g] = v, a[g + 1] = y; } } else { c || (c = u), e.deformData && (c = e.deformData); var T; if (T = e.parent, i) for (w = i.length, _ = 0; _ < w; _++) if (i[_].name == T) { h = i[_]; break; } var I; h && (I = h.resultMatrix), I || (I = t._tempMt); var M = I.tx, E = I.ty, A = I.a, L = I.b, P = I.c, k = I.d; for (h && (k *= h.d), d = n, g = r; g < s; d += 2, g += 2) x = c[d], b = c[d + 1], a[g] = x * A + b * L + M, a[g + 1] = -(x * P + b * k + E); } }, e.computeWorldPositions = function(t, e, i, n, s, a, r) { t.currDisplayData.bones, t.currDisplayData.weights, t.currDisplayData.triangles; var o = [], h = 0, l = t.currDisplayData.verLen, u = this.position, c = this._spaces, _ = [], d = [], p = l / 6, f = -1, g = NaN, m = 0, v = 0, y = NaN, x = NaN, b = NaN, w = NaN; if (p--, l -= 4, this.computeWorldVertices2(t, e, 2, l, o, 0), this._debugKey) for (h = 0; h < o.length; ) i.drawCircle(o[h++], o[h++], 10, "#ff0000"); _ = o, this._curves.length = p; var C = this._curves; g = 0; var S = _[0], T = _[1], I = 0, M = 0, E = 0, A = 0, L = 0, P = 0, k = NaN, R = NaN, D = NaN, N = NaN, F = NaN, B = NaN, O = NaN, z = NaN, U = 0; for (h = 0, U = 2; h < p; h++, U += 6) I = _[U], M = _[U + 1], E = _[U + 2], A = _[U + 3], F = 2 * (k = .1875 * (S - 2 * I + E)) + (D = .09375 * (3 * (I - E) - S + (L = _[U + 4]))), B = 2 * (R = .1875 * (T - 2 * M + A)) + (N = .09375 * (3 * (M - A) - T + (P = _[U + 5]))), O = .75 * (I - S) + k + .16666667 * D, z = .75 * (M - T) + R + .16666667 * N, g += Math.sqrt(O * O + z * z), O += F, z += B, F += D, B += N, g += Math.sqrt(O * O + z * z), O += F, z += B, g += Math.sqrt(O * O + z * z), O += F + D, z += B + N, g += Math.sqrt(O * O + z * z), C[h] = g, S = L, T = P; if (a && (u *= g), r) for (h = 0; h < n; h++) c[h] *= g; var V = this._segments, W = 0, G = 0; for (h = 0, m = 0, v = 0, G = 0; h < n; h++, m += 3) if (x = c[h], u += x, (y = u) < 0) this.addBeforePosition(y, _, 0, d, m); else if (y > g) this.addAfterPosition(y - g, _, l - 4, d, m); else { for (;;v++) if (w = C[v], !(y > w)) { 0 == v ? y /= w : y = (y - (b = C[v - 1])) / (w - b); break; } if (v != f) { f = v; var H = 6 * v; for (S = _[H], T = _[H + 1], I = _[H + 2], M = _[H + 3], E = _[H + 4], A = _[H + 5], F = 2 * (k = .03 * (S - 2 * I + E)) + (D = .006 * (3 * (I - E) - S + (L = _[H + 6]))), B = 2 * (R = .03 * (T - 2 * M + A)) + (N = .006 * (3 * (M - A) - T + (P = _[H + 7]))), O = .3 * (I - S) + k + .16666667 * D, z = .3 * (M - T) + R + .16666667 * N, W = Math.sqrt(O * O + z * z), V[0] = W, H = 1; H < 8; H++) O += F, z += B, F += D, B += N, W += Math.sqrt(O * O + z * z), V[H] = W; O += F, z += B, W += Math.sqrt(O * O + z * z), V[8] = W, O += F + D, z += B + N, W += Math.sqrt(O * O + z * z), V[9] = W, G = 0; } for (y *= W; ;G++) if (w = V[G], !(y > w)) { 0 == G ? y /= w : y = G + (y - (b = V[G - 1])) / (w - b); break; } this.addCurvePosition(.1 * y, S, T, I, M, E, A, L, P, d, m, s || h > 0 && 0 == x); } return d; }, e.addBeforePosition = function(t, e, i, n, s) { var a = e[i], r = e[i + 1], o = e[i + 2] - a, h = e[i + 3] - r, l = Math.atan2(h, o); n[s] = a + t * Math.cos(l), n[s + 1] = r + t * Math.sin(l), n[s + 2] = l; }, e.addAfterPosition = function(t, e, i, n, s) { var a = e[i + 2], r = e[i + 3], o = a - e[i], h = r - e[i + 1], l = Math.atan2(h, o); n[s] = a + t * Math.cos(l), n[s + 1] = r + t * Math.sin(l), n[s + 2] = l; }, e.addCurvePosition = function(t, e, i, n, s, a, r, o, h, l, u, c) { 0 == t && (t = 1e-4); var _ = t * t, d = _ * t, p = 1 - t, f = p * p, g = f * p, m = p * t, v = 3 * m, y = p * v, x = v * t, b = e * g + n * y + a * x + o * d, w = i * g + s * y + r * x + h * d; l[u] = b, l[u + 1] = w, l[u + 2] = c ? Math.atan2(w - (i * f + s * m * 2 + r * _), b - (e * f + n * m * 2 + a * _)) : 0; }, t.NONE = -1, t.BEFORE = -2, t.AFTER = -3, n(t, [ "_tempMt", function() { return this._tempMt = new g(); } ]), t; }(), G = function() { function t() { this.name = null, this.target = null, this.positionMode = null, this.spacingMode = null, this.rotateMode = null, this.offsetRotation = NaN, this.position = NaN, this.spacing = NaN, this.rotateMix = NaN, this.translateMix = NaN, this.bones = []; } return s(t, "laya.ani.bone.PathConstraintData"), t; }(), H = function() { function t() { this.name = null, this.slotArr = []; } return s(t, "laya.ani.bone.SkinData"), t; }(), Y = function() { function t() { this.name = null, this.attachmentName = null, this.type = 0, this.transform = null, this.width = NaN, this.height = NaN, this.texture = null, this.bones = null, this.uvs = null, this.weights = null, this.triangles = null, this.vertices = null, this.lengths = null, this.verLen = 0; } s(t, "laya.ani.bone.SkinSlotDisplayData"); var e = t.prototype; return e.createTexture = function(t) { return this.texture ? this.texture : (this.texture = new S(t.bitmap, this.uvs), this.uvs[0] > this.uvs[4] && this.uvs[1] > this.uvs[5] ? (this.texture.width = t.height, this.texture.height = t.width, this.texture.offsetX = -t.offsetX, this.texture.offsetY = -t.offsetY, this.texture.sourceWidth = t.sourceHeight, this.texture.sourceHeight = t.sourceWidth) : (this.texture.width = t.width, this.texture.height = t.height, this.texture.offsetX = -t.offsetX, this.texture.offsetY = -t.offsetY, this.texture.sourceWidth = t.sourceWidth, this.texture.sourceHeight = t.sourceHeight), v.isWebGL || this.uvs[1] > this.uvs[5] && (this.texture.offsetY = this.texture.sourceHeight - this.texture.height - this.texture.offsetY), this.texture); }, e.destory = function() { this.texture && this.texture.destroy(); }, t; }(), X = function() { function t() { this.name = null, this.displayArr = []; } s(t, "laya.ani.bone.SlotData"); return t.prototype.getDisplayByName = function(t) { for (var e = 0, i = this.displayArr.length; e < i; e++) if (this.displayArr[e].attachmentName == t) return e; return -1; }, t; }(), j = function() { function t(t, e) { this._data = null, this._bones = null, this.target = null, this.rotateMix = NaN, this.translateMix = NaN, this.scaleMix = NaN, this.shearMix = NaN, this._temp = r(2, 0), this._data = t, null == this._bones && (this._bones = []), this.target = e[t.targetIndex]; var i = 0, n = 0; for (i = 0, n = t.boneIndexs.length; i < n; i++) this._bones.push(e[t.boneIndexs[i]]); this.rotateMix = t.rotateMix, this.translateMix = t.translateMix, this.scaleMix = t.scaleMix, this.shearMix = t.shearMix; } s(t, "laya.ani.bone.TfConstraint"); return t.prototype.apply = function() { for (var t, e = this.target.resultMatrix.a, i = this.target.resultMatrix.b, n = this.target.resultMatrix.c, s = this.target.resultMatrix.d, a = 0, r = this._bones.length; a < r; a++) { if (t = this._bones[a], this.rotateMix > 0) { var o = t.resultMatrix.a, h = t.resultMatrix.b, l = t.resultMatrix.c, u = t.resultMatrix.d, c = Math.atan2(n, e) - Math.atan2(l, o) + this._data.offsetRotation * Math.PI / 180; c > Math.PI ? c -= 2 * Math.PI : c < -Math.PI && (c += 2 * Math.PI), c *= this.rotateMix; var _ = Math.cos(c), d = Math.sin(c); t.resultMatrix.a = _ * o - d * l, t.resultMatrix.b = _ * h - d * u, t.resultMatrix.c = d * o + _ * l, t.resultMatrix.d = d * h + _ * u; } if (this.translateMix && (this._temp[0] = this._data.offsetX, this._temp[1] = this._data.offsetY, this.target.localToWorld(this._temp), t.resultMatrix.tx += (this._temp[0] - t.resultMatrix.tx) * this.translateMix, t.resultMatrix.ty += (this._temp[1] - t.resultMatrix.ty) * this.translateMix, t.updateChild()), this.scaleMix > 0) { var p = Math.sqrt(t.resultMatrix.a * t.resultMatrix.a + t.resultMatrix.c * t.resultMatrix.c), f = Math.sqrt(e * e + n * n), g = p > 1e-5 ? (p + (f - p + this._data.offsetScaleX) * this.scaleMix) / p : 0; t.resultMatrix.a *= g, t.resultMatrix.c *= g, p = Math.sqrt(t.resultMatrix.b * t.resultMatrix.b + t.resultMatrix.d * t.resultMatrix.d), f = Math.sqrt(i * i + s * s), g = p > 1e-5 ? (p + (f - p + this._data.offsetScaleY) * this.scaleMix) / p : 0, t.resultMatrix.b *= g, t.resultMatrix.d *= g; } if (this.shearMix > 0) { h = t.resultMatrix.b, u = t.resultMatrix.d; var m = Math.atan2(u, h); (c = Math.atan2(s, i) - Math.atan2(n, e) - (m - Math.atan2(t.resultMatrix.c, t.resultMatrix.a))) > Math.PI ? c -= 2 * Math.PI : c < -Math.PI && (c += 2 * Math.PI), c = m + (c + this._data.offsetShearY * Math.PI / 180) * this.shearMix, g = Math.sqrt(h * h + u * u), t.resultMatrix.b = Math.cos(c) * g, t.resultMatrix.d = Math.sin(c) * g; } } }, t; }(), K = function() { function t() { this.name = null, this.targetIndex = 0, this.rotateMix = NaN, this.translateMix = NaN, this.scaleMix = NaN, this.shearMix = NaN, this.offsetRotation = NaN, this.offsetX = NaN, this.offsetY = NaN, this.offsetScaleX = NaN, this.offsetScaleY = NaN, this.offsetShearY = NaN, this.boneIndexs = []; } return s(t, "laya.ani.bone.TfConstraintData"), t; }(), $ = function() { function t() { this.skX = 0, this.skY = 0, this.scX = 1, this.scY = 1, this.x = 0, this.y = 0, this.skewX = 0, this.skewY = 0, this.mMatrix = null; } s(t, "laya.ani.bone.Transform"); var e = t.prototype; return e.initData = function(t) { void 0 != t.x && (this.x = t.x), void 0 != t.y && (this.y = t.y), void 0 != t.skX && (this.skX = t.skX), void 0 != t.skY && (this.skY = t.skY), void 0 != t.scX && (this.scX = t.scX), void 0 != t.scY && (this.scY = t.scY); }, e.getMatrix = function() { var t; return (t = this.mMatrix ? this.mMatrix : this.mMatrix = new g()).identity(), t.scale(this.scX, this.scY), (this.skewX || this.skewY) && this.skew(t, this.skewX * Math.PI / 180, this.skewY * Math.PI / 180), t.rotate(this.skX * Math.PI / 180), t.translate(this.x, this.y), t; }, e.skew = function(t, e, i) { var n = Math.sin(i), s = Math.cos(i), a = Math.sin(e), r = Math.cos(e); return t.setTo(t.a * r - t.b * n, t.a * a + t.b * s, t.c * r - t.d * n, t.c * a + t.d * s, t.tx * r - t.ty * n, t.tx * a + t.ty * s), t; }, t; }(), q = function() { function t() {} return s(t, "laya.ani.bone.UVTools"), t.getRelativeUV = function(t, e, i) { var n = t[0], s = t[2] - t[0], a = t[1], r = t[5] - t[1]; i || (i = []), i.length = e.length; var o = 0, h = 0; h = i.length; var l = 1 / s, u = 1 / r; for (o = 0; o < h; o += 2) i[o] = (e[o] - n) * l, i[o + 1] = (e[o + 1] - a) * u; return i; }, t.getAbsoluteUV = function(t, e, i) { if (0 == t[0] && 0 == t[1] && 1 == t[4] && 1 == t[5]) return i ? (T.copyArray(i, e), i) : e; var n = t[0], s = t[2] - t[0], a = t[1], r = t[5] - t[1]; i || (i = []), i.length = e.length; var o = 0, h = 0; for (h = i.length, o = 0; o < h; o += 2) i[o] = e[o] * s + n, i[o + 1] = e[o + 1] * r + a; return i; }, t; }(), Z = function() { function t() { this.startTime = NaN, this.duration = NaN, this.interpolationData = null, this.data = null, this.nextData = null; } return s(t, "laya.ani.KeyFramesContent"), t; }(), J = function() { function t() {} return s(t, "laya.ani.math.BezierLerp"), t.getBezierRate = function(e, i, n, s, a) { var r = t._getBezierParamKey(i, n, s, a), o = 100 * r + e; if (t._bezierResultCache[o]) return t._bezierResultCache[o]; var h = t._getBezierPoints(i, n, s, a, r), l = 0, u = 0; for (u = h.length, l = 0; l < u; l += 2) if (e <= h[l]) return t._bezierResultCache[o] = h[l + 1], h[l + 1]; return t._bezierResultCache[o] = 1, 1; }, t._getBezierParamKey = function(t, e, i, n) { return 100 * (100 * (100 * (100 * t + e) + i) + n); }, t._getBezierPoints = function(e, i, n, s, a) { if (t._bezierPointsCache[a]) return t._bezierPointsCache[a]; var r; r = [ 0, 0, e, i, n, s, 1, 1 ]; var h; return h = new o().getBezierPoints(r, 100, 3), t._bezierPointsCache[a] = h, h; }, t._bezierResultCache = {}, t._bezierPointsCache = {}, t; }(), Q = function(t) { function e() { this._destroyed = !1, this._templet = null, this._currentTime = NaN, this._currentFrameTime = NaN, this._playStart = NaN, this._playEnd = NaN, this._playDuration = NaN, this._overallDuration = NaN, this._stopWhenCircleFinish = !1, this._elapsedPlaybackTime = NaN, this._startUpdateLoopCount = NaN, this._currentAnimationClipIndex = 0, this._currentKeyframeIndex = 0, this._paused = !1, this._cacheFrameRate = 0, this._cacheFrameRateInterval = NaN, this._cachePlayRate = NaN, this._fullFrames = null, this.isCache = !0, this.playbackRate = 1, this.returnToZeroStopped = !1, e.__super.call(this), this._destroyed = !1, this._currentAnimationClipIndex = -1, this._currentKeyframeIndex = -1, this._currentTime = 0, this._overallDuration = Number.MAX_VALUE, this._stopWhenCircleFinish = !1, this._elapsedPlaybackTime = 0, this._startUpdateLoopCount = -1, this._cachePlayRate = 1, this.cacheFrameRate = 60, this.returnToZeroStopped = !1; } s(e, "laya.ani.AnimationPlayer", u); var n = e.prototype; return i.imps(n, { "laya.resource.IDestroy": !0 }), n._onTempletLoadedComputeFullKeyframeIndices = function(t, e, i) { this._templet === i && this._cachePlayRate === t && this._cacheFrameRate === e && this._computeFullKeyframeIndices(); }, n._computeFullKeyframeIndices = function() { for (var t = this._fullFrames = [], e = this._templet, i = this._cacheFrameRateInterval * this._cachePlayRate, n = 0, s = e.getAnimationCount(); n < s; n++) { for (var a = [], r = 0, o = e.getAnimation(n).nodes.length; r < o; r++) { for (var h = e.getAnimation(n).nodes[r], l = Math.floor(h.playTime / i + .01), u = new Uint16Array(l + 1), c = -1, _ = 0, d = h.keyFrame.length; _ < d; _++) { var p = h.keyFrame[_], f = p.startTime, g = f + p.duration + i; do { for (var m = Math.floor(f / i + .5), v = c + 1; v < m; v++) u[v] = _; c = m, u[m] = _, f += i; } while (f <= g); } a.push(u); } t.push(a); } }, n._onAnimationTempletLoaded = function() { this.destroyed || this._calculatePlayDuration(); }, n._calculatePlayDuration = function() { if (0 !== this.state) { var t = this._templet.getAniDuration(this._currentAnimationClipIndex); 0 === this._playEnd && (this._playEnd = t), this._playEnd > t && (this._playEnd = t), this._playDuration = this._playEnd - this._playStart; } }, n._setPlayParams = function(t, e) { this._currentTime = t, this._currentKeyframeIndex = Math.max(Math.floor(this.currentPlayTime / e + .01), 0), this._currentFrameTime = this._currentKeyframeIndex * e; }, n._setPlayParamsWhenStop = function(t, e) { this._currentTime = t, this._currentKeyframeIndex = Math.max(Math.floor(t / e + .01), 0), this._currentFrameTime = this._currentKeyframeIndex * e, this._currentAnimationClipIndex = -1; }, n._update = function(t) { if (-1 !== this._currentAnimationClipIndex && !this._paused && this._templet && this._templet.loaded) { var e = this._cacheFrameRateInterval * this._cachePlayRate, i = 0; this._startUpdateLoopCount !== C.loopCount && (i = t * this.playbackRate, this._elapsedPlaybackTime += i); var n = this.playDuration; if (0 !== this._overallDuration && this._elapsedPlaybackTime >= this._overallDuration || 0 === this._overallDuration && this._elapsedPlaybackTime >= n) return this._setPlayParamsWhenStop(n, e), void this.event("stopped"); if (i += this._currentTime, n > 0) if (i >= n) do { if (i -= n, this._stopWhenCircleFinish) return this._setPlayParamsWhenStop(n, e), this._stopWhenCircleFinish = !1, void this.event("stopped"); i < n && (this._setPlayParams(i, e), this.event("complete")); } while (i >= n); else this._setPlayParams(i, e); else { if (this._stopWhenCircleFinish) return this._setPlayParamsWhenStop(n, e), this._stopWhenCircleFinish = !1, void this.event("stopped"); this._currentTime = this._currentFrameTime = this._currentKeyframeIndex = 0, this.event("complete"); } } }, n._destroy = function() { this.offAll(), this._templet = null, this._fullFrames = null, this._destroyed = !0; }, n.play = function(t, e, i, n, s) { if (void 0 === t && (t = 0), void 0 === e && (e = 1), void 0 === i && (i = 2147483647), void 0 === n && (n = 0), void 0 === s && (s = 0), !this._templet) throw new Error("AnimationPlayer:templet must not be null,maybe you need to set url."); if (i < 0 || n < 0 || s < 0) throw new Error("AnimationPlayer:overallDuration,playStart and playEnd must large than zero."); if (0 !== s && n > s) throw new Error("AnimationPlayer:start must less than end."); this._currentTime = 0, this._currentFrameTime = 0, this._elapsedPlaybackTime = 0, this.playbackRate = e, this._overallDuration = i, this._playStart = n, this._playEnd = s, this._paused = !1, this._currentAnimationClipIndex = t, this._currentKeyframeIndex = 0, this._startUpdateLoopCount = C.loopCount, this.event("played"), this._templet.loaded ? this._calculatePlayDuration() : this._templet.once("loaded", this, this._onAnimationTempletLoaded), this._update(0); }, n.playByFrame = function(t, e, i, n, s, a) { void 0 === t && (t = 0), void 0 === e && (e = 1), void 0 === i && (i = 2147483647), void 0 === n && (n = 0), void 0 === s && (s = 0), void 0 === a && (a = 30); var r = 1e3 / a; this.play(t, e, i, n * r, s * r); }, n.stop = function(t) { void 0 === t && (t = !0), t ? (this._currentTime = this._currentFrameTime = this._currentKeyframeIndex = 0, this._currentAnimationClipIndex = -1, this.event("stopped")) : this._stopWhenCircleFinish = !0; }, a(0, n, "playEnd", function() { return this._playEnd; }), a(0, n, "templet", function() { return this._templet; }, function(t) { 0 === !this.state && this.stop(!0), this._templet !== t && (this._templet = t, t.loaded ? this._computeFullKeyframeIndices() : t.once("loaded", this, this._onTempletLoadedComputeFullKeyframeIndices, [ this._cachePlayRate, this._cacheFrameRate ])); }), a(0, n, "playStart", function() { return this._playStart; }), a(0, n, "playDuration", function() { return this._playDuration; }), a(0, n, "state", function() { return -1 === this._currentAnimationClipIndex ? 0 : this._paused ? 1 : 2; }), a(0, n, "currentKeyframeIndex", function() { return this._currentKeyframeIndex; }), a(0, n, "overallDuration", function() { return this._overallDuration; }), a(0, n, "currentFrameTime", function() { return this._currentFrameTime; }), a(0, n, "currentAnimationClipIndex", function() { return this._currentAnimationClipIndex; }), a(0, n, "currentPlayTime", function() { return this._currentTime + this._playStart; }), a(0, n, "cachePlayRate", function() { return this._cachePlayRate; }, function(t) { this._cachePlayRate !== t && (this._cachePlayRate = t, this._templet && (this._templet.loaded ? this._computeFullKeyframeIndices() : this._templet.once("loaded", this, this._onTempletLoadedComputeFullKeyframeIndices, [ t, this._cacheFrameRate ]))); }), a(0, n, "cacheFrameRate", function() { return this._cacheFrameRate; }, function(t) { this._cacheFrameRate !== t && (this._cacheFrameRate = t, this._cacheFrameRateInterval = 1e3 / this._cacheFrameRate, this._templet && (this._templet.loaded ? this._computeFullKeyframeIndices() : this._templet.once("loaded", this, this._onTempletLoadedComputeFullKeyframeIndices, [ this._cachePlayRate, t ]))); }), a(0, n, "currentTime", null, function(t) { if (-1 !== this._currentAnimationClipIndex && this._templet && this._templet.loaded) { if (t < this._playStart || t > this._playEnd) throw new Error("AnimationPlayer:value must large than playStartTime,small than playEndTime."); this._startUpdateLoopCount = C.loopCount; var e = this._cacheFrameRateInterval * this._cachePlayRate; this._currentTime = t, this._currentKeyframeIndex = Math.max(Math.floor(this.currentPlayTime / e), 0), this._currentFrameTime = this._currentKeyframeIndex * e; } }), a(0, n, "paused", function() { return this._paused; }, function(t) { this._paused = t, t && this.event("paused"); }), a(0, n, "cacheFrameRateInterval", function() { return this._cacheFrameRateInterval; }), a(0, n, "destroyed", function() { return this._destroyed; }), e; }(), tt = function(t) { function e() { e.__super.call(this), v.isConchNode && (this.drawSkin = function(t) { t.transform || (t.transform = g.EMPTY), this._addCmd([ t ]), this.setSkinMesh && this.setSkinMesh(t._ps, t.mVBData, t.mEleNum, 0, t.mTexture, t.transform); }); } s(e, "laya.ani.GraphicsAni", c); return e.prototype.drawSkin = function(t) { var e = [ t ]; this._saveToCmd(v._context._drawSkin, e); }, e.create = function() { return e._caches.pop() || new e(); }, e.recycle = function(t) { t.clear(), e._caches.push(t); }, e._caches = [], e; }(), et = function(t) { function e() { e.__super.call(this), this.mesh = new R(); } s(e, "laya.ani.bone.canvasmesh.SkinMeshCanvas", k); var i = e.prototype; return i.init2 = function(t, e, i, n, s) { this.transform && (this.transform = null); var a; i ? a = i : (a = []).push(0, 1, 3, 3, 1, 2), this.mesh.texture = t, this.mesh.indexes = a, this.mesh.vertices = n, this.mesh.uvs = s; }, i.render = function(t, i, n) { this.mesh.texture && (this.transform ? (this.transform.translate(i, n), this.renderToContext(t), this.transform.translate(-i, -n)) : (this.transform = e._tempMatrix, this.transform.identity(), this.transform.translate(i, n), this.renderToContext(t), this.transform.translate(-i, -n), this.transform = null)); }, n(e, [ "_tempMatrix", function() { return this._tempMatrix = new g(); } ]), e; }(), it = function(t) { function e() { this._aniMap = {}, this.unfixedLastAniIndex = -1, e.__super.call(this), this._anis = new Array(); } s(e, "laya.ani.AnimationTemplet", y); var n = e.prototype; return n.parse = function(t) { var e = new l(t); this._aniVersion = e.readUTFString(), E.parse(this, e); }, n._calculateKeyFrame = function(t, e, i) { var n = t.keyFrame; n[e] = n[0]; for (var s = 0; s < e; s++) { var a = n[s]; a.nextData = 0 === a.duration ? a.data : n[s + 1].data; } n.length--; }, n.onAsynLoaded = function(t, e, i) { var n = new l(e); switch (this._aniVersion = n.readUTFString(), this._aniVersion) { case "LAYAANIMATION:02": A.parse(this, n); break; default: E.parse(this, n); } this._endLoaded(); }, n.disposeResource = function() { this._aniVersion = null, this._anis = null, this._aniMap = null, this._publicExtData = null, this.unfixedCurrentFrameIndexes = null, this.unfixedCurrentTimes = null, this.unfixedKeyframes = null, this._aniClassName = null, this._animationDatasCache = null; }, n.getAnimationCount = function() { return this._anis.length; }, n.getAnimation = function(t) { return this._anis[t]; }, n.getAniDuration = function(t) { return this._anis[t].playTime; }, n.getNodes = function(t) { return this._anis[t].nodes; }, n.getNodeIndexWithName = function(t, e) { return this._anis[t].bone3DMap[e]; }, n.getNodeCount = function(t) { return this._anis[t].nodes.length; }, n.getTotalkeyframesLength = function(t) { return this._anis[t].totalKeyframeDatasLength; }, n.getPublicExtData = function() { return this._publicExtData; }, n.getAnimationDataWithCache = function(t, e, i, n) { var s = e[i]; if (s) { var a = s[t]; return a ? a[n] : null; } return null; }, n.setAnimationDataWithCache = function(t, e, i, n, s) { var a = e[i] || (e[i] = {}); (a[t] || (a[t] = []))[n] = s; }, n.getOriginalData = function(t, i, n, s, a) { for (var r = this._anis[t].nodes, o = 0, h = 0, l = r.length, u = 0; h < l; h++) { var c, _ = r[h]; c = _.keyFrame[n[h][s]], _.dataOffset = u; var d = a - c.startTime, p = _.lerpType; if (p) switch (p) { case 0: case 1: for (o = 0; o < _.keyframeWidth; ) o += _.interpolationMethod[o](_, o, i, u + o, c.data, d, null, c.duration, c.nextData); break; case 2: var f = c.interpolationData, g = f.length, m = 0; for (o = 0; o < g; ) { var v = f[o]; switch (v) { case 6: case 7: o += e.interpolation[v](_, m, i, u + m, c.data, d, null, c.duration, c.nextData, f, o + 1); break; default: o += e.interpolation[v](_, m, i, u + m, c.data, d, null, c.duration, c.nextData); } m++; } } else for (o = 0; o < _.keyframeWidth; ) o += _.interpolationMethod[o](_, o, i, u + o, c.data, d, null, c.duration, c.nextData); u += _.keyframeWidth; } }, n.getNodesCurrentFrameIndex = function(t, e) { var i = this._anis[t].nodes; t !== this.unfixedLastAniIndex && (this.unfixedCurrentFrameIndexes = new Uint32Array(i.length), this.unfixedCurrentTimes = new Float32Array(i.length), this.unfixedLastAniIndex = t); for (var n = 0, s = i.length; n < s; n++) { var a = i[n]; for (e < this.unfixedCurrentTimes[n] && (this.unfixedCurrentFrameIndexes[n] = 0), this.unfixedCurrentTimes[n] = e; this.unfixedCurrentFrameIndexes[n] < a.keyFrame.length && !(a.keyFrame[this.unfixedCurrentFrameIndexes[n]].startTime > this.unfixedCurrentTimes[n]); ) this.unfixedCurrentFrameIndexes[n]++; this.unfixedCurrentFrameIndexes[n]--; } return this.unfixedCurrentFrameIndexes; }, n.getOriginalDataUnfixedRate = function(t, i, n) { var s = this._anis[t].nodes; t !== this.unfixedLastAniIndex && (this.unfixedCurrentFrameIndexes = new Uint32Array(s.length), this.unfixedCurrentTimes = new Float32Array(s.length), this.unfixedKeyframes = r(s.length), this.unfixedLastAniIndex = t); for (var a = 0, o = 0, h = s.length, l = 0; o < h; o++) { var u = s[o]; for (n < this.unfixedCurrentTimes[o] && (this.unfixedCurrentFrameIndexes[o] = 0), this.unfixedCurrentTimes[o] = n; this.unfixedCurrentFrameIndexes[o] < u.keyFrame.length && !(u.keyFrame[this.unfixedCurrentFrameIndexes[o]].startTime > this.unfixedCurrentTimes[o]); ) this.unfixedKeyframes[o] = u.keyFrame[this.unfixedCurrentFrameIndexes[o]], this.unfixedCurrentFrameIndexes[o]++; var c = this.unfixedKeyframes[o]; u.dataOffset = l; var _ = n - c.startTime; if (u.lerpType) switch (u.lerpType) { case 0: case 1: for (a = 0; a < u.keyframeWidth; ) a += u.interpolationMethod[a](u, a, i, l + a, c.data, _, null, c.duration, c.nextData); break; case 2: var d = c.interpolationData, p = d.length, f = 0; for (a = 0; a < p; ) { var g = d[a]; switch (g) { case 6: case 7: a += e.interpolation[g](u, f, i, l + f, c.data, _, null, c.duration, c.nextData, d, a + 1); break; default: a += e.interpolation[g](u, f, i, l + f, c.data, _, null, c.duration, c.nextData); } f++; } } else for (a = 0; a < u.keyframeWidth; ) a += u.interpolationMethod[a](u, a, i, l + a, c.data, _, null, c.duration, c.nextData); l += u.keyframeWidth; } }, e._LinearInterpolation_0 = function(t, e, i, n, s, a, r, o, h, l) { var u = 0 === o ? 0 : a / o; return i[n] = (1 - u) * s[e] + u * h[e], 1; }, e._QuaternionInterpolation_1 = function(t, e, i, n, s, a, r, o, h, l) { var u = 0 === o ? 0 : a / o; return f.slerpQuaternionArray(s, e, h, e, u, i, n), 4; }, e._AngleInterpolation_2 = function(t, e, i, n, s, a, r, o, h, l) { return 0; }, e._RadiansInterpolation_3 = function(t, e, i, n, s, a, r, o, h, l) { return 0; }, e._Matrix4x4Interpolation_4 = function(t, e, i, n, s, a, r, o, h, l) { for (var u = 0; u < 16; u++, e++) i[n + u] = s[e] + a * r[e]; return 16; }, e._NoInterpolation_5 = function(t, e, i, n, s, a, r, o, h, l) { return i[n] = s[e], 1; }, e._BezierInterpolation_6 = function(t, e, i, n, s, a, r, o, h, l, u) { return void 0 === u && (u = 0), i[n] = s[e] + (h[e] - s[e]) * J.getBezierRate(a / o, l[u], l[u + 1], l[u + 2], l[u + 3]), 5; }, e._BezierInterpolation_7 = function(t, e, i, n, s, a, r, o, h, l, u) { return void 0 === u && (u = 0), i[n] = l[u + 4] + l[u + 5] * J.getBezierRate((.001 * a + l[u + 6]) / l[u + 7], l[u], l[u + 1], l[u + 2], l[u + 3]), 9; }, e.load = function(t) { return i.loader.create(t, null, null, e); }, e.interpolation = [ e._LinearInterpolation_0, e._QuaternionInterpolation_1, e._AngleInterpolation_2, e._RadiansInterpolation_3, e._Matrix4x4Interpolation_4, e._NoInterpolation_5, e._BezierInterpolation_6, e._BezierInterpolation_7 ], e; }(), nt = (function(t) { function e() { this.isCached = !1, this.canvas = null, this.tex = null, this.rec = null, e.__super.call(this); } s(e, "laya.ani.bone.canvasmesh.CacheAbleSkinMesh", et); var i = e.prototype; i.getCanvasPic = function() { var t = new _("2D"), i = t.getContext("2d"); this.rec = this.mesh.getBounds(), t.size(this.rec.width, this.rec.height); var n; return n = this.transform, this.transform = e.tempMt, this.transform.identity(), this.transform.translate(-this.rec.x, -this.rec.y), this.renderToContext(i), this.transform.translate(+this.rec.x, +this.rec.y), this.transform = n, new S(t); }, i.render = function(t, e, i) { this.mesh.texture && (this.isCached || (this.isCached = !0, this.tex = this.getCanvasPic()), this.transform ? (this.transform.translate(e, i), this._renderTextureToContext(t), this.transform.translate(-e, -i)) : (this.transform = et._tempMatrix, this.transform.identity(), this.transform.translate(e, i), this._renderTextureToContext(t), this.transform.translate(-e, -i), this.transform = null)); }, i._renderTextureToContext = function(t) { this.context = t.ctx || t, t.save(); var e; if (e = this.tex, this.transform) { var i = this.transform; t.transform(i.a, i.b, i.c, i.d, i.tx, i.ty); } this.rec = this.mesh.getBounds(), t.translate(this.rec.x, this.rec.y), t.drawTexture(e, 0, 0, e.width, e.height, 0, 0), t.restore(); }, n(e, [ "tempMt", function() { return this.tempMt = new g(); } ]); }(), function(t) { function e() { this.cacheOK = !1, this.cacheCmdOK = !1, this.transformCmds = [], this.drawCmds = [], e.__super.call(this), this.tempMesh = new R(); } s(e, "laya.ani.bone.canvasmesh.SimpleSkinMeshCanvas", t); var i = e.prototype; return i.init2 = function(e, i, n, s, a) { t.prototype.init2.call(this, e, i, n, s, a), this.cacheOK = !1, this.cacheCmdOK = !1, this.transformCmds.length = 6, this.drawCmds.length = 9; }, i.renderToContext = function(t) { if (this.context = t.ctx || t, this.mesh) { if (this.mesh.uvs.length <= 8) return void (0 == this.mode ? this._renderWithIndexes(this.mesh) : this._renderNoIndexes(this.mesh)); this.cacheOK || (this.tempMesh.texture = this.mesh.texture, this.tempMesh.uvs = this.mesh.texture.uv, this.tempMesh.vertices = V.solveMesh(this.mesh, this.tempMesh.vertices), this.cacheOK = !0), 0 == this.mode ? this._renderWithIndexes(this.tempMesh) : this._renderNoIndexes(this.tempMesh); } }, i._renderWithIndexes = function(t) { if (this.cacheCmdOK) this.renderByCache(t); else { var e = t.indexes, i = 0, n = e.length; for (n > 1 && (n = 1), i = 0; i < n; i += 3) { var s = 2 * e[i], a = 2 * e[i + 1], r = 2 * e[i + 2]; this._renderDrawTriangle(t, s, a, r); } this.cacheCmdOK = !0; } }, i._renderDrawTriangle = function(t, e, i, n) { var s = this.context, a = t.uvs, r = t.vertices, o = t.texture, h = o.bitmap, l = h.source, u = o.width, c = o.height, _ = h.width, d = h.height, p = NaN, f = NaN, g = NaN, m = NaN, v = NaN, y = NaN; if (t.useUvTransform) { var x = t.uvTransform; p = (a[e] * x.a + a[e + 1] * x.c + x.tx) * _, f = (a[i] * x.a + a[i + 1] * x.c + x.tx) * _, g = (a[n] * x.a + a[n + 1] * x.c + x.tx) * _, m = (a[e] * x.b + a[e + 1] * x.d + x.ty) * d, v = (a[i] * x.b + a[i + 1] * x.d + x.ty) * d, y = (a[n] * x.b + a[n + 1] * x.d + x.ty) * d; } else p = a[e] * _, f = a[i] * _, g = a[n] * _, m = a[e + 1] * d, v = a[i + 1] * d, y = a[n + 1] * d; var b = r[e], w = r[i], C = r[n], S = r[e + 1], T = r[i + 1], I = r[n + 1], M = 1 / (p * v + m * g + f * y - v * g - m * f - p * y), E = b * v + m * C + w * y - v * C - m * w - b * y, A = p * w + b * g + f * C - w * g - b * f - p * C, L = p * v * C + m * w * g + b * f * y - b * v * g - m * f * C - p * w * y, P = S * v + m * I + T * y - v * I - m * T - S * y, k = p * T + S * g + f * I - T * g - S * f - p * I, R = p * v * I + m * T * g + S * f * y - S * v * g - m * f * I - p * T * y; if (this.transformCmds[0] = E * M, this.transformCmds[1] = P * M, this.transformCmds[2] = A * M, this.transformCmds[3] = k * M, this.transformCmds[4] = L * M, this.transformCmds[5] = R * M, this.drawCmds[0] = l, this.drawCmds[1] = o.uv[0] * _, this.drawCmds[2] = o.uv[1] * d, this.drawCmds[3] = u, this.drawCmds[4] = c, this.drawCmds[5] = o.uv[0] * _, this.drawCmds[6] = o.uv[1] * d, this.drawCmds[7] = u, this.drawCmds[8] = c, s.save(), this.transform) { var D = this.transform; s.transform(D.a, D.b, D.c, D.d, D.tx, D.ty); } s.transform.apply(s, this.transformCmds), s.drawImage.apply(s, this.drawCmds), s.restore(); }, i.renderByCache = function(t) { var e = this.context; if (e.save(), this.transform) { var i = this.transform; e.transform(i.a, i.b, i.c, i.d, i.tx, i.ty); } e.transform.apply(e, this.transformCmds), e.drawImage.apply(e, this.drawCmds), e.restore(); }, e; }(et)), st = function(t) { function e(t, i) { this._templet = null, this._player = null, this._curOriginalData = null, this._boneMatrixArray = [], this._lastTime = 0, this._currAniName = null, this._currAniIndex = -1, this._pause = !0, this._aniClipIndex = -1, this._clipIndex = -1, this._skinIndex = 0, this._skinName = "default", this._aniMode = 0, this._graphicsCache = null, this._boneSlotDic = null, this._bindBoneBoneSlotDic = null, this._boneSlotArray = null, this._index = -1, this._total = -1, this._indexControl = !1, this._aniPath = null, this._texturePath = null, this._complete = null, this._loadAniMode = 0, this._yReverseMatrix = null, this._ikArr = null, this._tfArr = null, this._pathDic = null, this._rootBone = null, this._boneList = null, this._aniSectionDic = null, this._eventIndex = 0, this._drawOrderIndex = 0, this._drawOrder = null, this._lastAniClipIndex = -1, this._lastUpdateAniClipIndex = -1, this._playAudio = !0, this._soundChannelArr = [], e.__super.call(this), void 0 === i && (i = 0), t && this.init(t, i); } s(e, "laya.ani.bone.Skeleton", t); var n = e.prototype; return n.init = function(t, e) { void 0 === e && (e = 0); var i = 0, n = 0; if (1 == e) for (this._graphicsCache = [], i = 0, n = t.getAnimationCount(); i < n; i++) this._graphicsCache.push([]); if (this._yReverseMatrix = t.yReverseMatrix, this._aniMode = e, this._templet = t, this._player = new Q(), this._player.cacheFrameRate = t.rate, this._player.templet = t, this._player.play(), this._parseSrcBoneMatrix(), this._boneList = t.mBoneArr, this._rootBone = t.mRootBone, this._aniSectionDic = t.aniSectionDic, t.ikArr.length > 0) for (this._ikArr = [], i = 0, n = t.ikArr.length; i < n; i++) this._ikArr.push(new z(t.ikArr[i], this._boneList)); if (t.pathArr.length > 0) { var s, a; null == this._pathDic && (this._pathDic = {}); var r; for (i = 0, n = t.pathArr.length; i < n; i++) s = t.pathArr[i], a = new W(s, this._boneList), (r = this._boneSlotDic[s.name]) && ((a = new W(s, this._boneList)).target = r), this._pathDic[s.name] = a; } if (t.tfArr.length > 0) for (this._tfArr = [], i = 0, n = t.tfArr.length; i < n; i++) this._tfArr.push(new j(t.tfArr[i], this._boneList)); if (t.skinDataArray.length > 0) { var o = this._templet.skinDataArray[this._skinIndex]; this._skinName = o.name; } this._player.on("played", this, this._onPlay), this._player.on("stopped", this, this._onStop), this._player.on("paused", this, this._onPause); }, n.load = function(t, e, n) { void 0 === n && (n = 0), this._aniPath = t, this._complete = e, this._loadAniMode = n, i.loader.load([ { url: t, type: "arraybuffer" } ], d.create(this, this._onLoaded)); }, n._onLoaded = function() { var t = p.getRes(this._aniPath); if (null != t) { null == at.TEMPLET_DICTIONARY && (at.TEMPLET_DICTIONARY = {}); var e; (e = at.TEMPLET_DICTIONARY[this._aniPath]) ? e.isParseFail ? this._parseFail() : e.isParserComplete ? this._parseComplete() : (e.on("complete", this, this._parseComplete), e.on("error", this, this._parseFail)) : ((e = new at())._setUrl(this._aniPath), at.TEMPLET_DICTIONARY[this._aniPath] = e, e.on("complete", this, this._parseComplete), e.on("error", this, this._parseFail), e.isParserComplete = !1, e.parseData(null, t)); } }, n._parseComplete = function() { var t = at.TEMPLET_DICTIONARY[this._aniPath]; t && (this.init(t, this._loadAniMode), this.play(0, !0)), this._complete && this._complete.runWith(this); }, n._parseFail = function() { console.log("[Error]:" + this._aniPath + "解析失败"); }, n._onPlay = function() { this.event("played"); }, n._onStop = function() { var t, e = this._templet.eventAniArr[this._aniClipIndex]; if (e && this._eventIndex < e.length) for (;this._eventIndex < e.length; this._eventIndex++) (t = e[this._eventIndex]).time >= this._player.playStart && t.time <= this._player.playEnd && this.event("label", t); this._drawOrder = null, this.event("stopped"); }, n._onPause = function() { this.event("paused"); }, n._parseSrcBoneMatrix = function() { var t = 0, e = 0; for (e = this._templet.srcBoneMatrixArr.length, t = 0; t < e; t++) this._boneMatrixArray.push(new g()); if (0 == this._aniMode) this._boneSlotDic = this._templet.boneSlotDic, this._bindBoneBoneSlotDic = this._templet.bindBoneBoneSlotDic, this._boneSlotArray = this._templet.boneSlotArray; else { null == this._boneSlotDic && (this._boneSlotDic = {}), null == this._bindBoneBoneSlotDic && (this._bindBoneBoneSlotDic = {}), null == this._boneSlotArray && (this._boneSlotArray = []); var i, n, s = this._templet.boneSlotArray; for (t = 0, e = s.length; t < e; t++) i = s[t], null == (n = this._bindBoneBoneSlotDic[i.parent]) && (this._bindBoneBoneSlotDic[i.parent] = n = []), this._boneSlotDic[i.name] = i = i.copy(), n.push(i), this._boneSlotArray.push(i); } }, n._emitMissedEvents = function(t, e, i) { void 0 === i && (i = 0); var n = this._templet.eventAniArr[this._player.currentAnimationClipIndex]; if (n) { var s, a = 0, r = 0; for (r = n.length, a = i; a < r; a++) (s = n[a]).time >= this._player.playStart && s.time <= this._player.playEnd && this.event("label", s); } }, n._update = function(t) { if (void 0 === t && (t = !0), !(this._pause || t && this._indexControl)) { var e = this.timer.currTimer, i = this._player.currentKeyframeIndex, n = e - this._lastTime; if (t ? this._player._update(n) : i = -1, this._lastTime = e, this._player && (this._index = this._clipIndex = this._player.currentKeyframeIndex, !(this._index < 0 || n > 0 && this._clipIndex == i && this._lastUpdateAniClipIndex == this._aniClipIndex))) { this._lastUpdateAniClipIndex = this._aniClipIndex, i > this._clipIndex && 0 != this._eventIndex && (this._emitMissedEvents(this._player.playStart, this._player.playEnd, this._eventIndex), this._eventIndex = 0); var s, a, r = this._templet.eventAniArr[this._aniClipIndex]; r && this._eventIndex < r.length && ((s = r[this._eventIndex]).time >= this._player.playStart && s.time <= this._player.playEnd ? this._player.currentPlayTime >= s.time && (this.event("label", s), this._eventIndex++, this._playAudio && s.audioValue && "null" !== s.audioValue && (a = b.playSound(this._player.templet._path + s.audioValue, 1, d.create(this, this._onAniSoundStoped)), b.playbackRate = this._player.playbackRate, a && this._soundChannelArr.push(a))) : s.time < this._player.playStart && this._playAudio && s.audioValue && "null" !== s.audioValue && this._player.playEnd - this._player.currentPlayTime > .1 ? (this._eventIndex++, a = b.playSound(this._player.templet._path + s.audioValue, 1, d.create(this, this._onAniSoundStoped), null, (this._player.currentPlayTime - s.time) / 1e3), b.playbackRate = this._player.playbackRate, a && this._soundChannelArr.push(a)) : this._eventIndex++); var o; if (0 == this._aniMode) { if (o = this._templet.getGrahicsDataWithCache(this._aniClipIndex, this._clipIndex)) return void (this.graphics != o && (this.graphics = o)); var h = 0, l = 0; for (l = this._clipIndex; !this._templet.getGrahicsDataWithCache(this._aniClipIndex, l - 1) && l > 0; ) l--; if (l < this._clipIndex) for (h = l; h < this._clipIndex; h++) this._createGraphics(h); } else if (1 == this._aniMode) { if (o = this._getGrahicsDataWithCache(this._aniClipIndex, this._clipIndex)) return void (this.graphics != o && (this.graphics = o)); for (l = this._clipIndex; !this._getGrahicsDataWithCache(this._aniClipIndex, l - 1) && l > 0; ) l--; if (l < this._clipIndex) for (h = l; h < this._clipIndex; h++) this._createGraphics(h); } this._createGraphics(); } } }, n._onAniSoundStoped = function(t) { for (var e, i = this._soundChannelArr.length, n = 0; n < i; n++) ((e = this._soundChannelArr[n]).isStopped || t) && (!e.isStopped && e.stop(), this._soundChannelArr.splice(n, 1), i--, n--); }, n._createGraphics = function(t) { void 0 === t && (t = -1), -1 == t && (t = this._clipIndex); var e, i = t * this._player.cacheFrameRateInterval, n = this._templet.drawOrderAniArr[this._aniClipIndex]; if (n && n.length > 0) for (this._drawOrderIndex = 0, e = n[this._drawOrderIndex]; i >= e.time && (this._drawOrder = e.drawOrder, this._drawOrderIndex++, !(this._drawOrderIndex >= n.length)); ) e = n[this._drawOrderIndex]; var s; 0 == this._aniMode || 1 == this._aniMode ? this.graphics = tt.create() : this.graphics instanceof laya.ani.GraphicsAni ? this.graphics.clear() : this.graphics = tt.create(), s = this.graphics; var a = this._templet.getNodes(this._aniClipIndex); this._templet.getOriginalData(this._aniClipIndex, this._curOriginalData, this._player._fullFrames[this._aniClipIndex], t, i); var r, o, h, u, c = this._aniSectionDic[this._aniClipIndex], _ = 0, d = 0, p = 0, f = 0, m = 0, v = this._templet.srcBoneMatrixArr.length; for (d = 0, m = c[0]; d < v; d++) u = this._boneList[d], h = this._templet.srcBoneMatrixArr[d], u.resultTransform.scX = h.scX * this._curOriginalData[_++], u.resultTransform.skX = h.skX + this._curOriginalData[_++], u.resultTransform.skY = h.skY + this._curOriginalData[_++], u.resultTransform.scY = h.scY * this._curOriginalData[_++], u.resultTransform.x = h.x + this._curOriginalData[_++], u.resultTransform.y = h.y + this._curOriginalData[_++], 8 === this._templet.tMatrixDataLen && (u.resultTransform.skewX = h.skewX + this._curOriginalData[_++], u.resultTransform.skewY = h.skewY + this._curOriginalData[_++]); var y, x = {}, b = {}; for (m += c[1]; d < m; d++) x[(y = a[d]).name] = this._curOriginalData[_++], b[y.name] = this._curOriginalData[_++], this._curOriginalData[_++], this._curOriginalData[_++], this._curOriginalData[_++], this._curOriginalData[_++]; var w = {}, C = {}; for (m += c[2]; d < m; d++) w[(y = a[d]).name] = this._curOriginalData[_++], C[y.name] = this._curOriginalData[_++], this._curOriginalData[_++], this._curOriginalData[_++], this._curOriginalData[_++], this._curOriginalData[_++]; if (this._pathDic) { var S; for (m += c[3]; d < m; d++) if (y = a[d], S = this._pathDic[y.name]) { switch (new l(y.extenData).getByte()) { case 1: S.position = this._curOriginalData[_++]; break; case 2: S.spacing = this._curOriginalData[_++]; break; case 3: S.rotateMix = this._curOriginalData[_++], S.translateMix = this._curOriginalData[_++]; } } } if (this._yReverseMatrix ? this._rootBone.update(this._yReverseMatrix) : this._rootBone.update(g.TEMP.identity()), this._ikArr) { var T; for (d = 0, m = this._ikArr.length; d < m; d++) T = this._ikArr[d], w.hasOwnProperty(T.name) && (T.bendDirection = w[T.name]), C.hasOwnProperty(T.name) && (T.mix = C[T.name]), T.apply(); } if (this._pathDic) for (var I in this._pathDic) (S = this._pathDic[I]).apply(this._boneList, s); if (this._tfArr) { for (d = 0, f = this._tfArr.length; d < f; d++) this._tfArr[d].apply(); } for (d = 0, f = this._boneList.length; d < f; d++) if (u = this._boneList[d], o = this._bindBoneBoneSlotDic[u.name], u.resultMatrix.copyTo(this._boneMatrixArray[d]), o) for (p = 0, m = o.length; p < m; p++) (r = o[p]) && r.setParentMatrix(u.resultMatrix); var M, E = {}, A = this._templet.deformAniArr; if (A && A.length > 0) { if (this._lastAniClipIndex != this._aniClipIndex) for (this._lastAniClipIndex = this._aniClipIndex, d = 0, m = this._boneSlotArray.length; d < m; d++) (r = this._boneSlotArray[d]).deformData = null; var L = A[this._aniClipIndex]; M = L.default, this._setDeform(M, E, this._boneSlotArray, i); var P; for (P in L) "default" != P && P != this._skinName && (M = L[P], this._setDeform(M, E, this._boneSlotArray, i)); M = L[this._skinName], this._setDeform(M, E, this._boneSlotArray, i); } var k, R, D; if (this._drawOrder) for (d = 0, m = this._drawOrder.length; d < m; d++) k = x[(r = this._boneSlotArray[this._drawOrder[d]]).name], R = b[r.name], isNaN(R) || (s.save(), s.alpha(R)), isNaN(k) || -2 == k || (this._templet.attachmentNames ? r.showDisplayByName(this._templet.attachmentNames[k]) : r.showDisplayByIndex(k)), E[this._drawOrder[d]] ? (D = E[this._drawOrder[d]], r.currDisplayData && D[r.currDisplayData.attachmentName] ? r.deformData = D[r.currDisplayData.attachmentName] : r.deformData = null) : r.deformData = null, isNaN(R) ? r.draw(s, this._boneMatrixArray, 2 == this._aniMode) : r.draw(s, this._boneMatrixArray, 2 == this._aniMode, R), isNaN(R) || s.restore(); else for (d = 0, m = this._boneSlotArray.length; d < m; d++) k = x[(r = this._boneSlotArray[d]).name], R = b[r.name], isNaN(R) || (s.save(), s.alpha(R)), isNaN(k) || -2 == k || (this._templet.attachmentNames ? r.showDisplayByName(this._templet.attachmentNames[k]) : r.showDisplayByIndex(k)), E[d] ? (D = E[d], r.currDisplayData && D[r.currDisplayData.attachmentName] ? r.deformData = D[r.currDisplayData.attachmentName] : r.deformData = null) : r.deformData = null, isNaN(R) ? r.draw(s, this._boneMatrixArray, 2 == this._aniMode) : r.draw(s, this._boneMatrixArray, 2 == this._aniMode, R), isNaN(R) || s.restore(); 0 == this._aniMode ? this._templet.setGrahicsDataWithCache(this._aniClipIndex, t, s) : 1 == this._aniMode && this._setGrahicsDataWithCache(this._aniClipIndex, t, s); }, n._setDeform = function(t, e, i, n) { if (t) { var s, a, r, o = 0, h = 0, l = 0; if (t) for (o = 0, h = t.deformSlotDataList.length; o < h; o++) for (s = t.deformSlotDataList[o], l = 0; l < s.deformSlotDisplayList.length; l++) r = i[(a = s.deformSlotDisplayList[l]).slotIndex], a.apply(n, r), e[a.slotIndex] || (e[a.slotIndex] = {}), e[a.slotIndex][a.attachment] = a.deformData; } }, n.getAnimNum = function() { return this._templet.getAnimationCount(); }, n.getAniNameByIndex = function(t) { return this._templet.getAniNameByIndex(t); }, n.getSlotByName = function(t) { return this._boneSlotDic[t]; }, n.showSkinByName = function(t, e) { void 0 === e && (e = !0), this.showSkinByIndex(this._templet.getSkinIndexByName(t), e); }, n.showSkinByIndex = function(t, e) { void 0 === e && (e = !0); for (var i = 0; i < this._boneSlotArray.length; i++) this._boneSlotArray[i].showSlotData(null, e); if (this._templet.showSkinByIndex(this._boneSlotDic, t, e)) { var n = this._templet.skinDataArray[t]; this._skinIndex = t, this._skinName = n.name; } this._clearCache(); }, n.showSlotSkinByIndex = function(t, e) { if (0 != this._aniMode) { var i = this.getSlotByName(t); i && i.showDisplayByIndex(e), this._clearCache(); } }, n.showSlotSkinByName = function(t, e) { if (0 != this._aniMode) { var i = this.getSlotByName(t); i && i.showDisplayByName(e), this._clearCache(); } }, n.replaceSlotSkinName = function(t, e, i) { if (0 != this._aniMode) { var n = this.getSlotByName(t); n && n.replaceDisplayByName(e, i), this._clearCache(); } }, n.replaceSlotSkinByIndex = function(t, e, i) { if (0 != this._aniMode) { var n = this.getSlotByName(t); n && n.replaceDisplayByIndex(e, i), this._clearCache(); } }, n.setSlotSkin = function(t, e) { if (0 != this._aniMode) { var i = this.getSlotByName(t); i && i.replaceSkin(e), this._clearCache(); } }, n._clearCache = function() { if (1 == this._aniMode) for (var t = 0, e = this._graphicsCache.length; t < e; t++) { for (var i = 0, n = this._graphicsCache[t].length; i < n; i++) { var s = this._graphicsCache[t][i]; s != this.graphics && tt.recycle(s); } this._graphicsCache[t].length = 0; } }, n.play = function(t, e, i, n, s, a, r) { void 0 === i && (i = !0), void 0 === n && (n = 0), void 0 === s && (s = 0), void 0 === a && (a = !0), void 0 === r && (r = !0), this._playAudio = r, this._indexControl = !1; var o = -1, l = NaN; if (l = e ? 2147483647 : 0, "string" == typeof t) for (var u = 0, c = this._templet.getAnimationCount(); u < c; u++) { var _ = this._templet.getAnimation(u); if (_ && t == _.name) { o = u; break; } } else o = t; o > -1 && o < this.getAnimNum() && (this._aniClipIndex = o, (i || this._pause || this._currAniIndex != o) && (this._currAniIndex = o, this._curOriginalData = new Float32Array(this._templet.getTotalkeyframesLength(o)), this._drawOrder = null, this._eventIndex = 0, this._player.play(o, this._player.playbackRate, l, n, s), a && this._templet.showSkinByIndex(this._boneSlotDic, this._skinIndex), this._pause && (this._pause = !1, this._lastTime = h.now(), this.timer.frameLoop(1, this, this._update, null, !0)), this._update())); }, n.stop = function() { this._pause || (this._pause = !0, this._player && this._player.stop(!0), this._soundChannelArr.length > 0 && this._onAniSoundStoped(!0), this.timer.clear(this, this._update)); }, n.playbackRate = function(t) { this._player && (this._player.playbackRate = t); }, n.paused = function() { if (!this._pause) { if (this._pause = !0, this._player && (this._player.paused = !0), this._soundChannelArr.length > 0) for (var t, e = this._soundChannelArr.length, i = 0; i < e; i++) (t = this._soundChannelArr[i]).isStopped || t.pause(); this.timer.clear(this, this._update); } }, n.resume = function() { if (this._indexControl = !1, this._pause) { if (this._pause = !1, this._player && (this._player.paused = !1), this._soundChannelArr.length > 0) for (var t, e = this._soundChannelArr.length, i = 0; i < e; i++) (t = this._soundChannelArr[i]).audioBuffer && t.resume(); this._lastTime = h.now(), this.timer.frameLoop(1, this, this._update, null, !0); } }, n._getGrahicsDataWithCache = function(t, e) { return this._graphicsCache[t][e]; }, n._setGrahicsDataWithCache = function(t, e, i) { this._graphicsCache[t][e] = i; }, n.destroy = function(e) { void 0 === e && (e = !0), t.prototype.destroy.call(this, e), this._templet = null, this._player && this._player.offAll(), this._player = null, this._curOriginalData = null, this._boneMatrixArray.length = 0, this._lastTime = 0, this.timer.clear(this, this._update), this._soundChannelArr.length > 0 && this._onAniSoundStoped(!0); }, a(0, n, "url", function() { return this._aniPath; }, function(t) { this.load(t); }), a(0, n, "index", function() { return this._index; }, function(t) { this.player && (this._index = t, this._player.currentTime = 1e3 * this._index / this._player.cacheFrameRate, this._indexControl = !0, this._update(!1)); }), a(0, n, "total", function() { return this._templet && this._player ? this._total = Math.floor(this._templet.getAniDuration(this._player.currentAnimationClipIndex) / 1e3 * this._player.cacheFrameRate) : this._total = -1, this._total; }), a(0, n, "templet", function() { return this._templet; }), a(0, n, "player", function() { return this._player; }), e.useSimpleMeshInCanvas = !1, e; }(w), at = (function(t) { function e(t) { this._start = 0, this._Pos = 0, this._data = null, this._curIndex = 0, this._preIndex = 0, this._playIndex = 0, this._playing = !1, this._ended = !0, this._count = 0, this._ids = null, this._loadedImage = {}, this._idOfSprite = null, this._parentMovieClip = null, this._movieClipList = null, this._labels = null, this.basePath = null, this._atlasPath = null, this._url = null, this._isRoot = !1, this._completeHandler = null, this._endFrame = -1, this.interval = 30, this.loop = !1, e.__super.call(this), this._ids = {}, this._idOfSprite = [], this._reset(), this._playing = !1, this._parentMovieClip = t, t ? (this._isRoot = !1, this._movieClipList = t._movieClipList, this._movieClipList.push(this)) : (this._movieClipList = [ this ], this._isRoot = !0, this._setUpNoticeType(1)); } s(e, "laya.ani.swf.MovieClip", t); var n = e.prototype; n.destroy = function(e) { void 0 === e && (e = !0), this._clear(), t.prototype.destroy.call(this, e); }, n._setDisplay = function(e) { t.prototype._setDisplay.call(this, e), this._isRoot && this._$3__onDisplay(e); }, n._$3__onDisplay = function(t) { t ? this.timer.loop(this.interval, this, this.updates, null, !0) : this.timer.clear(this, this.updates); }, n.updates = function() { if (!this._parentMovieClip) { var t = 0, e = 0; for (e = this._movieClipList.length, t = 0; t < e; t++) this._movieClipList[t] && this._movieClipList[t]._update(); } }, n.addLabel = function(t, e) { this._labels || (this._labels = {}), this._labels[e] = t; }, n.removeLabel = function(t) { if (t) { if (!this._labels) for (var e in this._labels) if (this._labels[e] === t) { delete this._labels[e]; break; } } else this._labels = null; }, n._update = function() { if (this._data && this._playing) { if (this._playIndex++, this._playIndex >= this._count) { if (!this.loop) return this._playIndex--, void this.stop(); this._playIndex = 0; } if (this._parse(this._playIndex), this._labels && this._labels[this._playIndex] && this.event("label", this._labels[this._playIndex]), -1 != this._endFrame && this._endFrame == this._playIndex) { if (this._endFrame = -1, null != this._completeHandler) { var t = this._completeHandler; this._completeHandler = null, t.run(); } this.stop(); } } }, n.stop = function() { this._playing = !1; }, n.gotoAndStop = function(t) { this.index = t, this.stop(); }, n._clear = function() { if (this.stop(), this._idOfSprite.length = 0, !this._parentMovieClip) { this.timer.clear(this, this.updates); var t = 0, e = 0; for (e = this._movieClipList.length, t = 0; t < e; t++) this._movieClipList[t] != this && this._movieClipList[t]._clear(); this._movieClipList.length = 0; } this._atlasPath && p.clearRes(this._atlasPath); var i; for (i in this._loadedImage) this._loadedImage[i] && (p.clearRes(i), this._loadedImage[i] = !1); this.removeChildren(), this.graphics = null, this._parentMovieClip = null; }, n.play = function(t, e) { void 0 === t && (t = 0), void 0 === e && (e = !0), this.loop = e, this._playing = !0, this._data && this._displayFrame(t); }, n._displayFrame = function(t) { void 0 === t && (t = -1), -1 != t && (this._curIndex > t && this._reset(), this._parse(t)); }, n._reset = function(t) { void 0 === t && (t = !0), t && 1 != this._curIndex && this.removeChildren(), this._preIndex = this._curIndex = -1, this._Pos = this._start; }, n._parse = function(t) { var i, n, s, a = 0, r = 0, o = 0, h = !1, l = this._idOfSprite, u = this._data; for (this._ended && this._reset(), u.pos = this._Pos, this._ended = !1, this._playIndex = t, this._curIndex > t && t < this._preIndex && (this._reset(!0), u.pos = this._Pos); this._curIndex <= t && !this._ended; ) switch (u.getUint16()) { case 12: if (a = u.getUint16(), r = this._ids[u.getUint16()], this._Pos = u.pos, u.pos = r, 0 == (o = u.getUint8())) { var c = u.getUint16(); if (!(n = l[a])) { n = l[a] = new w(); var _ = new w(); _.loadImage(this.basePath + c + ".png"), this._loadedImage[this.basePath + c + ".png"] = !0, n.addChild(_), _.size(u.getFloat32(), u.getFloat32()); var d = u._getMatrix(); _.transform = d; } n.alpha = 1; } else 1 == o && ((i = l[a]) || (l[a] = i = new e(this), i.interval = this.interval, i._ids = this._ids, i.basePath = this.basePath, i._setData(u, r), i._initState(), i.play(0)), i.alpha = 1); u.pos = this._Pos; break; case 3: var p = l[u.getUint16()]; p && (this.addChild(p), p.zOrder = u.getUint16(), h = !0); break; case 4: (p = l[u.getUint16()]) && p.removeSelf(); break; case 5: l[u.getUint16()][e._ValueList[u.getUint16()]] = u.getFloat32(); break; case 6: l[u.getUint16()].visible = u.getUint8() > 0; break; case 7: var f = (n = l[u.getUint16()]).transform || g.create(); f.setTo(u.getFloat32(), u.getFloat32(), u.getFloat32(), u.getFloat32(), u.getFloat32(), u.getFloat32()), n.transform = f; break; case 8: l[u.getUint16()].setPos(u.getFloat32(), u.getFloat32()); break; case 9: l[u.getUint16()].setSize(u.getFloat32(), u.getFloat32()); break; case 10: l[u.getUint16()].alpha = u.getFloat32(); break; case 11: l[u.getUint16()].setScale(u.getFloat32(), u.getFloat32()); break; case 98: s = u.getString(), this.event(s), "stop" == s && this.stop(); break; case 99: this._curIndex = u.getUint16(), h && this.updateZOrder(); break; case 100: this._count = this._curIndex + 1, this._ended = !0, this._playing && (this.event("enterframe"), this.event("end"), this.event("complete")), this._reset(!1); } this._playing && !this._ended && this.event("enterframe"), this._Pos = u.pos; }, n._setData = function(t, e) { this._data = t, this._start = e + 3; }, n.load = function(t, e, n) { void 0 === e && (e = !1), this._url = t, e && (this._atlasPath = n || t.split(".swf")[0] + ".json"), this.stop(), this._clear(), this._movieClipList = [ this ]; var s; s = [ { url: t, type: "arraybuffer" } ], this._atlasPath && s.push({ url: this._atlasPath, type: "atlas" }), i.loader.load(s, d.create(this, this._onLoaded)); }, n._onLoaded = function() { var t; (t = p.getRes(this._url)) ? !this._atlasPath || p.getAtlas(this._atlasPath) ? (this.basePath = this._atlasPath ? p.getAtlas(this._atlasPath).dir : this._url.split(".swf")[0] + "/image/", this._initData(t)) : this.event("error", "Atlas not find") : this.event("error", "file not find"); }, n._initState = function() { this._reset(), this._ended = !1; var t = this._playing; for (this._playing = !1, this._curIndex = 0; !this._ended; ) this._parse(++this._curIndex); this._playing = t; }, n._initData = function(t) { this._data = new l(t); var e = 0, i = this._data.getUint16(); for (e = 0; e < i; e++) this._ids[this._data.getInt16()] = this._data.getInt32(); this.interval = 1e3 / this._data.getUint16(), this._setData(this._data, this._ids[32767]), this._initState(), this.play(0), this.event("loaded"), this._parentMovieClip || this.timer.loop(this.interval, this, this.updates, null, !0); }, n.playTo = function(t, e, i) { this._completeHandler = i, this._endFrame = e, this.play(t, !1); }, a(0, n, "index", function() { return this._playIndex; }, function(t) { this._playIndex = t, this._data && this._displayFrame(this._playIndex), this._labels && this._labels[t] && this.event("label", this._labels[t]); }), a(0, n, "count", function() { return this._count; }), a(0, n, "playing", function() { return this._playing; }), a(0, n, "url", null, function(t) { this.load(t); }), e._ValueList = [ "x", "y", "width", "height", "scaleX", "scaleY", "rotation", "alpha" ]; }(w), function(t) { function e() { this._mainTexture = null, this._textureJson = null, this._graphicsCache = [], this.srcBoneMatrixArr = [], this.ikArr = [], this.tfArr = [], this.pathArr = [], this.boneSlotDic = {}, this.bindBoneBoneSlotDic = {}, this.boneSlotArray = [], this.skinDataArray = [], this.skinDic = {}, this.subTextureDic = {}, this.isParseFail = !1, this.yReverseMatrix = null, this.drawOrderAniArr = [], this.eventAniArr = [], this.attachmentNames = null, this.deformAniArr = [], this._isParseAudio = !1, this._isDestroyed = !1, this._rate = 30, this.isParserComplete = !1, this.aniSectionDic = {}, this._skBufferUrl = null, this._textureDic = {}, this._loadList = null, this._path = null, this.tMatrixDataLen = 0, this.mRootBone = null, e.__super.call(this), this.skinSlotDisplayDataArr = [], this.mBoneArr = []; } s(e, "laya.ani.bone.Templet", t); var n = e.prototype; return n.loadAni = function(t) { this._skBufferUrl = t, i.loader.load(t, d.create(this, this.onComplete), null, "arraybuffer"); }, n.onComplete = function(t) { if (this._isDestroyed) this.destroy(); else { var e = p.getRes(this._skBufferUrl); e ? (this._path = this._skBufferUrl.slice(0, this._skBufferUrl.lastIndexOf("/")) + "/", this.parseData(null, e)) : this.event("error", "load failed:" + this._skBufferUrl); } }, n.parseData = function(t, e, i) { void 0 === i && (i = 30), !this._path && this.url && (this._path = this.url.slice(0, this.url.lastIndexOf("/")) + "/"), this._mainTexture = t, this._mainTexture && v.isWebGL && t.bitmap && (t.bitmap.enableMerageInAtlas = !1), this._rate = i, this.parse(e); }, n.buildArmature = function(t) { return void 0 === t && (t = 0), new st(this, t); }, n.parse = function(i) { t.prototype.parse.call(this, i), this._endLoaded(), this._aniVersion === e.LAYA_ANIMATION_VISION ? this._isParseAudio = !0 : this._aniVersion != e.LAYA_ANIMATION_160_VISION && (console.log("[Error] 版本不一致,请使用IDE版本配套的重新导出" + this._aniVersion + "->" + e.LAYA_ANIMATION_VISION), this._loaded = !1), this.loaded ? this._mainTexture ? this._parsePublicExtData() : this._parseTexturePath() : (this.event("error", this), this.isParseFail = !0); }, n._parseTexturePath = function() { if (this._isDestroyed) this.destroy(); else { var t = 0; this._loadList = []; var e, n = new l(this.getPublicExtData()), s = 0, a = 0, r = 0, o = n.getInt32(), h = n.readUTFString(), u = h.split("\n"); for (t = 0; t < o; t++) e = this._path + u[2 * t], h = u[2 * t + 1], n.getFloat32(), n.getFloat32(), s = n.getFloat32(), a = n.getFloat32(), r = n.getFloat32(), isNaN(r) ? 0 : r, r = n.getFloat32(), isNaN(r) ? 0 : r, r = n.getFloat32(), isNaN(r) ? s : r, r = n.getFloat32(), isNaN(r) ? a : r, -1 == this._loadList.indexOf(e) && this._loadList.push(e); i.loader.load(this._loadList, d.create(this, this._textureComplete)); } }, n._textureComplete = function() { for (var t, e, i = 0, n = this._loadList.length; i < n; i++) e = this._loadList[i], t = this._textureDic[e] = p.getRes(e), v.isWebGL && t && t.bitmap && (t.bitmap.enableMerageInAtlas = !1); this._parsePublicExtData(); }, n._parsePublicExtData = function() { var t = 0, e = 0, i = 0, n = 0, s = 0; for (t = 0, s = this.getAnimationCount(); t < s; t++) this._graphicsCache.push([]); var a = !1; a = "Dragon" != this._aniClassName; var r, o, h = new l(this.getPublicExtData()), u = 0, c = 0, _ = 0, d = 0, p = 0, f = 0, m = 0, v = 0, y = 0, x = h.getInt32(), b = h.readUTFString(), w = b.split("\n"); for (t = 0; t < x; t++) { if (r = this._mainTexture, o = this._path + w[2 * t], b = w[2 * t + 1], null == this._mainTexture && (r = this._textureDic[o]), !r) return this.event("error", this), void (this.isParseFail = !0); u = h.getFloat32(), c = h.getFloat32(), _ = h.getFloat32(), d = h.getFloat32(), y = h.getFloat32(), p = isNaN(y) ? 0 : y, y = h.getFloat32(), f = isNaN(y) ? 0 : y, y = h.getFloat32(), m = isNaN(y) ? _ : y, y = h.getFloat32(), v = isNaN(y) ? d : y, this.subTextureDic[b] = S.create(r, u, c, _, d, -p, -f, m, v); } this._mainTexture = r; var C, T = h.getUint16(); for (t = 0; t < T; t++) (C = []).push(h.getUint16()), C.push(h.getUint16()), C.push(h.getUint16()), C.push(h.getUint16()), this.aniSectionDic[t] = C; var I, M, E, A, k, R = h.getInt16(), z = {}; for (t = 0; t < R; t++) I = new L(), 0 == t ? k = I : I.root = k, I.d = a ? -1 : 1, E = h.readUTFString(), A = h.readUTFString(), I.length = h.getFloat32(), 1 == h.getByte() && (I.inheritRotation = !1), 1 == h.getByte() && (I.inheritScale = !1), I.name = E, A && ((M = z[A]) ? M.addChild(I) : this.mRootBone = I), z[E] = I, this.mBoneArr.push(I); this.tMatrixDataLen = h.getUint16(); var V, W = h.getUint16(), j = Math.floor(W / this.tMatrixDataLen), q = this.srcBoneMatrixArr; for (t = 0; t < j; t++) (V = new $()).scX = h.getFloat32(), V.skX = h.getFloat32(), V.skY = h.getFloat32(), V.scY = h.getFloat32(), V.x = h.getFloat32(), V.y = h.getFloat32(), 8 === this.tMatrixDataLen && (V.skewX = h.getFloat32(), V.skewY = h.getFloat32()), q.push(V), (I = this.mBoneArr[t]).transform = V; var Z, J = h.getUint16(), Q = 0; for (t = 0; t < J; t++) { for (Z = new U(), Q = h.getUint16(), e = 0; e < Q; e++) Z.boneNames.push(h.readUTFString()), Z.boneIndexs.push(h.getInt16()); Z.name = h.readUTFString(), Z.targetBoneName = h.readUTFString(), Z.targetBoneIndex = h.getInt16(), Z.bendDirection = h.getFloat32(), Z.mix = h.getFloat32(), Z.isSpine = a, this.ikArr.push(Z); } var tt, et = h.getUint16(), it = 0; for (t = 0; t < et; t++) { for (tt = new K(), it = h.getUint16(), e = 0; e < it; e++) tt.boneIndexs.push(h.getInt16()); tt.name = h.getUTFString(), tt.targetIndex = h.getInt16(), tt.rotateMix = h.getFloat32(), tt.translateMix = h.getFloat32(), tt.scaleMix = h.getFloat32(), tt.shearMix = h.getFloat32(), tt.offsetRotation = h.getFloat32(), tt.offsetX = h.getFloat32(), tt.offsetY = h.getFloat32(), tt.offsetScaleX = h.getFloat32(), tt.offsetScaleY = h.getFloat32(), tt.offsetShearY = h.getFloat32(), this.tfArr.push(tt); } var nt, st = h.getUint16(), at = 0; for (t = 0; t < st; t++) { for ((nt = new G()).name = h.readUTFString(), at = h.getUint16(), e = 0; e < at; e++) nt.bones.push(h.getInt16()); nt.target = h.readUTFString(), nt.positionMode = h.readUTFString(), nt.spacingMode = h.readUTFString(), nt.rotateMode = h.readUTFString(), nt.offsetRotation = h.getFloat32(), nt.position = h.getFloat32(), nt.spacing = h.getFloat32(), nt.rotateMix = h.getFloat32(), nt.translateMix = h.getFloat32(), this.pathArr.push(nt); } var rt, ot, ht, lt, ut = 0, ct = 0, _t = 0, dt = NaN, pt = 0, ft = h.getInt16(); for (t = 0; t < ft; t++) { var gt = h.getUint8(), mt = {}; this.deformAniArr.push(mt); for (var vt = 0; vt < gt; vt++) for ((rt = new D()).skinName = h.getUTFString(), mt[rt.skinName] = rt, ut = h.getInt16(), e = 0; e < ut; e++) for (ot = new N(), rt.deformSlotDataList.push(ot), ct = h.getInt16(), i = 0; i < ct; i++) for (ht = new F(), ot.deformSlotDisplayList.push(ht), ht.slotIndex = h.getInt16(), ht.attachment = h.getUTFString(), _t = h.getInt16(), n = 0; n < _t; n++) for (1 == h.getByte() ? ht.tweenKeyList.push(!0) : ht.tweenKeyList.push(!1), dt = h.getFloat32(), ht.timeList.push(dt), lt = [], ht.vectices.push(lt), pt = h.getInt16(), s = 0; s < pt; s++) lt.push(h.getFloat32()); } var yt, xt, bt = h.getInt16(), wt = 0, Ct = 0; for (t = 0; t < bt; t++) { for (wt = h.getInt16(), yt = [], e = 0; e < wt; e++) { for ((xt = new B()).time = h.getFloat32(), Ct = h.getInt16(), i = 0; i < Ct; i++) xt.drawOrder.push(h.getInt16()); yt.push(xt); } this.drawOrderAniArr.push(yt); } var St, Tt, It = h.getInt16(), Mt = 0; for (t = 0; t < It; t++) { for (Mt = h.getInt16(), St = [], e = 0; e < Mt; e++) (Tt = new O()).name = h.getUTFString(), this._isParseAudio && (Tt.audioValue = h.getUTFString()), Tt.intValue = h.getInt32(), Tt.floatValue = h.getFloat32(), Tt.stringValue = h.getUTFString(), Tt.time = h.getFloat32(), St.push(Tt); this.eventAniArr.push(St); } var Et = h.getInt16(); if (Et > 0) for (this.attachmentNames = [], t = 0; t < Et; t++) this.attachmentNames.push(h.getUTFString()); var At, Lt, Pt = h.getInt16(); for (t = 0; t < Pt; t++) (At = new P()).name = h.readUTFString(), At.parent = h.readUTFString(), At.attachmentName = h.readUTFString(), At.srcDisplayIndex = At.displayIndex = h.getInt16(), At.templet = this, this.boneSlotDic[At.name] = At, null == (Lt = this.bindBoneBoneSlotDic[At.parent]) && (this.bindBoneBoneSlotDic[At.parent] = Lt = []), Lt.push(At), this.boneSlotArray.push(At); var kt, Rt, Dt, Nt = h.readUTFString().split("\n"), Ft = 0, Bt = h.getUint8(), Ot = 0, zt = 0, Ut = 0, Vt = 0, Wt = 0, Gt = 0, Ht = 0; for (t = 0; t < Bt; t++) { for ((kt = new H()).name = Nt[Ft++], Ot = h.getUint8(), e = 0; e < Ot; e++) { for ((Rt = new X()).name = Nt[Ft++], At = this.boneSlotDic[Rt.name], zt = h.getUint8(), i = 0; i < zt; i++) { if (Dt = new Y(), this.skinSlotDisplayDataArr.push(Dt), Dt.name = Nt[Ft++], Dt.attachmentName = Nt[Ft++], Dt.transform = new $(), Dt.transform.scX = h.getFloat32(), Dt.transform.skX = h.getFloat32(), Dt.transform.skY = h.getFloat32(), Dt.transform.scY = h.getFloat32(), Dt.transform.x = h.getFloat32(), Dt.transform.y = h.getFloat32(), Rt.displayArr.push(Dt), Dt.width = h.getFloat32(), Dt.height = h.getFloat32(), Dt.type = h.getUint8(), Dt.verLen = h.getUint16(), (R = h.getUint16()) > 0) for (Dt.bones = [], n = 0; n < R; n++) { var Yt = h.getUint16(); Dt.bones.push(Yt); } if ((Ut = h.getUint16()) > 0) for (Dt.uvs = [], n = 0; n < Ut; n++) Dt.uvs.push(h.getFloat32()); if ((Vt = h.getUint16()) > 0) for (Dt.weights = [], n = 0; n < Vt; n++) Dt.weights.push(h.getFloat32()); if ((Wt = h.getUint16()) > 0) for (Dt.triangles = [], n = 0; n < Wt; n++) Dt.triangles.push(h.getUint16()); if ((Gt = h.getUint16()) > 0) for (Dt.vertices = [], n = 0; n < Gt; n++) Dt.vertices.push(h.getFloat32()); if ((Ht = h.getUint16()) > 0) for (Dt.lengths = [], n = 0; n < Ht; n++) Dt.lengths.push(h.getFloat32()); } kt.slotArr.push(Rt); } this.skinDic[kt.name] = kt, this.skinDataArray.push(kt); } 1 == h.getUint8() ? (this.yReverseMatrix = new g(1, 0, 0, -1, 0, 0), k && k.setTempMatrix(this.yReverseMatrix)) : k && k.setTempMatrix(new g()), this.showSkinByIndex(this.boneSlotDic, 0), this.isParserComplete = !0, this.event("complete", this); }, n.getTexture = function(t) { var e = this.subTextureDic[t]; return e || (e = this.subTextureDic[t.substr(0, t.length - 1)]), null == e ? this._mainTexture : e; }, n.showSkinByIndex = function(t, e, i) { if (void 0 === i && (i = !0), e < 0 && e >= this.skinDataArray.length) return !1; var n, s, a = 0, r = 0, o = this.skinDataArray[e]; if (o) { for (a = 0, r = o.slotArr.length; a < r; a++) (s = o.slotArr[a]) && (n = t[s.name]) && (n.showSlotData(s, i), i && "undefined" != n.attachmentName && "null" != n.attachmentName ? n.showDisplayByName(n.attachmentName) : n.showDisplayByIndex(n.displayIndex)); return !0; } return !1; }, n.getSkinIndexByName = function(t) { for (var e = 0, i = this.skinDataArray.length; e < i; e++) if (this.skinDataArray[e].name == t) return e; return -1; }, n.getGrahicsDataWithCache = function(t, e) { return this._graphicsCache[t] && this._graphicsCache[t][e] ? this._graphicsCache[t][e] : null; }, n.setGrahicsDataWithCache = function(t, e, i) { this._graphicsCache[t][e] = i; }, n.destroy = function() { this._isDestroyed = !0; var t; for (var i in this.subTextureDic) (t = this.subTextureDic[i]) && t.destroy(); for (i in this._textureDic) (t = this._textureDic[i]) && t.destroy(); for (var n = 0, s = this.skinSlotDisplayDataArr.length; n < s; n++) this.skinSlotDisplayDataArr[n].destory(); this.skinSlotDisplayDataArr.length = 0, this.url && delete e.TEMPLET_DICTIONARY[this.url], laya.resource.Resource.prototype.destroy.call(this); }, n.getAniNameByIndex = function(t) { var e = this.getAnimation(t); return e ? e.name : null; }, a(0, n, "rate", function() { return this._rate; }, function(t) { this._rate = t; }), e.LAYA_ANIMATION_160_VISION = "LAYAANIMATION:1.6.0", e.LAYA_ANIMATION_VISION = "LAYAANIMATION:1.7.0", e.TEMPLET_DICTIONARY = null, e; }(it)); }(window, document, Laya), "function" == typeof define && define.amd && define("laya.core", [ "require", "exports" ], function(t, e) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }); for (var i in Laya) { var n = Laya[i]; n && n.__isclass && (e[i] = n); } }), function(t, e, i) { i.un, i.uns, i.static; var n = i.class, s = i.getset, a = (i.__newvec, laya.utils.Browser, laya.utils.Color), r = laya.filters.ColorFilterAction, o = laya.filters.webgl.ColorFilterActionGL, h = laya.filters.Filter, l = laya.filters.webgl.FilterActionGL, u = laya.maths.Matrix, c = (laya.maths.Rectangle, laya.renders.Render), _ = (laya.renders.RenderContext, laya.webgl.resource.RenderTarget2D), d = laya.utils.RunDriver, p = (laya.webgl.shader.d2.ShaderDefines2D, laya.display.Sprite, laya.resource.Texture, laya.webgl.shader.d2.value.Value2D), f = function() { function t() { this.data = null; } n(t, "laya.filters.FilterAction"); var e = t.prototype; return i.imps(e, { "laya.filters.IFilterAction": !0 }), e.apply = function(t) { return null; }, t; }(), g = function() { function t() {} return n(t, "laya.filters.WebGLFilter"), t.enable = function() { t.isInit || (t.isInit = !0, c.isWebGL && (d.createFilterAction = function(t) { var e; switch (t) { case 32: e = new o(); break; case 16: e = new m(); break; case 8: e = new v(); } return e; })); }, t.isInit = !1, t.__init$ = function() { d.createFilterAction = function(t) { var e; switch (t) { case 16: case 8: e = new f(); break; case 32: e = new r(); } return e; }; }, t; }(), m = (function(t) { function e(t) { this.strength = NaN, this.strength_sig2_2sig2_gauss1 = [], e.__super.call(this), void 0 === t && (t = 4), c.isWebGL && g.enable(), this.strength = t, this._action = d.createFilterAction(16), this._action.data = this; } n(e, "laya.filters.BlurFilter", h); var i = e.prototype; i.callNative = function(t) { t.conchModel && t.conchModel.blurFilter && t.conchModel.blurFilter(this.strength); }, s(0, i, "action", function() { return this._action; }), s(0, i, "type", function() { return 16; }); }(), function(t) { function e(t, i, n, s) { this._color = null, e.__super.call(this), this._elements = new Float32Array(9), void 0 === i && (i = 4), void 0 === n && (n = 6), void 0 === s && (s = 6), c.isWebGL && g.enable(), this._color = new a(t), this.blur = Math.min(i, 20), this.offX = n, this.offY = s, this._action = d.createFilterAction(8), this._action.data = this; } n(e, "laya.filters.GlowFilter", h); var i = e.prototype; i.getColor = function() { return this._color._color; }, i.callNative = function(t) { t.conchModel && t.conchModel.glowFilter && t.conchModel.glowFilter(this._color.strColor, this._elements[4], this._elements[5], this._elements[6]); }, s(0, i, "type", function() { return 8; }), s(0, i, "action", function() { return this._action; }), s(0, i, "offY", function() { return this._elements[6]; }, function(t) { this._elements[6] = t; }), s(0, i, "offX", function() { return this._elements[5]; }, function(t) { this._elements[5] = t; }), s(0, i, "blur", function() { return this._elements[4]; }, function(t) { this._elements[4] = t; }); }(), function(t) { function e() { this.data = null, e.__super.call(this); } n(e, "laya.filters.webgl.BlurFilterActionGL", l); var i = e.prototype; return i.setValueMix = function(t) { t.defines.add(this.data.type); }, i.apply3d = function(t, e, i, n, s) { var a = t.getValue("bounds"), r = p.create(1, 0); r.setFilters([ this.data ]); u.EMPTY.identity(), i.ctx.drawTarget(t, 0, 0, a.width, a.height, u.EMPTY, "src", r), r.setFilters(null); }, i.setValue = function(t) { t.strength = this.data.strength; var e = this.data.strength / 3, i = e * e; this.data.strength_sig2_2sig2_gauss1[0] = this.data.strength, this.data.strength_sig2_2sig2_gauss1[1] = i, this.data.strength_sig2_2sig2_gauss1[2] = 2 * i, this.data.strength_sig2_2sig2_gauss1[3] = 1 / (2 * Math.PI * i), t.strength_sig2_2sig2_gauss1 = this.data.strength_sig2_2sig2_gauss1; }, s(0, i, "typeMix", function() { return 16; }), e; }()), v = function(t) { function e() { this.data = null, this._initKey = !1, this._textureWidth = 0, this._textureHeight = 0, e.__super.call(this); } n(e, "laya.filters.webgl.GlowFilterActionGL", l); var a = e.prototype; return i.imps(a, { "laya.filters.IFilterActionGL": !0 }), a.setValueMix = function(t) {}, a.apply3d = function(t, e, i, n, s) { var a = t.getValue("bounds"); t.addValue("color", this.data.getColor()); var r = a.width, o = a.height; this._textureWidth = r, this._textureHeight = o; var h, l = u.TEMP; return l.identity(), (h = p.create(1, 0)).setFilters([ this.data ]), i.ctx.drawTarget(t, 0, 0, this._textureWidth, this._textureHeight, l, "src", h, null), h = p.create(1, 0), i.ctx.drawTarget(t, 0, 0, this._textureWidth, this._textureHeight, l, "src", h), null; }, a.setSpriteWH = function(t) { this._textureWidth = t.width, this._textureHeight = t.height; }, a.setValue = function(t) { t.u_offsetX = this.data.offX, t.u_offsetY = -this.data.offY, t.u_strength = 1, t.u_blurX = this.data.blur, t.u_blurY = this.data.blur, t.u_textW = this._textureWidth, t.u_textH = this._textureHeight, t.u_color = this.data.getColor(); }, s(0, a, "typeMix", function() { return 8; }), e.tmpTarget = function(t, e, i, n, s) { var a = t.getValue("bounds"); t.getValue("out").end(); var r = _.create(a.width, a.height); r.start(); var o = t.getValue("color"); o && r.clear(o[0], o[1], o[2], 0), t.addValue("tmpTarget", r); }, e.startOut = function(t, e, i, n, s) { t.getValue("tmpTarget").end(); var a = t.getValue("out"); a.start(); var r = t.getValue("color"); r && a.clear(r[0], r[1], r[2], 0); }, e.recycleTarget = function(t, e, i, n, s) { t.getValue("src"); t.getValue("tmpTarget").recycle(); }, e; }(); i.__init([ g ]); }(window, document, Laya), "function" == typeof define && define.amd && define("laya.core", [ "require", "exports" ], function(t, e) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }); for (var i in Laya) { var n = Laya[i]; n && n.__isclass && (e[i] = n); } }), function(t, e, i) { i.un, i.uns; var n = i.static, s = i.class, a = i.getset, r = (i.__newvec, laya.utils.Browser, laya.display.css.CSSStyle), o = laya.utils.ClassUtils, h = (laya.events.Event, laya.utils.HTMLChar), l = laya.net.Loader, u = (laya.display.Node, laya.maths.Rectangle), c = laya.renders.Render, _ = (laya.renders.RenderContext, laya.renders.RenderSprite, laya.display.Sprite), d = laya.utils.Stat, p = laya.display.Text, f = laya.resource.Texture, g = laya.net.URL, m = laya.utils.Utils, v = function() { function t() {} return s(t, "laya.html.utils.HTMLParse"), t.parse = function(e, i, n) { i = (i = "" + (i = i.replace(/
/g, "
")) + "
").replace(t.spacePattern, t.char255); var s = m.parseXMLFromString(i); t._parseXML(e, s.childNodes[0].childNodes, n); }, t._parseXML = function(e, i, n, s) { var a = 0, r = 0; if (i.join || i.item) for (a = 0, r = i.length; a < r; ++a) t._parseXML(e, i[a], n, s); else { var h, l; if (3 == i.nodeType) { var u; return void (e instanceof laya.html.dom.HTMLDivElement ? (null == i.nodeName && (i.nodeName = "#text"), l = i.nodeName.toLowerCase(), (u = i.textContent.replace(/^\s+|\s+$/g, "")).length > 0 && (h = o.getInstance(l)) && (e.addChild(h), h.innerTEXT = u.replace(t.char255AndOneSpacePattern, " "))) : (u = i.textContent.replace(/^\s+|\s+$/g, "")).length > 0 && (e.innerTEXT = u.replace(t.char255AndOneSpacePattern, " "))); } if ("#comment" == (l = i.nodeName.toLowerCase())) return; if (h = o.getInstance(l)) { (h = e.addChild(h)).URI = n, h.href = s; var c = i.attributes; if (c && c.length > 0) for (a = 0, r = c.length; a < r; ++a) { var _ = c[a], d = _.nodeName, p = _.value; h._setAttributes(d, p); } t._parseXML(h, i.childNodes, n, h.href); } else t._parseXML(e, i.childNodes, n, s); } }, t.char255 = String.fromCharCode(255), t.spacePattern = / | /g, t.char255AndOneSpacePattern = new RegExp(String.fromCharCode(255) + "|(\\s+)", "g"), t; }(), y = function() { function t() {} return s(t, "laya.html.utils.Layout"), t.later = function(e) { null == t._will && (t._will = [], i.stage.frameLoop(1, null, function() { if (!(t._will.length < 1)) { for (var e = 0; e < t._will.length; e++) laya.html.utils.Layout.layout(t._will[e]); t._will.length = 0; } })), t._will.push(e); }, t.layout = function(e) { if (!e || !e._style) return null; if (0 == (512 & e._style._type)) return null; e.getStyle()._type &= -513; var i = t._multiLineLayout(e); return c.isConchApp && e.layaoutCallNative && e.layaoutCallNative(), i; }, t._multiLineLayout = function(e) { function i() { A.y = T, T += A.h + d, 0 == A.h && (T += f), A.mWidth = k, k = 0, A = new x(), E.push(A), A.h = 0, S = 0, R = !0, L = !1; } if (p.RightToLeft) return t._multiLineLayout2(e); var n = new Array(); e._addChildsToLayout(n); var s, a, r, o, h, l = 0, u = n.length, c = e._getCSSStyle(), _ = c.letterSpacing, d = c.leading, f = c.lineHeight, g = c._widthAuto() || !c.wordWrap, m = g ? 999999 : e.width, v = (e.height, 0), y = c.italic ? c.fontSize / 3 : 0, b = c._getAlign(), w = c._getValign(), C = 0 !== w || 0 !== b || 0 != f, S = 0, T = 0, I = 0, M = 0, E = new Array(), A = E[0] = new x(), L = !1, P = !1; A.h = 0, c.italic && (m -= c.fontSize / 3); var k = 0, R = !0; for (l = 0; l < u; l++) if (null != (s = n[l])) if (R = !1, s instanceof laya.html.dom.HTMLBrElement) i(), A.y = T; else { if (s._isChar()) { if ((o = s).isWord) L = P || "\n" === o.char, A.wordStartIndex = A.elements.length; else { if (E.length > 0 && S + I > m && A.wordStartIndex > 0) { var D = 0; D = A.elements.length - A.wordStartIndex + 1, A.elements.length = A.wordStartIndex, l -= D, i(); continue; } L = !1, k += o.width; } I = o.width + _, M = o.height, P = !1, (L = L || S + I > m) && i(), A.minTextHeight = Math.min(A.minTextHeight, s.height); } else h = s, r = (a = s._getCSSStyle()).padding, 0 === a._getCssFloat() || (C = !0), L = P || a.lineElement, I = h.width * h._style._tf.scaleX + r[1] + r[3] + _, M = h.height * h._style._tf.scaleY + r[0] + r[2], P = a.lineElement, (L = L || S + I > m && a.wordWrap) && i(); A.elements.push(s), A.h = Math.max(A.h, M), s.x = S, s.y = T, S += I, A.w = S - _, A.y = T, v = Math.max(S + y, v); } else R || (S += t.DIV_ELEMENT_PADDING), A.wordStartIndex = A.elements.length; if (T = A.y + A.h, C) { var N = 0, F = m; for (g && e.width > 0 && (F = e.width), l = 0, u = E.length; l < u; l++) E[l].updatePos(0, F, l, N, b, w, f), N += Math.max(f, E[l].h + d); T = N; } return g && (e.width = v), T > e.height && (e.height = T), [ v, T ]; }, t._multiLineLayout2 = function(e) { function i() { E.y = S, S += E.h + d, 0 == E.h && (S += p), E.mWidth = P, P = 0, E = new x(), M.push(E), E.h = 0, C = 0, k = !0, A = !1; } var n = new Array(); e._addChildsToLayout(n); var s, a, r, o, h, l = 0, u = n.length, c = e._getCSSStyle(), _ = c.letterSpacing, d = c.leading, p = c.lineHeight, f = c._widthAuto() || !c.wordWrap, g = f ? 999999 : e.width, m = (e.height, 0), v = c.italic ? c.fontSize / 3 : 0, y = 2 - c._getAlign(), b = c._getValign(), w = 0 !== b || 0 !== y || 0 != p, C = 0, S = 0, T = 0, I = 0, M = new Array(), E = M[0] = new x(), A = !1, L = !1; E.h = 0, c.italic && (g -= c.fontSize / 3); var P = 0, k = !0; for (l = 0; l < u; l++) if (null != (s = n[l])) if (k = !1, s instanceof laya.html.dom.HTMLBrElement) i(), E.y = S; else { if (s._isChar()) { if ((o = s).isWord) A = L || "\n" === o.char, E.wordStartIndex = E.elements.length; else { if (M.length > 0 && C + T > g && E.wordStartIndex > 0) { var R = 0; R = E.elements.length - E.wordStartIndex + 1, E.elements.length = E.wordStartIndex, l -= R, i(); continue; } A = !1, P += o.width; } T = o.width + _, I = o.height, L = !1, (A = A || C + T > g) && i(), E.minTextHeight = Math.min(E.minTextHeight, s.height); } else h = s, r = (a = s._getCSSStyle()).padding, 0 === a._getCssFloat() || (w = !0), A = L || a.lineElement, T = h.width * h._style._tf.scaleX + r[1] + r[3] + _, I = h.height * h._style._tf.scaleY + r[0] + r[2], L = a.lineElement, (A = A || C + T > g && a.wordWrap) && i(); E.elements.push(s), E.h = Math.max(E.h, I), s.x = C, s.y = S, C += T, E.w = C - _, E.y = S, m = Math.max(C + v, m); } else k || (C += t.DIV_ELEMENT_PADDING), E.wordStartIndex = E.elements.length; if (S = E.y + E.h, w) { var D = 0, N = g; for (l = 0, u = M.length; l < u; l++) M[l].updatePos(0, N, l, D, y, b, p), D += Math.max(p, M[l].h + d); S = D; } for (f && (e.width = m), S > e.height && (e.height = S), l = 0, u = M.length; l < u; l++) M[l].revertOrder(g); return [ m, S ]; }, t._will = null, t.DIV_ELEMENT_PADDING = 0, t; }(), x = function() { function t() { this.x = 0, this.y = 0, this.w = 0, this.h = 0, this.wordStartIndex = 0, this.minTextHeight = 99999, this.mWidth = 0, this.elements = new Array(); } s(t, "laya.html.utils.LayoutLine"); var e = t.prototype; return e.updatePos = function(t, e, i, n, s, a, r) { var o, h = 0; this.elements.length > 0 && (h = (o = this.elements[this.elements.length - 1]).x + o.width - this.elements[0].x); var l = 0, u = NaN; 1 === s && (l = (e - h) / 2), 2 === s && (l = e - h), 0 === r || 0 != a || (a = 1); for (var c = 0, _ = this.elements.length; c < _; c++) { var d = (o = this.elements[c])._getCSSStyle(); switch (0 !== l && (o.x += l), d._getValign()) { case 0: o.y = n; break; case 1: var p = 0; 99999 != this.minTextHeight && (p = this.minTextHeight); var f = (p + r) / 2; f = Math.max(f, this.h), u = (laya.html.dom.HTMLImageElement, n + f - o.height), o.y = u; break; case 2: o.y = n + (r - o.height); } } }, e.revertOrder = function(t) { var e; if (this.elements.length > 0) { var i = 0, n = 0; for (n = this.elements.length, i = 0; i < n; i++) (e = this.elements[i]).x = t - e.x - e.width; } }, t; }(), b = function(t) { function e() { this.URI = null, this._href = null, e.__super.call(this), this._text = e._EMPTYTEXT, this.setStyle(new r(this)), this._getCSSStyle().valign = "middle", this.mouseEnabled = !0; } s(e, "laya.html.dom.HTMLElement", t); var n = e.prototype; return n.layaoutCallNative = function() { var t = 0; if (this._childs && (t = this._childs.length) > 0) for (var e = 0; e < t; e++) this._childs[e].layaoutCallNative && this._childs[e].layaoutCallNative(); var i = this._getWords(); i ? laya.html.dom.HTMLElement.fillWords(this, i, 0, 0, this.style.font, this.style.color, this.style.underLine) : this.graphics.clear(); }, n.appendChild = function(t) { return this.addChild(t); }, n._getWords2 = function() { var t = this._text.text; if (!t || 0 === t.length) return null; var e, i, n = 0, s = 0; if (this._text.drawWords) i = this._text.drawWords; else { for (s = (e = t.split(" ")).length - 1, i = [], n = 0; n < s; n++) i.push(e[n], " "); s >= 0 && i.push(e[s]), this._text.drawWords = i; } var a = this._text.words; if (a && a.length === i.length) return a; null === a && (this._text.words = a = []), a.length = i.length; var r, o = this.style, l = o.font; for (n = 0, s = i.length; n < s; n++) { r = m.measureText(i[n], l); var u = a[n] = new h(i[n], r.width, r.height || o.fontSize, o); if (u.char.length > 1 && (u.charNum = u.char), this.href) { var c = new _(); this.addChild(c), u.setSprite(c); } } return a; }, n._getWords = function() { if (!p.CharacterCache) return this._getWords2(); var t = this._text.text; if (!t || 0 === t.length) return null; var e = this._text.words; if (e && e.length === t.length) return e; null === e && (this._text.words = e = []), e.length = t.length; for (var i, n = this.style, s = n.font, a = 0, r = t.length; a < r; a++) { i = m.measureText(t.charAt(a), s); var o = e[a] = new h(t.charAt(a), i.width, i.height || n.fontSize, n); if (this.href) { var l = new _(); this.addChild(l), o.setSprite(l); } } return e; }, n.showLinkSprite = function() { var t = this._text.words; if (t) for (var e, i, n = [], s = 0; s < t.length; s++) i = t[s], (e = new _()).graphics.drawRect(0, 0, i.width, i.height, "#ff0000"), e.width = i.width, e.height = i.height, this.addChild(e), n.push(e); }, n._layoutLater = function() { var t = this.style; 512 & t._type || (t.widthed(this) && (this._childs.length > 0 || null != this._getWords()) && t.block ? (y.later(this), t._type |= 512) : this.parent && this.parent._layoutLater()); }, n._setAttributes = function(e, i) { switch (e) { case "style": return void this.style.cssText(i); case "class": return void (this.className = i); } t.prototype._setAttributes.call(this, e, i); }, n.updateHref = function() { if (null != this._href) { var t = this._getWords(); if (t) for (var e, i, n = 0; n < t.length; n++) (i = (e = t[n]).getSprite()) && (i.size(e.width, e.height), i.on("click", this, this.onLinkHandler)); } }, n.onLinkHandler = function(t) { switch (t.type) { case "click": for (var e = this; e; ) e.event("link", [ this.href ]), e = e.parent; } }, n.formatURL = function(t) { return this.URI ? g.formatURL(t, this.URI ? this.URI.path : null) : t; }, a(0, n, "href", function() { return this._href; }, function(t) { this._href = t, null != t && (this._getCSSStyle().underLine = 1, this.updateHref()); }), a(0, n, "color", null, function(t) { this.style.color = t; }), a(0, n, "onClick", null, function(t) { i._runScript("fn=function(event){" + t + ";}"), this.on("click", this, void 0); }), a(0, n, "id", null, function(t) { C.document.setElementById(t, this); }), a(0, n, "innerTEXT", function() { return this._text.text; }, function(t) { this.text = t; }), a(0, n, "style", function() { return this._style; }), a(0, n, "text", function() { return this._text.text; }, function(t) { this._text == e._EMPTYTEXT ? this._text = { text: t, words: null } : (this._text.text = t, this._text.words && (this._text.words.length = 0)), c.isConchApp && this.layaoutCallNative(), this._renderType |= 2048, this.repaint(), this.updateHref(); }), a(0, n, "parent", t.prototype._$get_parent, function(t) { if (t instanceof laya.html.dom.HTMLElement) { var e = t; this.URI || (this.URI = e.URI), this.style.inherit(e.style); } i.superSet(_, this, "parent", t); }), a(0, n, "className", null, function(t) { this.style.attrs(C.document.styleSheets["." + t]); }), e.fillWords = function(t, e, i, n, s, a, r) { t.graphics.clear(); for (var o = 0, h = e.length; o < h; o++) { var l = e[o]; t.graphics.fillText(l.char, l.x + i, l.y + n, s, a, "left", r); } }, e._EMPTYTEXT = { text: null, words: null }, e; }(_), w = (function(t) { function e() { e.__super.call(this), this.style.lineElement = !0, this.style.block = !0; } s(e, "laya.html.dom.HTMLBrElement", b); }(), function(t) { function e() { this.contextHeight = NaN, this.contextWidth = NaN, e.__super.call(this), this.style.block = !0, this.style.lineElement = !0, this.style.width = 200, this.style.height = 200; } s(e, "laya.html.dom.HTMLDivElement", t); var n = e.prototype; return n.appendHTML = function(t) { v.parse(this, t, this.URI), this.layout(); }, n._addChildsToLayout = function(t) { var e = this._getWords(); if (null == e && 0 == this._childs.length) return !1; e && e.forEach(function(e) { t.push(e); }); for (var i = !0, n = 0, s = this._childs.length; n < s; n++) { var a = this._childs[n]; i ? i = !1 : t.push(null), a._addToLayout(t); } return !0; }, n._addToLayout = function(t) { this.layout(); }, n.layout = function() { if (this.style) { this.style._type |= 512; var t = y.layout(this); if (t) { this._$P.mHtmlBounds || this._set$P("mHtmlBounds", new u()); var e = this._$P.mHtmlBounds; e.x = e.y = 0, e.width = this.contextWidth = t[0], e.height = this.contextHeight = t[1], this.setBounds(e); } } }, a(0, n, "height", function() { return this._height ? this._height : this.contextHeight; }, t.prototype._$set_height), a(0, n, "innerHTML", null, function(t) { this.destroyChildren(), this.appendHTML(t); }), a(0, n, "width", function() { return this._width ? this._width : this.contextWidth; }, function(t) { var e = !1; e = 0 === t ? t != this._width : t != this.width, i.superSet(b, this, "width", t), e && this.layout(); }), e; }(b)), C = function(t) { function e() { this.all = new Array(), this.styleSheets = r.styleSheets, e.__super.call(this); } s(e, "laya.html.dom.HTMLDocument", b); var i = e.prototype; return i.getElementById = function(t) { return this.all[t]; }, i.setElementById = function(t, e) { this.all[t] = e; }, n(e, [ "document", function() { return this.document = new e(); } ]), e; }(); (function(t) { function e() { this._tex = null, this._url = null, this._renderArgs = [], e.__super.call(this), this.style.block = !0; } s(e, "laya.html.dom.HTMLImageElement", b); var i = e.prototype; i._addToLayout = function(t) { !this._style.absolute && t.push(this); }, i.render = function(t, e, i) { !this._tex || !this._tex.loaded || !this._tex.loaded || this._width < 1 || this._height < 1 || (d.spriteCount++, this._renderArgs[0] = this._tex, this._renderArgs[1] = this.x, this._renderArgs[2] = this.y, this._renderArgs[3] = this.width || this._tex.width, this._renderArgs[4] = this.height || this._tex.height, t.ctx.drawTexture2(e, i, this.style.translateX, this.style.translateY, this.transform, this.style.alpha, this.style.blendMode, this._renderArgs)); }, i.layaoutCallNative = function() { var t = 0; if (this._childs && (t = this._childs.length) > 0) for (var e = 0; e < t; e++) this._childs[e].layaoutCallNative && this._childs[e].layaoutCallNative(); }, a(0, i, "src", null, function(t) { function e() { if (i._style) { var t = i._style; t.widthed(i) || i._tex.width, t.heighted(i) || i._tex.height; t.widthed(i) || i._width == i._tex.width || (i.width = i._tex.width, i.parent && i.parent._layoutLater()), t.heighted(i) || i._height == i._tex.height || (i.height = i._tex.height, i.parent && i.parent._layoutLater()), c.isConchApp && (i._renderArgs[0] = i._tex, i._renderArgs[1] = i.x, i._renderArgs[2] = i.y, i._renderArgs[3] = i.width || i._tex.width, i._renderArgs[4] = i.height || i._tex.height, i.graphics.drawTexture(i._tex, 0, 0, i._renderArgs[3], i._renderArgs[4])), i.repaint(), i.parentRepaint(); } } var i = this; if (t = this.formatURL(t), this._url != t) { this._url = t; var n = this._tex = l.getRes(t); n || (this._tex = n = new f(), n.load(t), l.cacheRes(t, n)), n.loaded ? e() : n.on("loaded", null, e); } }); })(), function(t) { function e() { this.type = null, e.__super.call(this), this.visible = !1; } s(e, "laya.html.dom.HTMLLinkElement", t); var i = e.prototype; i._onload = function(t) { switch (this.type) { case "text/css": r.parseCSS(t, this.URI); } }, a(0, i, "href", t.prototype._$get_href, function(t) { var e = this; t = this.formatURL(t), this.URI = new g(t); var i = new l(); i.once("complete", null, function(t) { e._onload(t); }), i.load(t, "text"); }), e._cuttingStyle = new RegExp("((@keyframes[\\s\\t]+|)(.+))[\\t\\n\\r\\s]*{", "g"); }(b), function(t) { function e() { e.__super.call(this), this.visible = !1; } s(e, "laya.html.dom.HTMLStyleElement", t); a(0, e.prototype, "text", t.prototype._$get_text, function(t) { r.parseCSS(t, null); }); }(b), function(t) { function e() { e.__super.call(this), this._getCSSStyle().valign = "middle"; } s(e, "laya.html.dom.HTMLIframeElement", t); a(0, e.prototype, "href", t.prototype._$get_href, function(t) { var e = this; t = this.formatURL(t); var i = new l(); i.once("complete", null, function(i) { var n = e.URI; e.URI = new g(t), e.innerHTML = i, !n || (e.URI = n); }), i.load(t, "text"); }); }(w); }(window, document, Laya), "function" == typeof define && define.amd && define("laya.core", [ "require", "exports" ], function(t, e) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }); for (var i in Laya) { var n = Laya[i]; n && n.__isclass && (e[i] = n); } }), function(t, e, i) { i.un, i.uns; var n = i.static, s = i.class, a = i.getset, r = (i.__newvec, laya.webgl.canvas.BlendMode), o = (laya.events.Event, laya.resource.HTMLCanvas), h = laya.utils.Handler, l = laya.webgl.utils.IndexBuffer2D, u = (laya.net.Loader, laya.maths.MathUtil), c = laya.maths.Matrix, _ = laya.renders.Render, d = (laya.renders.RenderContext, laya.renders.RenderSprite, laya.webgl.shader.Shader), p = laya.display.Sprite, f = laya.utils.Stat, g = laya.resource.Texture, m = laya.utils.Utils, v = laya.webgl.shader.d2.value.Value2D, y = laya.webgl.utils.VertexBuffer2D, x = laya.webgl.WebGL, b = (laya.webgl.WebGLContext, function() { function t() { this._frameTime = 0, this._emissionRate = 60, this._emissionTime = 0, this.minEmissionTime = 1 / 60, this._particleTemplate = null; } s(t, "laya.particle.emitter.EmitterBase"); var e = t.prototype; return e.start = function(t) { void 0 === t && (t = 2147483647), 0 != this._emissionRate && (this._emissionTime = t); }, e.stop = function() { this._emissionTime = 0; }, e.clear = function() { this._emissionTime = 0; }, e.emit = function() {}, e.advanceTime = function(t) { if (void 0 === t && (t = 1), this._emissionTime -= t, !(this._emissionTime < 0 || (this._frameTime += t, this._frameTime < this.minEmissionTime))) for (;this._frameTime > this.minEmissionTime; ) this._frameTime -= this.minEmissionTime, this.emit(); }, a(0, e, "particleTemplate", null, function(t) { this._particleTemplate = t; }), a(0, e, "emissionRate", function() { return this._emissionRate; }, function(t) { t <= 0 || (this._emissionRate = t, t > 0 && (this.minEmissionTime = 1 / t)); }), t; }()), w = function() { function t() { this.position = null, this.velocity = null, this.startColor = null, this.endColor = null, this.sizeRotation = null, this.radius = null, this.radian = null, this.durationAddScale = NaN, this.time = NaN; } return s(t, "laya.particle.ParticleData"), t.Create = function(e, i, n, s) { var a = new t(); a.position = i, u.scaleVector3(n, e.emitterVelocitySensitivity, t._tempVelocity); var r = u.lerp(e.minHorizontalVelocity, e.maxHorizontalVelocity, Math.random()), o = Math.random() * Math.PI * 2; t._tempVelocity[0] += r * Math.cos(o), t._tempVelocity[2] += r * Math.sin(o), t._tempVelocity[1] += u.lerp(e.minVerticalVelocity, e.maxVerticalVelocity, Math.random()), a.velocity = t._tempVelocity, a.startColor = t._tempStartColor, a.endColor = t._tempEndColor; var h = 0; if (e.disableColor) for (h = 0; h < 4; h++) a.startColor[h] = 1, a.endColor[h] = 1; else if (e.colorComponentInter) for (h = 0; h < 4; h++) a.startColor[h] = u.lerp(e.minStartColor[h], e.maxStartColor[h], Math.random()), a.endColor[h] = u.lerp(e.minEndColor[h], e.maxEndColor[h], Math.random()); else u.lerpVector4(e.minStartColor, e.maxStartColor, Math.random(), a.startColor), u.lerpVector4(e.minEndColor, e.maxEndColor, Math.random(), a.endColor); a.sizeRotation = t._tempSizeRotation; var l = Math.random(); a.sizeRotation[0] = u.lerp(e.minStartSize, e.maxStartSize, l), a.sizeRotation[1] = u.lerp(e.minEndSize, e.maxEndSize, l), a.sizeRotation[2] = u.lerp(e.minRotateSpeed, e.maxRotateSpeed, Math.random()), a.radius = t._tempRadius; var c = Math.random(); a.radius[0] = u.lerp(e.minStartRadius, e.maxStartRadius, c), a.radius[1] = u.lerp(e.minEndRadius, e.maxEndRadius, c), a.radian = t._tempRadian, a.radian[0] = u.lerp(e.minHorizontalStartRadian, e.maxHorizontalStartRadian, Math.random()), a.radian[1] = u.lerp(e.minVerticalStartRadian, e.maxVerticalStartRadian, Math.random()); var _ = e.useEndRadian; return a.radian[2] = _ ? u.lerp(e.minHorizontalEndRadian, e.maxHorizontalEndRadian, Math.random()) : a.radian[0], a.radian[3] = _ ? u.lerp(e.minVerticalEndRadian, e.maxVerticalEndRadian, Math.random()) : a.radian[1], a.durationAddScale = e.ageAddScale * Math.random(), a.time = s, a; }, n(t, [ "_tempVelocity", function() { return this._tempVelocity = new Float32Array(3); }, "_tempStartColor", function() { return this._tempStartColor = new Float32Array(4); }, "_tempEndColor", function() { return this._tempEndColor = new Float32Array(4); }, "_tempSizeRotation", function() { return this._tempSizeRotation = new Float32Array(3); }, "_tempRadius", function() { return this._tempRadius = new Float32Array(2); }, "_tempRadian", function() { return this._tempRadian = new Float32Array(4); } ]), t; }(), C = (function() { function t(t, e, i) { this._templet = null, this._timeBetweenParticles = NaN, this._previousPosition = null, this._timeLeftOver = 0, this._tempVelocity = new Float32Array([ 0, 0, 0 ]), this._tempPosition = new Float32Array([ 0, 0, 0 ]), this._templet = t, this._timeBetweenParticles = 1 / e, this._previousPosition = i; } s(t, "laya.particle.ParticleEmitter"); t.prototype.update = function(t, e) { if ((t /= 1e3) > 0) { u.subtractVector3(e, this._previousPosition, this._tempVelocity), u.scaleVector3(this._tempVelocity, 1 / t, this._tempVelocity); for (var i = this._timeLeftOver + t, n = -this._timeLeftOver; i > this._timeBetweenParticles; ) n += this._timeBetweenParticles, i -= this._timeBetweenParticles, u.lerpVector3(this._previousPosition, e, n / t, this._tempPosition), this._templet.addParticleArray(this._tempPosition, this._tempVelocity); this._timeLeftOver = i; } this._previousPosition[0] = e[0], this._previousPosition[1] = e[1], this._previousPosition[2] = e[2]; }; }(), function() { function t() { this.textureName = null, this.textureCount = 1, this.maxPartices = 100, this.duration = 1, this.ageAddScale = 0, this.emitterVelocitySensitivity = 1, this.minStartSize = 100, this.maxStartSize = 100, this.minEndSize = 100, this.maxEndSize = 100, this.minHorizontalVelocity = 0, this.maxHorizontalVelocity = 0, this.minVerticalVelocity = 0, this.maxVerticalVelocity = 0, this.endVelocity = 1, this.minRotateSpeed = 0, this.maxRotateSpeed = 0, this.minStartRadius = 0, this.maxStartRadius = 0, this.minEndRadius = 0, this.maxEndRadius = 0, this.minHorizontalStartRadian = 0, this.maxHorizontalStartRadian = 0, this.minVerticalStartRadian = 0, this.maxVerticalStartRadian = 0, this.useEndRadian = !0, this.minHorizontalEndRadian = 0, this.maxHorizontalEndRadian = 0, this.minVerticalEndRadian = 0, this.maxVerticalEndRadian = 0, this.colorComponentInter = !1, this.disableColor = !1, this.blendState = 0, this.emitterType = "null", this.emissionRate = 0, this.sphereEmitterRadius = 1, this.sphereEmitterVelocity = 0, this.sphereEmitterVelocityAddVariance = 0, this.ringEmitterRadius = 30, this.ringEmitterVelocity = 0, this.ringEmitterVelocityAddVariance = 0, this.ringEmitterUp = 2, this.gravity = new Float32Array([ 0, 0, 0 ]), this.minStartColor = new Float32Array([ 1, 1, 1, 1 ]), this.maxStartColor = new Float32Array([ 1, 1, 1, 1 ]), this.minEndColor = new Float32Array([ 1, 1, 1, 1 ]), this.maxEndColor = new Float32Array([ 1, 1, 1, 1 ]), this.pointEmitterPosition = new Float32Array([ 0, 0, 0 ]), this.pointEmitterPositionVariance = new Float32Array([ 0, 0, 0 ]), this.pointEmitterVelocity = new Float32Array([ 0, 0, 0 ]), this.pointEmitterVelocityAddVariance = new Float32Array([ 0, 0, 0 ]), this.boxEmitterCenterPosition = new Float32Array([ 0, 0, 0 ]), this.boxEmitterSize = new Float32Array([ 0, 0, 0 ]), this.boxEmitterVelocity = new Float32Array([ 0, 0, 0 ]), this.boxEmitterVelocityAddVariance = new Float32Array([ 0, 0, 0 ]), this.sphereEmitterCenterPosition = new Float32Array([ 0, 0, 0 ]), this.ringEmitterCenterPosition = new Float32Array([ 0, 0, 0 ]), this.positionVariance = new Float32Array([ 0, 0, 0 ]); } return s(t, "laya.particle.ParticleSetting"), t.checkSetting = function(e) { var i; for (i in t._defaultSetting) e.hasOwnProperty(i) || (e[i] = t._defaultSetting[i]); e.endVelocity = +e.endVelocity, e.gravity[0] = +e.gravity[0], e.gravity[1] = +e.gravity[1], e.gravity[2] = +e.gravity[2]; }, n(t, [ "_defaultSetting", function() { return this._defaultSetting = new t(); } ]), t; }()), S = function() { function t() { this.settings = null, this.texture = null; } s(t, "laya.particle.ParticleTemplateBase"); return t.prototype.addParticleArray = function(t, e) {}, t; }(), T = function() { function t() { this.u_Duration = NaN, this.u_EndVelocity = NaN, this.u_Gravity = null, this.a_Position = null, this.a_Velocity = null, this.a_StartColor = null, this.a_EndColor = null, this.a_SizeRotation = null, this.a_Radius = null, this.a_Radian = null, this.a_AgeAddScale = NaN, this.gl_Position = null, this.v_Color = null, this.oSize = NaN, this._color = new Float32Array(4), this._position = new Float32Array(3); } s(t, "laya.particle.particleUtils.CanvasShader"); var e = t.prototype; return e.getLen = function(t) { return Math.sqrt(t[0] * t[0] + t[1] * t[1] + t[2] * t[2]); }, e.ComputeParticlePosition = function(t, e, i, n) { this._position[0] = t[0], this._position[1] = t[1], this._position[2] = t[2]; var s = this.getLen(e), a = s * n + (s * this.u_EndVelocity - s) * n * n / 2, r = NaN; r = this.getLen(e); var o = 0; for (3, o = 0; o < 3; o++) this._position[o] = this._position[o] + e[o] / r * a * this.u_Duration, this._position[o] += this.u_Gravity[o] * i * n; var h = u.lerp(this.a_Radius[0], this.a_Radius[1], n), l = u.lerp(this.a_Radian[0], this.a_Radian[2], n), c = u.lerp(this.a_Radian[1], this.a_Radian[3], n), _ = Math.cos(c) * h; return this._position[1] += Math.sin(c) * h, this._position[0] += Math.cos(l) * _, this._position[2] += Math.sin(l) * _, new Float32Array([ this._position[0], this._position[1], 0, 1 ]); }, e.ComputeParticleSize = function(t, e, i) { return u.lerp(t, e, i); }, e.ComputeParticleRotation = function(t, e) { return t * e; }, e.ComputeParticleColor = function(t, e, i) { var n = this._color; return u.lerpVector4(t, e, i, n), n[3] = n[3] * i * (1 - i) * (1 - i) * 6.7, n; }, e.clamp = function(t, e, i) { return t < e ? e : t > i ? i : t; }, e.getData = function(t) { t *= 1 + this.a_AgeAddScale; var e = this.clamp(t / this.u_Duration, 0, 1); this.gl_Position = this.ComputeParticlePosition(this.a_Position, this.a_Velocity, t, e); var i = this.ComputeParticleSize(this.a_SizeRotation[0], this.a_SizeRotation[1], e), n = this.ComputeParticleRotation(this.a_SizeRotation[2], t); this.v_Color = this.ComputeParticleColor(this.a_StartColor, this.a_EndColor, e); var s = new c(), a = NaN; a = i / this.oSize * 2, s.scale(a, a), s.rotate(n), s.setTranslate(this.gl_Position[0], -this.gl_Position[1]); var r = NaN; return r = this.v_Color[3], [ this.v_Color, r, s, this.v_Color[0] * r, this.v_Color[1] * r, this.v_Color[2] * r ]; }, t; }(), I = function() { function t() { this.maxIndex = 0, this.cmds = null, this.id = 0; } s(t, "laya.particle.particleUtils.CMDParticle"); return t.prototype.setCmds = function(t) { this.cmds = t, this.maxIndex = t.length - 1; }, t; }(), M = function() { function t() {} return s(t, "laya.particle.particleUtils.PicTool"), t.getCanvasPic = function(t, e) { t = t.bitmap; var i = new o("2D"), n = i.getContext("2d"); i.size(t.width, t.height); var s = e >> 16 & 255, a = e >> 8 & 255, r = 255 & e; if (_.isConchApp && n.setFilter(s / 255, a / 255, r / 255, 0), n.drawImage(t.source, 0, 0), !_.isConchApp) { for (var h = n.getImageData(0, 0, i.width, i.height), l = h.data, u = 0, c = l.length; u < c; u += 4) 0 != l[u + 3] && (l[u] *= s / 255, l[u + 1] *= a / 255, l[u + 2] *= r / 255); n.putImageData(h, 0, 0); } return i; }, t.getRGBPic = function(e) { return [ new g(t.getCanvasPic(e, 16711680)), new g(t.getCanvasPic(e, 65280)), new g(t.getCanvasPic(e, 255)) ]; }, t; }(), E = function(t) { function e(t) { this.setting = null, this._posRange = null, this._canvasTemplate = null, this._emitFun = null, e.__super.call(this), this.template = t; } s(e, "laya.particle.emitter.Emitter2D", t); var i = e.prototype; return i.emit = function() { t.prototype.emit.call(this), null != this._emitFun && this._emitFun(); }, i.getRandom = function(t) { return (2 * Math.random() - 1) * t; }, i.webGLEmit = function() { var t = new Float32Array(3); t[0] = this.getRandom(this._posRange[0]), t[1] = this.getRandom(this._posRange[1]), t[2] = this.getRandom(this._posRange[2]); var e = new Float32Array(3); e[0] = 0, e[1] = 0, e[2] = 0, this._particleTemplate.addParticleArray(t, e); }, i.canvasEmit = function() { var t = new Float32Array(3); t[0] = this.getRandom(this._posRange[0]), t[1] = this.getRandom(this._posRange[1]), t[2] = this.getRandom(this._posRange[2]); var e = new Float32Array(3); e[0] = 0, e[1] = 0, e[2] = 0, this._particleTemplate.addParticleArray(t, e); }, a(0, i, "template", function() { return this._particleTemplate; }, function(t) { this._particleTemplate = t, t || (this._emitFun = null, this.setting = null, this._posRange = null), this.setting = t.settings, this._posRange = this.setting.positionVariance, this._particleTemplate instanceof laya.particle.ParticleTemplate2D ? this._emitFun = this.webGLEmit : this._particleTemplate instanceof laya.particle.ParticleTemplateCanvas && (this._canvasTemplate = t, this._emitFun = this.canvasEmit); }), e; }(b), A = function(t) { function e(t) { this._vertices = null, this._vertexBuffer = null, this._indexBuffer = null, this._floatCountPerVertex = 29, this._firstActiveElement = 0, this._firstNewElement = 0, this._firstFreeElement = 0, this._firstRetiredElement = 0, this._currentTime = 0, this._drawCounter = 0, e.__super.call(this), this.settings = t; } s(e, "laya.particle.ParticleTemplateWebGL", S); var i = e.prototype; return i.initialize = function() { this._vertices = new Float32Array(this.settings.maxPartices * this._floatCountPerVertex * 4); for (var t = 0, e = 0; e < this.settings.maxPartices; e++) { var i = Math.random(), n = this.settings.textureCount ? 1 / this.settings.textureCount : 1, s = NaN; for (s = 0; s < this.settings.textureCount && !(i < s + n); s += n) ; t = e * this._floatCountPerVertex * 4, this._vertices[t + 0 * this._floatCountPerVertex + 0] = -1, this._vertices[t + 0 * this._floatCountPerVertex + 1] = -1, this._vertices[t + 0 * this._floatCountPerVertex + 2] = 0, this._vertices[t + 0 * this._floatCountPerVertex + 3] = s, this._vertices[t + 1 * this._floatCountPerVertex + 0] = 1, this._vertices[t + 1 * this._floatCountPerVertex + 1] = -1, this._vertices[t + 1 * this._floatCountPerVertex + 2] = 1, this._vertices[t + 1 * this._floatCountPerVertex + 3] = s, this._vertices[t + 2 * this._floatCountPerVertex + 0] = 1, this._vertices[t + 2 * this._floatCountPerVertex + 1] = 1, this._vertices[t + 2 * this._floatCountPerVertex + 2] = 1, this._vertices[t + 2 * this._floatCountPerVertex + 3] = s + n, this._vertices[t + 3 * this._floatCountPerVertex + 0] = -1, this._vertices[t + 3 * this._floatCountPerVertex + 1] = 1, this._vertices[t + 3 * this._floatCountPerVertex + 2] = 0, this._vertices[t + 3 * this._floatCountPerVertex + 3] = s + n; } }, i.loadContent = function() {}, i.update = function(t) { this._currentTime += t / 1e3, this.retireActiveParticles(), this.freeRetiredParticles(), this._firstActiveElement == this._firstFreeElement && (this._currentTime = 0), this._firstRetiredElement == this._firstActiveElement && (this._drawCounter = 0); }, i.retireActiveParticles = function() { for (var t = this.settings.duration; this._firstActiveElement != this._firstNewElement; ) { var e = this._firstActiveElement * this._floatCountPerVertex * 4, i = e + 28, n = this._currentTime - this._vertices[i]; if ((n *= 1 + this._vertices[e + 27]) + 1e-4 < t) break; this._vertices[i] = this._drawCounter, this._firstActiveElement++, this._firstActiveElement >= this.settings.maxPartices && (this._firstActiveElement = 0); } }, i.freeRetiredParticles = function() { for (;this._firstRetiredElement != this._firstActiveElement; ) { if (this._drawCounter - this._vertices[this._firstRetiredElement * this._floatCountPerVertex * 4 + 28] < 3) break; this._firstRetiredElement++, this._firstRetiredElement >= this.settings.maxPartices && (this._firstRetiredElement = 0); } }, i.addNewParticlesToVertexBuffer = function() {}, i.addParticleArray = function(t, e) { var i = this._firstFreeElement + 1; if (i >= this.settings.maxPartices && (i = 0), i !== this._firstRetiredElement) { for (var n = w.Create(this.settings, t, e, this._currentTime), s = this._firstFreeElement * this._floatCountPerVertex * 4, a = 0; a < 4; a++) { var r = 0, o = 0; for (r = 0, o = 4; r < 3; r++) this._vertices[s + a * this._floatCountPerVertex + o + r] = n.position[r]; for (r = 0, o = 7; r < 3; r++) this._vertices[s + a * this._floatCountPerVertex + o + r] = n.velocity[r]; for (r = 0, o = 10; r < 4; r++) this._vertices[s + a * this._floatCountPerVertex + o + r] = n.startColor[r]; for (r = 0, o = 14; r < 4; r++) this._vertices[s + a * this._floatCountPerVertex + o + r] = n.endColor[r]; for (r = 0, o = 18; r < 3; r++) this._vertices[s + a * this._floatCountPerVertex + o + r] = n.sizeRotation[r]; for (r = 0, o = 21; r < 2; r++) this._vertices[s + a * this._floatCountPerVertex + o + r] = n.radius[r]; for (r = 0, o = 23; r < 4; r++) this._vertices[s + a * this._floatCountPerVertex + o + r] = n.radian[r]; this._vertices[s + a * this._floatCountPerVertex + 27] = n.durationAddScale, this._vertices[s + a * this._floatCountPerVertex + 28] = n.time; } this._firstFreeElement = i; } }, e; }(), L = function(t) { function e(t) { this._ready = !1, this.textureList = [], this.particleList = [], this.pX = 0, this.pY = 0, this.activeParticles = [], this.deadParticles = [], this.iList = [], this._maxNumParticles = 0, this.textureWidth = NaN, this.dTextureWidth = NaN, this.colorChange = !0, this.step = 1 / 60, this.canvasShader = new T(), e.__super.call(this), this.settings = t, this._maxNumParticles = t.maxPartices, this.texture = new g(), this.texture.on("loaded", this, this._textureLoaded), this.texture.load(t.textureName); } s(e, "laya.particle.ParticleTemplateCanvas", S); var i = e.prototype; return i._textureLoaded = function(t) { this.setTexture(this.texture), this._ready = !0; }, i.clear = function(t) { void 0 === t && (t = !0), this.deadParticles.length = 0, this.activeParticles.length = 0, this.textureList.length = 0; }, i.setTexture = function(t) { this.texture = t, this.textureWidth = t.width, this.dTextureWidth = 1 / this.textureWidth, this.pX = .5 * -t.width, this.pY = .5 * -t.height, this.textureList = e.changeTexture(t, this.textureList), this.particleList.length = 0, this.deadParticles.length = 0, this.activeParticles.length = 0; }, i._createAParticleData = function(t, e) { this.canvasShader.u_EndVelocity = this.settings.endVelocity, this.canvasShader.u_Gravity = this.settings.gravity, this.canvasShader.u_Duration = this.settings.duration; var i; i = w.Create(this.settings, t, e, 0), this.canvasShader.a_Position = i.position, this.canvasShader.a_Velocity = i.velocity, this.canvasShader.a_StartColor = i.startColor, this.canvasShader.a_EndColor = i.endColor, this.canvasShader.a_SizeRotation = i.sizeRotation, this.canvasShader.a_Radius = i.radius, this.canvasShader.a_Radian = i.radian, this.canvasShader.a_AgeAddScale = i.durationAddScale, this.canvasShader.oSize = this.textureWidth; var n = new I(), s = 0, a = this.settings.duration / (1 + i.durationAddScale), r = []; for (s = 0; s < a; s += this.step) r.push(this.canvasShader.getData(s)); return n.id = this.particleList.length, this.particleList.push(n), n.setCmds(r), n; }, i.addParticleArray = function(t, e) { if (this._ready) { var i; this.particleList.length < this._maxNumParticles ? (i = this._createAParticleData(t, e), this.iList[i.id] = 0, this.activeParticles.push(i)) : this.deadParticles.length > 0 && (i = this.deadParticles.pop(), this.iList[i.id] = 0, this.activeParticles.push(i)); } }, i.advanceTime = function(t) { if (void 0 === t && (t = 1), this._ready) { var e, i = this.activeParticles, n = this.deadParticles, s = 0, a = i.length, r = 0, o = this.iList; for (s = a - 1; s > -1; s--) (r = o[(e = i[s]).id]) >= e.maxIndex ? (r = 0, i.splice(s, 1), n.push(e)) : r += 1, o[e.id] = r; } }, i.render = function(t, e, i) { this._ready && (this.activeParticles.length < 1 || this.textureList.length < 2 || (this.settings.disableColor ? this.noColorRender(t, e, i) : this.canvasRender(t, e, i))); }, i.noColorRender = function(t, e, i) { var n, s, a = this.activeParticles, r = 0, o = a.length, h = NaN, l = this.pX, u = this.pY, c = 2 * -l, _ = 2 * -u, d = 0, p = (this.textureList, this.iList), f = NaN; for (t.translate(e, i), f = t.ctx.globalAlpha, r = 0; r < o; r++) d = p[(n = a[r]).id], (s = n.cmds[d]) && ((h = s[1]) <= .01 || (t.setAlpha(f * h), t.drawTextureWithTransform(this.texture, l, u, c, _, s[2], 1))); t.setAlpha(f), t.translate(-e, -i); }, i.canvasRender = function(t, e, i) { var n, s, a, r = this.activeParticles, o = 0, h = r.length, l = this.pX, u = this.pY, c = 2 * -l, _ = 2 * -u, d = 0, p = this.textureList, f = this.iList, g = NaN; for (t.translate(e, i), g = t.ctx.globalAlpha, a = t.ctx.globalCompositeOperation, t.blendMode("lighter"), o = 0; o < h; o++) d = f[(n = r[o]).id], (s = n.cmds[d]) && (s[1] <= .01 || (t.save(), t.transformByMatrix(s[2]), s[3] > .01 && (t.setAlpha(g * s[3]), t.drawTexture(p[0], l, u, c, _)), s[4] > .01 && (t.setAlpha(g * s[4]), t.drawTexture(p[1], l, u, c, _)), s[5] > .01 && (t.setAlpha(g * s[5]), t.drawTexture(p[2], l, u, c, _)), t.restore())); t.setAlpha(g), t.translate(-e, -i), t.blendMode(a); }, e.changeTexture = function(t, e, i) { return e || (e = []), e.length = 0, i && i.disableColor ? e.push(t, t, t) : m.copyArray(e, M.getRGBPic(t)), e; }, e; }(), P = function(t) { function e(t) { this._vertexBuffer2D = null, this._indexBuffer2D = null, this.x = 0, this.y = 0, this._blendFn = null, this._startTime = 0, this.sv = new k(), e.__super.call(this, t); var n = this; i.loader.load(this.settings.textureName, h.create(null, function(t) { t.bitmap.enableMerageInAtlas = !1, n.texture = t; })), this.sv.u_Duration = this.settings.duration, this.sv.u_Gravity = this.settings.gravity, this.sv.u_EndVelocity = this.settings.endVelocity, this._blendFn = r.fns[t.blendState], this.initialize(), this._vertexBuffer = this._vertexBuffer2D = y.create(-1, 35048), this._indexBuffer = this._indexBuffer2D = l.create(35044), this.loadContent(); } s(e, "laya.particle.ParticleTemplate2D", t); var n = e.prototype; return i.imps(n, { "laya.webgl.submit.ISubmit": !0 }), n.getRenderType = function() { return -111; }, n.releaseRender = function() {}, n.addParticleArray = function(e, i) { e[0] += this.x, e[1] += this.y, t.prototype.addParticleArray.call(this, e, i); }, n.loadContent = function() { for (var t = new Uint16Array(6 * this.settings.maxPartices), e = 0; e < this.settings.maxPartices; e++) t[6 * e + 0] = 4 * e + 0, t[6 * e + 1] = 4 * e + 1, t[6 * e + 2] = 4 * e + 2, t[6 * e + 3] = 4 * e + 0, t[6 * e + 4] = 4 * e + 2, t[6 * e + 5] = 4 * e + 3; this._indexBuffer2D.clear(), this._indexBuffer2D.append(t), this._indexBuffer2D.upload(); }, n.addNewParticlesToVertexBuffer = function() { this._vertexBuffer2D.clear(), this._vertexBuffer2D.append(this._vertices); var t = 0; this._firstNewElement < this._firstFreeElement ? (t = 4 * this._firstNewElement * this._floatCountPerVertex * 4, this._vertexBuffer2D.subUpload(t, t, t + 4 * (this._firstFreeElement - this._firstNewElement) * this._floatCountPerVertex * 4)) : (t = 4 * this._firstNewElement * this._floatCountPerVertex * 4, this._vertexBuffer2D.subUpload(t, t, t + 4 * (this.settings.maxPartices - this._firstNewElement) * this._floatCountPerVertex * 4), this._firstFreeElement > 0 && (this._vertexBuffer2D.setNeedUpload(), this._vertexBuffer2D.subUpload(0, 0, 4 * this._firstFreeElement * this._floatCountPerVertex * 4))), this._firstNewElement = this._firstFreeElement; }, n.renderSubmit = function() { if (this.texture && this.texture.loaded) { if (this.update(i.timer.delta), this.sv.u_CurrentTime = this._currentTime, this._firstNewElement != this._firstFreeElement && this.addNewParticlesToVertexBuffer(), this.blend(), this._firstActiveElement != this._firstFreeElement) { x.mainContext; this._vertexBuffer2D.bind(this._indexBuffer2D), this.sv.u_texture = this.texture.source, this.sv.upload(), this._firstActiveElement < this._firstFreeElement ? x.mainContext.drawElements(4, 6 * (this._firstFreeElement - this._firstActiveElement), 5123, 6 * this._firstActiveElement * 2) : (x.mainContext.drawElements(4, 6 * (this.settings.maxPartices - this._firstActiveElement), 5123, 6 * this._firstActiveElement * 2), this._firstFreeElement > 0 && x.mainContext.drawElements(4, 6 * this._firstFreeElement, 5123, 0)), f.drawCall++; } this._drawCounter++; } return 1; }, n.blend = function() { if (r.activeBlendFunction !== this._blendFn) { var t = x.mainContext; t.enable(3042), this._blendFn(t), r.activeBlendFunction = this._blendFn; } }, n.dispose = function() { this._vertexBuffer2D.dispose(), this._indexBuffer2D.dispose(); }, e.activeBlendType = -1, e; }(A), k = function(t) { function e() { this.a_CornerTextureCoordinate = [ 4, 5126, !1, 116, 0 ], this.a_Position = [ 3, 5126, !1, 116, 16 ], this.a_Velocity = [ 3, 5126, !1, 116, 28 ], this.a_StartColor = [ 4, 5126, !1, 116, 40 ], this.a_EndColor = [ 4, 5126, !1, 116, 56 ], this.a_SizeRotation = [ 3, 5126, !1, 116, 72 ], this.a_Radius = [ 2, 5126, !1, 116, 84 ], this.a_Radian = [ 4, 5126, !1, 116, 92 ], this.a_AgeAddScale = [ 1, 5126, !1, 116, 108 ], this.a_Time = [ 1, 5126, !1, 116, 112 ], this.u_CurrentTime = NaN, this.u_Duration = NaN, this.u_Gravity = null, this.u_EndVelocity = NaN, this.u_texture = null, e.__super.call(this, 0, 0); } s(e, "laya.particle.shader.value.ParticleShaderValue", v); return e.prototype.upload = function() { this.refresh(), e.pShader.upload(this); }, n(e, [ "pShader", function() { return this.pShader = new R(); } ]), e; }(), R = (function(e) { function n(t) { this._matrix4 = [ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 ], this._particleTemplate = null, this._canvasTemplate = null, this._emitter = null, this.autoPlay = !0, n.__super.call(this), t && this.setParticleSetting(t); } s(n, "laya.particle.Particle2D", e); var r = n.prototype; r.load = function(t) { i.loader.load(t, h.create(this, this.setParticleSetting), null, "json"); }, r.setParticleSetting = function(e) { var n = this; if (!e) return this.stop(); if (C.checkSetting(e), t.ConchParticleTemplate2D && !_.isWebGL || (this.customRenderEnable = !0), _.isWebGL) this._particleTemplate = new P(e), this.graphics._saveToCmd(_.context._drawParticle, [ this._particleTemplate ]); else { if (_.isConchApp && t.ConchParticleTemplate2D) { this._particleTemplate = new ConchParticleTemplate2D(); var s = this; return i.loader.load(e.textureName, h.create(null, function(t) { s._particleTemplate.texture = t, s._particleTemplate.settings = e, _.isConchNode ? s.graphics.drawParticle(s._particleTemplate) : s.graphics._saveToCmd(_.context._drawParticle, [ n._particleTemplate ]); })), this._emitter = { start: function() {} }, this.play = this._particleTemplate.play.bind(this._particleTemplate), this.stop = this._particleTemplate.stop.bind(this._particleTemplate), void (this.autoPlay && this.play()); } this._particleTemplate = this._canvasTemplate = new L(e); } this._emitter ? this._emitter.template = this._particleTemplate : this._emitter = new E(this._particleTemplate), this.autoPlay && (this.emitter.start(), this.play()); }, r.play = function() { this.timer.frameLoop(1, this, this._loop); }, r.stop = function() { this.timer.clear(this, this._loop); }, r._loop = function() { this.advanceTime(1 / 60); }, r.advanceTime = function(t) { void 0 === t && (t = 1), this._canvasTemplate && this._canvasTemplate.advanceTime(t), this._emitter && this._emitter.advanceTime(t); }, r.customRender = function(t, e, i) { if (_.isWebGL) { this._matrix4[0] = t.ctx._curMat.a, this._matrix4[1] = t.ctx._curMat.b, this._matrix4[4] = t.ctx._curMat.c, this._matrix4[5] = t.ctx._curMat.d, this._matrix4[12] = t.ctx._curMat.tx, this._matrix4[13] = t.ctx._curMat.ty; this._particleTemplate.sv.u_mmat = this._matrix4; } this._canvasTemplate && this._canvasTemplate.render(t, e, i); }, r.destroy = function(t) { void 0 === t && (t = !0), this._particleTemplate instanceof laya.particle.ParticleTemplate2D && this._particleTemplate.dispose(), e.prototype.destroy.call(this, t); }, a(0, r, "url", null, function(t) { this.load(t); }), a(0, r, "emitter", function() { return this._emitter; }); }(p), function(t) { function e() { e.__super.call(this, e.vs, e.ps, "ParticleShader"); } return s(e, "laya.particle.shader.ParticleShader", d), n(e, [ "vs", function() { return this.vs = "attribute vec4 a_CornerTextureCoordinate;\nattribute vec3 a_Position;\nattribute vec3 a_Velocity;\nattribute vec4 a_StartColor;\nattribute vec4 a_EndColor;\nattribute vec3 a_SizeRotation;\nattribute vec2 a_Radius;\nattribute vec4 a_Radian;\nattribute float a_AgeAddScale;\nattribute float a_Time;\n\nvarying vec4 v_Color;\nvarying vec2 v_TextureCoordinate;\n\nuniform float u_CurrentTime;\nuniform float u_Duration;\nuniform float u_EndVelocity;\nuniform vec3 u_Gravity;\n\n#ifdef PARTICLE3D\n uniform mat4 u_WorldMat;\n uniform mat4 u_View;\n uniform mat4 u_Projection;\n uniform vec2 u_ViewportScale;\n#else\n uniform vec2 size;\n uniform mat4 mmat;\n uniform mat4 u_mmat;\n#endif\n\nvec4 ComputeParticlePosition(in vec3 position, in vec3 velocity,in float age,in float normalizedAge)\n{\n\n float startVelocity = length(velocity);//起始标量速度\n float endVelocity = startVelocity * u_EndVelocity;//结束标量速度\n\n float velocityIntegral = startVelocity * normalizedAge +(endVelocity - startVelocity) * normalizedAge *normalizedAge/2.0;//计算当前速度的标量(单位空间),vt=v0*t+(1/2)*a*(t^2)\n \n vec3 addPosition = normalize(velocity) * velocityIntegral * u_Duration;//计算受自身速度影响的位置,转换标量到矢量 \n addPosition += u_Gravity * age * normalizedAge;//计算受重力影响的位置\n \n float radius=mix(a_Radius.x, a_Radius.y, normalizedAge); //计算粒子受半径和角度影响(无需计算角度和半径时,可用宏定义优化屏蔽此计算)\n float radianHorizontal =mix(a_Radian.x,a_Radian.z,normalizedAge);\n float radianVertical =mix(a_Radian.y,a_Radian.w,normalizedAge);\n \n float r =cos(radianVertical)* radius;\n addPosition.y += sin(radianVertical) * radius;\n\t\n addPosition.x += cos(radianHorizontal) *r;\n addPosition.z += sin(radianHorizontal) *r;\n \n #ifdef PARTICLE3D\n position+=addPosition;\n return u_Projection*u_View*u_WorldMat*(vec4(position, 1.0));\n #else\n addPosition.y=-addPosition.y;//2D粒子位置更新需要取负,2D粒子坐标系Y轴正向朝上\n position+=addPosition;\n return vec4(position,1.0);\n #endif\n}\n\nfloat ComputeParticleSize(in float startSize,in float endSize, in float normalizedAge)\n{ \n float size = mix(startSize, endSize, normalizedAge);\n \n\t#ifdef PARTICLE3D\n //Project the size into screen coordinates.\n return size * u_Projection[1][1];\n\t#else\n\t return size;\n\t#endif\n}\n\nmat2 ComputeParticleRotation(in float rot,in float age)\n{ \n float rotation =rot * age;\n //计算2x2旋转矩阵.\n float c = cos(rotation);\n float s = sin(rotation);\n return mat2(c, -s, s, c);\n}\n\nvec4 ComputeParticleColor(in vec4 startColor,in vec4 endColor,in float normalizedAge)\n{\n\tvec4 color=mix(startColor,endColor,normalizedAge);\n //硬编码设置,使粒子淡入很快,淡出很慢,6.7的缩放因子把置归一在0到1之间,可以谷歌x*(1-x)*(1-x)*6.7的制图表\n color.a *= normalizedAge * (1.0-normalizedAge) * (1.0-normalizedAge) * 6.7;\n \n return color;\n}\n\nvoid main()\n{\n float age = u_CurrentTime - a_Time;\n age *= 1.0 + a_AgeAddScale;\n float normalizedAge = clamp(age / u_Duration,0.0,1.0);\n gl_Position = ComputeParticlePosition(a_Position, a_Velocity, age, normalizedAge);//计算粒子位置\n float pSize = ComputeParticleSize(a_SizeRotation.x,a_SizeRotation.y, normalizedAge);\n mat2 rotation = ComputeParticleRotation(a_SizeRotation.z, age);\n\t\n #ifdef PARTICLE3D\n\tgl_Position.xy += (rotation*a_CornerTextureCoordinate.xy) * pSize * u_ViewportScale;\n #else\n mat4 mat=u_mmat*mmat;\n gl_Position=vec4((mat*gl_Position).xy,0.0,1.0);\n\tgl_Position.xy += (rotation*a_CornerTextureCoordinate.xy) * pSize*vec2(mat[0][0],mat[1][1]);\n gl_Position=vec4((gl_Position.x/size.x-0.5)*2.0,(0.5-gl_Position.y/size.y)*2.0,0.0,1.0);\n #endif\n \n v_Color = ComputeParticleColor(a_StartColor,a_EndColor, normalizedAge);\n v_TextureCoordinate =a_CornerTextureCoordinate.zw;\n}\n\n"; }, "ps", function() { return this.ps = "#ifdef FSHIGHPRECISION\nprecision highp float;\n#else\nprecision mediump float;\n#endif\n\nvarying vec4 v_Color;\nvarying vec2 v_TextureCoordinate;\nuniform sampler2D u_texture;\n\nvoid main()\n{\t\n\tgl_FragColor=texture2D(u_texture,v_TextureCoordinate)*v_Color;\n\tgl_FragColor.xyz *= v_Color.w;\n}"; } ]), e; }()); }(window, document, Laya), "function" == typeof define && define.amd && define("laya.core", [ "require", "exports" ], function(t, e) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }); for (var i in Laya) { var n = Laya[i]; n && n.__isclass && (e[i] = n); } }), function(t, e, i) { i.un, i.uns, i.static; var n = i.class, s = i.getset, a = (i.__newvec, laya.utils.Browser), r = laya.resource.HTMLCanvas, o = (laya.utils.Handler, laya.net.Loader), h = laya.maths.Point, l = laya.maths.Rectangle, u = laya.renders.Render, c = laya.renders.RenderContext, _ = laya.display.Sprite, d = laya.resource.Texture, p = function() { function t() { this._jsonData = null, this._tileTexSetArr = [], this._texArray = [], this._x = 0, this._y = 0, this._width = 0, this._height = 0, this._mapW = 0, this._mapH = 0, this._mapTileW = 0, this._mapTileH = 0, this._mapSprite = null, this._layerArray = [], this._renderLayerArray = [], this._gridArray = [], this._showGridKey = !1, this._totalGridNum = 0, this._gridW = 0, this._gridH = 0, this._gridWidth = 450, this._gridHeight = 450, this._jsonLoader = null, this._loader = null, this._tileSetArray = [], this._currTileSet = null, this._completeHandler = null, this._index = 0, this._animationDic = {}, this._properties = null, this._tileProperties = {}, this._tileProperties2 = {}, this._orientation = "orthogonal", this._renderOrder = "right-down", this._colorArray = [ "FF", "00", "33", "66" ], this._scale = 1, this._pivotScaleX = .5, this._pivotScaleY = .5, this._centerX = 0, this._centerY = 0, this._viewPortX = 0, this._viewPortY = 0, this._viewPortWidth = 0, this._viewPortHeight = 0, this._enableLinear = !0, this._resPath = null, this._pathArray = null, this._limitRange = !1, this._fastDirty = !0, this.autoCache = !0, this.autoCacheType = "normal", this.enableMergeLayer = !1, this.removeCoveredTile = !1, this.showGridTextureCount = !1, this.antiCrack = !0, this.cacheAllAfterInit = !1, this._texutreStartDic = {}, this._rect = new l(), this._paddingRect = new l(), this._mapRect = new e(), this._mapLogicRect = new e(), this._mapLastRect = new e(), this._mapSprite = new _(); } var e, a, h; n(t, "laya.map.TiledMap"); var p = t.prototype; return p.createMap = function(t, e, i, n, s, a, r) { void 0 === a && (a = !0), void 0 === r && (r = !1), this._enableLinear = a, this._limitRange = r, this._rect.x = e.x, this._rect.y = e.y, this._rect.width = e.width, this._rect.height = e.height, this._viewPortWidth = e.width / this._scale, this._viewPortHeight = e.height / this._scale, this._completeHandler = i, n ? this._paddingRect.copyFrom(n) : this._paddingRect.setTo(0, 0, 0, 0), s && (this._gridWidth = s.x, this._gridHeight = s.y); var h = t.lastIndexOf("/"); h > -1 ? (this._resPath = t.substr(0, h), this._pathArray = this._resPath.split("/")) : (this._resPath = "", this._pathArray = []), this._jsonLoader = new o(), this._jsonLoader.once("complete", this, this.onJsonComplete), this._jsonLoader.load(t, "json", !1); }, p.onJsonComplete = function(t) { var e = this._jsonData = t; this._properties = e.properties, this._orientation = e.orientation, this._renderOrder = e.renderorder, this._mapW = e.width, this._mapH = e.height, this._mapTileW = e.tilewidth, this._mapTileH = e.tileheight, this._width = this._mapTileW * this._mapW, this._height = this._mapTileH * this._mapH, "staggered" == this._orientation && (this._height = (.5 + .5 * this._mapH) * this._mapTileH), this._mapLastRect.top = this._mapLastRect.bottom = this._mapLastRect.left = this._mapLastRect.right = -1; var i, n, s = e.tilesets, r = 0; for (r = 0; r < s.length; r++) if (i = s[r], (n = new h()).init(i), !n.properties || !n.properties.ignore) { this._tileProperties[r] = n.tileproperties, this.addTileProperties(n.tileproperties), this._tileSetArray.push(n); var l = i.tiles; if (l) for (var u in l) { var c = l[u].animation; if (c) { var _ = new a(); this._animationDic[u] = _, _.image = i.image; for (var d = 0; d < c.length; d++) { var p = c[d]; _.mAniIdArray.push(p.tileid), _.mDurationTimeArray.push(p.duration); } } } } if (this._tileTexSetArr.push(null), this._tileSetArray.length > 0) { n = this._currTileSet = this._tileSetArray.shift(), this._loader = new o(), this._loader.once("complete", this, this.onTextureComplete); var f = this.mergePath(this._resPath, n.image); this._loader.load(f, "image", !1); } }, p.mergePath = function(t, e) { var i = "", n = e.split("/"), s = 0, a = 0; for (a = n.length - 1; a >= 0; a--) ".." == n[a] && s++; if (0 == s) return i = this._pathArray.length > 0 ? t + "/" + e : e; var r = this._pathArray.length - s; for (r < 0 && console.log("[error]path does not exist", this._pathArray, n, t, e), a = 0; a < r; a++) 0 == a ? i += this._pathArray[a] : i = i + "/" + this._pathArray[a]; for (a = s; a < n.length; a++) i = i + "/" + n[a]; return i; }, p.onTextureComplete = function(t) { this._jsonData; var e = t; u.isWebGL && !this._enableLinear && (e.bitmap.minFifter = 9728, e.bitmap.magFifter = 9728, e.bitmap.enableMerageInAtlas = !1), this._texArray.push(e); var i = this._currTileSet, n = i.tilewidth, s = i.tileheight, a = i.imagewidth, r = i.imageheight, o = (i.firstgid, Math.floor((a - i.margin - n) / (n + i.spacing)) + 1), h = Math.floor((r - i.margin - s) / (s + i.spacing)) + 1, l = null; this._texutreStartDic[i.image] = this._tileTexSetArr.length; for (var c = 0; c < h; c++) for (var _ = 0; _ < o; _++) (l = new f()).offX = i.titleoffsetX, l.offY = i.titleoffsetY - (s - this._mapTileH), l.texture = d.createFromTexture(e, i.margin + (n + i.spacing) * _, i.margin + (s + i.spacing) * c, n, s), this.antiCrack && this.adptTexture(l.texture), this._tileTexSetArr.push(l), l.gid = this._tileTexSetArr.length; if (this._tileSetArray.length > 0) { i = this._currTileSet = this._tileSetArray.shift(), this._loader.once("complete", this, this.onTextureComplete); var p = this.mergePath(this._resPath, i.image); this._loader.load(p, "image", !1); } else this._currTileSet = null, this.initMap(); }, p.adptTexture = function(t) { if (t) { var e = t.uv[0], i = t.uv[2], n = t.uv[1], s = t.uv[7], a = 1 / t.bitmap.width, r = 1 / t.bitmap.height; t.uv[0] = t.uv[6] = e + a, t.uv[2] = t.uv[4] = i - a, t.uv[1] = t.uv[3] = n + r, t.uv[5] = t.uv[7] = s - r; } }, p.initMap = function() { var t = 0, e = 0; for (var n in this._animationDic) { var s = this._animationDic[n], a = 0; a = this._texutreStartDic[s.image]; var r = this.getTexture(parseInt(n) + a); if (s.mAniIdArray.length > 0) { for (r.textureArray = [], r.durationTimeArray = s.mDurationTimeArray, r.isAnimation = !0, r.animationTotalTime = 0, t = 0, e = r.durationTimeArray.length; t < e; t++) r.animationTotalTime += r.durationTimeArray[t]; for (t = 0, e = s.mAniIdArray.length; t < e; t++) { var o = this.getTexture(s.mAniIdArray[t] + a); r.textureArray.push(o); } } } for (this._gridWidth = Math.floor(this._gridWidth / this._mapTileW) * this._mapTileW, this._gridHeight = Math.floor(this._gridHeight / this._mapTileH) * this._mapTileH, this._gridWidth < this._mapTileW && (this._gridWidth = this._mapTileW), this._gridHeight < this._mapTileH && (this._gridHeight = this._mapTileH), this._gridW = Math.ceil(this._width / this._gridWidth), this._gridH = Math.ceil(this._height / this._gridHeight), this._totalGridNum = this._gridW * this._gridH, t = 0; t < this._gridH; t++) { var h = []; this._gridArray.push(h); for (var l = 0; l < this._gridW; l++) h.push(null); } for (var u, c, _, d = this._jsonData.layers, p = !0, f = 0; f < d.length; f++) { var g = d[f]; if (1 == g.visible) { var v = new m(); v.init(g, this), this.enableMergeLayer ? (u = v.getLayerProperties("layer"), (p = p || !_ || u != c) ? (p = !1, v.tarLayer = v, _ = v, this._mapSprite.addChild(v), this._renderLayerArray.push(v)) : v.tarLayer = _, c = u) : (this._mapSprite.addChild(v), this._renderLayerArray.push(v)), this._layerArray.push(v); } } this.removeCoveredTile && this.adptTiledMapData(), this.cacheAllAfterInit && this.cacheAllGrid(), this.moveViewPort(this._rect.x, this._rect.y), i.stage.addChild(this.mapSprite()), null != this._completeHandler && this._completeHandler.run(); }, p.addTileProperties = function(t) { var e; for (e in t) this._tileProperties2[e] = t[e]; }, p.getTileUserData = function(t, e, i) { return this._tileProperties2 && this._tileProperties2[t] && e in this._tileProperties2[t] ? this._tileProperties2[t][e] : i; }, p.adptTiledMapData = function() { var t, e = 0, i = {}; for (e = this._layerArray.length - 1; e >= 0; e--) (t = this._layerArray[e]._mapData) && (this.removeCoverd(t, i), this.collectCovers(t, i, e)); }, p.removeCoverd = function(t, e) { var i = 0, n = 0; for (n = t.length, i = 0; i < n; i++) e[i] && (t[i] = 0); }, p.collectCovers = function(t, e, i) { var n = 0, s = 0; s = t.length; var a = 0; for (n = 0; n < s; n++) (a = t[n]) > 0 && this.getTileUserData(a - 1, "type", 0) > 0 && (e[n] = a); }, p.getTexture = function(t) { return t < this._tileTexSetArr.length ? this._tileTexSetArr[t] : null; }, p.getMapProperties = function(t) { return this._properties ? this._properties[t] : null; }, p.getTileProperties = function(t, e, i) { return this._tileProperties[t] && this._tileProperties[t][e] ? this._tileProperties[t][e][i] : null; }, p.getSprite = function(t, e, i) { if (0 < this._tileTexSetArr.length) { var n = new g(); n.initData(this, !0), n.size(e, i); var s = this._tileTexSetArr[t]; if (null != s && null != s.texture) { if (s.isAnimation) { var a = new v(); this._index++, a.setTileTextureSet(this._index.toString(), s), n.addAniSprite(a), n.addChild(a); } else n.graphics.drawTexture(s.texture, 0, 0, e, i); n.drawImageNum++; } return n; } return null; }, p.setViewPortPivotByScale = function(t, e) { this._pivotScaleX = t, this._pivotScaleY = e, this._fastDirty = !0; }, p.moveViewPort = function(t, e) { if (this._x = -t, this._y = -e, this._fastDirty) this._rect.x = t, this._rect.y = e, this.updateViewPort(); else { var i = NaN, n = NaN; i = t - this._rect.x, n = e - this._rect.y, this._rect.x = t, this._rect.y = e, this.updateViewPortFast(i, n); } }, p.changeViewPort = function(t, e, i, n) { t == this._rect.x && e == this._rect.y && i == this._rect.width && n == this._rect.height || (i != this._rect.width || n != this._rect.height ? (this._fastDirty = !0, this._x = -t, this._y = -e, this._rect.x = t, this._rect.y = e, this._rect.width = i, this._rect.height = n, this._viewPortWidth = i / this._scale, this._viewPortHeight = n / this._scale, this.updateViewPort()) : this.moveViewPort(t, e)); }, p.changeViewPortBySize = function(t, e, i) { return null == i && (i = new l()), this._centerX = this._rect.x + this._rect.width * this._pivotScaleX, this._centerY = this._rect.y + this._rect.height * this._pivotScaleY, i.x = this._centerX - t * this._pivotScaleX, i.y = this._centerY - e * this._pivotScaleY, i.width = t, i.height = e, this.changeViewPort(i.x, i.y, i.width, i.height), i; }, p.updateViewPortFast = function(t, e) { this._centerX += t, this._centerY += e, this._viewPortX += t, this._viewPortY += e; var i = !1, n = e / this._gridHeight, s = t / this._gridWidth; this._mapLogicRect.top += n, this._mapLogicRect.bottom += n, this._mapLogicRect.left += s, this._mapLogicRect.right += s, this._mapRect.top = 0 | this._mapLogicRect.top, this._mapRect.bottom = 0 | this._mapLogicRect.bottom, this._mapRect.left = 0 | this._mapLogicRect.left, this._mapRect.right = 0 | this._mapLogicRect.right, this._mapRect.top == this._mapLastRect.top && this._mapRect.bottom == this._mapLastRect.bottom && this._mapRect.left == this._mapLastRect.left && this._mapRect.right == this._mapLastRect.right || (this.clipViewPort(), this._mapLastRect.top = this._mapRect.top, this._mapLastRect.bottom = this._mapRect.bottom, this._mapLastRect.left = this._mapRect.left, this._mapLastRect.right = this._mapRect.right, i = !0), (i = i || 0 != t || 0 != e) && this.updateMapLayersPos(); }, p.updateMapLayersPos = function() { for (var t, e = this._renderLayerArray.length, i = 0; i < e; i++) (t = this._renderLayerArray[i])._gridSpriteArray.length > 0 && (t.updateAloneObject(), t.pos(-this._viewPortX, -this._viewPortY)); }, p.updateViewPort = function() { this._fastDirty = !1; var t = this._rect.width * this._pivotScaleX, e = this._rect.height * this._pivotScaleY; this._centerX = this._rect.x + t, this._centerY = this._rect.y + e; var i = !1, n = this._viewPortX; if (this._viewPortX = this._centerX - t / this._scale, n != this._viewPortX ? i = !0 : n = this._viewPortY, this._viewPortY = this._centerY - e / this._scale, i || n == this._viewPortY || (i = !0), this._limitRange) { this._viewPortX + this._viewPortWidth > this._width && (this._viewPortX = this._width - this._viewPortWidth); this._viewPortY + this._viewPortHeight > this._height && (this._viewPortY = this._height - this._viewPortHeight), this._viewPortX < 0 && (this._viewPortX = 0), this._viewPortY < 0 && (this._viewPortY = 0); } var s = this._paddingRect; this._mapLogicRect.top = (this._viewPortY - s.y) / this._gridHeight, this._mapLogicRect.bottom = (this._viewPortY + this._viewPortHeight + s.height + s.y) / this._gridHeight, this._mapLogicRect.left = (this._viewPortX - s.x) / this._gridWidth, this._mapLogicRect.right = (this._viewPortX + this._viewPortWidth + s.width + s.x) / this._gridWidth, this._mapRect.top = 0 | this._mapLogicRect.top, this._mapRect.bottom = 0 | this._mapLogicRect.bottom, this._mapRect.left = 0 | this._mapLogicRect.left, this._mapRect.right = 0 | this._mapLogicRect.right, this._mapRect.top == this._mapLastRect.top && this._mapRect.bottom == this._mapLastRect.bottom && this._mapRect.left == this._mapLastRect.left && this._mapRect.right == this._mapLastRect.right || (this.clipViewPort(), this._mapLastRect.top = this._mapRect.top, this._mapLastRect.bottom = this._mapRect.bottom, this._mapLastRect.left = this._mapRect.left, this._mapLastRect.right = this._mapRect.right, i = !0), i && this.updateMapLayersPos(); }, p.clipViewPort = function() { var t = 0, e = 0, i = 0, n = 0; if (this._mapRect.left > this._mapLastRect.left) { if ((t = this._mapRect.left - this._mapLastRect.left) > 0) for (n = this._mapLastRect.left; n < this._mapLastRect.left + t; n++) for (i = this._mapLastRect.top; i <= this._mapLastRect.bottom; i++) this.hideGrid(n, i); } else if ((e = Math.min(this._mapLastRect.left, this._mapRect.right + 1) - this._mapRect.left) > 0) for (n = this._mapRect.left; n < this._mapRect.left + e; n++) for (i = this._mapRect.top; i <= this._mapRect.bottom; i++) this.showGrid(n, i); if (this._mapRect.right > this._mapLastRect.right) { if ((e = this._mapRect.right - this._mapLastRect.right) > 0) for (n = Math.max(this._mapLastRect.right + 1, this._mapRect.left); n <= this._mapLastRect.right + e; n++) for (i = this._mapRect.top; i <= this._mapRect.bottom; i++) this.showGrid(n, i); } else if ((t = this._mapLastRect.right - this._mapRect.right) > 0) for (n = this._mapRect.right + 1; n <= this._mapRect.right + t; n++) for (i = this._mapLastRect.top; i <= this._mapLastRect.bottom; i++) this.hideGrid(n, i); if (this._mapRect.top > this._mapLastRect.top) { if ((t = this._mapRect.top - this._mapLastRect.top) > 0) for (i = this._mapLastRect.top; i < this._mapLastRect.top + t; i++) for (n = this._mapLastRect.left; n <= this._mapLastRect.right; n++) this.hideGrid(n, i); } else if ((e = Math.min(this._mapLastRect.top, this._mapRect.bottom + 1) - this._mapRect.top) > 0) for (i = this._mapRect.top; i < this._mapRect.top + e; i++) for (n = this._mapRect.left; n <= this._mapRect.right; n++) this.showGrid(n, i); if (this._mapRect.bottom > this._mapLastRect.bottom) { if ((e = this._mapRect.bottom - this._mapLastRect.bottom) > 0) for (i = Math.max(this._mapLastRect.bottom + 1, this._mapRect.top); i <= this._mapLastRect.bottom + e; i++) for (n = this._mapRect.left; n <= this._mapRect.right; n++) this.showGrid(n, i); } else if ((t = this._mapLastRect.bottom - this._mapRect.bottom) > 0) for (i = this._mapRect.bottom + 1; i <= this._mapRect.bottom + t; i++) for (n = this._mapLastRect.left; n <= this._mapLastRect.right; n++) this.hideGrid(n, i); }, p.showGrid = function(t, e) { if (!(t < 0 || t >= this._gridW || e < 0 || e >= this._gridH)) { var i, n = 0, s = this._gridArray[e][t]; if (null == s) s = this.getGridArray(t, e); else for (n = 0; n < s.length && n < this._layerArray.length; n++) { this._layerArray[n] && s[n] && 0 == (i = s[n]).visible && i.drawImageNum > 0 && i.show(); } } }, p.cacheAllGrid = function() { var t, e = 0, i = 0; for (e = 0; e < this._gridW; e++) for (i = 0; i < this._gridH; i++) t = this.getGridArray(e, i), this.cacheGridsArray(t); }, p.cacheGridsArray = function(e) { var i; t._tempContext || (t._tempContext = new c(1, 1, r.create("AUTO"))), (i = t._tempContext.canvas).context.asBitmap = !1; var n = 0, s = 0; s = e.length; var a; for (n = 0; n < s; n++) a = e[n], i.clear(), i.size(1, 1), a.render(t._tempContext, 0, 0), a.hide(); i.clear(), i.size(1, 1); }, p.getGridArray = function(t, e) { var i, n = 0, s = 0, a = this._gridArray[e][t]; if (null == a) { a = this._gridArray[e][t] = []; var r = 0, o = 0, h = 0, l = 0, u = this._gridWidth, c = this._gridHeight; switch (this.orientation) { case "isometric": r = Math.floor(t * u), o = Math.floor(t * u + u), h = Math.floor(e * c), l = Math.floor(e * c + c); var _ = 0, d = 0, p = 0, f = 0; break; case "staggered": r = Math.floor(t * u / this._mapTileW), o = Math.floor((t * u + u) / this._mapTileW), h = Math.floor(e * c / (this._mapTileH / 2)), l = Math.floor((e * c + c) / (this._mapTileH / 2)); break; case "orthogonal": r = Math.floor(t * u / this._mapTileW), o = Math.floor((t * u + u) / this._mapTileW), h = Math.floor(e * c / this._mapTileH), l = Math.floor((e * c + c) / this._mapTileH); break; case "hexagonal": var g = 2 * this._mapTileH / 3; r = Math.floor(t * u / this._mapTileW), o = Math.ceil((t * u + u) / this._mapTileW), h = Math.floor(e * c / g), l = Math.ceil((e * c + c) / g); } for (var m, v, y = null, x = 0; x < this._layerArray.length; x++) { y = this._layerArray[x], this.enableMergeLayer ? (y.tarLayer != v && (m = null, v = y.tarLayer), m || (m = v.getDrawSprite(t, e), a.push(m)), i = m) : (i = y.getDrawSprite(t, e), a.push(i)); var b; switch (this._showGridKey && (b = "#", b += this._colorArray[Math.floor(Math.random() * this._colorArray.length)], b += this._colorArray[Math.floor(Math.random() * this._colorArray.length)], b += this._colorArray[Math.floor(Math.random() * this._colorArray.length)]), this.orientation) { case "isometric": var w = this.tileHeight / 2, C = this.tileWidth / 2, S = this._width / 2; p = Math.floor(h / w), f = Math.floor(l / w), _ = this._mapW + Math.floor((r - S) / C), d = this._mapW + Math.floor((o - S) / C); this._mapW; var T = 2 * this._mapH; for (p < 0 && (p = 0), p >= T && (p = T - 1), f < 0 && (l = 0), f >= T && (f = T - 1), i.zOrder = this._totalGridNum * x + e * this._gridW + t, n = p; n < f; n++) for (s = 0; s <= n; s++) { var I = n - s, M = s, E = I - M + this._mapW; E > _ && E <= d && y.drawTileTexture(i, I, M) && i.drawImageNum++; } break; case "staggered": for (i.zOrder = x * this._totalGridNum + e * this._gridW + t, n = h; n < l; n++) for (s = r; s < o; s++) y.drawTileTexture(i, s, n) && i.drawImageNum++; break; case "orthogonal": case "hexagonal": switch (this._renderOrder) { case "right-down": for (i.zOrder = x * this._totalGridNum + e * this._gridW + t, n = h; n < l; n++) for (s = r; s < o; s++) y.drawTileTexture(i, s, n) && i.drawImageNum++; break; case "right-up": for (i.zOrder = x * this._totalGridNum + (this._gridH - 1 - e) * this._gridW + t, n = l - 1; n >= h; n--) for (s = r; s < o; s++) y.drawTileTexture(i, s, n) && i.drawImageNum++; break; case "left-down": for (i.zOrder = x * this._totalGridNum + e * this._gridW + (this._gridW - 1 - t), n = h; n < l; n++) for (s = o - 1; s >= r; s--) y.drawTileTexture(i, s, n) && i.drawImageNum++; break; case "left-up": for (i.zOrder = x * this._totalGridNum + (this._gridH - 1 - e) * this._gridW + (this._gridW - 1 - t), n = l - 1; n >= h; n--) for (s = o - 1; s >= r; s--) y.drawTileTexture(i, s, n) && i.drawImageNum++; } } i.isHaveAnimation || (i.autoSize = !0, this.autoCache && (i.cacheAs = this.autoCacheType), i.autoSize = !1), this.enableMergeLayer ? m && m.drawImageNum > 0 && v && (v.addChild(m), m.visible = !1, m.show()) : (i.drawImageNum > 0 && (y.addChild(i), i.visible = !1, i.show()), this._showGridKey && i.graphics.drawRect(0, 0, u, c, null, b)); } this.enableMergeLayer && this.showGridTextureCount && m && m.graphics.fillText(m.drawImageNum + "", 20, 20, null, "#ff0000", "left"); } return a; }, p.hideGrid = function(t, e) { if (!(t < 0 || t >= this._gridW || e < 0 || e >= this._gridH)) { var i = this._gridArray[e][t]; if (i) for (var n, s = 0; s < i.length; s++) (n = i[s]).drawImageNum > 0 && null != n && n.hide(); } }, p.getLayerObject = function(t, e) { for (var i = null, n = 0; n < this._layerArray.length && (i = this._layerArray[n]).layerName != t; n++) ; return i ? i.getObjectByName(e) : null; }, p.destroy = function() { this._orientation = "orthogonal", this._jsonData = null; var t = 0; this._gridArray = []; var e; for (t = 0; t < this._tileTexSetArr.length; t++) (e = this._tileTexSetArr[t]) && e.clearAll(); this._tileTexSetArr = []; for (t = 0; t < this._texArray.length; t++) this._texArray[t].destroy(); this._texArray = [], this._width = 0, this._height = 0, this._mapW = 0, this._mapH = 0, this._mapTileW = 0, this._mapTileH = 0, this._rect.setTo(0, 0, 0, 0); for (t = 0; t < this._layerArray.length; t++) this._layerArray[t].clearAll(); this._layerArray = [], this._renderLayerArray = [], this._mapSprite && (this._mapSprite.destroy(), this._mapSprite = null), this._jsonLoader = null, this._loader = null; var i = this._animationDic; for (var n in i) delete i[n]; this._properties = null, i = this._tileProperties; for (n in i) delete i[n]; this._currTileSet = null, this._completeHandler = null, this._mapRect.clearAll(), this._mapLastRect.clearAll(), this._tileSetArray = [], this._gridWidth = 450, this._gridHeight = 450, this._gridW = 0, this._gridH = 0, this._x = 0, this._y = 0, this._index = 0, this._enableLinear = !0, this._resPath = null, this._pathArray = null; }, p.mapSprite = function() { return this._mapSprite; }, p.getLayerByName = function(t) { for (var e, i = 0; i < this._layerArray.length; i++) if (e = this._layerArray[i], t == e.layerName) return e; return null; }, p.getLayerByIndex = function(t) { return t < this._layerArray.length ? this._layerArray[t] : null; }, s(0, p, "orientation", function() { return this._orientation; }), s(0, p, "viewPortX", function() { return -this._viewPortX; }), s(0, p, "scale", function() { return this._scale; }, function(t) { t <= 0 || (this._scale = t, this._viewPortWidth = this._rect.width / t, this._viewPortHeight = this._rect.height / t, this._mapSprite.scale(this._scale, this._scale), this.updateViewPort()); }), s(0, p, "tileWidth", function() { return this._mapTileW; }), s(0, p, "viewPortY", function() { return -this._viewPortY; }), s(0, p, "tileHeight", function() { return this._mapTileH; }), s(0, p, "width", function() { return this._width; }), s(0, p, "numRowsTile", function() { return this._mapH; }), s(0, p, "numColumnsTile", function() { return this._mapW; }), s(0, p, "height", function() { return this._height; }), s(0, p, "viewPortWidth", function() { return this._viewPortWidth; }), s(0, p, "viewPortHeight", function() { return this._viewPortHeight; }), s(0, p, "x", function() { return this._x; }), s(0, p, "y", function() { return this._y; }), s(0, p, "gridWidth", function() { return this._gridWidth; }), s(0, p, "gridHeight", function() { return this._gridHeight; }), s(0, p, "numColumnsGrid", function() { return this._gridW; }), s(0, p, "numRowsGrid", function() { return this._gridH; }), s(0, p, "renderOrder", function() { return this._renderOrder; }), t.ORIENTATION_ORTHOGONAL = "orthogonal", t.ORIENTATION_ISOMETRIC = "isometric", t.ORIENTATION_STAGGERED = "staggered", t.ORIENTATION_HEXAGONAL = "hexagonal", t.RENDERORDER_RIGHTDOWN = "right-down", t.RENDERORDER_RIGHTUP = "right-up", t.RENDERORDER_LEFTDOWN = "left-down", t.RENDERORDER_LEFTUP = "left-up", t._tempContext = null, t.__init$ = function() { e = function() { function t() { this.left = 0, this.top = 0, this.right = 0, this.bottom = 0; } n(t, ""); return t.prototype.clearAll = function() { this.left = this.top = this.right = this.bottom = 0; }, t; }(), a = function() { function t() { this.mAniIdArray = [], this.mDurationTimeArray = [], this.mTileTexSetArr = [], this.image = null; } return n(t, ""), t; }(), h = function() { function t() { this.firstgid = 0, this.image = "", this.imageheight = 0, this.imagewidth = 0, this.margin = 0, this.name = 0, this.properties = null, this.spacing = 0, this.tileheight = 0, this.tilewidth = 0, this.titleoffsetX = 0, this.titleoffsetY = 0, this.tileproperties = null; } n(t, ""); return t.prototype.init = function(t) { this.firstgid = t.firstgid, this.image = t.image, this.imageheight = t.imageheight, this.imagewidth = t.imagewidth, this.margin = t.margin, this.name = t.name, this.properties = t.properties, this.spacing = t.spacing, this.tileheight = t.tileheight, this.tilewidth = t.tilewidth, this.tileproperties = t.tileproperties; var e = t.tileoffset; e && (this.titleoffsetX = e.x, this.titleoffsetY = e.y); }, t; }(); }, t; }(), f = function() { function t() { this.gid = -1, this.texture = null, this.offX = 0, this.offY = 0, this.textureArray = null, this.durationTimeArray = null, this.animationTotalTime = 0, this.isAnimation = !1, this._spriteNum = 0, this._aniDic = null, this._frameIndex = 0, this._time = 0, this._interval = 0, this._preFrameTime = 0; } n(t, "laya.map.TileTexSet"); var e = t.prototype; return e.addAniSprite = function(t, e) { if (0 != this.animationTotalTime && (null == this._aniDic && (this._aniDic = {}), 0 == this._spriteNum && (i.timer.frameLoop(3, this, this.animate), this._preFrameTime = a.now(), this._frameIndex = 0, this._time = 0, this._interval = 0), this._spriteNum++, this._aniDic[t] = e, this.textureArray && this._frameIndex < this.textureArray.length)) { var n = this.textureArray[this._frameIndex]; this.drawTexture(e, n); } }, e.animate = function() { if (this.textureArray && this.textureArray.length > 0 && this.durationTimeArray && this.durationTimeArray.length > 0) { var t = a.now(); this._interval = t - this._preFrameTime, this._preFrameTime = t, this._interval > this.animationTotalTime && (this._interval = this._interval % this.animationTotalTime), this._time += this._interval; for (var e = this.durationTimeArray[this._frameIndex]; this._time > e; ) { this._time -= e, this._frameIndex++, (this._frameIndex >= this.durationTimeArray.length || this._frameIndex >= this.textureArray.length) && (this._frameIndex = 0); var i, n = this.textureArray[this._frameIndex]; for (var s in this._aniDic) i = this._aniDic[s], this.drawTexture(i, n); e = this.durationTimeArray[this._frameIndex]; } } }, e.drawTexture = function(t, e) { t.graphics.clear(), t.graphics.drawTexture(e.texture, e.offX, e.offY); }, e.removeAniSprite = function(t) { this._aniDic && this._aniDic[t] && (delete this._aniDic[t], this._spriteNum--, 0 == this._spriteNum && i.timer.clear(this, this.animate)); }, e.showDebugInfo = function() { var t = null; return this._spriteNum > 0 && (t = "TileTextureSet::gid:" + this.gid.toString() + " 动画数:" + this._spriteNum.toString()), t; }, e.clearAll = function() { this.gid = -1, this.texture && (this.texture.destroy(), this.texture = null), this.offX = 0, this.offY = 0, this.textureArray = null, this.durationTimeArray = null, this.isAnimation = !1, this._spriteNum = 0, this._aniDic = null, this._frameIndex = 0, this._preFrameTime = 0, this._time = 0, this._interval = 0; }, t; }(), g = function(t) { function e() { this.relativeX = 0, this.relativeY = 0, this.isAloneObject = !1, this.isHaveAnimation = !1, this.aniSpriteArray = null, this.drawImageNum = 0, this._map = null, e.__super.call(this); } n(e, "laya.map.GridSprite", t); var i = e.prototype; return i.initData = function(t, e) { void 0 === e && (e = !1), this._map = t, this.isAloneObject = e; }, i._setDisplay = function(e) { if (!e) { var i = this._$P.cacheCanvas; i && i.ctx && (i.ctx.canvas.destroy(), i.ctx = null); var n = this._$P._filterCache; n && (n.destroy(), n.recycle(), this._set$P("_filterCache", null)), this._$P._isHaveGlowFilter && this._set$P("_isHaveGlowFilter", !1); } t.prototype._setDisplay.call(this, e); }, i.addAniSprite = function(t) { null == this.aniSpriteArray && (this.aniSpriteArray = []), this.aniSpriteArray.push(t); }, i.show = function() { if (!this.visible) { if (this.visible = !0, !this.isAloneObject) { var t; (t = this.parent) && t.showGridSprite(this); } if (!u.isWebGL && this._map.autoCache && (this.cacheAs = this._map.autoCacheType), null == this.aniSpriteArray) return; for (var e = 0; e < this.aniSpriteArray.length; e++) this.aniSpriteArray[e].show(); } }, i.hide = function() { if (this.visible) { if (this.visible = !1, !this.isAloneObject) { var t; (t = this.parent) && t.hideGridSprite(this); } if (!u.isWebGL && this._map.autoCache && (this.cacheAs = "none"), null == this.aniSpriteArray) return; for (var e = 0; e < this.aniSpriteArray.length; e++) this.aniSpriteArray[e].hide(); } }, i.updatePos = function() { this.isAloneObject ? (this._map && (this.x = this.relativeX, this.y = this.relativeY), this.x < 0 || this.x > this._map.viewPortWidth || this.y < 0 || this.y > this._map.viewPortHeight ? this.hide() : this.show()) : this._map && (this.x = this.relativeX, this.y = this.relativeY); }, i.clearAll = function() { this._map && (this._map = null), this.visible = !1; if (null != this.aniSpriteArray) for (var t = 0; t < this.aniSpriteArray.length; t++) this.aniSpriteArray[t].clearAll(); this.destroy(), this.relativeX = 0, this.relativeY = 0, this.isHaveAnimation = !1, this.aniSpriteArray = null, this.drawImageNum = 0; }, e; }(_), m = function(t) { function e() { this._map = null, this._mapData = null, this._tileWidthHalf = 0, this._tileHeightHalf = 0, this._mapWidthHalf = 0, this._mapHeightHalf = 0, this._gridSpriteArray = [], this._objDic = null, this._dataDic = null, this._properties = null, this.tarLayer = null, this.layerName = null, this._showGridList = [], this._aloneObjs = [], e.__super.call(this), this._tempMapPos = new h(); } n(e, "laya.map.MapLayer", t); var i = e.prototype; return i.init = function(t, e) { this._map = e, this._mapData = t.data; t.height, t.width; var i = e.tileWidth, n = e.tileHeight; switch (this.layerName = t.name, this._properties = t.properties, this.alpha = t.opacity, this._tileWidthHalf = i / 2, this._tileHeightHalf = n / 2, this._mapWidthHalf = this._map.width / 2 - this._tileWidthHalf, this._mapHeightHalf = this._map.height / 2, t.type) { case "tilelayer": break; case "objectgroup": var s = t.objects; s.length > 0 && (this._objDic = {}, this._dataDic = {}); for (var a, r = NaN, o = NaN, l = 0; l < s.length; l++) if (a = s[l], this._dataDic[a.name] = a, 1 == a.visible) { r = a.width, o = a.height; var u = e.getSprite(a.gid, r, o); if (null != u) { switch (this._map.orientation) { case "isometric": this.getScreenPositionByTilePos(a.x / n, a.y / n, h.TEMP), u.pivot(r / 2, o / 2), u.rotation = a.rotation, u.x = u.relativeX = h.TEMP.x + this._map.viewPortX, u.y = u.relativeY = h.TEMP.y + this._map.viewPortY - o / 2; break; case "staggered": case "orthogonal": u.pivot(r / 2, o / 2), u.rotation = a.rotation, u.x = u.relativeX = a.x + r / 2, u.y = u.relativeY = a.y - o / 2; break; case "hexagonal": u.x = u.relativeX = a.x, u.y = u.relativeY = a.y; } this.addChild(u), this._gridSpriteArray.push(u), u.isAloneObject && (this._showGridList.push(u), this._aloneObjs.push(u)), this._objDic[a.name] = u; } } } }, i.getObjectByName = function(t) { return this._objDic ? this._objDic[t] : null; }, i.getObjectDataByName = function(t) { return this._dataDic ? this._dataDic[t] : null; }, i.getLayerProperties = function(t) { return this._properties ? this._properties[t] : null; }, i.getTileData = function(t, e) { if (e >= 0 && e < this._map.numRowsTile && t >= 0 && t < this._map.numColumnsTile) { var i = e * this._map.numColumnsTile + t, n = this._mapData; if (null != n && i < n.length) return n[i]; } return 0; }, i.getScreenPositionByTilePos = function(t, e, i) { if (i) { switch (this._map.orientation) { case "isometric": i.x = this._map.width / 2 - (e - t) * this._tileWidthHalf, i.y = (e + t) * this._tileHeightHalf; break; case "staggered": t = Math.floor(t), e = Math.floor(e), i.x = t * this._map.tileWidth + (1 & e) * this._tileWidthHalf, i.y = e * this._tileHeightHalf; break; case "orthogonal": i.x = t * this._map.tileWidth, i.y = e * this._map.tileHeight; break; case "hexagonal": t = Math.floor(t), e = Math.floor(e); var n = 2 * this._map.tileHeight / 3; i.x = (t * this._map.tileWidth + e % 2 * this._tileWidthHalf) % this._map.gridWidth, i.y = e * n % this._map.gridHeight; } i.x = (i.x + this._map.viewPortX) * this._map.scale, i.y = (i.y + this._map.viewPortY) * this._map.scale; } }, i.getTileDataByScreenPos = function(t, e) { var i = 0; return this.getTilePositionByScreenPos(t, e, this._tempMapPos) && (i = this.getTileData(Math.floor(this._tempMapPos.x), Math.floor(this._tempMapPos.y))), i; }, i.getTilePositionByScreenPos = function(t, e, i) { t = t / this._map.scale - this._map.viewPortX, e = e / this._map.scale - this._map.viewPortY; var n = this._map.tileWidth, s = this._map.tileHeight, a = 0, r = 0; switch (this._map.orientation) { case "isometric": var o = t - this._map.width / 2; return a = -(o / n - e / s), r = o / n + e / s, i && (i.x = r, i.y = a), !0; case "staggered": if (i) { var h = 0, l = 0; h = (t - (Math.floor(t / n) * n + n / 2)) * s / 2, l = (e - (Math.floor(e / s) * s + s / 2)) * n / 2, Math.abs(h) + Math.abs(l) <= n * s / 4 ? (r = Math.floor(t / n), a = 2 * Math.floor(e / s)) : (t -= n / 2, r = Math.floor(t / n) + 1, e -= s / 2, a = 2 * Math.floor(e / s) + 1), i.x = r - (1 & a), i.y = a; } return !0; case "orthogonal": return r = t / n, a = e / s, i && (i.x = r, i.y = a), !0; case "hexagonal": r = (t - (a = e / (2 * s / 3)) % 2 * this._tileWidthHalf) / n, i && (i.x = r, i.y = a); } return !1; }, i.getDrawSprite = function(t, e) { var i = new g(); return i.relativeX = t * this._map.gridWidth, i.relativeY = e * this._map.gridHeight, i.initData(this._map), i.updatePos(), this._gridSpriteArray.push(i), i; }, i.showGridSprite = function(t) { var e = this._showGridList, i = 0, n = 0; n = e.length; var s, a = -1; for (i = 0; i < n; i++) { if ((s = e[i]) == t) return; s.isAloneObject || s.visible || (a = i); } a >= 0 ? e[a] = t : e.push(t); }, i.hideGridSprite = function(t) { t.visible = !1; }, i.updateGridPos = function() { var t, e, i = 0; i = (e = this._showGridList).length; for (var n = 0; n < i; n++) ((t = e[n])._style.visible || t.isAloneObject) && t.drawImageNum > 0 && t.updatePos(); }, i.updateAloneObject = function() { var t, e, i = 0; i = (e = this._aloneObjs).length; for (var n = 0; n < i; n++) (t = e[n]).drawImageNum > 0 && t.updatePos(); }, i.render = function(e, i, n) { var s = this._childs; this._childs = this._showGridList, t.prototype.render.call(this, e, i, n), this._childs = s; }, i.drawTileTexture = function(t, e, i) { if (i >= 0 && i < this._map.numRowsTile && e >= 0 && e < this._map.numColumnsTile) { var n = i * this._map.numColumnsTile + e, s = this._mapData; if (null != s && n < s.length && 0 != s[n]) { var a = this._map.getTexture(s[n]); if (a) { var r = 0, o = 0; a.texture; switch (this._map.orientation) { case "staggered": r = e * this._map.tileWidth % this._map.gridWidth + (1 & i) * this._tileWidthHalf, o = i * this._tileHeightHalf % this._map.gridHeight; break; case "orthogonal": r = e * this._map.tileWidth % this._map.gridWidth, o = i * this._map.tileHeight % this._map.gridHeight; break; case "isometric": r = (this._mapWidthHalf + (e - i) * this._tileWidthHalf) % this._map.gridWidth, o = (e + i) * this._tileHeightHalf % this._map.gridHeight; break; case "hexagonal": var h = 2 * this._map.tileHeight / 3; r = (e * this._map.tileWidth + i % 2 * this._tileWidthHalf) % this._map.gridWidth, o = i * h % this._map.gridHeight; } if (a.isAnimation) { var l = new v(); l.x = r, l.y = o, l.setTileTextureSet(n.toString(), a), t.addAniSprite(l), t.addChild(l), t.isHaveAnimation = !0; } else t.graphics.drawTexture(a.texture, r + a.offX, o + a.offY); return !0; } } } return !1; }, i.clearAll = function() { this._map = null, this._mapData = null, this._tileWidthHalf = 0, this._tileHeightHalf = 0, this._mapWidthHalf = 0, this._mapHeightHalf = 0, this.layerName = null; var t = 0; if (this._objDic) { for (var e in this._objDic) delete this._objDic[e]; this._objDic = null; } if (this._dataDic) { for (e in this._dataDic) delete this._dataDic[e]; this._dataDic = null; } for (t = 0; t < this._gridSpriteArray.length; t++) this._gridSpriteArray[t].clearAll(); this._properties = null, this._tempMapPos = null, this.tarLayer = null; }, e; }(_), v = function(t) { function e() { this._tileTextureSet = null, this._aniName = null, e.__super.call(this); } n(e, "laya.map.TileAniSprite", _); var i = e.prototype; return i.setTileTextureSet = function(t, e) { this._aniName = t, this._tileTextureSet = e, e.addAniSprite(this._aniName, this); }, i.show = function() { this._tileTextureSet.addAniSprite(this._aniName, this); }, i.hide = function() { this._tileTextureSet.removeAniSprite(this._aniName); }, i.clearAll = function() { this._tileTextureSet.removeAniSprite(this._aniName), this.destroy(), this._tileTextureSet = null, this._aniName = null; }, e; }(); i.__init([ p ]); }(window, document, Laya), "function" == typeof define && define.amd && define("laya.core", [ "require", "exports" ], function(t, e) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }); for (var i in Laya) { var n = Laya[i]; n && n.__isclass && (e[i] = n); } }), function(t, e, i) { i.un, i.uns; var n = i.static, s = i.class, a = i.getset, r = (i.__newvec, laya.display.Animation), o = laya.utils.Browser, h = laya.utils.ClassUtils, l = laya.filters.ColorFilter, u = laya.utils.Ease, c = laya.events.Event, _ = (laya.events.EventDispatcher, laya.display.css.Font), d = laya.display.FrameAnimation, p = laya.display.Graphics, f = laya.utils.Handler, g = laya.net.HttpRequest, m = laya.display.Input, v = laya.net.Loader, y = laya.net.LocalStorage, x = (laya.display.Node, laya.maths.Point), b = laya.maths.Rectangle, w = laya.renders.Render, C = laya.display.Sprite, S = (laya.display.Stage, laya.display.Text), T = laya.resource.Texture, I = laya.utils.TimeLine, M = laya.utils.Tween, E = laya.utils.Utils, A = laya.utils.WeakObject; i.interface("laya.ui.IItem"), i.interface("laya.ui.IRender"), i.interface("laya.ui.ISelect"), i.interface("laya.ui.IComponent"), i.interface("laya.ui.IBox", "IComponent"); var L = function() { function t() { this.enable = !1, this.top = NaN, this.bottom = NaN, this.left = NaN, this.right = NaN, this.centerX = NaN, this.centerY = NaN, this.anchorX = NaN, this.anchorY = NaN; } return s(t, "laya.ui.LayoutStyle"), n(t, [ "EMPTY", function() { return this.EMPTY = new t(); } ]), t; }(), P = function() { function t() {} return s(t, "laya.ui.Styles"), t.labelColor = "#000000", t.buttonStateNum = 3, t.scrollBarMinNum = 15, t.scrollBarDelayTime = 500, n(t, [ "defaultSizeGrid", function() { return this.defaultSizeGrid = [ 4, 4, 4, 4, 0 ]; }, "labelPadding", function() { return this.labelPadding = [ 2, 2, 2, 2 ]; }, "inputLabelPadding", function() { return this.inputLabelPadding = [ 1, 1, 1, 3 ]; }, "buttonLabelColors", function() { return this.buttonLabelColors = [ "#32556b", "#32cc6b", "#ff0000", "#C0C0C0" ]; }, "comboBoxItemColors", function() { return this.comboBoxItemColors = [ "#5e95b6", "#ffffff", "#000000", "#8fa4b1", "#ffffff" ]; } ]), t; }(), k = function() { function t() {} return s(t, "laya.ui.UIUtils"), t.fillArray = function(t, e, i) { var n = t.concat(); if (e) for (var s = e.split(","), a = 0, r = Math.min(n.length, s.length); a < r; a++) { var o = s[a]; n[a] = "true" == o || "false" != o && o, null != i && (n[a] = i(o)); } return n; }, t.toColor = function(t) { return E.toHexColor(t); }, t.gray = function(e, i) { void 0 === i && (i = !0), i ? t.addFilter(e, t.grayFilter) : t.clearFilter(e, l); }, t.addFilter = function(t, e) { var i = t.filters || []; i.push(e), t.filters = i; }, t.clearFilter = function(t, e) { var n = t.filters; if (null != n && n.length > 0) { for (var s = n.length - 1; s > -1; s--) { var a = n[s]; i.__typeof(a, e) && n.splice(s, 1); } t.filters = n; } }, t._getReplaceStr = function(e) { return t.escapeSequence[e]; }, t.adptString = function(e) { return e.replace(/\\(\w)/g, t._getReplaceStr); }, t.getBindFun = function(e) { var n = t._funMap.get(e); if (null == n) { var s = '"' + e + '"', a = "(function(data){if(data==null)return;with(data){try{\nreturn " + (s = s.replace(/^"\${|}"$/g, "").replace(/\${/g, '"+').replace(/}/g, '+"')) + "\n}catch(e){}}})"; n = i._runScript(a), t._funMap.set(e, n); } return n; }, n(t, [ "grayFilter", function() { return this.grayFilter = new l([ .3086, .6094, .082, 0, 0, .3086, .6094, .082, 0, 0, .3086, .6094, .082, 0, 0, 0, 0, 0, 1, 0 ]); }, "escapeSequence", function() { return this.escapeSequence = { "\\n": "\n", "\\t": "\t" }; }, "_funMap", function() { return this._funMap = new A(); } ]), t; }(), R = function() { function t() {} return s(t, "UIConfig"), t.touchScrollEnable = !0, t.mouseWheelEnable = !0, t.showButtons = !0, t.popupBgColor = "#000000", t.popupBgAlpha = .5, t.closeDialogOnSide = !0, t; }(), D = function(t) { function e() { this.autoCacheCmd = !0, this._width = 0, this._height = 0, this._source = null, this._sizeGrid = null, this._isChanged = !1, this._offset = null, e.__super.call(this); } s(e, "laya.ui.AutoBitmap", t); var n = e.prototype; return n.destroy = function() { t.prototype.destroy.call(this), this._source = null, this._sizeGrid = null, this._offset = null; }, n._setChanged = function() { this._isChanged || (this._isChanged = !0, i.timer.callLater(this, this.changeSource)); }, n.changeSource = function() { this._isChanged = !1; var t = this._source; if (t && t.bitmap) { var i = this.width, n = this.height, s = this._sizeGrid, a = t.sourceWidth, r = t.sourceHeight; if (!s || a === i && r === n) this.clear(), this.drawTexture(t, this._offset ? this._offset[0] : 0, this._offset ? this._offset[1] : 0, i, n); else { t.$_GID || (t.$_GID = E.getGID()); var o = t.$_GID + "." + i + "." + n + "." + s.join("."); if (E.isOKCmdList(A.I.get(o))) return void (this.cmds = A.I.get(o)); this.clear(); var h = s[0], l = s[1], u = s[2], c = s[3], _ = s[4], d = !1; if (i == a && (c = l = 0), n == r && (h = u = 0), c + l > i) { var p = i; d = !0, i = c + l, this.save(), this.clipRect(0, 0, p, n); } c && h && this.drawTexture(e.getTexture(t, 0, 0, c, h), 0, 0, c, h), l && h && this.drawTexture(e.getTexture(t, a - l, 0, l, h), i - l, 0, l, h), c && u && this.drawTexture(e.getTexture(t, 0, r - u, c, u), 0, n - u, c, u), l && u && this.drawTexture(e.getTexture(t, a - l, r - u, l, u), i - l, n - u, l, u), h && this.drawBitmap(_, e.getTexture(t, c, 0, a - c - l, h), c, 0, i - c - l, h), u && this.drawBitmap(_, e.getTexture(t, c, r - u, a - c - l, u), c, n - u, i - c - l, u), c && this.drawBitmap(_, e.getTexture(t, 0, h, c, r - h - u), 0, h, c, n - h - u), l && this.drawBitmap(_, e.getTexture(t, a - l, h, l, r - h - u), i - l, h, l, n - h - u), this.drawBitmap(_, e.getTexture(t, c, h, a - c - l, r - h - u), c, h, i - c - l, n - h - u), d && this.restore(), this.autoCacheCmd && !w.isConchApp && A.I.set(o, this.cmds); } this._repaint(); } }, n.drawBitmap = function(t, e, i, n, s, a) { void 0 === s && (s = 0), void 0 === a && (a = 0), s < .1 || a < .1 || (!t || e.width == s && e.height == a ? this.drawTexture(e, i, n, s, a) : this.fillTexture(e, i, n, s, a)); }, n.clear = function(e) { void 0 === e && (e = !0), t.prototype.clear.call(this, !1); }, a(0, n, "sizeGrid", function() { return this._sizeGrid; }, function(t) { this._sizeGrid = t, this._setChanged(); }), a(0, n, "width", function() { return this._width ? this._width : this._source ? this._source.sourceWidth : 0; }, function(t) { this._width != t && (this._width = t, this._setChanged()); }), a(0, n, "height", function() { return this._height ? this._height : this._source ? this._source.sourceHeight : 0; }, function(t) { this._height != t && (this._height = t, this._setChanged()); }), a(0, n, "source", function() { return this._source; }, function(t) { t ? (this._source = t, this._setChanged()) : (this._source = null, this.clear()); }), e.getTexture = function(t, e, i, n, s) { n <= 0 && (n = 1), s <= 0 && (s = 1), t.$_GID || (t.$_GID = E.getGID()); var a = t.$_GID + "." + e + "." + i + "." + n + "." + s, r = A.I.get(a); return r && r.source || (r = T.createFromTexture(t, e, i, n, s), A.I.set(a, r)), r; }, e; }(p), N = (function(t) { function e() { e.__super.call(this); } s(e, "laya.ui.UIEvent", c), e.SHOW_TIP = "showtip", e.HIDE_TIP = "hidetip"; }(), function(t) { function e() { this._comXml = null, this._dataSource = null, this._toolTip = null, this._tag = null, this._disabled = !1, this._gray = !1, this.layoutEnabled = !0, e.__super.call(this), this._layout = L.EMPTY, this.preinitialize(), this.createChildren(), this.initialize(); } s(e, "laya.ui.Component", t); var n = e.prototype; return i.imps(n, { "laya.ui.IComponent": !0 }), n.destroy = function(e) { void 0 === e && (e = !0), t.prototype.destroy.call(this, e), this._dataSource = this._layout = null, this._tag = null, this._toolTip = null; }, n.preinitialize = function() {}, n.createChildren = function() {}, n.initialize = function() {}, n.callLater = function(t, e) { i.timer.callLater(this, t, e); }, n.runCallLater = function(t) { i.timer.runCallLater(this, t); }, n.commitMeasure = function() {}, n.changeSize = function() { this.event("resize"), this._layout.enable && (this.resetLayoutX(), this.resetLayoutY()); }, n.getLayout = function() { return this._layout === L.EMPTY && (this._layout = new L()), this._layout; }, n._setLayoutEnabled = function(t) { this._layout && this._layout.enable != t && (this._layout.enable = t, this.on("added", this, this.onAdded), this.on("removed", this, this.onRemoved), this.parent && this.onAdded()); }, n.onRemoved = function() { this.parent.off("resize", this, this.onCompResize); }, n.onAdded = function() { this.parent.on("resize", this, this.onCompResize), this.resetLayoutX(), this.resetLayoutY(); }, n.onCompResize = function() { this._layout && this._layout.enable && (this.resetLayoutX(), this.resetLayoutY()); }, n.resetLayoutX = function() { var t = this._layout; if (isNaN(t.anchorX) || (this.pivotX = t.anchorX * this.width), this.layoutEnabled) { var e = this.parent; e && (isNaN(t.centerX) ? isNaN(t.left) ? isNaN(t.right) || (this.x = Math.round(e.width - this.displayWidth - t.right + this.pivotX * this.scaleX)) : (this.x = Math.round(t.left + this.pivotX * this.scaleX), isNaN(t.right) || (this.width = (e._width - t.left - t.right) / (this.scaleX || .01))) : this.x = Math.round(.5 * (e.width - this.displayWidth) + t.centerX + this.pivotX * this.scaleX)); } }, n.resetLayoutY = function() { var t = this._layout; if (isNaN(t.anchorY) || (this.pivotY = t.anchorY * this.height), this.layoutEnabled) { var e = this.parent; e && (isNaN(t.centerY) ? isNaN(t.top) ? isNaN(t.bottom) || (this.y = Math.round(e.height - this.displayHeight - t.bottom + this.pivotY * this.scaleY)) : (this.y = Math.round(t.top + this.pivotY * this.scaleY), isNaN(t.bottom) || (this.height = (e._height - t.top - t.bottom) / (this.scaleY || .01))) : this.y = Math.round(.5 * (e.height - this.displayHeight) + t.centerY + this.pivotY * this.scaleY)); } }, n.onMouseOver = function(t) { i.stage.event("showtip", this._toolTip); }, n.onMouseOut = function(t) { i.stage.event("hidetip", this._toolTip); }, n._childChanged = function(e) { this.callLater(this.changeSize), t.prototype._childChanged.call(this, e); }, a(0, n, "displayWidth", function() { return this.width * this.scaleX; }), a(0, n, "width", function() { return this._width ? this._width : this.measureWidth; }, function(t) { this._width != t && (this._width = t, this.conchModel && this.conchModel.size(this._width, this._height), this.callLater(this.changeSize), !this._layout.enable || isNaN(this._layout.centerX) && isNaN(this._layout.right) && isNaN(this._layout.anchorX) || this.resetLayoutX()); }), a(0, n, "measureWidth", function() { var t = 0; this.commitMeasure(); for (var e = this.numChildren - 1; e > -1; e--) { var i = this.getChildAt(e); i.visible && (t = Math.max(i.x + i.width * i.scaleX, t)); } return t; }), a(0, n, "displayHeight", function() { return this.height * this.scaleY; }), a(0, n, "height", function() { return this._height ? this._height : this.measureHeight; }, function(t) { this._height != t && (this._height = t, this.conchModel && this.conchModel.size(this._width, this._height), this.callLater(this.changeSize), !this._layout.enable || isNaN(this._layout.centerY) && isNaN(this._layout.bottom) && isNaN(this._layout.anchorY) || this.resetLayoutY()); }), a(0, n, "dataSource", function() { return this._dataSource; }, function(t) { this._dataSource = t; for (var e in this._dataSource) this.hasOwnProperty(e) && "function" != typeof this[e] && (this[e] = this._dataSource[e]); }), a(0, n, "scaleY", t.prototype._$get_scaleY, function(t) { i.superGet(C, this, "scaleY") != t && (i.superSet(C, this, "scaleY", t), this.callLater(this.changeSize), this._layout.enable && this.resetLayoutY()); }), a(0, n, "measureHeight", function() { var t = 0; this.commitMeasure(); for (var e = this.numChildren - 1; e > -1; e--) { var i = this.getChildAt(e); i.visible && (t = Math.max(i.y + i.height * i.scaleY, t)); } return t; }), a(0, n, "scaleX", t.prototype._$get_scaleX, function(t) { i.superGet(C, this, "scaleX") != t && (i.superSet(C, this, "scaleX", t), this.callLater(this.changeSize), this._layout.enable && this.resetLayoutX()); }), a(0, n, "top", function() { return this._layout.top; }, function(t) { t != this._layout.top && (this.getLayout().top = t, this._setLayoutEnabled(!0)), this.resetLayoutY(); }), a(0, n, "bottom", function() { return this._layout.bottom; }, function(t) { t != this._layout.bottom && (this.getLayout().bottom = t, this._setLayoutEnabled(!0)), this.resetLayoutY(); }), a(0, n, "left", function() { return this._layout.left; }, function(t) { t != this._layout.left && (this.getLayout().left = t, this._setLayoutEnabled(!0)), this.resetLayoutX(); }), a(0, n, "right", function() { return this._layout.right; }, function(t) { t != this._layout.right && (this.getLayout().right = t, this._setLayoutEnabled(!0)), this.resetLayoutX(); }), a(0, n, "centerX", function() { return this._layout.centerX; }, function(t) { t != this._layout.centerX && (this.getLayout().centerX = t, this._setLayoutEnabled(!0)), this.resetLayoutX(); }), a(0, n, "centerY", function() { return this._layout.centerY; }, function(t) { t != this._layout.centerY && (this.getLayout().centerY = t, this._setLayoutEnabled(!0)), this.resetLayoutY(); }), a(0, n, "anchorX", function() { return this._layout.anchorX; }, function(t) { t != this._layout.anchorX && (this.getLayout().anchorX = t, this._setLayoutEnabled(!0)), this.resetLayoutX(); }), a(0, n, "anchorY", function() { return this._layout.anchorY; }, function(t) { t != this._layout.anchorY && (this.getLayout().anchorY = t, this._setLayoutEnabled(!0)), this.resetLayoutY(); }), a(0, n, "tag", function() { return this._tag; }, function(t) { this._tag = t; }), a(0, n, "toolTip", function() { return this._toolTip; }, function(t) { this._toolTip != t && (this._toolTip = t, null != t ? (this.on("mouseover", this, this.onMouseOver), this.on("mouseout", this, this.onMouseOut)) : (this.off("mouseover", this, this.onMouseOver), this.off("mouseout", this, this.onMouseOut))); }), a(0, n, "comXml", function() { return this._comXml; }, function(t) { this._comXml = t; }), a(0, n, "gray", function() { return this._gray; }, function(t) { t !== this._gray && (this._gray = t, k.gray(this, t)); }), a(0, n, "disabled", function() { return this._disabled; }, function(t) { t !== this._disabled && (this.gray = this._disabled = t, this.mouseEnabled = !t); }), e; }(C)), F = function(t) { function e() { this.lockLayer = null, this.popupEffect = function(t) { t.scale(1, 1), M.from(t, { x: i.stage.width / 2, y: i.stage.height / 2, scaleX: 0, scaleY: 0 }, 300, u.backOut, f.create(this, this.doOpen, [ t ])); }, this.closeEffect = function(t, e) { M.to(t, { x: i.stage.width / 2, y: i.stage.height / 2, scaleX: 0, scaleY: 0 }, 300, u.strongOut, f.create(this, this.doClose, [ t, e ])); }, e.__super.call(this), this.maskLayer = new C(), this.popupEffectHandler = new f(this, this.popupEffect), this.closeEffectHandler = new f(this, this.closeEffect), this.mouseEnabled = this.maskLayer.mouseEnabled = !0, this.zOrder = 1e3, i.stage.addChild(this), i.stage.on("resize", this, this._onResize), R.closeDialogOnSide && this.maskLayer.on("click", this, this._closeOnSide), this._onResize(null); } s(e, "laya.ui.DialogManager", C); var n = e.prototype; return n._closeOnSide = function() { var t = this.getChildAt(this.numChildren - 1); t instanceof laya.ui.Dialog && t.close("side"); }, n.setLockView = function(t) { this.lockLayer || (this.lockLayer = new O(), this.lockLayer.mouseEnabled = !0, this.lockLayer.size(i.stage.width, i.stage.height)), this.lockLayer.removeChildren(), t && (t.centerX = t.centerY = 0, this.lockLayer.addChild(t)); }, n._onResize = function(t) { var e = this.maskLayer.width = i.stage.width, n = this.maskLayer.height = i.stage.height; this.lockLayer && this.lockLayer.size(e, n), this.maskLayer.graphics.clear(), this.maskLayer.graphics.drawRect(0, 0, e, n, R.popupBgColor), this.maskLayer.alpha = R.popupBgAlpha; for (var s = this.numChildren - 1; s > -1; s--) { var a = this.getChildAt(s); a.popupCenter && this._centerDialog(a); } }, n._centerDialog = function(t) { t.x = Math.round((i.stage.width - t.width >> 1) + t.pivotX), t.y = Math.round((i.stage.height - t.height >> 1) + t.pivotY); }, n.open = function(t, e, i) { void 0 === e && (e = !1), void 0 === i && (i = !1), e && this._closeAll(), t.popupCenter && this._centerDialog(t), this.addChild(t), (t.isModal || this._$P.hasZorder) && this.timer.callLater(this, this._checkMask), i && null != t.popupEffect ? t.popupEffect.runWith(t) : this.doOpen(t), this.event("open"); }, n.doOpen = function(t) { t.onOpened(); }, n.lock = function(t) { this.lockLayer && (t ? this.addChild(this.lockLayer) : this.lockLayer.removeSelf()); }, n.close = function(t, e, i) { void 0 === i && (i = !1), i && null != t.closeEffect ? t.closeEffect.runWith([ t, e ]) : this.doClose(t, e), this.event("close"); }, n.doClose = function(t, e) { t.removeSelf(), t.isModal && this._checkMask(), t.closeHandler && t.closeHandler.runWith(e), t.onClosed(e); }, n.closeAll = function() { this._closeAll(), this.event("close"); }, n._closeAll = function() { for (var t = this.numChildren - 1; t > -1; t--) { var e = this.getChildAt(t); e && null != e.close && this.doClose(e); } }, n.getDialogsByGroup = function(t) { for (var e = [], i = this.numChildren - 1; i > -1; i--) { var n = this.getChildAt(i); n && n.group === t && e.push(n); } return e; }, n.closeByGroup = function(t) { for (var e = [], i = this.numChildren - 1; i > -1; i--) { var n = this.getChildAt(i); n && n.group === t && (n.close(), e.push(n)); } return e; }, n._checkMask = function() { this.maskLayer.removeSelf(); for (var t = this.numChildren - 1; t > -1; t--) { var e = this.getChildAt(t); if (e && e.isModal) return void this.addChildAt(this.maskLayer, t); } }, e; }(), B = function(t) { function e(t) { this._bitmap = null, this._skin = null, this._group = null, e.__super.call(this), this.skin = t; } s(e, "laya.ui.Image", t); var n = e.prototype; return n.destroy = function(e) { void 0 === e && (e = !0), t.prototype.destroy.call(this, !0), this._bitmap && this._bitmap.destroy(), this._bitmap = null; }, n.dispose = function() { this.destroy(!0), i.loader.clearRes(this._skin); }, n.createChildren = function() { this.graphics = this._bitmap = new D(), this._bitmap.autoCacheCmd = !1; }, n.setSource = function(t, e) { t === this._skin && e && (this.source = e, this.onCompResize()); }, a(0, n, "source", function() { return this._bitmap.source; }, function(t) { this._bitmap && (this._bitmap.source = t, this.event("loaded"), this.repaint()); }), a(0, n, "dataSource", t.prototype._$get_dataSource, function(t) { this._dataSource = t, "string" == typeof t ? this.skin = t : i.superSet(N, this, "dataSource", t); }), a(0, n, "measureHeight", function() { return this._bitmap.height; }), a(0, n, "skin", function() { return this._skin; }, function(t) { if (this._skin != t) if (this._skin = t, t) { var e = v.getRes(t); e ? (this.source = e, this.onCompResize()) : i.loader.load(this._skin, f.create(this, this.setSource, [ this._skin ]), null, "image", 1, !0, this._group); } else this.source = null; }), a(0, n, "group", function() { return this._group; }, function(t) { t && this._skin && v.setGroup(this._skin, t), this._group = t; }), a(0, n, "sizeGrid", function() { return this._bitmap.sizeGrid ? this._bitmap.sizeGrid.join(",") : null; }, function(t) { this._bitmap.sizeGrid = k.fillArray(P.defaultSizeGrid, t, Number); }), a(0, n, "measureWidth", function() { return this._bitmap.width; }), a(0, n, "width", t.prototype._$get_width, function(t) { i.superSet(N, this, "width", t), this._bitmap.width = 0 == t ? 1e-7 : t; }), a(0, n, "height", t.prototype._$get_height, function(t) { i.superSet(N, this, "height", t), this._bitmap.height = 0 == t ? 1e-7 : t; }), e; }(N), O = function(t) { function e() { e.__super.call(this); } s(e, "laya.ui.Box", t); var n = e.prototype; return i.imps(n, { "laya.ui.IBox": !0 }), a(0, n, "dataSource", t.prototype._$get_dataSource, function(t) { this._dataSource = t; for (var e in t) { var i = this.getChildByName(e); i ? i.dataSource = t[e] : this.hasOwnProperty(e) && "function" != typeof this[e] && (this[e] = t[e]); } }), e; }(N), z = function(t) { function e(t, i) { this.toggle = !1, this._bitmap = null, this._text = null, this._strokeColors = null, this._state = 0, this._selected = !1, this._skin = null, this._autoSize = !0, this._sources = null, this._clickHandler = null, this._stateChanged = !1, e.__super.call(this), this._labelColors = P.buttonLabelColors, this._stateNum = P.buttonStateNum, void 0 === i && (i = ""), this.skin = t, this.label = i; } s(e, "laya.ui.Button", t); var r = e.prototype; return i.imps(r, { "laya.ui.ISelect": !0 }), r.destroy = function(e) { void 0 === e && (e = !0), t.prototype.destroy.call(this, e), this._bitmap && this._bitmap.destroy(), this._text && this._text.destroy(e), this._bitmap = null, this._text = null, this._clickHandler = null, this._labelColors = this._sources = this._strokeColors = null; }, r.createChildren = function() { this.graphics = this._bitmap = new D(); }, r.createText = function() { this._text || (this._text = new S(), this._text.overflow = S.HIDDEN, this._text.align = "center", this._text.valign = "middle", this._text.width = this._width, this._text.height = this._height); }, r.initialize = function() { 1 !== this._mouseEnableState && (this.mouseEnabled = !0, this._setBit(2, !0)), this._createListener("mouseover", this, this.onMouse, null, !1, !1), this._createListener("mouseout", this, this.onMouse, null, !1, !1), this._createListener("mousedown", this, this.onMouse, null, !1, !1), this._createListener("mouseup", this, this.onMouse, null, !1, !1), this._createListener("click", this, this.onMouse, null, !1, !1); }, r.onMouse = function(t) { if (!1 !== this.toggle || !this._selected) return "click" === t.type ? (this.toggle && (this.selected = !this._selected), void (this._clickHandler && this._clickHandler.run())) : void (!this._selected && (this.state = e.stateMap[t.type])); }, r.changeClips = function() { var t = v.getRes(this._skin); if (t) { var e = t.sourceWidth, i = t.sourceHeight / this._stateNum; t.$_GID || (t.$_GID = E.getGID()); var n = t.$_GID + "-" + this._stateNum, s = A.I.get(n); if (E.isOkTextureList(s) || (s = null), s) this._sources = s; else { if (this._sources = [], 1 === this._stateNum) this._sources.push(t); else for (var a = 0; a < this._stateNum; a++) this._sources.push(T.createFromTexture(t, 0, i * a, e, i)); A.I.set(n, this._sources); } this._autoSize ? (this._bitmap.width = this._width || e, this._bitmap.height = this._height || i, this._text && (this._text.width = this._bitmap.width, this._text.height = this._bitmap.height)) : this._text && (this._text.x = e); } else console.log("lose skin", this._skin); }, r.changeState = function() { this._stateChanged = !1, this.runCallLater(this.changeClips); var t = this._state < this._stateNum ? this._state : this._stateNum - 1; this._sources && (this._bitmap.source = this._sources[t]), this.label && (this._text.color = this._labelColors[t], this._strokeColors && (this._text.strokeColor = this._strokeColors[t])); }, r._setStateChanged = function() { this._stateChanged || (this._stateChanged = !0, this.callLater(this.changeState)); }, a(0, r, "labelStrokeColor", function() { return this.createText(), this._text.strokeColor; }, function(t) { this.createText(), this._text.strokeColor = t; }), a(0, r, "measureHeight", function() { return this.runCallLater(this.changeClips), this._text ? Math.max(this._bitmap.height, this._text.height) : this._bitmap.height; }), a(0, r, "skin", function() { return this._skin; }, function(t) { this._skin != t && (this._skin = t, this.callLater(this.changeClips), this._setStateChanged()); }), a(0, r, "state", function() { return this._state; }, function(t) { this._state != t && (this._state = t, this._setStateChanged()); }), a(0, r, "text", function() { return this.createText(), this._text; }), a(0, r, "stateNum", function() { return this._stateNum; }, function(t) { "string" == typeof t && (t = parseInt(t)), this._stateNum != t && (this._stateNum = t < 1 ? 1 : t > 3 ? 3 : t, this.callLater(this.changeClips)); }), a(0, r, "strokeColors", function() { return this._strokeColors ? this._strokeColors.join(",") : ""; }, function(t) { this._strokeColors = k.fillArray(P.buttonLabelColors, t, String), this._setStateChanged(); }), a(0, r, "labelColors", function() { return this._labelColors.join(","); }, function(t) { this._labelColors = k.fillArray(P.buttonLabelColors, t, String), this._setStateChanged(); }), a(0, r, "measureWidth", function() { return this.runCallLater(this.changeClips), this._autoSize ? this._bitmap.width : (this.runCallLater(this.changeState), this._bitmap.width + (this._text ? this._text.width : 0)); }), a(0, r, "label", function() { return this._text ? this._text.text : null; }, function(t) { (this._text || t) && (this.createText(), this._text.text != t && (t && !this._text.parent && this.addChild(this._text), this._text.text = (t + "").replace(/\\n/g, "\n"), this._setStateChanged())); }), a(0, r, "selected", function() { return this._selected; }, function(t) { this._selected != t && (this._selected = t, this.state = this._selected ? 2 : 0, this.event("change")); }), a(0, r, "labelPadding", function() { return this.createText(), this._text.padding.join(","); }, function(t) { this.createText(), this._text.padding = k.fillArray(P.labelPadding, t, Number); }), a(0, r, "labelSize", function() { return this.createText(), this._text.fontSize; }, function(t) { this.createText(), this._text.fontSize = t; }), a(0, r, "labelStroke", function() { return this.createText(), this._text.stroke; }, function(t) { this.createText(), this._text.stroke = t; }), a(0, r, "labelBold", function() { return this.createText(), this._text.bold; }, function(t) { this.createText(), this._text.bold = t; }), a(0, r, "labelFont", function() { return this.createText(), this._text.font; }, function(t) { this.createText(), this._text.font = t; }), a(0, r, "labelAlign", function() { return this.createText(), this._text.align; }, function(t) { this.createText(), this._text.align = t; }), a(0, r, "clickHandler", function() { return this._clickHandler; }, function(t) { this._clickHandler = t; }), a(0, r, "sizeGrid", function() { return this._bitmap.sizeGrid ? this._bitmap.sizeGrid.join(",") : null; }, function(t) { this._bitmap.sizeGrid = k.fillArray(P.defaultSizeGrid, t, Number); }), a(0, r, "width", t.prototype._$get_width, function(t) { i.superSet(N, this, "width", t), this._autoSize && (this._bitmap.width = t, this._text && (this._text.width = t)); }), a(0, r, "height", t.prototype._$get_height, function(t) { i.superSet(N, this, "height", t), this._autoSize && (this._bitmap.height = t, this._text && (this._text.height = t)); }), a(0, r, "dataSource", t.prototype._$get_dataSource, function(t) { this._dataSource = t, "number" == typeof t || "string" == typeof t ? this.label = t + "" : i.superSet(N, this, "dataSource", t); }), a(0, r, "iconOffset", function() { return this._bitmap._offset ? this._bitmap._offset.join(",") : null; }, function(t) { this._bitmap._offset = t ? k.fillArray([ 1, 1 ], t, Number) : []; }), n(e, [ "stateMap", function() { return this.stateMap = { mouseup: 0, mouseover: 1, mousedown: 2, mouseout: 0 }; } ]), e; }(N), U = function(t) { function e(t, i, n) { this._sources = null, this._bitmap = null, this._skin = null, this._clipX = 1, this._clipY = 1, this._clipWidth = 0, this._clipHeight = 0, this._autoPlay = !1, this._interval = 50, this._complete = null, this._isPlaying = !1, this._index = 0, this._clipChanged = !1, this._group = null, this._toIndex = -1, e.__super.call(this), void 0 === i && (i = 1), void 0 === n && (n = 1), this._clipX = i, this._clipY = n, this.skin = t; } s(e, "laya.ui.Clip", t); var n = e.prototype; return n.destroy = function(e) { void 0 === e && (e = !0), t.prototype.destroy.call(this, !0), this._bitmap && this._bitmap.destroy(), this._bitmap = null, this._sources = null; }, n.dispose = function() { this.destroy(!0), i.loader.clearRes(this._skin); }, n.createChildren = function() { this.graphics = this._bitmap = new D(); }, n._onDisplay = function(t) { this._isPlaying ? this._displayedInStage ? this.play() : this.stop() : this._autoPlay && this.play(); }, n.changeClip = function() { if (this._clipChanged = !1, this._skin) { var t = v.getRes(this._skin); t ? this.loadComplete(this._skin, t) : i.loader.load(this._skin, f.create(this, this.loadComplete, [ this._skin ])); } }, n.loadComplete = function(t, e) { if (t === this._skin && e) { var i = this._clipWidth || Math.ceil(e.sourceWidth / this._clipX), n = this._clipHeight || Math.ceil(e.sourceHeight / this._clipY), s = this._skin + i + n, a = A.I.get(s); if (E.isOkTextureList(a) || (a = null), a) this._sources = a; else { this._sources = []; for (var r = 0; r < this._clipY; r++) for (var o = 0; o < this._clipX; o++) this._sources.push(T.createFromTexture(e, i * o, n * r, i, n)); A.I.set(s, this._sources); } this.index = this._index, this.event("loaded"), this.onCompResize(); } }, n.play = function(t, e) { void 0 === t && (t = 0), void 0 === e && (e = -1), this._isPlaying = !0, this.index = t, this._toIndex = e, this._index++, i.timer.loop(this.interval, this, this._loop), this.on("display", this, this._onDisplay), this.on("undisplay", this, this._onDisplay); }, n._loop = function() { this._style.visible && this._sources && (this._index++, this._toIndex > -1 && this._index >= this._toIndex ? this.stop() : this._index >= this._sources.length && (this._index = 0), this.index = this._index); }, n.stop = function() { this._isPlaying = !1, i.timer.clear(this, this._loop), this.event("complete"); }, n._setClipChanged = function() { this._clipChanged || (this._clipChanged = !0, this.callLater(this.changeClip)); }, a(0, n, "interval", function() { return this._interval; }, function(t) { this._interval != t && (this._interval = t, this._isPlaying && this.play()); }), a(0, n, "skin", function() { return this._skin; }, function(t) { this._skin != t && (this._skin = t, t ? this._setClipChanged() : this._bitmap.source = null); }), a(0, n, "sources", function() { return this._sources; }, function(t) { this._sources = t, this.index = this._index, this.event("loaded"); }), a(0, n, "clipX", function() { return this._clipX; }, function(t) { this._clipX = t || 1, this._setClipChanged(); }), a(0, n, "clipY", function() { return this._clipY; }, function(t) { this._clipY = t || 1, this._setClipChanged(); }), a(0, n, "total", function() { return this.runCallLater(this.changeClip), this._sources ? this._sources.length : 0; }), a(0, n, "clipWidth", function() { return this._clipWidth; }, function(t) { this._clipWidth = t, this._setClipChanged(); }), a(0, n, "sizeGrid", function() { return this._bitmap.sizeGrid ? this._bitmap.sizeGrid.join(",") : null; }, function(t) { this._bitmap.sizeGrid = k.fillArray(P.defaultSizeGrid, t, Number); }), a(0, n, "group", function() { return this._group; }, function(t) { t && this._skin && v.setGroup(this._skin, t), this._group = t; }), a(0, n, "clipHeight", function() { return this._clipHeight; }, function(t) { this._clipHeight = t, this._setClipChanged(); }), a(0, n, "width", t.prototype._$get_width, function(t) { i.superSet(N, this, "width", t), this._bitmap.width = t; }), a(0, n, "height", t.prototype._$get_height, function(t) { i.superSet(N, this, "height", t), this._bitmap.height = t; }), a(0, n, "measureWidth", function() { return this.runCallLater(this.changeClip), this._bitmap.width; }), a(0, n, "measureHeight", function() { return this.runCallLater(this.changeClip), this._bitmap.height; }), a(0, n, "index", function() { return this._index; }, function(t) { this._index = t, this._bitmap && this._sources && (this._bitmap.source = this._sources[t]), this.event("change"); }), a(0, n, "autoPlay", function() { return this._autoPlay; }, function(t) { this._autoPlay != t && (this._autoPlay = t, t ? this.play() : this.stop()); }), a(0, n, "isPlaying", function() { return this._isPlaying; }, function(t) { this._isPlaying = t; }), a(0, n, "dataSource", t.prototype._$get_dataSource, function(t) { this._dataSource = t, "number" == typeof t && Math.floor(t) == t || "string" == typeof t ? this.index = parseInt(t) : i.superSet(N, this, "dataSource", t); }), a(0, n, "bitmap", function() { return this._bitmap; }), e; }(N), V = function(t) { function e() { this.changeHandler = null, this._gridSize = 11, this._bgColor = "#ffffff", this._borderColor = "#000000", this._inputColor = "#000000", this._inputBgColor = "#efefef", this._colorPanel = null, this._colorTiles = null, this._colorBlock = null, this._colorInput = null, this._colorButton = null, this._colors = [], this._selectedColor = "#000000", this._panelChanged = !1, e.__super.call(this); } s(e, "laya.ui.ColorPicker", t); var n = e.prototype; return n.destroy = function(e) { void 0 === e && (e = !0), t.prototype.destroy.call(this, e), this._colorPanel && this._colorPanel.destroy(e), this._colorButton && this._colorButton.destroy(e), this._colorPanel = null, this._colorTiles = null, this._colorBlock = null, this._colorInput = null, this._colorButton = null, this._colors = null, this.changeHandler = null; }, n.createChildren = function() { this.addChild(this._colorButton = new z()), this._colorPanel = new O(), this._colorPanel.size(230, 166), this._colorPanel.addChild(this._colorTiles = new C()), this._colorPanel.addChild(this._colorBlock = new C()), this._colorPanel.addChild(this._colorInput = new m()); }, n.initialize = function() { this._colorButton.on("click", this, this.onColorButtonClick), this._colorBlock.pos(5, 5), this._colorInput.pos(60, 5), this._colorInput.size(60, 20), this._colorInput.on("change", this, this.onColorInputChange), this._colorInput.on("keydown", this, this.onColorFieldKeyDown), this._colorTiles.pos(5, 30), this._colorTiles.on("mousemove", this, this.onColorTilesMouseMove), this._colorTiles.on("click", this, this.onColorTilesClick), this._colorTiles.size(20 * this._gridSize, 12 * this._gridSize), this._colorPanel.on("mousedown", this, this.onPanelMouseDown), this.bgColor = this._bgColor; }, n.onPanelMouseDown = function(t) { t.stopPropagation(); }, n.changePanel = function() { this._panelChanged = !1; var t = this._colorPanel.graphics; t.clear(), t.drawRect(0, 0, 230, 166, this._bgColor, this._borderColor), this.drawBlock(this._selectedColor), this._colorInput.borderColor = this._borderColor, this._colorInput.bgColor = this._inputBgColor, this._colorInput.color = this._inputColor, (t = this._colorTiles.graphics).clear(); for (var e = [ 0, 3355443, 6710886, 10066329, 13421772, 16777215, 16711680, 65280, 255, 16776960, 65535, 16711935 ], i = 0; i < 12; i++) for (var n = 0; n < 20; n++) { var s = 0; s = 0 === n ? e[i] : 1 === n ? 0 : 51 * (((3 * i + n / 6) % 3 << 0) + 3 * (i / 6 << 0)) << 16 | n % 6 * 51 << 8 | (i << 0) % 6 * 51; var a = k.toColor(s); this._colors.push(a); var r = n * this._gridSize, o = i * this._gridSize; t.drawRect(r, o, this._gridSize, this._gridSize, a, "#000000"); } }, n.onColorButtonClick = function(t) { this._colorPanel.parent ? this.close() : this.open(); }, n.open = function() { var t = this.localToGlobal(new x()), e = t.x + this._colorPanel.width <= i.stage.width ? t.x : i.stage.width - this._colorPanel.width, n = t.y + this._colorButton.height; n = n + this._colorPanel.height <= i.stage.height ? n : t.y - this._colorPanel.height, this._colorPanel.pos(e, n), this._colorPanel.zOrder = 1001, i._currentStage.addChild(this._colorPanel), i.stage.on("mousedown", this, this.removeColorBox); }, n.close = function() { i.stage.off("mousedown", this, this.removeColorBox), this._colorPanel.removeSelf(); }, n.removeColorBox = function(t) { this.close(); }, n.onColorFieldKeyDown = function(t) { 13 == t.keyCode && (this._colorInput.text ? this.selectedColor = this._colorInput.text : this.selectedColor = null, this.close(), t.stopPropagation()); }, n.onColorInputChange = function(t) { this._colorInput.text ? this.drawBlock(this._colorInput.text) : this.drawBlock("#FFFFFF"); }, n.onColorTilesClick = function(t) { this.selectedColor = this.getColorByMouse(), this.close(); }, n.onColorTilesMouseMove = function(t) { this._colorInput.focus = !1; var e = this.getColorByMouse(); this._colorInput.text = e, this.drawBlock(e); }, n.getColorByMouse = function() { var t = this._colorTiles.getMousePoint(), e = Math.floor(t.x / this._gridSize), i = Math.floor(t.y / this._gridSize); return this._colors[20 * i + e]; }, n.drawBlock = function(t) { var e = this._colorBlock.graphics; e.clear(); var i = t || "#ffffff"; e.drawRect(0, 0, 50, 20, i, this._borderColor), t || e.drawLine(0, 0, 50, 20, "#ff0000"); }, n.changeColor = function() { var t = this.graphics; t.clear(); var e = this._selectedColor || "#000000"; t.drawRect(0, 0, this._colorButton.width, this._colorButton.height, e); }, n._setPanelChanged = function() { this._panelChanged || (this._panelChanged = !0, this.callLater(this.changePanel)); }, a(0, n, "inputBgColor", function() { return this._inputBgColor; }, function(t) { this._inputBgColor = t, this._setPanelChanged(); }), a(0, n, "selectedColor", function() { return this._selectedColor; }, function(t) { this._selectedColor != t && (this._selectedColor = this._colorInput.text = t, this.drawBlock(t), this.changeColor(), this.changeHandler && this.changeHandler.runWith(this._selectedColor), this.event("change", c.EMPTY.setTo("change", this, this))); }), a(0, n, "skin", function() { return this._colorButton.skin; }, function(t) { this._colorButton.skin = t, this.changeColor(); }), a(0, n, "bgColor", function() { return this._bgColor; }, function(t) { this._bgColor = t, this._setPanelChanged(); }), a(0, n, "borderColor", function() { return this._borderColor; }, function(t) { this._borderColor = t, this._setPanelChanged(); }), a(0, n, "inputColor", function() { return this._inputColor; }, function(t) { this._inputColor = t, this._setPanelChanged(); }), e; }(N), W = function(t) { function e(t, i) { this._visibleNum = 6, this._button = null, this._list = null, this._isOpen = !1, this._itemSize = 12, this._labels = [], this._selectedIndex = -1, this._selectHandler = null, this._itemHeight = NaN, this._listHeight = NaN, this._listChanged = !1, this._itemChanged = !1, this._scrollBarSkin = null, this._isCustomList = !1, this.itemRender = null, e.__super.call(this), this._itemColors = P.comboBoxItemColors, this.skin = t, this.labels = i; } s(e, "laya.ui.ComboBox", t); var n = e.prototype; return n.destroy = function(e) { void 0 === e && (e = !0), t.prototype.destroy.call(this, e), this._button && this._button.destroy(e), this._list && this._list.destroy(e), this._button = null, this._list = null, this._itemColors = null, this._labels = null, this._selectHandler = null; }, n.createChildren = function() { this.addChild(this._button = new z()), this._button.text.align = "left", this._button.labelPadding = "0,0,0,5", this._button.on("mousedown", this, this.onButtonMouseDown); }, n._createList = function() { this._list = new Z(), this._scrollBarSkin && (this._list.vScrollBarSkin = this._scrollBarSkin), this._setListEvent(this._list); }, n._setListEvent = function(t) { this._list.selectEnable = !0, this._list.on("mousedown", this, this.onListDown), this._list.mouseHandler = f.create(this, this.onlistItemMouse, null, !1), this._list.scrollBar && this._list.scrollBar.on("mousedown", this, this.onScrollBarDown); }, n.onListDown = function(t) { t.stopPropagation(); }, n.onScrollBarDown = function(t) { t.stopPropagation(); }, n.onButtonMouseDown = function(t) { this.callLater(this.switchTo, [ !this._isOpen ]); }, n.changeList = function() { this._listChanged = !1; var t = this.width - 2, e = this._itemColors[2]; this._itemHeight = this._itemSize + 6, this._list.itemRender = this.itemRender || { type: "Box", child: [ { type: "Label", props: { name: "label", x: 1, padding: "3,3,3,3", width: t, height: this._itemHeight, fontSize: this._itemSize, color: e } } ] }, this._list.repeatY = this._visibleNum, this._list.refresh(); }, n.onlistItemMouse = function(t, e) { var i = t.type; if ("mouseover" === i || "mouseout" === i) { if (this._isCustomList) return; var n = this._list.getCell(e); if (!n) return; var s = n.getChildByName("label"); s && ("mouseover" === i ? (s.bgColor = this._itemColors[0], s.color = this._itemColors[1]) : (s.bgColor = null, s.color = this._itemColors[2])); } else "click" === i && (this.selectedIndex = e, this.isOpen = !1); }, n.switchTo = function(t) { this.isOpen = t; }, n.changeOpen = function() { this.isOpen = !this._isOpen; }, n.changeItem = function() { if (this._itemChanged = !1, this._listHeight = this._labels.length > 0 ? Math.min(this._visibleNum, this._labels.length) * this._itemHeight : this._itemHeight, !this._isCustomList) { var t = this._list.graphics; t.clear(), t.drawRect(0, 0, this.width - 1, this._listHeight, this._itemColors[4], this._itemColors[3]); } var e = this._list.array || []; e.length = 0; for (var i = 0, n = this._labels.length; i < n; i++) e.push({ label: this._labels[i] }); this._list.height = this._listHeight, this._list.array = e; }, n.changeSelected = function() { this._button.label = this.selectedLabel; }, n._onStageMouseWheel = function(t) { this._list && !this._list.contains(t.target) && this.removeList(null); }, n.removeList = function(t) { i.stage.off("mousedown", this, this.removeList), i.stage.off("mousewheel", this, this._onStageMouseWheel), this.isOpen = !1; }, a(0, n, "selectedIndex", function() { return this._selectedIndex; }, function(t) { this._selectedIndex != t && (this._selectedIndex = t, this._labels.length > 0 ? this.changeSelected() : this.callLater(this.changeSelected), this.event("change", [ c.EMPTY.setTo("change", this, this) ]), this._selectHandler && this._selectHandler.runWith(this._selectedIndex)); }), a(0, n, "measureHeight", function() { return this._button.height; }), a(0, n, "skin", function() { return this._button.skin; }, function(t) { this._button.skin != t && (this._button.skin = t, this._listChanged = !0); }), a(0, n, "measureWidth", function() { return this._button.width; }), a(0, n, "width", t.prototype._$get_width, function(t) { i.superSet(N, this, "width", t), this._button.width = this._width, this._itemChanged = !0, this._listChanged = !0; }), a(0, n, "selectedLabel", function() { return this._selectedIndex > -1 && this._selectedIndex < this._labels.length ? this._labels[this._selectedIndex] : null; }, function(t) { this.selectedIndex = this._labels.indexOf(t); }), a(0, n, "labels", function() { return this._labels.join(","); }, function(t) { this._labels.length > 0 && (this.selectedIndex = -1), t ? this._labels = t.split(",") : this._labels.length = 0, this._itemChanged = !0; }), a(0, n, "height", t.prototype._$get_height, function(t) { i.superSet(N, this, "height", t), this._button.height = this._height; }), a(0, n, "selectHandler", function() { return this._selectHandler; }, function(t) { this._selectHandler = t; }), a(0, n, "visibleNum", function() { return this._visibleNum; }, function(t) { this._visibleNum = t, this._listChanged = !0; }), a(0, n, "labelBold", function() { return this._button.text.bold; }, function(t) { this._button.text.bold = t; }), a(0, n, "itemColors", function() { return String(this._itemColors); }, function(t) { this._itemColors = k.fillArray(this._itemColors, t, String), this._listChanged = !0; }), a(0, n, "itemSize", function() { return this._itemSize; }, function(t) { this._itemSize = t, this._listChanged = !0; }), a(0, n, "scrollBar", function() { return this.list.scrollBar; }), a(0, n, "isOpen", function() { return this._isOpen; }, function(t) { if (this._isOpen != t) if (this._isOpen = t, this._button.selected = this._isOpen, this._isOpen) { this._list || this._createList(), this._listChanged && !this._isCustomList && this.changeList(), this._itemChanged && this.changeItem(); var e = this.localToGlobal(x.TEMP.setTo(0, 0)), n = e.y + this._button.height; n = n + this._listHeight <= i.stage.height ? n : e.y - this._listHeight, this._list.pos(e.x, n), this._list.zOrder = 1001, i._currentStage.addChild(this._list), i.stage.once("mousedown", this, this.removeList), i.stage.on("mousewheel", this, this._onStageMouseWheel), this._list.selectedIndex = this._selectedIndex; } else this._list && this._list.removeSelf(); }), a(0, n, "scrollBarSkin", function() { return this._scrollBarSkin; }, function(t) { this._scrollBarSkin = t; }), a(0, n, "sizeGrid", function() { return this._button.sizeGrid; }, function(t) { this._button.sizeGrid = t; }), a(0, n, "button", function() { return this._button; }), a(0, n, "list", function() { return this._list || this._createList(), this._list; }, function(t) { t && (t.removeSelf(), this._isCustomList = !0, this._list = t, this._setListEvent(t), this._itemHeight = t.getCell(0).height + t.spaceY); }), a(0, n, "dataSource", t.prototype._$get_dataSource, function(t) { this._dataSource = t, "number" == typeof t && Math.floor(t) == t || "string" == typeof t ? this.selectedIndex = parseInt(t) : t instanceof Array ? this.labels = t.join(",") : i.superSet(N, this, "dataSource", t); }), a(0, n, "labelColors", function() { return this._button.labelColors; }, function(t) { this._button.labelColors != t && (this._button.labelColors = t); }), a(0, n, "labelPadding", function() { return this._button.text.padding.join(","); }, function(t) { this._button.text.padding = k.fillArray(P.labelPadding, t, Number); }), a(0, n, "labelSize", function() { return this._button.text.fontSize; }, function(t) { this._button.text.fontSize = t; }), a(0, n, "labelFont", function() { return this._button.text.font; }, function(t) { this._button.text.font = t; }), a(0, n, "stateNum", function() { return this._button.stateNum; }, function(t) { this._button.stateNum = t; }), e; }(N), G = function(t) { function e(t) { this.rollRatio = .95, this.changeHandler = null, this.scaleBar = !0, this.autoHide = !1, this.elasticDistance = 0, this.elasticBackTime = 500, this.upButton = null, this.downButton = null, this.slider = null, this._scrollSize = 1, this._skin = null, this._thumbPercent = 1, this._target = null, this._lastPoint = null, this._lastOffset = 0, this._checkElastic = !1, this._isElastic = !1, this._value = NaN, this._hide = !1, this._clickOnly = !0, this._offsets = null, e.__super.call(this), this._showButtons = R.showButtons, this._touchScrollEnable = R.touchScrollEnable, this._mouseWheelEnable = R.mouseWheelEnable, this.skin = t, this.max = 1; } s(e, "laya.ui.ScrollBar", t); var n = e.prototype; return n.destroy = function(e) { void 0 === e && (e = !0), this.stopScroll(), this.target = null, t.prototype.destroy.call(this, e), this.upButton && this.upButton.destroy(e), this.downButton && this.downButton.destroy(e), this.slider && this.slider.destroy(e), this.upButton = this.downButton = null, this.slider = null, this.changeHandler = null, this._offsets = null; }, n.createChildren = function() { this.addChild(this.slider = new H()), this.addChild(this.upButton = new z()), this.addChild(this.downButton = new z()); }, n.initialize = function() { this.slider.showLabel = !1, this.slider.on("change", this, this.onSliderChange), this.slider.setSlider(0, 0, 0), this.upButton.on("mousedown", this, this.onButtonMouseDown), this.downButton.on("mousedown", this, this.onButtonMouseDown); }, n.onSliderChange = function() { this._value != this.slider.value && (this.value = this.slider.value); }, n.onButtonMouseDown = function(t) { var e = t.currentTarget === this.upButton; this.slide(e), i.timer.once(P.scrollBarDelayTime, this, this.startLoop, [ e ]), i.stage.once("mouseup", this, this.onStageMouseUp); }, n.startLoop = function(t) { i.timer.frameLoop(1, this, this.slide, [ t ]); }, n.slide = function(t) { t ? this.value -= this._scrollSize : this.value += this._scrollSize; }, n.onStageMouseUp = function(t) { i.timer.clear(this, this.startLoop), i.timer.clear(this, this.slide); }, n.changeScrollBar = function() { this.upButton.visible = this._showButtons, this.downButton.visible = this._showButtons, this._showButtons && (this.upButton.skin = this._skin.replace(".png", "$up.png"), this.downButton.skin = this._skin.replace(".png", "$down.png")), this.slider.isVertical ? this.slider.y = this._showButtons ? this.upButton.height : 0 : this.slider.x = this._showButtons ? this.upButton.width : 0, this.resetPositions(), this.repaint(); }, n.changeSize = function() { t.prototype.changeSize.call(this), this.repaint(), this.resetPositions(), this.event("change"), this.changeHandler && this.changeHandler.runWith(this.value); }, n.resetPositions = function() { this.slider.isVertical ? this.slider.height = this.height - (this._showButtons ? this.upButton.height + this.downButton.height : 0) : this.slider.width = this.width - (this._showButtons ? this.upButton.width + this.downButton.width : 0), this.resetButtonPosition(); }, n.resetButtonPosition = function() { this.slider.isVertical ? this.downButton.y = this.slider.y + this.slider.height : this.downButton.x = this.slider.x + this.slider.width; }, n.setScroll = function(t, e, i) { this.runCallLater(this.changeSize), this.slider.setSlider(t, e, i), this.slider.bar.visible = e > 0, !this._hide && this.autoHide && (this.visible = !1); }, n.onTargetMouseWheel = function(t) { this.value -= t.delta * this._scrollSize, this.target = this._target; }, n.onTargetMouseDown = function(t) { this._clickOnly = !0, this._lastOffset = 0, this._checkElastic = !1, this._lastPoint || (this._lastPoint = new x()), this._lastPoint.setTo(i.stage.mouseX, i.stage.mouseY), i.timer.clear(this, this.tweenMove), M.clearTween(this), i.stage.once("mouseup", this, this.onStageMouseUp2), i.stage.once("mouseout", this, this.onStageMouseUp2), i.timer.frameLoop(1, this, this.loop); }, n.loop = function() { var t = i.stage.mouseY, e = i.stage.mouseX; if (this._lastOffset = this.isVertical ? t - this._lastPoint.y : e - this._lastPoint.x, this._clickOnly) { if (!(Math.abs(this._lastOffset * (this.isVertical ? i.stage._canvasTransform.getScaleY() : i.stage._canvasTransform.getScaleX())) > 1)) return; this._clickOnly = !1, this._offsets || (this._offsets = []), this._offsets.length = 0, this._target.mouseEnabled = !1, !this.hide && this.autoHide && (this.alpha = 1, this.visible = !0), this.event("start"); } this._offsets.push(this._lastOffset), this._lastPoint.x = e, this._lastPoint.y = t, 0 !== this._lastOffset && (this._checkElastic || (this.elasticDistance > 0 ? this._checkElastic || 0 == this._lastOffset || (this._lastOffset > 0 && this._value <= this.min || this._lastOffset < 0 && this._value >= this.max ? (this._isElastic = !0, this._checkElastic = !0) : this._isElastic = !1) : this._checkElastic = !0), this._isElastic ? this._value <= this.min ? this.value -= this._lastOffset * Math.max(0, 1 - (this.min - this._value) / this.elasticDistance) : this._value >= this.max && (this.value -= this._lastOffset * Math.max(0, 1 - (this._value - this.max) / this.elasticDistance)) : this.value -= this._lastOffset); }, n.onStageMouseUp2 = function(t) { if (i.stage.off("mouseup", this, this.onStageMouseUp2), i.stage.off("mouseout", this, this.onStageMouseUp2), i.timer.clear(this, this.loop), !(this._clickOnly && this._value >= this.min && this._value <= this.max)) if (this._target.mouseEnabled = !0, this._isElastic) this._value < this.min ? M.to(this, { value: this.min }, this.elasticBackTime, u.sineOut, f.create(this, this.elasticOver)) : this._value > this.max && M.to(this, { value: this.max }, this.elasticBackTime, u.sineOut, f.create(this, this.elasticOver)); else { if (!this._offsets) return; this._offsets.length < 1 && (this._offsets[0] = this.isVertical ? i.stage.mouseY - this._lastPoint.y : i.stage.mouseX - this._lastPoint.x); for (var e = 0, n = Math.min(this._offsets.length, 3), s = 0; s < n; s++) e += this._offsets[this._offsets.length - 1 - s]; if (this._lastOffset = e / n, (e = Math.abs(this._lastOffset)) < 2) return void this.event("end"); e > 60 && (this._lastOffset = this._lastOffset > 0 ? 60 : -60); var a = Math.round(Math.abs(this.elasticDistance * (this._lastOffset / 240))); i.timer.frameLoop(1, this, this.tweenMove, [ a ]); } }, n.elasticOver = function() { this._isElastic = !1, !this.hide && this.autoHide && M.to(this, { alpha: 0 }, 500), this.event("end"); }, n.tweenMove = function(t) { this._lastOffset *= this.rollRatio; var e = NaN; if (t > 0 && (this._lastOffset > 0 && this.value <= this.min ? (this._isElastic = !0, e = .5 * -(this.min - t - this.value), this._lastOffset > e && (this._lastOffset = e)) : this._lastOffset < 0 && this.value >= this.max && (this._isElastic = !0, e = .5 * -(this.max + t - this.value), this._lastOffset < e && (this._lastOffset = e))), this.value -= this._lastOffset, Math.abs(this._lastOffset) < 1) { if (i.timer.clear(this, this.tweenMove), this._isElastic) return void (this._value < this.min ? M.to(this, { value: this.min }, this.elasticBackTime, u.sineOut, f.create(this, this.elasticOver)) : this._value > this.max ? M.to(this, { value: this.max }, this.elasticBackTime, u.sineOut, f.create(this, this.elasticOver)) : this.elasticOver()); this.event("end"), !this.hide && this.autoHide && M.to(this, { alpha: 0 }, 500); } }, n.stopScroll = function() { this.onStageMouseUp2(null), i.timer.clear(this, this.tweenMove), M.clearTween(this); }, a(0, n, "measureHeight", function() { return this.slider.isVertical ? 100 : this.slider.height; }), a(0, n, "skin", function() { return this._skin; }, function(t) { this._skin != t && (this._skin = t, this.slider.skin = this._skin, this.callLater(this.changeScrollBar)); }), a(0, n, "max", function() { return this.slider.max; }, function(t) { this.slider.max = t; }), a(0, n, "showButtons", function() { return this._showButtons; }, function(t) { this._showButtons = t, this.callLater(this.changeScrollBar); }), a(0, n, "measureWidth", function() { return this.slider.isVertical ? this.slider.width : 100; }), a(0, n, "min", function() { return this.slider.min; }, function(t) { this.slider.min = t; }), a(0, n, "value", function() { return this._value; }, function(t) { t !== this._value && (this._value = t, this._isElastic || (this.slider._value != t && (this.slider._value = t, this.slider.changeValue()), this._value = this.slider._value), this.event("change"), this.changeHandler && this.changeHandler.runWith(this._value)); }), a(0, n, "isVertical", function() { return this.slider.isVertical; }, function(t) { this.slider.isVertical = t; }), a(0, n, "sizeGrid", function() { return this.slider.sizeGrid; }, function(t) { this.slider.sizeGrid = t; }), a(0, n, "scrollSize", function() { return this._scrollSize; }, function(t) { this._scrollSize = t; }), a(0, n, "dataSource", t.prototype._$get_dataSource, function(t) { this._dataSource = t, "number" == typeof t || "string" == typeof t ? this.value = Number(t) : i.superSet(N, this, "dataSource", t); }), a(0, n, "thumbPercent", function() { return this._thumbPercent; }, function(t) { this.runCallLater(this.changeScrollBar), this.runCallLater(this.changeSize), t = t >= 1 ? .99 : t, this._thumbPercent = t, this.scaleBar && (this.slider.isVertical ? this.slider.bar.height = Math.max(this.slider.height * t, P.scrollBarMinNum) : this.slider.bar.width = Math.max(this.slider.width * t, P.scrollBarMinNum)); }), a(0, n, "target", function() { return this._target; }, function(t) { this._target && (this._target.off("mousewheel", this, this.onTargetMouseWheel), this._target.off("mousedown", this, this.onTargetMouseDown)), this._target = t, t && (this._mouseWheelEnable && this._target.on("mousewheel", this, this.onTargetMouseWheel), this._touchScrollEnable && this._target.on("mousedown", this, this.onTargetMouseDown)); }), a(0, n, "hide", function() { return this._hide; }, function(t) { this._hide = t, this.visible = !t; }), a(0, n, "touchScrollEnable", function() { return this._touchScrollEnable; }, function(t) { this._touchScrollEnable = t, this.target = this._target; }), a(0, n, "mouseWheelEnable", function() { return this._mouseWheelEnable; }, function(t) { this._mouseWheelEnable = t, this.target = this._target; }), a(0, n, "tick", function() { return this.slider.tick; }, function(t) { this.slider.tick = t; }), e; }(N), H = function(t) { function e(t) { this.changeHandler = null, this.isVertical = !0, this.showLabel = !0, this._allowClickBack = !1, this._max = 100, this._min = 0, this._tick = 1, this._value = 0, this._skin = null, this._bg = null, this._progress = null, this._bar = null, this._tx = NaN, this._ty = NaN, this._maxMove = NaN, this._globalSacle = null, e.__super.call(this), this.skin = t; } s(e, "laya.ui.Slider", t); var r = e.prototype; return r.destroy = function(e) { void 0 === e && (e = !0), t.prototype.destroy.call(this, e), this._bg && this._bg.destroy(e), this._bar && this._bar.destroy(e), this._progress && this._progress.destroy(e), this._bg = null, this._bar = null, this._progress = null, this.changeHandler = null; }, r.createChildren = function() { this.addChild(this._bg = new B()), this.addChild(this._bar = new z()); }, r.initialize = function() { this._bar.on("mousedown", this, this.onBarMouseDown), this._bg.sizeGrid = this._bar.sizeGrid = "4,4,4,4,0", this._progress && (this._progress.sizeGrid = this._bar.sizeGrid), this.allowClickBack = !0; }, r.onBarMouseDown = function(t) { this._globalSacle || (this._globalSacle = new x()), this._globalSacle.setTo(this.globalScaleX || .01, this.globalScaleY || .01), this._maxMove = this.isVertical ? this.height - this._bar.height : this.width - this._bar.width, this._tx = i.stage.mouseX, this._ty = i.stage.mouseY, i.stage.on("mousemove", this, this.mouseMove), i.stage.once("mouseup", this, this.mouseUp), i.stage.once("mouseout", this, this.mouseUp), this.showValueText(); }, r.showValueText = function() { if (this.showLabel) { var t = laya.ui.Slider.label; this.addChild(t), t.textField.changeText(this._value + ""), this.isVertical ? (t.x = this._bar.x + 20, t.y = .5 * (this._bar.height - t.height) + this._bar.y) : (t.y = this._bar.y - 20, t.x = .5 * (this._bar.width - t.width) + this._bar.x); } }, r.hideValueText = function() { laya.ui.Slider.label && laya.ui.Slider.label.removeSelf(); }, r.mouseUp = function(t) { i.stage.off("mousemove", this, this.mouseMove), i.stage.off("mouseup", this, this.mouseUp), i.stage.off("mouseout", this, this.mouseUp), this.sendChangeEvent("changed"), this.hideValueText(); }, r.mouseMove = function(t) { var e = this._value; this.isVertical ? (this._bar.y += (i.stage.mouseY - this._ty) / this._globalSacle.y, this._bar.y > this._maxMove ? this._bar.y = this._maxMove : this._bar.y < 0 && (this._bar.y = 0), this._value = this._bar.y / this._maxMove * (this._max - this._min) + this._min, this._progress && (this._progress.height = this._bar.y + .5 * this._bar.height)) : (this._bar.x += (i.stage.mouseX - this._tx) / this._globalSacle.x, this._bar.x > this._maxMove ? this._bar.x = this._maxMove : this._bar.x < 0 && (this._bar.x = 0), this._value = this._bar.x / this._maxMove * (this._max - this._min) + this._min, this._progress && (this._progress.width = this._bar.x + .5 * this._bar.width)), this._tx = i.stage.mouseX, this._ty = i.stage.mouseY; var n = Math.pow(10, (this._tick + "").length - 1); this._value = Math.round(Math.round(this._value / this._tick) * this._tick * n) / n, this._value != e && this.sendChangeEvent(), this.showValueText(); }, r.sendChangeEvent = function(t) { void 0 === t && (t = "change"), this.event(t), this.changeHandler && this.changeHandler.runWith(this._value); }, r.setBarPoint = function() { this.isVertical ? this._bar.x = Math.round(.5 * (this._bg.width - this._bar.width)) : this._bar.y = Math.round(.5 * (this._bg.height - this._bar.height)); }, r.changeSize = function() { t.prototype.changeSize.call(this), this.isVertical ? this._bg.height = this.height : this._bg.width = this.width, this.setBarPoint(), this.changeValue(); }, r.setSlider = function(t, e, i) { this._value = -1, this._min = t, this._max = e > t ? e : t, this.value = i < t ? t : i > e ? e : i; }, r.changeValue = function() { var t = Math.pow(10, (this._tick + "").length - 1); this._value = Math.round(Math.round(this._value / this._tick) * this._tick * t) / t, this._value = this._value > this._max ? this._max : this._value < this._min ? this._min : this._value; var e = this._max - this._min; 0 === e && (e = 1), this.isVertical ? (this._bar.y = (this._value - this._min) / e * (this.height - this._bar.height), this._progress && (this._progress.height = this._bar.y + .5 * this._bar.height)) : (this._bar.x = (this._value - this._min) / e * (this.width - this._bar.width), this._progress && (this._progress.width = this._bar.x + .5 * this._bar.width)); }, r.onBgMouseDown = function(t) { var e = this._bg.getMousePoint(); this.isVertical ? this.value = e.y / (this.height - this._bar.height) * (this._max - this._min) + this._min : this.value = e.x / (this.width - this._bar.width) * (this._max - this._min) + this._min; }, a(0, r, "measureHeight", function() { return Math.max(this._bg.height, this._bar.height); }), a(0, r, "skin", function() { return this._skin; }, function(t) { if (this._skin != t) { this._skin = t, this._bg.skin = this._skin, this._bar.skin = this._skin.replace(".png", "$bar.png"); var e = this._skin.replace(".png", "$progress.png"); v.getRes(e) && (this._progress || (this.addChild(this._progress = new B()), this._progress.sizeGrid = this._bar.sizeGrid, this.setChildIndex(this._progress, 1)), this._progress.skin = e), this.setBarPoint(), this.callLater(this.changeValue); } }), a(0, r, "allowClickBack", function() { return this._allowClickBack; }, function(t) { this._allowClickBack != t && (this._allowClickBack = t, t ? this._bg.on("mousedown", this, this.onBgMouseDown) : this._bg.off("mousedown", this, this.onBgMouseDown)); }), a(0, r, "max", function() { return this._max; }, function(t) { this._max != t && (this._max = t, this.callLater(this.changeValue)); }), a(0, r, "measureWidth", function() { return Math.max(this._bg.width, this._bar.width); }), a(0, r, "tick", function() { return this._tick; }, function(t) { this._tick != t && (this._tick = t, this.callLater(this.changeValue)); }), a(0, r, "sizeGrid", function() { return this._bg.sizeGrid; }, function(t) { this._bg.sizeGrid = t, this._bar.sizeGrid = t, this._progress && (this._progress.sizeGrid = this._bar.sizeGrid); }), a(0, r, "min", function() { return this._min; }, function(t) { this._min != t && (this._min = t, this.callLater(this.changeValue)); }), a(0, r, "value", function() { return this._value; }, function(t) { if (this._value != t) { var e = this._value; this._value = t, this.changeValue(), this._value != e && this.sendChangeEvent(); } }), a(0, r, "dataSource", t.prototype._$get_dataSource, function(t) { this._dataSource = t, "number" == typeof t || "string" == typeof t ? this.value = Number(t) : i.superSet(N, this, "dataSource", t); }), a(0, r, "bar", function() { return this._bar; }), n(e, [ "label", function() { return this.label = new Y(); } ]), e; }(N), Y = function(t) { function e(t) { this._tf = null, e.__super.call(this), void 0 === t && (t = ""), _.defaultColor = P.labelColor, this.text = t; } s(e, "laya.ui.Label", t); var n = e.prototype; return n.destroy = function(e) { void 0 === e && (e = !0), t.prototype.destroy.call(this, e), this._tf = null; }, n.createChildren = function() { this.addChild(this._tf = new S()); }, n.changeText = function(t) { this._tf.changeText(t); }, a(0, n, "padding", function() { return this._tf.padding.join(","); }, function(t) { this._tf.padding = k.fillArray(P.labelPadding, t, Number); }), a(0, n, "bold", function() { return this._tf.bold; }, function(t) { this._tf.bold = t; }), a(0, n, "align", function() { return this._tf.align; }, function(t) { this._tf.align = t; }), a(0, n, "text", function() { return this._tf.text; }, function(t) { this._tf.text != t && (t && (t = k.adptString(t + "")), this._tf.text = t, this.event("change"), this._width && this._height || this.onCompResize()); }), a(0, n, "italic", function() { return this._tf.italic; }, function(t) { this._tf.italic = t; }), a(0, n, "wordWrap", function() { return this._tf.wordWrap; }, function(t) { this._tf.wordWrap = t; }), a(0, n, "font", function() { return this._tf.font; }, function(t) { this._tf.font = t; }), a(0, n, "dataSource", t.prototype._$get_dataSource, function(t) { this._dataSource = t, "number" == typeof t || "string" == typeof t ? this.text = t + "" : i.superSet(N, this, "dataSource", t); }), a(0, n, "color", function() { return this._tf.color; }, function(t) { this._tf.color = t; }), a(0, n, "valign", function() { return this._tf.valign; }, function(t) { this._tf.valign = t; }), a(0, n, "leading", function() { return this._tf.leading; }, function(t) { this._tf.leading = t; }), a(0, n, "fontSize", function() { return this._tf.fontSize; }, function(t) { this._tf.fontSize = t; }), a(0, n, "bgColor", function() { return this._tf.bgColor; }, function(t) { this._tf.bgColor = t; }), a(0, n, "borderColor", function() { return this._tf.borderColor; }, function(t) { this._tf.borderColor = t; }), a(0, n, "stroke", function() { return this._tf.stroke; }, function(t) { this._tf.stroke = t; }), a(0, n, "strokeColor", function() { return this._tf.strokeColor; }, function(t) { this._tf.strokeColor = t; }), a(0, n, "textField", function() { return this._tf; }), a(0, n, "measureWidth", function() { return this._tf.width; }), a(0, n, "measureHeight", function() { return this._tf.height; }), a(0, n, "width", function() { return this._width || this._tf.text ? i.superGet(N, this, "width") : 0; }, function(t) { i.superSet(N, this, "width", t), this._tf.width = t; }), a(0, n, "height", function() { return this._height || this._tf.text ? i.superGet(N, this, "height") : 0; }, function(t) { i.superSet(N, this, "height", t), this._tf.height = t; }), a(0, n, "overflow", function() { return this._tf.overflow; }, function(t) { this._tf.overflow = t; }), a(0, n, "underline", function() { return this._tf.underline; }, function(t) { this._tf.underline = t; }), a(0, n, "underlineColor", function() { return this._tf.underlineColor; }, function(t) { this._tf.underlineColor = t; }), e; }(N), X = function(t) { function e(t) { this.changeHandler = null, this._bg = null, this._bar = null, this._skin = null, this._value = .5, e.__super.call(this), this.skin = t; } s(e, "laya.ui.ProgressBar", t); var n = e.prototype; return n.destroy = function(e) { void 0 === e && (e = !0), t.prototype.destroy.call(this, e), this._bg && this._bg.destroy(e), this._bar && this._bar.destroy(e), this._bg = this._bar = null, this.changeHandler = null; }, n.createChildren = function() { this.addChild(this._bg = new B()), this.addChild(this._bar = new B()), this._bar._bitmap.autoCacheCmd = !1; }, n.changeValue = function() { if (this.sizeGrid) { var t = this.sizeGrid.split(","), e = Number(t[3]), i = Number(t[1]), n = (this.width - e - i) * this._value; this._bar.width = e + i + n, this._bar.visible = this._bar.width > e + i; } else this._bar.width = this.width * this._value; }, a(0, n, "measureHeight", function() { return this._bg.height; }), a(0, n, "skin", function() { return this._skin; }, function(t) { this._skin != t && (this._skin = t, this._bg.skin = this._skin, this._bar.skin = this._skin.replace(".png", "$bar.png"), this.callLater(this.changeValue)); }), a(0, n, "measureWidth", function() { return this._bg.width; }), a(0, n, "height", t.prototype._$get_height, function(t) { i.superSet(N, this, "height", t), this._bg.height = this._height, this._bar.height = this._height; }), a(0, n, "bar", function() { return this._bar; }), a(0, n, "value", function() { return this._value; }, function(t) { this._value != t && (t = t > 1 ? 1 : t < 0 ? 0 : t, this._value = t, this.callLater(this.changeValue), this.event("change"), this.changeHandler && this.changeHandler.runWith(t)); }), a(0, n, "bg", function() { return this._bg; }), a(0, n, "sizeGrid", function() { return this._bg.sizeGrid; }, function(t) { this._bg.sizeGrid = this._bar.sizeGrid = t; }), a(0, n, "width", t.prototype._$get_width, function(t) { i.superSet(N, this, "width", t), this._bg.width = this._width, this.callLater(this.changeValue); }), a(0, n, "dataSource", t.prototype._$get_dataSource, function(t) { this._dataSource = t, "number" == typeof t || "string" == typeof t ? this.value = Number(t) : i.superSet(N, this, "dataSource", t); }), e; }(N), j = (function(t) { function e() { this._tipBox = null, this._tipText = null, this._defaultTipHandler = null, e.__super.call(this), this._tipBox = new N(), this._tipBox.addChild(this._tipText = new S()), this._tipText.x = this._tipText.y = 5, this._tipText.color = e.tipTextColor, this._defaultTipHandler = this._showDefaultTip, i.stage.on("showtip", this, this._onStageShowTip), i.stage.on("hidetip", this, this._onStageHideTip), this.zOrder = 1100; } s(e, "laya.ui.TipManager", N); var n = e.prototype; n._onStageHideTip = function(t) { i.timer.clear(this, this._showTip), this.closeAll(), this.removeSelf(); }, n._onStageShowTip = function(t) { i.timer.once(e.tipDelay, this, this._showTip, [ t ], !0); }, n._showTip = function(t) { if ("string" == typeof t) { var e = String(t); Boolean(e) && this._defaultTipHandler(e); } else t instanceof laya.utils.Handler ? t.run() : "function" == typeof t && t.apply(); i.stage.on("mousemove", this, this._onStageMouseMove), i.stage.on("mousedown", this, this._onStageMouseDown), this._onStageMouseMove(null); }, n._onStageMouseDown = function(t) { this.closeAll(); }, n._onStageMouseMove = function(t) { this._showToStage(this, e.offsetX, e.offsetY); }, n._showToStage = function(t, e, n) { void 0 === e && (e = 0), void 0 === n && (n = 0); var s = t.getBounds(); t.x = i.stage.mouseX + e, t.y = i.stage.mouseY + n, t.x + s.width > i.stage.width && (t.x -= s.width + e), t.y + s.height > i.stage.height && (t.y -= s.height + n); }, n.closeAll = function() { i.timer.clear(this, this._showTip), i.stage.off("mousemove", this, this._onStageMouseMove), i.stage.off("mousedown", this, this._onStageMouseDown), this.removeChildren(); }, n.showDislayTip = function(t) { this.addChild(t), this._showToStage(this), i._currentStage.addChild(this); }, n._showDefaultTip = function(t) { this._tipText.text = t; var n = this._tipBox.graphics; n.clear(), n.drawRect(0, 0, this._tipText.width + 10, this._tipText.height + 10, e.tipBackColor), this.addChild(this._tipBox), this._showToStage(this), i._currentStage.addChild(this); }, a(0, n, "defaultTipHandler", function() { return this._defaultTipHandler; }, function(t) { this._defaultTipHandler = t; }), e.offsetX = 10, e.offsetY = 15, e.tipTextColor = "#ffffff", e.tipBackColor = "#111111", e.tipDelay = 200; }(), function(t) { function e(t) { this.advsListArr = [], this.resUrl = "https://unioncdn.layabox.com/config/iconlist.json", this._data = [], this._resquestTime = 36e4, this._appid = null, this._appCodeImgStr = null, this._playIndex = 0, this._lunboTime = 5e3, e.__super.call(this), this._http = new o.window.XMLHttpRequest(), this.skin = t, this.init(), this.size(120, 120); } s(e, "laya.ui.AdvImage", t); var n = e.prototype; n.init = function() { o.onMiniGame && this.isSupportJump ? (i.timer.loop(this._resquestTime, this, this.onGetAdvsListData), this.onGetAdvsListData(), this.initEvent()) : this.visible = !1; }, n.initEvent = function() { this.on("click", this, this.onAdvsImgClick); }, n.onAdvsImgClick = function() { this.getCurrentAppidObj() && this.jumptoGame(); }, n.revertAdvsData = function() { this.advsListArr[this._playIndex] && (this.visible = !0, this.skin = this.advsListArr[this._playIndex]); }, n.jumptoGame = function() { var t = this; o.onMiniGame && this.isSupportJump && wx.navigateToMiniProgram({ appId: this._appid, path: "", extraData: "", envVersion: "release", success: function() { console.log("-------------跳转成功--------------"); }, fail: function() { console.log("-------------跳转失败--------------"); }, complete: function() { console.log("-------------跳转接口调用成功--------------"), t.updateAdvsInfo(); }.bind(this) }); }, n.updateAdvsInfo = function() { this.visible = !1, this.onLunbo(), i.timer.loop(this._lunboTime, this, this.onLunbo); }, n.onLunbo = function() { this._playIndex >= this.advsListArr.length - 1 ? this._playIndex = 0 : this._playIndex += 1, this.visible = !0, this.revertAdvsData(); }, n.getCurrentAppidObj = function() { return this.advsListArr[this._playIndex]; }, n.onGetAdvsListData = function() { var t = this, e = this.randRange(1e4, 1e6), i = this.resUrl + "?" + e; this._http.open("get", i, !0), this._http.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"), this._http.responseType = "text", this._http.onerror = function(e) { t._onError(e); }, this._http.onload = function(e) { t._onLoad(e); }, this._http.send(null); }, n.randRange = function(t, e) { return Math.floor(Math.random() * (e - t + 1)) + t; }, n._onError = function(t) { this.error("Request failed Status:" + this._http.status + " text:" + this._http.statusText); }, n._onLoad = function(t) { var e = this._http, i = void 0 !== e.status ? e.status : 200; 200 === i || 204 === i || 0 === i ? this.complete() : this.error("[" + e.status + "]" + e.statusText + ":" + e.responseURL); }, n.error = function(t) { this.event("error", t); }, n.complete = function() { try { this._data = this._http.response || this._http.responseText, this._data = JSON.parse(this._data), this.advsListArr = this._data.list, this._appid = this._data.appid, this._appCodeImgStr = this._data.qrcode, this.updateAdvsInfo(), this.revertAdvsData(); } catch (t) { !1, this.error(t.message); } }, n.clear = function() { var t = this._http; t.onerror = t.onabort = t.onprogress = t.onload = null; }, n.destroy = function(e) { void 0 === e && (e = !0), t.prototype.destroy.call(this, !0), i.timer.clear(this, this.onLunbo), i.timer.clear(this, this.onGetAdvsListData), this.clear(); }, a(0, n, "isSupportJump", function() { if (o.onMiniGame) { return "function" == typeof wx.navigateToMiniProgram; } return !1; }); }(B), function(t) { function e() { this._idMap = null, this._aniList = null, this._watchMap = {}, e.__super.call(this); } var a; s(e, "laya.ui.View", O); var o = e.prototype; return o.createView = function(t) { if (t.animations && !this._idMap && (this._idMap = {}), e.createComp(t, this, this), t.animations) { var i, n, s = [], a = t.animations, r = 0, o = a.length; for (r = 0; r < o; r++) { switch (i = new d(), n = a[r], i._setUp(this._idMap, n), this[n.name] = i, i._setControlNode(this), n.action) { case 1: i.play(0, !1); break; case 2: i.play(0, !0); } s.push(i); } this._aniList = s; } this._width > 0 && null == t.props.hitTestPrior && !this.mouseThrough && (this.hitTestPrior = !0); }, o.onEvent = function(t, e) {}, o.loadUI = function(t) { var i = e.uiMap[t]; i && this.createView(i); }, o.destroy = function(t) { void 0 === t && (t = !0), this._aniList && (this._aniList.length = 0), this._idMap = null, this._aniList = null, this._watchMap = null, laya.ui.Component.prototype.destroy.call(this, t); }, o.changeData = function(t) { var e = this._watchMap[t]; if (e) { console.log("change", t); for (var i = 0, n = e.length; i < n; i++) { e[i].exe(this); } } }, e._regs = function() { for (var t in e.uiClassMap) h.regClass(t, e.uiClassMap[t]); }, e.createComp = function(t, n, s, a) { if (!(n = n || e.getCompInstance(t))) return console.warn("can not create:" + t.type), null; var r = t.child; if (r) for (var o = n instanceof laya.ui.List, l = 0, u = r.length; l < u; l++) { var c = r[l]; if (!n.hasOwnProperty("itemRender") || "render" != c.props.name && "render" !== c.props.renderType) if ("Graphic" == c.type) h.addGraphicsToSprite(c, n); else if (h.isDrawType(c.type)) h.addGraphicToSprite(c, n, !0); else { if (o) { var _ = [], d = e.createComp(c, null, s, _); _.length && (d._$bindData = _); } else d = e.createComp(c, null, s, a); "Script" == c.type ? "owner" in d ? d.owner = n : "target" in d && (d.target = n) : "mask" == c.props.renderType || "mask" == c.props.name ? n.mask = d : d instanceof laya.display.Sprite && n.addChild(d); } else n.itemRender = c; } var p = t.props; for (var f in p) { var g = p[f]; e.eventDic[f] ? g && s && n.on(f, s, s.onEvent, [ g ]) : e.setCompValue(n, f, g, s, a); } return i.__typeof(n, "laya.ui.IItem") && n.initItems(), t.compId && s && s._idMap && (s._idMap[t.compId] = n), n; }, e.setCompValue = function(t, n, s, r, o) { if ("string" == typeof s && s.indexOf("${") > -1) { if (e._sheet || (e._sheet = h.getClass("laya.data.Table")), !e._sheet) return void console.warn("Can not find class Sheet"); if (o) o.push(t, n, s); else if (r) { -1 == s.indexOf("].") && (s = s.replace(".", "[0].")); var l = new a(t, n, s); l.exe(r); for (var u, c, _ = s.replace(/\[.*?\]\./g, "."); null != (u = e._parseWatchData.exec(_)); ) { for (var d = u[1]; null != (c = e._parseKeyWord.exec(d)); ) { var p = c[0], f = r._watchMap[p] || (r._watchMap[p] = []); f.push(l), e._sheet.I.notifer.on(p, r, r.changeData, [ p ]); } (f = r._watchMap[d] || (r._watchMap[d] = [])).push(l), e._sheet.I.notifer.on(d, r, r.changeData, [ d ]); } } } else if ("var" === n && r) r[s] = t; else if ("onClick" == n) { var g = i._runScript("(function(){" + s + "})"); t.on("click", r, g); } else t[n] = "true" === s || "false" !== s && s; }, e.getCompInstance = function(t) { var n, s = t.props ? t.props.runtime : null; return n = s ? e.viewClassMap[s] || e.uiClassMap[s] || i.__classmap[s] : e.uiClassMap[t.type], t.props && t.props.hasOwnProperty("renderType") && "instance" == t.props.renderType ? n.instance : n ? new n() : null; }, e.regComponent = function(t, i) { e.uiClassMap[t] = i, h.regClass(t, i); }, e.regViewRuntime = function(t, i) { e.viewClassMap[t] = i; }, e.uiMap = {}, e.viewClassMap = {}, e._sheet = null, n(e, [ "uiClassMap", function() { return this.uiClassMap = { ViewStack: st, LinkButton: z, TextArea: pt, ColorPicker: V, Box: O, Button: z, CheckBox: K, Clip: U, ComboBox: W, Component: N, HScrollBar: J, HSlider: tt, Image: B, Label: Y, List: Z, Panel: Q, ProgressBar: X, Radio: et, RadioGroup: _t, ScrollBar: G, Slider: H, Tab: dt, TextInput: rt, View: e, VScrollBar: at, VSlider: ot, Tree: nt, HBox: lt, VBox: ct, Sprite: C, Animation: r, Text: S, FontClip: q }; }, "eventDic", function() { return this.eventDic = { mousedown: !0, mouseup: !0, mousemove: !0, mouseover: !0, mouseout: !0, click: !0, doubleclick: !0, rightmousedown: !0, rightmouseup: !0, rightclick: !0 }; }, "_parseWatchData", function() { return this._parseWatchData = /\${(.*?)}/g; }, "_parseKeyWord", function() { return this._parseKeyWord = /[a-zA-Z_][a-zA-Z0-9_]*(?:(?:\.[a-zA-Z_][a-zA-Z0-9_]*)+)/g; } ]), e.__init$ = function() { e._regs(), a = function() { function t(t, e, i) { this.comp = null, this.prop = null, this.value = null, this.comp = t, this.prop = e, this.value = i; } s(t, ""); return t.prototype.exe = function(t) { var e = k.getBindFun(this.value); this.comp[this.prop] = e.call(this, t); }, t; }(); }, e; }()), K = function(t) { function e(t, i) { void 0 === i && (i = ""), e.__super.call(this, t, i); } s(e, "laya.ui.CheckBox", t); var n = e.prototype; return n.preinitialize = function() { laya.ui.Component.prototype.preinitialize.call(this), this.toggle = !0, this._autoSize = !1; }, n.initialize = function() { t.prototype.initialize.call(this), this.createText(), this._text.align = "left", this._text.valign = "top", this._text.width = 0; }, a(0, n, "dataSource", t.prototype._$get_dataSource, function(t) { this._dataSource = t, "boolean" == typeof t ? this.selected = t : "string" == typeof t ? this.selected = "true" === t : i.superSet(z, this, "dataSource", t); }), e; }(z), $ = function(t) { function e() { this._space = 0, this._align = "none", this._itemChanged = !1, e.__super.call(this); } s(e, "laya.ui.LayoutBox", O); var i = e.prototype; return i.addChild = function(t) { return t.on("resize", this, this.onResize), this._setItemChanged(), laya.display.Node.prototype.addChild.call(this, t); }, i.onResize = function(t) { this._setItemChanged(); }, i.addChildAt = function(t, e) { return t.on("resize", this, this.onResize), this._setItemChanged(), laya.display.Node.prototype.addChildAt.call(this, t, e); }, i.removeChildAt = function(t) { return this.getChildAt(t).off("resize", this, this.onResize), this._setItemChanged(), laya.display.Node.prototype.removeChildAt.call(this, t); }, i.refresh = function() { this._setItemChanged(); }, i.changeItems = function() { this._itemChanged = !1; }, i.sortItem = function(t) { t && t.sort(function(t, e) { return t.y - e.y; }); }, i._setItemChanged = function() { this._itemChanged || (this._itemChanged = !0, this.callLater(this.changeItems)); }, a(0, i, "space", function() { return this._space; }, function(t) { this._space = t, this._setItemChanged(); }), a(0, i, "align", function() { return this._align; }, function(t) { this._align = t, this._setItemChanged(); }), e; }(), q = function(t) { function e(t, i) { this._valueArr = null, this._indexMap = null, this._sheet = null, this._direction = "horizontal", this._spaceX = 0, this._spaceY = 0, this._align = "left", this._wordsW = 0, this._wordsH = 0, e.__super.call(this), t && (this.skin = t), i && (this.sheet = i); } s(e, "laya.ui.FontClip", t); var n = e.prototype; return n.createChildren = function() { this._bitmap = new D(), this.on("loaded", this, this._onClipLoaded); }, n._onClipLoaded = function() { this.callLater(this.changeValue); }, n.changeValue = function() { if (this._sources && this._valueArr) { this.graphics.clear(!0); var t; if (t = this._sources[0]) { var e = "horizontal" === this._direction; e ? (this._wordsW = this._valueArr.length * (t.sourceWidth + this.spaceX), this._wordsH = t.sourceHeight) : (this._wordsW = t.sourceWidth, this._wordsH = (t.sourceHeight + this.spaceY) * this._valueArr.length); var i = 0; if (this._width) switch (this._align) { case "center": i = .5 * (this._width - this._wordsW); break; case "right": i = this._width - this._wordsW; break; default: i = 0; } for (var n = 0, s = this._valueArr.length; n < s; n++) { var a = this._indexMap[this._valueArr.charAt(n)]; this.sources[a] && (t = this.sources[a], e ? this.graphics.drawTexture(t, i + n * (t.sourceWidth + this.spaceX), 0, t.sourceWidth, t.sourceHeight) : this.graphics.drawTexture(t, 0 + i, n * (t.sourceHeight + this.spaceY), t.sourceWidth, t.sourceHeight)); } this._width || (this.resetLayoutX(), this.callLater(this.changeSize)), this._height || (this.resetLayoutY(), this.callLater(this.changeSize)); } } }, n.destroy = function(e) { void 0 === e && (e = !0), this._valueArr = null, this._indexMap = null, this.graphics.clear(!0), this.removeSelf(), this.off("loaded", this, this._onClipLoaded), t.prototype.destroy.call(this, e); }, a(0, n, "sheet", function() { return this._sheet; }, function(t) { t += "", this._sheet = t; var e = t.split(" "); this._clipX = String(e[0]).length, this.clipY = e.length, this._indexMap = {}; for (var i = 0; i < this._clipY; i++) for (var n = e[i].split(""), s = 0, a = n.length; s < a; s++) this._indexMap[n[s]] = i * this._clipX + s; }), a(0, n, "height", t.prototype._$get_height, function(t) { i.superSet(U, this, "height", t), this.callLater(this.changeValue); }), a(0, n, "direction", function() { return this._direction; }, function(t) { this._direction = t, this.callLater(this.changeValue); }), a(0, n, "value", function() { return this._valueArr ? this._valueArr : ""; }, function(t) { t += "", this._valueArr = t, this.callLater(this.changeValue); }), a(0, n, "width", t.prototype._$get_width, function(t) { i.superSet(U, this, "width", t), this.callLater(this.changeValue); }), a(0, n, "spaceX", function() { return this._spaceX; }, function(t) { this._spaceX = t, "horizontal" === this._direction && this.callLater(this.changeValue); }), a(0, n, "spaceY", function() { return this._spaceY; }, function(t) { this._spaceY = t, "horizontal" !== this._direction && this.callLater(this.changeValue); }), a(0, n, "align", function() { return this._align; }, function(t) { this._align = t, this.callLater(this.changeValue); }), a(0, n, "measureWidth", function() { return this._wordsW; }), a(0, n, "measureHeight", function() { return this._wordsH; }), e; }(U), Z = function(t) { function e() { this.selectHandler = null, this.renderHandler = null, this.mouseHandler = null, this.selectEnable = !1, this.totalPage = 0, this._content = null, this._scrollBar = null, this._itemRender = null, this._repeatX = 0, this._repeatY = 0, this._repeatX2 = 0, this._repeatY2 = 0, this._spaceX = 0, this._spaceY = 0, this._array = null, this._startIndex = 0, this._selectedIndex = -1, this._page = 0, this._isVertical = !0, this._cellSize = 20, this._cellOffset = 0, this._isMoved = !1, this.cacheContent = !1, this._createdLine = 0, this._cellChanged = !1, this._cells = [], this._offset = new x(), e.__super.call(this); } s(e, "laya.ui.List", t); var n = e.prototype; return i.imps(n, { "laya.ui.IRender": !0, "laya.ui.IItem": !0 }), n.destroy = function(t) { void 0 === t && (t = !0), this._content && this._content.destroy(t), this._scrollBar && this._scrollBar.destroy(t), laya.ui.Component.prototype.destroy.call(this, t), this._content = null, this._scrollBar = null, this._itemRender = null, this._cells = null, this._array = null, this.selectHandler = this.renderHandler = this.mouseHandler = null; }, n.createChildren = function() { this.addChild(this._content = new O()); }, n.onScrollStart = function() { this._$P.cacheAs || (this._$P.cacheAs = i.superGet(O, this, "cacheAs")), i.superSet(O, this, "cacheAs", "none"), this._scrollBar.once("end", this, this.onScrollEnd); }, n.onScrollEnd = function() { i.superSet(O, this, "cacheAs", this._$P.cacheAs); }, n._removePreScrollBar = function() { var t = this.removeChildByName("scrollBar"); t && t.destroy(!0); }, n.changeCells = function() { if (this._cellChanged = !1, this._itemRender) { this.scrollBar = this.getChildByName("scrollBar"); var t = this._getOneCell(), e = t.width + this._spaceX || 1, i = t.height + this._spaceY || 1; this._width > 0 && (this._repeatX2 = this._isVertical ? Math.round(this._width / e) : Math.ceil(this._width / e)), this._height > 0 && (this._repeatY2 = this._isVertical ? Math.ceil(this._height / i) : Math.round(this._height / i)); var n = this._width ? this._width : e * this.repeatX - this._spaceX, s = this._height ? this._height : i * this.repeatY - this._spaceY; this._cellSize = this._isVertical ? i : e, this._cellOffset = this._isVertical ? i * Math.max(this._repeatY2, this._repeatY) - s - this._spaceY : e * Math.max(this._repeatX2, this._repeatX) - n - this._spaceX, this._isVertical && this._scrollBar ? this._scrollBar.height = s : !this._isVertical && this._scrollBar && (this._scrollBar.width = n), this.setContentSize(n, s); var a = this._isVertical ? this.repeatX : this.repeatY, r = (this._isVertical ? this.repeatY : this.repeatX) + (this._scrollBar ? 1 : 0); this._createItems(0, a, r), this._createdLine = r, this._array && (this.array = this._array, this.runCallLater(this.renderItems)); } }, n._getOneCell = function() { if (0 === this._cells.length) { var t = this.createItem(); if (this._offset.setTo(t.x, t.y), this.cacheContent) return t; this._cells.push(t); } return this._cells[0]; }, n._createItems = function(t, e, i) { var n = this._content, s = this._getOneCell(), a = s.width + this._spaceX, r = s.height + this._spaceY; if (this.cacheContent) { var o = new O(); o.cacheAsBitmap = !0, o.pos((this._isVertical ? 0 : t) * a, (this._isVertical ? t : 0) * r), this._content.addChild(o), this._content.optimizeScrollRect = !0, n = o; } else { for (var h = [], l = this._cells.length - 1; l > -1; l--) { var u = this._cells[l]; u.removeSelf(), h.push(u); } this._cells.length = 0; } for (var c = t; c < i; c++) for (var _ = 0; _ < e; _++) (s = h && h.length ? h.pop() : this.createItem()).x = (this._isVertical ? _ : c) * a - n.x, s.y = (this._isVertical ? c : _) * r - n.y, s.name = "item" + (c * e + _), n.addChild(s), this.addCell(s); }, n.createItem = function() { var t = []; if ("function" == typeof this._itemRender) var e = new this._itemRender(); else e = j.createComp(this._itemRender, null, null, t); if (0 == t.length && e._watchMap) { var i = e._watchMap; for (var n in i) for (var s = i[n], a = 0; a < s.length; a++) { var r = s[a]; t.push(r.comp, r.prop, r.value); } } return t.length && (e._$bindData = t), e; }, n.addCell = function(t) { t.on("click", this, this.onCellMouse), t.on("rightclick", this, this.onCellMouse), t.on("mouseover", this, this.onCellMouse), t.on("mouseout", this, this.onCellMouse), t.on("mousedown", this, this.onCellMouse), t.on("mouseup", this, this.onCellMouse), this._cells.push(t); }, n.initItems = function() { if (!this._itemRender && null != this.getChildByName("item0")) { this.repeatX = 1; var t = 0; t = 0; for (var e = 0; e < 1e4; e++) { var i = this.getChildByName("item" + e); { if (!i) break; this.addCell(i), t++; } } this.repeatY = t; } }, n.setContentSize = function(t, e) { this._content.width = t, this._content.height = e, (this._scrollBar || 0 != this._offset.x || 0 != this._offset.y) && (this._content.scrollRect || (this._content.scrollRect = new b()), this._content.scrollRect.setTo(-this._offset.x, -this._offset.y, t, e), this._content.scrollRect = this._content.scrollRect), this.event("resize"); }, n.onCellMouse = function(t) { "mousedown" === t.type && (this._isMoved = !1); var e = t.currentTarget, i = this._startIndex + this._cells.indexOf(e); i < 0 || ("click" === t.type || "rightclick" === t.type ? this.selectEnable && !this._isMoved ? this.selectedIndex = i : this.changeCellState(e, !0, 0) : "mouseover" !== t.type && "mouseout" !== t.type || this._selectedIndex === i || this.changeCellState(e, "mouseover" === t.type, 0), this.mouseHandler && this.mouseHandler.runWith([ t, i ])); }, n.changeCellState = function(t, e, i) { var n = t.getChildByName("selectBox"); n && (this.selectEnable = !0, n.visible = e, n.index = i); }, n.changeSize = function() { laya.ui.Component.prototype.changeSize.call(this), this.setContentSize(this.width, this.height), this._scrollBar && this.callLater(this.onScrollBarChange); }, n.onScrollBarChange = function(t) { this.runCallLater(this.changeCells); var e = this._scrollBar.value, i = this._isVertical ? this.repeatX : this.repeatY, n = this._isVertical ? this.repeatY : this.repeatX, s = Math.floor(e / this._cellSize); if (this.cacheContent) r = n + 1, this._createdLine - s < r && (this._createItems(this._createdLine, i, this._createdLine + r), this.renderItems(this._createdLine * i, 0), this._createdLine += r); else { var a = s * i, r = 0; if (a > this._startIndex) { r = a - this._startIndex; var o = !0, h = this._startIndex + i * (n + 1); this._isMoved = !0; } else a < this._startIndex && (r = this._startIndex - a, o = !1, h = this._startIndex - 1, this._isMoved = !0); for (var l = 0; l < r; l++) { if (o) { var u = this._cells.shift(); this._cells[this._cells.length] = u; var c = h + l; } else u = this._cells.pop(), this._cells.unshift(u), c = h - l; var _ = Math.floor(c / i) * this._cellSize; this._isVertical ? u.y = _ : u.x = _, this.renderItem(u, c); } this._startIndex = a, this.changeSelectStatus(); } var d = this._content.scrollRect; this._isVertical ? (d.y = e - this._offset.y, d.x = -this._offset.x) : (d.y = -this._offset.y, d.x = e - this._offset.x), this._content.scrollRect = d; }, n.posCell = function(t, e) { if (this._scrollBar) { var i = this._isVertical ? this.repeatX : this.repeatY, n = (this._isVertical ? this.repeatY : this.repeatX, Math.floor(e / i) * this._cellSize); this._isVertical ? t.y = n : t.x = n; } }, n.changeSelectStatus = function() { for (var t = 0, e = this._cells.length; t < e; t++) this.changeCellState(this._cells[t], this._selectedIndex === this._startIndex + t, 1); }, n.renderItems = function(t, e) { void 0 === t && (t = 0), void 0 === e && (e = 0); for (var i = t, n = e || this._cells.length; i < n; i++) this.renderItem(this._cells[i], this._startIndex + i); this.changeSelectStatus(); }, n.renderItem = function(t, e) { this._array && e >= 0 && e < this._array.length ? (t.visible = !0, t._$bindData ? (t._dataSource = this._array[e], this._bindData(t, this._array[e])) : t.dataSource = this._array[e], this.cacheContent || this.posCell(t, e), this.hasListener("render") && this.event("render", [ t, e ]), this.renderHandler && this.renderHandler.runWith([ t, e ])) : (t.visible = !1, t.dataSource = null); }, n._bindData = function(t, e) { for (var i = t._$bindData, n = 0, s = i.length; n < s; n++) { var a = i[n++], r = i[n++], o = i[n], h = k.getBindFun(o); a[r] = h.call(this, e); } }, n.refresh = function() { this.array = this._array; }, n.getItem = function(t) { return t > -1 && t < this._array.length ? this._array[t] : null; }, n.changeItem = function(t, e) { t > -1 && t < this._array.length && (this._array[t] = e, t >= this._startIndex && t < this._startIndex + this._cells.length && this.renderItem(this.getCell(t), t)); }, n.setItem = function(t, e) { this.changeItem(t, e); }, n.addItem = function(t) { this._array.push(t), this.array = this._array; }, n.addItemAt = function(t, e) { this._array.splice(e, 0, t), this.array = this._array; }, n.deleteItem = function(t) { this._array.splice(t, 1), this.array = this._array; }, n.getCell = function(t) { return this.runCallLater(this.changeCells), t > -1 && this._cells ? this._cells[(t - this._startIndex) % this._cells.length] : null; }, n.scrollTo = function(t) { if (this._scrollBar) { var e = this._isVertical ? this.repeatX : this.repeatY; this._scrollBar.value = Math.floor(t / e) * this._cellSize; } else this.startIndex = t; }, n.tweenTo = function(t, e, i) { if (void 0 === e && (e = 200), this._scrollBar) { var n = this._isVertical ? this.repeatX : this.repeatY; M.to(this._scrollBar, { value: Math.floor(t / n) * this._cellSize }, e, null, i, 0, !0); } else this.startIndex = t, i && i.run(); }, n._setCellChanged = function() { this._cellChanged || (this._cellChanged = !0, this.callLater(this.changeCells)); }, n.commitMeasure = function() { this.runCallLater(this.changeCells); }, a(0, n, "cacheAs", t.prototype._$get_cacheAs, function(t) { i.superSet(O, this, "cacheAs", t), this._scrollBar && (this._$P.cacheAs = null, "none" !== t ? this._scrollBar.on("start", this, this.onScrollStart) : this._scrollBar.off("start", this, this.onScrollStart)); }), a(0, n, "content", function() { return this._content; }), a(0, n, "height", t.prototype._$get_height, function(t) { t != this._height && (i.superSet(O, this, "height", t), this._setCellChanged()); }), a(0, n, "itemRender", function() { return this._itemRender; }, function(t) { if (this._itemRender != t) { this._itemRender = t; for (var e = this._cells.length - 1; e > -1; e--) this._cells[e].destroy(); this._cells.length = 0, this._setCellChanged(); } }), a(0, n, "vScrollBarSkin", function() { return this._scrollBar ? this._scrollBar.skin : null; }, function(t) { this._removePreScrollBar(); var e = new at(); e.name = "scrollBar", e.right = 0, t && " " != t && (e.skin = t), this.scrollBar = e, this.addChild(e), this._setCellChanged(); }), a(0, n, "page", function() { return this._page; }, function(t) { this._page = t, this._array && (this._page = t > 0 ? t : 0, this._page = this._page < this.totalPage ? this._page : this.totalPage - 1, this.startIndex = this._page * this.repeatX * this.repeatY); }), a(0, n, "hScrollBarSkin", function() { return this._scrollBar ? this._scrollBar.skin : null; }, function(t) { this._removePreScrollBar(); var e = new J(); e.name = "scrollBar", e.bottom = 0, t && " " != t && (e.skin = t), this.scrollBar = e, this.addChild(e), this._setCellChanged(); }), a(0, n, "repeatX", function() { return this._repeatX > 0 ? this._repeatX : this._repeatX2 > 0 ? this._repeatX2 : 1; }, function(t) { this._repeatX = t, this._setCellChanged(); }), a(0, n, "scrollBar", function() { return this._scrollBar; }, function(t) { this._scrollBar != t && (this._scrollBar = t, t && (this._isVertical = this._scrollBar.isVertical, this.addChild(this._scrollBar), this._scrollBar.on("change", this, this.onScrollBarChange))); }), a(0, n, "width", t.prototype._$get_width, function(t) { t != this._width && (i.superSet(O, this, "width", t), this._setCellChanged()); }), a(0, n, "repeatY", function() { return this._repeatY > 0 ? this._repeatY : this._repeatY2 > 0 ? this._repeatY2 : 1; }, function(t) { this._repeatY = t, this._setCellChanged(); }), a(0, n, "spaceX", function() { return this._spaceX; }, function(t) { this._spaceX = t, this._setCellChanged(); }), a(0, n, "spaceY", function() { return this._spaceY; }, function(t) { this._spaceY = t, this._setCellChanged(); }), a(0, n, "selectedIndex", function() { return this._selectedIndex; }, function(t) { this._selectedIndex != t && (this._selectedIndex = t, this.changeSelectStatus(), this.event("change"), this.selectHandler && this.selectHandler.runWith(t), this.startIndex = this._startIndex); }), a(0, n, "selectedItem", function() { return -1 != this._selectedIndex ? this._array[this._selectedIndex] : null; }, function(t) { this.selectedIndex = this._array.indexOf(t); }), a(0, n, "length", function() { return this._array ? this._array.length : 0; }), a(0, n, "selection", function() { return this.getCell(this._selectedIndex); }, function(t) { this.selectedIndex = this._startIndex + this._cells.indexOf(t); }), a(0, n, "startIndex", function() { return this._startIndex; }, function(t) { this._startIndex = t > 0 ? t : 0, this.callLater(this.renderItems); }), a(0, n, "array", function() { return this._array; }, function(t) { this.runCallLater(this.changeCells), this._array = t || []; var e = this._array.length; if (this.totalPage = Math.ceil(e / (this.repeatX * this.repeatY)), this._selectedIndex = this._selectedIndex < e ? this._selectedIndex : e - 1, this.startIndex = this._startIndex, this._scrollBar) { this._scrollBar.stopScroll(); var i = this._isVertical ? this.repeatX : this.repeatY, n = this._isVertical ? this.repeatY : this.repeatX, s = Math.ceil(e / i); (this._cellOffset > 0 ? this.totalPage + 1 : this.totalPage) > 1 ? (this._scrollBar.scrollSize = this._cellSize, this._scrollBar.thumbPercent = n / s, this._scrollBar.setScroll(0, (s - n) * this._cellSize + this._cellOffset, this._scrollBar.value), this._scrollBar.target = this._content) : (this._scrollBar.setScroll(0, 0, 0), this._scrollBar.target = this._content); } }), a(0, n, "dataSource", t.prototype._$get_dataSource, function(t) { this._dataSource = t, "number" == typeof t && Math.floor(t) == t || "string" == typeof t ? this.selectedIndex = parseInt(t) : t instanceof Array ? this.array = t : i.superSet(O, this, "dataSource", t); }), a(0, n, "cells", function() { return this.runCallLater(this.changeCells), this._cells; }), e; }(O), J = function(t) { function e() { e.__super.call(this); } s(e, "laya.ui.HScrollBar", t); return e.prototype.initialize = function() { t.prototype.initialize.call(this), this.slider.isVertical = !1; }, e; }(G), Q = function(t) { function e() { this._content = null, this._vScrollBar = null, this._hScrollBar = null, this._scrollChanged = !1, e.__super.call(this), this.width = this.height = 100; } s(e, "laya.ui.Panel", t); var n = e.prototype; return n.destroy = function(t) { void 0 === t && (t = !0), laya.ui.Component.prototype.destroy.call(this, t), this._content && this._content.destroy(t), this._vScrollBar && this._vScrollBar.destroy(t), this._hScrollBar && this._hScrollBar.destroy(t), this._vScrollBar = null, this._hScrollBar = null, this._content = null; }, n.destroyChildren = function() { this._content.destroyChildren(); }, n.createChildren = function() { laya.display.Node.prototype.addChild.call(this, this._content = new O()); }, n.addChild = function(t) { return t.on("resize", this, this.onResize), this._setScrollChanged(), this._content.addChild(t); }, n.onResize = function() { this._setScrollChanged(); }, n.addChildAt = function(t, e) { return t.on("resize", this, this.onResize), this._setScrollChanged(), this._content.addChildAt(t, e); }, n.removeChild = function(t) { return t.off("resize", this, this.onResize), this._setScrollChanged(), this._content.removeChild(t); }, n.removeChildAt = function(t) { return this.getChildAt(t).off("resize", this, this.onResize), this._setScrollChanged(), this._content.removeChildAt(t); }, n.removeChildren = function(t, e) { return void 0 === t && (t = 0), void 0 === e && (e = 2147483647), this._content.removeChildren(t, e), this._setScrollChanged(), this; }, n.getChildAt = function(t) { return this._content.getChildAt(t); }, n.getChildByName = function(t) { return this._content.getChildByName(t); }, n.getChildIndex = function(t) { return this._content.getChildIndex(t); }, n.changeScroll = function() { this._scrollChanged = !1; var t = this.contentWidth || 1, e = this.contentHeight || 1, i = this._vScrollBar, n = this._hScrollBar, s = i && e > this._height, a = n && t > this._width, r = s ? this._width - i.width : this._width, o = a ? this._height - n.height : this._height; i && (i.x = this._width - i.width, i.y = 0, i.height = this._height - (a ? n.height : 0), i.scrollSize = Math.max(.033 * this._height, 1), i.thumbPercent = o / e, i.setScroll(0, e - o, i.value)), n && (n.x = 0, n.y = this._height - n.height, n.width = this._width - (s ? i.width : 0), n.scrollSize = Math.max(.033 * this._width, 1), n.thumbPercent = r / t, n.setScroll(0, t - r, n.value)); }, n.changeSize = function() { laya.ui.Component.prototype.changeSize.call(this), this.setContentSize(this._width, this._height); }, n.setContentSize = function(t, e) { var i = this._content; i.width = t, i.height = e, i.scrollRect || (i.scrollRect = new b()), i.scrollRect.setTo(0, 0, t, e), i.scrollRect = i.scrollRect; }, n.onScrollBarChange = function(t) { var e = this._content.scrollRect; if (e) { var i = Math.round(t.value); t.isVertical ? e.y = i : e.x = i, this._content.scrollRect = e; } }, n.scrollTo = function(t, e) { void 0 === t && (t = 0), void 0 === e && (e = 0), this.vScrollBar && (this.vScrollBar.value = e), this.hScrollBar && (this.hScrollBar.value = t); }, n.refresh = function() { this.changeScroll(); }, n.onScrollStart = function() { this._$P.cacheAs || (this._$P.cacheAs = i.superGet(O, this, "cacheAs")), i.superSet(O, this, "cacheAs", "none"), this._hScrollBar && this._hScrollBar.once("end", this, this.onScrollEnd), this._vScrollBar && this._vScrollBar.once("end", this, this.onScrollEnd); }, n.onScrollEnd = function() { i.superSet(O, this, "cacheAs", this._$P.cacheAs); }, n._setScrollChanged = function() { this._scrollChanged || (this._scrollChanged = !0, this.callLater(this.changeScroll)); }, a(0, n, "numChildren", function() { return this._content.numChildren; }), a(0, n, "hScrollBarSkin", function() { return this._hScrollBar ? this._hScrollBar.skin : null; }, function(t) { null == this._hScrollBar && (laya.display.Node.prototype.addChild.call(this, this._hScrollBar = new J()), this._hScrollBar.on("change", this, this.onScrollBarChange, [ this._hScrollBar ]), this._hScrollBar.target = this._content, this._setScrollChanged()), this._hScrollBar.skin = t; }), a(0, n, "contentWidth", function() { for (var t = 0, e = this._content.numChildren - 1; e > -1; e--) { var i = this._content.getChildAt(e); t = Math.max(i.x + i.width * i.scaleX, t); } return t; }), a(0, n, "contentHeight", function() { for (var t = 0, e = this._content.numChildren - 1; e > -1; e--) { var i = this._content.getChildAt(e); t = Math.max(i.y + i.height * i.scaleY, t); } return t; }), a(0, n, "width", t.prototype._$get_width, function(t) { i.superSet(O, this, "width", t), this._setScrollChanged(); }), a(0, n, "hScrollBar", function() { return this._hScrollBar; }), a(0, n, "content", function() { return this._content; }), a(0, n, "height", t.prototype._$get_height, function(t) { i.superSet(O, this, "height", t), this._setScrollChanged(); }), a(0, n, "vScrollBarSkin", function() { return this._vScrollBar ? this._vScrollBar.skin : null; }, function(t) { null == this._vScrollBar && (laya.display.Node.prototype.addChild.call(this, this._vScrollBar = new at()), this._vScrollBar.on("change", this, this.onScrollBarChange, [ this._vScrollBar ]), this._vScrollBar.target = this._content, this._setScrollChanged()), this._vScrollBar.skin = t; }), a(0, n, "vScrollBar", function() { return this._vScrollBar; }), a(0, n, "cacheAs", t.prototype._$get_cacheAs, function(t) { i.superSet(O, this, "cacheAs", t), this._$P.cacheAs = null, "none" !== t ? (this._hScrollBar && this._hScrollBar.on("start", this, this.onScrollStart), this._vScrollBar && this._vScrollBar.on("start", this, this.onScrollStart)) : (this._hScrollBar && this._hScrollBar.off("start", this, this.onScrollStart), this._vScrollBar && this._vScrollBar.off("start", this, this.onScrollStart)); }), e; }(O), tt = function(t) { function e(t) { e.__super.call(this, t), this.isVertical = !1; } return s(e, "laya.ui.HSlider", H), e; }(), et = function(t) { function e(t, i) { this._value = null, void 0 === i && (i = ""), e.__super.call(this, t, i); } s(e, "laya.ui.Radio", t); var i = e.prototype; return i.destroy = function(e) { void 0 === e && (e = !0), t.prototype.destroy.call(this, e), this._value = null; }, i.preinitialize = function() { laya.ui.Component.prototype.preinitialize.call(this), this.toggle = !1, this._autoSize = !1; }, i.initialize = function() { t.prototype.initialize.call(this), this.createText(), this._text.align = "left", this._text.valign = "top", this._text.width = 0, this.on("click", this, this.onClick); }, i.onClick = function(t) { this.selected = !0; }, a(0, i, "value", function() { return null != this._value ? this._value : this.label; }, function(t) { this._value = t; }), e; }(z), it = function(t) { function e(t, i) { this.selectHandler = null, this._items = null, this._selectedIndex = -1, this._skin = null, this._direction = "horizontal", this._space = 0, this._labels = null, this._labelColors = null, this._labelFont = null, this._labelStrokeColor = null, this._strokeColors = null, this._labelStroke = NaN, this._labelSize = 0, this._labelBold = !1, this._labelPadding = null, this._labelAlign = null, this._stateNum = 0, this._labelChanged = !1, e.__super.call(this), this.skin = i, this.labels = t; } s(e, "laya.ui.UIGroup", t); var n = e.prototype; return i.imps(n, { "laya.ui.IItem": !0 }), n.preinitialize = function() { this.mouseEnabled = !0; }, n.destroy = function(t) { void 0 === t && (t = !0), laya.ui.Component.prototype.destroy.call(this, t), this._items && (this._items.length = 0), this._items = null, this.selectHandler = null; }, n.addItem = function(t, e) { void 0 === e && (e = !0); var i = t, n = this._items.length; if (i.name = "item" + n, this.addChild(i), this.initItems(), e && n > 0) { var s = this._items[n - 1]; "horizontal" == this._direction ? i.x = s.x + s.width + this._space : i.y = s.y + s.height + this._space; } else e && (i.x = 0, i.y = 0); return n; }, n.delItem = function(t, e) { void 0 === e && (e = !0); var i = this._items.indexOf(t); if (-1 != i) { var n = t; this.removeChild(n); for (var s = i + 1, a = this._items.length; s < a; s++) { var r = this._items[s]; r.name = "item" + (s - 1), e && ("horizontal" == this._direction ? r.x -= n.width + this._space : r.y -= n.height + this._space); } if (this.initItems(), this._selectedIndex > -1) { var o = 0; o = this._selectedIndex < this._items.length ? this._selectedIndex : this._selectedIndex - 1, this._selectedIndex = -1, this.selectedIndex = o; } } }, n.initItems = function() { this._items || (this._items = []), this._items.length = 0; for (var t = 0; t < 1e4; t++) { var e = this.getChildByName("item" + t); if (null == e) break; this._items.push(e), e.selected = t === this._selectedIndex, e.clickHandler = f.create(this, this.itemClick, [ t ], !1); } }, n.itemClick = function(t) { this.selectedIndex = t; }, n.setSelect = function(t, e) { this._items && t > -1 && t < this._items.length && (this._items[t].selected = e); }, n.createItem = function(t, e) { return null; }, n.changeLabels = function() { if (this._labelChanged = !1, this._items) for (var t = 0, e = 0, i = this._items.length; e < i; e++) { var n = this._items[e]; this._skin && (n.skin = this._skin), this._labelColors && (n.labelColors = this._labelColors), this._labelSize && (n.labelSize = this._labelSize), this._labelStroke && (n.labelStroke = this._labelStroke), this._labelStrokeColor && (n.labelStrokeColor = this._labelStrokeColor), this._strokeColors && (n.strokeColors = this._strokeColors), this._labelBold && (n.labelBold = this._labelBold), this._labelPadding && (n.labelPadding = this._labelPadding), this._labelAlign && (n.labelAlign = this._labelAlign), this._stateNum && (n.stateNum = this._stateNum), this._labelFont && (n.labelFont = this._labelFont), "horizontal" === this._direction ? (n.y = 0, n.x = t, t += n.width + this._space) : (n.x = 0, n.y = t, t += n.height + this._space); } this.changeSize(); }, n.commitMeasure = function() { this.runCallLater(this.changeLabels); }, n._setLabelChanged = function() { this._labelChanged || (this._labelChanged = !0, this.callLater(this.changeLabels)); }, a(0, n, "labelStrokeColor", function() { return this._labelStrokeColor; }, function(t) { this._labelStrokeColor != t && (this._labelStrokeColor = t, this._setLabelChanged()); }), a(0, n, "skin", function() { return this._skin; }, function(t) { this._skin != t && (this._skin = t, this._setLabelChanged()); }), a(0, n, "selectedIndex", function() { return this._selectedIndex; }, function(t) { this._selectedIndex != t && (this.setSelect(this._selectedIndex, !1), this._selectedIndex = t, this.setSelect(t, !0), this.event("change"), this.selectHandler && this.selectHandler.runWith(this._selectedIndex)); }), a(0, n, "labels", function() { return this._labels; }, function(t) { if (this._labels != t) { if (this._labels = t, this.removeChildren(), this._setLabelChanged(), this._labels) for (var e = this._labels.split(","), i = 0, n = e.length; i < n; i++) { var s = this.createItem(this._skin, e[i]); s.name = "item" + i, this.addChild(s); } this.initItems(); } }), a(0, n, "strokeColors", function() { return this._strokeColors; }, function(t) { this._strokeColors != t && (this._strokeColors = t, this._setLabelChanged()); }), a(0, n, "labelColors", function() { return this._labelColors; }, function(t) { this._labelColors != t && (this._labelColors = t, this._setLabelChanged()); }), a(0, n, "labelStroke", function() { return this._labelStroke; }, function(t) { this._labelStroke != t && (this._labelStroke = t, this._setLabelChanged()); }), a(0, n, "labelSize", function() { return this._labelSize; }, function(t) { this._labelSize != t && (this._labelSize = t, this._setLabelChanged()); }), a(0, n, "stateNum", function() { return this._stateNum; }, function(t) { this._stateNum != t && (this._stateNum = t, this._setLabelChanged()); }), a(0, n, "labelBold", function() { return this._labelBold; }, function(t) { this._labelBold != t && (this._labelBold = t, this._setLabelChanged()); }), a(0, n, "labelFont", function() { return this._labelFont; }, function(t) { this._labelFont != t && (this._labelFont = t, this._setLabelChanged()); }), a(0, n, "labelPadding", function() { return this._labelPadding; }, function(t) { this._labelPadding != t && (this._labelPadding = t, this._setLabelChanged()); }), a(0, n, "direction", function() { return this._direction; }, function(t) { this._direction = t, this._setLabelChanged(); }), a(0, n, "space", function() { return this._space; }, function(t) { this._space = t, this._setLabelChanged(); }), a(0, n, "items", function() { return this._items; }), a(0, n, "selection", function() { return this._selectedIndex > -1 && this._selectedIndex < this._items.length ? this._items[this._selectedIndex] : null; }, function(t) { this.selectedIndex = this._items.indexOf(t); }), a(0, n, "dataSource", t.prototype._$get_dataSource, function(t) { this._dataSource = t, "number" == typeof t && Math.floor(t) == t || "string" == typeof t ? this.selectedIndex = parseInt(t) : t instanceof Array ? this.labels = t.join(",") : i.superSet(O, this, "dataSource", t); }), e; }(O), nt = function(t) { function e() { this._list = null, this._source = null, this._renderHandler = null, this._spaceLeft = 10, this._spaceBottom = 0, this._keepStatus = !0, e.__super.call(this), this.width = this.height = 200; } s(e, "laya.ui.Tree", t); var n = e.prototype; return i.imps(n, { "laya.ui.IRender": !0 }), n.destroy = function(t) { void 0 === t && (t = !0), laya.ui.Component.prototype.destroy.call(this, t), this._list && this._list.destroy(t), this._list = null, this._source = null, this._renderHandler = null; }, n.createChildren = function() { this.addChild(this._list = new Z()), this._list.renderHandler = f.create(this, this.renderItem, null, !1), this._list.repeatX = 1, this._list.on("change", this, this.onListChange); }, n.onListChange = function(t) { this.event("change"); }, n.getArray = function() { var t, e = []; for (var i in this._source) t = this._source[i], this.getParentOpenStatus(t) && (t.x = this._spaceLeft * this.getDepth(t), e.push(t)); return e; }, n.getDepth = function(t, e) { return void 0 === e && (e = 0), null == t.nodeParent ? e : this.getDepth(t.nodeParent, e + 1); }, n.getParentOpenStatus = function(t) { var e = t.nodeParent; return null == e || !!e.isOpen && (null == e.nodeParent || this.getParentOpenStatus(e)); }, n.renderItem = function(t, e) { var i = t.dataSource; if (i) { t.left = i.x; var n = t.getChildByName("arrow"); n && (i.hasChild ? (n.visible = !0, n.index = i.isOpen ? 1 : 0, n.tag = e, n.off("click", this, this.onArrowClick), n.on("click", this, this.onArrowClick)) : n.visible = !1); var s = t.getChildByName("folder"); s && (2 == s.clipY ? s.index = i.isDirectory ? 0 : 1 : s.index = i.isDirectory ? i.isOpen ? 1 : 0 : 2), this._renderHandler && this._renderHandler.runWith([ t, e ]); } }, n.onArrowClick = function(t) { var e = t.currentTarget.tag; this._list.array[e].isOpen = !this._list.array[e].isOpen, this.event("open"), this._list.array = this.getArray(); }, n.setItemState = function(t, e) { this._list.array[t] && (this._list.array[t].isOpen = e, this._list.array = this.getArray()); }, n.fresh = function() { this._list.array = this.getArray(), this.repaint(); }, n.parseXml = function(t, e, i, n) { var s, a = t.childNodes, r = a.length; if (!n) { s = {}; var o, h = t.attributes; for (var l in h) { var u = (o = h[l]).nodeName, c = o.nodeValue; s[u] = "true" == c || "false" != c && c; } s.nodeParent = i, r > 0 && (s.isDirectory = !0), s.hasChild = r > 0, e.push(s); } for (var _ = 0; _ < r; _++) { var d = a[_]; this.parseXml(d, e, s, !1); } }, n.parseOpenStatus = function(t, e) { for (var i = 0, n = e.length; i < n; i++) { var s = e[i]; if (s.isDirectory) for (var a = 0, r = t.length; a < r; a++) { var o = t[a]; if (o.isDirectory && this.isSameParent(o, s) && s.label == o.label) { s.isOpen = o.isOpen; break; } } } }, n.isSameParent = function(t, e) { return null == t.nodeParent && null == e.nodeParent || null != t.nodeParent && null != e.nodeParent && (t.nodeParent.label == e.nodeParent.label && this.isSameParent(t.nodeParent, e.nodeParent)); }, n.filter = function(t) { if (Boolean(t)) { var e = []; this.getFilterSource(this._source, e, t), this._list.array = e; } else this._list.array = this.getArray(); }, n.getFilterSource = function(t, e, i) { i = i.toLocaleLowerCase(); var n; for (var s in t) !(n = t[s]).isDirectory && String(n.label).toLowerCase().indexOf(i) > -1 && (n.x = 0, e.push(n)), n.child && n.child.length > 0 && this.getFilterSource(n.child, e, i); }, a(0, n, "spaceBottom", function() { return this._list.spaceY; }, function(t) { this._list.spaceY = t; }), a(0, n, "keepStatus", function() { return this._keepStatus; }, function(t) { this._keepStatus = t; }), a(0, n, "itemRender", function() { return this._list.itemRender; }, function(t) { this._list.itemRender = t; }), a(0, n, "array", function() { return this._list.array; }, function(t) { this._keepStatus && this._list.array && t && this.parseOpenStatus(this._list.array, t), this._source = t, this._list.array = this.getArray(); }), a(0, n, "mouseHandler", function() { return this._list.mouseHandler; }, function(t) { this._list.mouseHandler = t; }), a(0, n, "dataSource", t.prototype._$get_dataSource, function(t) { this._dataSource = t, i.superSet(O, this, "dataSource", t); }), a(0, n, "source", function() { return this._source; }), a(0, n, "scrollBar", function() { return this._list.scrollBar; }), a(0, n, "list", function() { return this._list; }), a(0, n, "scrollBarSkin", function() { return this._list.vScrollBarSkin; }, function(t) { this._list.vScrollBarSkin = t; }), a(0, n, "renderHandler", function() { return this._renderHandler; }, function(t) { this._renderHandler = t; }), a(0, n, "selectedIndex", function() { return this._list.selectedIndex; }, function(t) { this._list.selectedIndex = t; }), a(0, n, "spaceLeft", function() { return this._spaceLeft; }, function(t) { this._spaceLeft = t; }), a(0, n, "selectedItem", function() { return this._list.selectedItem; }, function(t) { this._list.selectedItem = t; }), a(0, n, "width", t.prototype._$get_width, function(t) { i.superSet(O, this, "width", t), this._list.width = t; }), a(0, n, "height", t.prototype._$get_height, function(t) { i.superSet(O, this, "height", t), this._list.height = t; }), a(0, n, "xml", null, function(t) { var e = []; this.parseXml(t.childNodes[0], e, null, !0), this.array = e; }), a(0, n, "selectedPath", function() { return this._list.selectedItem ? this._list.selectedItem.path : null; }), e; }(O), st = function(t) { function e() { this._items = null, this._selectedIndex = 0, e.__super.call(this), this._setIndexHandler = f.create(this, this.setIndex, null, !1); } s(e, "laya.ui.ViewStack", t); var n = e.prototype; return i.imps(n, { "laya.ui.IItem": !0 }), n.setItems = function(t) { this.removeChildren(); for (var e = 0, i = 0, n = t.length; i < n; i++) { var s = t[i]; s && (s.name = "item" + e, this.addChild(s), e++); } this.initItems(); }, n.addItem = function(t) { t.name = "item" + this._items.length, this.addChild(t), this.initItems(); }, n.initItems = function() { this._items = []; for (var t = 0; t < 1e4; t++) { var e = this.getChildByName("item" + t); if (null == e) break; this._items.push(e), e.visible = t == this._selectedIndex; } }, n.setSelect = function(t, e) { this._items && t > -1 && t < this._items.length && (this._items[t].visible = e); }, n.setIndex = function(t) { this.selectedIndex = t; }, a(0, n, "dataSource", t.prototype._$get_dataSource, function(t) { if (this._dataSource = t, "number" == typeof t && Math.floor(t) == t || "string" == typeof t) this.selectedIndex = parseInt(t); else for (var e in this._dataSource) this.hasOwnProperty(e) && (this[e] = this._dataSource[e]); }), a(0, n, "selectedIndex", function() { return this._selectedIndex; }, function(t) { this._selectedIndex != t && (this.setSelect(this._selectedIndex, !1), this._selectedIndex = t, this.setSelect(this._selectedIndex, !0)); }), a(0, n, "selection", function() { return this._selectedIndex > -1 && this._selectedIndex < this._items.length ? this._items[this._selectedIndex] : null; }, function(t) { this.selectedIndex = this._items.indexOf(t); }), a(0, n, "items", function() { return this._items; }), a(0, n, "setIndexHandler", function() { return this._setIndexHandler; }, function(t) { this._setIndexHandler = t; }), e; }(O), at = function(t) { function e() { e.__super.call(this); } return s(e, "laya.ui.VScrollBar", G), e; }(), rt = function(t) { function e(t) { this._bg = null, this._skin = null, e.__super.call(this), void 0 === t && (t = ""), this.text = t, this.skin = this.skin; } s(e, "laya.ui.TextInput", t); var n = e.prototype; return n.preinitialize = function() { this.mouseEnabled = !0; }, n.destroy = function(e) { void 0 === e && (e = !0), t.prototype.destroy.call(this, e), this._bg && this._bg.destroy(), this._bg = null; }, n.createChildren = function() { this.addChild(this._tf = new m()), this._tf.padding = P.inputLabelPadding, this._tf.on("input", this, this._onInput), this._tf.on("enter", this, this._onEnter), this._tf.on("blur", this, this._onBlur), this._tf.on("focus", this, this._onFocus); }, n._onFocus = function() { this.event("focus", this); }, n._onBlur = function() { this.event("blur", this); }, n._onInput = function() { this.event("input", this); }, n._onEnter = function() { this.event("enter", this); }, n.initialize = function() { this.width = 128, this.height = 22; }, n.select = function() { this._tf.select(); }, n.setSelection = function(t, e) { this._tf.setSelection(t, e); }, a(0, n, "text", t.prototype._$get_text, function(t) { this._tf.text != t && (t += "", this._tf.text = t, this.event("change")); }), a(0, n, "bg", function() { return this._bg; }, function(t) { this.graphics = this._bg = t; }), a(0, n, "inputElementYAdjuster", function() { return this._tf.inputElementYAdjuster; }, function(t) { this._tf.inputElementYAdjuster = t; }), a(0, n, "multiline", function() { return this._tf.multiline; }, function(t) { this._tf.multiline = t; }), a(0, n, "skin", function() { return this._skin; }, function(t) { this._skin != t && (this._skin = t, this._bg || (this.graphics = this._bg = new D()), this._bg.source = v.getRes(this._skin), this._width && (this._bg.width = this._width), this._height && (this._bg.height = this._height)); }), a(0, n, "sizeGrid", function() { return this._bg && this._bg.sizeGrid ? this._bg.sizeGrid.join(",") : null; }, function(t) { this._bg || (this.graphics = this._bg = new D()), this._bg.sizeGrid = k.fillArray(P.defaultSizeGrid, t, Number); }), a(0, n, "inputElementXAdjuster", function() { return this._tf.inputElementXAdjuster; }, function(t) { this._tf.inputElementXAdjuster = t; }), a(0, n, "width", t.prototype._$get_width, function(t) { i.superSet(Y, this, "width", t), this._bg && (this._bg.width = t); }), a(0, n, "height", t.prototype._$get_height, function(t) { i.superSet(Y, this, "height", t), this._bg && (this._bg.height = t); }), a(0, n, "editable", function() { return this._tf.editable; }, function(t) { this._tf.editable = t; }), a(0, n, "restrict", function() { return this._tf.restrict; }, function(t) { this._tf.restrict = t; }), a(0, n, "prompt", function() { return this._tf.prompt; }, function(t) { this._tf.prompt = t; }), a(0, n, "promptColor", function() { return this._tf.promptColor; }, function(t) { this._tf.promptColor = t; }), a(0, n, "maxChars", function() { return this._tf.maxChars; }, function(t) { this._tf.maxChars = t; }), a(0, n, "focus", function() { return this._tf.focus; }, function(t) { this._tf.focus = t; }), a(0, n, "type", function() { return this._tf.type; }, function(t) { this._tf.type = t; }), a(0, n, "asPassword", function() { return this._tf.asPassword; }, function(t) { this._tf.asPassword = t; }), e; }(Y), ot = function(t) { function e() { e.__super.call(this); } return s(e, "laya.ui.VSlider", H), e; }(), ht = function(t) { function e() { this.popupCenter = !0, this.closeHandler = null, this.popupEffect = null, this.closeEffect = null, this.group = null, this.isModal = !1, this._dragArea = null, e.__super.call(this); } s(e, "laya.ui.Dialog", t); var n = e.prototype; return n.initialize = function() { this.popupEffect = e.manager.popupEffectHandler, this.closeEffect = e.manager.closeEffectHandler, this._dealDragArea(), this.on("click", this, this._onClick); }, n._dealDragArea = function() { var t = this.getChildByName("drag"); t && (this.dragArea = t.x + "," + t.y + "," + t.width + "," + t.height, t.removeSelf()); }, n._onClick = function(t) { var e = t.target; if (e) switch (e.name) { case "close": case "cancel": case "sure": case "no": case "ok": case "yes": this.close(e.name); } }, n.show = function(t, e) { void 0 === t && (t = !1), void 0 === e && (e = !0), this._open(!1, t, e); }, n.popup = function(t, e) { void 0 === t && (t = !1), void 0 === e && (e = !0), this._open(!0, t, e); }, n._open = function(t, i, n) { e.manager.lock(!1), this.isModal = t, e.manager.open(this, i, n); }, n.onOpened = function() {}, n.close = function(t, i) { void 0 === i && (i = !0), e.manager.close(this, t, i); }, n.onClosed = function(t) {}, n._onMouseDown = function(t) { var e = this.getMousePoint(); this._dragArea.contains(e.x, e.y) ? this.startDrag() : this.stopDrag(); }, a(0, n, "dragArea", function() { return this._dragArea ? this._dragArea.toString() : null; }, function(t) { if (t) { var e = k.fillArray([ 0, 0, 0, 0 ], t, Number); this._dragArea = new b(e[0], e[1], e[2], e[3]), this.on("mousedown", this, this._onMouseDown); } else this._dragArea = null, this.off("mousedown", this, this._onMouseDown); }), a(0, n, "isPopup", function() { return null != this.parent; }), a(0, n, "zOrder", t.prototype._$get_zOrder, function(t) { i.superSet(j, this, "zOrder", t), e.manager._checkMask(); }), a(1, e, "manager", function() { return e._manager = e._manager || new F(); }, function(t) { e._manager = t; }), e.setLockView = function(t) { e.manager.setLockView(t); }, e.lock = function(t) { e.manager.lock(t); }, e.closeAll = function() { e.manager.closeAll(); }, e.getDialogsByGroup = function(t) { return e.manager.getDialogsByGroup(t); }, e.closeByGroup = function(t) { return e.manager.closeByGroup(t); }, e.CLOSE = "close", e.CANCEL = "cancel", e.SURE = "sure", e.NO = "no", e.OK = "ok", e.YES = "yes", e._manager = null, e; }(j), lt = function(t) { function e() { e.__super.call(this); } s(e, "laya.ui.HBox", t); var n = e.prototype; return n.sortItem = function(t) { t && t.sort(function(t, e) { return t.x - e.x; }); }, n.changeItems = function() { this._itemChanged = !1; for (var t = [], e = 0, i = 0, n = this.numChildren; i < n; i++) { var s = this.getChildAt(i); s && s.layoutEnabled && (t.push(s), e = this._height ? this._height : Math.max(e, s.height * s.scaleY)); } this.sortItem(t); var a = 0; for (i = 0, n = t.length; i < n; i++) (s = t[i]).x = a, a += s.width * s.scaleX + this._space, "top" == this._align ? s.y = 0 : "middle" == this._align ? s.y = .5 * (e - s.height * s.scaleY) : "bottom" == this._align && (s.y = e - s.height * s.scaleY); this.changeSize(); }, a(0, n, "height", t.prototype._$get_height, function(t) { this._height != t && (i.superSet($, this, "height", t), this.callLater(this.changeItems)); }), e.NONE = "none", e.TOP = "top", e.MIDDLE = "middle", e.BOTTOM = "bottom", e; }($), ut = function(t) { function a(t) { this.gameStopHD = !1, this.iconImgTl = null, this._iconImage = null, this._moreBox = null, this._gameBox = null, this.screenType = 0, this._moreGameDataUrl = "https://abc.layabox.com/public/more/gamelist2.json", this._iconImageObj = null, this.clickCallBack = null, this.closeCallBack = null, this.isShow = !1, this.dinfo = null, this.ErrorUrlHttps = "https://elastic.layabox.com/", this.tongjiType = "bdm", void 0 === t && (t = 0), a.__super.call(this), this.screenType = t, this.init(); } var r, h; s(a, "laya.ui.MoreGame", j); var l = a.prototype; return l.getLocalDateString = function(t) { void 0 === t && (t = 0); var e = this.getDateByTimestamp(t).toLocaleDateString(); if (o.onLimixiu || o.onMiniGame) { var i = new Date(); e = a.toLocaleDateString(i.getTime()); } var n = new RegExp("/", "g"); return e = e.replace(n, "-"); }, l.getDateByTimestamp = function(t) { return void 0 === t && (t = 0), t && "" != t ? new Date(t) : new Date(); }, l.reportError = function(t, i, n) { void 0 === i && (i = ""), n = n || {}; var s = Date.now(), r = new Date(s + 0); n.date = r.toLocaleString(), n.etype = t, "error" != t && "statistics" != t && (t = "statistics"), n.version = "V0.0.1", n.gameId = 10100, n.dinfo = this.dinfo, n.channel = -1e3, n.msg = i, n["@timestamp"] = r.toISOString(), n.user = this.getUserId(), n.openid = this.getOpenId(); var o = a.getDay(r); n.rdate = o, n.day = r.getDate() + "", n.hour = r.getHours() + "", n.minute = r.getMinutes() + "", n.gameurl = e.baseURI, n.regTime = 0, "error" == t ? this.sendLog(n, this.tongjiType + "error-" + o.substring(0, 6) + "/" + t + "/", t) : this.sendLog(n, this.tongjiType + "-" + o.substring(0, 6) + "/" + t + "/", t); }, l.getUserId = function() { var t = parseInt(y.getItem("layauserid") + "") || -1; return -1 == t && (t = this.randRange(0, 1e9), y.setItem("layauserid", t + "")), t; }, l.getOpenId = function() { var t = y.getItem("openid"); if (null == t || "" == t) { t = ""; for (var e = 0; e < 32; e++) { var i = this.randRange(0, 62); t += "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".charAt(i); } y.setItem("openid", t); } return t; }, l.sendLog = function(t, e, i) { var n = this, s = new g(); s.on("error", this, function(t, e, i) { if (i && -1 != i.indexOf("[404]")) { new g().send(n.ErrorUrlHttps + "garbage/" + e + "/", JSON.stringify(t), "post", "text", [ "Content-Type", "application/json" ]); } }, [ t, i ]), o.onBDMiniGame && (t.gameurl = ""), s.send(this.ErrorUrlHttps + e, JSON.stringify(t), "post", "text", [ "Content-Type", "application/json" ]); }, l.initEvent = function() { this.on("click", this, this.onIconClick); }, l.onStageResize = function() { var t = Math.min(i.stage.width / i.stage.designWidth, i.stage.height / i.stage.designHeight); i.stage.width < 720 && (t = .9), this._moreBox && this._moreBox.scale(t, t), this._gameBox && this._gameBox.scale(t, t); }, l.tada = function(t, e, i, n) { void 0 === i && (i = 1.1), void 0 === n && (n = 1); var s = new I(); return s.reset(), s.to(t, { scaleX: i, scaleY: i, rotation: 3 }, .1 * e).to(t, { scaleX: i, scaleY: i, rotation: -3 }, .1 * e).to(t, { scaleX: i, scaleY: i, rotation: 3 }, .1 * e).to(t, { scaleX: i, scaleY: i, rotation: -3 }, .1 * e).to(t, { scaleX: i, scaleY: i, rotation: 3 }, .1 * e).to(t, { scaleX: i, scaleY: i, rotation: -3 }, .1 * e).to(t, { scaleX: i, scaleY: i, rotation: 3 }, .1 * e).to(t, { scaleX: i, scaleY: i, rotation: -3 }, .1 * e).to(t, { scaleX: i, scaleY: i, rotation: 3 }, .1 * e).to(t, { scaleX: n, scaleY: n, rotation: 0 }, .1 * e), s.play(0), s; }, l.dispose = function() { this.removeEvent(), this.gameStopHD = !0, a._moreGameData = null, this._iconImageObj = null, this.clickCallBack = null, this.closeCallBack = null, this.iconImgTl && (this.iconImgTl.offAll("complete"), this.iconImgTl = null), this._moreBox && (this._moreBox.removeChildren(), this._moreBox = null), this._gameBox && (this._gameBox.removeChildren(), this._gameBox = null), this._iconImage && (this._iconImage.removeSelf(), this._iconImage = null); }, l.onSetIconType = function(t) { this.gameStopHD = !t, this.visible = t; }, l.checkIconImgHD = function() { this.iconImgTl ? this.iconImgTl.play(0) : this.iconImgTl = this.tada(this._iconImage, 1200, 1.1, .9), this.iconImgTl.on("complete", this, this.onTlComplete); }, l.onTlComplete = function() { if (this.parent) { if (this._iconImage.scale(.9, .9), this._iconImage.rotation = 0, this.gameStopHD && this.iconImgTl) return this.iconImgTl.offAll("complete"), void (this.iconImgTl = null); i.timer.once(1e3, this, this.onYanChiPlay); } else this.iconImgTl && (this.iconImgTl.offAll(), this.iconImgTl = null); }, l.onYanChiPlay = function() { this.parent && this.iconImgTl ? this.iconImgTl.play(0) : this.iconImgTl && (this.iconImgTl.offAll("complete"), this.iconImgTl = null); }, l.removeEvent = function() { this.off("click", this, this.onIconClick); }, l.onIconClick = function() { this.isShow = !0, null != this.clickCallBack && this.clickCallBack.run(); var t = y.getItem("currentTime"), e = this.getLocalDateString(); t != e ? (y.setItem("currentTime", e), this.reportError(a._moreGameData.statid1)) : this.reportError(a._moreGameData.statid2), this.onResLoaded(); }, l.onResLoaded = function() { if (this._moreBox) this._moreBox.visible = !0; else { this._moreBox = new O(), i.stage.addChild(this._moreBox), this._moreBox.zOrder = 99999, this._moreBox.left = this._moreBox.right = this._moreBox.top = this._moreBox.bottom = 0; var t = this.onCreateImage(a.onGetAtlasDanImgUrl("img_white_bg"), this._moreBox); t.top = t.left = t.right = t.bottom = 0, t.sizeGrid = "1,1,1,1,1"; var e = this.onCreateImage(a.onGetAtlasDanImgUrl("hengfengexian"), this._moreBox); e.left = e.right = 0, e.y = 132, e.alpha = .2; var n = this.onCreateImage(a.onGetAtlasDanImgUrl("img_font_jingcai"), this._moreBox); n.on("click", this, this.onJiantouImgClick), this.isQMP() && this.screenType ? n.pos(15, 70) : n.pos(15, 45); var s = new Z(); this._moreBox.addChild(s), s.itemRender = r, s.selectEnable = !0, s.vScrollBarSkin = "", s.scrollBar.autoHide = !0, s.scrollBar.elasticDistance = 250, s.renderHandler = new f(this, this.onGameListRender); var o = a._moreGameData.marvellousGame.gameList, h = []; h.push(o[0]), h.push(o[1]); var l = this.RandomNumBoth(h.length, o.length - h.length, o.length); if (!l) return void (this.visible = !1); try { for (var u = 0, c = l.length; u < c; u++) { var _ = l[u]; h.push(o[_]); } a._moreGameData.marvellousGame.gameList = [], a._moreGameData.marvellousGame.gameList = h, s.array = a._moreGameData.marvellousGame.gameList; } catch (t) { s.array = a._moreGameData.marvellousGame.gameList; } this.screenType && (s.spaceY = 10, s.width = 690, this.isQMP() ? s.height = i.stage.height + 130 : s.height = 1139, s.y = 139, s.centerX = 0), this.onStageResize(); } }, l.RandomNumBoth = function(t, e, i) { for (var n = [], s = t; s < i; s++) n.push(s); var a = [], r = n.length; for (s = 0; s < r; s++) { n.length; var o = Math.floor(Math.random() * n.length); if (a.push(n[o]), n.splice(o, 1), n.length <= r - e) return a; } return null; }, l.isQMP = function() { var t = !1, e = 0; if (e = "horizontal" == i.stage.screenMode ? o.height % 9 : o.width % 9, o.onAndroid && 0 == e) { var n = 0; n = "horizontal" == i.stage.screenMode ? o.width : o.height, -1 != [ 2280, 2160, 2244, 3120, 2248, 2340, 2310 ].indexOf(n) && (t = !0); } var s = /iPhone/gi.test(o.window.navigator.userAgent) && 375 == Math.min(o.clientHeight, o.clientWidth) && 812 == Math.max(o.clientHeight, o.clientWidth), a = 414 == Math.min(o.clientHeight, o.clientWidth) && 896 == Math.max(o.clientHeight, o.clientWidth); return !o.onMiniGame && !o.onBDMiniGame || o.onAndroid || !s && !a || (t = !0), t; }, l.onDrawShapes = function(t, e, i, n) { void 0 === i && (i = 5), void 0 === n && (n = !1); var s = i; n && (s = 0); var a = new C(); return a.graphics.drawPath(0, 0, [ [ "moveTo", i, 0 ], [ "lineTo", 105, 0 ], [ "arcTo", t, 0, t, i, i ], [ "lineTo", t, e ], [ "arcTo", t, e + i, 105, e + i, s ], [ "lineTo", i, e + i ], [ "arcTo", 0, e + i, 0, e, s ], [ "lineTo", 0, i ], [ "arcTo", 0, 0, i, 0, i ], [ "closePath" ] ], { fillStyle: "#ff0000" }), a; }, l.onCreateMaskImg = function(t, e) { var i = this.onCreateImage(a.onGetAtlasDanImgUrl("dayuan"), e), n = this.onCreateImage(t, i); n.pos(11, 10); var s = new C(); return s.graphics.drawCircle(71, 74, 68, "#ff0000"), n.mask = s, i.scale(.7, .7), i; }, l.onGameListRender = function(t, e) { var i = a._moreGameData.marvellousGame.gameList; if (!(e < 0 || e > i.length - 1)) { var n = i[e]; t.init(n, this.screenType, new f(this, this.onItemClickCallBack)); } }, l.onItemClickCallBack = function(t) { var e = this; if (swan.navigateToMiniProgram) { var i = t.appKey, n = t.path, s = t.extendInfo; swan.navigateToMiniProgram({ appKey: i, path: n, extraData: s, success: function(t) {}, fail: function(t) {}, complete: function(i) { e.reportError(t.statid); }.bind(this) }); } }, l.onJiantouImgClick = function(t) { this.isShow = !1, this._moreBox && (this._moreBox.visible = !1), null != this.closeCallBack && this.closeCallBack.run(); }, l.onCreateLabel = function(t, e, i, n, s, a, r) { void 0 === i && (i = 24), void 0 === n && (n = "#000000"), void 0 === s && (s = !1), void 0 === a && (a = "center"), void 0 === r && (r = 10); var o = new Y(); return o.text = t, o.font = "Microsoft YaHei", o.fontSize = i, o.color = n, o.bold = !0, o.leading = r, o.valign = "middle", o.align = a, o.wordWrap = s, e.addChild(o), o; }, l.onCreateImage = function(t, e) { var i = new B(); return i.skin = t, e.addChild(i), i; }, l.init = function() { var t = o.window.navigator.userAgent.indexOf("SwanGame") > -1; this.visible = !1, t && (this.dinfo = JSON.stringify(laya.bd.mini.BMiniAdapter.systemInfo), this.onGetAdvsListData()); }, l.randRange = function(t, e) { return Math.floor(Math.random() * (e - t + 1)) + t; }, l.onGetAdvsListData = function() { var t = this, e = this.randRange(1e4, 1e6), i = this._moreGameDataUrl + "?" + e; a._http.open("get", i, !0), a._http.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"), a._http.responseType = "text", a._http.onerror = function(e) { t._onError(e); }, a._http.onload = function(e) { t._onLoad(e); }, a._http.send(null); }, l._onError = function(t) { this.error("Request failed Status:" + a._http.status + " text:" + a._http.statusText); }, l._onLoad = function(t) { var e = a._http, i = void 0 !== e.status ? e.status : 200; 200 === i || 204 === i || 0 === i ? this.complete() : this.error("[" + e.status + "]" + e.statusText + ":" + e.responseURL); }, l.error = function(t) { this.event("error", t); }, l.complete = function() { try { var t = a._http.response || a._http.responseText; a._moreGameData = JSON.parse(t), this.initUI(); } catch (t) { !1, this.error(t.message); } }, l.initUI = function() { a._moreGameData.isOpen && this.screenType ? (this._iconImage || (this._iconImage = new B(), this.addChild(this._iconImage)), this._iconImage.skin = a.onGetImgSkinUrl(a._moreGameData.icon), this._iconImageObj && (this._iconImage.size(this._iconImageObj.width, this._iconImageObj.height), this._iconImage.pivot(this._iconImageObj.width / 2, this._iconImageObj.height / 2), this._iconImage.pos(this._iconImageObj.width / 2, this._iconImageObj.height / 2)), this.visible = !0, this.initEvent(), this.gameStopHD = !1, this.checkIconImgHD()) : this.visible = !1; }, l.setIconSize = function(t, e) { this._iconImage && (this._iconImage.size(t, e), this._iconImage.pivot(t / 2, e / 2), this._iconImage.pos(t / 2, e / 2)), this._iconImageObj = { width: t, height: e }; }, a.toLocaleDateString = function(t) { return a.getDateFormatStr(t, "/"); }, a.getDateFormatStr = function(t, e) { void 0 === e && (e = "yynndd"); var i = new Date(t), n = i.getFullYear(), s = i.getMonth() + 1, a = i.getDate(), r = i.getHours(), o = i.getMinutes(), h = i.getSeconds(); switch (e) { case "yynndd": return n.toString() + "年" + s.toString() + "月" + a.toString() + "日"; case "/": return n.toString() + "/" + s.toString() + "/" + a.toString(); } return n.toString() + "年" + s.toString() + "月" + a.toString() + "日" + r.toString() + "时" + o.toString() + "分" + h.toString() + "秒"; }, a.getDay = function(t) { var e = t.getMonth() + 1, i = t.getDate(); return t.getFullYear() + "" + (e < 10 ? "0" + e : e) + (i < 10 ? "0" + i : i); }, a.onGetAtlasDanImgUrl = function(t) { return a._moreGameData.imgPath + a._moreGameData.atlas + t + ".png"; }, a.onGetImgSkinUrl = function(t) { return a._moreGameData.imgPath + t; }, a.onGetIconImgSkinUrl = function(t) { return a._moreGameData.iconPath + t; }, a._moreGameData = null, n(a, [ "_http", function() { return this._http = new o.window.XMLHttpRequest(); } ]), a.__init$ = function() { r = function(t) { function e() { this.titleLabel = null, this.gameListBox = null, e.__super.call(this); } s(e, "", O); var i = e.prototype; return i.init = function(t, e, i) { if (this.titleLabel ? this.titleLabel.text = t.title : (this.titleLabel = this.onCreateLabel(t.title, this, 32, "#3d3939"), this.titleLabel.pos(8, 0), this.titleLabel.size(162, 50)), this.gameListBox) for (n = 0, s = this.gameListBox._childs.length; n < s; n++) (a = this.gameListBox._childs[n]).init(t.gameList[n], e, i); else { this.gameListBox = new O(), this.addChild(this.gameListBox); for (var n = 0, s = t.gameList.length; n < s; n++) { var a = new h(); a.init(t.gameList[n], e, i), a.x = 0 + 175 * n, a.y = 65, this.gameListBox.addChild(a); } } this.size(695, 340), this.cacheAs = "bitmap"; }, i.onCreateLabel = function(t, e, i, n, s) { void 0 === i && (i = 26), void 0 === n && (n = "#000000"), void 0 === s && (s = !0); var a = new Y(); return a.text = t, a.font = "Microsoft YaHei", a.fontSize = i, a.color = n, a.bold = s, a.leading = 10, a.valign = "middle", a.align = "center", a.overflow = "hidden", e.addChild(a), a; }, e; }(), h = function(t) { function e() { this.kuangImg = null, this.iconNameLabel = null, this.iconImg = null, this.playImg = null, this.itemData = null, this.callBackHandler = null, e.__super.call(this); } s(e, "", O); var i = e.prototype; return i.MoveGameItem = function() {}, i.initEvent = function() { this.on("click", this, this.onItemClick); }, i.onItemClick = function() { null != this.callBackHandler && this.callBackHandler.runWith([ this.itemData ]); }, i.init = function(t, e, i) { if (this.itemData = t, this.callBackHandler = i, this.kuangImg ? this.kuangImg.skin = a.onGetAtlasDanImgUrl("dayuan") : this.kuangImg = this.onCreateImage(a.onGetAtlasDanImgUrl("dayuan"), this), this.iconImg) this.iconImg.skin = a.onGetIconImgSkinUrl(t.icon); else { this.iconImg = this.onCreateImage(a.onGetIconImgSkinUrl(t.icon), this); var n = new C(); n.graphics.drawCircle(71, 74, 68, "#ff0000"), this.iconImg.mask = n, this.iconImg.pos(13, 10); } this.iconNameLabel ? this.iconNameLabel.text = t.name : (this.iconNameLabel = this.onCreateLabel(t.name, this, 28, "#3d3939"), this.iconNameLabel.pos(7, 165)), this.playImg ? this.playImg.skin = a.onGetAtlasDanImgUrl("img_play") : (this.playImg = this.onCreateImage(a.onGetAtlasDanImgUrl("img_play"), this), this.playImg.pos(12, 210)), this.size(165, 270), this.initEvent(); }, i.onCreateLabel = function(t, e, i, n, s) { void 0 === i && (i = 24), void 0 === n && (n = "#000000"), void 0 === s && (s = !1); var a = new Y(); return a.text = t, a.font = "Microsoft YaHei", a.fontSize = i, a.color = n, a.bold = s, a.leading = 10, a.valign = "middle", a.align = "center", a.size(152, 44), a.overflow = "hidden", e.addChild(a), a; }, i.onCreateImage = function(t, e) { var i = new B(); return i.skin = t, e.addChild(i), i; }, e; }(); }, a; }(), ct = function(t) { function e() { e.__super.call(this); } s(e, "laya.ui.VBox", t); var n = e.prototype; return n.changeItems = function() { this._itemChanged = !1; for (var t = [], e = 0, i = 0, n = this.numChildren; i < n; i++) { var s = this.getChildAt(i); s && s.layoutEnabled && (t.push(s), e = this._width ? this._width : Math.max(e, s.width * s.scaleX)); } this.sortItem(t); var a = 0; for (i = 0, n = t.length; i < n; i++) (s = t[i]).y = a, a += s.height * s.scaleY + this._space, "left" == this._align ? s.x = 0 : "center" == this._align ? s.x = .5 * (e - s.width * s.scaleX) : "right" == this._align && (s.x = e - s.width * s.scaleX); this.changeSize(); }, a(0, n, "width", t.prototype._$get_width, function(t) { this._width != t && (i.superSet($, this, "width", t), this.callLater(this.changeItems)); }), e.NONE = "none", e.LEFT = "left", e.CENTER = "center", e.RIGHT = "right", e; }($), _t = function(t) { function e() { e.__super.call(this); } s(e, "laya.ui.RadioGroup", it); return e.prototype.createItem = function(t, e) { return new et(t, e); }, e; }(), dt = function(t) { function e() { e.__super.call(this); } s(e, "laya.ui.Tab", it); return e.prototype.createItem = function(t, e) { return new z(t, e); }, e; }(), pt = function(t) { function e(t) { this._vScrollBar = null, this._hScrollBar = null, void 0 === t && (t = ""), e.__super.call(this, t); } s(e, "laya.ui.TextArea", t); var n = e.prototype; return n.destroy = function(e) { void 0 === e && (e = !0), t.prototype.destroy.call(this, e), this._vScrollBar && this._vScrollBar.destroy(), this._hScrollBar && this._hScrollBar.destroy(), this._vScrollBar = null, this._hScrollBar = null; }, n.initialize = function() { this.width = 180, this.height = 150, this._tf.wordWrap = !0, this.multiline = !0; }, n.onVBarChanged = function(t) { this._tf.scrollY != this._vScrollBar.value && (this._tf.scrollY = this._vScrollBar.value); }, n.onHBarChanged = function(t) { this._tf.scrollX != this._hScrollBar.value && (this._tf.scrollX = this._hScrollBar.value); }, n.changeScroll = function() { var t = this._vScrollBar && this._tf.maxScrollY > 0, e = this._hScrollBar && this._tf.maxScrollX > 0, i = t ? this._width - this._vScrollBar.width : this._width, n = e ? this._height - this._hScrollBar.height : this._height, s = this._tf.padding || P.labelPadding; this._tf.width = i, this._tf.height = n, this._vScrollBar && (this._vScrollBar.x = this._width - this._vScrollBar.width - s[2], this._vScrollBar.y = s[1], this._vScrollBar.height = this._height - (e ? this._hScrollBar.height : 0) - s[1] - s[3], this._vScrollBar.scrollSize = 1, this._vScrollBar.thumbPercent = n / Math.max(this._tf.textHeight, n), this._vScrollBar.setScroll(1, this._tf.maxScrollY, this._tf.scrollY), this._vScrollBar.visible = t), this._hScrollBar && (this._hScrollBar.x = s[0], this._hScrollBar.y = this._height - this._hScrollBar.height - s[3], this._hScrollBar.width = this._width - (t ? this._vScrollBar.width : 0) - s[0] - s[2], this._hScrollBar.scrollSize = Math.max(.033 * i, 1), this._hScrollBar.thumbPercent = i / Math.max(this._tf.textWidth, i), this._hScrollBar.setScroll(0, this.maxScrollX, this.scrollX), this._hScrollBar.visible = e); }, n.scrollTo = function(t) { this.commitMeasure(), this._tf.scrollY = t; }, a(0, n, "scrollY", function() { return this._tf.scrollY; }), a(0, n, "width", t.prototype._$get_width, function(t) { i.superSet(rt, this, "width", t), this.callLater(this.changeScroll); }), a(0, n, "hScrollBar", function() { return this._hScrollBar; }), a(0, n, "height", t.prototype._$get_height, function(t) { i.superSet(rt, this, "height", t), this.callLater(this.changeScroll); }), a(0, n, "maxScrollX", function() { return this._tf.maxScrollX; }), a(0, n, "vScrollBarSkin", function() { return this._vScrollBar ? this._vScrollBar.skin : null; }, function(t) { null == this._vScrollBar && (this.addChild(this._vScrollBar = new at()), this._vScrollBar.on("change", this, this.onVBarChanged), this._vScrollBar.target = this._tf, this.callLater(this.changeScroll)), this._vScrollBar.skin = t; }), a(0, n, "hScrollBarSkin", function() { return this._hScrollBar ? this._hScrollBar.skin : null; }, function(t) { null == this._hScrollBar && (this.addChild(this._hScrollBar = new J()), this._hScrollBar.on("change", this, this.onHBarChanged), this._hScrollBar.mouseWheelEnable = !1, this._hScrollBar.target = this._tf, this.callLater(this.changeScroll)), this._hScrollBar.skin = t; }), a(0, n, "vScrollBar", function() { return this._vScrollBar; }), a(0, n, "maxScrollY", function() { return this._tf.maxScrollY; }), a(0, n, "scrollX", function() { return this._tf.scrollX; }), e; }(rt); !function(t) { function e() { this._uiView = null, this.isCloseOther = !1, e.__super.call(this); } s(e, "laya.ui.AsynDialog", ht); var i = e.prototype; i.createView = function(t) { this._uiView = t; }, i._open = function(t, e, i) { this.isModal = t, this.isCloseOther = e, ht.manager.lock(!0), this._uiView ? this.onCreated() : this.onOpen(); }, i.onCreated = function() { this.createUI(), this.onOpen(); }, i.createUI = function() { laya.ui.View.prototype.createView.call(this, this._uiView), this._uiView = null, this._dealDragArea(); }, i.onOpen = function() { ht.manager.open(this, this.isCloseOther), ht.manager.lock(!1); }, i.close = function(t, e) { void 0 === e && (e = !0), ht.manager.close(this), this.onClose(); }, i.onClose = function() {}, i.destroy = function(t) { void 0 === t && (t = !0), laya.ui.View.prototype.destroy.call(this, t), this._uiView = null, this.onDestroy(); }, i.onDestroy = function() {}; }(); i.__init([ j, ut ]); }(window, document, Laya), "function" == typeof define && define.amd && define("laya.core", [ "require", "exports" ], function(t, e) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }); for (var i in Laya) { var n = Laya[i]; n && n.__isclass && (e[i] = n); } }); var ui, PublicFun = function() { function t() {} return t.changeString = function(e) { if (e < 1e3) return Math.floor(e).toString(); for (var i = 0; e >= 1e3; ) e /= 1e3, i++; return e.toFixed(1) + t.coinUnit.list[i - 1]; }, t.getMyDate = function() { var t = new Date(); return t.getFullYear() + "-" + (t.getMonth() + 1) + "-" + t.getDate(); }, t.judgeDate = function() { var t = new Date(), e = new Date(); return e.setFullYear(2019, 0, 1), e.setHours(0), e.setMinutes(0), e.setSeconds(0), e.setMilliseconds(0), Math.floor((t.getTime() - e.getTime()) / 864e5); }, t.getPointAngle = function(t, e, i, n) { var s = i - t, a = n - e; return 180 * Math.atan(a / s) / Math.PI; }, t.getMaskPath = function(t, e, i) { return [ [ "moveTo", i, 0 ], [ "arcTo", t, 0, t, i, i ], [ "arcTo", t, e, t - i, e, i ], [ "arcTo", 0, e, 0, e - i, i ], [ "arcTo", 0, 0, i, 0, i ] ]; }, t.popWindow = function(t, e) { void 0 === e && (e = 1), t.scale(0, 0), Tween.to(t, { scaleX: e, scaleY: e }, 300, Laya.Ease.backOut); }, t.getINFO = function() { "wx" == CF.environment ? CF.SystemInfoRES = wx.getSystemInfoSync() : "tt" == CF.environment ? CF.SystemInfoRES = window.tt.getSystemInfoSync() : "vivo" == CF.environment && (CF.SystemInfoRES = window.qg.getSystemInfoSync()); }, t.setShow = function(e, i) { "wx" == CF.environment && (wx.onShow(function(n) { console.log(n), wx.login({ success: function(n) { var s = { channel: "", gameid: "game_sszqtf", vc: "game_sszqtf_1.0.0", code: n.code, appid: "wx1e8ee97d040238a4" }; wx.request({ method: "GET", url: "https://dhservice.qizheplay.com/webchat/zt/wxloginv1", data: s, header: { "Content-Type": "application/x-www-form-urlencoded" }, success: function(n) { console.log("接收到的response 附带openid及其他配置信息:::::", n); var s = n.data.body.openid; CF.coinRewardTime = n.data.body.coinRewardTime, CF.jbsbTime = n.data.body.jbsbTime, t.initCPA(s, e, i), t.bannerShowRandom = n.data.body.randomnum, CF.versions = n.data.body.iswxchecking ? "audit" : "ol", t.isRegister = n.data.body.isRegister; }, fail: function(t) { console.log(t.statusCode, t.errMsg); } }); } }); }), wx.showShareMenu({ success: function() { console.log("设置右上角分享按钮"), wx.onShareAppMessage(function() { return { title: CF.shareMsg, imageUrl: "img/share.png" }; }); } })); }, t.addTopAd = function(e) { Catalog._TOPAD_SCENE.show(); //t.comePage(t.cpamanager.pagelist[e]); }, t.closeTopAd = function() { Catalog._TOPAD_SCENE.close(); }, t.addAbout = function(e) { Catalog._ABOUT_SCENE.visible = !0, //t.comePage(t.cpamanager.pagelist[e]), Catalog._ABOUT_SCENE.adName != e && Catalog._ABOUT_SCENE.changeShow(e); }, t.closeAbout = function() { Catalog._ABOUT_SCENE.visible = !1; }, t.comePage = function(e) { t.cpamanager.setcurrentpageid(e); }, t.initBanner = function() { if ("wx" != CF.environment) ; else { var t = CF.adUnitIdBanner; if (0 == t.length) return; for (var e = function() { CF.adUnitIdBanner[n]; i["banner" + n] = wx.createBannerAd({ adUnitId: id, adIntervals: 30, style: { left: 0, top: 0, width: 300, height: 150 } }), i["banner" + n].hide; var t; console.log(i["banner" + n]), i["banner" + n].onResize(function(e) { if (!t) { var i = "wx" == CF.environment; console.log(e), t = !0, this["banner" + n].style.left = ((i ? CF.SystemInfoRES.screenWidth : CF.SystemInfoRES.windowWidth) - e.width) / 2, this["banner" + n].style.top = (i ? CF.SystemInfoRES.screenHeight - (CF.SystemInfoRES.screenHeight - CF.SystemInfoRES.screenWidth / 750 * 1334) / 2 : CF.SystemInfoRES.windowHeight) - e.height, this["banner" + n].offResize(); } }), i["banner" + n].onError(function(t) { console.log("banner展示失败", t); }); }, i = this, n = 0; n < t.length; n++) e(); } }, t.addBanner = function() { console.log("出错") return; var t; if ("wx" == CF.environment) { var e = CF.adUnitIdBanner[Math.floor(Math.random() * CF.adUnitIdBanner.length)]; (t = wx.createBannerAd({ adUnitId: e, adIntervals: 30, style: { left: 0, top: 0, width: 300, height: 150 } })).hide; } "tt" == CF.environment ? (t = window.tt.createBannerAd({ adUnitId: CF.adUnitIdBannerInTT, style: { width: 300, top: CF.SystemInfoRES.windowHeight - 168.75 } })).onLoad(function() { t.show().then(function() { console.log("头条banner显示成功"); }); }) : "vivo" == CF.environment && (t = window.qg.createBannerAd({ posId: CF.adUnitIdBannerInVIVO, style: { width: 300, top: CF.SystemInfoRES.windowHeight - 168.75 } })).onLoad(function() { t.show().then(function() { console.log("vivobanner显示成功"); }); }); var i; return console.log(t), t.onResize(function(e) { if (!i) { var n = "wx" == CF.environment; console.log(e), i = !0, t.style.left = ((n ? CF.SystemInfoRES.screenWidth : CF.SystemInfoRES.windowWidth) - e.width) / 2, t.style.top = (n ? CF.SystemInfoRES.screenHeight - (CF.SystemInfoRES.screenHeight - CF.SystemInfoRES.screenWidth / 750 * 1334) / 2 : CF.SystemInfoRES.windowHeight) - e.height, t.offResize(); } }), t.onError(function(t) { console.log("banner展示失败", t); }), t; }, t.removeBanner = function() { CF.banner && CF.banner.destroy && ("wx" == CF.environment ? (CF.banner.destroy(), CF.banner = null, t.addBanner()) : (CF.banner.destroy(), CF.banner = null, console.log("移除banner"))), Catalog._LIKE_SCENE.visible = !1; }, t.isAddB = function(e, i) { void 0 === e && (e = !0), void 0 === i && (i = !1), Browser.onWeiXin && null != CF["adUnitIdBanner" + ("tt" == CF.environment ? "inTT" : "wx" == CF.environment ? "" : "InVIVO")] && e ? (i && console.log("随机展示banner,当前不展示banner的概率为:" + t.bannerShowRandom + ","), i && Math.random() < t.bannerShowRandom ? Catalog._LIKE_SCENE.visible = !0 : "wx" == CF.environment ? CF.banner ? CF.banner.show() : (CF.banner = t.addBanner(), CF.banner.show()) : CF.banner = t.addBanner()) : Catalog._LIKE_SCENE.visible = !0; }, t.WXShare = function() { Browser.onWeiXin && ("wx" == CF.environment ? wx.shareAppMessage({ title: CF.shareMsg, imageUrl: "img/share.png", query: "uid=" + LocalStorage.userUID }) : "tt" == CF.environment ? tt.shareAppMessage({ templateId: CF.shareIdTT }) : "vivo" == CF.environment && window.qg.share({ success: function() { console.log("vivo分享成功"); }, fail: function() { console.log("vivo分享失败"); } })); }, t.lookAd = function(e, i, n) { if (Browser.onWeiXin) { var s; "wx" == CF.environment ? s = wx.createRewardedVideoAd({ adUnitId: CF.adUnitIdVideo }) : "tt" == CF.environment ? s = window.tt.createRewardedVideoAd({ adUnitId: CF.adUnitIdVideoinTT }) : "vivo" == CF.environment && (s = window.qg.createRewardedVideoAd({ posId: CF.adUnitIdVideoinVIVO })), s.load().then(function() { s.show(), s.offLoad(); }).catch(function(t) { console.log("广告错误", t); }), "tt" != CF.environment ? s.onClose(function(t) { t.isEnded && e(), s.offClose(); }) : (t.adCb = e, t.adCloseCb = n, t.clickName = i, t.videoAd = s, s.onClose(t.adClose)), s.onError(function(t) { t.errCode, t.errMsg; n && n(), Catalog._MAIN_SCENE.postMsg("很抱歉,暂时没有广告可以看,请稍后再试"); }); } else { window['uptap'].ShowExcitationVideoAdv((n1) => { switch (n1.type) { case "1": //暂时没有广告 console.log("暂时没有广告"); break; case "2": //想要奖励,必须看完广告(用户点击跳过按钮) console.log("必须看完整视频才能获得奖励哦!"); break; case "3": //广告正常播放完毕 console.log("广告播放成功") e(), n && n(); break; } }) } }, t.adClose = function(e) { e.isEnded && t.adCb(), t.adCloseCb && t.adCloseCb(), t.videoAd.offClose(t.adClose); }, t.showInterstitialAd = function() { if (Browser.onWeiXin) { var t = null; "wx" == CF.environment && wx.createInterstitialAd ? t = wx.createInterstitialAd({ adUnitId: CF.adunitIdInterstitial }) : "vivo" == CF.environment && (t = window.qg.createInterstitialAd({ posId: CF.adunitIdInterstitialInVIVO })), t && t.show().catch(function(t) { console.error(t); }); } }, t.http = function(t, e, i, n, s, a) { var r = new HttpRequest(); r.once(Laya.Event.COMPLETE, this, n), r.once(Laya.Event.ERROR, this, s), r.once(Laya.Event.COMPLETE, this, a), r.send(t, JSON.stringify(e), i, "json", [ "Content-Type", "application/json" ]); }, t.getVivoId = function() { CF.adunitIdInterstitialInVIVO = "", CF.adUnitIdBannerInVIVO = "", CF.adUnitIdVideoinVIVO = "", t.http("https://firefly-public.oss-cn-shenzhen.aliyuncs.com/conf/compound_ncdzjs_conf_vivo", "", "get", function(t) { console.log("vivo id", t), CF.adUnitIdVideoinVIVO = t.vedio_id, CF.adunitIdInterstitialInVIVO = t.interstitial_id, CF.adUnitIdBannerInVIVO = t.banner_id; }, function(t) { console.log("获取失败:" + t); }); }, t.initCPA = function(e, i, n) { console.log("initCPA"); var s = window.CPA; console.log("cap:::", s); var a = new s(e, CF.APPID); t.cpamanager = a; var r = 0, o = function(e) { a.getCpaByPosConfig(e, function(s) { console.log("cpa itemlist >" + e), console.log(s), t.ADlist[e] = s, 4 == ++r && (i && i(), n && n()); }); }; for (var h in t.ADlist) o(h); }, t.coinUnit = { K: Math.pow(10, 3), M: Math.pow(10, 6), G: Math.pow(10, 9), T: Math.pow(10, 12), P: Math.pow(10, 15), E: Math.pow(10, 18), Z: Math.pow(10, 21), Y: Math.pow(10, 24), B: Math.pow(10, 27), list: [ "K", "M", "G", "T", "P", "E", "Z", "Y", "B" ] }, t.bannerShowRandom = .5, t.isRegister = !0, t.adCb = null, t.adCloseCb = null, t.clickName = "", t.videoAd = null, t.ADlist = { notice: [], gameover: [], mainicon: [], mainbanner: [] }, t; }(), Img = Laya.Image, WebGL = laya.webgl.WebGL, HttpRequest = Laya.HttpRequest, Txt = Laya.Text, Texture = Laya.Texture, BlurFilter = Laya.BlurFilter, Sprite = Laya.Sprite, Tween = Laya.Tween, Ease = Laya.Ease, Timeline = Laya.TimeLine, Handler = Laya.Handler, TimeLine = Laya.TimeLine, Rectangle = Laya.Rectangle, Box = Laya.Box, List = Laya.List, Browser = Laya.Browser, _Event = Laya.Event, Point = Laya.Point, CF = function() { function t() {} return t.getGift = function(t, e) { return { type: Math.floor(3 * Math.random() + 1), level: 1 }; }, t.getAddCoins = function(t, e) { return 1e4; }, t.wallAD = null, t.APPID = "wx1e8ee97d040238a4", t.adunitIdInterstitial = "adunit-b3ffa21f581845da", t.adunitIdInterstitialInVIVO = "", t.adUnitIdVideoinTT = "24cbp04batf22dgcl2", t.adUnitIdVideoinVIVO = "", t.APP_Name = "", t.adUnitIdVideo = "adunit-1dee9858ebde62b0", t.adUnitIdBanner = [ "adunit-7d8a86157da0ed6e", "adunit-65ccfb3d4c154d7b", "adunit-ca139f2ba2c777ec", "adunit-7410e3ff1dca4250" ], t.adUnitIdBannerInTT = "g7jl1k8212k1bqi9p4", t.adUnitIdBannerInVIVO = "", t.shareMsg = "分享语", t.inviteMsg = "邀请语", t.shareIdTT = "3scligo34171bn7662", t.fromName = "", t.fromWxid = "", t.fromUid = "", t.versions = "audit", t.shareUid = "", t.differLevel = 3, t.defaultMoney = 2e4, t.speedRadix = 20, t.zombiTime = 1.5, t.coinsRandom = 80, t.defaultSkill = [ 2, 2, 2 ], t.giftTime = 3e4, t.circularRadius = 200, t.coinRewardTime = 0, t.superLevelRadom = .5, t.kuangbao = !1, t.buff_kbspeed = { time: 0, value: 0 }, t.jbsbTime = 0, t.curJbsbTime = 0, t.doubleCount = 1, t.skillMsg = { slow_color: "#121aca", slow_alpha: 1, frozen_color: "#121aca", frozen_alpha: 1 }, t.levelUpOdd = [ .25, .2, .15, .1, .05 ], t.maxLevel = [ 48, 28, 48 ], t.environment = "wx", t.list = [ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ], t.loadList = [ "res/atlas/img.atlas", "res/atlas/flower.atlas", "res/atlas/bullet.atlas", "res/atlas/skill.atlas" ], t.jsonList = [ "data/Bianyi.json", "data/Bullet.json", "data/Guanka.json", "data/Map.json", "data/Monster.json", "data/Plant.json", "data/ShuZhi.json", "data/Skill.json", "data/tianfu.json", "data/Tujian.json", "data/UnLock.json", "data/zhalan.json" ], t.jsonNick = [ "variation", "bullet", "custom", "map", "monster", "plant", "value", "skill", "inborn", "book", "unlock", "paling" ], t.subpackageList = [ "other/other.atlas" ], t; }(), Catalog = function() { function t() {} return t.init = function() { LocalStorage.init(), t._LIKE_SCENE = new Like(), t._ABOUT_SCENE = new About(), t._UNLOCKED_SCENE = new Unlocked(), t._MAIN_SCENE = new Index(), t._BOOK_SCENE = new Book(), t._SHOP_SCENE = new Shop(), t._ADD_SCENE = new Add(), t._ROAD_SCENE = new Road(), t._DIAL_SCENE = new Dial(), t._LEVELUP_SCENE = new Levelup(), t._OVER_SCENE = new Over(), t._VARIATION_SCENE = new Variation(), t._GIFT_SCENE = new GiftScene(), t._SCENEAD1_SCENE = new SceneAD1(), t._CLOSE_SCENE = new Close(), t._SIGN_SCENE = new Sign(), t._OFFLINE_SCENE = new Offline(), t._DOUBLE_SCENE = new DoubleCoin(), t._TOPAD_SCENE = new TopAd(), t._SUPERUNLOCK_SCENE = new SuperUnlock(), t._COINREWARD_SCENE = new CoinReward(), t._MAIN_SCENE.pageAD.addChild(t._SCENEAD1_SCENE), t._MAIN_SCENE.pageClose.addChild(t._CLOSE_SCENE), t._MAIN_SCENE.pageLike.addChild(t._LIKE_SCENE), t._MAIN_SCENE.pageAbout.addChild(t._ABOUT_SCENE), t._MAIN_SCENE.pageAll.addChild(t._BOOK_SCENE), t._MAIN_SCENE.pageAll.addChild(t._SHOP_SCENE), t._MAIN_SCENE.pageAll.addChild(t._OVER_SCENE), t._MAIN_SCENE.pageAll.addChild(t._UNLOCKED_SCENE), t._MAIN_SCENE.pageAll.addChild(t._VARIATION_SCENE), t._MAIN_SCENE.pageAll.addChild(t._ADD_SCENE), t._MAIN_SCENE.pageAll.addChild(t._ROAD_SCENE), t._MAIN_SCENE.pageAll.addChild(t._DIAL_SCENE), t._MAIN_SCENE.pageAll.addChild(t._LEVELUP_SCENE), t._MAIN_SCENE.pageAll.addChild(t._GIFT_SCENE), t._MAIN_SCENE.pageAll.addChild(t._SIGN_SCENE), t._MAIN_SCENE.pageAll.addChild(t._OFFLINE_SCENE), t._MAIN_SCENE.pageAll.addChild(t._DOUBLE_SCENE), t._MAIN_SCENE.pageAll.addChild(t._TOPAD_SCENE), t._MAIN_SCENE.pageAll.addChild(t._SUPERUNLOCK_SCENE), t._MAIN_SCENE.pageAll.addChild(t._COINREWARD_SCENE); }, t; }(), LocalStorage = function() { function t() {} return t.init = function() { t.initList = t.getHasList() ? t.getHasList() : function() { for (var t = [], e = 0, i = Data.unlock; e < i.length; e++) { i[e]; t.push(0); } return t; }(), t.soilList = t.getSoilList() ? t.getSoilList() : Data.unlock, t.shopPrice = t.getBuyMoney() || [ [], [], [] ]; for (var e = 0; e < t.shopPrice.length; e++) for (;t.shopPrice[e].length < CF.maxLevel[e]; ) t.shopPrice[e].push(0); t.moneyCount = t.getMoneyCount(), t.gemCount = t.getGemCount(), t.sevenDay = t.getSevenDay() ? t.getSevenDay() : [ PublicFun.judgeDate(), 1, 0 ], t.skill = t.getSkill() ? t.getSkill() : CF.defaultSkill; }, t.setLS = function(t, e) { localStorage.setItem(t, e); }, t.getLS = function(t) { return localStorage.getItem(t); }, t.setClickAD = function() { t.setLS("ClickAD", JSON.stringify(t.clickAD)); }, t.getClickAD = function() { return t.getLS("ClickAD") ? JSON.parse(t.getLS("ClickAD")) : null; }, t.setOfflineTime = function() { t.setLS("OfflineTime", Date.now()); }, t.getOfflineTime = function() { return t.getLS("OfflineTime"); }, t.setSevenDay = function() { t.setLS("SevenDay", JSON.stringify(t.sevenDay)); }, t.getSevenDay = function() { return t.getLS("SevenDay") ? JSON.parse(t.getLS("SevenDay")) : null; }, t.setSkill = function() { t.setLS("Skill", JSON.stringify(t.skill)); }, t.getSkill = function() { return t.getLS("Skill") ? JSON.parse(t.getLS("Skill")) : null; }, t.setBookReward = function() { t.setLS("BookReward", JSON.stringify(t.bookReward)); }, t.getBookReward = function() { return t.getLS("BookReward") ? JSON.parse(t.getLS("BookReward")) : null; }, t.setDeblocking = function() { t.setLS("deblocking", JSON.stringify(t.deblocking)); }, t.getDeblocking = function() { return t.getLS("deblocking") ? JSON.parse(t.getLS("deblocking")) : null; }, t.setDialCount = function() { t.setLS("DialCount", t.dialCount); }, t.getDialCount = function() { return t.getLS("DialCount") ? parseInt(t.getLS("DialCount")) : 1; }, t.setPaling = function() { t.setLS("Paling", t.paling); }, t.getPaling = function() { return t.getLS("Paling") ? parseInt(t.getLS("Paling")) : 1; }, t.setBuyMoney = function() { t.setLS("BuyMoney", JSON.stringify(t.shopPrice)); }, t.getBuyMoney = function() { if (t.getLS("BuyMoney")) { var e = JSON.parse(t.getLS("BuyMoney")); return e[0].length < CF.maxLevel ? null : e; } return null; }, t.setNewDate = function() { t.setLS("NewDate", JSON.stringify(t.newDate)); }, t.getNewDate = function() { return t.getLS("NewDate") ? JSON.parse(t.getLS("NewDate")) : []; }, t.setCustom = function() { t.setLS("Custom", t.custom); }, t.getCustom = function() { if (t.getLS("Custom")) { var e = JSON.parse(t.getLS("Custom")); if ("number" == typeof e) return e; } return 1; }, t.setHasList = function() { for (var e = [], i = 0; i < 15; i++) CF.list[i] && !CF.list[i].isGift ? e.push({ id: CF.list[i].id, variation: CF.list[i].variation }) : e.push(null); t.setLS("hasList", JSON.stringify(e)); }, t.getHasList = function() { return t.getLS("hasList") ? JSON.parse(t.getLS("hasList")) : null; }, t.setSoilList = function() { t.setLS("SoilList", JSON.stringify(t.soilList)); }, t.getSoilList = function() { return t.getLS("SoilList") ? JSON.parse(t.getLS("SoilList")) : null; }, t.setMoneyCount = function() { t.setLS("moneyCount", t.moneyCount); }, t.getMoneyCount = function() { var e = t.getLS("moneyCount") || CF.defaultMoney + ""; return Number(e); }, t.setGemCount = function() { var e = PublicFun.changeString(t.gemCount); t.setLS("GemCount", e); }, t.getGemCount = function() { var e = t.getLS("GemCount") || "0"; return Number(e); }, t.setSpeedx2 = function() { t.setLS("speedx2", t.speedx2); }, t.getSpeedx2 = function() { return t.getLS("speedx2"); }, t.setStrong = function() { t.setLS("Strong", t.strong); }, t.getStrong = function() { return t.getLS("Strong"); }, t.setUID = function(e) { t.setLS("userUID", e); }, t.getUID = function() { return t.getLS("userUID"); }, t.getUidString = function() { var e = new Date().getTime() + "_" + Math.random(); return t.isGuide = !0, t.guide = !0, e = hex_md5(e), t.setUID(e), e; }, t.guide = !1, t.userUID = t.getUID() ? t.getUID() : t.getUidString(), t.clickAD = t.getClickAD() ? t.getClickAD() : [], t.offlineTime = parseInt(t.getOfflineTime()) || Date.now(), t.speedx2 = parseInt(t.getSpeedx2()) || 0, t.strong = parseInt(t.getStrong()) || 0, t.deblocking = t.getDeblocking() ? t.getDeblocking() : [ 1, 1, 1 ], t.paling = t.getPaling(), t.custom = t.getCustom(), t.newDate = t.getNewDate(), t.dialCount = t.getDialCount(), t.bookReward = t.getBookReward() ? t.getBookReward() : [], t.isDoubleTime = !1, t; }(), Data = function() { function t() {} return t.getMonsterByid = function(e) { return t.monster[e - 1]; }, t.getCustomByid = function(e) { for (var i = 0, n = t.custom; i < n.length; i++) { var s = n[i]; if (s.id === e) return s; } return null; }, t.getFirstWaveByCustom = function(e) { for (var i = 0, n = t.custom; i < n.length; i++) { var s = n[i]; if (s.guanka === e && 1 === s.turn) return s; } return null; }, t.getPlanData = function(e) { if ("type" in e && "level" in e) return t.PlantType[e.type][e.level - 1]; if ("id" in e) for (var i = 0, n = t.plant; i < n.length; i++) { var s = n[i]; if (s.id === e.id) return s; } console.log("Data.getPlantData方法传参错误"); }, t.getValueByid = function(e) { for (var i = 0, n = t.value; i < n.length; i++) { var s = n[i]; if (s.id === e) return s; } return null; }, t.getBulletByid = function(e) { for (var i = 0, n = t.bullet; i < n.length; i++) { var s = n[i]; if (s.id === e) return s; } return null; }, t.init = function() { for (n = 0; n < CF.jsonList.length; n++) t[CF.jsonNick[n]] = JSON.parse(Laya.loader.getRes(CF.jsonList[n])), console.log(CF.jsonNick[n] + "::::", t[CF.jsonNick[n]]); for (var e = 0, i = this.plant; e < i.length; e++) { var n = i[e]; t.PlantType[n.type].push(n); } console.log(t.PlantType); }, t.dialMsg = { 1: { type: "coins", num: 1, probability: 1 }, 2: { type: "gem", num: 50, probability: .1 }, 3: { type: "coins", num: 2, probability: .2 }, 4: { type: "gem", num: 30, probability: .2 }, 5: { type: "coins", num: 1.5, probability: .5 }, 6: { type: "gem", num: 70, probability: .01 } }, t.zombiAni = { 7: [ 2, 0, 1 ], 8: [ 0, 2, 1 ], 10: [ 2, 0, 1 ], 11: [ 2, 0, 1 ], 12: [ 2, 0, 1 ], 13: [ 2, 0, 1 ], 14: [ 2, 0, 1 ], 15: [ 2, 0, 1 ], 16: [ 2, 0, 1 ], 17: [ 2, 0, 1 ], 18: [ 3, 0, 2, 1 ], 19: [ 2, 0, 1 ], 20: [ 2, 0, 1 ], 21: [ 2, 0, 1 ], 22: [ 2, 0, 1 ] }, t.PlantType = { 1: [], 2: [], 3: [] }, t; }(), __extends = this && this.__extends || function() { var t = function(e, i) { return (t = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, e) { t.__proto__ = e; } || function(t, e) { for (var i in e) e.hasOwnProperty(i) && (t[i] = e[i]); })(e, i); }; return function(e, i) { function n() { this.constructor = e; } t(e, i), e.prototype = null === i ? Object.create(i) : (n.prototype = i.prototype, new n()); }; }(), Boom = function(t) { function e() { var e = t.call(this) || this; return e.anchorX = .5, e.anchorY = .5, e; } return __extends(e, t), e.prototype.start = function(t, i, n, s) { void 0 === i && (i = null), void 0 === n && (n = 0), void 0 === s && (s = 1), this.index = 1, this.skin = "bullet/" + t + "01.png", this.nick = t, this.cb = i, this.rotation = n, this.len = e.src[t], this.scale(s, s), t in e.src || console.log("没有动画名:::", t), Laya.timer.loop(100, this, this.change); }, e.prototype.change = function() { this.index++, this.index > this.len ? (Laya.timer.clearAll(this), this.cb && this.cb(), this.del()) : this.skin = "bullet/" + this.nick + (this.index <= 9 ? "0" + this.index : this.index) + ".png"; }, e.prototype.del = function() { this.removeSelf(), Laya.Pool.recover("boom", this); }, e.create = function(t, i, n, s, a) { void 0 === n && (n = null), void 0 === s && (s = 0), void 0 === a && (a = 1); var r = Laya.Pool.getItemByClass("boom", e); Catalog._MAIN_SCENE.bullet_sp.addChild(r), r.pos(t.x, t.y), r.start(i, n, s, a); }, e.src = { wandou: 3, jiansu: 4, baocai: 7, ci: 4, guazi: 3, huluobo: 3, juhua: 3, lajiao: 3, lianzi: 3, luhui: 3, "o-baozha": 7, pingguo: 8, "p-shirenhua": 3, pugongying: 3, "r-guozhi": 6, sanyecao: 3, shiliu: 3, shirenhua: 3, suan: 3, "w-guozhi": 6, xiangjiao: 3, xilanhua: 3, "y-baozha": 7, "y-guozhi": 6, yinfu: 4, yumi: 3, "z-baozha": 7, juqi: 6, fq: 12, db: 7, heidong: 8, car2Shinning02_00: 6, starRockBoom: 7 }, e; }(Laya.Image), __extends = this && this.__extends || function() { var t = function(e, i) { return (t = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, e) { t.__proto__ = e; } || function(t, e) { for (var i in e) e.hasOwnProperty(i) && (t[i] = e[i]); })(e, i); }; return function(e, i) { function n() { this.constructor = e; } t(e, i), e.prototype = null === i ? Object.create(i) : (n.prototype = i.prototype, new n()); }; }(), Bullet = function(t) { function e() { var e = t.call(this) || this; return e.zombiList = [], e.anchorX = .5, e.anchorY = .5, e.hitR = new Rectangle(), e.setBounds(e.hitR), e; } return __extends(e, t), e.prototype.init = function(t, e, i, n) { void 0 === n && (n = 0), this.id = t; var s = Data.getBulletByid(t); this.data = s, this.variation = i, this.speed = s.speed, this.skin = "bullet/" + s.pic + ".png", this.ro = n, this.rotation = n, this.move_time = Date.now(), this.line = e, this.zombiList.length = 0, this.up = 1, this.hitR.setTo(0, 0, this.width, this.height); }, e.prototype.getHurt = function() { var t = this.data.dps; this.zombiList.length > 1 && this.data.chuantou > 0 && (t *= this.data.chuantou); var e = { count: t, delay: null, poison: null, circular: this.data.circular, die: !1, frozen: null }; if ("0" !== this.data.frozen) { (n = this.data.frozen.split(",").map(function(t) { return Number(t); })).length > 2 && Math.random() < n[2] ? e.frozen = n[3] : e.delay = { trigger: !0, value: n[0], time: n[1] }; } if (0 != this.variation) { var i = Data.variation[this.variation - 1]; switch (this.variation) { case 2: e.count *= i.attack; break; case 3: if (e.delay) break; n = i.frozen.split(",").map(function(t) { return Number(t); }); Math.random() < n[2] && (e.delay = { trigger: !0, value: n[0], time: n[1] }); break; case 4: var n = i.poisoning.split(",").map(function(t) { return Number(t); }); Math.random() < n[4] && (e.poison = { trigger: !0, value: n[0], time: n[2] }); break; case 5: Math.random() < i.die && (e.die = !0); } } return e; }, e.prototype.towRay = function() { for (var t = this.data.towRay.split(",").map(function(t) { return Number(t); }), i = 1 == t[1] ? 0 : t[0] / (t[1] - 1), n = 90 - i * (t[1] - 1) / 2, s = -90 - i * (t[1] - 1) / 2, a = 0; a < 2 * t[1]; a++) { var r = a < t[1], o = Laya.Pool.getItemByClass("bullet", e); o.pos(this.x, this.y), o.init(t[2], -1, 0, r ? n : s), o.zombiList.push(this.zombiList[0]), Catalog._MAIN_SCENE.bullet_sp.addChild(o), r ? n += i : s += i; } }, e.prototype.del = function() { this.removeSelf(), Laya.Pool.recover("bullet", this); }, e.create = function(t, i, n, s, a, r) { void 0 === r && (r = 0); var o = Laya.Pool.getItemByClass("bullet", e); return o.pos(t, i), o.init(n, s, a, r), Catalog._MAIN_SCENE.bullet_sp.addChild(o), o; }, e.getColorArray = function(t) { t = t.split("0x")[1]; return [ Number("0x" + t[0] + t[1]) / 255, 0, 0, 0, 0, Number("0x" + t[2] + t[3]) / 255, 0, 0, 0, 0, Number("0x" + t[4] + t[5]) / 255, 0, 0, 0, 0, 0, 0, 0, .1, 0 ]; }, e; }(Laya.Image), __extends = this && this.__extends || function() { var t = function(e, i) { return (t = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, e) { t.__proto__ = e; } || function(t, e) { for (var i in e) e.hasOwnProperty(i) && (t[i] = e[i]); })(e, i); }; return function(e, i) { function n() { this.constructor = e; } t(e, i), e.prototype = null === i ? Object.create(i) : (n.prototype = i.prototype, new n()); }; }(), Coins = function(t) { function e() { var e = t.call(this) || this; return e.skin = "img/zwujs_icon_jinbi1.png", e.size(52, 54), e.anchorX = .5, e.anchorY = 1, e; } return __extends(e, t), e.prototype.start = function() { Tween.to(this, { x: 72, y: 81 }, 500, Ease.backIn, Handler.create(this, this.del)); }, e.prototype.del = function() { this.removeSelf(), Laya.Pool.recover("coins", this); }, e; }(Laya.Image), __extends = this && this.__extends || function() { var t = function(e, i) { return (t = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, e) { t.__proto__ = e; } || function(t, e) { for (var i in e) e.hasOwnProperty(i) && (t[i] = e[i]); })(e, i); }; return function(e, i) { function n() { this.constructor = e; } t(e, i), e.prototype = null === i ? Object.create(i) : (n.prototype = i.prototype, new n()); }; }(), Gift = function(t) { function e() { var e = t.call(this) || this; e.isGift = !0; var i = new Img("img/zwujs_img_guangq.png"); e.addChild(i), i.scale(.3, .3).pos(0, -47), i.anchorX = .5, i.anchorY = .5; var n = new Img("img/zwujs_icon_huaplw.png"); e.addChild(n), n.size(98, 90).y = 10, n.anchorX = .5, n.anchorY = 1, e.img = n; var s = new Timeline(); return s.to(i, { rotation: 360 }, 2e3), s.play(0, !0), n.on(_Event.CLICK, e, function() { if (this.isBox) Catalog._MAIN_SCENE.hasBox = !1; else { var t = CF.list.indexOf(this); if (t < 0) return; CF.list[t] = null; } Catalog._GIFT_SCENE.play(!this.isBox), this.del(); }), e; } return __extends(e, t), e.prototype.del = function() { this.removeSelf(), Laya.Pool.recover("gift", this); }, e.create = function(t) { if (void 0 === t && (t = !0), t) for (var i = 0; i < CF.list.length; i++) { var n = Catalog._MAIN_SCENE["bt_" + (i + 1)], s = n.getChildByName("btn"); if (null == CF.list[i] && n.visible && (!s || s && !s.visible)) { a = Laya.Pool.getItemByClass("gift", e); return Catalog._MAIN_SCENE.bottom_sp.addChild(a), CF.list[i] = a, a.isBox = !1, a.img.skin = "img/zwujs_icon_huaplw.png", void Catalog._MAIN_SCENE.getPosition(i); } } else { console.log("createcreate"), Catalog._MAIN_SCENE.hasBox = !0; var a = Laya.Pool.getItemByClass("gift", e); Catalog._MAIN_SCENE.top.addChild(a), a.isBox = !0, a.pos(375, 200), a.img.skin = "img/nczjs_img_gwubox.png", Tween.to(a, { y: 600 }, 500, Ease.sineIn); } }, e; }(Sprite), __extends = this && this.__extends || function() { var t = function(e, i) { return (t = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, e) { t.__proto__ = e; } || function(t, e) { for (var i in e) e.hasOwnProperty(i) && (t[i] = e[i]); })(e, i); }; return function(e, i) { function n() { this.constructor = e; } t(e, i), e.prototype = null === i ? Object.create(i) : (n.prototype = i.prototype, new n()); }; }(), Laser = function(t) { function e() { var e = t.call(this) || this; return e.anchorX = .5, e.anchorY = 1, e.size(33, 1334), e; } return __extends(e, t), e.prototype.start = function(t) { var e = this; this.skin = "bullet/" + t + ".png", this.width = 33, Tween.to(this, { width: 0 }, 300, null, Handler.create(this, function() { e.del(); }), 300); }, e.prototype.del = function() { this.removeSelf(), Laya.Pool.recover("laser", this); }, e.create = function(t, i) { var n = Laya.Pool.getItemByClass("laser", e); Catalog._MAIN_SCENE.bullet_sp.addChild(n), n.pos(t.x, t.y), n.start(i); }, e; }(Laya.Image), __extends = this && this.__extends || function() { var t = function(e, i) { return (t = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, e) { t.__proto__ = e; } || function(t, e) { for (var i in e) e.hasOwnProperty(i) && (t[i] = e[i]); })(e, i); }; return function(e, i) { function n() { this.constructor = e; } t(e, i), e.prototype = null === i ? Object.create(i) : (n.prototype = i.prototype, new n()); }; }(), Msg = function(t) { function e() { var e = t.call(this) || this; return e.skin = "img/zwujs_kuan_phlbdi2.png", e.sizeGrid = "18,20,18,18", e.size(600, 100), e.tx = new Laya.Text(), e.addChild(e.tx), e.tx.size(600, 100), e.tx.fontSize = 50, e.tx.color = "#7c340b", e.tx.align = "center", e.tx.valign = "middle", e; } return __extends(e, t), e.prototype.start = function(t) { Catalog._MAIN_SCENE.addChild(this), this.pos(75, 650), this.tx.text = t, Tween.to(this, { y: 600 }, 500, Ease.sineIn, Handler.create(this, this.del), 500); }, e.prototype.del = function() { this.removeSelf(), Laya.Pool.recover("msg", this); }, e.post = function(t) { Laya.Pool.getItemByClass("msg", e).start(t); }, e; }(Laya.Image), __extends = this && this.__extends || function() { var t = function(e, i) { return (t = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, e) { t.__proto__ = e; } || function(t, e) { for (var i in e) e.hasOwnProperty(i) && (t[i] = e[i]); })(e, i); }; return function(e, i) { function n() { this.constructor = e; } t(e, i), e.prototype = null === i ? Object.create(i) : (n.prototype = i.prototype, new n()); }; }(), Plant = function(t) { function e() { var e = t.call(this) || this; e.buff_atkspeed = { time: 0, value: 0 }, e.anchorX = .5, e.anchorY = 1, e.scale(.9, .9), e.addEvent(), e.addAttackAni(), e.v_icon = new Img(), e.v_icon.centerX = 0, e.v_icon.bottom = 10, e.addChild(e.v_icon), e.buff_ani = new Laya.Animation(), e.addChild(e.buff_ani); for (var i = [], n = 1; n <= 6; n++) i.push("skill/qianghua0" + n + ".png"); e.buff_ani.loadImages(i), e.buff_ani.interval = 100, e.buff_ani.pivot(60, 92), e.buff_ani.play(0, !0), e.buff_kb = new Laya.Animation(), e.addChild(e.buff_kb); for (n = 1; n <= 4; n++) i.push("skill/kuangbao0" + n + ".png"); return e.buff_kb.loadImages([]), e.buff_kb.interval = 100, e.buff_kb.pivot(60, 92), e.buff_kb.play(0, !0), e; } return __extends(e, t), e.prototype.init = function(t, e, i, n) { void 0 === n && (n = !1), this.id = t, this.index = e, this.isGift = n, this.buff_atkspeed.time = 0, this.buff_atkspeed.value = 0, this.buff_ani.visible = !1, CF.buff_kbspeed.time = 0, CF.buff_kbspeed.value = 0, this.buff_kb.visible = !1, this.variation = i, this.a_count = 0, n && Laya.timer.once(5e3, this, this.change), this.updateShow(); }, e.prototype.change = function() {}, e.prototype.addEvent = function() { var t = this; t.on(_Event.MOUSE_DOWN, Catalog._MAIN_SCENE, function(e) { if (!t.ani && !t.isGift) { t.ani = !0; var i = e.target, n = i.x, s = i.y; t.zOrder = ++Catalog._MAIN_SCENE.z_index, t.startDrag(null, !1, 0, 0, { obj: i, x: n, y: s }), CF.list.forEach(function(e, i) { e && e.id == t.id && i != t.index && !e.isGift && (Catalog._MAIN_SCENE["bt_" + (i + 1)].getChildByName("ray").visible = !0); }); } }), t.on(_Event.MOUSE_UP, Catalog._MAIN_SCENE, function(e) { t.isGift || (t.ani = !1, Catalog._MAIN_SCENE.closeBt()); }), t.on(_Event.DRAG_END, Catalog._MAIN_SCENE, function(e) { t.ani = !1, Catalog._MAIN_SCENE.closeBt(); var i, n = new Rectangle(Catalog._MAIN_SCENE.img_del.x, Catalog._MAIN_SCENE.img_del.y, Catalog._MAIN_SCENE.img_del.width, Catalog._MAIN_SCENE.img_del.height), s = t.getBounds(); if (Catalog._MAIN_SCENE.bottomList.some(function(e, n) { var a = e.getChildByName("btn"); if (!e.visible || e.visible && a && a.visible) return !1; var r = e.getBounds().intersection(s); return !!(r && n != t.index && r.width * r.height > 6e3) && (i = n, !0); })) { if (CF.list[i] && (CF.list[i].ani || CF.list[i].isGift)) return void t.pos(e.x, e.y); if (CF.list[i] && CF.list[t.index].id == CF.list[i].id) t.level < CF.maxLevel[t.type - 1] ? (Catalog._MAIN_SCENE.guide2.visible && (Catalog._MAIN_SCENE.guide2.visible = !1, LocalStorage.isGuide = !1, Catalog._MAIN_SCENE.play()), Laya.SoundManager.playSound("sound/hecheng.mp3", 1), t.ani = !0, CF.list[i].ani = !0, t.pos(CF.list[i].x, CF.list[i].y), Tween.to(t, { x: t.x + 40 }, 200, null, Handler.create(Catalog._MAIN_SCENE, function() { Tween.to(t, { x: t.x - 40 }, 200); })), Boom.create({ x: CF.list[i].x, y: CF.list[i].y - 50 }, "car2Shinning02_00", null, 0, 2), Tween.to(CF.list[i], { x: CF.list[i].x - 40 }, 200, null, Handler.create(Catalog._MAIN_SCENE, function() { Tween.to(CF.list[i], { x: CF.list[i].x + 40 }, 200, null, Handler.create(Catalog._MAIN_SCENE, function() { CF.list[i].level++; var e = Data.getPlanData({ type: CF.list[i].type, level: CF.list[i].level }).id; CF.list[i].id = e, CF.list[i].variation = 0, Catalog._MAIN_SCENE.updateDress(i), CF.list[t.index] = null, t.ani = !1, t.del(), LocalStorage.setHasList(), Catalog._LEVELUP_SCENE.play(i), CF.list[i].ani = !1, CF.list[i].level > LocalStorage.deblocking[CF.list[i].type - 1] ? (LocalStorage.deblocking[CF.list[i].type - 1] = CF.list[i].level, LocalStorage.setDeblocking(), CF.list[i].level < CF.maxLevel[t.type - 1] - 5 && Math.random() < CF.superLevelRadom ? (Catalog._SUPERUNLOCK_SCENE.play(i), Catalog._MAIN_SCENE.updateBuyBtn()) : (Catalog._UNLOCKED_SCENE.play(CF.list[i].level, CF.list[i].type), Catalog._MAIN_SCENE.updateBuyBtn())) : CF.list[i].startVariation(); })); }))) : t.pos(e.x, e.y); else if (null != CF.list[i]) { var a = t.id, r = t.variation, o = t.buff_atkspeed; t.id = CF.list[i].id, t.variation = CF.list[i].variation, t.buff_atkspeed = CF.list[i].buff_atkspeed, CF.list[i].id = a, CF.list[i].variation = r, CF.list[i].buff_atkspeed = o, Catalog._MAIN_SCENE.updateDress(t.index), Catalog._MAIN_SCENE.updateDress(i), t.pos(e.x, e.y); } else CF.list[t.index] = null, t.index = i, CF.list[i] = t, Catalog._MAIN_SCENE.getPosition(i); LocalStorage.setHasList(); } else if (n.intersection(s)) if (n.intersection(s).width * n.intersection(s).height > 5e3) { CF.list[t.index] = null, t.del(); var h = Data.getPlanData({ level: t.level, type: t.type }).sale; Catalog._MAIN_SCENE.changeMoney(h), Msg.post("Coins +" + PublicFun.changeString(h)), LocalStorage.setHasList(); } else t.pos(e.x, e.y); else t.pos(e.x, e.y); }), t.on(_Event.CLICK, this, function() { this.isGift && this.change(); }); }, e.prototype.updateShow = function() { if(window.start_game == 0){ console.log("玩家进入") window.start_game++ window['uptap'].GameEvent("start_game",window.start_game); } var t = Data.getPlanData({ id: this.id }); this.level = t.level, this.type = t.type, this.data = t, this.others = t.others.split(",").map(function(t) { return Number(t); }), this.cd = 1e3 * t.attackGap, this.attack_range = t.range, this.skin = "flower/" + t.pic + ".png", this.buff_ani.pos(.5 * this.width, .5 * this.height), this.buff_kb.pos(.5 * this.width, .5 * this.height), this.v_icon.skin = 0 === this.variation ? "" : "img/nczjs_icon_tsbji" + this.variation + ".png", this.attack_time_old = Date.now(), this.attack_time = 0; }, e.prototype.startVariation = function() { for (var t = Math.random(), e = 0, i = 0, n = 0, s = this.data.bianyi.split(";").map(function(t) { return t.split(",").map(function(t) { return Number(t); }); }); n < s.length; n++) { var a = s[n]; if (e += .01 * a[0], t < e) { i = a[1]; break; } } this.variation = i, 0 != i && Catalog._VARIATION_SCENE.play(this.skin, "img/nczjs_icon_tsbji" + i + ".png"), this.updateShow(); }, e.prototype.addAttackAni = function() { var t = new TimeLine(); t.to(this, { scaleY: .7 }, 200).addLabel("a", 0).to(this, { scaleY: .9 }, 200), this.attack_ani = t, t.on(_Event.LABEL, this, function(t) { Laya.SoundManager.playSound("sound/hit.mp3", 1); }); }, e.prototype.attack = function() { var t = this; this.attack_time = 0, this.attack_ani.play(0, !1); var i = 0, n = [ 1, 0 ]; "0" != this.data.colCount && (n = this.data.colCount.split(",").map(function(t) { return Number(t); })); var s = this.id; this.a_count++; var a = Data.getBulletByid(this.data.shellid); if ("db" !== a.effect_Hit) if (this.others[0] > 0 && this.a_count > this.others[0]) { this.a_count = 0; var r = Data.getBulletByid(this.others[1]); "juqi" === r.effect_Hit ? (this.ani = !0, Boom.create({ x: this.x, y: this.y - this.height }, "juqi", function() { for (var e = 0, i = Catalog._MAIN_SCENE.zombiList; e < i.length; e++) { var n = i[e]; n.die || n.y > 0 && n.line === t.index % 5 + 1 && n.hit({ count: r.dps, die: !1, poison: null, delay: null, circular: 0 }); } Laser.create({ x: t.x, y: t.y - t.height + 30 }, r.pic), t.ani = !1; })) : Bullet.create(this.x, this.y - this.height, this.others[1], this.index % 5 + 1, this.variation); } else for (_ = 0; _ < n[0]; _++) Laya.timer.once(1e3 * i, this, function() { if (t.id == s) if (1 === t.data.channel) if ("0" != t.data.ray) for (var e = t.data.ray.split(",").map(function(t) { return Number(t); }), i = -(e[1] - 1) / 2 * e[0] / e[1], n = 0; n < e[1]; n++) Bullet.create(t.x, t.y - t.height, t.data.shellid, -1, t.variation, i), i += e[0] / e[1]; else Bullet.create(t.x, t.y - t.height, t.data.shellid, t.index % 5 + 1, t.variation); else for (n = 0; n < t.data.channel; n++) { var a = Bullet.create(t.x, t.y - t.height, t.data.shellid, t.index % 5 + n, t.variation); Tween.to(a, { x: a.x + 146 * (n - 1) }, 300); } }), i += n[1]; else for (var o = a.atkspeed.split(",").map(function(t) { return Number(t); }), h = 3 == o[2] ? -90 : 0, l = 2 == o[2] ? 180 : 90, u = function(t) { var i = e.buff_pos[h], n = c.index, s = n + i.i; Boom.create({ x: c.x + c.width * i.w, y: c.y + c.height * i.h }, "db", function() { if (s < CF.list.length && s >= 0) { if (n % 5 == 0 && -1 === i.i) return; if ((n + 1) % 5 == 0 && 1 === i.i) return; CF.list[s] && CF.list[s].buff_atkspeed.time < 1e3 * o[1] && (CF.list[s].buff_atkspeed.time = 1e3 * o[1], CF.list[s].buff_atkspeed.value = o[0]); } }, h), h += l; }, c = this, _ = 0; _ < o[2]; _++) u(); }, e.prototype.del = function() { this.removeSelf(), Laya.timer.clearAll(this), Laya.Pool.recover("plant", this); }, e.buff_v = .3, e.buff_pos = { 0: { w: 0, h: -(1 + e.buff_v), i: 5 }, 90: { w: .5 + e.buff_v, h: -.5, i: 1 }, 180: { w: 0, h: e.buff_v, i: -5 }, 270: { w: -(.5 + e.buff_v), h: -.5, i: -1 }, "-90": { w: -(.5 + e.buff_v), h: -.5, i: -1 } }, e; }(Img), __extends = this && this.__extends || function() { var t = function(e, i) { return (t = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, e) { t.__proto__ = e; } || function(t, e) { for (var i in e) e.hasOwnProperty(i) && (t[i] = e[i]); })(e, i); }; return function(e, i) { function n() { this.constructor = e; } t(e, i), e.prototype = null === i ? Object.create(i) : (n.prototype = i.prototype, new n()); }; }(), Rock = function(t) { function e() { for (var e = t.call(this) || this, i = [], n = 1; n <= 4; n++) i.push("skill/starRock0" + n + ".png"); return e.loadImages(i), e.play(0, !0), e.interval = 100, e.pivot(60, 230), e; } return __extends(e, t), e.prototype.start = function() { var t = this; Laya.Tween.to(this, { y: this.y + 400 + 100 * Math.random() }, 500, null, Handler.create(this, function() { Boom.create({ x: t.x, y: t.y }, "starRockBoom"), t.del(); })); }, e.prototype.del = function() { Laya.timer.clearAll(this), this.removeSelf(), Laya.Pool.recover("rock", this); }, e.create = function(t) { var i = Laya.Pool.getItemByClass("rock", e); Catalog._MAIN_SCENE.bullet_sp.addChild(i), i.pos(t.x, t.y), i.start(); }, e; }(Laya.Animation), __extends = this && this.__extends || function() { var t = function(e, i) { return (t = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, e) { t.__proto__ = e; } || function(t, e) { for (var i in e) e.hasOwnProperty(i) && (t[i] = e[i]); })(e, i); }; return function(e, i) { function n() { this.constructor = e; } t(e, i), e.prototype = null === i ? Object.create(i) : (n.prototype = i.prototype, new n()); }; }(), Wind = function(t) { function e() { var e = t.call(this) || this; return e.len = 12, e.anchorX = .5, e.anchorY = .5, e; } return __extends(e, t), e.prototype.start = function(t) { this.index = 1, this.att = 0, this.ac = 0, this.skin = "bullet/fq01.png", this.list = String(t).split("0").map(function(t) { return Number(t); }), Laya.timer.loop(100, this, this.change); }, e.prototype.change = function() { this.index++, this.ac++, this.skin = "bullet/fq" + (this.index <= 9 ? "0" + this.index : this.index) + ".png", this.index %= this.len, this.ac % 10 == 0 && (this.attack(), this.att >= this.list.length && this.del()); }, e.prototype.attack = function() { if (!(this.att >= this.list.length)) { for (var t = 0, e = Catalog._MAIN_SCENE.zombiList; t < e.length; t++) { var i = e[t]; i.die || Math.pow(this.x - i.x, 2) + Math.pow(this.y - i.y, 2) < Math.pow(CF.circularRadius, 2) && i.hit({ count: this.list[this.att], delay: null, die: !1, poison: null, circular: 0 }); } this.att++; } }, e.prototype.del = function() { Laya.timer.clearAll(this), this.removeSelf(), Laya.Pool.recover("wind", this); }, e.create = function(t, i) { var n = Laya.Pool.getItemByClass("wind", e); Catalog._MAIN_SCENE.bullet_sp.addChild(n), n.pos(t.x, t.y), n.start(i); }, e; }(Laya.Image), __extends = this && this.__extends || function() { var t = function(e, i) { return (t = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, e) { t.__proto__ = e; } || function(t, e) { for (var i in e) e.hasOwnProperty(i) && (t[i] = e[i]); })(e, i); }; return function(e, i) { function n() { this.constructor = e; } t(e, i), e.prototype = null === i ? Object.create(i) : (n.prototype = i.prototype, new n()); }; }(), Zombi = function(t) { function e() { var i = t.call(this) || this; i.lens = [], i.delay = .8, i.addSmog(), i.sksp = new Sprite(), i.addChild(i.sksp), i.blood_bottom = new Img("img/zwujs_jindt_xuet1.png"), i.addChild(i.blood_bottom), i.blood_bottom.pos(0, -150), i.blood_bottom.sizeGrid = "6,10,6,10", i.blood_bottom.anchorX = .5, i.blood_bottom.size(100, 16), i.blood_top = new Img("img/zwujs_jindt_xuet3.png"), i.blood_bottom.addChild(i.blood_top), i.blood_top.sizeGrid = "4,8,8,10", i.blood_top.size(100, 16), i.shield_bottom = new Img("img/zwujs_jindt_xuet1.png"), i.addChild(i.shield_bottom), i.shield_bottom.pos(0, -170), i.shield_bottom.sizeGrid = "6,10,6,10", i.shield_bottom.anchorX = .5, i.shield_bottom.size(100, 16), i.shield_top = new Img("img/zwujs_kuan_boshei2.png"), i.shield_bottom.addChild(i.shield_top), i.shield_top.sizeGrid = "10,8,8,10", i.shield_top.size(100, 16), i.lens.push(new Laya.ColorFilter(e.getColorList(CF.skillMsg.slow_color, CF.skillMsg.slow_alpha))), i.lens.push(new Laya.ColorFilter(e.getColorList(CF.skillMsg.frozen_color, CF.skillMsg.frozen_alpha))), i.hitR = new Rectangle(-58, -132, 117, 138), i.setBounds(i.hitR), i.shieldAni = new Laya.Animation(), i.addChild(i.shieldAni); for (var n = [], s = 1; s <= 6; s++) n.push("skill/hudun0" + s + ".png"); return i.shieldAni.loadImages(n), i.shieldAni.pos(-150, -235), i.shieldAni.play(0, !0), i.shieldAni.interval = 150, i.frozenAni = new Img(), i.addChild(i.frozenAni), i.frozenAni.anchorX = .5, i.frozenAni.anchorY = 1, i; } return __extends(e, t), e.prototype.addSmog = function() { var t = this; this.smog = new Laya.Image("skill/MotoSmoke01.png"), this.addChild(this.smog), this.smog.anchorX = .5, this.smog.anchorY = 1, this.smog.pos(0, -100); var e = 1; Laya.timer.loop(100, Catalog._MAIN_SCENE, function() { e %= 7, e++, t.smog.skin = "skill/MotoSmoke0" + e + ".png"; }); }, e.prototype.init = function(t, i, n, s) { void 0 === s && (s = 0), this.id = t, this.isS = !1, this.attack_old = 0, this.alpha = 1; var a = Date.now(); this.skill = { invisible_time: a, invisible: 0, invisible_value: 0, flash_time: a }, this.die = !1, this.shield_bottom.visible = !1, this.shieldAni.visible = !1, this.frozenAni.visible = !1; var r = Data.getValueByid(t); this.data = r, this.blood_bottom.y = 1 == r.isBoss ? -300 : -150, "0" != r.invisible && (this.skill.invisible_value = 1e3 * Number(r.invisible.split(",")[0])), this.nick = a + Math.random().toString(), this.skin_id = r.monsterid, this.setBounds(e.zombiHit[this.skin_id]); var o = Data.getMonsterByid(this.skin_id); this.skin_data = o, this.blood = (0 == i ? this.data.hp : i) * o.hpratio, this.bloodMax = this.blood, this.blood_top.width = this.blood_bottom.width, this.shield = 0, this.shield_top.width = this.shield_bottom.width, this.smog.visible = r.smog > 0, this.money = r.money, this.line = n, this.speed = r.speed, this.delay_time = 0, this.poison_time = 0, this.frozen = 0, this.updateShow(), this.pos(e.posX[n - 1], s); }, e.prototype.updateShow = function() { this.skeleton && this.skeleton.destroy && (this.skeleton.destroy(), this.skeleton = null), this.addTem(), this.addAni(1); }, e.prototype.changeBlood = function(t) { if (t < 0 && this.shield > 0) { if (this.shield > -1 * t) return this.shield += t, void (this.shield_top.width = this.shield / this.shieldMax * this.shield_bottom.width); t += this.shield, this.shield = 0, this.shield_bottom.visible = !1; } this.blood += t, this.blood = Math.min(this.blood, this.bloodMax), this.blood = Math.max(this.blood, 0), this.blood_top.width = this.blood / this.bloodMax * this.blood_bottom.width; }, e.prototype.startFrozen = function() { var t = this; this.frozenAni.visible = !0, this.frozenAni.skin = "skill/Bingdong_00001.png"; for (var e = function(e) { Laya.timer.once(100 * e - 100, i, function() { t.frozenAni.skin = "skill/Bingdong_0000" + e + ".png"; }); }, i = this, n = 1; n <= 8; n++) e(n); }, e.prototype.addTem = function() { var t = this; this.templete = new Laya.Templet(), this.templete.on(_Event.COMPLETE, this, function() { t.skeleton = t.templete.buildArmature(1), t.skeleton.pos(0, 0), t.skeleton.scale(t.data.big, t.data.big), t.sksp.addChild(t.skeleton), t.skeleton.play(Data.zombiAni[t.skin_id][0], !0), t.skeleton.playbackRate(2); }); }, e.prototype.addAni = function(t) { this.skeleton ? (this.skeleton.playbackRate(3 == t ? 1 : 2), this.skeleton.play(Data.zombiAni[this.skin_id][t], 0 == t, !1), 0 != t && this.skeleton.once(_Event.STOPPED, this, this.anicallback, [ t ])) : this.templete.loadAni("sk/" + this.skin_data.bone + ".sk"); }, e.prototype.anicallback = function(t) { if (1 == t) this.attack(), this.addAni(0); else if (2 == t) { if (CF.curJbsbTime ? Catalog._MAIN_SCENE.changeMoney(2 * this.money) : Catalog._MAIN_SCENE.changeMoney(this.money * (LocalStorage.speedx2 > 0 ? CF.doubleCount + 1 : 1)), Catalog._MAIN_SCENE.createCoins(Math.ceil(2 * Math.random() + 1), this.x, this.y, !0), this.data.fission > 0) for (var i = this.y, n = this.data.fissionID, s = this.data.fission, a = this.line, r = 0; r < s; r++) { var o = Laya.Pool.getItemByClass("zombi", e); Catalog._MAIN_SCENE.zombi_sp.addChild(o), Catalog._MAIN_SCENE.zombiList.push(o), o.init(n, 0, 2 == s ? a : Math.min(a + Math.max(Math.floor(3 * Math.random()) - 1, 1), 5), i - 50 * Math.random()), o.start(); } if (this.data.shieldCount > 0) for (var h = this.data.shieldCount, l = 0, u = Catalog._MAIN_SCENE.zombiList; l < u.length; l++) { if (this !== (r = u[l]) && !r.die && 0 == r.data.isBoss && (r.shield <= 0 && (r.shieldMax = this.data.shieldHP * r.bloodMax, r.shield = this.data.shieldHP * r.bloodMax, --h <= 0))) break; } Catalog._MAIN_SCENE.hasBox || Math.random() < .5 && Gift.create(!1), this.del(), 0 === Catalog._MAIN_SCENE.zombi_sp._childs.length && Catalog._MAIN_SCENE.next(); } else 3 == t && (this.line = (Math.floor(4 * Math.random()) + 1 + this.line - 1) % 5 + 1, this.x = e.posX[this.line - 1], this.alpha = 1, this.addAni(0)); }, e.prototype.start = function() { this.move_time = Date.now(), this.isS = !0; }, e.prototype.hit = function(t) { var e = this; if (this.die) return !0; if (1 != this.alpha) return !1; if (Laya.SoundManager.playSound("sound/hit.mp3", 1), this.changeBlood(-1 * t.count), t.circular > 0) for (var i = 0, n = Catalog._MAIN_SCENE.zombiList; i < n.length; i++) { var s = n[i]; this === s || s.die || Math.pow(this.x - s.x, 2) + Math.pow(this.y - s.y, 2) < Math.pow(CF.circularRadius, 2) && s.hit({ count: t.circular, delay: null, die: !1, poison: null, circular: 0 }); } if (this.blood <= 0 || t.die) return this.die = !0, this.addAni(2), !0; if (t.delay && t.delay.trigger) { a = t.delay; Laya.SoundManager.playSound("sound/slow.mp3", 1), this.delay_time = Math.max(this.delay_time, 1e3 * a.time), this.delay = a.value, console.log("减速,效果:" + a.value + ",时间:" + a.time); } if ("frozen" in t && (this.startFrozen(), this.frozen += 1e3 * t.frozen), t.poison && t.poison.trigger && this.poison_time <= 0) { var a = t.poison; this.poison_time = 1e3 * a.time, this.poison = a.value, Laya.timer.once(1e3, this, function() { e.changeBlood(-1 * e.bloodMax * e.poison), Laya.timer.once(1e3, e, function() { e.changeBlood(-1 * e.bloodMax * e.poison); }); }); } }, e.prototype.attack = function() { this.die || (Catalog._MAIN_SCENE.paling.filters = [ Catalog._MAIN_SCENE.paling_red ], Laya.timer.once(200, Catalog._MAIN_SCENE, function() { Catalog._MAIN_SCENE.paling.filters = []; }), Catalog._MAIN_SCENE.changeBlood(-1)); }, e.prototype.del = function() { this.skeleton && this.skeleton.destroy && (this.skeleton.destroy(), this.skeleton = null), this.removeSelf(), Laya.timer.clearAll(this), Laya.Pool.recover("zombi", this); }, e.getColorList = function(t, e) { for (t = (t = t.split("#")[1]).toLowerCase(); t.length < 6; ) t += "f"; return [ Number("0x" + t[0] + t[1]) / 255, 0, 0, 0, 0, Number("0x" + t[2] + t[3]) / 255, 0, 0, 0, 0, Number("0x" + t[4] + t[5]) / 255, 0, 0, 0, 0, 0, 0, 0, e, 0 ]; }, e.posX = [ 78, 224, 370, 516, 662 ], e.zombiHit = { 7: new Rectangle(-58, -178, 117, 184), 8: new Rectangle(-36, -103, 74, 100), 10: new Rectangle(-65, -156, 126, 155), 11: new Rectangle(-123, -143, 238, 142), 12: new Rectangle(-59, -183, 118, 184), 13: new Rectangle(-51, -130, 102, 134), 14: new Rectangle(-51, -130, 102, 134), 15: new Rectangle(-51, -130, 102, 134), 16: new Rectangle(-51, -130, 102, 134), 17: new Rectangle(-135, -295, 272, 291), 18: new Rectangle(-71, -162, 159, 146), 19: new Rectangle(-71, -162, 159, 146), 20: new Rectangle(-71, -162, 159, 146), 21: new Rectangle(-71, -150, 159, 146), 22: new Rectangle(-71, -150, 159, 146) }, e; }(Sprite), __extends = this && this.__extends || function() { var t = function(e, i) { return (t = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, e) { t.__proto__ = e; } || function(t, e) { for (var i in e) e.hasOwnProperty(i) && (t[i] = e[i]); })(e, i); }; return function(e, i) { function n() { this.constructor = e; } t(e, i), e.prototype = null === i ? Object.create(i) : (n.prototype = i.prototype, new n()); }; }(), View = laya.ui.View, Dialog = laya.ui.Dialog; !function(t) { var e = function(e) { function i() { return e.call(this) || this; } return __extends(i, e), i.prototype.createChildren = function() { e.prototype.createChildren.call(this), this.createView(t.aboutUI.uiView); }, i.uiView = { type: "View", props: { width: 750, mouseThrough: !0, height: 1334 } }, i; }(View); t.aboutUI = e; }(ui || (ui = {})), function(t) { var e = function(e) { function i() { return e.call(this) || this; } return __extends(i, e), i.prototype.createChildren = function() { View.regComponent("Text", laya.display.Text), e.prototype.createChildren.call(this), this.createView(t.addUI.uiView); }, i.uiView = { type: "View", props: { width: 750, height: 1334 }, child: [ { type: "Sprite", props: { alpha: .6 }, child: [ { type: "Rect", props: { y: -300, width: 750, lineWidth: 1, height: 1934, fillColor: "#000000" } } ] }, { type: "Image", props: { y: 524, x: 375, width: 543, var: "bg", skin: "img/nczjs_backg_zlbj.png", sizeGrid: "152,72,68,88", scaleY: .8, scaleX: .8, height: 458, anchorY: .5, anchorX: .5 }, child: [ { type: "Image", props: { y: 54, x: 74, width: 395, skin: "img/nczjs_kuan_zhlk1.png", sizeGrid: "22,26,26,22", height: 288 } }, { type: "Image", props: { y: -24, x: -1, skin: "img/nczjs_img_jscd1.png" }, child: [ { type: "Image", props: { y: 7, x: 144, skin: "img/nczjs_txt_jinbzu.png" } } ] }, { type: "Image", props: { y: 97, x: 216, width: 110, skin: "img/zwujs_icon_jinbi1.png", height: 110 } }, { type: "Text", props: { y: 242, x: 134, width: 275, var: "num", valign: "middle", text: "100 金币", height: 46, fontSize: 40, color: "#cd430d", bold: !0, align: "center" } }, { type: "Image", props: { y: 390, x: 271, width: 201, var: "btn_ad", skin: "img/zwujs_button_lv1.png", sizeGrid: "22,20,28,20", height: 73, anchorY: .5, anchorX: .5 }, child: [ { type: "Text", props: { y: 0, x: 69, width: 120, valign: "middle", text: "获取", strokeColor: "#000000", stroke: 3, height: 66, fontSize: 30, color: "#ffffff", bold: !0, align: "center" } }, { type: "Image", props: { y: 14, x: 24, skin: "img/ad.png" } } ] }, { type: "Text", props: { y: 475, x: 190, width: 162, var: "btn_close", text: "Give up", height: 43, fontSize: 30, color: "#cdcdcd", align: "center" } } ] } ] }, i; }(View); t.addUI = e; }(ui || (ui = {})), function(t) { var e = function(e) { function i() { return e.call(this) || this; } return __extends(i, e), i.prototype.createChildren = function() { View.regComponent("Text", laya.display.Text), e.prototype.createChildren.call(this), this.createView(t.bookUI.uiView); }, i.uiView = { type: "View", props: { width: 750, height: 1334 }, child: [ { type: "Sprite", props: { alpha: .6 }, child: [ { type: "Rect", props: { y: -300, width: 750, lineWidth: 1, height: 1934, fillColor: "#000000" } } ] }, { type: "Image", props: { y: 568, x: 375, width: 652, var: "bg", skin: "img/nczjs_backg_zlbj.png", sizeGrid: "152,72,68,88", scaleY: .8, scaleX: .8, height: 1006, anchorY: .5, anchorX: .5 }, child: [ { type: "Image", props: { y: 41, x: 52, width: 60, var: "btn_close", skin: "img/close.png", height: 57 } }, { type: "Image", props: { y: 24, x: 166, skin: "img/nczjs_img_newbtl1.png" }, child: [ { type: "Image", props: { y: 4, x: 98, skin: "img/zwujs_txt_jstuj.png" } } ] }, { type: "Image", props: { y: 146, x: 99, width: 214, var: "btn_1", skin: "img/book (1).png", height: 80 }, child: [ { type: "Text", props: { y: 13, x: 23, width: 168, valign: "middle", text: "corpse", height: 53, fontSize: 36, color: "#972e06", bold: !0, align: "center" } } ] }, { type: "Image", props: { y: 146, x: 339, width: 214, var: "btn_2", skin: "img/book (2).png", height: 80 }, child: [ { type: "Text", props: { y: 13, x: 23, width: 168, valign: "middle", text: "Botany", height: 53, fontSize: 36, color: "#972e06", bold: !0, align: "center" } } ] }, { type: "Sprite", props: { y: 230, x: 55, width: 550, var: "list1", height: 739 } }, { type: "Sprite", props: { y: 230, x: 55, width: 550, visible: !1, var: "list2", height: 739 } }, { type: "Image", props: { y: 230, x: 55, width: 550, visible: !1, skin: "img/nczjs_kuan_zhlk1.png", sizeGrid: "26,20,18,26", height: 150 }, child: [ { type: "Image", props: { y: 75, x: 64, skin: "img/nczjs_tujjs18.png", anchorY: .5, anchorX: .5 } }, { type: "Text", props: { y: 20, x: 130, width: 136, text: "僵尸木乃伊", height: 35, fontSize: 36, color: "#972e06" } }, { type: "Text", props: { y: 65, x: 130, wordWrap: !0, width: 236, text: "啥的", height: 35, fontSize: 22, color: "#b96509" } }, { type: "Image", props: { y: 60, x: 377, width: 156, skin: "img/zwujs_button_lv1.png", sizeGrid: "12,12,18,16", height: 67 }, child: [ { type: "Image", props: { y: 7, x: 14, skin: "img/nczjs_icon_8.png" } }, { type: "Text", props: { y: 16, x: 72, width: 69, text: "50", height: 30, fontSize: 30, color: "#ffffff", align: "center" } } ] }, { type: "Image", props: { y: 62, x: 388, skin: "img/nczjs_icon_dui1.png" }, child: [ { type: "Text", props: { y: 0, x: 40, width: 69, text: "Received", height: 30, fontSize: 26, color: "#127816", bold: !0 } } ] } ] } ] } ] }, i; }(View); t.bookUI = e; }(ui || (ui = {})), function(t) { var e = function(e) { function i() { return e.call(this) || this; } return __extends(i, e), i.prototype.createChildren = function() { View.regComponent("Text", laya.display.Text), e.prototype.createChildren.call(this), this.createView(t.closeUI.uiView); }, i.uiView = { type: "View", props: { width: 750, height: 1334 }, child: [ { type: "Sprite", props: { x: 0 }, child: [ { type: "Rect", props: { y: -300, width: 750, lineWidth: 1, height: 1934, fillColor: "#ffffff" } }, { type: "Rect", props: { y: 0, x: 0, width: 750, lineWidth: 1, height: 140, fillColor: "#EEEEEE" } } ] }, { type: "Image", props: { y: 48, x: 32, skin: "img/newscene4.png" } }, { type: "Panel", props: { y: 222, x: 0, width: 750, var: "pl", height: 1112 } }, { type: "Text", props: { y: 29, x: 60, width: 369, valign: "middle", text: "小程序", height: 68, fontSize: 36, color: "#000000", bold: !0, align: "left" } }, { type: "Text", props: { y: 149, x: 30, width: 369, valign: "middle", text: "Use", height: 68, fontSize: 27, color: "#494949", bold: !0, align: "left" } }, { type: "Sprite", props: { y: 229, x: 6, width: 730, visible: !1, height: 150 }, child: [ { type: "Image", props: { y: 25, x: 25, width: 100, skin: "img/newscene2.png", height: 100 } }, { type: "Text", props: { y: 55, x: 180, width: 176, text: "笑笑开了房间安抚", height: 40, fontSize: 40, color: "#000000" } }, { type: "Image", props: { y: 51, x: 645, skin: "img/newscene5.png" } } ] } ] }, i; }(View); t.closeUI = e; }(ui || (ui = {})), function(t) { var e = function(e) { function i() { return e.call(this) || this; } return __extends(i, e), i.prototype.createChildren = function() { e.prototype.createChildren.call(this), this.createView(t.coinRewardUI.uiView); }, i.uiView = { type: "View", props: { width: 750, height: 1334 }, child: [ { type: "Sprite", props: { y: 2, x: 0, width: 751, height: 1336, alpha: .6 }, child: [ { type: "Rect", props: { y: -300, width: 750, height: 1934, fillColor: "#000000" } } ] }, { type: "Sprite", props: { y: -20, x: 0, width: 751, var: "get", height: 1197 }, child: [ { type: "Image", props: { y: 329, x: 63, skin: "imgv2/signbg.png", scaleY: .9, scaleX: .9 } }, { type: "Image", props: { y: 308, x: 631, var: "btn_close", skin: "imgv2/btn_close.png" } }, { type: "Image", props: { y: 295, x: 163, var: "get_tittle", skin: "imgv2/tittle_jbdlb.png", scaleY: .8, scaleX: .8 } }, { type: "Image", props: { y: 427, x: 103, skin: "imgv2/gx.png", scaleY: 1, scaleX: 1, pivotY: -40, pivotX: -86 } }, { type: "Image", props: { y: 502, x: 222, var: "icon", skin: "imgv2/icon_morecoin2.png" } }, { type: "Image", props: { y: 824, x: 201, skin: "imgv2/tips_jrsylqcs.png" }, child: [ { type: "Label", props: { y: -6, x: 293, var: "number_jbdlb", text: "3", fontSize: 45, color: "#ead14b" } } ] }, { type: "Image", props: { y: 929, x: 157, var: "video_get", skin: "imgv2/btn_shibei.png" }, child: [ { type: "Label", props: { y: 28, x: 94, var: "more_number", text: "20000", fontSize: 40, color: "#ffffff" } } ] }, { type: "Image", props: { y: 937, x: 423, var: "normal_get", skin: "imgv2/btn_bg1.png" }, child: [ { type: "Label", props: { y: 18, x: 50, var: "one_number", text: "2000", fontSize: 40, color: "#ffffff" } } ] }, { type: "Image", props: { y: 1079, x: 247, skin: "imgv2/tips_jbbz.png" } } ] } ] }, i; }(View); t.coinRewardUI = e; }(ui || (ui = {})), function(t) { var e = function(e) { function i() { return e.call(this) || this; } return __extends(i, e), i.prototype.createChildren = function() { View.regComponent("Text", laya.display.Text), e.prototype.createChildren.call(this), this.createView(t.dialUI.uiView); }, i.uiView = { type: "View", props: { width: 750, height: 1334 }, child: [ { type: "Sprite", props: { alpha: .6 }, child: [ { type: "Rect", props: { y: -300, width: 750, lineWidth: 1, height: 1934, fillColor: "#000000" } } ] }, { type: "Image", props: { y: 550, x: 375, var: "bg", skin: "img/zwujs_icon_zhuanpan3.png", scaleY: .8, scaleX: .8, anchorY: .5, anchorX: .5 }, child: [ { type: "Image", props: { y: -179, x: 60, skin: "img/nczjs_font_3.png", scaleY: 1.2, scaleX: 1.2 } }, { type: "Image", props: { y: 298, x: 298, var: "bt", skin: "img/zwujs_icon_zhuanpan2.png", rotation: 300, anchorY: .5, anchorX: .5 }, child: [ { type: "Image", props: { y: 61, x: 225, width: 53, skin: "img/zwujs_icon_jinbi1.png", height: 55 }, child: [ { type: "Text", props: { y: -39, x: -9, width: 71, var: "tx1", text: "100", strokeColor: "#000000", stroke: 2, height: 33, fontSize: 30, color: "#ffffff", align: "center" } }, { type: "Image", props: { y: 65, x: -2, skin: "img/nczjs_txt_zpwz1.png" } } ] }, { type: "Image", props: { y: 183, x: 67, skin: "img/nczjs_icon_18.png", rotation: -60 }, child: [ { type: "Text", props: { y: -35, x: -6, width: 71, var: "tx2", text: "50", strokeColor: "#000000", stroke: 2, height: 27, fontSize: 30, color: "#ffffff", align: "center" } }, { type: "Image", props: { y: 68, x: 2, skin: "img/nczjs_txt_zpwz2.png" } } ] }, { type: "Image", props: { y: 377, x: 103, skin: "img/nczjs_icon_10.png", rotation: -120 }, child: [ { type: "Text", props: { y: -35, x: 2, width: 71, var: "tx3", text: "50", strokeColor: "#000000", stroke: 2, height: 27, fontSize: 30, color: "#ffffff", align: "center" } }, { type: "Image", props: { y: 68, x: 10, skin: "img/nczjs_txt_zpwz3.png" } } ] }, { type: "Image", props: { y: 433, x: 272, skin: "img/nczjs_icon_8.png", rotation: -180 }, child: [ { type: "Text", props: { y: -40, x: -17, width: 71, var: "tx4", text: "30", strokeColor: "#000000", stroke: 2, height: 27, fontSize: 30, color: "#ffffff", align: "center" } }, { type: "Image", props: { y: 58, x: -10, skin: "img/nczjs_txt_zpwz1.png" } } ] }, { type: "Image", props: { y: 317, x: 433, skin: "img/nczjs_icon_17.png", rotation: -240 }, child: [ { type: "Text", props: { y: -35, x: -4, width: 71, var: "tx5", text: "50", strokeColor: "#000000", stroke: 2, height: 27, fontSize: 30, color: "#ffffff", align: "center" } }, { type: "Image", props: { y: 68, x: 4, skin: "img/nczjs_txt_zpwz2.png" } } ] }, { type: "Image", props: { y: 126, x: 404, skin: "img/nczjs_icon_9.png", rotation: -300 }, child: [ { type: "Text", props: { y: -35, x: 1, width: 71, var: "tx6", text: "70", strokeColor: "#000000", stroke: 2, height: 27, fontSize: 30, color: "#ffffff", align: "center" } }, { type: "Image", props: { y: 68, x: 8, skin: "img/nczjs_txt_zpwz3.png" } } ] } ] }, { type: "Image", props: { y: -3, x: 276, skin: "img/zwujs_icon_zhuanpan1.png" } }, { type: "Image", props: { y: -244, x: -68, var: "btn_close", skin: "img/nczjs_buttom_2.png", scaleY: 1.2, scaleX: 1.2 } }, { type: "Image", props: { y: 707, x: 298, width: 287, var: "btn_ad", skin: "img/zwujs_button_huan1.png", sizeGrid: "22,20,28,20", height: 90, anchorY: .5, anchorX: .5 }, child: [ { type: "Image", props: { y: 22, x: 22, skin: "img/ad2.png" } }, { type: "Image", props: { y: 20, x: 91, skin: "img/nczjs_font_5.png" } } ] }, { type: "Image", props: { y: 707, x: 298, width: 287, var: "btn_go", skin: "img/zwujs_button_lv1.png", sizeGrid: "22,20,28,20", scaleY: 1.2, scaleX: 1.2, height: 90, anchorY: .5, anchorX: .5 }, child: [ { type: "Image", props: { y: 20, x: 53, skin: "img/nczjs_font_4.png" } } ] } ] } ] }, i; }(View); t.dialUI = e; }(ui || (ui = {})), function(t) { var e = function(e) { function i() { return e.call(this) || this; } return __extends(i, e), i.prototype.createChildren = function() { e.prototype.createChildren.call(this), this.createView(t.doublecoinUI.uiView); }, i.uiView = { type: "View", props: { width: 750, height: 1334 }, child: [ { type: "Sprite", props: { y: 0, x: 0, width: 751, height: 1336, alpha: .5 }, child: [ { type: "Rect", props: { y: -300, width: 750, height: 1934, fillColor: "#000000" } } ] }, { type: "Sprite", props: { y: -20, x: -6, width: 770, var: "get", height: 1221 }, child: [ { type: "Image", props: { y: 329, x: 63, width: 692, skin: "imgv2/signbg.png", scaleY: .9, scaleX: .9, height: 864 } }, { type: "Image", props: { y: 308, x: 631, var: "btn_close", skin: "imgv2/btn_close.png" } }, { type: "Image", props: { y: 291, x: 163, var: "get_tittle", skin: "imgv2/tittle_dcoin.png", scaleY: .8, scaleX: .8 } }, { type: "Image", props: { y: 467, x: 125, skin: "imgv2/gx.png", scaleY: 1.3, scaleX: 1.3 } }, { type: "Image", props: { y: 649, x: 259, var: "icon", skin: "imgv2/sbei.png" } }, { type: "Image", props: { y: 589, x: 244, skin: "imgv2/tips_jsdljb.png" } }, { type: "Image", props: { y: 832, x: 215, visible: !1, skin: "imgv2/kuang_bg.png" }, child: [ { type: "Label", props: { y: 3, x: 116, text: "00:00", fontSize: 45, color: "#fdfdfd" } } ] }, { type: "Image", props: { y: 880, x: 262, var: "video_get", skin: "imgv2/btn_mf.png" } }, { type: "Label", props: { y: 986, x: 261, var: "lbl_tips_jbsb", text: "30s coins*2", fontSize: 30, color: "#fdfdfd" } }, { type: "Image", props: { y: 1041, x: 246, var: "tipscoin", skin: "imgv2/tips_jbbz.png" } } ] } ] }, i; }(View); t.doublecoinUI = e; }(ui || (ui = {})), function(t) { var e = function(e) { function i() { return e.call(this) || this; } return __extends(i, e), i.prototype.createChildren = function() { View.regComponent("Text", laya.display.Text), e.prototype.createChildren.call(this), this.createView(t.giftUI.uiView); }, i.uiView = { type: "View", props: { width: 750, height: 1334 }, child: [ { type: "Sprite", props: { alpha: .6 }, child: [ { type: "Rect", props: { y: -300, width: 750, height: 1934, fillColor: "#000000" } } ] }, { type: "Image", props: { y: 520, x: 375, width: 400, var: "box_bg", skin: "img/zwujs_kuan_xzwsm.png", sizeGrid: "32,34,44,42", scaleY: .9, scaleX: .9, height: 380, anchorY: .5, anchorX: .5 }, child: [ { type: "Image", props: { y: -55, x: -73, skin: "img/nczjs_img_jscd1.png" }, child: [ { type: "Image", props: { y: 52, x: 272, skin: "img/nczjs_txt_gwubx.png", anchorY: .5, anchorX: .5 } } ] }, { type: "Image", props: { y: 188, x: 200, var: "box_img", skin: "img/nczjs_icon_1.png", scaleY: 1.5, scaleX: 1.5, anchorY: 1, anchorX: .5 } }, { type: "Text", props: { y: 200, x: 54, width: 291, var: "box_count", height: 56, fontSize: 40, color: "#af3f00", bold: !0, align: "center" } }, { type: "Image", props: { y: 305, x: 200, width: 209, var: "box_get", skin: "img/zwujs_button_huan1.png", sizeGrid: "22,20,28,20", height: 70, anchorY: .5, anchorX: .5 }, child: [ { type: "Text", props: { y: 15, x: 65, width: 129, text: "Claim", height: 39, fontSize: 30, color: "#ffffff", bold: !0, align: "center" } }, { type: "Image", props: { y: 12, x: 17, skin: "img/ad.png" } } ] }, { type: "Image", props: { y: -17, x: 13, var: "box_close", skin: "img/close2.png" } } ] }, { type: "Image", props: { y: 534, x: 375, width: 561, var: "gift_bg", skin: "img/nczjs_backg_zlbj.png", sizeGrid: "152,72,68,88", scaleY: .9, scaleX: .9, height: 512, anchorY: .5, anchorX: .5 }, child: [ { type: "Image", props: { y: 99, x: 83, width: 403, skin: "img/nczjs_kuan_zhlk1.png", sizeGrid: "22,26,26,22", height: 363 } }, { type: "Image", props: { y: -24, x: 121, skin: "img/nczjs_img_newbtl1.png" }, child: [ { type: "Image", props: { y: 7, x: 37, skin: "img/nczjs_txt_luckp.png" } } ] }, { type: "Image", props: { y: 405, x: 280, width: 201, var: "gift_get", skin: "img/nczjs_button_chen1.png", sizeGrid: "22,20,28,20", height: 73, anchorY: .5, anchorX: .5 }, child: [ { type: "Text", props: { y: 0, x: 69, width: 120, valign: "middle", text: "免费获取", height: 66, fontSize: 30, color: "#ffffff", bold: !0, align: "center" } }, { type: "Image", props: { y: 16, x: 16, skin: "img/ad.png" } } ] }, { type: "Image", props: { y: 248, x: 280, var: "gift_img", skin: "flower/tur_10101.png", anchorY: 1, anchorX: .5 } }, { type: "Image", props: { y: 248, x: 310, var: "gift_type", skin: "img/zwujs_icon_zwdji1.png", anchorY: 1, anchorX: .5 }, child: [ { type: "FontClip", props: { var: "gift_level", value: "1", skin: "img/nczjs_txt_sylv.png", sheet: "0123456789LV.", scaleY: 1.3, scaleX: 1.3, centerY: -2, centerX: 1 } } ] }, { type: "Image", props: { y: 256, x: 32, width: 509, skin: "img/zwujs_img_cduan1.png", sizeGrid: "0,72,0,82", height: 143 }, child: [ { type: "Text", props: { y: 18, x: 125, width: 259, var: "gift_name", valign: "middle", text: "射手", height: 57, fontSize: 40, color: "#ffffff", bold: !0, align: "center" } } ] }, { type: "Image", props: { y: 42, x: 57, var: "gift_close", skin: "img/close.png" } } ] } ] }, i; }(View); t.giftUI = e; }(ui || (ui = {})), function(t) { var e = function(e) { function i() { return e.call(this) || this; } return __extends(i, e), i.prototype.createChildren = function() { e.prototype.createChildren.call(this), this.createView(t.helpUI.uiView); }, i.uiView = { type: "View", props: { width: 750, height: 1334 }, child: [ { type: "Sprite", props: { alpha: .6 }, child: [ { type: "Rect", props: { y: -300, width: 750, lineWidth: 1, height: 1934, fillColor: "#000000" } } ] }, { type: "Image", props: { y: 568, x: 375, width: 652, var: "bg", skin: "img/nczjs_backg_zlbj.png", sizeGrid: "152,72,68,88", scaleY: .8, scaleX: .8, height: 1006, anchorY: .5, anchorX: .5 }, child: [ { type: "Image", props: { y: 41, x: 52, width: 60, var: "btn_close", skin: "img/close.png", height: 57 } }, { type: "Image", props: { y: 136, x: 55, skin: "img/nczjs_frame_17.png" } }, { type: "Image", props: { y: 24, x: 166, skin: "img/nczjs_img_newbtl1.png" }, child: [ { type: "Image", props: { y: 3, x: 67, skin: "img/nczjs_txt_howan.png" } } ] } ] } ] }, i; }(View); t.helpUI = e; }(ui || (ui = {})), function(t) { var e = function(e) { function i() { return e.call(this) || this; } return __extends(i, e), i.prototype.createChildren = function() { View.regComponent("SkeletonPlayer", laya.ani.bone.Skeleton), View.regComponent("Text", laya.display.Text), View.regComponent("ui.helpUI", t.helpUI), e.prototype.createChildren.call(this), this.createView(t.indexUI.uiView); }, i.uiView = { type: "View", props: { width: 750, height: 1334 }, child: [ { type: "Image", props: { y: -656, x: 0, width: 750, skin: "img/shamo_road.png", height: 1700 } }, { type: "Image", props: { y: 0, width: 750, skin: "img/shamo_road.png", height: 1700 } }, { type: "Sprite", props: { y: 0, x: 0, var: "zombi_sp" }, child: [ { type: "Sprite", props: { y: 419, x: 970 }, child: [ { type: "Image", props: { y: -100, skin: "skill/MotoSmoke07.png", anchorY: 1, anchorX: .5 } }, { type: "SkeletonPlayer", props: { url: "sk/fazhangjiangshi.sk", scaleY: 1.5, scaleX: 1.5 } }, { type: "Image", props: { y: -150, width: 100, skin: "img/zwujs_jindt_xuet1.png", sizeGrid: "6,10,6,10", height: 16, anchorX: .5 }, child: [ { type: "Image", props: { y: 0, x: 0, width: 100, skin: "img/zwujs_jindt_xuet3.png", sizeGrid: "4,8,8,10", height: 16 } } ] }, { type: "Image", props: { y: -170, width: 100, skin: "img/zwujs_jindt_xuet1.png", sizeGrid: "6,10,6,10", height: 16, anchorX: .5 }, child: [ { type: "Image", props: { y: 0, x: 0, width: 100, skin: "img/zwujs_kuan_boshei2.png", sizeGrid: "10,8,8,10", height: 16 } } ] }, { type: "Sprite", props: { y: -150, x: -79, width: 159, height: 146 } } ] } ] }, { type: "Sprite", props: { y: 0, x: 0, var: "bullet_sp" } }, { type: "Sprite", props: { y: 0, x: 0, var: "bottom_sp" }, child: [ { type: "Image", props: { y: 570, var: "paling", skin: "img/zhalan.png" } }, { type: "Image", props: { y: 1334, x: 375, skin: "img/shamo_land.png", anchorY: 1, anchorX: .5 } }, { type: "Sprite", props: { y: 0, x: 0 }, child: [ { type: "Image", props: { y: 1064, x: 25, width: 116, var: "bt_1", skin: "img/shamo_enclosure.png", height: 110 }, child: [ { type: "Image", props: { y: 51, x: 58, visible: !1, skin: "img/shockball_03.png", scaleY: .6, scaleX: .6, anchorY: .5, anchorX: .5 } } ] }, { type: "Image", props: { y: 1035, x: 171, width: 116, var: "bt_2", skin: "img/shamo_enclosure.png", height: 110 } }, { type: "Image", props: { y: 1035, x: 317, width: 116, var: "bt_3", skin: "img/shamo_enclosure.png", height: 110 } }, { type: "Image", props: { y: 1035, x: 463, width: 116, var: "bt_4", skin: "img/shamo_enclosure.png", height: 110 } }, { type: "Image", props: { y: 1064, x: 609, width: 116, var: "bt_5", skin: "img/shamo_enclosure.png", height: 110 } }, { type: "Image", props: { y: 937, x: 25, width: 116, var: "bt_6", skin: "img/shamo_enclosure.png", height: 110 } }, { type: "Image", props: { y: 908, x: 171, width: 116, var: "bt_7", skin: "img/shamo_enclosure.png", height: 110 } }, { type: "Image", props: { y: 908, x: 317, width: 116, var: "bt_8", skin: "img/shamo_enclosure.png", height: 110 } }, { type: "Image", props: { y: 908, x: 463, width: 116, var: "bt_9", skin: "img/shamo_enclosure.png", height: 110 } }, { type: "Image", props: { y: 937, x: 609, width: 116, var: "bt_10", skin: "img/shamo_enclosure.png", height: 110 } }, { type: "Image", props: { y: 809, x: 25, width: 116, var: "bt_11", skin: "img/shamo_enclosure.png", height: 110 }, child: [ { type: "Image", props: { y: 4, x: -5, skin: "img/zwujs_button_jskan.png", name: "btn" } }, { type: "Text", props: { y: 17, x: 33, width: 69, valign: "middle", text: "100", name: "count", height: 24, fontSize: 24, color: "#ffffff", align: "center" } } ] }, { type: "Image", props: { y: 780, x: 171, width: 116, var: "bt_12", skin: "img/shamo_enclosure.png", height: 110 }, child: [ { type: "Image", props: { y: 4, x: -5, skin: "img/zwujs_button_jskan.png", name: "btn" } }, { type: "Text", props: { y: 17, x: 33, width: 69, valign: "middle", text: "100", name: "count", height: 24, fontSize: 24, color: "#ffffff", align: "center" } } ] }, { type: "Image", props: { y: 780, x: 317, width: 116, var: "bt_13", skin: "img/shamo_enclosure.png", height: 110 }, child: [ { type: "Image", props: { y: 4, x: -5, skin: "img/zwujs_button_jskan.png", name: "btn" } }, { type: "Text", props: { y: 17, x: 33, width: 69, valign: "middle", text: "100", name: "count", height: 24, fontSize: 24, color: "#ffffff", align: "center" } } ] }, { type: "Image", props: { y: 780, x: 463, width: 116, var: "bt_14", skin: "img/shamo_enclosure.png", height: 110 }, child: [ { type: "Image", props: { y: 4, x: -5, skin: "img/zwujs_button_jskan.png", name: "btn" } }, { type: "Text", props: { y: 17, x: 33, width: 69, valign: "middle", text: "100", name: "count", height: 24, fontSize: 24, color: "#ffffff", align: "center" } } ] }, { type: "Image", props: { y: 809, x: 609, width: 116, var: "bt_15", skin: "img/shamo_enclosure.png", height: 110 }, child: [ { type: "Image", props: { y: 4, x: -5, skin: "img/zwujs_button_jskan.png", name: "btn" } }, { type: "Text", props: { y: 17, x: 33, width: 69, valign: "middle", text: "100", name: "count", height: 24, fontSize: 24, color: "#ffffff", align: "center" } } ] } ] }, { type: "Image", props: { y: 703, x: 651, var: "road_sign", skin: "img/zhaopai_zhalan.png", rotation: 0, anchorY: 1, anchorX: .5 }, child: [ { type: "Image", props: { y: 6, x: 27, var: "btn_road", skin: "img/nczjs_font_2.png" } }, { type: "Image", props: { y: 43, x: 14, width: 83, skin: "img/zwujs_jindt_zlxuel2.png", sizeGrid: "0,6,0,8", height: 20 }, child: [ { type: "Image", props: { y: 3, x: 3, width: 78, var: "blood_img", skin: "img/zwujs_jindt_zlxuel1.png", sizeGrid: "0,4,0,6", height: 14 } }, { type: "Text", props: { y: -1, x: 15, width: 52, var: "blood_show", valign: "middle", height: 21, fontSize: 18, color: "#ffffff", align: "center" } } ] } ] }, { type: "Image", props: { y: 1174, x: 0, width: 750, skin: "img/zwujs_img_gkhdi.png", sizeGrid: "10,10,12,12", height: 160 } }, { type: "Image", props: { y: 1205, x: 16, width: 108, var: "img_del", skin: "img/zwujs_icon_lajit.png", height: 100 } }, { type: "Image", props: { y: 1211, x: 615, width: 124, var: "btn_shop", skin: "img/zwujs_icon_shop.png", height: 99 } }, { type: "Image", props: { y: 1184, x: 130, width: 143, var: "btn_buy1", skin: "img/zwujs_button_gmai1.png", sizeGrid: "0,20,0,44", height: 140 }, child: [ { type: "Image", props: { y: 63, x: 81, var: "buy_img1", skin: "flower/tur_10101.png", scaleY: .6, scaleX: .6, anchorY: 1, anchorX: .5 } }, { type: "Text", props: { y: 92, x: 42, width: 90, var: "buy_count1", valign: "middle", text: "100", height: 30, fontSize: 26, color: "#ffffff", align: "center" } } ] }, { type: "Image", props: { y: 1184, x: 295, width: 143, var: "btn_buy2", skin: "img/zwujs_button_gmai2.png", sizeGrid: "0,20,0,44", height: 140 }, child: [ { type: "Image", props: { y: 63, x: 81, var: "buy_img2", skin: "flower/tur_10101.png", scaleY: .6, scaleX: .6, anchorY: 1, anchorX: .5 } }, { type: "Text", props: { y: 92, x: 42, width: 90, var: "buy_count2", valign: "middle", text: "100", height: 30, fontSize: 26, color: "#ffffff", align: "center" } } ] }, { type: "Image", props: { y: 1184, x: 460, width: 143, var: "btn_buy3", skin: "img/zwujs_button_gmai3.png", sizeGrid: "0,20,0,44", height: 140 }, child: [ { type: "Image", props: { y: 63, x: 81, var: "buy_img3", skin: "flower/tur_10101.png", scaleY: .6, scaleX: .6, anchorY: 1, anchorX: .5 } }, { type: "Text", props: { y: 92, x: 42, width: 90, var: "buy_count3", valign: "middle", text: "100", height: 30, fontSize: 26, color: "#ffffff", align: "center" } } ] }, { type: "Image", props: { y: 273, x: 687, var: "btn_skill1", skin: "img/nczjs_icon_1.png", scaleY: 1.2, scaleX: 1.2, anchorY: 1, anchorX: .5 }, child: [ { type: "Image", props: { y: 69, x: 63, skin: "img/nczjs_img_yhsl.png", name: "count", anchorY: 1, anchorX: .5 }, child: [ { type: "Text", props: { y: 4, x: 2, width: 25, var: "skill_count1", valign: "middle", text: "1", height: 21, fontSize: 20, color: "#ffffff", align: "center" } } ] }, { type: "Image", props: { y: 66, x: 64, skin: "img/nczjs_icon_jnship.png", name: "ad", anchorY: 1, anchorX: .5 } }, { type: "Image", props: { y: 89, x: 36, width: 63, visible: !1, skin: "img/zwujs_jindt_zlxuel2.png", sizeGrid: "10,12,14,12", name: "time", height: 26, anchorY: 1, anchorX: .5 }, child: [ { type: "Text", props: { y: 3, x: 3, width: 56, var: "skill_time1", valign: "middle", text: "00:00", height: 20, fontSize: 16, color: "#ffffff", align: "center" } } ] } ] }, { type: "Image", props: { y: 390, x: 687, var: "btn_skill2", skin: "img/nczjs_icon_6.png", scaleY: 1.2, scaleX: 1.2, anchorY: 1, anchorX: .5 }, child: [ { type: "Image", props: { y: 69, x: 63, skin: "img/nczjs_img_yhsl.png", name: "count", anchorY: 1, anchorX: .5 }, child: [ { type: "Text", props: { y: 4, x: 2, width: 25, var: "skill_count2", valign: "middle", text: "1", height: 21, fontSize: 20, color: "#ffffff", align: "center" } } ] }, { type: "Image", props: { y: 66, x: 64, skin: "img/nczjs_icon_jnship.png", name: "ad", anchorY: 1, anchorX: .5 } }, { type: "Image", props: { y: 89, x: 36, width: 63, visible: !1, skin: "img/zwujs_jindt_zlxuel2.png", sizeGrid: "10,12,14,12", name: "time", height: 26, anchorY: 1, anchorX: .5 }, child: [ { type: "Text", props: { y: 3, x: 3, width: 56, var: "skill_time2", valign: "middle", text: "00:00", height: 20, fontSize: 16, color: "#ffffff", align: "center" } } ] } ] }, { type: "Image", props: { y: 500, x: 687, var: "btn_skill3", skin: "img/nczjs_icon_4.png", scaleY: 1.2, scaleX: 1.2, anchorY: 1, anchorX: .5 }, child: [ { type: "Image", props: { y: 69, x: 63, skin: "img/nczjs_img_yhsl.png", name: "count", anchorY: 1, anchorX: .5 }, child: [ { type: "Text", props: { y: 4, x: 2, width: 25, var: "skill_count3", valign: "middle", text: "1", height: 21, fontSize: 20, color: "#ffffff", align: "center" } } ] }, { type: "Image", props: { y: 66, x: 64, skin: "img/nczjs_icon_jnship.png", name: "ad", anchorY: 1, anchorX: .5 } }, { type: "Image", props: { y: 89, x: 36, width: 63, visible: !1, skin: "img/zwujs_jindt_zlxuel2.png", sizeGrid: "10,12,14,12", name: "time", height: 26, anchorY: 1, anchorX: .5 }, child: [ { type: "Text", props: { y: 3, x: 3, width: 56, var: "skill_time3", valign: "middle", text: "00:00", height: 20, fontSize: 16, color: "#ffffff", align: "center" } } ] } ] } ] }, { type: "Sprite", props: { y: -4, x: -2, width: 101, var: "top", height: 808 }, child: [ { type: "Image", props: { y: 20, x: 37, width: 210, skin: "img/zwujs_kuan_ziyhei1.png", sizeGrid: "24,22,22,22", height: 68 }, child: [ { type: "Text", props: { y: 14, x: 66, width: 124, var: "money_count", valign: "middle", text: "100", height: 40, fontSize: 32, color: "#ffffff", bold: !0, align: "center" } }, { type: "Image", props: { y: 61, x: 35, width: 52, skin: "img/zwujs_icon_jinbi1.png", height: 54, anchorY: 1, anchorX: .5 } } ] }, { type: "Image", props: { y: 20, x: 270, width: 210, skin: "img/zwujs_kuan_ziyhei1.png", sizeGrid: "24,22,22,22", height: 68 }, child: [ { type: "Image", props: { y: 58, x: 32, width: 41, skin: "img/nczjs_icon_8.png", height: 49, anchorY: 1, anchorX: .5 } }, { type: "Text", props: { y: 14, x: 66, width: 124, var: "gem_count", valign: "middle", text: "100", height: 40, fontSize: 32, color: "#ffffff", bold: !0, align: "center" } } ] }, { type: "Image", props: { y: 88, x: 375, skin: "img/zwujs_icon_gkasdp.png", anchorX: .5 }, child: [ { type: "FontClip", props: { y: 26, x: 37, var: "level_now", value: "19", spaceX: -7, skin: "img/zwujs_txt_gkashu.png", sheet: "0123456789", anchorX: .5 } } ] }, { type: "Image", props: { y: 180, x: 375, width: 162, skin: "img/zwujs_kuan_ziyhei1.png", sizeGrid: "24,22,22,22", height: 47, anchorX: .5 }, child: [ { type: "Image", props: { y: 6, x: 13, width: 135, var: "level_ms", skin: "img/zwujs_kuan_boshei2.png", sizeGrid: "7,7,7,7", height: 34 } }, { type: "FontClip", props: { y: 9, x: 81, var: "level_count", value: "1", spaceX: -7, skin: "img/zwujs_txt_gshu.png", sheet: "0123456789", scaleY: .5, scaleX: .5, anchorX: .5 } }, { type: "Image", props: { visible:false, y: 6, x: 27, skin: "img/zwujs_txt_gshu2.png", scaleY: .5, scaleX: .5 } }, { type: "Image", props: { visible:false, y: 6, x: 105, skin: "img/zwujs_txt_gshu4.png", scaleY: .5, scaleX: .5 } } ] }, { type: "Image", props: { y: 510, x: 685, width: 80, var: "ad_sp", height: 80, anchorY: .2, anchorX: .5 }, child: [ { type: "Image", props: { y: 0, x: 40, width: 80, visible: !1, var: "ad_img", height: 80, anchorX: .5 } } ] }, { type: "Image", props: { visible:false, y: 682, x: 40, width: 0, var: "btn_bk", skin: "", height: 0, anchorY: .5, anchorX: .5 } } ] }, { type: "Sprite", props: { y: -242, x: 216, width: 125, visible: !1, height: 101 }, child: [ { type: "Image", props: { y: 53, x: 90, visible: !1, skin: "img/zwujs_img_guangq.png", scaleY: .3, scaleX: .3, anchorY: .5, anchorX: .5 } }, { type: "Image", props: { y: 94, x: 89, width: 95, visible: !1, skin: "img/nczjs_img_gwubox.png", height: 90, anchorY: 1, anchorX: .5 } } ] }, { type: "Sprite", props: { y: 0, x: 0, width: 750 }, child: [ { type: "Text", props: { y: 490, x: 271, width: 207, visible: !1, var: "cuttx", text: "Wave 1", height: 68, fontSize: 50, color: "#ffffff", align: "center" } }, { type: "Image", props: { visible: !1, var: "over_boss" }, child: [ { type: "Image", props: { width: 750, var: "over_red", skin: "img/zwujs_img_weix.png", height: 1334 } }, { type: "Image", props: { y: 626, x: 375, width: 750, var: "over_img", skin: "img/zwujs_img_bosslxi.png", height: 178, anchorY: .5, anchorX: .5 } } ] }, { type: "Image", props: { y: 568, x: 0, width: 750, visible: !1, var: "cutscene", skin: "img/zwujs_img_gkhdi.png", sizeGrid: "0,0,0,0", height: 130 }, child: [ { type: "Image", props: { y: 0, x: 750, width: 750, var: "cutscene_img", sizeGrid: "0,0,0,0", height: 130 }, child: [ { type: "Image", props: { visible:false, y: 30, x: 250, skin: "img/zwujs_txt_gshu2.png", anchorX: .5 } }, { type: "Image", props: { visible:false, y: 32, x: 500, skin: "img/zwujs_txt_gshu3.png", anchorX: .5 } }, { type: "FontClip", props: { y: 37, var: "cut_count", value: "1", skin: "img/zwujs_txt_gshu.png", sheet: "0123456789", centerX: 0 } } ] } ] } ] }, { type: "Sprite", props: { y: 1, x: 0, width: 182, var: "page1", height: 562 }, child: [ { type: "Image", props: { y: 243, x: 114, width: 148, visible: !1, var: "btn_scene", skin: "img/doll-7.png", height: 140, anchorY: .5, anchorX: .5 } }, { type: "Image", props: { y: 208, x: 88, var: "btn_av", skin: "img/av (2).png" }, child: [ { type: "Text", props: { y: 62, x: -43, width: 137, var: "av_tx", text: "录屏", strokeColor: "#000000", stroke: 3, height: 30, fontSize: 24, color: "#ffffff", align: "center" } } ] }, { type: "Image", props: { y: 97, x: 13, var: "btn_sign", skin: "imgv2/btn_sign.png", scaleY: .8, scaleX: .8 }, child: [ { type: "Image", props: { y: -6, x: 45, skin: "img/zwujs_icon_mfei.png" } } ] }, { type: "Image", props: { visible:false, y: 226, x: 8, var: "btn_doublecoin", skin: "imgv2/btn_sbei.png", scaleY: .9, scaleX: .9 }, child: [ { type: "Image", props: { y: -6, x: 45, skin: "img/zwujs_icon_mfei.png" } }, { type: "Label", props: { y: 77, x: 13, width: 61, visible: !1, var: "lbl_double_minute", text: "00:00", height: 20, fontSize: 23, color: "#f8f4f4" } } ] }, { type: "Image", props: { y: 447, x: 12, var: "btn_dial", skin: "img/zwujs_icon_zhpan.png" }, child: [ { type: "Image", props: { y: -6, x: 45, skin: "img/zwujs_icon_mfei.png" } } ] }, { type: "Sprite", props: { y: -5, x: 0, var: "setting" }, child: [ { type: "Rect", props: { y: 0, x: -150, width: 150, lineWidth: 1, height: 1334, fillColor: "#a1a1a1" } }, { type: "Image", props: { y: 341, x: 0, width: 73, var: "btn_setting", skin: "img/zwujs_img_zuoct.png", height: 95 }, child: [ { type: "Image", props: { y: 22, x: 36, var: "setting_img", skin: "img/zwujs_img_zuoct2.png", anchorX: .5 } } ] }, { type: "Image", props: { y: 549, x: -75, var: "btn_music", skin: "img/zwujs_icon_ceb2.png", anchorY: .5, anchorX: .5 } }, { type: "Image", props: { y: 137, x: -75, var: "btn_help", skin: "img/nczjs_buttom_8.png", anchorX: .5 } }, { type: "Image", props: { y: 294, x: -75, var: "btn_book", skin: "img/nczjs_icon_tujrk.png", anchorX: .5 } } ] }, { type: "help", props: { y: -5, x: 0, visible: !1, var: "help", runtime: "ui.helpUI" } } ] }, { type: "Sprite", props: { y: 0, x: 0, var: "pub" }, child: [ { type: "Sprite", props: { y: 0, x: 0, var: "pagePlay" } }, { type: "Sprite", props: { y: 0, x: 0, var: "pageAll" } }, { type: "Sprite", props: { y: 0, x: 0, var: "pageLike" } }, { type: "Sprite", props: { var: "pageAbout" } } ] }, { type: "Sprite", props: { y: 0, x: 3, visible: !1, var: "guide1" }, child: [ { type: "Sprite", props: { alpha: .6 }, child: [ { type: "Rect", props: { width: 750, height: 1334, fillColor: "#000000" } } ] }, { type: "Sprite", props: { y: 1185, x: 130, width: 143, var: "g_click", height: 140 } }, { type: "Image", props: { y: 1070, x: 219, var: "hand1", skin: "img/zwujs_icon_ydshou.png" } }, { type: "Text", props: { y: 1006, x: 58, width: 295, var: "ms1", text: "Click to buy plants!", height: 89, fontSize: 40, color: "#ffffff", bold: !0 } } ] }, { type: "Sprite", props: { visible: !1, var: "guide2" }, child: [ { type: "Sprite", props: { alpha: .6 }, child: [ { type: "Rect", props: { y: 0, x: 0, width: 750, height: 770, fillColor: "#000000" } }, { type: "Rect", props: { y: 1168, x: 0, width: 750, height: 166, fillColor: "#000000" } } ] }, { type: "Image", props: { y: 1001, x: 228, var: "hand2", skin: "img/zwujs_icon_ydshou.png" } }, { type: "Text", props: { y: 836, x: 157, width: 295, text: "Drag to create new plants!", height: 89, fontSize: 40, color: "#ffffff", bold: !0 } } ] }, { type: "Sprite", props: { y: 0, x: 0, var: "pageAD" } }, { type: "Image", props: { y: 80, x: 536, visible: !1, var: "btn_close", skin: "img/newscene.png" } }, { type: "Sprite", props: { var: "pageClose" } } ], animations: [ { nodes: [ { target: 240, keyframes: { skin: [ { value: "img/a3 (1).png", tweenMethod: "linearNone", tween: !1, target: 240, key: "skin", index: 0 }, { value: "img/a3 (2).png", tweenMethod: "linearNone", tween: !1, target: 240, key: "skin", index: 3 }, { value: "img/a3 (3).png", tweenMethod: "linearNone", tween: !1, target: 240, key: "skin", index: 6 }, { value: "img/a3 (4).png", tweenMethod: "linearNone", tween: !1, target: 240, key: "skin", index: 9 }, { value: "img/a3 (1).png", tweenMethod: "linearNone", tween: !1, target: 240, key: "skin", index: 12 } ] } }, { target: 241, keyframes: { skin: [ { value: "img/a1 (4).png", tweenMethod: "linearNone", tween: !1, target: 241, key: "skin", index: 0 }, { value: "img/a1 (3).png", tweenMethod: "linearNone", tween: !1, target: 241, key: "skin", index: 3 }, { value: "img/a1 (2).png", tweenMethod: "linearNone", tween: !1, target: 241, key: "skin", index: 6 }, { value: "img/a1 (1).png", tweenMethod: "linearNone", tween: !1, target: 241, key: "skin", index: 9 }, { value: "img/a1 (4).png", tweenMethod: "linearNone", tween: !1, target: 241, key: "skin", index: 12 } ] } } ], name: "ani1", id: 1, frameRate: 24, action: 0 } ] }, i; }(View); t.indexUI = e; }(ui || (ui = {})), function(t) { var e = function(e) { function i() { return e.call(this) || this; } return __extends(i, e), i.prototype.createChildren = function() { View.regComponent("Text", laya.display.Text), e.prototype.createChildren.call(this), this.createView(t.levelupUI.uiView); }, i.uiView = { type: "View", props: { width: 750, height: 1334 }, child: [ { type: "Sprite", props: { alpha: .6 }, child: [ { type: "Rect", props: { y: -300, width: 750, height: 1934, fillColor: "#000000" } } ] }, { type: "Image", props: { y: 596, x: 375, width: 587, var: "bg", scaleY: .8, scaleX: .8, height: 670, anchorY: .5, anchorX: .5 }, child: [ { type: "Image", props: { y: -34, x: 21, skin: "img/nczjs_img_jscd1.png" }, child: [ { type: "Image", props: { y: 13, x: 221, width: 103, skin: "img/nczjs_font_2.png", height: 58 } } ] }, { type: "Image", props: { y: 363, x: 126, var: "img1", skin: "flower/tur_10101.png", scaleY: 1.5, scaleX: 1.5, anchorY: 1, anchorX: .5 } }, { type: "Image", props: { y: 363, x: 468, var: "img2", skin: "flower/tur_10101.png", scaleY: 1.5, scaleX: 1.5, anchorY: 1, anchorX: .5 } }, { type: "Image", props: { y: 210, x: 239, skin: "img/nczjs_img_byjtou1.png" } }, { type: "Text", props: { y: 416, x: 96, width: 395, text: "Free upgrade", strokeColor: "#000000", stroke: 3, height: 72, fontSize: 46, color: "#ffffff", align: "center" } }, { type: "Image", props: { y: 550, x: 293, width: 201, var: "btn_ad", skin: "img/zwujs_button_lv1.png", sizeGrid: "22,20,28,20", height: 73, anchorY: .5, anchorX: .5 }, child: [ { type: "Text", props: { y: 0, x: 69, width: 120, valign: "middle", text: "OK", strokeColor: "#000000", stroke: 3, height: 72, fontSize: 30, color: "#ffffff", bold: !0, align: "center" } }, { type: "Image", props: { y: 14, x: 24, skin: "img/ad.png" } } ] }, { type: "Text", props: { y: 617, x: 212, width: 162, var: "btn_close", text: "Give up", height: 43, fontSize: 30, color: "#cdcdcd", align: "center" } } ] } ] }, i; }(View); t.levelupUI = e; }(ui || (ui = {})), function(t) { var e = function(e) { function i() { return e.call(this) || this; } return __extends(i, e), i.prototype.createChildren = function() { e.prototype.createChildren.call(this), this.createView(t.likeUI.uiView); }, i.uiView = { type: "View", props: { width: 750, mouseThrough: !0, height: 1334 } }, i; }(View); t.likeUI = e; }(ui || (ui = {})), function(t) { var e = function(e) { function i() { return e.call(this) || this; } return __extends(i, e), i.prototype.createChildren = function() { e.prototype.createChildren.call(this), this.createView(t.offlineUI.uiView); }, i.uiView = { type: "View", props: { width: 750, height: 1334 }, child: [ { type: "Sprite", props: { y: 0, x: 0, width: 751, height: 1336, alpha: .6 }, child: [ { type: "Rect", props: { y: -300, width: 750, height: 1934, fillColor: "#000000" } } ] }, { type: "Sprite", props: { y: -55, x: 0, width: 751, var: "get", height: 891 }, child: [ { type: "Image", props: { y: 329, x: 63, width: 692, skin: "imgv2/signbg.png", scaleY: .9, scaleX: .9, height: 864 } }, { type: "Image", props: { y: 291, x: 163, var: "get_tittle", skin: "imgv2/title_lxsy.png", scaleY: .8, scaleX: .8 } }, { type: "Image", props: { y: 504, x: 225, var: "icon", skin: "imgv2/icon_morecoin.png" } }, { type: "Image", props: { y: 449, x: 281, skin: "imgv2/tips_yzqsy.png" } }, { type: "Image", props: { y: 707, x: 203, skin: "imgv2/kuang_bg.png" }, child: [ { type: "Label", props: { y: 4, x: 126, var: "offlineLbl", text: "+4000k", fontSize: 45, color: "#fdfdfd" } } ] }, { type: "Image", props: { y: 933, x: 264, var: "common_get", skin: "imgv2/btn_get.png" } }, { type: "Image", props: { y: 810, x: 262, var: "video_get", skin: "imgv2/dbei_btn.png" } } ] } ] }, i; }(View); t.offlineUI = e; }(ui || (ui = {})), function(t) { var e = function(e) { function i() { return e.call(this) || this; } return __extends(i, e), i.prototype.createChildren = function() { View.regComponent("Text", laya.display.Text), e.prototype.createChildren.call(this), this.createView(t.overUI.uiView); }, i.uiView = { type: "View", props: { width: 750, height: 1334 }, child: [ { type: "Sprite", props: { alpha: .6 }, child: [ { type: "Rect", props: { y: -300, width: 750, lineWidth: 1, height: 1934, fillColor: "#000000" } } ] }, { type: "Image", props: { y: 667, x: 375, width: 750, var: "bg", scaleY: .8, scaleX: .8, height: 1334, anchorY: .5, anchorX: .5 }, child: [ { type: "Sprite", props: { y: 0, x: 0, width: 750, var: "over" }, child: [ { type: "Image", props: { y: 530, x: 375, skin: "img/zwujs_txt_tcgguan3.png", anchorY: .5, anchorX: .5 } }, { type: "Image", props: { y: -44, x: 108, width: 534, var: "title", skin: "img/zwujs_txt_tcgguan2.png", height: 303 } }, { type: "Image", props: { y: 769, x: 113, skin: "imgv2/tips_hczw.png" } }, { type: "Image", props: { y: 829, x: 225, skin: "imgv2/tips_cxtz.png" } }, { type: "Text", props: { y: 777, x: 68, width: 613, visible: !1, text: "tip:合成新植物可以提升攻击伤害!", height: 58, fontSize: 33, color: "#bcbcbc", align: "center" } }, { type: "Image", props: { y: 980, x: 375, width: 295, var: "over_ad", skin: "img/nczjs_button_chen1.png", sizeGrid: "22,20,28,20", height: 106, anchorY: .5, anchorX: .5 }, child: [ { type: "Text", props: { y: 20, x: 105, width: 171, valign: "middle", text: "Revive", height: 66, fontSize: 40, color: "#ffffff", bold: !0, align: "left" } }, { type: "Image", props: { y: -56, x: 240, skin: "imgv2/tips_kb.png" } }, { type: "Image", props: { y: 25, x: 21, width: 73, skin: "img/ad.png", height: 55 } } ] }, { type: "Text", props: { y: 1050, x: 289, width: 171, var: "over_close", valign: "middle", text: "Close", height: 51, fontSize: 30, color: "#cacaca", bold: !0, align: "center" } } ] }, { type: "Sprite", props: { y: 0, x: 0, width: 750, var: "done" }, child: [ { type: "Image", props: { y: 460, x: 375, var: "ray", skin: "img/zwujs_img_guangq.png", scaleY: 1.1, scaleX: 1.1, anchorY: .5, anchorX: .5 } }, { type: "Image", props: { y: 226, x: 110, skin: "img/zwujs_txt_tcgguan1.png" }, child: [ { type: "Text", props: { y: 343, x: 184, width: 162, valign: "middle", text: "Stage", height: 43, fontSize: 30, color: "#ffffff", bold: !0, align: "center" } } ] }, { type: "Image", props: { y: 799, x: 321, width: 68, skin: "img/zwujs_icon_jinbi1.png", height: 73, anchorY: 1, anchorX: .5 }, child: [ { type: "Text", props: { y: 12, x: 88, width: 145, var: "num", valign: "middle", text: "+200", strokeColor: "#000000", stroke: 3, height: 49, fontSize: 40, color: "#fdd819", align: "left" } } ] }, { type: "Image", props: { y: 831, x: 270, width: 209, var: "btn_get", skin: "img/zwujs_button_lv1.png", sizeGrid: "22,20,28,20", height: 70 }, child: [ { type: "Text", props: { y: 15, x: 62, width: 85, text: "Claim", height: 39, fontSize: 30, color: "#ffffff", bold: !0, align: "center" } } ] }, { type: "Text", props: { y: 919, x: 330, wordWrap: !0, width: 190, text: "Claim*2", height: 33, fontSize: 20, color: "#c0c0c0", bold: !0 } }, { type: "Image", props: { y: 916, x: 281, width: 30, var: "btn_done", skin: "img/zwujs_kuan_phlbdi2.png", height: 28 }, child: [ { type: "Image", props: { y: -2, x: 0, var: "done_img", skin: "img/nczjs_icon_dui1.png" } } ] } ] } ] } ] }, i; }(View); t.overUI = e; }(ui || (ui = {})), function(t) { var e = function(e) { function i() { return e.call(this) || this; } return __extends(i, e), i.prototype.createChildren = function() { View.regComponent("Text", laya.display.Text), e.prototype.createChildren.call(this), this.createView(t.roadUI.uiView); }, i.uiView = { type: "View", props: { width: 750, height: 1334 }, child: [ { type: "Sprite", props: { alpha: .6 }, child: [ { type: "Rect", props: { y: -300, width: 750, height: 1934, fillColor: "#000000" } } ] }, { type: "Image", props: { y: 583, x: 375, width: 700, var: "bg", skin: "img/nczjs_backg_zlbj.png", sizeGrid: "152,72,68,88", scaleY: .8, scaleX: .8, height: 1032, anchorY: .5, anchorX: .5 }, child: [ { type: "Image", props: { y: 23, x: 190, skin: "img/nczjs_img_newbtl1.png" }, child: [ { type: "Image", props: { y: 4, x: 38, skin: "img/zwujs_txt_sjzlan.png" } } ] }, { type: "Image", props: { y: 48, x: 64, width: 55, var: "btn_close", skin: "img/close.png", height: 51 } }, { type: "Sprite", props: { y: 140, x: 54, width: 600, var: "list", height: 853 } } ] }, { type: "Image", props: { y: 213, x: 78, width: 600, visible: !1, skin: "img/nczjs_kuan_zhlk1.png", sizeGrid: "26,20,18,26", height: 160 }, child: [ { type: "Image", props: { y: 19, x: 19, skin: "img/icon_weiqiang.png" } }, { type: "Text", props: { y: 19, x: 166, width: 136, text: "毛豆", height: 30, fontSize: 30, color: "#6b2104", bold: !0 } }, { type: "Text", props: { y: 60, x: 166, wordWrap: !0, width: 236, text: "啥的", height: 66, fontSize: 22, color: "#93520a" } }, { type: "Image", props: { y: 68, x: 439, skin: "img/nczjs_icon_7.png" } }, { type: "Image", props: { y: 47, x: 416, width: 156, skin: "img/zwujs_button_huan1.png", sizeGrid: "12,12,18,16", height: 67 }, child: [ { type: "Text", props: { y: 15, x: 19, width: 117, valign: "middle", text: "Use", height: 36, fontSize: 36, color: "#b2480d", bold: !0, align: "center" } } ] } ] } ] }, i; }(View); t.roadUI = e; }(ui || (ui = {})), function(t) { var e = function(e) { function i() { return e.call(this) || this; } return __extends(i, e), i.prototype.createChildren = function() { View.regComponent("Text", laya.display.Text), e.prototype.createChildren.call(this), this.createView(t.sceneADUI.uiView); }, i.uiView = { type: "View", props: { width: 750, height: 1334 }, child: [ { type: "Sprite", props: { y: 0, x: 0 }, child: [ { type: "Rect", props: { y: -300, width: 750, lineWidth: 1, height: 1934, fillColor: "#ffffff" } } ] }, { type: "Image", props: { y: 120, x: 25, width: 700, var: "head_img", height: 180 } }, { type: "Image", props: { y: 270, x: 375, width: 308, var: "head_play", skin: "img/scene_play.png", height: 125, anchorY: .5, anchorX: .5 } }, { type: "Panel", props: { y: 334, width: 750, var: "pl", height: 1e3 } }, { type: "Image", props: { y: 23, x: 30, var: "btn_close", skin: "img/scene_back.png" } }, { type: "Text", props: { y: 20, x: 190, width: 369, valign: "middle", text: "热门小游戏", height: 68, fontSize: 46, color: "#0a00ff", bold: !0, align: "center" } } ] }, i; }(View); t.sceneADUI = e; }(ui || (ui = {})), function(t) { var e = function(e) { function i() { return e.call(this) || this; } return __extends(i, e), i.prototype.createChildren = function() { e.prototype.createChildren.call(this), this.createView(t.sceneAD1UI.uiView); }, i.uiView = { type: "View", props: { width: 750, height: 1334 }, child: [ { type: "Sprite", props: { y: 0, x: 0, alpha: .6 }, child: [ { type: "Rect", props: { y: -300, width: 750, lineWidth: 1, height: 1934, fillColor: "#000000" } } ] }, { type: "Image", props: { y: 170, x: 61, width: 628, skin: "img/newscene2.png", sizeGrid: "106,58,44,54", height: 856 }, child: [ { type: "Image", props: { y: 15, x: 18, width: 53, var: "btn_close", skin: "img/newscene3.png", height: 53 } }, { type: "Image", props: { y: 16, x: 147, skin: "img/newscene1.png" } }, { type: "Panel", props: { y: 81, x: -61, width: 750, var: "pl", height: 762 } } ] } ] }, i; }(View); t.sceneAD1UI = e; }(ui || (ui = {})), function(t) { var e = function(e) { function i() { return e.call(this) || this; } return __extends(i, e), i.prototype.createChildren = function() { View.regComponent("Text", laya.display.Text), e.prototype.createChildren.call(this), this.createView(t.shopUI.uiView); }, i.uiView = { type: "View", props: { width: 750, height: 1334 }, child: [ { type: "Sprite", props: { alpha: .6 }, child: [ { type: "Rect", props: { y: -300, width: 750, height: 1934, fillColor: "#000000" } } ] }, { type: "Image", props: { y: 583, x: 375, width: 700, var: "bg", skin: "img/nczjs_backg_zlbj.png", sizeGrid: "152,72,68,88", height: 1032, anchorY: .5, anchorX: .5 }, child: [ { type: "Image", props: { y: 23, x: 190, skin: "img/nczjs_img_newbtl1.png" }, child: [ { type: "Image", props: { y: 4, x: 99, skin: "img/nczjs_txt_sdgm.png" } } ] }, { type: "Image", props: { y: 48, x: 64, width: 55, var: "btn_close", skin: "img/close.png", height: 51 } }, { type: "Image", props: { y: 130, x: 75, width: 170, var: "btn_1", skin: "img/book (1).png", height: 74 }, child: [ { type: "Text", props: { y: 17, x: 31, width: 108, valign: "middle", text: "Botany1", height: 39, fontSize: 36, color: "#972e06", bold: !0, align: "center" } } ] }, { type: "Image", props: { y: 130, x: 265, width: 170, var: "btn_2", skin: "img/book (1).png", height: 74 }, child: [ { type: "Text", props: { y: 17, x: 31, width: 108, valign: "middle", text: "Botany2", height: 39, fontSize: 36, color: "#972e06", bold: !0, align: "center" } } ] }, { type: "Image", props: { y: 130, x: 455, width: 170, var: "btn_3", skin: "img/book (1).png", height: 74 }, child: [ { type: "Text", props: { y: 17, x: 31, width: 108, valign: "middle", text: "Botany3", height: 39, fontSize: 36, color: "#972e06", bold: !0, align: "center" } } ] }, { type: "Sprite", props: { y: 212, x: 66, width: 574, var: "list1", height: 781 } }, { type: "Sprite", props: { y: 212, x: 66, width: 574, var: "list2", height: 781 } }, { type: "Sprite", props: { y: 212, x: 66, width: 574, var: "list3", height: 781 } } ] }, { type: "Image", props: { y: 279, x: 91, width: 574, visible: !1, skin: "img/nczjs_kuan_zhlk1.png", sizeGrid: "26,20,18,26", height: 150 }, child: [ { type: "Image", props: { y: 75, x: 64, skin: "flower/tur_10101.png", scaleY: .7, scaleX: .7, anchorY: .5, anchorX: .5 } }, { type: "Image", props: { y: 15, x: 15, skin: "img/zwujs_icon_zwdji1.png", anchorY: .5, anchorX: .5 } }, { type: "FontClip", props: { y: 15, x: 15, value: "1", skin: "img/zwujs_txt_gshu.png", sheet: "0123456789", scaleY: .4, scaleX: .4, anchorY: .5, anchorX: .5 } }, { type: "Text", props: { y: 10, x: 130, width: 136, text: "毛豆", height: 30, fontSize: 30, color: "#6b2104", bold: !0 } }, { type: "Image", props: { y: 55, x: 140, skin: "img/zwujs_icon_gongji.png" } }, { type: "Text", props: { y: 55, x: 175, width: 136, text: "100", height: 26, fontSize: 26, color: "#d75523" } }, { type: "Text", props: { y: 90, x: 130, wordWrap: !0, width: 413, text: "啥的", height: 27, fontSize: 22, color: "#93520a" } }, { type: "Image", props: { y: 12, x: 404, width: 156, skin: "img/zwujs_button_lv1.png", sizeGrid: "12,12,18,16", height: 67 }, child: [ { type: "Image", props: { y: 7, x: 10, width: 43, skin: "img/zwujs_icon_jinbi1.png", height: 48 } }, { type: "Text", props: { y: 16, x: 62, width: 79, text: "50", height: 30, fontSize: 30, color: "#ffffff", align: "center" } }, { type: "Image", props: { y: 16, x: 65, skin: "img/zwujs_icon_suo1.png" } } ] } ] } ] }, i; }(View); t.shopUI = e; }(ui || (ui = {})), function(t) { var e = function(e) { function i() { return e.call(this) || this; } return __extends(i, e), i.prototype.createChildren = function() { View.regComponent("Text", laya.display.Text), e.prototype.createChildren.call(this), this.createView(t.signUI.uiView); }, i.uiView = { type: "View", props: { width: 750, height: 1334 }, child: [ { type: "Sprite", props: { y: 2, x: 0, alpha: .6 }, child: [ { type: "Rect", props: { y: -300, width: 750, height: 1934, fillColor: "#000000" } } ] }, { type: "Image", props: { y: 618, x: 385, width: 692, var: "panel_sign", skin: "imgv2/signbg.png", sizeGrid: "32,34,44,42", scaleY: .9, scaleX: .9, height: 864, anchorY: .5, anchorX: .5 }, child: [ { type: "Image", props: { y: 20, x: 302, width: 102, var: "title_qiandao", skin: "imgv2/qiandao.png", sizeGrid: "22,20,28,20", height: 56 } }, { type: "Image", props: { y: -20, x: 630, width: 76, var: "btn_close", skin: "imgv2/btn_close.png", sizeGrid: "22,20,28,20", height: 76 } }, { type: "Image", props: { y: 890, x: 101, var: "btn_dbei", skin: "imgv2/JBBtn.png" } }, { type: "Label", props: { y: 920, x: 404, var: "btn_get", underline: !0, text: "Claim", scaleY: .8, scaleX: .8, fontSize: 45, font: "Helvetica", color: "#dedada" } }, { type: "Image", props: { y: 130, x: 49, var: "sign1", skin: "imgv2/signitem1.png", scaleY: .85, scaleX: .9 }, child: [ { type: "Sprite", props: { y: 0, x: 0, visible: !1 }, child: [ { type: "Image", props: { y: 20, x: 60, skin: "imgv2/1.png" } }, { type: "Image", props: { y: 95, x: 65, skin: "imgv2/zuan_1.png" } } ] }, { type: "Sprite", props: { y: 0, x: 0, visible: !1, var: "sign1_now" }, child: [ { type: "Image", props: { y: 0, x: 0, skin: "imgv2/XZ_kuang.png", layoutEnabled: !1, alpha: 1 } }, { type: "Image", props: { y: 30, x: 4, skin: "imgv2/gxwirte.png" } } ] }, { type: "Label", props: { y: 182, x: 79, var: "num", text: "50", fontSize: 50 } }, { type: "Image", props: { y: 22, x: 63, skin: "imgv2/1.png" } }, { type: "Image", props: { y: 34, x: 4, skin: "imgv2/gxwirte.png" } }, { type: "Image", props: { y: 94, x: 65, skin: "imgv2/zuan_1.png" } }, { type: "Sprite", props: { y: 0, x: 0, width: 208, visible: !1, var: "sign1_mask", height: 272 }, child: [ { type: "Image", props: { y: 0, x: 3, width: 206, skin: "imgv2/sign-bg-v2.png", layoutEnabled: !1, height: 275, alpha: .5 } }, { type: "Image", props: { y: 88, x: 79, skin: "imgv2/tick-v2.png" } } ] } ] }, { type: "Image", props: { y: 130, x: 255, visible: !0, var: "sign2", skin: "imgv2/signitem1.png", scaleY: .85, scaleX: .9 }, child: [ { type: "Sprite", props: { y: 0, x: 0, visible: !1 }, child: [ { type: "Image", props: { y: 20, x: 60, skin: "imgv2/2.png" } }, { type: "Image", props: { y: 95, x: 65, skin: "imgv2/zuan_1.png" } } ] }, { type: "Sprite", props: { y: 0, x: 0, visible: !1, var: "sign2_now" }, child: [ { type: "Image", props: { y: 0, x: 0, skin: "imgv2/XZ_kuang.png", layoutEnabled: !1, alpha: 1 } }, { type: "Image", props: { y: 30, x: 4, skin: "imgv2/gxwirte.png" } } ] }, { type: "Label", props: { y: 180, x: 60, text: "100", fontSize: 50 } }, { type: "Image", props: { y: 20, x: 64, skin: "imgv2/2.png" } }, { type: "Image", props: { y: 34, x: 4, skin: "imgv2/gxwirte.png" } }, { type: "Image", props: { y: 94, x: 65, skin: "imgv2/zuan_1.png" } }, { type: "Sprite", props: { visible: !1, var: "sign2_mask" }, child: [ { type: "Image", props: { y: 0, x: 0, width: 206, skin: "imgv2/sign-bg-v2.png", layoutEnabled: !1, height: 275, alpha: .5 } }, { type: "Image", props: { y: 88, x: 79, skin: "imgv2/tick-v2.png" } } ] } ] }, { type: "Image", props: { y: 130, x: 460, var: "sign3", skin: "imgv2/signitem1.png", scaleY: .85, scaleX: .9 }, child: [ { type: "Sprite", props: { y: 0, x: 0, visible: !1 }, child: [ { type: "Image", props: { y: 20, x: 60, skin: "imgv2/3.png" } }, { type: "Image", props: { y: 95, x: 65, skin: "imgv2/zuan_1.png" } } ] }, { type: "Sprite", props: { y: 0, x: 0, visible: !1, var: "sign3_now" }, child: [ { type: "Image", props: { y: 0, x: 0, skin: "imgv2/XZ_kuang.png", layoutEnabled: !1, alpha: 1 } }, { type: "Image", props: { y: 30, x: 4, skin: "imgv2/gxwirte.png" } } ] }, { type: "Label", props: { y: 180, x: 60, text: "200", fontSize: 50 } }, { type: "Image", props: { y: 20, x: 64, skin: "imgv2/3.png" } }, { type: "Image", props: { y: 34, x: 4, skin: "imgv2/gxwirte.png" } }, { type: "Image", props: { y: 94, x: 65, skin: "imgv2/zuan_1.png" } }, { type: "Sprite", props: { visible: !1, var: "sign3_mask" }, child: [ { type: "Image", props: { y: 0, x: 0, width: 206, skin: "imgv2/sign-bg-v2.png", layoutEnabled: !1, height: 275, alpha: .5 } }, { type: "Image", props: { y: 88, x: 79, skin: "imgv2/tick-v2.png" } } ] } ] }, { type: "Image", props: { y: 380, x: 50, var: "sign4", skin: "imgv2/signitem1.png", scaleY: .85, scaleX: .9 }, child: [ { type: "Sprite", props: { y: 0, x: 0, visible: !1 }, child: [ { type: "Image", props: { y: 20, x: 60, skin: "imgv2/4.png" } }, { type: "Image", props: { y: 95, x: 49, skin: "imgv2/zuan_2.png" } } ] }, { type: "Sprite", props: { y: 0, x: 0, visible: !1, var: "sign4_now" }, child: [ { type: "Image", props: { y: 0, x: 0, skin: "imgv2/XZ_kuang.png", layoutEnabled: !1, alpha: 1 } }, { type: "Image", props: { y: 30, x: 4, skin: "imgv2/gxwirte.png" } } ] }, { type: "Label", props: { y: 180, x: 60, text: "300", fontSize: 50 } }, { type: "Image", props: { y: 20, x: 65, skin: "imgv2/4.png" } }, { type: "Image", props: { y: 34, x: 4, skin: "imgv2/gxwirte.png" } }, { type: "Image", props: { y: 89, x: 46, skin: "imgv2/zuan_2.png" } }, { type: "Sprite", props: { visible: !1, var: "sign4_mask" }, child: [ { type: "Image", props: { y: 0, x: 0, width: 206, skin: "imgv2/sign-bg-v2.png", layoutEnabled: !1, height: 275, alpha: .5 } }, { type: "Image", props: { y: 88, x: 79, skin: "imgv2/tick-v2.png" } } ] } ] }, { type: "Image", props: { y: 380, x: 255, var: "sign5", skin: "imgv2/signitem1.png", scaleY: .85, scaleX: .9 }, child: [ { type: "Sprite", props: { y: 0, x: 0, visible: !1 }, child: [ { type: "Image", props: { y: 20, x: 60, skin: "imgv2/5.png" } }, { type: "Image", props: { y: 94, x: 46, skin: "imgv2/zuan_2.png" } } ] }, { type: "Sprite", props: { y: 0, x: 0, visible: !1, var: "sign5_now" }, child: [ { type: "Image", props: { y: 0, x: 0, skin: "imgv2/XZ_kuang.png", layoutEnabled: !1, alpha: 1 } }, { type: "Image", props: { y: 30, x: 4, skin: "imgv2/gxwirte.png" } } ] }, { type: "Label", props: { y: 180, x: 60, text: "400", fontSize: 50 } }, { type: "Image", props: { y: 34, x: 4, skin: "imgv2/gxwirte.png" } }, { type: "Image", props: { y: 89, x: 46, skin: "imgv2/zuan_2.png" } }, { type: "Image", props: { y: 20, x: 65, skin: "imgv2/5.png" } }, { type: "Sprite", props: { visible: !1, var: "sign5_mask" }, child: [ { type: "Image", props: { y: 0, x: 0, width: 206, skin: "imgv2/sign-bg-v2.png", layoutEnabled: !1, height: 275, alpha: .5 } }, { type: "Image", props: { y: 88, x: 79, skin: "imgv2/tick-v2.png" } } ] } ] }, { type: "Image", props: { y: 380, x: 460, var: "sign6", skin: "imgv2/signitem1.png", scaleY: .85, scaleX: .9 }, child: [ { type: "Sprite", props: { y: 0, x: 0, visible: !1 }, child: [ { type: "Image", props: { y: 20, x: 60, skin: "imgv2/6.png" } }, { type: "Image", props: { y: 93, x: 48, skin: "imgv2/zuan_2.png" } } ] }, { type: "Sprite", props: { y: 0, x: 0, visible: !1, var: "sign6_now" }, child: [ { type: "Image", props: { y: 0, x: 0, skin: "imgv2/XZ_kuang.png", layoutEnabled: !1, alpha: 1 } }, { type: "Image", props: { y: 30, x: 4, skin: "imgv2/gxwirte.png" } } ] }, { type: "Label", props: { y: 180, x: 60, text: "500", fontSize: 50 } }, { type: "Image", props: { y: 20, x: 65, skin: "imgv2/6.png" } }, { type: "Image", props: { y: 34, x: 4, skin: "imgv2/gxwirte.png" } }, { type: "Image", props: { y: 89, x: 46, skin: "imgv2/zuan_2.png" } }, { type: "Sprite", props: { visible: !1, var: "sign6_mask" }, child: [ { type: "Image", props: { y: 0, x: 0, width: 206, skin: "imgv2/sign-bg-v2.png", layoutEnabled: !1, height: 275, alpha: .5 } }, { type: "Image", props: { y: 88, x: 79, skin: "imgv2/tick-v2.png" } } ] } ] }, { type: "Image", props: { y: 642, x: 50, width: 664, var: "sign7", skin: "imgv2/signitem7.png", scaleY: .9, scaleX: .9, height: 192 }, child: [ { type: "Sprite", props: { y: 0, x: 0, visible: !1 }, child: [ { type: "Image", props: { y: 22, x: 290, skin: "imgv2/7.png", scaleY: .8, scaleX: .8 } }, { type: "Image", props: { y: 67, x: 218, skin: "imgv2/zuan_3.png" } } ] }, { type: "Sprite", props: { y: 5, x: 0, width: 656, visible: !1, var: "sign7_now", height: 187 }, child: [ { type: "Image", props: { y: -6, x: 3, width: 664, skin: "imgv2/XZ_7.png", layoutEnabled: !1, height: 192, alpha: 1 } }, { type: "Image", props: { y: 4, x: 242, skin: "imgv2/gxwirte.png", scaleY: .9, scaleX: .9 } } ] }, { type: "Label", props: { y: 112, x: 480, text: "700", fontSize: 50 } }, { type: "Image", props: { y: 24, x: 300, skin: "imgv2/7.png", scaleY: .8, scaleX: .8 } }, { type: "Image", props: { y: 59, x: 230, skin: "imgv2/zuan_3.png" } }, { type: "Sprite", props: { y: -26, x: -141, width: 657, visible: !1, var: "sign7_mask", pivotY: -29, pivotX: -142, height: 183 }, child: [ { type: "Image", props: { y: 2, x: 0, width: 670, skin: "imgv2/sign-bg-v2.png", pivotY: 2, layoutEnabled: !1, height: 195, alpha: .5 } }, { type: "Image", props: { y: 62, x: 301, skin: "imgv2/tick-v2.png" } } ] } ] }, { type: "Text", props: { y: 915, x: 211, wordWrap: !0, width: 333, var: "lbl_hassign", text: "Signed in", height: 86, fontSize: 60, color: "#e7e5e4", bold: !0 } } ] }, { type: "Sprite", props: { y: 175, x: 2, width: 746, visible: !1, var: "panel_get", height: 1414 }, child: [ { type: "Image", props: { y: 90, x: 64, skin: "imgv2/signbg.png", scaleY: .9, scaleX: .9 } }, { type: "Image", props: { y: 47, x: 137, var: "get_tittle", skin: "imgv2/title_gxhd.png", scaleY: .9, scaleX: .9 } }, { type: "Image", props: { y: 278, x: 190, skin: "imgv2/gx.png" } }, { type: "Image", props: { y: 412, x: 323, width: 120, var: "icon", skin: "imgv2/zuan_2.png", height: 123 } }, { type: "Image", props: { y: 773, x: 277, var: "nomorl_get", skin: "imgv2/btn_get.png" } }, { type: "Label", props: { y: 638, x: 400, var: "lbl_coinnum", text: "+100", fontSize: 50, color: "#fdfdfd" } }, { type: "Image", props: { y: 632, x: 298, skin: "imgv2/zuan_1.png" } } ] } ] }, i; }(View); t.signUI = e; }(ui || (ui = {})), function(t) { var e = function(e) { function i() { return e.call(this) || this; } return __extends(i, e), i.prototype.createChildren = function() { View.regComponent("Text", laya.display.Text), e.prototype.createChildren.call(this), this.createView(t.superUnlockUI.uiView); }, i.uiView = { type: "View", props: { width: 750, height: 1334 }, child: [ { type: "Sprite", props: { alpha: .6 }, child: [ { type: "Rect", props: { y: -300, width: 750, height: 1934, fillColor: "#000000" } } ] }, { type: "Image", props: { y: 500, x: 375, width: 400, var: "bg", sizeGrid: "32,34,44,42", height: 400, anchorY: .5, anchorX: .5 }, child: [ { type: "Image", props: { y: -150, x: -36, skin: "imgv2/xnhc.png", scaleY: .9, scaleX: .9 } }, { type: "Image", props: { y: 510, x: 1, skin: "imgv2/ts.png", sizeGrid: "0,72,0,82" } }, { type: "Image", props: { y: 434, x: 97, skin: "imgv2/ms5.png" } }, { type: "Image", props: { y: 563, x: 76, var: "video_get", skin: "imgv2/xyBtn.png", sizeGrid: "22,20,28,20" } }, { type: "Image", props: { y: 694, x: 195, var: "normal_get", skin: "imgv2/ptBtn.png", sizeGrid: "22,20,28,20", anchorY: .5, anchorX: .5 } }, { type: "Image", props: { y: -95, x: -34, var: "hc_contain", scaleY: .9, scaleX: .9 }, child: [ { type: "Image", props: { y: 94, x: 84, skin: "imgv2/gx.png", scaleY: .9, scaleX: .9 } }, { type: "Image", props: { y: 351, x: 72, skin: "imgv2/jt.png" } }, { type: "Image", props: { var: "spnew", skin: "flower/tur_10104.png", centerY: 245, centerX: 268 }, child: [ { type: "Text", props: { y: 129, x: 33, var: "spnew_lv", text: "lv:13", fontSize: 30, color: "#ffffff" } } ] }, { type: "Image", props: { var: "sp1", skin: "flower/tur_10101.png", scaleY: .8, scaleX: .8, centerY: 507, centerX: 78 }, child: [ { type: "Text", props: { y: 121, x: 30, var: "lv1", text: "lv:13", fontSize: 30, color: "#ffffff" } } ] }, { type: "Image", props: { var: "sp2", skin: "flower/tur_10101.png", scaleY: .8, scaleX: .8, centerY: 507, centerX: 437 }, child: [ { type: "Text", props: { y: 121, x: 30, var: "lv2", text: "lv:13", fontSize: 30, color: "#ffffff" } } ] } ] } ] } ] }, i; }(View); t.superUnlockUI = e; }(ui || (ui = {})), function(t) { var e = function(e) { function i() { return e.call(this) || this; } return __extends(i, e), i.prototype.createChildren = function() { e.prototype.createChildren.call(this), this.createView(t.topAdUI.uiView); }, i.uiView = { type: "View", props: { width: 750, height: 110 } }, i; }(View); t.topAdUI = e; }(ui || (ui = {})), function(t) { var e = function(e) { function i() { return e.call(this) || this; } return __extends(i, e), i.prototype.createChildren = function() { View.regComponent("Text", laya.display.Text), e.prototype.createChildren.call(this), this.createView(t.unlockedUI.uiView); }, i.uiView = { type: "View", props: { width: 750, height: 1334 }, child: [ { type: "Sprite", props: { alpha: .6 }, child: [ { type: "Rect", props: { y: -300, width: 750, height: 1934, fillColor: "#000000" } } ] }, { type: "Image", props: { y: 500, x: 375, width: 400, var: "bg", skin: "img/zwujs_kuan_xzwsm.png", sizeGrid: "32,34,44,42", height: 400, anchorY: .5, anchorX: .5 }, child: [ { type: "Image", props: { y: -145, x: -73, skin: "img/nczjs_img_jscd1.png" }, child: [ { type: "Image", props: { y: 7, x: 112, skin: "img/zwujs_txt_jsnewzw.png" } } ] }, { type: "Image", props: { y: 187, x: 200, var: "img", scaleY: 1.5, scaleX: 1.5, anchorY: 1, anchorX: .5 } }, { type: "Image", props: { y: 187, x: -55, width: 509, skin: "img/zwujs_img_cduan1.png", sizeGrid: "0,72,0,82", height: 143 } }, { type: "Image", props: { y: 312, x: 142, width: 53, skin: "img/zwujs_icon_gongji.png", height: 51 }, child: [ { type: "Text", props: { y: 9, x: 60, width: 281, var: "power", text: "16", height: 46, fontSize: 40, color: "#ffffff", bold: !0 } } ] }, { type: "Text", props: { y: 407, x: -62, wordWrap: !0, width: 524, var: "desc", height: 80, fontSize: 30, color: "#bc690f", bold: !0 } }, { type: "Image", props: { y: 492, x: 118, width: 56, skin: "img/zwujs_icon_jinbi1.png", height: 57 }, child: [ { type: "Text", props: { y: 4, x: 67, width: 281, var: "money", text: "100", height: 46, fontSize: 40, color: "#ffea00", bold: !0 } } ] }, { type: "Image", props: { y: 599, x: 110, width: 209, var: "btn_get", skin: "img/zwujs_button_lv1.png", sizeGrid: "22,20,28,20", height: 70 }, child: [ { type: "Text", props: { y: 15, x: 62, width: 85, text: "Claim", strokeColor: "#000000", stroke: 3, height: 39, fontSize: 30, color: "#ffffff", align: "center" } } ] }, { type: "Image", props: { visible:false, y: 634, x: 349, width: 209, var: "btn_share", skin: "img/zwujs_button_huan1.png", sizeGrid: "22,20,28,20", height: 70, anchorY: .5, anchorX: .5 }, child: [ { type: "Text", props: { y: 15, x: 62, width: 85, text: "分享", strokeColor: "#000000", stroke: 3, height: 39, fontSize: 30, color: "#ffffff", align: "center" } } ] }, { type: "Text", props: { y: 684, x: 120, wordWrap: !0, width: 190, text: "Claim*2", height: 33, fontSize: 20, color: "#c0c0c0", bold: !0 } }, { type: "Image", props: { y: 681, x: 80, width: 30, var: "btn_ad", skin: "img/zwujs_kuan_phlbdi2.png", height: 28 }, child: [ { type: "Image", props: { y: -2, x: 0, var: "done", skin: "img/nczjs_icon_dui1.png" } } ] } ] } ] }, i; }(View); t.unlockedUI = e; }(ui || (ui = {})), function(t) { var e = function(e) { function i() { return e.call(this) || this; } return __extends(i, e), i.prototype.createChildren = function() { View.regComponent("Text", laya.display.Text), e.prototype.createChildren.call(this), this.createView(t.variationUI.uiView); }, i.uiView = { type: "View", props: { width: 750, height: 1334 }, child: [ { type: "Sprite", props: { alpha: .6 }, child: [ { type: "Rect", props: { y: -300, width: 750, lineWidth: 1, height: 1934, fillColor: "#000000" } } ] }, { type: "Image", props: { y: 606, x: 385, width: 587, var: "bg", scaleY: .8, scaleX: .8, height: 670, anchorY: .5, anchorX: .5 }, child: [ { type: "Image", props: { y: -34, x: 21, skin: "img/nczjs_img_jscd1.png" }, child: [ { type: "Image", props: { y: 7, x: 144, skin: "img/nczjs_txt_zwubyi.png" } } ] }, { type: "Image", props: { y: 363, x: 126, var: "img1", skin: "flower/tur_10101.png", scaleY: 1.5, scaleX: 1.5, anchorY: 1, anchorX: .5 } }, { type: "Image", props: { y: 363, x: 468, var: "img2", skin: "flower/tur_10101.png", scaleY: 1.5, scaleX: 1.5, anchorY: 1, anchorX: .5 }, child: [ { type: "Image", props: { y: 20, x: 20, var: "icon", skin: "img/nczjs_icon_tsbji1.png", scaleY: .7, scaleX: .7, rotation: 0, centerX: 0, bottom: 20 } } ] }, { type: "Image", props: { y: 210, x: 239, skin: "img/nczjs_img_byjtou1.png" } }, { type: "Text", props: { y: 416, x: 56, width: 475, var: "desc", strokeColor: "#000000", stroke: 3, height: 68, fontSize: 40, color: "#ffffff", align: "center" } }, { type: "Image", props: { y: 550, x: 293, width: 201, var: "btn_close", skin: "img/zwujs_button_lv1.png", sizeGrid: "22,20,28,20", height: 73, anchorY: .5, anchorX: .5 }, child: [ { type: "Text", props: { y: 0, x: 22, width: 156, valign: "middle", text: "OK", strokeColor: "#000000", stroke: 3, height: 72, fontSize: 30, color: "#ffffff", bold: !0, align: "center" } } ] }, { type: "Text", props: { y: 626, x: 56, width: 475, text: "tip: Variation synthesis~", strokeColor: "#000000", stroke: 3, height: 53, fontSize: 30, color: "#c6c6c6", align: "center" } } ] } ] }, i; }(View); t.variationUI = e; }(ui || (ui = {})); var view, __extends = this && this.__extends || function() { var t = function(e, i) { return (t = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, e) { t.__proto__ = e; } || function(t, e) { for (var i in e) e.hasOwnProperty(i) && (t[i] = e[i]); })(e, i); }; return function(e, i) { function n() { this.constructor = e; } t(e, i), e.prototype = null === i ? Object.create(i) : (n.prototype = i.prototype, new n()); }; }(), About = function(t) { function e() { var e = t.call(this) || this; return e.adName = "gameover", e.list = [], e.visible = !1, e; } return __extends(e, t), e.prototype.init = function() { var t = 200; console.log(PublicFun.ADlist[this.adName].length); for (var e = function(e) { if (!PublicFun.ADlist[i.adName][e]) return "continue"; var n = new Sprite(); i.addChild(n), n.size(100, 100).pos(e < 5 ? 20 : 630, t), i.list.push(n); var s = new Img(PublicFun.ADlist[i.adName][e].PicUrl); n.addChild(s), s.size(100, 100), s.name = "img"; var a = new Laya.Sprite(); a.graphics.drawPath(0, 0, PublicFun.getMaskPath(100, 100, 15), "#000"), s.mask = a; var r = new Txt(); n.addChild(r), r.name = "nick", r.text = PublicFun.ADlist[i.adName][e].name, r.size(s.width, 20).y = s.height + 10, r.overflow = Txt.HIDDEN, r.color = "#fff", r.fontSize = 20, r.align = "center"; var o = new Img("img/scene_tan.png"); n.addChild(o), o.pos(60, -20), Laya.timer.loop(300, i, function() { o.visible = !o.visible; }), s.on(_Event.CLICK, i, function() { if (Browser.onWeiXin) { var t = PublicFun.ADlist[this.adName][e], i = this.adName; PublicFun.cpamanager.CPATurn({ appid: t.appid, path: t.path, posid: i, callback: function(t) { t ? console.log("=====跳转成功") : (console.log("=====跳转失败"), Catalog._SCENEAD_SCENE && Catalog._SCENEAD_SCENE.play()); } }); } }), t += 140, 4 == e && (t = 200); }, i = this, n = 0; n < 10; n++) e(n); }, e.prototype.changeShow = function(t) { this.adName = t, this.updateShow(); }, e.prototype.updateShow = function() { for (var t = this.list.length, e = PublicFun.ADlist[this.adName], i = 0; i < t; i++) { var n = this.list[i], s = n.getChildByName("img"), a = n.getChildByName("nick"); s.skin = e[i].PicUrl, a.changeText(e[i].name); } }, e; }(ui.aboutUI), __extends = this && this.__extends || function() { var t = function(e, i) { return (t = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, e) { t.__proto__ = e; } || function(t, e) { for (var i in e) e.hasOwnProperty(i) && (t[i] = e[i]); })(e, i); }; return function(e, i) { function n() { this.constructor = e; } t(e, i), e.prototype = null === i ? Object.create(i) : (n.prototype = i.prototype, new n()); }; }(), Add = function(t) { function e() { var e = t.call(this) || this; return e.visible = !1, e.init(), e.addEvent(), e; } return __extends(e, t), e.prototype.init = function() {}, e.prototype.addEvent = function() { this.btn_close.on(Laya.Event.CLICK, this, function() { Laya.SoundManager.playSound("sound/click.mp3", 1), this.close(); }), this.btn_ad.on(_Event.CLICK, this, function() { var t = this; Laya.SoundManager.playSound("sound/click.mp3", 1), PublicFun.lookAd(function() { Catalog._MAIN_SCENE.changeMoney(Math.floor(t.count)), t.close(); }, "ADD_POP"); }); }, e.prototype.play = function() { var t = this; PublicFun.isAddB(!0, !0), PublicFun.addAbout("gameover"), Catalog._MAIN_SCENE.gameStop = !0, this.visible = !0, PublicFun.popWindow(this.bg, .8); for (var e = 0, i = 1; i <= 3; i++) { var n = Catalog._MAIN_SCENE.getLevelBuyCoins({ level: Catalog._MAIN_SCENE.getDefaultLevel(i), type: i }); e = n > e ? n : e; } this.count = CF.getAddCoins(e, LocalStorage.custom), this.num.text = "+" + PublicFun.changeString(this.count) + " 金币", this.btn_close.visible = !1, Laya.timer.once(2e3, this, function() { t.btn_close.visible = !0; }); }, e.prototype.close = function() { this.visible = !1, Catalog._OVER_SCENE.visible || (Catalog._MAIN_SCENE.gameStop = !1), PublicFun.removeBanner(), PublicFun.closeAbout(); }, e; }(ui.addUI), __extends = this && this.__extends || function() { var t = function(e, i) { return (t = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, e) { t.__proto__ = e; } || function(t, e) { for (var i in e) e.hasOwnProperty(i) && (t[i] = e[i]); })(e, i); }; return function(e, i) { function n() { this.constructor = e; } t(e, i), e.prototype = null === i ? Object.create(i) : (n.prototype = i.prototype, new n()); }; }(), Book = function(t) { function e() { var e = t.call(this) || this; return e.init(), e.addEvent(), e.visible = !1, e; } return __extends(e, t), e.prototype.init = function() { this.addList(2); }, e.prototype.addEvent = function() { this.btn_close.on(_Event.CLICK, this, function() { Laya.SoundManager.playSound("sound/click.mp3", 1), this.close(); }), this.btn_1.on(_Event.CLICK, this, function() { Laya.SoundManager.playSound("sound/click.mp3", 1), this.select(1); }), this.btn_2.on(_Event.CLICK, this, function() { Laya.SoundManager.playSound("sound/click.mp3", 1), this.select(2); }); }, e.prototype.play = function() { Catalog._MAIN_SCENE.gameStop = !0, PublicFun.isAddB(), PublicFun.addAbout("notice"), this.visible = !0, PublicFun.popWindow(this.bg, .8), this.select(1), this.addList(1); }, e.prototype.select = function(t) { this["btn_" + t].skin = "img/book (1).png", this["btn_" + (1 == t ? 2 : 1)].skin = "img/book (2).png", this["list" + t].visible = !0, this["list" + (1 == t ? 2 : 1)].visible = !1; }, e.prototype.addList = function(t) { this["array" + t] && this["array" + t].destroy && this["array" + t].destroy(); var e = new List(); this["list" + t].addChild(e), this["array" + t] = e, e.itemRender = ItemBookList, e.cacheContent = !0, e.size(550, 740); var i = 2 == t ? Data.variation.length : Data.book.length; e.repeatX = 1, e.repeatY = i, e.vScrollBarSkin = "", e.renderHandler = new Handler(this, function(e, i) { e.setImg(i, t); }), e.array = function() { for (var t = [], e = 0; e < i; e++) t.push(e); return t; }(); }, e.prototype.close = function() { Catalog._OVER_SCENE.visible || (Catalog._MAIN_SCENE.gameStop = !1), PublicFun.removeBanner(), PublicFun.closeAbout(), this.visible = !1; }, e; }(ui.bookUI), ItemBookList = function(t) { function e() { var e = t.call(this) || this; e.size(550, 160), e.bg = new Img("img/nczjs_kuan_zhlk1.png"), e.addChild(e.bg), e.bg.size(550, 150), e.bg.sizeGrid = "26,20,18,26", e.img = new Img(), e.bg.addChild(e.img), e.img.anchorX = .5, e.img.anchorY = .5, e.img.pos(64, 75), e.title = new Txt(), e.bg.addChild(e.title), e.title.bold = !0, e.title.color = "#972e06", e.title.pos(130, 20), e.title.fontSize = 36, e.desc = new Txt(), e.bg.addChild(e.desc), e.desc.size(236, 35).pos(130, 65), e.desc.wordWrap = !0, e.desc.fontSize = 22, e.desc.color = "#b96509", e.done = new Img("img/nczjs_icon_dui1.png"), e.bg.addChild(e.done), e.done.pos(388, 62); var i = new Txt(); return e.done.addChild(i), i.fontSize = 26, i.pos(40, 5), i.color = "#127816", i.bold = !0, i.text = "Received", e.btn = new Img("img/zwujs_button_lv1.png"), e.bg.addChild(e.btn), e.btn.size(156, 67).pos(377, 60), e.btn.sizeGrid = "12,12,18,16", e.icon = new Img("img/nczjs_icon_8.png"), e.btn.addChild(e.icon), e.icon.pos(14, 7), e.count = new Txt(), e.btn.addChild(e.count), e.count.size(69, 30).pos(72, 16), e.count.color = "#fff", e.count.fontSize = 30, e.count.align = "center", e; } return __extends(e, t), e.prototype.setImg = function(t, e) { var i = 1 == e ? Data.book[t] : Data.variation[t]; if (2 === e) { this.img.skin = "img/" + i.icon + ".png", this.title.text = i.name; var n = i.dsc.replace(/<.*?>/g, ""); return this.desc.text = n, this.desc.width = 390, this.done.visible = !1, void (this.btn.visible = !1); } var s = i.id, a = Data.getMonsterByid(i.monsterid), r = i.unlockid, o = Data.getCustomByid(r), h = Catalog._MAIN_SCENE.nowCustomData, l = h.guanka > o.guanka || h.guanka == o.guanka && h.turn >= o.turn, u = -1 != LocalStorage.bookReward.indexOf(s); this.btn.disabled = !l, this.btn.visible = !u, this.count.text = i.diamond, this.btn.visible && this.btn.on(_Event.CLICK, this, function() { this.btn.visible = !1, Catalog._MAIN_SCENE.changeGem(i.diamond), LocalStorage.bookReward.push(s), LocalStorage.setBookReward(); }), this.title.text = l ? a.name : "???"; var c = a.desc.replace(/<.*?>/g, ""); if (this.desc.text = l ? c : "??????????????", this.img.skin = "img/" + a.icon + ".png", !l) { var _ = new Laya.ColorFilter([ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 ]); this.img.filters = [ _ ]; } }, e; }(Laya.Box), __extends = this && this.__extends || function() { var t = function(e, i) { return (t = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, e) { t.__proto__ = e; } || function(t, e) { for (var i in e) e.hasOwnProperty(i) && (t[i] = e[i]); })(e, i); }; return function(e, i) { function n() { this.constructor = e; } t(e, i), e.prototype = null === i ? Object.create(i) : (n.prototype = i.prototype, new n()); }; }(), Close = function(t) { function e() { var e = t.call(this) || this; return e.adName = "gameover", e.visible = !1, e; } return __extends(e, t), e.prototype.init = function() { this.setAD(), this.pl.vScrollBarSkin = ""; }, e.prototype.setAD = function() { for (var t = 20, e = function(e) { var n = PublicFun.ADlist[i.adName][e], s = new Sprite(); i.pl.addChild(s), s.pos(0, t).size(750, 150), s.graphics.drawLine(0, 0, 750, 0, "#EEEEEE", 2); var a = new Img(n.PicUrl); s.addChild(a), a.size(100, 100).pos(25, 25); var r = new Laya.Sprite(); r.graphics.drawCircle(50, 50, 50, "#000"), a.mask = r; var o = new Txt(); s.addChild(o), o.pos(180, 55), o.text = n.name, o.color = "#000", o.fontSize = 40; var h = new Img("img/newscene5.png"); s.addChild(h), h.pos(645, 51); var l = i.adName; a.on(_Event.CLICK, i, function() { Browser.onWeiXin && PublicFun.cpamanager.CPATurn({ appid: n.appid, path: n.path, posid: l, callback: function(t) { t ? console.log("=====跳转成功") : console.log("=====跳转失败"); } }); }), t += 150; }, i = this, n = 0; n < PublicFun.ADlist[this.adName].length; n++) e(n); }, e; }(ui.closeUI), __extends = this && this.__extends || function() { var t = function(e, i) { return (t = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, e) { t.__proto__ = e; } || function(t, e) { for (var i in e) e.hasOwnProperty(i) && (t[i] = e[i]); })(e, i); }; return function(e, i) { function n() { this.constructor = e; } t(e, i), e.prototype = null === i ? Object.create(i) : (n.prototype = i.prototype, new n()); }; }(), CoinReward = function(t) { function e() { var e = t.call(this) || this; return e.coinArr = [ 50, 100, 200, 300, 400, 500, 700 ], e.canReward = !0, e.coinRewardTime = 0, e.visible = !1, e.init(), e.addEvent(), e; } return __extends(e, t), e.prototype.init = function() { this.coinRewardTime = CF.coinRewardTime; var t = LocalStorage.getLS("coinReward-" + PublicFun.getMyDate()), e = 0; t && (e = parseInt(t)), this.coinRewardTime <= e && (this.canReward = !1), this.canReward || (this.video_get.visible = !1, this.normal_get.visible = !1), this.number_jbdlb.text = "" + (this.coinRewardTime - e), this.coinReward = 2e3, this.coinRewardDbei = 2e4; }, e.prototype.addEvent = function() { this.normal_get.on(Laya.Event.CLICK, this, function() { if (this.canReward) { this.visible = !1, LocalStorage.moneyCount += this.coinReward, LocalStorage.setMoneyCount(), Catalog._MAIN_SCENE.updateMoneyCount(), Msg.post("Coins " + PublicFun.changeString(this.coinReward)); var t = LocalStorage.getLS("coinReward-" + PublicFun.getMyDate()), e = 0; t ? (e = parseInt(t) + 1, this.coinRewardTime <= e && (this.canReward = !1), LocalStorage.setLS("coinReward-" + PublicFun.getMyDate(), e)) : (e = 1, LocalStorage.setLS("coinReward-" + PublicFun.getMyDate(), 1), this.coinRewardTime <= e && (this.canReward = !1)), this.number_jbdlb.text = "" + (this.coinRewardTime - e), this.init(), this.close(); } }), this.video_get.on(Laya.Event.CLICK, this, function() { var t = this; PublicFun.lookAd(function() { if (t.canReward) { t.visible = !1, LocalStorage.moneyCount += t.coinRewardDbei, LocalStorage.setMoneyCount(), Catalog._MAIN_SCENE.updateMoneyCount(), Msg.post("Coins " + PublicFun.changeString(t.coinRewardDbei)); var e = LocalStorage.getLS("coinReward-" + PublicFun.getMyDate()), i = 0; e ? (i = parseInt(e) + 1, t.coinRewardTime <= i && (t.canReward = !1), LocalStorage.setLS("coinReward-" + PublicFun.getMyDate(), i)) : (i = 1, LocalStorage.setLS("coinReward-" + PublicFun.getMyDate(), 1), t.coinRewardTime <= i && (t.canReward = !1)), t.number_jbdlb.text = "" + (t.coinRewardTime - i), t.init(), t.close(); } }, "coinReward"); }), this.btn_close.on(Laya.Event.CLICK, this, function() { this.close(); }); }, e.prototype.getCoinRewardTime = function() { var t = LocalStorage.getLS("coinReward-" + PublicFun.getMyDate()), e = 0; return t && (e = parseInt(t)), this.coinRewardTime - e; }, e.prototype.play = function() { Catalog._MAIN_SCENE.gameStop = !0, this.visible = !0, PublicFun.isAddB(), PublicFun.addTopAd("mainicon"); }, e.prototype.close = function() { Catalog._OVER_SCENE.visible || (Catalog._MAIN_SCENE.gameStop = !1), this.visible = !1, PublicFun.removeBanner(), PublicFun.closeTopAd(); }, e; }(ui.coinRewardUI), __extends = this && this.__extends || function() { var t = function(e, i) { return (t = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, e) { t.__proto__ = e; } || function(t, e) { for (var i in e) e.hasOwnProperty(i) && (t[i] = e[i]); })(e, i); }; return function(e, i) { function n() { this.constructor = e; } t(e, i), e.prototype = null === i ? Object.create(i) : (n.prototype = i.prototype, new n()); }; }(), Dial = function(t) { function e() { var e = t.call(this) || this; return e.detail = [ 0, 60, 120, 180, 240, 300 ], e.oddList = [], e.visible = !1, e.init(), e.addEvent(), e; } return __extends(e, t), e.prototype.init = function() { this.updateImg(), this.setOdd(); }, e.prototype.addEvent = function() { this.btn_close.on(Laya.Event.CLICK, this, function() { Laya.SoundManager.playSound("sound/click.mp3", 1), this.isAni || this.close(); }), this.btn_go.on(Laya.Event.CLICK, this, function() { Laya.SoundManager.playSound("sound/click.mp3", 1), this.isAni || LocalStorage.dialCount <= 0 || (LocalStorage.dialCount--, LocalStorage.setDialCount(), this.go()); }), this.btn_ad.on(Laya.Event.CLICK, this, function() { var t = this; this.isAni || (Laya.SoundManager.playSound("sound/click.mp3", 1), PublicFun.lookAd(function() { t.go(); }, "DIAL")); }); }, e.prototype.play = function() { Catalog._MAIN_SCENE.gameStop = !0, PublicFun.isAddB(), PublicFun.addAbout("notice"), this.visible = !0, PublicFun.popWindow(this.bg, .8), this.btn_go.visible = LocalStorage.dialCount > 0; }, e.prototype.setOdd = function() { this.oddList = []; for (var t = 1; t <= 6; t++) this.oddList.push(t); this.oddList.sort(function(t, e) { return Data.dialMsg[t].probability - Data.dialMsg[e].probability; }), console.log(this.oddList); }, e.prototype.getOdd = function() { for (var t = 0; t < this.oddList.length; t++) { var e = this.oddList[t]; if (Math.random() < Data.dialMsg[e].probability) return e; } }, e.prototype.updateImg = function() { for (var t = 1; t <= 6; t++) { var e = this["tx" + t], i = Data.dialMsg[t]; if ("coins" == i.type) { for (var n = 0, s = 1; s <= 3; s++) { var a = Catalog._MAIN_SCENE.getLevelBuyCoins({ level: Catalog._MAIN_SCENE.getDefaultLevel(s), type: s }); n = a > n ? a : n; } var r = CF.getAddCoins(n, LocalStorage.custom); e.text = PublicFun.changeString(r * i.num); } else if ("gem" == i.type) { LocalStorage.deblocking; e.text = PublicFun.changeString(i.num); } } }, e.prototype.go = function() { this.isAni = !0; var t = this.getOdd(); Tween.to(this.bt, { rotation: 3600 + this.detail[t - 1] }, 5e3, Ease.circInOut, Handler.create(this, function() { this.bt.rotation = this.detail[t - 1], this.isAni = !1; var e = Data.dialMsg[t], i = 0; if ("coins" == e.type) { for (var n = 0, s = 1; s <= 3; s++) { var a = Catalog._MAIN_SCENE.getLevelBuyCoins({ level: Catalog._MAIN_SCENE.getDefaultLevel(s), type: s }); n = a > n ? a : n; } i = CF.getAddCoins(n, LocalStorage.custom) * e.num, Catalog._MAIN_SCENE.changeMoney(i); } else "gem" == e.type && (i = e.num, Catalog._MAIN_SCENE.changeGem(e.num)); Msg.post("Get" + ("coins" == e.type ? "Coins" : "Diamonds") + "x" + PublicFun.changeString(i)); })), this.btn_go.visible = LocalStorage.dialCount > 0; }, e.prototype.close = function() { Catalog._OVER_SCENE.visible || (Catalog._MAIN_SCENE.gameStop = !1), PublicFun.removeBanner(), PublicFun.closeAbout(), this.visible = !1; }, e; }(ui.dialUI), __extends = this && this.__extends || function() { var t = function(e, i) { return (t = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, e) { t.__proto__ = e; } || function(t, e) { for (var i in e) e.hasOwnProperty(i) && (t[i] = e[i]); })(e, i); }; return function(e, i) { function n() { this.constructor = e; } t(e, i), e.prototype = null === i ? Object.create(i) : (n.prototype = i.prototype, new n()); }; }(), DoubleCoin = function(t) { function e() { var e = t.call(this) || this; return e.coinArr = [ 50, 100, 200, 300, 400, 500, 700 ], e.visible = !1, e.init(), e.addEvent(), e; } return __extends(e, t), e.prototype.init = function() { //this.lbl_tips_jbsb.text = "\b持续" + CF.jbsbTime + "秒金币双倍"; this.lbl_tips_jbsb.text = "\bLasts " + 30 + "s coins*2"; }, e.prototype.addEvent = function() { var t = this; this.btn_close.on(Laya.Event.CLICK, this, function() { t.close(); }), this.video_get.on(Laya.Event.CLICK, this, function() { PublicFun.lookAd(function() { CF.curJbsbTime = parseInt(CF.jbsbTime + "") + parseInt(CF.curJbsbTime + ""), LocalStorage.setLS("curJbsbTime", CF.curJbsbTime), LocalStorage.setLS("curJbsbTime", 30), t.close(); }, "Offline"); }); }, e.prototype.play = function(t) { Catalog._MAIN_SCENE.gameStop = !0, this.tipscoin.visible = t, this.visible = !0, PublicFun.isAddB(), PublicFun.addTopAd("mainicon"); }, e.prototype.close = function() { Catalog._OVER_SCENE.visible || (Catalog._MAIN_SCENE.gameStop = !1), this.visible = !1, PublicFun.removeBanner(), PublicFun.closeTopAd(); }, e; }(ui.doublecoinUI), __extends = this && this.__extends || function() { var t = function(e, i) { return (t = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, e) { t.__proto__ = e; } || function(t, e) { for (var i in e) e.hasOwnProperty(i) && (t[i] = e[i]); })(e, i); }; return function(e, i) { function n() { this.constructor = e; } t(e, i), e.prototype = null === i ? Object.create(i) : (n.prototype = i.prototype, new n()); }; }(), GiftScene = function(t) { function e() { var e = t.call(this) || this; return e.plantId = 0, e.skill = 1, e.visible = !1, e.init(), e.addEvent(), e; } return __extends(e, t), e.prototype.init = function() {}, e.prototype.addEvent = function() { this.box_close.on(Laya.Event.CLICK, this, function() { Laya.SoundManager.playSound("sound/click.mp3", 1), this.close(); }), this.gift_close.on(Laya.Event.CLICK, this, function() { Laya.SoundManager.playSound("sound/click.mp3", 1), this.close(); }), this.gift_get.on(Laya.Event.CLICK, this, function() { var t = this; Laya.SoundManager.playSound("sound/click.mp3", 1), PublicFun.lookAd(function() { t.plantId <= 0 || (Catalog._MAIN_SCENE.createnew(t.plantId, !1, !1), t.close()); }, "GIFT"); }), this.box_get.on(Laya.Event.CLICK, this, function() { var t = this; Laya.SoundManager.playSound("sound/click.mp3", 1), PublicFun.lookAd(function() { Catalog._MAIN_SCENE.changeSkill(t.skill, 2), t.close(); }, "GIFT"); }); }, e.prototype.play = function(t) { if (Catalog._MAIN_SCENE.gameStop = !0, PublicFun.isAddB(), PublicFun.addAbout("mainicon"), this.visible = !0, this.box_bg.visible = !t, this.gift_bg.visible = t, PublicFun.popWindow(t ? this.gift_bg : this.box_bg, .9), t) { var e = LocalStorage.deblocking, i = CF.getGift({ 1: e[0], 2: e[1], 3: e[2] }, LocalStorage.custom), n = Data.getPlanData({ type: i.type, level: i.level }); this.gift_img.skin = "flower/" + n.pic + ".png", this.gift_type.skin = "img/zwujs_icon_zwdji" + i.type + ".png", this.gift_level.value = i.level + "", this.gift_name.text = n.name, this.plantId = n.id; } else { console.log("出现") let i = Math.random(); if(i>0.7){ var s = 2; this.skill = s, this.box_img.skin = "img/nczjs_icon_" + 6 + ".png", this.box_count.text = Data.skill[s - 1].name + " +2"; }else if( 0.7> i&&i >0.3){ var s = 1; this.skill = s, this.box_img.skin = "img/nczjs_icon_" + 1 + ".png", this.box_count.text = Data.skill[s - 1].name + " +2"; }else{ var s = 3; this.skill = s, this.box_img.skin = "img/nczjs_icon_" + 4 + ".png", this.box_count.text = Data.skill[s - 1].name + " +2"; } } }, e.prototype.close = function() { Catalog._OVER_SCENE.visible || (Catalog._MAIN_SCENE.gameStop = !1), this.visible = !1, PublicFun.closeAbout(), PublicFun.removeBanner(); }, e; }(ui.giftUI), __extends = this && this.__extends || function() { var t = function(e, i) { return (t = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, e) { t.__proto__ = e; } || function(t, e) { for (var i in e) e.hasOwnProperty(i) && (t[i] = e[i]); })(e, i); }; return function(e, i) { function n() { this.constructor = e; } t(e, i), e.prototype = null === i ? Object.create(i) : (n.prototype = i.prototype, new n()); }; }(), Index = function(t) { function e() { var e = t.call(this) || this; return e.video = null, e.redList3 = [], e.z_index = 0, e.bottomList = [], e.zombiList = [], e.auto_limit = 122, e.auto_time = 0, e.blood_max = 100, e.doubleCoinTime = 0, e.hasBox = !1, e.init(), e.initAni(), e.addEvent(), e.addLoop(), e.loopDoubleCoin(), e.loopBuff(), e; } return __extends(e, t), e.prototype.start = function() { LocalStorage.isGuide ? this.setGuide() : this.play(); }, e.prototype.init = function() { PublicFun.removeBanner(), this.nowCustomData = Data.getFirstWaveByCustom(LocalStorage.custom), this.btn_bk.visible = "wx" == CF.environment, this.btn_av.visible = "tt" == CF.environment, Laya.SoundManager.playMusic("sound/music.mp3", 0), this.addBottom(), this.initHasList(), this.updateMoneyCount(), this.updateBuyBtn(), this.updateSkill(), this.updateGemCount(), this.updateDate(), this.updateCustom(), this.addMsg(), this.updateRoad(), this.paling_red = new Laya.ColorFilter(Zombi.getColorList("#ff0000", 1)); }, e.prototype.initAni = function() { var t = this; !function() { var e = new Timeline(); e.to(t.btn_scene, { scaleX: 1.1, scaleY: 1.1 }, 500).to(t.btn_scene, { scaleX: 1, scaleY: 1 }, 500), e.play(0, !0); }(), function() { var e = new Timeline(); e.to(t.btn_bk, { scaleX: 1.1, scaleY: 1.1 }, 300, null, 500).to(t.btn_bk, { rotation: 5 }, 40).to(t.btn_bk, { rotation: -5 }, 80).to(t.btn_bk, { rotation: 5 }, 80).to(t.btn_bk, { rotation: -5 }, 80).to(t.btn_bk, { rotation: 5 }, 80).to(t.btn_bk, { rotation: -5 }, 80).to(t.btn_bk, { rotation: 0 }, 40).to(t.btn_bk, { scaleX: 1, scaleY: 1 }, 300), e.play(0, !0); }(), function() { var e = new Timeline(); e.to(t.over_red, { alpha: 0 }, 300).to(t.over_red, { alpha: 1 }, 300), e.play(0, !0); }(), function() { var e = new Timeline(); e.to(t.over_img, { scaleX: 1.3, scaleY: 1.3 }, 500).to(t.over_img, { scaleX: 1, scaleY: 1 }, 500), e.play(0, !0); }(); }, e.prototype.setGuide = function() { var t = this; this.guide1.visible = !0, this.guide1.cacheAs = "bitmap"; var e = new Laya.Sprite(); this.guide1.addChild(e), e.blendMode = "destination-out", e.graphics.drawRect(130, 1184, 143, 140, "#fff"); var i = new Laya.TimeLine(); i.to(this.hand1, { y: this.hand1.y + 20 }, 500).to(this.hand1, { y: this.hand1.y }, 500), i.play(0, !0); var n = new Laya.TimeLine(); n.to(this.hand2, { x: 368 }, 1e3), n.play(0, !0), this.g_click.once(Laya.Event.CLICK, this, function() { t.ms1.text = "Buy another one!", t.createnew(10101, !0), t.g_click.once(Laya.Event.CLICK, t, function() { t.guide1.visible = !1, t.guide2.visible = !0, t.createnew(10101, !0); }); }); }, e.prototype.addEvent = function() { var t = this; this.btn_doublecoin.on(Laya.Event.CLICK, this, function() { Laya.SoundManager.playSound("sound/click.mp3", 1), Catalog._DOUBLE_SCENE.play(!1); }), this.btn_close.on(Laya.Event.CLICK, this, function() { Laya.SoundManager.playSound("sound/click.mp3", 1), Catalog._CLOSE_SCENE.visible = !0; }), this.btn_scene.on(Laya.Event.CLICK, this, function() { Laya.SoundManager.playSound("sound/click.mp3", 1), Catalog._SCENEAD_SCENE && Catalog._SCENEAD_SCENE.play(!0); }), this.btn_bk.on(Laya.Event.CLICK, this, function() { Laya.SoundManager.playSound("sound/click.mp3", 1), Catalog._SCENEAD_SCENE && Catalog._SCENEAD_SCENE.play(!0); }), this.btn_sign.on(Laya.Event.CLICK, this, function() { Laya.SoundManager.playSound("sound/click.mp3", 1), Catalog._SIGN_SCENE.show(!1); }); for (var e = function(e) { i["btn_buy" + e].on(_Event.CLICK, i, function() { Laya.SoundManager.playSound("sound/click.mp3", 1); var i = Data.getPlanData({ level: t.getDefaultLevel(e), type: e }); t.createnew(i.id, !0); }); }, i = this, n = 1; n <= 3; n++) e(n); for (var s = function(e) { var i = a["btn_skill" + e], n = i.getChildByName("time"), s = a["skill_time" + e], r = Data.skill[e - 1]; i.on(_Event.CLICK, a, function() { if (Laya.SoundManager.playSound("sound/click.mp3", 1), !n.visible) if (t.changeSkill(e, -1)) { if (t.useSkill(e), r.time <= 0) return; var a = r.time; n.visible = !0, s.text = "00:" + (a > 9 ? a : "0" + a), Laya.timer.loop(1e3, i, function() { a--, s.text = "00:" + (a > 9 ? a : "0" + a), 0 === a && (n.visible = !1, Laya.timer.clearAll(i)); }); } else t.gameStop = !0, PublicFun.lookAd(function() { t.changeSkill(e, 1); }, "SKILL_" + e, function() { Laya.timer.once(200, t, function() { t.gameStop = !1; }); }); }); }, a = this, n = 1; n <= 3; n++) s(n); if (this.btn_setting.on(_Event.CLICK, this, function() { Laya.SoundManager.playSound("sound/click.mp3", 1); var e = 0 === t.setting.x; Tween.to(t.setting, { x: e ? 150 : 0 }, 300, null, Handler.create(t, function() { t.setting_img.scaleX = e ? -1 : 1; })); }), this.btn_book.on(_Event.CLICK, this, function() { Laya.SoundManager.playSound("sound/click.mp3", 1), Catalog._BOOK_SCENE.play(); }), this.btn_music.on(_Event.CLICK, this, function() { Laya.SoundManager.playSound("sound/click.mp3", 1), Laya.SoundManager.musicMuted = !Laya.SoundManager.musicMuted, Laya.SoundManager.soundMuted = !Laya.SoundManager.soundMuted, t.btn_music.skin = "img/zwujs_icon_ceb" + (Laya.SoundManager.musicMuted ? 3 : 2) + ".png"; }), this.btn_shop.on(_Event.CLICK, this, function() { Laya.SoundManager.playSound("sound/click.mp3", 1), Catalog._SHOP_SCENE.play(); }), this.btn_road.on(_Event.CLICK, this, function() { Laya.SoundManager.playSound("sound/click.mp3", 1), Catalog._ROAD_SCENE.play(); }), this.btn_dial.on(_Event.CLICK, this, function() { Laya.SoundManager.playSound("sound/click.mp3", 1), Catalog._DIAL_SCENE.play(); }), this.btn_help.on(_Event.CLICK, this, function() { Laya.SoundManager.playSound("sound/click.mp3", 1), Catalog._MAIN_SCENE.gameStop = !0, PublicFun.isAddB(), PublicFun.addAbout("notice"), t.help.visible = !0, PublicFun.popWindow(t.help.bg, .8); }), this.help.btn_close.on(_Event.CLICK, this, function() { Laya.SoundManager.playSound("sound/click.mp3", 1), Catalog._OVER_SCENE.visible || (Catalog._MAIN_SCENE.gameStop = !1), PublicFun.removeBanner(), PublicFun.closeAbout(), t.help.visible = !1; }), "tt" == CF.environment && Laya.Browser.onWeiXin) { var r = 0, o = window.tt.getGameRecorderManager(); this.btn_av.on(Laya.Event.CLICK, this, this.cutAv), o.onStart(function(e) { console.log("录屏开始"), t.btn_av.skin = "img/av (1).png", t.av_tx.text = "分享录屏", r = Date.now(), t.autoStop = !0; }), o.onStop(function(e) { console.log("录屏结束"), Date.now() - r >= 3e3 ? t.autoStop ? (t.video = e, t.postMsg("录屏已达到最大时长,已自动保存录屏,点击分享录屏即可操作录屏", !0)) : (t.btn_av.skin = "img/av (2).png", t.av_tx.text = "录屏", window.tt.shareAppMessage({ channel: "video", extra: e })) : (t.btn_av.skin = "img/av (2).png", t.av_tx.text = "录屏", t.postMsg("录屏时间超过3秒才能分享")); }); } }, e.prototype.showPanelSign = function() { Catalog._SIGN_SCENE.show(!1); }, e.prototype.updateDoubleCoinTime = function() { if (CF.curJbsbTime) { var t = Math.floor(CF.curJbsbTime / 60), e = Math.floor(CF.curJbsbTime - 60 * t), i = "" + t, n = "" + e; t < 10 && (i = "0" + t), e < 10 && (n = "0" + e), this.lbl_double_minute.text = i + ":" + n; } }, e.prototype.loopBuff = function() { Laya.timer.loop(1e3, this, function() { CF.buff_kbspeed.time > 0 && CF.buff_kbspeed.time--; }); }, e.prototype.loopDoubleCoin = function() { var t = this; Laya.timer.loop(1e3, this, function() { CF.curJbsbTime > 0 ? (t.updateDoubleCoinTime(), CF.curJbsbTime--, LocalStorage.setLS("curJbsbTime", CF.curJbsbTime), t.lbl_double_minute.visible = !0) : (t.lbl_double_minute.text = "00:00", t.lbl_double_minute.visible = !1); }); }, e.prototype.addAD = function() { var t = PublicFun.ADlist.mainicon, e = 0, i = this.ad_sp, n = this.ad_img; n.skin = t[e].PicUrl, console.log("mainicon-------------------------------", t[e]); var s = new Laya.Sprite(); s.graphics.drawPath(0, 0, PublicFun.getMaskPath(n.width, n.height, 30), "#fff"), n.mask = s; var a = new TimeLine(); a.to(i, { rotation: 20 }, 300, null, 300).to(i, { rotation: -20 }, 600).to(i, { rotation: 10 }, 450).to(i, { rotation: -10 }, 300).to(i, { rotation: 0 }, 150), a.play(0, !0), n.on(_Event.CLICK, this, function() { if (Browser.onWeiXin) { var i = t[e]; PublicFun.cpamanager.CPATurn({ appid: i.appid, path: i.path, posid: "mainicon", callback: function(t) { t ? console.log("=====跳转成功") : (console.log("=====跳转失败"), Catalog._SCENEAD_SCENE && Catalog._SCENEAD_SCENE.play()); } }), e++, e %= t.length, n.skin = t[e].PicUrl; } }); }, e.prototype.cutAv = function() { var t = window.tt.getGameRecorderManager(); "img/av (1).png" == this.btn_av.skin ? this.video ? (window.tt.shareAppMessage({ channel: "video", extra: this.video }), this.btn_av.skin = "img/av (2).png", this.av_tx.text = "录屏", this.video = null) : (this.autoStop = !1, t.stop()) : t.start({ duration: 300 }); }, e.prototype.addLoop = function() { Laya.timer.loop(10, this, this.loop), Laya.timer.loop(1e3 * CF.giftTime, this, function() { console.log("loop Gift.create"), Catalog._GIFT_SCENE.visible || LocalStorage.isGuide || Gift.create(); }); }, e.prototype.loop = function() { var t = this, e = Date.now(); CF.list.forEach(function(i, n) { if (!(!i || i.level <= 0 || i.isGift)) if (i.ani || t.gameStop) i.attack_time_old = e; else { var s = e - i.attack_time_old; if (i.attack_time += s, i.attack_time_old = e, i.buff_atkspeed.time > 0 && (i.buff_atkspeed.time -= s, i.buff_atkspeed.time <= 0 && (i.buff_atkspeed.value = 0)), i.buff_ani.visible = i.buff_atkspeed.time > 0, i.buff_ani.visible || (i.buff_ani.visible = CF.buff_kbspeed.time > 0), i.attack_time >= i.cd / (LocalStorage.strong > 0 ? 2 : 1 + (1 === i.variation ? .5 : 0) + i.buff_atkspeed.value + CF.buff_kbspeed.value)) { i.x; for (var a = i.y, r = 0, o = t.zombiList; r < o.length; r++) { var h = o[r]; if (!h.die && (h.line == i.index % 5 + 1 && !(a - h.y > 1.2 * i.attack_range))) { i.attack(); break; } } i.attack_time > i.cd && i.ani_index; } } }); for (var i = function(t) { if (!t.isS || t.die) return "continue"; if (n.gameStop) return t.move_time = e, "continue"; var i = e - t.move_time; if (t.move_time = e, t.shieldAni.visible = t.shield > 0, t.shield_bottom.visible = t.shield > 0, t.delay_time > 0 && (t.delay_time -= i), t.poison_time > 0 && (t.poison_time -= i), t.frozen > 0 ? t.skeleton && (t.skeleton.filters = [ t.lens[1] ]) : t.delay_time > 0 ? t.skeleton && (t.skeleton.filters = [ t.lens[0] ]) : (t.skeleton && (t.skeleton.filters = []), t.frozenAni.visible = !1), t.blood_top.skin = "img/zwujs_jindt_xuet" + (t.poison_time > 0 ? 4 : 3) + ".png", t.frozen > 0) return t.frozen -= i, t.frozen <= 0 && t.skeleton && t.skeleton.resume(), "continue"; if ("0" != t.data.invisible && (1 != t.alpha ? (t.skill.invisible -= i, t.skill.invisible <= 0 && (t.alpha = 1, t.skill.invisible_time = e)) : e - t.skill.invisible_time > 1e3 * t.data.invisibleCD && (t.skill.invisible = t.skill.invisible_value, t.alpha = .5)), t.y >= 700 && e - t.attack_old > 1e3 * t.skin_data.attackCD) return t.attack_old = e, t.addAni(1), "continue"; if (t.data.flash > 0 && e - t.skill.flash_time > 1e3 * t.data.flash) return t.skill.flash_time = e, t.alpha = .9, Laya.timer.once(1e3, n, function() { t.alpha = 0; }), t.addAni(3), "continue"; var s = i * t.speed / CF.speedRadix * (t.delay_time > 0 ? t.delay : 1); t.y += s, t.y = t.y > 700 ? 700 : t.y, t.zOrder = t.y; }, n = this, s = 0, a = this.zombiList; s < a.length; s++) { i(p = a[s]); } e = Date.now(); for (var r = 0; r < this.bullet_sp._childs.length; r++) { var o = this.bullet_sp._childs[r]; if ("id" in o) if (this.gameStop) o.move_time = e; else { var h = e - o.move_time; o.move_time = e; var l = h * o.speed / CF.speedRadix; if (0 == o.ro) o.y -= l * o.up; else { var u = l * Math.sin(o.ro / 180 * Math.PI), c = l * Math.cos(o.ro / 180 * Math.PI); o.x += u, o.y -= c; } if (o.data.spin > 0 && (o.rotation += o.data.spin), o.y < 0) { if (0 === o.data.huili) { o.del(); continue; } o.up = -1, o.y = 0, o.zombiList.length = 0; } if (o.y > 1334 || o.x < 0 || o.x > 750) o.del(); else { var _ = o.getBounds(); t: for (var d = 0; d < this.zombiList.length; d++) { var p = this.zombiList[d]; if (!p.die && 1 == p.alpha && ((-1 == o.line || p.line == o.line) && -1 == o.zombiList.indexOf(p.nick))) { var f = p.getBounds().intersection(_); if (f && f.width * f.height > .5 * _.width * _.height) { if (o.data.push > 0 && (p.y -= o.data.push), "0" == o.data.effect_Hit) { Wind.create({ x: o.x, y: o.y }, o.data.circular), o.del(); break t; } if (Boom.create({ x: o.x, y: o.y }, o.data.effect_Hit), o.zombiList.push(p.nick), p.hit(o.getHurt()) && (this.zombiList.splice(d, 1), this.updateWave()), "0" != o.data.towRay && o.towRay(), o.data.chuantou <= 0) { o.del(); break t; } } } } } } } }, e.prototype.play = function() { this.gameStop = !1, this.zombi_sp.removeChildren(), this.zombiList = []; var t = this.nowCustomData; this.level_ms.width = 0, console.log(t), this.level_count.value = t.turn, this.blood = 0, this.changeBlood(this.blood_max), 1 === t.turn ? this.startCustomAni(!0) : t.turn === t.allTurn ? this.startCustomAni(!1) : this.addTask(); }, e.prototype.startCustomAni = function(t) { t ? (this.cut_count.value = LocalStorage.custom + "", this.cutscene.visible = !0, this.cutscene_img.x = 750, Tween.to(this.cutscene_img, { x: 0 }, 1e3), Tween.to(this.cutscene_img, { x: -750 }, 500, null, Handler.create(this, this.addTask), 2e3)) : (this.over_boss.visible = !0, Laya.timer.once(1500, this, this.addTask)); }, e.prototype.addTask = function() { var t = this; this.over_boss.visible = !1, this.cutscene.visible = !1; var e = this.nowCustomData; this.cuttx.text = "Wave" + e.turn + "", this.cuttx.visible = !0, this.cuttx.y = 490, Tween.to(this.cuttx, { y: 350 }, 800, null, Handler.create(this, function() { t.cuttx.visible = !1; })); var i = e.monsterId.split(",").map(function(t) { return Number(t); }), n = e.monstrCount.split(",").map(function(t) { return Number(t); }), s = n.reduce(function(t, e) { return t + e; }); console.log(s, i, n); for (var a = 0, r = 3, o = function(t) { var s = []; n.forEach(function(t, e) { t > 0 && s.push(e); }); var o = s[Math.floor(Math.random() * s.length)]; n[o]--; var l = i[o]; console.log("创造僵尸id:", l, "第" + r + "行"); var u = Laya.Pool.getItemByClass("zombi", Zombi); h.zombi_sp.addChild(u), h.zombiList.push(u), u.init(l, e.hp, r), Laya.timer.once(a, h, function() { u.start(); }), a += 1e3 * CF.zombiTime, r = 1 != (r = 6 == (r = 5 != ++r || h.bt_5.visible ? r : 1) ? 1 : r) || h.bt_1.visible ? r : 2; }, h = this, l = 0; l < s; l++) o(); }, e.prototype.changeBlood = function(t) { this.blood += t, this.blood = Math.max(0, this.blood), this.blood = Math.min(this.blood_max, this.blood), this.blood_img.width = this.blood / this.blood_max * 78, this.blood_show.text = this.blood + "/" + this.blood_max, this.blood <= 0 && this.over(); }, e.prototype.updateWave = function() { var t = this.nowCustomData; this.level_ms.width = (t.allCount - this.zombiList.length) / t.allCount * 135; }, e.prototype.next = function() { console.log("完成"); window['uptap'].ShowScreenVideo("下一关",()=>{ var t = this.nowCustomData; if (t.turn === t.allTurn) LocalStorage.custom = Math.min(LocalStorage.custom + 1, 190), this.nowCustomData = Data.getFirstWaveByCustom(LocalStorage.custom), Catalog._OVER_SCENE.play(!0, this.nowCustomData.waveMoney), LocalStorage.setCustom(), this.updateBottom(); else { var e = t.nextId; this.nowCustomData = Data.getCustomByid(e), this.play(); } }); }, e.prototype.over = function() { this.gameStop = !0, console.log("over"), console.log(this.nowCustomData.turn), Catalog._OVER_SCENE.play(!1, 0, 1 != this.nowCustomData.turn); }, e.prototype.useSkill = function(t) { var e = Data.skill[t - 1]; if (Msg.post("" + e.name), 1 === t) for (var i = 0, n = this.zombiList; i < n.length; i++) { (o = n[i]).die || (o.startFrozen(), o.frozen = 1e3 * e.time); } else if (2 === t) { for (var s = 0, a = function(t) { Laya.timer.once(s, r, function() { Rock.create({ x: 100 * t + 125, y: 0 }); }), s += 100; }, r = this, o = 0; o < 5; o++) a(o); for (var h = 0, l = this.zombiList; h < l.length; h++) { if (!((o = l[h]).die || 1 != o.alpha || o.y <= 0)) { o.hit({ count: o.bloodMax * (0 === o.data.isBoss ? e.value : e.bossvalue), delay: null, poison: null, die: !1, circular: 0, frozen: 0 }); } } } else if (3 === t) for (var u = 0, c = CF.list; u < c.length; u++) { (o = c[u]) && !o.isGift && (o.buff_atkspeed.time = 1e3 * e.time, o.buff_atkspeed.value = e.value); } }, e.prototype.initHasList = function() { for (var t = 0; t < LocalStorage.initList.length; t++) if (LocalStorage.initList[t] && 0 != LocalStorage.initList[t]) { var e = LocalStorage.initList[t]; this.createnew(e.id, !1, !1, e.variation, t); } }, e.prototype.addFly = function() {}, e.prototype.addBottom = function() { for (var t = this, e = function(e) { var n = i["bt_" + e]; i.bottomList.push(n); var s = n.getChildByName("btn"), a = n.getChildByName("count"); if (s && a) { var r = LocalStorage.soilList[e - 1].cost; r > 0 ? (a.text = PublicFun.changeString(r), n.on(_Event.CLICK, i, function() { s.visible && t.changeMoney(-1 * r) && (LocalStorage.soilList[e - 1].cost = 0, LocalStorage.setSoilList(), s.visible = !1, a.visible = !1); })) : (s.visible = !1, a.visible = !1); } var o = new Img("img/shockball_03.png"); n.addChild(o), o.anchorX = .5, o.anchorY = .5, o.pos(58, 51); var h = new Timeline(); o.scale(.6, .6), h.to(o, { scaleX: 1.2, scaleY: 1.2, alpha: 0 }, 1e3), h.play(0, !0), o.visible = !1, o.name = "ray"; }, i = this, n = 1; n <= 15; n++) e(n); this.updateBottom(); }, e.prototype.updateBottom = function() { for (var t = 1; t <= 15; t++) { var e = this["bt_" + t], i = LocalStorage.soilList[t - 1].guanka; e.visible = LocalStorage.custom >= i; } }, e.prototype.closeBt = function() { for (var t = 0, e = this.bottomList; t < e.length; t++) { e[t].getChildByName("ray").visible = !1; } }, e.prototype.getPosition = function(t) { var e = this.bottomList[t].localToGlobal(new Point(58, 73)); CF.list[t].pos(e.x, e.y); }, e.prototype.createnew = function(t, e, i, n, s, a) { var r = this; void 0 === e && (e = !1), void 0 === i && (i = !1), void 0 === n && (n = 0), void 0 === s && (s = -1), void 0 === a && (a = !1); var o; if (CF.list.some(function(t, e) { var i = r.bottomList[e], n = i.getChildByName("btn"); return !(null != t || -1 != s && s != e || !i.visible || n && (!n || n.visible)) && (o = e, !0); })) { var h = Data.getPlanData({ id: t }); if (e) { if (!this.changeMoney(-1 * this.getLevelBuyCoins({ level: h.level, type: h.type }))) return !1; LocalStorage.shopPrice[h.type - 1][h.level - 1]++, LocalStorage.setBuyMoney(), this.updateBuyBtn(); } if (i && !this.changeGem(-1 * h.diamond)) return Msg.post("Lack of gemstone"), !1; var l = Laya.Pool.getItemByClass("plant", Plant); return this.bottom_sp.addChild(l), l.init(h.id, o, n, a), CF.list[o] = l, this.getPosition(o), LocalStorage.setHasList(), console.log("isBuy :" + e), e && Catalog._LEVELUP_SCENE.play(l.index), !0; } return (e || i) && Msg.post("Space full"), !1; }, e.prototype.createCoins = function(t, e, i, n) { void 0 === n && (n = !1); for (var s = 0, a = function(t) { var a = Laya.Pool.getItemByClass("coins", Coins), o = CF.coinsRandom; r.addChild(a), a.pos(e + (n ? Math.random() * o - .5 * o : 0), i + (n ? Math.random() * o - .5 * o : 0)), Laya.timer.once(s, r, function() { a.start(); }), s += 50; }, r = this, o = 0; o < t; o++) a(); }, e.prototype.updateDress = function(t) { CF.list[t].updateShow(); }, e.prototype.updateDate = function() { var t = PublicFun.getMyDate(); -1 == LocalStorage.newDate.indexOf(t) && (LocalStorage.newDate.push(t), LocalStorage.setNewDate(), LocalStorage.dialCount = 1, LocalStorage.setDialCount()); }, e.prototype.updateRoad = function() { var t = LocalStorage.paling, e = Data.paling[t - 1]; this.paling.skin = "img/" + e.pic + ".png", this.road_sign.skin = "img/" + e.zhaopai + ".png", this.blood_max = e.hp; }, e.prototype.updateSkill = function(t) { void 0 === t && (t = 0); for (var e = 1; e <= 3; e++) if (0 == t || e == t) { var i = this["btn_skill" + e], n = i.getChildByName("count"), s = i.getChildByName("ad"), a = LocalStorage.skill[e - 1]; n.visible = a > 0, s.visible = a <= 0, this["skill_count" + e].text = a; } }, e.prototype.changeSkill = function(t, e) { return !(LocalStorage.skill[t - 1] + e < 0) && (LocalStorage.skill[t - 1] += e, LocalStorage.setSkill(), this.updateSkill(t), !0); }, e.prototype.updateMoneyCount = function() { this.money_count.text = PublicFun.changeString(LocalStorage.moneyCount); }, e.prototype.updateGemCount = function() { this.gem_count.text = PublicFun.changeString(LocalStorage.gemCount); }, e.prototype.updateBuyBtn = function() { for (var t = 1; t <= 3; t++) { var e = { level: this.getDefaultLevel(t), type: t }, i = Data.getPlanData(e); this["buy_img" + t].skin = "flower/" + i.pic + ".png", this["buy_count" + t].text = PublicFun.changeString(this.getLevelBuyCoins(e)); } }, e.prototype.updateCustom = function() { var t = LocalStorage.custom; this.level_now.value = t + ""; }, e.prototype.getDefaultLevel = function(t) { return LocalStorage.deblocking[t - 1] > CF.differLevel ? LocalStorage.deblocking[t - 1] - CF.differLevel : 1; }, e.prototype.getLevelBuyCoins = function(t) { var e = Data.getPlanData(t); return Math.ceil(e.sale * Math.pow(e.saleRate + 1, LocalStorage.shopPrice[e.type - 1][e.level - 1])); }, e.prototype.changeMoney = function(t) { return LocalStorage.moneyCount + t < 0 ? (Catalog._COINREWARD_SCENE.getCoinRewardTime() ? Catalog._COINREWARD_SCENE.play() : CF.curJbsbTime ? Catalog._ADD_SCENE.play() : Catalog._DOUBLE_SCENE.play(!0), !1) : (LocalStorage.moneyCount += t, LocalStorage.setMoneyCount(), this.updateMoneyCount(), !0); }, e.prototype.changeGem = function(t) { return !(LocalStorage.gemCount + t < 0) && (LocalStorage.gemCount += t, LocalStorage.setGemCount(), this.updateGemCount(), !0); }, e.prototype.addMsg = function() { var t = new Laya.Sprite(); this.addChild(t), t.pos(190, 500); var e = new Laya.Sprite(); t.addChild(e), e.graphics.drawPath(0, 0, PublicFun.getMaskPath(360, 180, 20), "#000"), e.alpha = .7; var i = new Laya.Text(); t.addChild(i), i.name = "tx", i.size(320, 180).pos(20, 0), i.color = "#fff", i.align = "center", i.valign = "middle", i.fontSize = 30, i.wordWrap = !0, t.alpha = 0, this.msg_sp = t; }, e.prototype.postMsg = function(t, e) { void 0 === e && (e = !1); var i = this.msg_sp.getChildByName("tx"); 0 == this.msg_sp.alpha ? (this.msg_sp.alpha = 1, i.text = t, Laya.Tween.to(this.msg_sp, { alpha: 0 }, 500, null, Laya.Handler.create(this, function() { i.text = 0; }), 2e3)) : e && (i.text = t); }, e.prototype.updateRed = function() {}, e; }(ui.indexUI), __extends = this && this.__extends || function() { var t = function(e, i) { return (t = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, e) { t.__proto__ = e; } || function(t, e) { for (var i in e) e.hasOwnProperty(i) && (t[i] = e[i]); })(e, i); }; return function(e, i) { function n() { this.constructor = e; } t(e, i), e.prototype = null === i ? Object.create(i) : (n.prototype = i.prototype, new n()); }; }(), Levelup = function(t) { function e() { var e = t.call(this) || this; return e.init(), e.addEvent(), e.visible = !1, e; } return __extends(e, t), e.prototype.init = function() {}, e.prototype.addEvent = function() { this.btn_close.on(_Event.CLICK, this, function() { Laya.SoundManager.playSound("sound/click.mp3", 1), this.close(); }), this.btn_ad.on(_Event.CLICK, this, function() { var t = this; Laya.SoundManager.playSound("sound/click.mp3", 1), PublicFun.lookAd(function() { CF.list[t.index].id = t.id, Catalog._MAIN_SCENE.updateDress(t.index), t.close(); }, "POP_LEVELUP"); }); }, e.prototype.play = function(t) { var e = this, i = CF.list[t], n = LocalStorage.deblocking[i.type - 1]; if (CF.list[t].level >= n - 6 && CF.list[t].level <= n - 2) { var s = 0; switch (CF.list[t].level) { case n - 6: s = CF.levelUpOdd[0]; break; case n - 5: s = CF.levelUpOdd[1]; break; case n - 4: s = CF.levelUpOdd[2]; break; case n - 3: s = CF.levelUpOdd[3]; break; case n - 2: s = CF.levelUpOdd[4]; } if (!(Math.random() >= s)) { Catalog._MAIN_SCENE.gameStop = !0, this.visible = !0, PublicFun.popWindow(this.bg, .8), PublicFun.isAddB(!1), PublicFun.addAbout("mainicon"), this.index = t; CF.list[t].level; this.img1.skin = i.skin; var a = Data.getPlanData({ level: i.level + 1, type: i.type }); this.id = a.id, this.img2.skin = "flower/" + a.pic + ".png", this.btn_close.visible = !1, Laya.timer.once(2e3, this, function() { e.btn_close.visible = !0; }); } } }, e.prototype.close = function() { Catalog._OVER_SCENE.visible || (Catalog._MAIN_SCENE.gameStop = !1), this.visible = !1, PublicFun.removeBanner(), PublicFun.closeAbout(); }, e; }(ui.levelupUI), __extends = this && this.__extends || function() { var t = function(e, i) { return (t = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, e) { t.__proto__ = e; } || function(t, e) { for (var i in e) e.hasOwnProperty(i) && (t[i] = e[i]); })(e, i); }; return function(e, i) { function n() { this.constructor = e; } t(e, i), e.prototype = null === i ? Object.create(i) : (n.prototype = i.prototype, new n()); }; }(), Like = function(t) { function e() { var e = t.call(this) || this; return e.adName = "gameover", e; } return __extends(e, t), e.prototype.init = function() { var t = 2, e = 45, i = [], n = new Sprite(); this.addChild(n), n.size(750, 214).pos(0, 1120); for (var s = function(s) { var r = PublicFun.ADlist[a.adName][s], o = new Sprite(); n.addChild(o), o.size(140, 140).pos(e, 37); var h = new Sprite(); o.addChild(h), h.alpha = .5, h.size(140, 140), h.graphics.drawRect(0, 0, 140, 140, "#fff"); var l = new Laya.Sprite(); l.graphics.drawPath(0, 0, PublicFun.getMaskPath(140, 140, 25), "#fff"), h.mask = l; var u = new Img(r.PicUrl); o.addChild(u), u.size(120, 120).pos(10, 10); var c = new Laya.Sprite(); if (c.graphics.drawPath(0, 0, PublicFun.getMaskPath(120, 120, 20), "#000"), u.mask = c, t > 0 && Math.random() < t / (PublicFun.ADlist[a.adName].length - s)) { t--; var _ = new Laya.Image("img/red.png"); o.addChild(_), _.anchorX = .5, _.anchorY = .5, _.size(.4 * u.width, .4 * u.width).pos(u.width + u.x, u.y); var d = new Laya.Text(); _.addChild(d), d.size(_.width, _.height), d.text = "火", d.align = "center", d.valign = "middle", d.fontSize = .6 * d.height, d.color = "#fff"; } i.push(o); var p = a.adName; u.on(_Event.CLICK, a, function() { Browser.onWeiXin && PublicFun.cpamanager.CPATurn({ appid: r.appid, path: r.path, posid: p, callback: function(t) { t ? console.log("=====跳转成功") : (console.log("=====跳转失败"), Catalog._SCENEAD_SCENE && Catalog._SCENEAD_SCENE.play()); } }); }), e += 177; }, a = this, r = 0; r < PublicFun.ADlist[this.adName].length; r++) s(r); Laya.timer.loop(6e3, this, function() { for (var t = function(t) { if (0 != (i[t].x + 177 - 45) % 177) return "continue"; Tween.to(i[t], { x: i[t].x - 177 }, 1e3, null, Handler.create(e, function() { i[t].x < 0 && (i[t].x += 177 * i.length); })); }, e = this, n = 0; n < i.length; n++) t(n); }); }, e; }(ui.likeUI), __extends = this && this.__extends || function() { var t = function(e, i) { return (t = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, e) { t.__proto__ = e; } || function(t, e) { for (var i in e) e.hasOwnProperty(i) && (t[i] = e[i]); })(e, i); }; return function(e, i) { function n() { this.constructor = e; } t(e, i), e.prototype = null === i ? Object.create(i) : (n.prototype = i.prototype, new n()); }; }(), Offline = function(t) { function e() { var e = t.call(this) || this; return e.coinArr = [ 50, 100, 200, 300, 400, 500, 700 ], e.visible = !1, e.init(), e.addEvent(), e; } return __extends(e, t), e.prototype.init = function() { var t = 0, e = LocalStorage.getLS("lastlogintime"); if (e) { t = parseInt(e); var i = Math.round(new Date().valueOf() / 1e3) - t; i > 600 && (i > 72e3 && (i = 72e3), this.offlineCoin = Math.round(i / 5), this.offlineLbl.text = "+" + PublicFun.changeString(this.offlineCoin), LocalStorage.setLS("offlineCoin", this.offlineCoin), PublicFun.isAddB()); } else this.saveTime(); }, e.prototype.saveTime = function() { var t = Math.round(new Date().valueOf() / 1e3); LocalStorage.setLS("lastlogintime", t); }, e.prototype.addEvent = function() { this.common_get.on(Laya.Event.CLICK, this, function() { this.visible = !1, LocalStorage.moneyCount += this.offlineCoin, LocalStorage.setMoneyCount(), Catalog._MAIN_SCENE.updateMoneyCount(), Msg.post("Coins " + PublicFun.changeString(this.offlineCoin)), LocalStorage.setLS("offlineCoin", 0); var t = Math.round(new Date().valueOf() / 1e3); LocalStorage.setLS("lastlogintime", t), this.close(); }), this.video_get.on(Laya.Event.CLICK, this, function() { var t = this; PublicFun.lookAd(function() { t.offlineCoin = 3 * t.offlineCoin, LocalStorage.moneyCount += t.offlineCoin, LocalStorage.setMoneyCount(), Catalog._MAIN_SCENE.updateMoneyCount(), Msg.post("Coins " + PublicFun.changeString(t.offlineCoin)), LocalStorage.setLS("offlineCoin", 0); var e = Math.round(new Date().valueOf() / 1e3); LocalStorage.setLS("lastlogintime", e), t.close(); }, "Offline"); }); }, e.prototype.play = function() { Catalog._MAIN_SCENE.gameStop = !0; var t = LocalStorage.getLS("offlineCoin"); console.log("offline play offlineCoin>" + t), t ? (this.visible = !0, PublicFun.isAddB(), PublicFun.addTopAd("mainicon")) : this.close(); }, e.prototype.close = function() { Catalog._OVER_SCENE.visible || (Catalog._MAIN_SCENE.gameStop = !1), this.visible = !1, PublicFun.removeBanner(), PublicFun.closeTopAd(); }, e; }(ui.offlineUI), __extends = this && this.__extends || function() { var t = function(e, i) { return (t = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, e) { t.__proto__ = e; } || function(t, e) { for (var i in e) e.hasOwnProperty(i) && (t[i] = e[i]); })(e, i); }; return function(e, i) { function n() { this.constructor = e; } t(e, i), e.prototype = null === i ? Object.create(i) : (n.prototype = i.prototype, new n()); }; }(), Over = function(t) { function e() { var e = t.call(this) || this; return e.count = 0, e.visible = !1, e.init(), e.addEvent(), e; } return __extends(e, t), e.prototype.init = function() {}, e.prototype.addEvent = function() { this.btn_get.on(_Event.CLICK, this, function() { var t = this; Laya.SoundManager.playSound("sound/click.mp3", 1), this.done_img.visible ? PublicFun.lookAd(function() { t.get(!0); }, "OVER_GET") : this.get(!1); }), this.over_close.on(_Event.CLICK, this, function() { Laya.SoundManager.playSound("sound/click.mp3", 1), console.log("over_close"), console.log(CF.buff_kbspeed), this.close(), Catalog._MAIN_SCENE.nowCustomData = Data.getFirstWaveByCustom(LocalStorage.custom), Catalog._MAIN_SCENE.play(); }), this.btn_done.on(_Event.CLICK, this, function() { Laya.SoundManager.playSound("sound/click.mp3", 1), this.done_img.visible = !this.done_img.visible; }), this.over_ad.on(_Event.CLICK, this, function() { var t = this; Laya.SoundManager.playSound("sound/click.mp3", 1), PublicFun.lookAd(function() { t.close(), CF.kuangbao = !0, CF.buff_kbspeed = { time: 30, value: .5 }, Catalog._MAIN_SCENE.play(); }, "OVER_DIE"); }); }, e.prototype.play = function(t, e, i) { var n = this; void 0 === e && (e = 0), void 0 === i && (i = !0), this.visible || (i = !0, PublicFun.isAddB(), PublicFun.addAbout("gameover"), this.visible = !0, PublicFun.popWindow(this.bg, .8), Laya.SoundManager.playSound("sound/" + (t ? "win" : "fail") + ".mp3", 1), this.done.visible = t, this.over.visible = !t, t ? (this.count = e, this.done_img.visible = !0, this.num.text = "+" + PublicFun.changeString(e)) : (this.over_ad.visible = i, this.over_close.visible = !1, i ? Laya.timer.once(2e3, this, function() { n.over_close.visible = !0; }) : this.over_close.visible = !0)); }, e.prototype.get = function(t) { Catalog._MAIN_SCENE.createCoins(10, 321, 800, !0), Catalog._MAIN_SCENE.changeMoney(Math.floor(this.count * (t ? 2 : 1))), this.close(), PublicFun.showInterstitialAd(), Catalog._MAIN_SCENE.play(), Catalog._MAIN_SCENE.updateCustom(); }, e.prototype.close = function() { this.visible = !1, PublicFun.removeBanner(), PublicFun.closeAbout(); }, e; }(ui.overUI), __extends = this && this.__extends || function() { var t = function(e, i) { return (t = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, e) { t.__proto__ = e; } || function(t, e) { for (var i in e) e.hasOwnProperty(i) && (t[i] = e[i]); })(e, i); }; return function(e, i) { function n() { this.constructor = e; } t(e, i), e.prototype = null === i ? Object.create(i) : (n.prototype = i.prototype, new n()); }; }(), Road = function(t) { function e() { var e = t.call(this) || this; return e.init(), e.addEvent(), e.visible = !1, e; } return __extends(e, t), e.prototype.init = function() {}, e.prototype.addEvent = function() { this.btn_close.on(_Event.CLICK, this, function() { Laya.SoundManager.playSound("sound/click.mp3", 1), this.close(); }); }, e.prototype.play = function() { Catalog._MAIN_SCENE.gameStop = !0, PublicFun.isAddB(), PublicFun.addAbout("notice"), this.visible = !0, PublicFun.popWindow(this.bg, .7), this.addList(); }, e.prototype.addList = function() { this.array && this.array.destroy && this.array.destroy(); var t = new List(); this.list.addChild(t), this.list = t, t.itemRender = ItemRoad, t.cacheContent = !0, t.size(680, 853); var e = Data.paling.length; t.repeatX = 1, t.repeatY = e, t.vScrollBarSkin = "", t.renderHandler = new Handler(this, function(t, e) { t.setImg(e); }), t.array = function() { for (var t = [], i = 0; i < e; i++) t.push(i); return t; }(); }, e.prototype.close = function() { Catalog._OVER_SCENE.visible || (Catalog._MAIN_SCENE.gameStop = !1), PublicFun.removeBanner(), PublicFun.closeAbout(), this.visible = !1; }, e; }(ui.roadUI), ItemRoad = function(t) { function e() { var e = t.call(this) || this; e.size(600, 170), e.bg = new Img("img/nczjs_kuan_zhlk1.png"), e.addChild(e.bg), e.bg.size(600, 160), e.bg.sizeGrid = "26,20,18,26", e.img = new Img(), e.bg.addChild(e.img), e.img.pos(19, 19), e.title = new Txt(), e.bg.addChild(e.title), e.title.bold = !0, e.title.color = "#6b2104", e.title.pos(166, 19), e.title.fontSize = 30, e.title.bold = !0, e.desc = new Txt(), e.bg.addChild(e.desc), e.desc.size(236, 27).pos(166, 60), e.desc.wordWrap = !0, e.desc.fontSize = 22, e.desc.color = "#93520a", e.lockI = new Img("img/nczjs_icon_7.png"), e.bg.addChild(e.lockI), e.lockI.pos(439, 68), e.btn = new Img("img/zwujs_button_huan1.png"), e.bg.addChild(e.btn), e.btn.size(156, 67).pos(416, 47), e.btn.sizeGrid = "12,12,18,16"; var i = new Txt(); return e.btn.addChild(i), i.size(117, 36).pos(19, 15), i.align = "center", i.fontSize = 36, i.bold = !0, i.text = "Use", i.color = "#b2480d", e; } return __extends(e, t), e.prototype.setImg = function(t) { var e = this, i = t + 1, n = Data.paling[t]; this.img.skin = "img/" + n.icon + ".png", this.title.text = n.name, this.desc.text = n.desc, this.btn.visible = LocalStorage.paling != i, this.btn.disabled = LocalStorage.custom < n.num, this.btn.on(_Event.CLICK, this, function() { e.btn.visible = !1, LocalStorage.paling = i, LocalStorage.setPaling(), Catalog._MAIN_SCENE.updateRoad(), Catalog._ROAD_SCENE.addList(); }); }, e; }(Laya.Box), __extends = this && this.__extends || function() { var t = function(e, i) { return (t = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, e) { t.__proto__ = e; } || function(t, e) { for (var i in e) e.hasOwnProperty(i) && (t[i] = e[i]); })(e, i); }; return function(e, i) { function n() { this.constructor = e; } t(e, i), e.prototype = null === i ? Object.create(i) : (n.prototype = i.prototype, new n()); }; }(), SceneAD = function(t) { function e() { var e = t.call(this) || this; return e.adName = "gameover", e.index = 0, e.init(), e.addEvent(), e; } return __extends(e, t), e.prototype.init = function() { console.log("SceneAD"), this.visible = !1, this.setHead(), this.setAD(), this.pl.vScrollBarSkin = ""; }, e.prototype.addEvent = function() { this.btn_close.on(_Event.CLICK, this, function() { Laya.SoundManager.playSound("sound/click.mp3", 1), this.close(); }); }, e.prototype.setHead = function() { var t = this; console.log("setHead"); var e = PublicFun.ADlist.mainbanner; if (console.log(e), 0 != e.length) { var i = 0; this.head_img.skin = e[i].PicUrl; var n = new TimeLine(); n.to(this.head_play, { scaleX: 1.2, scaleY: 1.2 }, 500).to(this.head_play, { scaleX: 1, scaleY: 1 }, 500), n.play(0, !0), Laya.timer.loop(5e3, this, function() { i++, i %= e.length, t.head_img.skin = e[i].PicUrl; }), this.head_play.on(Laya.Event.CLICK, this, function() { if (Browser.onWeiXin) { var t = e[i]; PublicFun.cpamanager.CPATurn({ appid: t.appid, path: t.path, posid: "mainbanner", callback: function(t) { t ? console.log("=====跳转成功") : console.log("=====跳转失败"); } }); } }); } }, e.prototype.setAD = function() { for (var t = 0, e = 0, i = [ { title: "热门新游", count: 4 }, { title: "好玩推荐", count: 8 }, { title: "经典爆款", count: 8 } ]; e < i.length; e++) { var n = i[e]; t += 20; var s = new Txt(); this.pl.addChild(s), s.text = n.title, s.size(300, 50).pos(0, t), s.color = "#000", s.fontSize = 40; var a = 35; t += 60; for (var r = function(e) { var i = o.getCPAObj(), n = new Sprite(); o.pl.addChild(n), n.pos(a, t); var s = new Img(i.PicUrl); n.addChild(s), s.size(140, 140); var r = new Laya.Sprite(); r.graphics.drawPath(0, 0, PublicFun.getMaskPath(140, 140, 26), "#000"), s.mask = r; var h = new Txt(); n.addChild(h), h.size(s.width, 28).y = s.height + 12, h.text = i.name, h.overflow = Txt.HIDDEN, h.color = "#000", h.fontSize = 28, h.align = "center"; var l = o.adName; s.on(_Event.CLICK, o, function() { Browser.onWeiXin && PublicFun.cpamanager.CPATurn({ appid: i.appid, path: i.path, posid: l, callback: function(t) { t ? console.log("=====跳转成功") : console.log("=====跳转失败"); } }); }), a += 180, (e + 1) % 4 == 0 && (a = 35, t += 200); }, o = this, h = 0; h < n.count; h++) r(h); } var l = new Sprite(); this.pl.addChild(l), l.size(100, 100).y = t; }, e.prototype.getCPAObj = function() { var t = this.index++; return this.index >= PublicFun.ADlist[this.adName].length && (this.index = 0), PublicFun.ADlist[this.adName][t]; }, e.prototype.play = function(t) { void 0 === t && (t = !1), Catalog._MAIN_SCENE.gameStop = !0, this.visible = !0, PublicFun.removeBanner(); }, e.prototype.close = function() { Catalog._OVER_SCENE.visible || (Catalog._MAIN_SCENE.gameStop = !1), this.visible = !1; }, e; }(ui.sceneADUI), __extends = this && this.__extends || function() { var t = function(e, i) { return (t = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, e) { t.__proto__ = e; } || function(t, e) { for (var i in e) e.hasOwnProperty(i) && (t[i] = e[i]); })(e, i); }; return function(e, i) { function n() { this.constructor = e; } t(e, i), e.prototype = null === i ? Object.create(i) : (n.prototype = i.prototype, new n()); }; }(), SceneAD1 = function(t) { function e() { var e = t.call(this) || this; return e.adName = "gameover", e.visible = !1, e.addEvent(), e; } return __extends(e, t), e.prototype.init = function() { this.setAD(), this.pl.vScrollBarSkin = ""; }, e.prototype.addEvent = function() { this.btn_close.on(_Event.CLICK, this, function() { Laya.SoundManager.playSound("sound/click.mp3", 1), this.close(); }); }, e.prototype.setAD = function() { for (var t = 120, e = 10, i = function(i) { var s = PublicFun.ADlist[n.adName][i], a = new Sprite(); n.pl.addChild(a), a.pos(t, e).size(150, 200); var r = new Img(s.PicUrl); a.addChild(r), r.size(150, 150); var o = new Laya.Sprite(); o.graphics.drawPath(0, 0, PublicFun.getMaskPath(150, 150, 26), "#000"), r.mask = o; var h = new Txt(); a.addChild(h), h.size(r.width, 25).y = r.height + 10, h.text = s.name, h.overflow = Txt.HIDDEN, h.color = "#000", h.fontSize = 25, h.align = "center"; var l = n.adName; r.on(_Event.CLICK, n, function() { Browser.onWeiXin && PublicFun.cpamanager.CPATurn({ appid: s.appid, path: s.path, posid: l, callback: function(t) { t ? console.log("=====跳转成功") : console.log("=====跳转失败"); } }); }), t += 180, (i + 1) % 3 == 0 && (t = 120, e += 195); }, n = this, s = 0; s < PublicFun.ADlist[this.adName].length; s++) i(s); }, e.prototype.play = function() { Catalog._MAIN_SCENE.gameStop = !0, this.visible = !0, PublicFun.isAddB(); }, e.prototype.close = function() { Catalog._OVER_SCENE.visible || (Catalog._MAIN_SCENE.gameStop = !1), this.visible = !1, PublicFun.removeBanner(); }, e; }(ui.sceneAD1UI), __extends = this && this.__extends || function() { var t = function(e, i) { return (t = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, e) { t.__proto__ = e; } || function(t, e) { for (var i in e) e.hasOwnProperty(i) && (t[i] = e[i]); })(e, i); }; return function(e, i) { function n() { this.constructor = e; } t(e, i), e.prototype = null === i ? Object.create(i) : (n.prototype = i.prototype, new n()); }; }(), Shop = function(t) { function e() { var e = t.call(this) || this; return e.init(), e.addEvent(), e.visible = !1, e; } return __extends(e, t), e.prototype.init = function() {}, e.prototype.addEvent = function() { this.btn_close.on(_Event.CLICK, this, function() { Laya.SoundManager.playSound("sound/click.mp3", 1), this.close(); }); for (var t = function(t) { e["btn_" + t].on(_Event.CLICK, e, function() { Laya.SoundManager.playSound("sound/click.mp3", 1), this.select(t); }); }, e = this, i = 1; i <= 3; i++) t(i); }, e.prototype.play = function() { Catalog._MAIN_SCENE.gameStop = !0, PublicFun.isAddB(), this.visible = !0, PublicFun.popWindow(this.bg), this.select(1), this.addList(1), this.addList(2), this.addList(3); }, e.prototype.select = function(t) { for (var e = 1; e <= 3; e++) this["btn_" + e].skin = "img/book (" + (e === t ? 1 : 2) + ").png", this["list" + e].visible = e === t; }, e.prototype.addList = function(t) { this["array" + t] && this["array" + t].destroy && this["array" + t].destroy(); var e = new List(); this["list" + t].addChild(e), this["array" + t] = e, e.itemRender = ItemShopList, e.cacheContent = !0, e.size(594, 781).x = -10; var i = Data.PlantType[t].length; e.repeatX = 1, e.repeatY = i, e.vScrollBarSkin = "", e.renderHandler = new Handler(this, function(e, i) { e.setImg(i, t); }), e.array = function() { for (var t = [], e = 0; e < i; e++) t.push(e); return t; }(); }, e.prototype.close = function() { Catalog._OVER_SCENE.visible || (Catalog._MAIN_SCENE.gameStop = !1), PublicFun.removeBanner(), this.visible = !1; }, e; }(ui.shopUI), ItemShopList = function(t) { function e() { var e = t.call(this) || this; e.size(574, 170), e.bg = new Img("img/nczjs_kuan_zhlk1.png"), e.addChild(e.bg), e.bg.size(574, 150).pos(10, 10), e.bg.sizeGrid = "26,20,18,26", e.img = new Img(), e.bg.addChild(e.img), e.img.anchorX = .5, e.img.anchorY = .5, e.img.pos(64, 75), e.img.scale(.7, .7), e.flag = new Img(), e.bg.addChild(e.flag), e.flag.anchorX = .5, e.flag.anchorY = .5, e.flag.pos(15, 15), e.levelT = new Laya.FontClip(), e.bg.addChild(e.levelT), e.levelT.anchorX = .5, e.levelT.anchorY = .5, e.levelT.pos(15, 15), e.levelT.scale(.4, .4), e.levelT.skin = "img/zwujs_txt_gshu.png", e.levelT.sheet = "0123456789", e.title = new Txt(), e.bg.addChild(e.title), e.title.bold = !0, e.title.color = "#6b2104", e.title.pos(130, 10), e.title.fontSize = 30, e.title.bold = !0; var i = new Img("img/zwujs_icon_gongji.png"); return e.bg.addChild(i), i.pos(140, 55), e.power = new Txt(), e.bg.addChild(e.power), e.power.pos(175, 55), e.power.color = "#d75523", e.power.fontSize = 26, e.desc = new Txt(), e.bg.addChild(e.desc), e.desc.size(413, 27).pos(130, 90), e.desc.wordWrap = !0, e.desc.fontSize = 22, e.desc.color = "#93520a", e.btn = new Img("img/zwujs_button_lv1.png"), e.bg.addChild(e.btn), e.btn.size(156, 67).pos(404, 12), e.btn.sizeGrid = "12,12,18,16", e.icon = new Img("img/zwujs_icon_jinbi1.png"), e.btn.addChild(e.icon), e.icon.pos(10, 7).size(43, 48), e.count = new Txt(), e.btn.addChild(e.count), e.count.size(69, 30).pos(62, 16), e.count.color = "#fff", e.count.fontSize = 30, e.count.align = "center", e.lockI = new Img("img/zwujs_icon_suo1.png"), e.btn.addChild(e.lockI), e.lockI.pos(65, 16), e; } return __extends(e, t), e.prototype.setImg = function(t, e) { var i = t + 1, n = Data.PlantType[e][i - 1]; this.levelT.value = i + "", this.img.skin = "flower/" + n.pic + ".png", this.flag.skin = "img/zwujs_icon_zwdji" + e + ".png", this.power.text = PublicFun.changeString(n.attack), this.title.text = n.name, this.desc.text = n.desc; var s = "coins"; if (i == LocalStorage.deblocking[e - 1] - 1 && n.diamond > 0 && i > 1 && (s = "gem"), LocalStorage.deblocking[e - 1] - 1 < i && i > 1 && LocalStorage.deblocking != CF.maxLevel) { if (this.bg.disabled = !0, LocalStorage.deblocking[e - 1] < i) { this.title.text = "???", this.power.text = "???", this.desc.text = "???"; var a = new Laya.ColorFilter([ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 ]); this.img.filters = [ a ]; } } else this.icon.skin = "coins" == s ? "img/zwujs_icon_jinbi1.png" : "img/nczjs_icon_8.png", this.lockI.visible = !1, "coins" == s ? this.count.text = PublicFun.changeString(Catalog._MAIN_SCENE.getLevelBuyCoins({ type: n.type, level: n.level })) : "gem" == s && (this.count.text = PublicFun.changeString(n.diamond)), this.btn.on(_Event.CLICK, this, function() { Laya.SoundManager.playSound("sound/click.mp3", 1), "coins" == s ? Catalog._MAIN_SCENE.createnew(n.id, !0) && (this.count.text = PublicFun.changeString(Catalog._MAIN_SCENE.getLevelBuyCoins({ level: i, type: e }))) : Catalog._MAIN_SCENE.createnew(n.id, !1, !0); }); }, e; }(Laya.Box), __extends = this && this.__extends || function() { var t = function(e, i) { return (t = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, e) { t.__proto__ = e; } || function(t, e) { for (var i in e) e.hasOwnProperty(i) && (t[i] = e[i]); })(e, i); }; return function(e, i) { function n() { this.constructor = e; } t(e, i), e.prototype = null === i ? Object.create(i) : (n.prototype = i.prototype, new n()); }; }(), Sign = function(t) { function e() { var e = t.call(this) || this; return e.coinArr = [ 50, 100, 200, 300, 400, 500, 700 ], e.visible = !1, e.init(), e.addEvent(), e; } return __extends(e, t), e.prototype.init = function() { var t = PublicFun.getMyDate(), e = LocalStorage.getLS("lastsigndate"); e && e == t ? (this.lbl_hassign.visible = !0, this.btn_dbei.visible = !1, this.btn_get.visible = !1) : (this.lbl_hassign.visible = !1, this.btn_dbei.visible = !0, this.btn_get.visible = !0); var i = 0, n = LocalStorage.getLS("signedTime"); n && (i = parseInt(n)), this.count = this.coinArr[i], 7 == i && e != t && (this.signedTimes = 0, LocalStorage.setLS("signedTime", i)), this.lbl_coinnum.text = "+" + PublicFun.changeString(this.coinArr[i]), i > 0 && (this.sign1_mask.visible = !0, this.sign1_now.visible = !0, e && e == t || (this.sign2_now.visible = !0)), i > 1 && (this.sign2_mask.visible = !0, this.sign2_now.visible = !0, e && e == t || (this.sign3_now.visible = !0)), i > 2 && (this.sign3_mask.visible = !0, this.sign3_now.visible = !0, e && e == t || (this.sign4_now.visible = !0)), i > 3 && (this.sign4_mask.visible = !0, this.sign4_now.visible = !0, e && e == t || (this.sign5_now.visible = !0)), i > 4 && (this.sign5_mask.visible = !0, this.sign5_now.visible = !0, e && e == t || (this.sign6_now.visible = !0)), i > 5 && (this.sign6_mask.visible = !0, this.sign6_now.visible = !0, e && e == t || (this.sign7_now.visible = !0)), i > 6 && (this.sign7_mask.visible = !0, this.sign7_now.visible = !0); }, e.prototype.addEvent = function() { this.btn_close.on(Laya.Event.CLICK, this, function() { Laya.SoundManager.playSound("sound/click.mp3", 1), this.close(); }), this.btn_get.on(Laya.Event.CLICK, this, function() { Laya.SoundManager.playSound("sound/click.mp3", 1), this.lbl_coinnum.text = "+" + PublicFun.changeString(this.count), this.panel_sign.visible = !1, this.panel_get.visible = !0; }), this.btn_dbei.on(Laya.Event.CLICK, this, function() { var t = this; Laya.SoundManager.playSound("sound/click.mp3", 1), PublicFun.lookAd(function() { t.count = 3 * t.count, t.lbl_coinnum.text = "+" + PublicFun.changeString(t.count), t.panel_sign.visible = !1, t.panel_get.visible = !0; }, "Sign"); }), this.nomorl_get.on(Laya.Event.CLICK, this, function() { Laya.SoundManager.playSound("sound/click.mp3", 1); var t = 0, e = LocalStorage.getLS("signedTime"); e && (t = parseInt(e)), LocalStorage.setLS("signedTime", t + 1), LocalStorage.setLS("lastsigndate", PublicFun.getMyDate()), LocalStorage.gemCount += this.count, LocalStorage.setGemCount(), Catalog._MAIN_SCENE.updateGemCount(), this.btn_dbei.visible = !1, this.btn_get.visible = !1, this.lbl_hassign.visible = !0, this.visible = !1, this.panel_sign.visible = !0, this.panel_get.visible = !1, Msg.post("Get diamonds" + PublicFun.changeString(this.count)), this.init(), this.close(); }); }, e.prototype.show = function(t) { console.log("sign show"), PublicFun.addTopAd("mainicon"), Catalog._MAIN_SCENE.gameStop = !0; var e = PublicFun.getMyDate(), i = LocalStorage.getLS("lastsigndate"); console.log("lastSignDate >" + i), console.log("today >" + e), i && i == e ? (this.lbl_hassign.visible = !0, this.btn_get.visible = !1, this.visible = !1, t ? Catalog._OFFLINE_SCENE.play() : (this.visible = !0, PublicFun.isAddB())) : this.visible = !0; }, e.prototype.close = function() { Catalog._OVER_SCENE.visible || (Catalog._MAIN_SCENE.gameStop = !1), this.visible = !1, this.panel_get.visible = !1, this.panel_sign.visible = !0, PublicFun.removeBanner(), Catalog._OFFLINE_SCENE.play(), PublicFun.closeTopAd(); }, e; }(ui.signUI), __extends = this && this.__extends || function() { var t = function(e, i) { return (t = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, e) { t.__proto__ = e; } || function(t, e) { for (var i in e) e.hasOwnProperty(i) && (t[i] = e[i]); })(e, i); }; return function(e, i) { function n() { this.constructor = e; } t(e, i), e.prototype = null === i ? Object.create(i) : (n.prototype = i.prototype, new n()); }; }(), SuperUnlock = function(t) { function e() { var e = t.call(this) || this; return e.init(), e.addEvent(), e.visible = !1, e; } return __extends(e, t), e.prototype.init = function() {}, e.prototype.addEvent = function() { this.normal_get.on(_Event.CLICK, this, function() { Laya.SoundManager.playSound("sound/click.mp3", 1), this.visible = !1, this.close(); }), this.video_get.on(_Event.CLICK, this, function() { var t = this; Laya.SoundManager.playSound("sound/click.mp3", 1), PublicFun.lookAd(function() { CF.list[t.transIndex].id = t.id, Catalog._MAIN_SCENE.updateDress(t.transIndex), t.close(); }, ""); }); }, e.prototype.play = function(t) { console.log("superUnlock play:" + t), this.transIndex = t; var e = CF.list[t].level, i = CF.list[t].type; Catalog._MAIN_SCENE.gameStop = !0, PublicFun.isAddB(), this.visible = !0, PublicFun.popWindow(this.bg); var n = Data.getPlanData({ level: e, type: i }); this.lv1.text = "lv:" + e, this.lv2.text = "lv:" + e; var s = e + 5; this.spnew_lv.text = "lv:" + s; var a = Data.getPlanData({ level: s, type: i }); this.id = a.id, this.sp1.skin = "flower/" + n.pic + ".png", this.sp2.skin = "flower/" + n.pic + ".png", this.spnew.skin = "flower/" + a.pic + ".png"; }, e.prototype.close = function() { Catalog._OVER_SCENE.visible || (Catalog._MAIN_SCENE.gameStop = !1), PublicFun.removeBanner(), PublicFun.closeAbout(), this.visible = !1; }, e; }(ui.superUnlockUI), __extends = this && this.__extends || function() { var t = function(e, i) { return (t = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, e) { t.__proto__ = e; } || function(t, e) { for (var i in e) e.hasOwnProperty(i) && (t[i] = e[i]); })(e, i); }; return function(e, i) { function n() { this.constructor = e; } t(e, i), e.prototype = null === i ? Object.create(i) : (n.prototype = i.prototype, new n()); }; }(), TopAd = function(t) { function e() { var e = t.call(this) || this; return e.adName = "mainicon", e.leftnum = 0, e.isleft = !0, e.list = new List(), e.imgList = [], e.visible = !1, e.list.hScrollBarSkin = "", e.list.repeatY = 1, e.list.repeatX = 5, e.y = 100, e; } return __extends(e, t), e.prototype.init = function() { console.log("topad init"), console.log(PublicFun.ADlist[this.adName].length); var t = PublicFun.ADlist[this.adName].length; if (console.log("gameAdSize ==" + t), !(t <= 0)) { for (var e = [], i = function(t) { if (!PublicFun.ADlist[n.adName][t]) return "continue"; var i = new Sprite(); n.addChild(i), i.size(108, 108).pos(115 * t, 0), e.push(i); var s = new Img(PublicFun.ADlist[n.adName][t].PicUrl); i.addChild(s), s.size(108, 108), s.name = "img", n.imgList.push(s), s.on(_Event.CLICK, n, function() { if (Browser.onWeiXin) { var e = PublicFun.ADlist[this.adName][t], i = this.adName; PublicFun.cpamanager.CPATurn({ appid: e.appid, path: e.path, posid: i, callback: function(t) { t ? console.log("=====跳转成功") : (console.log("=====跳转失败"), Catalog._SCENEAD_SCENE && Catalog._SCENEAD_SCENE.play()); } }); } }); }, n = this, s = 0; s < t; s++) i(s); this.list.array = e, console.log("list>>>>"), console.log(this.list.width), console.log(this.list.x); } }, e.prototype.show = function() { this.visible = !0, this.loopturn(); }, e.prototype.loopturn = function() { var t = this; if (this.visible && 0 != this.imgList.length) { for (var e = 1; e <= this.imgList.length && this.imgList.length > 6; e++) { var i = this.imgList[e - 1]; if (this.leftnum + 6 < this.list.array.length && this.isleft) { n = 0 - 110 * (this.leftnum + 1); Laya.Tween.to(i, { x: n }, 3e3); } if (this.leftnum > 0 && !this.isleft) { var n = 0 - 110 * (this.leftnum - 1); Laya.Tween.to(i, { x: n }, 3e3); } } this.isleft ? (this.leftnum++, this.leftnum + 6 == this.list.array.length && (this.isleft = !1)) : (this.leftnum--, 0 == this.leftnum && (this.isleft = !0)), Laya.timer.once(4500, this, function() { t.loopturn(); }); } }, e.prototype.close = function() { this.visible = !1; }, e; }(ui.topAdUI), __extends = this && this.__extends || function() { var t = function(e, i) { return (t = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, e) { t.__proto__ = e; } || function(t, e) { for (var i in e) e.hasOwnProperty(i) && (t[i] = e[i]); })(e, i); }; return function(e, i) { function n() { this.constructor = e; } t(e, i), e.prototype = null === i ? Object.create(i) : (n.prototype = i.prototype, new n()); }; }(), Unlocked = function(t) { function e() { var e = t.call(this) || this; return e.init(), e.addEvent(), e.visible = !1, e; } return __extends(e, t), e.prototype.init = function() { var t = this; !function() { var e = new Timeline(); e.to(t.btn_share, { scaleX: 1.1, scaleY: 1.1 }, 1e3).to(t.btn_share, { scaleX: 1, scaleY: 1 }, 1e3), e.play(0, !0); }(); }, e.prototype.addEvent = function() { this.btn_get.on(_Event.CLICK, this, function() { var t = this; Laya.SoundManager.playSound("sound/click.mp3", 1), this.done.visible ? PublicFun.lookAd(function() { t.getMoney(!0); }, "UNLOCKED") : this.getMoney(!1); }), this.btn_share.on(_Event.CLICK, this, function() { Laya.SoundManager.playSound("sound/click.mp3", 1), PublicFun.WXShare(); }), this.btn_ad.on(_Event.CLICK, this, function() { Laya.SoundManager.playSound("sound/click.mp3", 1), this.done.visible = !this.done.visible; }); }, e.prototype.play = function(t, e) { Catalog._MAIN_SCENE.gameStop = !0, PublicFun.isAddB(), PublicFun.addAbout("mainicon"), this.visible = !0, PublicFun.popWindow(this.bg); var i = Data.getPlanData({ level: t, type: e }); this.img.skin = "flower/" + i.pic + ".png", this.power.text = PublicFun.changeString(i.attack), this.desc.text = i.desc, this.count = i.newTurret, this.money.text = PublicFun.changeString(i.newTurret), this.done.visible = !0; }, e.prototype.getMoney = function(t) { Catalog._MAIN_SCENE.changeMoney(this.count * (t ? 2 : 1)), this.close(); }, e.prototype.close = function() { Catalog._OVER_SCENE.visible || (Catalog._MAIN_SCENE.gameStop = !1), PublicFun.removeBanner(), PublicFun.closeAbout(), this.visible = !1; }, e; }(ui.unlockedUI), __extends = this && this.__extends || function() { var t = function(e, i) { return (t = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, e) { t.__proto__ = e; } || function(t, e) { for (var i in e) e.hasOwnProperty(i) && (t[i] = e[i]); })(e, i); }; return function(e, i) { function n() { this.constructor = e; } t(e, i), e.prototype = null === i ? Object.create(i) : (n.prototype = i.prototype, new n()); }; }(), Variation = function(t) { function e() { var e = t.call(this) || this; return e.visible = !1, e.init(), e.addEvent(), e; } return __extends(e, t), e.prototype.init = function() {}, e.prototype.addEvent = function() { this.btn_close.on(Laya.Event.CLICK, this, function() { Laya.SoundManager.playSound("sound/click.mp3", 1), this.close(); }); }, e.prototype.play = function(t, e) { Catalog._MAIN_SCENE.gameStop = !0, LocalStorage.setHasList(), PublicFun.isAddB(), PublicFun.addAbout("mainicon"), this.visible = !0, PublicFun.popWindow(this.bg, .8), this.img1.skin = t, this.img2.skin = t, this.icon.skin = e; }, e.prototype.close = function() { Catalog._OVER_SCENE.visible || (Catalog._MAIN_SCENE.gameStop = !1), this.visible = !1, PublicFun.removeBanner(), PublicFun.closeAbout(); }, e; }(ui.variationUI), __extends = this && this.__extends || function() { var t = function(e, i) { return (t = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, e) { t.__proto__ = e; } || function(t, e) { for (var i in e) e.hasOwnProperty(i) && (t[i] = e[i]); })(e, i); }; return function(e, i) { function n() { this.constructor = e; } t(e, i), e.prototype = null === i ? Object.create(i) : (n.prototype = i.prototype, new n()); }; }(); !function(t) { var e = function(t) { function e() { return t.call(this) || this; } return __extends(e, t), e; }(ui.topAdUI); t.topAd = e; }(view || (view = {})); var GameMain = function() { function t() { var t = this; this.initDone = !1, this.mWidth = 750, this.mHeight = 1334, "vivo" == CF.environment ? Laya.VVMiniAdapter.init() : Laya.MiniAdpter.init(!0, !1), console.log("初始化完成"), Laya.init(750, 1334, Laya.WebGL), Laya.stage.alignH = Laya.Stage.ALIGN_CENTER, Laya.stage.alignV = Laya.Stage.ALIGN_MIDDLE, Laya.stage.scaleMode = Laya.Stage.SCALE_SHOWALL, Browser.onWeiXin && PublicFun.getINFO(), Browser.onWeiXin && PublicFun.setShow(function() { t.addScene(); }, function() { t.setAdState(); }); var e = Laya.Browser.clientWidth / (this.mWidth / 2) * (this.mHeight / 2), i = (Laya.Browser.clientHeight - e) * (this.mWidth / 2) / Laya.Browser.clientWidth; //Laya.stage.y = i, this.addLoad(), CF.banner = PublicFun.addBanner(), "vivo" == CF.environment && PublicFun.getVivoId(), Laya.loader.load(CF.jsonList, Handler.create(this, function() { var t = this; if (console.log("json加载完毕"), Data.init(), Laya.Browser.onWeiXin && "wx" == CF.environment) { wx.loadSubpackage({ name: "img", success: function(e) { console.log("分包1加载完成"), t.task1 = !0; }, fail: function(t) { console.log(t, "分包1失败"); } }), wx.loadSubpackage({ name: "res", success: function(e) { t.task2 = !0; }, fail: function(t) { console.log(t, "分包2失败"); } }), wx.loadSubpackage({ name: "sk", success: function(e) { t.task3 = !0; }, fail: function(t) { console.log(t, "分包3失败"); } }), wx.loadSubpackage({ name: "flower", success: function(e) { t.task4 = !0; }, fail: function(t) { console.log(t, "分包4失败"); } }); this.taskloading(); } else if ("vivo" == CF.environment) window.qg.loadSubpackage({ name: "res", success: function(e) { t.load(); }, fail: function(t) { console.log(t, "分包失败"); } }); else this.load(); }), null, "Loader.json"); } return t.prototype.taskloading = function() { var t = this; if (this.loads.width = this.loads.width + 1, this.task1 && this.task2 && this.task3 && this.task4) return this.loads.width = 500, void this.load(); 500 == this.loads.width && (this.loads.width = 0), Laya.timer.once(200, this, function() { t.taskloading(); }); }, t.prototype.addLoad = function() { console.log("addLoad"); var t = new Img("loading/zwujs_img_logo.png"); Laya.stage.addChild(t), t.size(750, 1334); var e = new Img("loading/zwujs_jindt_jiaz3.png"); t.addChild(e), e.size(500, 28).pos(125, 1059), e.sizeGrid = "0,14,0,26"; var i = new Img("loading/zwujs_jindt_jiaz2.png"); this.loads = i, e.addChild(i), i.size(0, 22).pos(5, 3), i.sizeGrid = "0,16,0,18", "wx" != CF.environment && Tween.to(i, { width: 245 }, 3e3, Ease.sineOut, Handler.create(this, function() { this.load(); })); }, t.prototype.load = function() { var t = this; this.ok || "wx" == CF.environment ? (this.loads.width = 0, Laya.loader.load(CF.loadList, Handler.create(this, function() { var t = this; Catalog.init(), Laya.timer.once(1e3, this, function() { Laya.stage.addChild(Catalog._MAIN_SCENE), Catalog._MAIN_SCENE.start(), t.addScene(); }); }), new Handler(this, function(e) { t.loads.width = 490 * e; }))) : this.ok = !0; }, t.prototype.setAdState = function() { this.adok = !0; }, t.prototype.addScene = function() { //隐藏框架loading //执行登陆 if(window.HideLoading){ window['uptap'].HideLoading(); window['uptap'].Login(function(t) { console.log("uptap_login_end && data = ", t) console.log("登录成功"); }); window.HideLoading = false; } if (console.log("addScene"), console.log(PublicFun.ADlist.gameover), this.adok) { if (!this.initDone && "wx" == CF.environment) { if (0 == PublicFun.ADlist.gameover.length) return; this.initDone = !0, Catalog._LIKE_SCENE.init(), Catalog._ABOUT_SCENE.init(), Catalog._TOPAD_SCENE.init(), Catalog._CLOSE_SCENE.init(), Catalog._SCENEAD_SCENE = new SceneAD(), Catalog._MAIN_SCENE.pageAD.addChild(Catalog._SCENEAD_SCENE), LocalStorage.isGuide || Catalog._SIGN_SCENE.show(!0); } } else this.adok = !0; }, t; }(); new GameMain();