Файловый менеджер - Редактировать - /home/jogoso94/public_html/jogos/pyramid_solitaire/js/main.js
�азад
/* screenfull v5.0.0 - 2019-09-09 (c) Sindre Sorhus; MIT License Platform.js <https://mths.be/platform> Copyright 2014-2018 Benjamin Tan <https://bnjmnt4n.now.sh/> Copyright 2011-2013 John-David Dalton Available under MIT license <https://mths.be/mit> */ ! function() { var a = "undefined" != typeof window && void 0 !== window.document ? window.document : {}, c = "undefined" != typeof module && module.exports, b = function() { for (var g, n = ["requestFullscreen exitFullscreen fullscreenElement fullscreenEnabled fullscreenchange fullscreenerror".split(" "), "webkitRequestFullscreen webkitExitFullscreen webkitFullscreenElement webkitFullscreenEnabled webkitfullscreenchange webkitfullscreenerror".split(" "), "webkitRequestFullScreen webkitCancelFullScreen webkitCurrentFullScreenElement webkitCancelFullScreen webkitfullscreenchange webkitfullscreenerror".split(" "), "mozRequestFullScreen mozCancelFullScreen mozFullScreenElement mozFullScreenEnabled mozfullscreenchange mozfullscreenerror".split(" "), "msRequestFullscreen msExitFullscreen msFullscreenElement msFullscreenEnabled MSFullscreenChange MSFullscreenError".split(" ") ], u = 0, q = n.length, l = {}; u < q; u++) if ((g = n[u]) && g[1] in a) { for (u = 0; u < g.length; u++) l[n[0][u]] = g[u]; return l } return !1 }(), d = { change: b.fullscreenchange, error: b.fullscreenerror }, e = { request: function(g) { return new Promise(function(n, u) { var q = function() { this.off("change", q); n() }.bind(this); this.on("change", q); g = g || a.documentElement; Promise.resolve(g[b.requestFullscreen]())["catch"](u) }.bind(this)) }, exit: function() { return new Promise(function(g, n) { if (this.isFullscreen) { var u = function() { this.off("change", u); g() }.bind(this); this.on("change", u); Promise.resolve(a[b.exitFullscreen]())["catch"](n) } else g() }.bind(this)) }, toggle: function(g) { return this.isFullscreen ? this.exit() : this.request(g) }, onchange: function(g) { this.on("change", g) }, onerror: function(g) { this.on("error", g) }, on: function(g, n) { var u = d[g]; u && a.addEventListener(u, n, !1) }, off: function(g, n) { var u = d[g]; u && a.removeEventListener(u, n, !1) }, raw: b }; b ? (Object.defineProperties(e, { isFullscreen: { get: function() { return !!a[b.fullscreenElement] } }, element: { enumerable: !0, get: function() { return a[b.fullscreenElement] } }, isEnabled: { enumerable: !0, get: function() { return !!a[b.fullscreenEnabled] } } }), c ? module.exports = e : window.screenfull = e) : c ? module.exports = { isEnabled: !1 } : window.screenfull = { isEnabled: !1 } }(); (function() { function a(m) { m = String(m); return m.charAt(0).toUpperCase() + m.slice(1) } function c(m, G) { var z = -1, A = m ? m.length : 0; if ("number" == typeof A && -1 < A && A <= E) for (; ++z < A;) G(m[z], z, m); else d(m, G) } function b(m) { m = String(m).replace(/^ +| +$/g, ""); return /^(?:webOS|i(?:OS|P))/.test(m) ? m : a(m) } function d(m, G) { for (var z in m) x.call(m, z) && G(m[z], z, m) } function e(m) { return null == m ? a(m) : C.call(m).slice(8, -1) } function g(m, G) { var z = null != m ? typeof m[G] : "number"; return !/^(?:boolean|number|string|undefined)$/.test(z) && ("object" == z ? !!m[G] : !0) } function n(m) { return String(m).replace(/([ -])(?!$)/g, "$1?") } function u(m, G) { var z = null; c(m, function(A, v) { z = G(z, A, v, m) }); return z } function q(m) { function G(Q) { return u(Q, function(N, M) { var R = M.pattern || n(M); !N && (N = RegExp("\\b" + R + " *\\d+[.\\w_]*", "i").exec(m) || RegExp("\\b" + R + " *\\w+-[\\w]*", "i").exec(m) || RegExp("\\b" + R + "(?:; *(?:[a-z]+[_-])?[a-z]+\\d+|[^ ();-]*)", "i").exec(m)) && ((N = String(M.label && !RegExp(R, "i").test(M.label) ? M.label : N).split("/"))[1] && !/[\d.]+/.test(N[0]) && (N[0] += " " + N[1]), M = M.label || M, N = b(N[0].replace(RegExp(R, "i"), M).replace(RegExp("; *(?:" + M + "[_-])?", "i"), " ").replace(RegExp("(" + M + ")[-_.]?(\\w)", "i"), "$1 $2"))); return N }) } function z(Q) { return u(Q, function(N, M) { return N || (RegExp(M + "(?:-[\\d.]+/|(?: for [\\w-]+)?[ /-])([\\d.]+[^ ();/_-]*)", "i").exec(m) || 0)[1] || null }) } var A = f, v = m && "object" == typeof m && "String" != e(m); v && (A = m, m = null); var t = A.navigator || {}, k = t.userAgent || ""; m || (m = k); var B = v ? !!t.likeChrome : /\bChrome\b/.test(m) && !/internal|\n/i.test(C.toString()), F = v ? "Object" : "ScriptBridgingProxyObject", H = v ? "Object" : "Environment", O = v && A.java ? "JavaPackage" : e(A.java), I = v ? "Object" : "RuntimeObject"; H = (O = /\bJava/.test(O) && A.java) && e(A.environment) == H; var P = O ? "a" : "\u03b1", W = O ? "b" : "\u03b2", X = A.document || {}, T = A.operamini || A.opera, Y = D.test(Y = v && T ? T["[[Class]]"] : e(T)) ? Y : T = null, h, Z = m; v = []; var aa = null, V = m == k; k = V && T && "function" == typeof T.version && T.version(); var K = function(Q) { return u(Q, function(N, M) { return N || RegExp("\\b" + (M.pattern || n(M)) + "\\b", "i").exec(m) && (M.label || M) }) }([{ label: "EdgeHTML", pattern: "Edge" }, "Trident", { label: "WebKit", pattern: "AppleWebKit" }, "iCab", "Presto", "NetFront", "Tasman", "KHTML", "Gecko"]), w = function(Q) { return u(Q, function(N, M) { return N || RegExp("\\b" + (M.pattern || n(M)) + "\\b", "i").exec(m) && (M.label || M) }) }(["Adobe AIR", "Arora", "Avant Browser", "Breach", "Camino", "Electron", "Epiphany", "Fennec", "Flock", "Galeon", "GreenBrowser", "iCab", "Iceweasel", "K-Meleon", "Konqueror", "Lunascape", "Maxthon", { label: "Microsoft Edge", pattern: "Edge" }, "Midori", "Nook Browser", "PaleMoon", "PhantomJS", "Raven", "Rekonq", "RockMelt", { label: "Samsung Internet", pattern: "SamsungBrowser" }, "SeaMonkey", { label: "Silk", pattern: "(?:Cloud9|Silk-Accelerated)" }, "Sleipnir", "SlimBrowser", { label: "SRWare Iron", pattern: "Iron" }, "Sunrise", "Swiftfox", "Waterfox", "WebPositive", "Opera Mini", { label: "Opera Mini", pattern: "OPiOS" }, "Opera", { label: "Opera", pattern: "OPR" }, "Chrome", { label: "Chrome Mobile", pattern: "(?:CriOS|CrMo)" }, { label: "Firefox", pattern: "(?:Firefox|Minefield)" }, { label: "Firefox for iOS", pattern: "FxiOS" }, { label: "IE", pattern: "IEMobile" }, { label: "IE", pattern: "MSIE" }, "Safari" ]), L = G([{ label: "BlackBerry", pattern: "BB10" }, "BlackBerry", { label: "Galaxy S", pattern: "GT-I9000" }, { label: "Galaxy S2", pattern: "GT-I9100" }, { label: "Galaxy S3", pattern: "GT-I9300" }, { label: "Galaxy S4", pattern: "GT-I9500" }, { label: "Galaxy S5", pattern: "SM-G900" }, { label: "Galaxy S6", pattern: "SM-G920" }, { label: "Galaxy S6 Edge", pattern: "SM-G925" }, { label: "Galaxy S7", pattern: "SM-G930" }, { label: "Galaxy S7 Edge", pattern: "SM-G935" }, "Google TV", "Lumia", "iPad", "iPod", "iPhone", "Kindle", { label: "Kindle Fire", pattern: "(?:Cloud9|Silk-Accelerated)" }, "Nexus", "Nook", "PlayBook", "PlayStation Vita", "PlayStation", "TouchPad", "Transformer", { label: "Wii U", pattern: "WiiU" }, "Wii", "Xbox One", { label: "Xbox 360", pattern: "Xbox" }, "Xoom" ]), S = function(Q) { return u(Q, function(N, M, R) { return N || (M[L] || M[/^[a-z]+(?: +[a-z]+\b)*/i.exec(L)] || RegExp("\\b" + n(R) + "(?:\\b|\\w*\\d)", "i").exec(m)) && R }) }({ Apple: { iPad: 1, iPhone: 1, iPod: 1 }, Archos: {}, Amazon: { Kindle: 1, "Kindle Fire": 1 }, Asus: { Transformer: 1 }, "Barnes & Noble": { Nook: 1 }, BlackBerry: { PlayBook: 1 }, Google: { "Google TV": 1, Nexus: 1 }, HP: { TouchPad: 1 }, HTC: {}, LG: {}, Microsoft: { Xbox: 1, "Xbox One": 1 }, Motorola: { Xoom: 1 }, Nintendo: { "Wii U": 1, Wii: 1 }, Nokia: { Lumia: 1 }, Samsung: { "Galaxy S": 1, "Galaxy S2": 1, "Galaxy S3": 1, "Galaxy S4": 1 }, Sony: { PlayStation: 1, "PlayStation Vita": 1 } }), y = function(Q) { return u(Q, function(N, M) { var R = M.pattern || n(M); if (!N && (N = RegExp("\\b" + R + "(?:/[\\d.]+|[ \\w.]*)", "i").exec(m))) { var U = N, ba = M.label || M, ca = { "10.0": "10", "6.4": "10 Technical Preview", "6.3": "8.1", "6.2": "8", "6.1": "Server 2008 R2 / 7", "6.0": "Server 2008 / Vista", "5.2": "Server 2003 / XP 64-bit", "5.1": "XP", "5.01": "2000 SP1", "5.0": "2000", "4.0": "NT", "4.90": "ME" }; R && ba && /^Win/i.test(U) && !/^Windows Phone /i.test(U) && (ca = ca[/[\d.]+$/.exec(U)]) && (U = "Windows " + ca); U = String(U); R && ba && (U = U.replace(RegExp(R, "i"), ba)); N = U = b(U.replace(/ ce$/i, " CE").replace(/\bhpw/i, "web").replace(/\bMacintosh\b/, "Mac OS").replace(/_PowerPC\b/i, " OS").replace(/\b(OS X) [^ \d]+/i, "$1").replace(/\bMac (OS X)\b/, "$1").replace(/\/(\d)/, " $1").replace(/_/g, ".").replace(/(?: BePC|[ .]*fc[ \d.]+)$/i, "").replace(/\bx86\.64\b/gi, "x86_64").replace(/\b(Windows Phone) OS\b/, "$1").replace(/\b(Chrome OS \w+) [\d.]+\b/, "$1").split(" on ")[0]) } return N }) }(["Windows Phone", "Android", "CentOS", { label: "Chrome OS", pattern: "CrOS" }, "Debian", "Fedora", "FreeBSD", "Gentoo", "Haiku", "Kubuntu", "Linux Mint", "OpenBSD", "Red Hat", "SuSE", "Ubuntu", "Xubuntu", "Cygwin", "Symbian OS", "hpwOS", "webOS ", "webOS", "Tablet OS", "Tizen", "Linux", "Mac OS X", "Macintosh", "Mac", "Windows 98;", "Windows " ]); K && (K = [K]); S && !L && (L = G([S])); if (h = /\bGoogle TV\b/.exec(L)) L = h[0]; /\bSimulator\b/i.test(m) && (L = (L ? L + " " : "") + "Simulator"); "Opera Mini" == w && /\bOPiOS\b/.test(m) && v.push("running in Turbo/Uncompressed mode"); "IE" == w && /\blike iPhone OS\b/.test(m) ? (h = q(m.replace(/like iPhone OS/, "")), S = h.manufacturer, L = h.product) : /^iP/.test(L) ? (w || (w = "Safari"), y = "iOS" + ((h = / OS ([\d_]+)/i.exec(m)) ? " " + h[1].replace(/_/g, ".") : "")) : "Konqueror" != w || /buntu/i.test(y) ? S && "Google" != S && (/Chrome/.test(w) && !/\bMobile Safari\b/i.test(m) || /\bVita\b/.test(L)) || /\bAndroid\b/.test(y) && /^Chrome/.test(w) && /\bVersion\//i.test(m) ? (w = "Android Browser", y = /\bAndroid\b/.test(y) ? y : "Android") : "Silk" == w ? (/\bMobi/i.test(m) || (y = "Android", v.unshift("desktop mode")), /Accelerated *= *true/i.test(m) && v.unshift("accelerated")) : "PaleMoon" == w && (h = /\bFirefox\/([\d.]+)\b/.exec(m)) ? v.push("identifying as Firefox " + h[1]) : "Firefox" == w && (h = /\b(Mobile|Tablet|TV)\b/i.exec(m)) ? (y || (y = "Firefox OS"), L || (L = h[1])) : !w || (h = !/\bMinefield\b/i.test(m) && /\b(?:Firefox|Safari)\b/.exec(w)) ? (w && !L && /[\/,]|^[^(]+?\)/.test(m.slice(m.indexOf(h + "/") + 8)) && (w = null), (h = L || S || y) && (L || S || /\b(?:Android|Symbian OS|Tablet OS|webOS)\b/.test(y)) && (w = /[a-z]+(?: Hat)?/i.exec(/\bAndroid\b/.test(y) ? y : h) + " Browser")) : "Electron" == w && (h = (/\bChrome\/([\d.]+)\b/.exec(m) || 0)[1]) && v.push("Chromium " + h) : y = "Kubuntu"; k || (k = z(["(?:Cloud9|CriOS|CrMo|Edge|FxiOS|IEMobile|Iron|Opera ?Mini|OPiOS|OPR|Raven|SamsungBrowser|Silk(?!/[\\d.]+$))", "Version", n(w), "(?:Firefox|Minefield|NetFront)" ])); if (h = "iCab" == K && 3 < parseFloat(k) && "WebKit" || /\bOpera\b/.test(w) && (/\bOPR\b/.test(m) ? "Blink" : "Presto") || /\b(?:Midori|Nook|Safari)\b/i.test(m) && !/^(?:Trident|EdgeHTML)$/.test(K) && "WebKit" || !K && /\bMSIE\b/i.test(m) && ("Mac OS" == y ? "Tasman" : "Trident") || "WebKit" == K && /\bPlayStation\b(?! Vita\b)/i.test(w) && "NetFront") K = [h]; "IE" == w && (h = (/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(m) || 0)[1]) ? (w += " Mobile", y = "Windows Phone " + (/\+$/.test(h) ? h : h + ".x"), v.unshift("desktop mode")) : /\bWPDesktop\b/i.test(m) ? (w = "IE Mobile", y = "Windows Phone 8.x", v.unshift("desktop mode"), k || (k = (/\brv:([\d.]+)/.exec(m) || 0)[1])) : "IE" != w && "Trident" == K && (h = /\brv:([\d.]+)/.exec(m)) && (w && v.push("identifying as " + w + (k ? " " + k : "")), w = "IE", k = h[1]); if (V) { if (g(A, "global")) if (O && (h = O.lang.System, Z = h.getProperty("os.arch"), y = y || h.getProperty("os.name") + " " + h.getProperty("os.version")), H) { try { k = A.require("ringo/engine").version.join("."), w = "RingoJS" } catch (Q) { (h = A.system) && h.global.system == A.system && (w = "Narwhal", y || (y = h[0].os || null)) } w || (w = "Rhino") } else "object" == typeof A.process && !A.process.browser && (h = A.process) && ("object" == typeof h.versions && ("string" == typeof h.versions.electron ? (v.push("Node " + h.versions.node), w = "Electron", k = h.versions.electron) : "string" == typeof h.versions.nw && (v.push("Chromium " + k, "Node " + h.versions.node), w = "NW.js", k = h.versions.nw)), w || (w = "Node.js", Z = h.arch, y = h.platform, k = (k = /[\d.]+/.exec(h.version)) ? k[0] : null)); else e(h = A.runtime) == F ? (w = "Adobe AIR", y = h.flash.system.Capabilities.os) : e(h = A.phantom) == I ? (w = "PhantomJS", k = (h = h.version || null) && h.major + "." + h.minor + "." + h.patch) : "number" == typeof X.documentMode && (h = /\bTrident\/(\d+)/i.exec(m)) ? (k = [k, X.documentMode], (h = +h[1] + 4) != k[1] && (v.push("IE " + k[1] + " mode"), K && (K[1] = ""), k[1] = h), k = "IE" == w ? String(k[1].toFixed(1)) : k[0]) : "number" == typeof X.documentMode && /^(?:Chrome|Firefox)\b/.test(w) && (v.push("masking as " + w + " " + k), w = "IE", k = "11.0", K = ["Trident"], y = "Windows"); y = y && b(y) } k && (h = /(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(k) || /(?:alpha|beta)(?: ?\d)?/i.exec(m + ";" + (V && t.appMinorVersion)) || /\bMinefield\b/i.test(m) && "a") && (aa = /b/i.test(h) ? "beta" : "alpha", k = k.replace(RegExp(h + "\\+?$"), "") + ("beta" == aa ? W : P) + (/\d+\+?/.exec(h) || "")); if ("Fennec" == w || "Firefox" == w && /\b(?:Android|Firefox OS)\b/.test(y)) w = "Firefox Mobile"; else if ("Maxthon" == w && k) k = k.replace(/\.[\d.]+/, ".x"); else if (/\bXbox\b/i.test(L)) "Xbox 360" == L && (y = null), "Xbox 360" == L && /\bIEMobile\b/.test(m) && v.unshift("mobile mode"); else if (!/^(?:Chrome|IE|Opera)$/.test(w) && (!w || L || /Browser|Mobi/.test(w)) || "Windows CE" != y && !/Mobi/i.test(m)) if ("IE" == w && V) try { null === A.external && v.unshift("platform preview") } catch (Q) { v.unshift("embedded") } else(/\bBlackBerry\b/.test(L) || /\bBB10\b/.test(m)) && (h = (RegExp(L.replace(/ +/g, " *") + "/([.\\d]+)", "i").exec(m) || 0)[1] || k) ? (h = [h, /BB10/.test(m)], y = (h[1] ? (L = null, S = "BlackBerry") : "Device Software") + " " + h[0], k = null) : this != d && "Wii" != L && (V && T || /Opera/.test(w) && /\b(?:MSIE|Firefox)\b/i.test(m) || "Firefox" == w && /\bOS X (?:\d+\.){2,}/.test(y) || "IE" == w && (y && !/^Win/.test(y) && 5.5 < k || /\bWindows XP\b/.test(y) && 8 < k || 8 == k && !/\bTrident\b/.test(m))) && !D.test(h = q.call(d, m.replace(D, "") + ";")) && h.name && (h = "ing as " + h.name + ((h = h.version) ? " " + h : ""), D.test(w) ? (/\bIE\b/.test(h) && "Mac OS" == y && (y = null), h = "identify" + h) : (h = "mask" + h, w = Y ? b(Y.replace(/([a-z])([A-Z])/g, "$1 $2")) : "Opera", /\bIE\b/.test(h) && (y = null), V || (k = null)), K = ["Presto"], v.push(h)); else w += " Mobile"; if (h = (/\bAppleWebKit\/([\d.]+\+?)/i.exec(m) || 0)[1]) { h = [parseFloat(h.replace(/\.(\d)$/, ".0$1")), h]; if ("Safari" == w && "+" == h[1].slice(-1)) w = "WebKit Nightly", aa = "alpha", k = h[1].slice(0, -1); else if (k == h[1] || k == (h[2] = (/\bSafari\/([\d.]+\+?)/i.exec(m) || 0)[1])) k = null; h[1] = (/\bChrome\/([\d.]+)/i.exec(m) || 0)[1]; 537.36 == h[0] && 537.36 == h[2] && 28 <= parseFloat(h[1]) && "WebKit" == K && (K = ["Blink"]); V && (B || h[1]) ? (K && (K[1] = "like Chrome"), h = h[1] || (h = h[0], 530 > h ? 1 : 532 > h ? 2 : 532.05 > h ? 3 : 533 > h ? 4 : 534.03 > h ? 5 : 534.07 > h ? 6 : 534.1 > h ? 7 : 534.13 > h ? 8 : 534.16 > h ? 9 : 534.24 > h ? 10 : 534.3 > h ? 11 : 535.01 > h ? 12 : 535.02 > h ? "13+" : 535.07 > h ? 15 : 535.11 > h ? 16 : 535.19 > h ? 17 : 536.05 > h ? 18 : 536.1 > h ? 19 : 537.01 > h ? 20 : 537.11 > h ? "21+" : 537.13 > h ? 23 : 537.18 > h ? 24 : 537.24 > h ? 25 : 537.36 > h ? 26 : "Blink" != K ? "27" : "28")) : (K && (K[1] = "like Safari"), h = (h = h[0], 400 > h ? 1 : 500 > h ? 2 : 526 > h ? 3 : 533 > h ? 4 : 534 > h ? "4+" : 535 > h ? 5 : 537 > h ? 6 : 538 > h ? 7 : 601 > h ? 8 : "8")); K && (K[1] += " " + (h += "number" == typeof h ? ".x" : /[.+]/.test(h) ? "" : "+")); "Safari" == w && (!k || 45 < parseInt(k)) && (k = h) } "Opera" == w && (h = /\bzbov|zvav$/.exec(y)) ? (w += " ", v.unshift("desktop mode"), "zvav" == h ? (w += "Mini", k = null) : w += "Mobile", y = y.replace(RegExp(" *" + h + "$"), "")) : "Safari" == w && /\bChrome\b/.exec(K && K[1]) && (v.unshift("desktop mode"), w = "Chrome Mobile", k = null, /\bOS X\b/.test(y) ? (S = "Apple", y = "iOS 4.3+") : y = null); k && 0 == k.indexOf(h = /[\d.]+$/.exec(y)) && -1 < m.indexOf("/" + h + "-") && (y = String(y.replace(h, "")).replace(/^ +| +$/g, "")); K && !/\b(?:Avant|Nook)\b/.test(w) && (/Browser|Lunascape|Maxthon/.test(w) || "Safari" != w && /^iOS/.test(y) && /\bSafari\b/.test(K[1]) || /^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|Web)/.test(w) && K[1]) && (h = K[K.length - 1]) && v.push(h); v.length && (v = ["(" + v.join("; ") + ")"]); S && L && 0 > L.indexOf(S) && v.push("on " + S); L && v.push((/^on /.test(v[v.length - 1]) ? "" : "on ") + L); if (y) { var da = (h = / ([\d.+]+)$/.exec(y)) && "/" == y.charAt(y.length - h[0].length - 1); y = { architecture: 32, family: h && !da ? y.replace(h[0], "") : y, version: h ? h[1] : null, toString: function() { var Q = this.version; return this.family + (Q && !da ? " " + Q : "") + (64 == this.architecture ? " 64-bit" : "") } } }(h = /\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(Z)) && !/\bi686\b/i.test(Z) ? (y && (y.architecture = 64, y.family = y.family.replace(RegExp(" *" + h), "")), w && (/\bWOW64\b/i.test(m) || V && /\w(?:86|32)$/.test(t.cpuClass || t.platform) && !/\bWin64; x64\b/i.test(m)) && v.unshift("32-bit")) : y && /^OS X/.test(y.family) && "Chrome" == w && 39 <= parseFloat(k) && (y.architecture = 64); m || (m = null); A = {}; A.description = m; A.layout = K && K[0]; A.manufacturer = S; A.name = w; A.prerelease = aa; A.product = L; A.ua = m; A.version = w && k; A.os = y || { architecture: null, family: null, version: null, toString: function() { return "null" } }; A.parse = q; A.toString = function() { return this.description || "" }; A.version && v.unshift(k); A.name && v.unshift(w); y && w && (y != String(y).split(" ")[0] || y != w.split(" ")[0] && !L) && v.push(L ? "(" + y + ")" : "on " + y); v.length && (A.description = v.join(" ")); return A } var l = { "function": !0, object: !0 }, f = l[typeof window] && window || this, r = l[typeof exports] && exports; l = l[typeof module] && module && !module.nodeType && module; var p = r && l && "object" == typeof global && global; !p || p.global !== p && p.window !== p && p.self !== p || (f = p); var E = Math.pow(2, 53) - 1, D = /\bOpera/; p = Object.prototype; var x = p.hasOwnProperty, C = p.toString, J = q(); "function" == typeof define && "object" == typeof define.amd && define.amd ? (f.platform = J, define(function() { return J })) : r && l ? d(J, function(m, G) { r[G] = m }) : f.platform = J }).call(this); function buildIOSMeta() { for (var a = [{ name: "viewport", content: "width=device-width, height=device-height, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no" }, { name: "apple-mobile-web-app-capable", content: "yes" }, { name: "apple-mobile-web-app-status-bar-style", content: "black" }], c = 0; c < a.length; c++) { var b = document.createElement("meta"); b.name = a[c].name; b.content = a[c].content; var d = window.document.head.querySelector('meta[name="' + b.name + '"]'); d && d.parentNode.removeChild(d); window.document.head.appendChild(b) } } function hideIOSFullscreenPanel() { jQuery(".xxx-ios-fullscreen-message").css("display", "none"); jQuery(".xxx-ios-fullscreen-scroll").css("display", "none"); jQuery(".xxx-game-iframe-full").removeClass("xxx-game-iframe-iphone-se") } function buildIOSFullscreenPanel() { jQuery("body").append('<div class="xxx-ios-fullscreen-message"><div class="xxx-ios-fullscreen-swipe"></div></div><div class="xxx-ios-fullscreen-scroll"></div>') } function showIOSFullscreenPanel() { jQuery(".xxx-ios-fullscreen-message").css("display", "block"); jQuery(".xxx-ios-fullscreen-scroll").css("display", "block") } function __iosResize() { window.scrollTo(0, 0); console.log(window.devicePixelRatio); console.log(window.innerWidth); console.log(window.innerHeight); if ("iPhone" === platform.product) switch (window.devicePixelRatio) { case 2: switch (window.innerWidth) { case 568: 320 !== window.innerHeight && jQuery(".xxx-game-iframe-full").addClass("xxx-game-iframe-iphone-se"); break; case 667: 375 === window.innerHeight ? hideIOSFullscreenPanel() : showIOSFullscreenPanel(); break; case 808: 414 === window.innerHeight ? hideIOSFullscreenPanel() : showIOSFullscreenPanel(); break; default: hideIOSFullscreenPanel() } break; case 3: switch (window.innerWidth) { case 736: 414 === window.innerHeight ? hideIOSFullscreenPanel() : showIOSFullscreenPanel(); break; case 724: 375 === window.innerHeight ? hideIOSFullscreenPanel() : showIOSFullscreenPanel(); break; case 808: 414 === window.innerHeight ? hideIOSFullscreenPanel() : showIOSFullscreenPanel(); break; default: hideIOSFullscreenPanel() } break; default: hideIOSFullscreenPanel() } } function iosResize() { __iosResize(); setTimeout(function() { __iosResize() }, 500) } function iosInIframe() { try { return window.self !== window.top } catch (a) { return !0 } } function isIOSLessThen13() { var a = platform.os, c = a.family.toLowerCase(); a = parseFloat(a.version); return "ios" === c && 13 > a ? !0 : !1 } $(document).ready(function() { platform && "iPhone" === platform.product && "safari" === platform.name.toLowerCase() && isIOSLessThen13() && !iosInIframe() && (buildIOSFullscreenPanel(), buildIOSMeta()) }); jQuery(window).resize(function() { platform && "iPhone" === platform.product && "safari" === platform.name.toLowerCase() && isIOSLessThen13() && !iosInIframe() && iosResize() }); var s_iScaleFactor = 1, s_bIsIphone = !1, s_iOffsetX, s_iOffsetY, s_bFocus = !0; (function(a) { (jQuery.browser = jQuery.browser || {}).mobile = /android|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(ad|hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|symbian|tablet|treo|up\.(browser|link)|vodafone|wap|webos|windows (ce|phone)|xda|xiino/i.test(a) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|e\-|e\/|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(di|rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|xda(\-|2|g)|yas\-|your|zeto|zte\-/i.test(a.substr(0, 4)) })(navigator.userAgent || navigator.vendor || window.opera); $(window).resize(function() { sizeHandler() }); function trace(a) { console.log(a) } function getSize(a) { var c = a.toLowerCase(), b = window.document, d = b.documentElement; if (void 0 === window["inner" + a]) a = d["client" + a]; else if (window["inner" + a] != d["client" + a]) { var e = b.createElement("body"); e.id = "vpw-test-b"; e.style.cssText = "overflow:scroll"; var g = b.createElement("div"); g.id = "vpw-test-d"; g.style.cssText = "position:absolute;top:-1000px"; g.innerHTML = "<style>@media(" + c + ":" + d["client" + a] + "px){body#vpw-test-b div#vpw-test-d{" + c + ":7px!important}}</style>"; e.appendChild(g); d.insertBefore(e, b.head); a = 7 == g["offset" + a] ? d["client" + a] : window["inner" + a]; d.removeChild(e) } else a = window["inner" + a]; return a } window.addEventListener("orientationchange", onOrientationChange); function onOrientationChange() { window.matchMedia("(orientation: portrait)").matches && sizeHandler(); window.matchMedia("(orientation: landscape)").matches && sizeHandler() } function isChrome() { return /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor) } function isIpad() { var a = -1 !== navigator.userAgent.toLowerCase().indexOf("ipad"); return !a && navigator.userAgent.match(/Mac/) && navigator.maxTouchPoints && 2 < navigator.maxTouchPoints ? !0 : a } function isMobile() { return isIpad() ? !0 : jQuery.browser.mobile } function isIOS() { var a = "iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";"); if (-1 !== navigator.userAgent.toLowerCase().indexOf("iphone")) return s_bIsIphone = !0; for (; a.length;) if (navigator.platform === a.pop()) return !0; return s_bIsIphone = !1 } function getIOSWindowHeight() { return document.documentElement.clientWidth / window.innerWidth * window.innerHeight } function getHeightOfIOSToolbars() { var a = (0 === window.orientation ? screen.height : screen.width) - getIOSWindowHeight(); return 1 < a ? a : 0 } function sizeHandler() { window.scrollTo(0, 1); if ($("#canvas")) { var a = null !== platform.name && "safari" === platform.name.toLowerCase() ? getIOSWindowHeight() : getSize("Height"); var c = getSize("Width"); s_bFocus && _checkOrientation(c, a); var b = Math.min(a / CANVAS_HEIGHT, c / CANVAS_WIDTH), d = Math.round(CANVAS_WIDTH * b); b = Math.round(CANVAS_HEIGHT * b); if (b < a) { var e = a - b; b += e; d += CANVAS_WIDTH / CANVAS_HEIGHT * e } else d < c && (e = c - d, d += e, b += CANVAS_HEIGHT / CANVAS_WIDTH * e); e = a / 2 - b / 2; var g = c / 2 - d / 2, n = CANVAS_WIDTH / d; if (g * n < -EDGEBOARD_X || e * n < -EDGEBOARD_Y) b = Math.min(a / (CANVAS_HEIGHT - 2 * EDGEBOARD_Y), c / (CANVAS_WIDTH - 2 * EDGEBOARD_X)), d = Math.round(CANVAS_WIDTH * b), b = Math.round(CANVAS_HEIGHT * b), e = (a - b) / 2, g = (c - d) / 2, n = CANVAS_WIDTH / d; s_iOffsetX = -1 * g * n; s_iOffsetY = -1 * e * n; 0 <= e && (s_iOffsetY = 0); 0 <= g && (s_iOffsetX = 0); null !== s_oInterface && s_oInterface.refreshButtonPos(); null !== s_oMenu && s_oMenu.refreshButtonPos(); s_bIsIphone && s_oStage ? (canvas = document.getElementById("canvas"), s_oStage.canvas.width = 2 * d, s_oStage.canvas.height = 2 * b, canvas.style.width = d + "px", canvas.style.height = b + "px", s_oStage.scaleX = s_oStage.scaleY = 2 * Math.min(d / CANVAS_WIDTH, b / CANVAS_HEIGHT)) : s_bMobile || isChrome() ? ($("#canvas").css("width", d + "px"), $("#canvas").css("height", b + "px")) : s_oStage && (s_oStage.canvas.width = d, s_oStage.canvas.height = b, s_iScaleFactor = Math.min(d / CANVAS_WIDTH, b / CANVAS_HEIGHT), s_oStage.scaleX = s_oStage.scaleY = s_iScaleFactor); 0 > e || (e = (a - b) / 2); $("#canvas").css("top", e + "px"); $("#canvas").css("left", g + "px"); fullscreenHandler() } } function _checkOrientation(a, c) { s_bMobile && ENABLE_CHECK_ORIENTATION && (a > c ? "landscape" === $(".orientation-msg-container").attr("data-orientation") ? ($(".orientation-msg-container").css("display", "none"), s_oMain.startUpdate()) : ($(".orientation-msg-container").css("display", "block"), s_oMain.stopUpdate()) : "portrait" === $(".orientation-msg-container").attr("data-orientation") ? ($(".orientation-msg-container").css("display", "none"), s_oMain.startUpdate()) : ($(".orientation-msg-container").css("display", "block"), s_oMain.stopUpdate())) } function playSound(a, c, b) { return !1 === DISABLE_SOUND_MOBILE || !1 === s_bMobile ? (s_aSounds[a].play(), s_aSounds[a].volume(c), s_aSounds[a].loop(b), s_aSounds[a]) : null } function stopSound(a) { !1 !== DISABLE_SOUND_MOBILE && !1 !== s_bMobile || s_aSounds[a].stop() } function setVolume(a, c) { !1 !== DISABLE_SOUND_MOBILE && !1 !== s_bMobile || s_aSounds[a].volume(c) } function setMute(a, c) { !1 !== DISABLE_SOUND_MOBILE && !1 !== s_bMobile || s_aSounds[a].mute(c) } function createBitmap(a, c, b) { var d = new createjs.Bitmap(a), e = new createjs.Shape; c && b ? e.graphics.beginFill("#fff").drawRect(0, 0, c, b) : e.graphics.beginFill("#ff0").drawRect(0, 0, a.width, a.height); d.hitArea = e; return d } function createSprite(a, c, b, d, e, g) { a = null !== c ? new createjs.Sprite(a, c) : new createjs.Sprite(a); c = new createjs.Shape; c.graphics.beginFill("#000000").drawRect(-b, -d, e, g); a.hitArea = c; return a } function randomFloatBetween(a, c, b) { "undefined" === typeof b && (b = 2); return parseFloat(Math.min(a + Math.random() * (c - a), c).toFixed(b)) } function rotateVector2D(a, c) { var b = c.getX() * Math.cos(a) + c.getY() * Math.sin(a), d = c.getX() * -Math.sin(a) + c.getY() * Math.cos(a); c.set(b, d) } function tweenVectorsOnX(a, c, b) { return a + b * (c - a) } function shuffle(a) { for (var c = a.length, b, d; 0 !== c;) d = Math.floor(Math.random() * c), --c, b = a[c], a[c] = a[d], a[d] = b; return a } function bubbleSort(a) { do { var c = !1; for (var b = 0; b < a.length - 1; b++) a[b] > a[b + 1] && (c = a[b], a[b] = a[b + 1], a[b + 1] = c, c = !0) } while (c) } function compare(a, c) { return a.index > c.index ? -1 : a.index < c.index ? 1 : 0 } function easeLinear(a, c, b, d) { return b * a / d + c } function easeInQuad(a, c, b, d) { return b * (a /= d) * a + c } function easeInSine(a, c, b, d) { return -b * Math.cos(a / d * (Math.PI / 2)) + b + c } function easeInCubic(a, c, b, d) { return b * (a /= d) * a * a + c } function getTrajectoryPoint(a, c) { var b = new createjs.Point, d = (1 - a) * (1 - a), e = a * a; b.x = d * c.start.x + 2 * (1 - a) * a * c.traj.x + e * c.end.x; b.y = d * c.start.y + 2 * (1 - a) * a * c.traj.y + e * c.end.y; return b } function formatTime(a) { a /= 1E3; var c = Math.floor(a / 60); a = Math.floor(a - 60 * c); var b = ""; b = 10 > c ? b + ("0" + c + ":") : b + (c + ":"); return 10 > a ? b + ("0" + a) : b + a } function degreesToRadians(a) { return a * Math.PI / 180 } function distance(a, c) { return Math.sqrt((c.x - a.x) * (c.x - a.x) + (c.y - a.y) * (c.y - a.y)) } function distance2(a, c) { return (c.x - a.x) * (c.x - a.x) + (c.y - a.y) * (c.y - a.y) } function NoClickDelay(a) { this.element = a; window.Touch && this.element.addEventListener("touchstart", this, !1) } function shuffle(a) { for (var c = a.length, b, d; 0 < c;) d = Math.floor(Math.random() * c), c--, b = a[c], a[c] = a[d], a[d] = b; return a } NoClickDelay.prototype = { handleEvent: function(a) { switch (a.type) { case "touchstart": this.onTouchStart(a); break; case "touchmove": this.onTouchMove(a); break; case "touchend": this.onTouchEnd(a) } }, onTouchStart: function(a) { a.preventDefault(); this.moved = !1; this.element.addEventListener("touchmove", this, !1); this.element.addEventListener("touchend", this, !1) }, onTouchMove: function(a) { this.moved = !0 }, onTouchEnd: function(a) { this.element.removeEventListener("touchmove", this, !1); this.element.removeEventListener("touchend", this, !1); if (!this.moved) { a = document.elementFromPoint(a.changedTouches[0].clientX, a.changedTouches[0].clientY); 3 == a.nodeType && (a = a.parentNode); var c = document.createEvent("MouseEvents"); c.initEvent("click", !0, !0); a.dispatchEvent(c) } } }; (function() { function a(b) { var d = { focus: "visible", focusin: "visible", pageshow: "visible", blur: "hidden", focusout: "hidden", pagehide: "hidden" }; b = b || window.event; b.type in d ? document.body.className = d[b.type] : (document.body.className = this[c] ? "hidden" : "visible", "hidden" === document.body.className ? (s_oMain.stopUpdate(), s_bFocus = !1) : (s_oMain.startUpdate(), s_bFocus = !0)) } var c = "hidden"; c in document ? document.addEventListener("visibilitychange", a) : (c = "mozHidden") in document ? document.addEventListener("mozvisibilitychange", a) : (c = "webkitHidden") in document ? document.addEventListener("webkitvisibilitychange", a) : (c = "msHidden") in document ? document.addEventListener("msvisibilitychange", a) : "onfocusin" in document ? document.onfocusin = document.onfocusout = a : window.onpageshow = window.onpagehide = window.onfocus = window.onblur = a })(); function ctlArcadeResume() { null !== s_oMain && s_oMain.startUpdate() } function ctlArcadePause() { null !== s_oMain && s_oMain.stopUpdate() } function getParamValue(a) { for (var c = window.location.search.substring(1).split("&"), b = 0; b < c.length; b++) { var d = c[b].split("="); if (d[0] == a) return d[1] } } function tweenVectors(a, c, b, d) { d.set(a.getX() + b * (c.getX() - a.getX()), a.getY() + b * (c.getY() - a.getY())); return d } function fullscreenHandler() { ENABLE_FULLSCREEN && screenfull.isEnabled && (s_bFullscreen = screenfull.isFullscreen, null !== s_oInterface && s_oInterface.resetFullscreenBut(), null !== s_oMenu && s_oMenu.resetFullscreenBut()) } if (screenfull.isEnabled) screenfull.on("change", function() { s_bFullscreen = screenfull.isFullscreen; null !== s_oInterface && s_oInterface.resetFullscreenBut(); null !== s_oMenu && s_oMenu.resetFullscreenBut() }); String.prototype.format = function() { for (var a = this, c = arguments.length; c--;) a = a.replace(new RegExp("\\{" + c + "\\}", "gm"), arguments[c]); return a }; function CSpriteLibrary() { var a = {}, c, b, d, e, g, n; this.init = function(u, q, l) { c = {}; d = b = 0; e = u; g = q; n = l }; this.addSprite = function(u, q) { if (!a.hasOwnProperty(u)) { var l = new Image; a[u] = c[u] = { szPath: q, oSprite: l, bLoaded: !1 }; b++ } }; this.getSprite = function(u) { return a.hasOwnProperty(u) ? a[u].oSprite : null }; this._onSpritesLoaded = function() { b = 0; g.call(n) }; this._onSpriteLoaded = function() { e.call(n); ++d === b && this._onSpritesLoaded() }; this.loadSprites = function() { for (var u in c) c[u].oSprite.oSpriteLibrary = this, c[u].oSprite.szKey = u, c[u].oSprite.onload = function() { this.oSpriteLibrary.setLoaded(this.szKey); this.oSpriteLibrary._onSpriteLoaded(this.szKey) }, c[u].oSprite.onerror = function(q) { var l = q.currentTarget; setTimeout(function() { c[l.szKey].oSprite.src = c[l.szKey].szPath }, 500) }, c[u].oSprite.src = c[u].szPath }; this.setLoaded = function(u) { a[u].bLoaded = !0 }; this.isLoaded = function(u) { return a[u].bLoaded }; this.getNumSprites = function() { return b } } var CANVAS_WIDTH = 1360, CANVAS_HEIGHT = 640, EDGEBOARD_X = 250, EDGEBOARD_Y = 5, FPS = 30, FPS_TIME = 1E3 / FPS, DISABLE_SOUND_MOBILE = !1, PRIMARY_FONT = "arialrounded", STATE_LOADING = 0, STATE_MENU = 1, STATE_HELP = 2, STATE_GAME = 3, ON_MOUSE_DOWN = 0, ON_MOUSE_UP = 1, ON_MOUSE_OVER = 2, ON_MOUSE_OUT = 3, ON_DRAG_START = 4, ON_DRAG_END = 5, ON_RELEASE_YES = 6, ON_RELEASE_NO = 7, STATE_CARD_DEALING = 0, STATE_CARD_REMOVING = 1, ON_CARD_SHOWN = 0, ON_CARD_ANIMATION_ENDING = 1, ON_CARD_SELECTED = 2, ON_CARD_REMOVED = 3, CARD_BOARD = 0, CARD_PILE = 1, CARD_WASTE = 2, CARD_WIDTH = 78, CARD_HEIGHT = 119, CARD_OFFSET_X = 5, CARD_OFFSET_Y = CARD_HEIGHT / 3, START_BOARD_Y = 150, NUM_CARDS_SOLITAIRE = 28, NUM_CARDS_PILE = 24, NUM_ROWS = 7, TIME_CARD_DEALING = 200, TIME_CARD_REMOVE = 1E3, SUM_MATCHING = 13, NUM_SCROLLING_DECK, SCORE_PER_CARD, SCORE_PER_ROW, MAX_TIME_SCORE = 999999, SOUNDTRACK_VOLUME_IN_GAME = .1, ENABLE_FULLSCREEN, ENABLE_CHECK_ORIENTATION; function CGameSettings() { var a, c; this._init = function() { var b = -1; a = []; for (var d = 0; 52 > d; d++) { var e = (d + 1) % 13; 1 === e ? (e = 1, b++) : 0 === e && (e = 13); a.push({ fotogram: d, rank: e, suit: b }) } this._initBlockList() }; this._initBlockList = function() { c = [ [], [0], [0], [1], [1, 2], [2], [3], [3, 4], [4, 5], [5], [6], [6, 7], [7, 8], [8, 9], [9], [10], [10, 11], [11, 12], [12, 13], [13, 14], [14], [15], [15, 16], [16, 17], [17, 18], [18, 19], [19, 20], [20] ] }; this.getShuffledCardDeck = function() { for (var b = [], d = 0; d < a.length; d++) b[d] = a[d]; for (d = []; 0 < b.length;) d.push(b.splice(Math.round(Math.random() * (b.length - 1)), 1)[0]); return d }; this.getBlockingList = function(b) { return c[b] }; this.getNumCards = function() { return a.length }; this._init() } function CPreloader() { var a, c, b, d, e, g, n, u, q, l; this._init = function() { s_oSpriteLibrary.init(this._onImagesLoaded, this._onAllImagesLoaded, this); s_oSpriteLibrary.addSprite("progress_bar", "./sprites/progress_bar.png"); s_oSpriteLibrary.addSprite("200x200", "./sprites/200x200.jpg"); s_oSpriteLibrary.addSprite("but_start", "./sprites/but_start.png"); s_oSpriteLibrary.loadSprites(); l = new createjs.Container; s_oStage.addChild(l) }; this.unload = function() { l.removeAllChildren(); q.unload() }; this._onImagesLoaded = function() {}; this._onAllImagesLoaded = function() { this.attachSprites(); s_oMain.preloaderReady() }; this.attachSprites = function() { var f = new createjs.Shape; f.graphics.beginFill("black").drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT); l.addChild(f); f = s_oSpriteLibrary.getSprite("200x200"); n = createBitmap(f); n.regX = .5 * f.width; n.regY = .5 * f.height; n.x = CANVAS_WIDTH / 2; n.y = CANVAS_HEIGHT / 2 - 80; l.addChild(n); u = new createjs.Shape; u.graphics.beginFill("rgba(0,0,0,0.01)").drawRoundRect(n.x - 100, n.y - 100, 200, 200, 10); l.addChild(u); n.mask = u; f = s_oSpriteLibrary.getSprite("progress_bar"); d = createBitmap(f); d.x = CANVAS_WIDTH / 2 - f.width / 2; d.y = CANVAS_HEIGHT / 2 + 70; l.addChild(d); a = f.width; c = f.height; e = new createjs.Shape; e.graphics.beginFill("rgba(0,0,0,0.01)").drawRect(d.x, d.y, 1, c); l.addChild(e); d.mask = e; b = new createjs.Text("", "30px " + PRIMARY_FONT, "#fff"); b.x = CANVAS_WIDTH / 2; b.y = CANVAS_HEIGHT / 2 + 120; b.textBaseline = "alphabetic"; b.textAlign = "center"; l.addChild(b); f = s_oSpriteLibrary.getSprite("but_start"); q = new CTextButton(CANVAS_WIDTH / 2, CANVAS_HEIGHT / 2 + 100, f, TEXT_PRELOADER_CONTINUE, "Arial", "#000", 36, l); q.addEventListener(ON_MOUSE_UP, this._onButStartRelease, this); q.setVisible(!1); g = new createjs.Shape; g.graphics.beginFill("black").drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT); l.addChild(g); createjs.Tween.get(g).to({ alpha: 0 }, 500).call(function() { createjs.Tween.removeTweens(g); l.removeChild(g) }) }; this._onButStartRelease = function() { s_oMain._allResourcesLoaded() }; this.refreshLoader = function(f) { b.text = f + "%"; 100 === f && (s_oMain._allResourcesLoaded(), b.visible = !1, d.visible = !1); e.graphics.clear(); f = Math.floor(f * a / 100); e.graphics.beginFill("rgba(0,0,0,0.01)").drawRect(d.x, d.y, f, c) }; this._init() } function CMain(a) { var c, b = 0, d = 0, e = STATE_LOADING, g, n; this.initContainer = function() { s_oCanvas = document.getElementById("canvas"); s_oStage = new createjs.Stage(s_oCanvas); s_oStage.preventSelection = !1; createjs.Touch.enable(s_oStage, !0); s_bMobile = isMobile(); !1 === s_bMobile && s_oStage.enableMouseOver(20); s_iPrevTime = (new Date).getTime(); createjs.Ticker.addEventListener("tick", this._update); createjs.Ticker.framerate = FPS; navigator.userAgent.match(/Windows Phone/i) && (DISABLE_SOUND_MOBILE = !0); s_oSpriteLibrary = new CSpriteLibrary; g = new CPreloader; }; this.preloaderReady = function() { s_oMain._loadImages(); !1 !== DISABLE_SOUND_MOBILE && !1 !== s_bMobile || s_oMain._initSounds() }; this.soundLoaded = function() { b++; g.refreshLoader(Math.floor(b / d * 100)) }; this._initSounds = function() { Howler.mute(!s_bAudioActive); s_aSoundsInfo = []; s_aSoundsInfo.push({ path: "./sounds/", filename: "win", loop: !1, volume: 1, ingamename: "win" }); s_aSoundsInfo.push({ path: "./sounds/", filename: "click", loop: !1, volume: 1, ingamename: "click" }); s_aSoundsInfo.push({ path: "./sounds/", filename: "game_over", loop: !1, volume: 1, ingamename: "game_over" }); s_aSoundsInfo.push({ path: "./sounds/", filename: "card_dealing", loop: !1, volume: 1, ingamename: "card_dealing" }); s_aSoundsInfo.push({ path: "./sounds/", filename: "matching", loop: !1, volume: 1, ingamename: "matching" }); s_aSoundsInfo.push({ path: "./sounds/", filename: "bonus_row", loop: !1, volume: 1, ingamename: "bonus_row" }); s_aSoundsInfo.push({ path: "./sounds/", filename: "soundtrack", loop: !0, volume: 1, ingamename: "soundtrack" }); d += s_aSoundsInfo.length; s_aSounds = []; for (var q = 0; q < s_aSoundsInfo.length; q++) this.tryToLoadSound(s_aSoundsInfo[q], !1) }; this.tryToLoadSound = function(q, l) { setTimeout(function() { s_aSounds[q.ingamename] = new Howl({ src: [q.path + q.filename + ".mp3"], autoplay: !1, preload: !0, loop: q.loop, volume: q.volume, onload: s_oMain.soundLoaded, onloaderror: function(f, r) { for (var p = 0; p < s_aSoundsInfo.length; p++) if (f === s_aSounds[s_aSoundsInfo[p].ingamename]._sounds[0]._id) { s_oMain.tryToLoadSound(s_aSoundsInfo[p], !0); break } }, onplayerror: function(f) { for (var r = 0; r < s_aSoundsInfo.length; r++) if (f === s_aSounds[s_aSoundsInfo[r].ingamename]._sounds[0]._id) { s_aSounds[s_aSoundsInfo[r].ingamename].once("unlock", function() { s_aSounds[s_aSoundsInfo[r].ingamename].play(); "soundtrack" === s_aSoundsInfo[r].ingamename && null !== s_oGame && setVolume("soundtrack", SOUNDTRACK_VOLUME_IN_GAME) }); break } } }) }, l ? 200 : 0) }; this._loadImages = function() { s_oSpriteLibrary.init(this._onImagesLoaded, this._onAllImagesLoaded, this); s_oSpriteLibrary.addSprite("but_play", "./sprites/but_play.png"); s_oSpriteLibrary.addSprite("msg_box", "./sprites/msg_box.png"); s_oSpriteLibrary.addSprite("but_credits", "./sprites/but_credits.png"); s_oSpriteLibrary.addSprite("ctl_logo", "./sprites/ctl_logo.png"); s_oSpriteLibrary.addSprite("bg_menu", "./sprites/bg_menu.jpg"); s_oSpriteLibrary.addSprite("bg_game", "./sprites/bg_game.jpg"); s_oSpriteLibrary.addSprite("but_exit", "./sprites/but_exit.png"); s_oSpriteLibrary.addSprite("audio_icon", "./sprites/audio_icon.png"); s_oSpriteLibrary.addSprite("but_fullscreen", "./sprites/but_fullscreen.png"); s_oSpriteLibrary.addSprite("but_yes", "./sprites/but_yes.png"); s_oSpriteLibrary.addSprite("but_no", "./sprites/but_no.png"); s_oSpriteLibrary.addSprite("but_home", "./sprites/but_home.png"); s_oSpriteLibrary.addSprite("but_restart", "./sprites/but_restart.png"); s_oSpriteLibrary.addSprite("but_restart_big", "./sprites/but_restart_big.png"); s_oSpriteLibrary.addSprite("end_panel_bg", "./sprites/end_panel_bg.png"); s_oSpriteLibrary.addSprite("card_spritesheet", "./sprites/card_spritesheet.png"); s_oSpriteLibrary.addSprite("card_selection", "./sprites/card_selection.png"); s_oSpriteLibrary.addSprite("arrow_right", "./sprites/arrow_right.png"); s_oSpriteLibrary.addSprite("but_deal", "./sprites/but_deal.png"); s_oSpriteLibrary.addSprite("time_icon", "./sprites/time_icon.png"); s_oSpriteLibrary.addSprite("image_help_0", "./sprites/image_help_0.png"); s_oSpriteLibrary.addSprite("image_help_1", "./sprites/image_help_1.png"); s_oSpriteLibrary.addSprite("image_help_2", "./sprites/image_help_2.png"); s_oSpriteLibrary.addSprite("help_arrow_left", "./sprites/help_arrow_left.png"); s_oSpriteLibrary.addSprite("help_arrow_right", "./sprites/help_arrow_right.png"); s_oSpriteLibrary.addSprite("but_help", "./sprites/but_help.png"); d += s_oSpriteLibrary.getNumSprites(); s_oSpriteLibrary.loadSprites() }; this._onImagesLoaded = function() { b++; g.refreshLoader(Math.floor(b / d * 100)) }; this._allResourcesLoaded = function() { g.unload(); s_oSoundTrack = playSound("soundtrack", 1, !0); s_oMain.gotoMenu() }; this._onAllImagesLoaded = function() {}; this.gotoMenu = function() { new CMenu; e = STATE_MENU }; this.gotoGame = function() { n = new CGame(u); e = STATE_GAME }; this.stopUpdate = function() { c = !1; createjs.Ticker.paused = !0; $("#block_game").css("display", "block"); !1 !== DISABLE_SOUND_MOBILE && !1 !== s_bMobile || Howler.mute(!0) }; this.startUpdate = function() { s_iPrevTime = (new Date).getTime(); c = !0; createjs.Ticker.paused = !1; $("#block_game").css("display", "none"); (!1 === DISABLE_SOUND_MOBILE || !1 === s_bMobile) && s_bAudioActive && Howler.mute(!1) }; this._update = function(q) { if (!1 !== c) { var l = (new Date).getTime(); s_iTimeElaps = l - s_iPrevTime; s_iCntTime += s_iTimeElaps; s_iCntFps++; s_iPrevTime = l; 1E3 <= s_iCntTime && (s_iCurFps = s_iCntFps, s_iCntTime -= 1E3, s_iCntFps = 0); e === STATE_GAME && n.update(); s_oStage.update(q) } }; s_oMain = this; var u = a; NUM_SCROLLING_DECK = a.num_turn_pile; ENABLE_FULLSCREEN = a.fullscreen; ENABLE_CHECK_ORIENTATION = a.check_orientation; SCORE_PER_CARD = a.card_score; SCORE_PER_ROW = a.score_per_row; s_bAudioActive = a.audio_enable_on_startup; this.initContainer() } var s_bMobile, s_bAudioActive = !0, s_iCntTime = 0, s_iTimeElaps = 0, s_iPrevTime = 0, s_iCntFps = 0, s_iCurFps = 0, s_oStage, s_oMain, s_oSpriteLibrary, s_oCanvas, s_bFullscreen = !1, s_oSoundTrack = null, s_aSounds; function CTextButton(a, c, b, d, e, g, n, u) { var q, l, f, r, p, E, D, x, C, J, m, G; this._init = function(z, A, v, t, k, B, F, H) { q = !1; l = 1; E = []; D = []; var O = createBitmap(v); C = new createjs.Text(t, " " + F + "px " + k, B); C.textAlign = "center"; C.textBaseline = "alphabetic"; C.x = v.width / 2; C.y = v.height / 2 + 15; x = new createjs.Container; x.x = z; x.y = A; x.regX = v.width / 2; x.regY = v.height / 2; x.addChild(O, C); H.addChild(x); f = v.width; r = v.height; this._initListener() }; this.unload = function() { x.off("mousedown", J); x.off("pressup", G); s_bMobile || x.off("mouseover", m); u.removeChild(x) }; this.setVisible = function(z) { x.visible = z }; this.enable = function() { q = !1; x.filters = []; x.cache(0, 0, f, r) }; this.disable = function() { q = !0; var z = (new createjs.ColorMatrix).adjustSaturation(-100); x.filters = [new createjs.ColorMatrixFilter(z)]; x.cache(0, 0, f, r) }; this._initListener = function() { J = x.on("mousedown", this.buttonDown); G = x.on("pressup", this.buttonRelease); s_bMobile || (m = x.on("mouseover", this.buttonOver)) }; this.addEventListener = function(z, A, v) { E[z] = A; D[z] = v }; this.addEventListenerWithParams = function(z, A, v, t) { E[z] = A; D[z] = v; p = t }; this.buttonRelease = function() { q || (x.scaleX = l, x.scaleY = l, E[ON_MOUSE_UP] && E[ON_MOUSE_UP].call(D[ON_MOUSE_UP], p)) }; this.buttonDown = function() { q || (x.scaleX = .9 * l, x.scaleY = .9 * l, E[ON_MOUSE_DOWN] && E[ON_MOUSE_DOWN].call(D[ON_MOUSE_DOWN], p)) }; this.buttonOver = function(z) { s_bMobile || (z.target.cursor = "pointer") }; this.setTextPosition = function(z) { C.y = z }; this.setPosition = function(z, A) { x.x = z; x.y = A }; this.setText = function(z) { C.text = z; x.cache(0, 0, f, r) }; this.moveTo = function(z, A) { createjs.Tween.get(x).to({ x: z.x, y: z.y }, A, createjs.Ease.cubicOut) }; this.tremble = function() { createjs.Tween.get(x).to({ rotation: 10 }, 40, createjs.Ease.cubicOut).to({ rotation: -10 }, 80).to({ rotation: 10 }, 80).to({ rotation: -10 }, 80).to({ rotation: 0 }, 40) }; this.scale = function(z) { createjs.Tween.get(x).to({ scaleX: l * z, scaleY: l * z }, 200, createjs.Ease.cubicOut).to({ scaleX: l, scaleY: l }, 1E3, createjs.Ease.elasticOut) }; this.setX = function(z) { x.x = z }; this.setY = function(z) { x.y = z }; this.getButtonImage = function() { return x }; this.getX = function() { return x.x }; this.getY = function() { return x.y }; this.getText = function() { return C.text }; this.isDisabled = function() { return q }; this._init(a, c, b, d, e, g, n, u); return this } function CToggle(a, c, b, d, e) { var g, n, u, q, l, f, r; this._init = function(E, D, x, C) { n = []; u = []; var J = new createjs.SpriteSheet({ images: [x], frames: { width: x.width / 2, height: x.height, regX: x.width / 2 / 2, regY: x.height / 2 }, animations: { state_true: [0], state_false: [1] } }); g = C; q = createSprite(J, "state_" + g, x.width / 2 / 2, x.height / 2, x.width / 2, x.height); q.x = E; q.y = D; q.stop(); p.addChild(q); this._initListener() }; this.unload = function() { q.off("mousedown", l); q.off("pressup", r); s_bMobile || q.off("mouseover", f); p.removeChild(q) }; this._initListener = function() { l = q.on("mousedown", this.buttonDown); r = q.on("pressup", this.buttonRelease); s_bMobile || (f = q.on("mouseover", this.buttonOver)) }; this.addEventListener = function(E, D, x) { n[E] = D; u[E] = x }; this.setActive = function(E) { g = E; q.gotoAndStop("state_" + g) }; this.buttonRelease = function() { q.scaleX = 1; q.scaleY = 1; playSound("click", 1, !1); g = !g; q.gotoAndStop("state_" + g); n[ON_MOUSE_UP] && n[ON_MOUSE_UP].call(u[ON_MOUSE_UP], g) }; this.buttonDown = function() { q.scaleX = .9; q.scaleY = .9; n[ON_MOUSE_DOWN] && n[ON_MOUSE_DOWN].call(u[ON_MOUSE_DOWN]) }; this.buttonOver = function(E) { s_bMobile || (E.target.cursor = "pointer") }; this.setPosition = function(E, D) { q.x = E; q.y = D }; var p = e; this._init(a, c, b, d) } function CGfxButton(a, c, b, d) { var e, g, n, u, q, l, f, r, p, E, D; this._init = function(C, J, m, G) { e = !1; g = 1; l = []; f = []; r = createBitmap(m); r.x = C; r.y = J; r.scaleX = r.scaleY = g; r.regX = m.width / 2; r.regY = m.height / 2; G.addChild(r); n = m.width; u = m.height; this._initListener() }; this.unload = function() { s_bMobile ? r.off("mousedown", p) : (r.off("mousedown", p), r.off("mouseover", E)); r.off("pressup", D); d.removeChild(r) }; this.enable = function() { e = !1; r.filters = []; r.cache(0, 0, n, u) }; this.disable = function() { e = !0; var C = (new createjs.ColorMatrix).adjustSaturation(-100); r.filters = [new createjs.ColorMatrixFilter(C)]; r.cache(0, 0, n, u) }; this.setScale = function(C) { g = C; r.scaleX = r.scaleY = g }; this.setVisible = function(C) { r.visible = C }; this._initListener = function() { s_bMobile ? p = r.on("mousedown", this.buttonDown) : (p = r.on("mousedown", this.buttonDown), E = r.on("mouseover", this.buttonOver)); D = r.on("pressup", this.buttonRelease) }; this.addEventListener = function(C, J, m) { l[C] = J; f[C] = m }; this.addEventListenerWithParams = function(C, J, m, G) { l[C] = J; f[C] = m; q = G }; this.buttonRelease = function() { e || (r.scaleX = g, r.scaleY = g, l[ON_MOUSE_UP] && l[ON_MOUSE_UP].call(f[ON_MOUSE_UP], q)) }; this.buttonDown = function() { e || (r.scaleX = .9 * g, r.scaleY = .9 * g, playSound("click", 1, !1), l[ON_MOUSE_DOWN] && l[ON_MOUSE_DOWN].call(f[ON_MOUSE_DOWN], q)) }; this.buttonOver = function(C) { s_bMobile || e || (C.target.cursor = "pointer") }; this.inversePulse = function() { createjs.Tween.get(r).to({ scaleX: 1.1 * g, scaleY: 1.1 * g }, 1050, createjs.Ease.quadOut).to({ scaleX: g, scaleY: g }, 850, createjs.Ease.quadIn).call(function() { x.inversePulse() }) }; this.setPosition = function(C, J) { r.x = C; r.y = J }; this.setX = function(C) { r.x = C }; this.setY = function(C) { r.y = C }; this.getButtonImage = function() { return r }; this.getX = function() { return r.x }; this.getY = function() { return r.y }; this.isDisabled = function() { return e }; this.setClickable = function(C) { e = !C }; var x = this; this._init(a, c, b, d); return this } function CMenu() { var a, c, b, d, e, g, n, u, q, l, f, r, p = null, E = null; this._init = function() { n = createBitmap(s_oSpriteLibrary.getSprite("bg_menu")); s_oStage.addChild(n); var D = s_oSpriteLibrary.getSprite("but_play"); u = new CGfxButton(CANVAS_WIDTH / 2, CANVAS_HEIGHT / 2 + 110, D, s_oStage); u.addEventListener(ON_MOUSE_UP, this._onButPlayRelease, this); u.inversePulse(); if (!1 === DISABLE_SOUND_MOBILE || !1 === s_bMobile) D = s_oSpriteLibrary.getSprite("audio_icon"), e = CANVAS_WIDTH - D.height / 2 - 10, g = D.height / 2 + 10, l = new CToggle(e, g, D, s_bAudioActive, s_oStage), l.addEventListener(ON_MOUSE_UP, this._onAudioToggle, this); D = s_oSpriteLibrary.getSprite("but_credits"); b = D.height / 2 + 10; d = D.height / 2 + 10; f = new CGfxButton(b, d, D, s_oStage); f.addEventListener(ON_MOUSE_UP, this._onButCreditRelease, this); D = window.document; var x = D.documentElement; p = x.requestFullscreen || x.mozRequestFullScreen || x.webkitRequestFullScreen || x.msRequestFullscreen; E = D.exitFullscreen || D.mozCancelFullScreen || D.webkitExitFullscreen || D.msExitFullscreen; !1 === ENABLE_FULLSCREEN && (p = !1); p && screenfull.isEnabled && (D = s_oSpriteLibrary.getSprite("but_fullscreen"), a = b + D.width / 2 + 10, c = d, r = new CToggle(a, c, D, s_bFullscreen, s_oStage), r.addEventListener(ON_MOUSE_UP, this._onFullscreenRelease, this)); q = new createjs.Shape; q.graphics.beginFill("black").drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT); s_oStage.addChild(q); createjs.Tween.get(q).to({ alpha: 0 }, 1E3).call(function() { q.visible = !1 }); this.refreshButtonPos() }; this.unload = function() { u.unload(); u = null; f.unload(); if (!1 === DISABLE_SOUND_MOBILE || !1 === s_bMobile) l.unload(), l = null; p && screenfull.isEnabled && r.unload(); s_oStage.removeAllChildren(); s_oMenu = n = null }; this.refreshButtonPos = function() { f.setPosition(b + s_iOffsetX, s_iOffsetY + d); !1 !== DISABLE_SOUND_MOBILE && !1 !== s_bMobile || l.setPosition(e - s_iOffsetX, s_iOffsetY + g); p && screenfull.isEnabled && r.setPosition(a + s_iOffsetX, c + s_iOffsetY) }; this._onAudioToggle = function() { Howler.mute(s_bAudioActive); s_bAudioActive = !s_bAudioActive }; this._onButPlayRelease = function() { this.unload(); $(s_oMain).trigger("start_session"); s_oMain.gotoGame() }; this._onButCreditRelease = function() { new CCreditsPanel }; this.resetFullscreenBut = function() { p && screenfull.isEnabled && r.setActive(s_bFullscreen) }; this._onFullscreenRelease = function() { s_bFullscreen ? E.call(window.document) : p.call(window.document.documentElement); sizeHandler() }; s_oMenu = this; this._init() } var s_oMenu = null; function CGame(a) { var c = !1, b, d, e, g, n, u, q, l, f, r, p, E, D, x, C, J, m, G, z, A, v = null; this._init = function() { D = new CVector2(606, 539); x = new CVector2(752, 539); var t = createBitmap(s_oSpriteLibrary.getSprite("bg_game")); s_oStage.addChild(t); J = new CGameSettings; G = new CInterface; this.reset(); m = new createjs.Container; s_oStage.addChild(m); this.extractCards(); A = new CAreYouSurePanel(s_oStage); v = new CEndPanel; z = new createjs.Shape; z.graphics.beginFill("rgba(0,0,0,0.01)").drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT); z.on("click", function() {}); s_oStage.addChild(z); this.showHelp(); setVolume("soundtrack", SOUNDTRACK_VOLUME_IN_GAME) }; this.unload = function() { G.unload(); v.unload(); A.unload(); createjs.Tween.removeAllTweens(); s_oStage.removeAllChildren(); s_oGame = null }; this.reset = function() { b = !1; u = q = d = 0; g = J.getNumCards() - NUM_CARDS_SOLITAIRE; n = NUM_SCROLLING_DECK; C = null; p = []; E = [1, 2, 3, 4, 5, 6, 7]; f = []; r = []; p = []; G.refreshScore(d); setVolume("soundtrack", 1) }; this.restart = function() { z.visible = !0; this.resetCards(); this.reset(); G.reset(u); this.extractCards(); c = !0 }; this.resetCards = function() { for (var t = 0; t < r.length; t++) r[t].unload(); for (t = 0; t < f.length; t++) f[t].unload(); for (t = 0; t < p.length; t++) p[t].unload(); f = []; r = []; p = [] }; this.extractCards = function() { do this.resetCards(), l = [], l = J.getShuffledCardDeck(), this.dealCards(), this.initBlocks(); while (this._checkIfNoMatching()) }; this.initBlocks = function() { for (var t = 0; t < r.length; t++) for (var k = J.getBlockingList(t), B = 0; B < k.length; B++) r[k[B]].increaseNumBlocks() }; this._removeBlocks = function(t) { t = t.getBlockingList(); for (var k = 0; k < t.length; k++) r[t[k]].decreaseNumBlock() }; this.dealCards = function() { f = []; for (var t = 0, k = 0; k < l.length - NUM_CARDS_SOLITAIRE; k++) { var B = !1; k === l.length - NUM_CARDS_SOLITAIRE - 1 && (B = !0); var F = new CVector2(D.getX() - .2 * t, D.getY() - .2 * t); F = new CCard(!0, B, CARD_PILE, F, l[t].fotogram, l[t].rank, [], m); F.setClickable(!1); F.addEventListener(ON_CARD_ANIMATION_ENDING, this._onCardMovedInPile); F.addEventListener(ON_CARD_SELECTED, this._onCardSelected); F.addEventListener(ON_CARD_REMOVED, this._onCardRemoved); f.push(F); t++ } f[f.length - 1].setClickable(!0); r = []; k = 1; B = CANVAS_WIDTH / 2; for (var H = START_BOARD_Y, O = 0; O < NUM_ROWS; O++) { for (var I = B, P = 0; P < k; P++) { var W = J.getBlockingList(t - f.length); F = new CVector2(D.getX() - .2 * t, D.getY() - .2 * t); F = new CCard(!1, !0, CARD_BOARD, F, l[t].fotogram, l[t].rank, W, m); F.setEndPos(new CVector2(I, H)); F.setRowInBoard(O); F.addEventListener(ON_CARD_ANIMATION_ENDING, this._onCardDealed); F.addEventListener(ON_CARD_SELECTED, this._onCardSelected); F.addEventListener(ON_CARD_REMOVED, this._onCardRemoved); I += CARD_WIDTH + CARD_OFFSET_X; t++; r.push(F) } B -= CARD_WIDTH / 2; H += CARD_OFFSET_Y; k++ } e = 0; r[e].deal() }; this._onCardDealed = function() { e++; e < r.length ? r[e].deal() : (f[f.length - 1].showCard(), z.visible = !1) }; this._onCardMovedInPile = function(t, k) { if (t === CARD_PILE) { var B = p.indexOf(k); - 1 < B && (p.splice(B, 1), 0 < p.length && p[p.length - 1].setClickable(!0)); s_oGame._moveCardInPile() } else B = f.indexOf(k), -1 < B && (f.splice(B, 1), 0 < f.length && f[f.length - 1].setClickable(!0)), z.visible = !1 }; this._onCardSelected = function(t, k) { t ? k.getValue() === SUM_MATCHING ? (k.getType() === CARD_PILE && s_oInterface.setNextCardButClickable(!1), s_oGame._calculateScore([k]), k.initRemoving(), s_oGame._removeBlocks(k)) : null === C ? C = k : (s_oGame._checkMatching(k), C = null) : C = null }; this._onCardRemoved = function(t, k) { s_oInterface.setNextCardButClickable(!0); switch (t) { case CARD_PILE: var B = f.indexOf(k); - 1 < B && f.splice(B, 1); 0 === f.length ? s_oGame.decreasePileScroll() : f[f.length - 1].setClickable(!0); break; case CARD_BOARD: q++; b || s_oGame._checkGameOver(); break; case CARD_WASTE: B = p.indexOf(k), -1 < B && p.splice(B, 1), 0 < p.length && p[p.length - 1].setClickable(!0) } }; this._calculateScore = function(t) { for (var k = 0; k < t.length; k++) { var B = t[k].getRow(); --E[B] } k = !1; for (B = 0; B < E.length; B++) 0 === E[B] && (E[B] = -1, k = !0, d += SCORE_PER_ROW[B], new CScoreText(SCORE_PER_ROW[B], t[0].getX(), t[0].getY()), playSound("bonus_row", 1, !1)); k || (d += SCORE_PER_CARD, playSound("matching", 1, !1)); G.refreshScore(d) }; this._checkMatching = function(t) { t.getValue() + C.getValue() === SUM_MATCHING ? (this._calculateScore([t, C]), t.initRemoving(), C.initRemoving(), this._removeBlocks(t), this._removeBlocks(C), t.getType() !== CARD_PILE && C.getType() !== CARD_PILE || s_oInterface.setNextCardButClickable(!1)) : (t.tremble(), C.tremble()); C = null }; this._checkIfNoMatching = function() { for (var t = [], k = 0; k < r.length; k++) r[k].isClickable() && t.push(r[k].getValue()); for (var B = 0; B < t.length; B++) if (t[B] === SUM_MATCHING) return !1; for (B = 0; B < t.length; B++) for (k = 0; k < t.length; k++) if (t[B] + t[k] === SUM_MATCHING) return !1; for (k = 0; k < f.length; k++) for (B = 0; B < r.length; B++) if (r[B].isClickable() && f[k].getValue() + r[B].getValue() === SUM_MATCHING) return !1; if (0 < n) { for (k = 0; k < p.length; k++) for (B = 0; B < r.length; B++) if (r[B].isClickable() && p[k].getValue() + r[B].getValue() === SUM_MATCHING) return !1; for (k = 0; k < p.length; k++) if (p[k].getValue() === SUM_MATCHING) return !1 } return p[p.length - 1].getValue() === SUM_MATCHING ? !1 : !0 }; this.restorePile = function() { this._moveCardInPile() }; this._moveCardInPile = function() { s_oGame.disableCardSelected(); g = p.length - 1; if (0 <= g) { z.visible = !0; f.push(p[g]); this._sortDepthInPile(); var t = new CVector2(D.getX() - .2 * f.length, D.getY() - .2 * f.length); p[g].setEndPos(t); p[g].deal(); p[g].changeType(CARD_PILE) } else z.visible = !1 }; this._checkGameOver = function() { q === NUM_CARDS_SOLITAIRE ? this._gameOver(!0) : this._checkIfNoMatching() && this._gameOver(!1) }; this._gameOver = function(t) { var k = 0; t && (k = Math.floor((MAX_TIME_SCORE - u) / 1E3), 0 > k && (k = 0)); var B = d; d += k; G.refreshScore(d); b = !0; v.show(t, k, B, d) }; this._sortDepthInPile = function() { var t = 0 < p.length ? p[p.length - 1].getDepth() : -1; for (var k = 0; k < f.length; k++) t++, f[k].setDepth(t), f[k].setClickable(!1); f[f.length - 1].setClickable(!0) }; this._sortDepthInWastePile = function() { var t = 0 < f.length ? f[f.length - 1].getDepth() : -1; for (var k = 0; k < p.length; k++) t++, p[k].setDepth(t), p[k].setClickable(!1); p[p.length - 1].setClickable(!0) }; this.moveCardInWaste = function() { s_oGame.disableCardSelected(); g = f.length - 1; if (0 <= g) { z.visible = !0; p.push(f[g]); this._sortDepthInWastePile(); var t = new CVector2(x.getX() - .2 * p.length, x.getY() - .2 * p.length); f[g].setEndPos(t); f[g].deal(); f[g].changeType(CARD_WASTE) } 0 === g && this.decreasePileScroll() }; this.decreasePileScroll = function() { n--; G.refreshDealLeft(n); 0 === n ? (G.disableDealPileBut(), this._checkGameOver()) : G.enableDealPileBut() }; this.disableCardSelected = function() { C && (C.removeSelection(), C = null) }; this.setUpdate = function(t) { c = t }; this.showHelp = function() { this.setUpdate(!1); new CHelpPanel }; this.onExitHelp = function() { this.setUpdate(!0) }; this.onTryExit = function() { this.setUpdate(!1); A.show(TEXT_ARE_YOU_SURE_EXIT); A.addEventListener(ON_RELEASE_YES, this._onExitYes); A.addEventListener(ON_RELEASE_NO, this._onExitNo) }; this._onExitYes = function() { $(s_oMain).trigger("end_session"); $(s_oMain).trigger("show_interlevel_ad"); s_oGame.onExit() }; this._onExitNo = function() { s_oGame.setUpdate(!0) }; this.onTryRestart = function() { this.setUpdate(!1); A.show(TEXT_ARE_YOU_SURE_RESTART); A.addEventListener(ON_RELEASE_YES, this._onRestartYes); A.addEventListener(ON_RELEASE_NO, this._onRestartNo) }; this._onRestartYes = function() { A.hide(); s_oGame.restart() }; this._onRestartNo = function() { s_oGame.setUpdate(!0) }; this.onExit = function() { this.unload(); s_oMain.gotoMenu() }; this._updateCards = function() { for (var t = 0; t < r.length; t++) r[t].update(); for (t = 0; t < f.length; t++) f[t].update(); for (t = 0; t < p.length; t++) p[t].update() }; this.update = function() { c && (this._updateCards(), !1 === b && (u += s_iTimeElaps, G.refreshTime(u))) }; s_oGame = this; this._init() } var s_oGame; function CInterface() { var a, c, b, d, e, g, n, u, q, l, f, r, p, E, D, x, C, J, m, G, z, A, v, t, k = null, B = null; this._init = function() { var F = s_oSpriteLibrary.getSprite("but_exit"); f = CANVAS_WIDTH - F.width / 2 - 10; r = F.height / 2 + 10; E = new CGfxButton(f, r, F, s_oStage); E.addEventListener(ON_MOUSE_UP, this._onExit, this); F = s_oSpriteLibrary.getSprite("but_restart"); q = f - F.width - 10; l = r; D = new CGfxButton(f, r, F, s_oStage); D.addEventListener(ON_MOUSE_UP, this._onRestartRelease, this); F = s_oSpriteLibrary.getSprite("but_help"); n = q - F.width - 10; u = l; x = new CGfxButton(n, u, F, s_oStage); x.addEventListener(ON_MOUSE_UP, this._onHelpRelease, this); var H = s_oSpriteLibrary.getSprite("but_fullscreen"); !1 === DISABLE_SOUND_MOBILE || !1 === s_bMobile ? (e = F.width / 2 + 10, g = l, p = new CToggle(e, g, s_oSpriteLibrary.getSprite("audio_icon"), s_bAudioActive, s_oStage), p.addEventListener(ON_MOUSE_UP, this._onAudioToggle, this), a = e + H.width / 2 + 10, c = g) : (a = F.width / 2 + 10, c = l); F = window.document; var O = F.documentElement; k = O.requestFullscreen || O.mozRequestFullScreen || O.webkitRequestFullScreen || O.msRequestFullscreen; B = F.exitFullscreen || F.mozCancelFullScreen || F.webkitExitFullscreen || F.msExitFullscreen; !1 === ENABLE_FULLSCREEN && (k = !1); k && screenfull.isEnabled && (C = new CToggle(a, c, H, s_bFullscreen, s_oStage), C.addEventListener(ON_MOUSE_UP, this._onFullscreenRelease, this)); J = new CGfxButton(CANVAS_WIDTH / 2, 510, s_oSpriteLibrary.getSprite("arrow_right"), s_oStage); J.addEventListener(ON_MOUSE_UP, this._onNextCardInPile, this); m = new CGfxButton(CANVAS_WIDTH / 2, 570, s_oSpriteLibrary.getSprite("but_deal"), s_oStage); m.setVisible(!1); m.addEventListener(ON_MOUSE_UP, this._onDeal, this); b = 10; d = CANVAS_HEIGHT - 40; t = new createjs.Container; t.x = b; t.y = d; s_oStage.addChild(t); G = new CTLText(t, 0, 0, 300, 30, 30, "left", "#fff", PRIMARY_FONT, 1, 0, 0, " ", !0, !0, !1, !1); A = new CTLText(s_oStage, CANVAS_WIDTH / 2 - 150, CANVAS_HEIGHT - 25, 300, 16, 16, "center", "#fff", PRIMARY_FONT, 1, 0, 0, TEXT_DEAL_LEFT + " " + NUM_SCROLLING_DECK, !0, !0, !1, !1); v = new createjs.Container; v.x = CANVAS_WIDTH / 2; v.y = 50; s_oStage.addChild(v); H = createBitmap(s_oSpriteLibrary.getSprite("time_icon")); v.addChild(H); z = new CTLText(v, 60, 10, 150, 40, 40, "left", "#fff", PRIMARY_FONT, 1, 0, 0, "00:00", !0, !0, !1, !1); v.regX = v.getBounds().width / 2; v.regY = v.getBounds().height / 2; this.refreshButtonPos() }; this.unload = function() { if (!1 === DISABLE_SOUND_MOBILE || !1 === s_bMobile) p.unload(), p = null; k && screenfull.isEnabled && C.unload(); E.unload(); D.unload(); x.unload(); s_oInterface = null }; this.refreshButtonPos = function() { t.x = b + s_iOffsetX; t.y = d - s_iOffsetY; E.setPosition(f - s_iOffsetX, s_iOffsetY + r); D.setPosition(q - s_iOffsetX, s_iOffsetY + l); x.setPosition(n - s_iOffsetX, u + s_iOffsetY); !1 !== DISABLE_SOUND_MOBILE && !1 !== s_bMobile || p.setPosition(e + s_iOffsetX, s_iOffsetY + g); k && screenfull.isEnabled && C.setPosition(a + s_iOffsetX, c + s_iOffsetY) }; this.reset = function(F) { this.refreshTime(F) }; this.refreshDealLeft = function(F) { A.refreshText(TEXT_DEAL_LEFT + " " + F) }; this.enableDealPileBut = function() { m.setVisible(!0) }; this.disableDealPileBut = function() { m.setVisible(!1) }; this.refreshTime = function(F) { z.refreshText(formatTime(F)) }; this.refreshScore = function(F) { G.refreshText(TEXT_SCORE + " " + F) }; this.setNextCardButClickable = function(F) { J.setClickable(F) }; this._onNextCardInPile = function() { s_oGame.moveCardInWaste() }; this._onDeal = function() { m.setVisible(!1); s_oGame.restorePile() }; this._onAudioToggle = function() { Howler.mute(s_bAudioActive); s_bAudioActive = !s_bAudioActive }; this._onExit = function() { s_oGame.onTryExit() }; this._onRestartRelease = function() { s_oGame.onTryRestart() }; this._onHelpRelease = function() { s_oGame.showHelp() }; this.resetFullscreenBut = function() { k && screenfull.isEnabled && C.setActive(s_bFullscreen) }; this._onFullscreenRelease = function() { s_bFullscreen ? B.call(window.document) : k.call(window.document.documentElement); sizeHandler() }; s_oInterface = this; this._init(); return this } var s_oInterface = null; function CEndPanel() { var a, c, b, d, e, g, n, u, q, l, f, r = this; this._init = function() { l = new createjs.Container; l.visible = !1; s_oStage.addChild(l); q = new createjs.Shape; q.graphics.beginFill("rgba(0,0,0)").drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT); u = q.on("click", function() {}); l.addChild(q); f = new createjs.Container; l.addChild(f); var p = s_oSpriteLibrary.getSprite("end_panel_bg"), E = createBitmap(p); f.addChild(E); b = new CTLText(f, p.width / 2 - 350, 20, 700, 65, 65, "center", "#fff", PRIMARY_FONT, 1, 0, 0, " ", !0, !0, !1, !1); e = new CTLText(f, p.width / 2 - 350, 110, 700, 40, 40, "center", "#fff", PRIMARY_FONT, 1, 0, 0, " ", !0, !0, !1, !1); d = new CTLText(f, p.width / 2 - 350, 150, 700, 40, 40, "center", "#fff", PRIMARY_FONT, 1, 0, 0, " ", !0, !0, !1, !1); c = new CTLText(f, p.width / 2 - 350, 200, 700, 45, 45, "center", "#fff", PRIMARY_FONT, 1, 0, 0, " ", !0, !0, !1, !1); g = new CGfxButton(p.width / 2 + 170, 340, s_oSpriteLibrary.getSprite("but_home"), f); g.addEventListener(ON_MOUSE_UP, this._onReleaseHome, this); n = new CGfxButton(p.width / 2 - 170, 340, s_oSpriteLibrary.getSprite("but_restart_big"), f); n.addEventListener(ON_MOUSE_UP, this._onReleaseRestart, this); f.regX = p.width / 2; f.regY = p.height / 2; f.x = CANVAS_WIDTH / 2; f.y = CANVAS_HEIGHT / 2; a = p.height }; this.unload = function() { q.off("click", u); n.unload(); g.unload() }; this.show = function(p, E, D, x) { p ? (b.refreshText(TEXT_CONGRATS), playSound("win", 1, !1)) : (b.refreshText(TEXT_GAMEOVER), playSound("game_over", 1, !1)); f.y = -a; l.visible = !0; c.refreshText(TEXT_YOUR_SCORE + " " + x); d.refreshText(TEXT_CARD_SCORE + " " + D); e.refreshText(TEXT_TIME_SCORE + " " + E); f.visible = !0; q.alpha = .1; createjs.Tween.get(f).to({ y: CANVAS_HEIGHT / 2 }, 1E3, createjs.Ease.backOut).call(function() { createjs.Tween.get(q).to({ alpha: .7 }, 500) }); $(s_oMain).trigger("save_score", x); $(s_oMain).trigger("share_event", x) }; this.hide = function() { l.visible = !1; $(s_oMain).trigger("show_interlevel_ad") }; this._onReleaseHome = function() { r.hide(); $(s_oMain).trigger("end_session"); s_oMain.gotoMenu() }; this._onReleaseRestart = function() { r.hide(); s_oGame.restart() }; this._init() } function CCreditsPanel() { var a, c, b, d, e, g, n, u; this._init = function() { d = new createjs.Container; s_oStage.addChild(d); b = new createjs.Shape; b.graphics.beginFill("black").drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT); a = b.on("click", function() {}); b.alpha = 0; d.addChild(b); e = new createjs.Container; d.addChild(e); var q = s_oSpriteLibrary.getSprite("msg_box"); u = createBitmap(q); c = u.on("click", this._onLogoButRelease); e.addChild(u); var l = new createjs.Text(TEXT_DEVELOPED, "60px " + PRIMARY_FONT, "#000"); l.x = q.width / 2; l.y = q.height / 2 - 90; l.textAlign = "center"; l.textBaseline = "middle"; l.lineWidth = 600; l.outline = 5; var f = new createjs.Text(TEXT_DEVELOPED, "50px " + PRIMARY_FONT, "#ffffff"); f.x = q.width / 2; f.y = l.y; f.textAlign = "center"; f.textBaseline = "middle"; f.lineWidth = 600; e.addChild(f); l = new createjs.Text("www.codethislab.com", "40px " + PRIMARY_FONT, "#000"); l.x = q.width / 2; l.y = q.height / 2 + 90; l.textAlign = "center"; l.textBaseline = "middle"; l.lineWidth = 600; l.outline = 5; f = new createjs.Text("www.codethislab.com", "40px " + PRIMARY_FONT, "#ffffff"); f.x = q.width / 2; f.y = l.y; f.textAlign = "center"; f.textBaseline = "middle"; f.lineWidth = 600; e.addChild(f); l = s_oSpriteLibrary.getSprite("ctl_logo"); n = createBitmap(l); n.x = q.width / 2; n.y = q.height / 2; n.regX = l.width / 2; n.regY = l.height / 2; e.addChild(n); l = s_oSpriteLibrary.getSprite("but_exit"); g = new CGfxButton(q.width - l.width / 2 - 10, l.height / 2 + 10, l, e); g.addEventListener(ON_MOUSE_UP, this.unload, this); e.regX = q.width / 2; e.regY = q.height / 2; e.x = CANVAS_WIDTH / 2; e.y = -q.height; createjs.Tween.get(b).to({ alpha: .7 }, 1E3, createjs.Ease.cubicOut); createjs.Tween.get(e).to({ y: CANVAS_HEIGHT / 2 }, 1E3, createjs.Ease.bounceOut) }; this.unload = function() { s_oStage.removeChild(d); g.unload(); b.off("click", a); u.off("click", c) }; this._onLogoButRelease = function() { window.open("http://www.codethislab.com/index.php?&l=en") }; this._init() } function CAreYouSurePanel(a) { var c, b, d, e, g, n, u, q, l, f; this._init = function() { b = []; d = []; l = new createjs.Container; l.visible = !1; r.addChild(l); q = new createjs.Shape; q.graphics.beginFill("black").drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT); u = q.on("click", function() {}); l.addChild(q); f = new createjs.Container; l.addChild(f); var p = s_oSpriteLibrary.getSprite("msg_box"), E = createBitmap(p); f.addChild(E); e = new CTLText(f, p.width / 2 - 250, 50, 500, 160, 60, "center", "#fff", PRIMARY_FONT, 1, 0, 0, " ", !0, !0, !0, !1); g = new CGfxButton(p.width / 2 + 220, 330, s_oSpriteLibrary.getSprite("but_yes"), f); g.addEventListener(ON_MOUSE_UP, this._onReleaseYes, this); n = new CGfxButton(p.width / 2 - 220, 330, s_oSpriteLibrary.getSprite("but_no"), f); n.addEventListener(ON_MOUSE_UP, this._onReleaseNo, this); f.regX = p.width / 2; f.regY = p.height / 2; f.x = CANVAS_WIDTH / 2; f.y = CANVAS_HEIGHT / 2; c = p.height }; this.addEventListener = function(p, E, D) { b[p] = E; d[p] = D }; this.unload = function() { q.off("click", u); n.unload(); g.unload() }; this.show = function(p) { f.y = -c; q.alpha = 0; l.visible = !0; e.refreshText(p); f.visible = !0; createjs.Tween.get(q).to({ alpha: .7 }, 1E3, createjs.Ease.cubicOut); createjs.Tween.get(f).to({ y: CANVAS_HEIGHT / 2 }, 1E3, createjs.Ease.backOut) }; this.hide = function() { l.visible = !1 }; this._onReleaseYes = function() { b[ON_RELEASE_YES] && b[ON_RELEASE_YES].call(d[ON_RELEASE_YES]) }; this._onReleaseNo = function() { b[ON_RELEASE_NO] && b[ON_RELEASE_NO].call(d[ON_RELEASE_NO]); l.visible = !1 }; var r = a; this._init(a) } function CCard(a, c, b, d, e, g, n, u) { var q, l, f, r = -1, p, E, D, x, C, J, m, G, z, A, v, t, k = this, B, F, H; this._init = function(I, P, W, X, T, Y, h) { q = P; f = !1; p = W; E = 0; m = h; l = !0; H = new createjs.Container; H.x = X.getX(); H.y = X.getY(); H.visible = I; O.addChild(H); I = s_oSpriteLibrary.getSprite("card_spritesheet"); I = new createjs.SpriteSheet({ images: [I], frames: { width: CARD_WIDTH, height: CARD_HEIGHT, regX: CARD_WIDTH / 2, regY: CARD_HEIGHT / 2 }, animations: { card_1_1: [0], card_1_2: [1], card_1_3: [2], card_1_4: [3], card_1_5: [4], card_1_6: [5], card_1_7: [6], card_1_8: [7], card_1_9: [8], card_1_10: [9], card_1_J: [10], card_1_Q: [11], card_1_K: [12], card_2_1: [13], card_2_2: [14], card_2_3: [15], card_2_4: [16], card_2_5: [17], card_2_6: [18], card_2_7: [19], card_2_8: [20], card_2_9: [21], card_2_10: [22], card_2_J: [23], card_2_Q: [24], card_2_K: [25], card_3_1: [26], card_3_2: [27], card_3_3: [28], card_3_4: [29], card_3_5: [30], card_3_6: [31], card_3_7: [32], card_3_8: [33], card_3_9: [34], card_3_10: [35], card_3_J: [36], card_3_Q: [37], card_3_K: [38], card_4_1: [39], card_4_2: [40], card_4_3: [41], card_4_4: [42], card_4_5: [43], card_4_6: [44], card_4_7: [45], card_4_8: [46], card_4_9: [47], card_4_10: [48], card_4_J: [49], card_4_Q: [50], card_4_K: [51], back: [52] } }); B = createSprite(I, P ? "back" : T, CARD_WIDTH / 2, CARD_HEIGHT / 2, CARD_WIDTH, CARD_HEIGHT); B.stop(); H.addChild(B); I = s_oSpriteLibrary.getSprite("card_selection"); F = createBitmap(I); F.regX = I.width / 2; F.regY = I.height / 2; F.visible = !1; H.addChild(F); A = B.on("click", this._onSelected); J = 0; x = T; C = Y; G = X; v = []; t = [] }; this.unload = function() { z = G = null; O.removeChild(H) }; this.addEventListener = function(I, P, W) { v[I] = P; t[I] = W }; this.setEndPos = function(I) { z = I }; this.increaseNumBlocks = function() { E++; l = !1 }; this.decreaseNumBlock = function() { E--; 0 === E && (l = !0) }; this.setClickable = function(I) { l = I }; this.setRowInBoard = function(I) { D = I }; this.deal = function() { H.visible = !0; q && this.showCard(); playSound("card_dealing", 1, !1); r = STATE_CARD_DEALING }; this.initRemoving = function() { G = new CVector2(H.x, H.y); B.off("click", A); var I = H.x; I = H.x > CANVAS_WIDTH / 2 ? I + 30 : I - 30; z = new CVector2(I, CANVAS_HEIGHT + CARD_HEIGHT); l = !1; J = 0; r = STATE_CARD_REMOVING }; this.setValue = function() { B.gotoAndStop(x); var I = this; createjs.Tween.get(B).to({ scaleX: 1 }, 100).call(function() { I.cardShown() }) }; this.setDepth = function(I) { O.setChildIndex(H, I) }; this.changeType = function(I) { p = I }; this.getType = function() { return p }; this.showCard = function() { q = !1; var I = this; createjs.Tween.get(B).to({ scaleX: .1 }, 100).call(function() { I.setValue() }) }; this.cardShown = function() { v[ON_CARD_SHOWN] && v[ON_CARD_SHOWN].call(t[ON_CARD_SHOWN]) }; this.tremble = function() { createjs.Tween.get(H).to({ rotation: 10 }, 40, createjs.Ease.cubicOut).to({ rotation: -10 }, 80).to({ rotation: 10 }, 80).to({ rotation: -10 }, 80).to({ rotation: 0 }, 40); f = !1; F.visible = f }; this._onSelected = function() { l && (playSound("click", 1, !1), f = !f, F.visible = f, v[ON_CARD_SELECTED] && v[ON_CARD_SELECTED].call(t[ON_CARD_SELECTED], f, k)) }; this.removeSelection = function() { f = !1; F.visible = f }; this.getState = function() { return r }; this.getValue = function() { return C }; this.getFotogram = function() { return x }; this.getBlockingList = function() { return m }; this.isClickable = function() { return l }; this.getX = function() { return H.x }; this.getY = function() { return H.y }; this.getDepth = function() { return O.getChildIndex(H) }; this.getRow = function() { return D }; this._updateDealing = function() { J += s_iTimeElaps; if (J > TIME_CARD_DEALING) r = -1, J = 0, H.x = z.getX(), H.y = z.getY(), G = new CVector2(H.x, H.y), v[ON_CARD_ANIMATION_ENDING] && v[ON_CARD_ANIMATION_ENDING].call(t[ON_CARD_ANIMATION_ENDING], p, k); else { this.visible = !0; var I = easeInOutCubic(J, 0, 1, TIME_CARD_DEALING), P = new CVector2; P = tweenVectors(G, z, I, P); H.x = P.getX(); H.y = P.getY() } }; this._updateRemoving = function() { J += s_iTimeElaps; if (J > TIME_CARD_REMOVE) J = 0, r = -1, v[ON_CARD_REMOVED] && v[ON_CARD_REMOVED].call(t[ON_CARD_REMOVED], p, k), this.unload(); else { var I = easeInBack(J, 0, 1, TIME_CARD_REMOVE), P = new CVector2; P = tweenVectors(G, z, I, P); H.x = P.getX(); H.y = P.getY(); H.rotation += 10 } }; this.update = function() { switch (r) { case STATE_CARD_DEALING: this._updateDealing(); break; case STATE_CARD_REMOVING: this._updateRemoving() } }; var O = u; this._init(a, c, b, d, e, g, n) } function CVector2(a, c) { var b, d; this._init = function(e, g) { b = e; d = g }; this.add = function(e, g) { b += e; d += g }; this.addV = function(e) { b += e.getX(); d += e.getY() }; this.scalarDivision = function(e) { b /= e; d /= e }; this.subV = function(e) { b -= e.getX(); d -= e.getY() }; this.scalarProduct = function(e) { b *= e; d *= e }; this.invert = function() { b *= -1; d *= -1 }; this.dotProduct = function(e) { return b * e.getX() + d * e.getY() }; this.set = function(e, g) { b = e; d = g }; this.setV = function(e) { b = e.getX(); d = e.getY() }; this.length = function() { return Math.sqrt(b * b + d * d) }; this.length2 = function() { return b * b + d * d }; this.normalize = function() { var e = this.length(); 0 < e && (b /= e, d /= e) }; this.getNormalize = function(e) { this.length(); e.set(b, d); e.normalize() }; this.rot90CCW = function() { var e = b; b = -d; d = e }; this.rot90CW = function() { var e = b; b = d; d = -e }; this.getRotCCW = function(e) { e.set(b, d); e.rot90CCW() }; this.getRotCW = function(e) { e.set(b, d); e.rot90CW() }; this.ceil = function() { b = Math.ceil(b); d = Math.ceil(d) }; this.round = function() { b = Math.round(b); d = Math.round(d) }; this.toString = function() { return "Vector2: " + b + ", " + d }; this.print = function() { trace("Vector2: " + b + ", " + d) }; this.getX = function() { return b }; this.getY = function() { return d }; this._init(a, c) } var TYPE_LINEAR = 0, TYPE_OUT_CUBIC = 1, TYPE_IN_CUBIC = 2, TYPE_OUT_BACK = 3, TYPE_IN_BACK = 4; function ease(a, c, b, d, e, g) { switch (a) { case TYPE_LINEAR: var n = easeLinear(c, b, d, e, g); break; case TYPE_IN_CUBIC: n = easeInCubic(c, b, d, e, g); break; case TYPE_OUT_CUBIC: n = easeOutCubic(c, b, d, e, g); break; case TYPE_IN_BACK: n = easeInBack(c, b, d, e, g); break; case TYPE_OUT_BACK: n = easeInBack(c, b, d, e, g) } return n } function easeOutBounce(a, c, b, d) { return (a /= d) < 1 / 2.75 ? 7.5625 * b * a * a + c : a < 2 / 2.75 ? b * (7.5625 * (a -= 1.5 / 2.75) * a + .75) + c : a < 2.5 / 2.75 ? b * (7.5625 * (a -= 2.25 / 2.75) * a + .9375) + c : b * (7.5625 * (a -= 2.625 / 2.75) * a + .984375) + c } function easeInBounce(a, c, b, d) { return b - easeOutBounce(d - a, 0, b, d) + c } function easeInOutBounce(a, c, b, d) { return a < d / 2 ? .5 * easeInBounce(2 * a, 0, b, d) + c : .5 * easeOutBounce(2 * a - d, 0, b, d) + .5 * b + c } function easeInCirc(a, c, b, d) { return -b * (Math.sqrt(1 - (a /= d) * a) - 1) + c } function easeOutCirc(a, c, b, d) { return b * Math.sqrt(1 - (a = a / d - 1) * a) + c } function easeInOutCirc(a, c, b, d) { return 1 > (a /= d / 2) ? -b / 2 * (Math.sqrt(1 - a * a) - 1) + c : b / 2 * (Math.sqrt(1 - (a -= 2) * a) + 1) + c } function easeInCubic(a, c, b, d, e) { return b * (a /= d) * a * a + c } function easeOutCubic(a, c, b, d, e) { return b * ((a = a / d - 1) * a * a + 1) + c } function easeInOutCubic(a, c, b, d, e) { return 1 > (a /= d / 2) ? b / 2 * a * a * a + c : b / 2 * ((a -= 2) * a * a + 2) + c } function easeInElastic(a, c, b, d, e, g, n) { if (0 == a) return c; if (1 == (a /= d)) return c + b; n || (n = .3 * d); !g || g < Math.abs(b) ? (g = b, e = n / 4) : e = n / (2 * Math.PI) * Math.asin(b / g); return -(g * Math.pow(2, 10 * --a) * Math.sin(2 * (a * d - e) * Math.PI / n)) + c } function easeOutElastic(a, c, b, d, e, g, n) { if (0 == a) return c; if (1 == (a /= d)) return c + b; n || (n = .3 * d); !g || g < Math.abs(b) ? (g = b, e = n / 4) : e = n / (2 * Math.PI) * Math.asin(b / g); return g * Math.pow(2, -10 * a) * Math.sin(2 * (a * d - e) * Math.PI / n) + b + c } function easeInOutElastic(a, c, b, d, e, g, n) { if (0 == a) return c; if (1 == (a /= d)) return c + b; n || (n = .3 * d); !g || g < Math.abs(b) ? (g = b, e = n / 4) : e = n / (2 * Math.PI) * Math.asin(b / g); return 1 > a ? -.5 * g * Math.pow(2, 10 * --a) * Math.sin(2 * (a * d - e) * Math.PI / n) + c : g * Math.pow(2, -10 * --a) * Math.sin(2 * (a * d - e) * Math.PI / n) * .5 + b + c } function easeInExpo(a, c, b, d) { return 0 == a ? c : b * Math.pow(2, 10 * (a / d - 1)) + c } function easeOutExpo(a, c, b, d) { return a == d ? c + b : b * (-Math.pow(2, -10 * a / d) + 1) + c } function easeInOutExpo(a, c, b, d) { return 0 == a ? c : a == d ? c + b : 1 > (a /= d / 2) ? b / 2 * Math.pow(2, 10 * (a - 1)) + c : b / 2 * (-Math.pow(2, -10 * --a) + 2) + c } function easeLinear(a, c, b, d) { return b * a / d + c } function easeInQuad(a, c, b, d) { return b * (a /= d) * a + c } function easeOutQuad(a, c, b, d) { return -b * (a /= d) * (a - 2) + c } function easeInOutQuad(a, c, b, d) { return 1 > (a /= d / 2) ? b / 2 * a * a + c : -b / 2 * (--a * (a - 2) - 1) + c } function easeInQuart(a, c, b, d) { return b * (a /= d) * a * a * a + c } function easeOutQuart(a, c, b, d) { return -b * ((a = a / d - 1) * a * a * a - 1) + c } function easeInOutQuart(a, c, b, d) { return 1 > (a /= d / 2) ? b / 2 * a * a * a * a + c : -b / 2 * ((a -= 2) * a * a * a - 2) + c } function easeInQuint(a, c, b, d) { return b * (a /= d) * a * a * a * a + c } function easeOutQuint(a, c, b, d) { return b * ((a = a / d - 1) * a * a * a * a + 1) + c } function easeInOutQuint(a, c, b, d) { return 1 > (a /= d / 2) ? b / 2 * a * a * a * a * a + c : b / 2 * ((a -= 2) * a * a * a * a + 2) + c } function easeInSine(a, c, b, d) { return -b * Math.cos(a / d * (Math.PI / 2)) + b + c } function easeOutSine(a, c, b, d) { return b * Math.sin(a / d * (Math.PI / 2)) + c } function easeInOutSine(a, c, b, d) { return -b / 2 * (Math.cos(Math.PI * a / d) - 1) + c } function easeInBack(a, c, b, d) { return b * (a /= d) * a * (2.70158 * a - 1.70158) + c } function easeOutBack(a, c, b, d) { return b * ((a = a / d - 1) * a * (2.70158 * a + 1.70158) + 1) + c } function CHelpPanel() { var a, c, b, d, e = this, g, n, u, q, l; this._init = function() { l = new createjs.Container; s_oStage.addChild(l); g = new createjs.Shape; g.graphics.beginFill("rgba(0,0,0,0.7)").drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT); d = g.on("click", function() {}); l.addChild(g); b = []; for (var f = 0; 3 > f; f++) this._createPage(f); n = new CGfxButton(CANVAS_WIDTH / 2 + 300, 470, s_oSpriteLibrary.getSprite("help_arrow_right"), l); n.addEventListener(ON_MOUSE_UP, this._onRight, this); u = new CGfxButton(CANVAS_WIDTH / 2 - 300, 470, s_oSpriteLibrary.getSprite("help_arrow_left"), l); u.addEventListener(ON_MOUSE_UP, this._onLeft, this); q = new CGfxButton(CANVAS_WIDTH / 2, 580, s_oSpriteLibrary.getSprite("but_play"), l); q.setScale(.4); q.addEventListener(ON_MOUSE_UP, this._onPlay, this); b[0].visible = !0; c = 0 }; this.unload = function() { g.off("click", d); u.unload(); n.unload(); q.unload(); s_oStage.removeChild(l) }; this.show = function() { l.y = -a; g.alpha = 0; l.visible = !0; createjs.Tween.get(g).to({ alpha: .7 }, 1E3, createjs.Ease.cubicOut); createjs.Tween.get(l).to({ y: CANVAS_HEIGHT / 2 }, 1E3, createjs.Ease.backOut) }; this._createPage = function(f) { var r = new createjs.Container; r.visible = !1; l.addChild(r); b.push(r); var p = s_oSpriteLibrary.getSprite("msg_box"), E = createBitmap(p); r.addChild(E); new CTLText(r, p.width / 2 - 350, 30, 700, 160, 40, "center", "#fff", PRIMARY_FONT, 1, 0, 0, TEXT_HELP[f].format(NUM_SCROLLING_DECK), !0, !0, !0, !1); f = s_oSpriteLibrary.getSprite("image_help_" + f); E = createBitmap(f); E.regX = f.width / 2; E.x = p.width / 2; E.y = 210; r.addChild(E); r.regX = p.width / 2; r.regY = p.height / 2; r.x = CANVAS_WIDTH / 2; r.y = CANVAS_HEIGHT / 2; a = p.height }; this._onRight = function() { b[c].visible = !1; c++; 3 === c && (c = 0); b[c].visible = !0 }; this._onLeft = function() { b[c].visible = !1; c--; 0 > c && (c = 2); b[c].visible = !0 }; this._onPlay = function() { e.unload(); s_oGame.onExitHelp() }; this._init() } function CScoreText(a, c, b) { var d, e, g; this._init = function(n, u, q) { d = new createjs.Container; d.alpha = 0; d.x = u; d.y = q; s_oStage.addChild(d); n = 0 <= n ? "+" + n : n; g = new createjs.Text(n, "50px " + PRIMARY_FONT, "#004e6f"); g.textAlign = "center"; g.outline = 4; d.addChild(g); e = new createjs.Text(n, "50px " + PRIMARY_FONT, "#fff"); e.textAlign = "center"; d.addChild(e); var l = this; createjs.Tween.get(d).to({ alpha: 1 }, 400, createjs.Ease.quadIn).call(function() { l.moveUp() }) }; this.moveUp = function() { var n = d.y - 100, u = this; createjs.Tween.get(d).to({ y: n }, 1E3, createjs.Ease.backIn).call(function() { u.unload() }); createjs.Tween.get(d).wait(500).to({ alpha: 0 }, 500) }; this.unload = function() { s_oStage.removeChild(d) }; this._init(a, c, b) } CTLText.prototype = { constructor: CTLText, __autofit: function() { if (this._bFitText) { for (var a = this._iFontSize; (this._oText.getBounds().height > this._iHeight - 2 * this._iPaddingV || this._oText.getBounds().width > this._iWidth - 2 * this._iPaddingH) && !(a--, this._oText.font = a + "px " + this._szFont, this._oText.lineHeight = Math.round(a * this._fLineHeightFactor), this.__updateY(), this.__verticalAlign(), 8 > a);); this._iFontSize = a } }, __verticalAlign: function() { if (this._bVerticalAlign) { var a = this._oText.getBounds().height; this._oText.y -= (a - this._iHeight) / 2 + this._iPaddingV } }, __updateY: function() { this._oText.y = this._y + this._iPaddingV; switch (this._oText.textBaseline) { case "middle": this._oText.y += this._oText.lineHeight / 2 + (this._iFontSize * this._fLineHeightFactor - this._iFontSize) } }, __createText: function(a) { this._bDebug && (this._oDebugShape = new createjs.Shape, this._oDebugShape.graphics.beginFill("rgba(255,0,0,0.5)").drawRect(this._x, this._y, this._iWidth, this._iHeight), this._oContainer.addChild(this._oDebugShape)); this._oText = new createjs.Text(a, this._iFontSize + "px " + this._szFont, this._szColor); this._oText.textBaseline = "middle"; this._oText.lineHeight = Math.round(this._iFontSize * this._fLineHeightFactor); this._oText.textAlign = this._szAlign; this._oText.lineWidth = this._bMultiline ? this._iWidth - 2 * this._iPaddingH : null; switch (this._szAlign) { case "center": this._oText.x = this._x + this._iWidth / 2; break; case "left": this._oText.x = this._x + this._iPaddingH; break; case "right": this._oText.x = this._x + this._iWidth - this._iPaddingH } this._oContainer.addChild(this._oText); this.refreshText(a) }, setVerticalAlign: function(a) { this._bVerticalAlign = a }, setOutline: function(a) { null !== this._oText && (this._oText.outline = a) }, setShadow: function(a, c, b, d) { null !== this._oText && (this._oText.shadow = new createjs.Shadow(a, c, b, d)) }, setColor: function(a) { this._oText.color = a }, setAlpha: function(a) { this._oText.alpha = a }, removeTweens: function() { createjs.Tween.removeTweens(this._oText) }, getText: function() { return this._oText }, getY: function() { return this._y }, getFontSize: function() { return this._iFontSize }, refreshText: function(a) { "" === a && (a = " "); null === this._oText && this.__createText(a); this._oText.text = a; this._oText.font = this._iFontSize + "px " + this._szFont; this._oText.lineHeight = Math.round(this._iFontSize * this._fLineHeightFactor); this.__autofit(); this.__updateY(); this.__verticalAlign() } }; function CTLText(a, c, b, d, e, g, n, u, q, l, f, r, p, E, D, x, C) { this._oContainer = a; this._x = c; this._y = b; this._iWidth = d; this._iHeight = e; this._bMultiline = x; this._iFontSize = g; this._szAlign = n; this._szColor = u; this._szFont = q; this._iPaddingH = f; this._iPaddingV = r; this._bVerticalAlign = D; this._bFitText = E; this._bDebug = C; this._oDebugShape = null; this._fLineHeightFactor = l; this._oText = null; p && this.__createText(p) } function extractHostname(a) { a = -1 < a.indexOf("://") ? a.split("/")[2] : a.split("/")[0]; a = a.split(":")[0]; return a = a.split("?")[0] } function extractRootDomain(a) { a = extractHostname(a); var c = a.split("."), b = c.length; 2 < b && (a = c[b - 2] + "." + c[b - 1]); return a } var getClosestTop = function() { var a = window, c = !1; try { for (; a.parent.document !== a.document;) if (a.parent.document) a = a.parent; else { c = !0; break } } catch (b) { c = !0 } return { topFrame: a, err: c } }, getBestPageUrl = function(a) { var c = a.topFrame, b = ""; if (a.err) try { try { b = window.top.location.href } catch (e) { var d = window.location.ancestorOrigins; b = d[d.length - 1] } } catch (e) { b = c.document.referrer } else b = c.location.href; return b }, TOPFRAMEOBJ = getClosestTop(), PAGE_URL = getBestPageUrl(TOPFRAMEOBJ); function seekAndDestroy() { for (var a = extractRootDomain(PAGE_URL), c = [String.fromCharCode(99, 111, 100, 101, 116, 104, 105, 115, 108, 97, 98, 46, 99, 111, 109), String.fromCharCode(101, 110, 118, 97, 116, 111, 46, 99, 111, 109), String.fromCharCode(99, 111, 100, 101, 99, 97, 110, 121, 111, 110, 46, 99, 111, 109), String.fromCharCode(99, 111, 100, 101, 99, 97, 110, 121, 111, 110, 46, 110, 101, 116)], b = 0; b < c.length; b++) if (c[b] === a) return !0; return !1 };
| ver. 1.4 |
Github
|
.
| PHP 8.2.29 | Генераци� �траницы: 0.01 |
proxy
|
phpinfo
|
�а�тройка