Файловый менеджер - Редактировать - /home/jogoso94/public_html/jogos/spider_3/js/main.js
�азад
/* TweenJS Visit http://createjs.com/ for documentation, updates and examples. Copyright (c) 2010 gskinner.com, inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 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> */ this.createjs = this.createjs || {}; createjs.extend = function(a, e) { function b() { this.constructor = a } b.prototype = e.prototype; return a.prototype = new b }; this.createjs = this.createjs || {}; createjs.promote = function(a, e) { var b = a.prototype, d = Object.getPrototypeOf && Object.getPrototypeOf(b) || b.__proto__; if (d) { b[(e += "_") + "constructor"] = d.constructor; for (var c in d) b.hasOwnProperty(c) && "function" == typeof d[c] && (b[e + c] = d[c]) } return a }; this.createjs = this.createjs || {}; createjs.deprecate = function(a, e) { return function() { var b = "Deprecated property or method '" + e + "'. See docs for info."; console && (console.warn ? console.warn(b) : console.log(b)); return a && a.apply(this, arguments) } }; this.createjs = this.createjs || {}; (function() { function a(b, d, c) { this.type = b; this.currentTarget = this.target = null; this.eventPhase = 0; this.bubbles = !!d; this.cancelable = !!c; this.timeStamp = (new Date).getTime(); this.removed = this.immediatePropagationStopped = this.propagationStopped = this.defaultPrevented = !1 } var e = a.prototype; e.preventDefault = function() { this.defaultPrevented = this.cancelable && !0 }; e.stopPropagation = function() { this.propagationStopped = !0 }; e.stopImmediatePropagation = function() { this.immediatePropagationStopped = this.propagationStopped = !0 }; e.remove = function() { this.removed = !0 }; e.clone = function() { return new a(this.type, this.bubbles, this.cancelable) }; e.set = function(b) { for (var d in b) this[d] = b[d]; return this }; e.toString = function() { return "[Event (type=" + this.type + ")]" }; createjs.Event = a })(); this.createjs = this.createjs || {}; (function() { function a() { this._captureListeners = this._listeners = null } var e = a.prototype; a.initialize = function(b) { b.addEventListener = e.addEventListener; b.on = e.on; b.removeEventListener = b.off = e.removeEventListener; b.removeAllEventListeners = e.removeAllEventListeners; b.hasEventListener = e.hasEventListener; b.dispatchEvent = e.dispatchEvent; b._dispatchEvent = e._dispatchEvent; b.willTrigger = e.willTrigger }; e.addEventListener = function(b, d, c) { var f = c ? this._captureListeners = this._captureListeners || {} : this._listeners = this._listeners || {}; var g = f[b]; g && this.removeEventListener(b, d, c); (g = f[b]) ? g.push(d): f[b] = [d]; return d }; e.on = function(b, d, c, f, g, h) { d.handleEvent && (c = c || d, d = d.handleEvent); c = c || this; return this.addEventListener(b, function(l) { d.call(c, l, g); f && l.remove() }, h) }; e.removeEventListener = function(b, d, c) { if (c = c ? this._captureListeners : this._listeners) { var f = c[b]; if (f) for (var g = 0, h = f.length; g < h; g++) if (f[g] == d) { 1 == h ? delete c[b] : f.splice(g, 1); break } } }; e.off = e.removeEventListener; e.removeAllEventListeners = function(b) { b ? (this._listeners && delete this._listeners[b], this._captureListeners && delete this._captureListeners[b]) : this._listeners = this._captureListeners = null }; e.dispatchEvent = function(b, d, c) { if ("string" == typeof b) { var f = this._listeners; if (!(d || f && f[b])) return !0; b = new createjs.Event(b, d, c) } else b.target && b.clone && (b = b.clone()); try { b.target = this } catch (g) {} if (b.bubbles && this.parent) { c = this; for (d = [c]; c.parent;) d.push(c = c.parent); f = d.length; for (c = f - 1; 0 <= c && !b.propagationStopped; c--) d[c]._dispatchEvent(b, 1 + (0 == c)); for (c = 1; c < f && !b.propagationStopped; c++) d[c]._dispatchEvent(b, 3) } else this._dispatchEvent(b, 2); return !b.defaultPrevented }; e.hasEventListener = function(b) { var d = this._listeners, c = this._captureListeners; return !!(d && d[b] || c && c[b]) }; e.willTrigger = function(b) { for (var d = this; d;) { if (d.hasEventListener(b)) return !0; d = d.parent } return !1 }; e.toString = function() { return "[EventDispatcher]" }; e._dispatchEvent = function(b, d) { var c, f, g = 2 >= d ? this._captureListeners : this._listeners; if (b && g && (f = g[b.type]) && (c = f.length)) { try { b.currentTarget = this } catch (l) {} try { b.eventPhase = d | 0 } catch (l) {} b.removed = !1; f = f.slice(); for (g = 0; g < c && !b.immediatePropagationStopped; g++) { var h = f[g]; h.handleEvent ? h.handleEvent(b) : h(b); b.removed && (this.off(b.type, h, 1 == d), b.removed = !1) } } 2 === d && this._dispatchEvent(b, 2.1) }; createjs.EventDispatcher = a })(); this.createjs = this.createjs || {}; (function() { function a() { throw "Ticker cannot be instantiated."; } a.RAF_SYNCHED = "synched"; a.RAF = "raf"; a.TIMEOUT = "timeout"; a.timingMode = null; a.maxDelta = 0; a.paused = !1; a.removeEventListener = null; a.removeAllEventListeners = null; a.dispatchEvent = null; a.hasEventListener = null; a._listeners = null; createjs.EventDispatcher.initialize(a); a._addEventListener = a.addEventListener; a.addEventListener = function() { !a._inited && a.init(); return a._addEventListener.apply(a, arguments) }; a._inited = !1; a._startTime = 0; a._pausedTime = 0; a._ticks = 0; a._pausedTicks = 0; a._interval = 50; a._lastTime = 0; a._times = null; a._tickTimes = null; a._timerId = null; a._raf = !0; a._setInterval = function(d) { a._interval = d; a._inited && a._setupTick() }; a.setInterval = createjs.deprecate(a._setInterval, "Ticker.setInterval"); a._getInterval = function() { return a._interval }; a.getInterval = createjs.deprecate(a._getInterval, "Ticker.getInterval"); a._setFPS = function(d) { a._setInterval(1E3 / d) }; a.setFPS = createjs.deprecate(a._setFPS, "Ticker.setFPS"); a._getFPS = function() { return 1E3 / a._interval }; a.getFPS = createjs.deprecate(a._getFPS, "Ticker.getFPS"); try { Object.defineProperties(a, { interval: { get: a._getInterval, set: a._setInterval }, framerate: { get: a._getFPS, set: a._setFPS } }) } catch (d) { console.log(d) } a.init = function() { a._inited || (a._inited = !0, a._times = [], a._tickTimes = [], a._startTime = a._getTime(), a._times.push(a._lastTime = 0), a.interval = a._interval) }; a.reset = function() { if (a._raf) { var d = window.cancelAnimationFrame || window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || window.oCancelAnimationFrame || window.msCancelAnimationFrame; d && d(a._timerId) } else clearTimeout(a._timerId); a.removeAllEventListeners("tick"); a._timerId = a._times = a._tickTimes = null; a._startTime = a._lastTime = a._ticks = a._pausedTime = 0; a._inited = !1 }; a.getMeasuredTickTime = function(d) { var c = 0, f = a._tickTimes; if (!f || 1 > f.length) return -1; d = Math.min(f.length, d || a._getFPS() | 0); for (var g = 0; g < d; g++) c += f[g]; return c / d }; a.getMeasuredFPS = function(d) { var c = a._times; if (!c || 2 > c.length) return -1; d = Math.min(c.length - 1, d || a._getFPS() | 0); return 1E3 / ((c[0] - c[d]) / d) }; a.getTime = function(d) { return a._startTime ? a._getTime() - (d ? a._pausedTime : 0) : -1 }; a.getEventTime = function(d) { return a._startTime ? (a._lastTime || a._startTime) - (d ? a._pausedTime : 0) : -1 }; a.getTicks = function(d) { return a._ticks - (d ? a._pausedTicks : 0) }; a._handleSynch = function() { a._timerId = null; a._setupTick(); a._getTime() - a._lastTime >= .97 * (a._interval - 1) && a._tick() }; a._handleRAF = function() { a._timerId = null; a._setupTick(); a._tick() }; a._handleTimeout = function() { a._timerId = null; a._setupTick(); a._tick() }; a._setupTick = function() { if (null == a._timerId) { var d = a.timingMode; if (d == a.RAF_SYNCHED || d == a.RAF) { var c = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame; if (c) { a._timerId = c(d == a.RAF ? a._handleRAF : a._handleSynch); a._raf = !0; return } } a._raf = !1; a._timerId = setTimeout(a._handleTimeout, a._interval) } }; a._tick = function() { var d = a.paused, c = a._getTime(), f = c - a._lastTime; a._lastTime = c; a._ticks++; d && (a._pausedTicks++, a._pausedTime += f); if (a.hasEventListener("tick")) { var g = new createjs.Event("tick"), h = a.maxDelta; g.delta = h && f > h ? h : f; g.paused = d; g.time = c; g.runTime = c - a._pausedTime; a.dispatchEvent(g) } for (a._tickTimes.unshift(a._getTime() - c); 100 < a._tickTimes.length;) a._tickTimes.pop(); for (a._times.unshift(c); 100 < a._times.length;) a._times.pop() }; var e = window, b = e.performance.now || e.performance.mozNow || e.performance.msNow || e.performance.oNow || e.performance.webkitNow; a._getTime = function() { return (b && b.call(e.performance) || (new Date).getTime()) - a._startTime }; createjs.Ticker = a })(); this.createjs = this.createjs || {}; (function() { function a(b) { this.EventDispatcher_constructor(); this.ignoreGlobalPause = !1; this.loop = 0; this.bounce = this.reversed = this.useTicks = !1; this.timeScale = 1; this.position = this.duration = 0; this.rawPosition = -1; this._paused = !0; this._labelList = this._labels = this._parent = this._prev = this._next = null; b && (this.useTicks = !!b.useTicks, this.ignoreGlobalPause = !!b.ignoreGlobalPause, this.loop = !0 === b.loop ? -1 : b.loop || 0, this.reversed = !!b.reversed, this.bounce = !!b.bounce, this.timeScale = b.timeScale || 1, b.onChange && this.addEventListener("change", b.onChange), b.onComplete && this.addEventListener("complete", b.onComplete)) } var e = createjs.extend(a, createjs.EventDispatcher); e._setPaused = function(b) { createjs.Tween._register(this, b); return this }; e.setPaused = createjs.deprecate(e._setPaused, "AbstractTween.setPaused"); e._getPaused = function() { return this._paused }; e.getPaused = createjs.deprecate(e._getPaused, "AbstactTween.getPaused"); e._getCurrentLabel = function(b) { var d = this.getLabels(); null == b && (b = this.position); for (var c = 0, f = d.length; c < f && !(b < d[c].position); c++); return 0 === c ? null : d[c - 1].label }; e.getCurrentLabel = createjs.deprecate(e._getCurrentLabel, "AbstractTween.getCurrentLabel"); try { Object.defineProperties(e, { paused: { set: e._setPaused, get: e._getPaused }, currentLabel: { get: e._getCurrentLabel } }) } catch (b) {} e.advance = function(b, d) { this.setPosition(this.rawPosition + b * this.timeScale, d) }; e.setPosition = function(b, d, c, f) { var g = this.duration, h = this.loop, l = this.rawPosition, k = 0; 0 > b && (b = 0); if (0 === g) { var n = !0; if (-1 !== l) return n } else { var v = b / g | 0; k = b - v * g; (n = -1 !== h && b >= h * g + g) && (b = (k = g) * (v = h) + g); if (b === l) return n; !this.reversed !== !(this.bounce && v % 2) && (k = g - k) } this.position = k; this.rawPosition = b; this._updatePosition(c, n); n && (this.paused = !0); f && f(this); d || this._runActions(l, b, c, !c && -1 === l); this.dispatchEvent("change"); n && this.dispatchEvent("complete") }; e.calculatePosition = function(b) { var d = this.duration, c = this.loop, f = 0; if (0 === d) return 0; - 1 !== c && b >= c * d + d ? (b = d, f = c) : 0 > b ? b = 0 : (f = b / d | 0, b -= f * d); return !this.reversed !== !(this.bounce && f % 2) ? d - b : b }; e.getLabels = function() { var b = this._labelList; if (!b) { b = this._labelList = []; var d = this._labels, c; for (c in d) b.push({ label: c, position: d[c] }); b.sort(function(f, g) { return f.position - g.position }) } return b }; e.setLabels = function(b) { this._labels = b; this._labelList = null }; e.addLabel = function(b, d) { this._labels || (this._labels = {}); this._labels[b] = d; var c = this._labelList; if (c) { for (var f = 0, g = c.length; f < g && !(d < c[f].position); f++); c.splice(f, 0, { label: b, position: d }) } }; e.gotoAndPlay = function(b) { this.paused = !1; this._goto(b) }; e.gotoAndStop = function(b) { this.paused = !0; this._goto(b) }; e.resolve = function(b) { var d = Number(b); isNaN(d) && (d = this._labels && this._labels[b]); return d }; e.toString = function() { return "[AbstractTween]" }; e.clone = function() { throw "AbstractTween can not be cloned."; }; e._init = function(b) { b && b.paused || (this.paused = !1); b && null != b.position && this.setPosition(b.position) }; e._updatePosition = function(b, d) {}; e._goto = function(b) { b = this.resolve(b); null != b && this.setPosition(b, !1, !0) }; e._runActions = function(b, d, c, f) { if (this._actionHead || this.tweens) { var g = this.duration, h = this.reversed, l = this.bounce, k = this.loop, n, v, r; if (0 === g) { var A = n = v = r = 0; h = l = !1 } else A = b / g | 0, n = d / g | 0, v = b - A * g, r = d - n * g; - 1 !== k && (n > k && (r = g, n = k), A > k && (v = g, A = k)); if (c) return this._runActionsRange(r, r, c, f); if (A !== n || v !== r || c || f) { -1 === A && (A = v = 0); b = b <= d; d = A; do { k = d === A ? v : b ? 0 : g; var x = d === n ? r : b ? g : 0; !h !== !(l && d % 2) && (k = g - k, x = g - x); if ((!l || d === A || k !== x) && this._runActionsRange(k, x, c, f || d !== A && !l)) return !0; f = !1 } while (b && ++d <= n || !b && --d >= n) } } }; e._runActionsRange = function(b, d, c, f) {}; createjs.AbstractTween = createjs.promote(a, "EventDispatcher") })(); this.createjs = this.createjs || {}; (function() { function a(c, f) { this.AbstractTween_constructor(f); this.pluginData = null; this.target = c; this.passive = !1; this._stepTail = this._stepHead = new e(null, 0, 0, {}, null, !0); this._stepPosition = 0; this._injected = this._pluginIds = this._plugins = this._actionTail = this._actionHead = null; f && (this.pluginData = f.pluginData, f.override && a.removeTweens(c)); this.pluginData || (this.pluginData = {}); this._init(f) } function e(c, f, g, h, l, k) { this.next = null; this.prev = c; this.t = f; this.d = g; this.props = h; this.ease = l; this.passive = k; this.index = c ? c.index + 1 : 0 } function b(c, f, g, h, l) { this.next = null; this.prev = c; this.t = f; this.d = 0; this.scope = g; this.funct = h; this.params = l } var d = createjs.extend(a, createjs.AbstractTween); a.IGNORE = {}; a._tweens = []; a._plugins = null; a._tweenHead = null; a._tweenTail = null; a.get = function(c, f) { return new a(c, f) }; a.tick = function(c, f) { for (var g = a._tweenHead; g;) { var h = g._next; f && !g.ignoreGlobalPause || g._paused || g.advance(g.useTicks ? 1 : c); g = h } }; a.handleEvent = function(c) { "tick" === c.type && this.tick(c.delta, c.paused) }; a.removeTweens = function(c) { if (c.tweenjs_count) { for (var f = a._tweenHead; f;) { var g = f._next; f.target === c && a._register(f, !0); f = g } c.tweenjs_count = 0 } }; a.removeAllTweens = function() { for (var c = a._tweenHead; c;) { var f = c._next; c._paused = !0; c.target && (c.target.tweenjs_count = 0); c._next = c._prev = null; c = f } a._tweenHead = a._tweenTail = null }; a.hasActiveTweens = function(c) { return c ? !!c.tweenjs_count : !!a._tweenHead }; a._installPlugin = function(c) { for (var f = c.priority = c.priority || 0, g = a._plugins = a._plugins || [], h = 0, l = g.length; h < l && !(f < g[h].priority); h++); g.splice(h, 0, c) }; a._register = function(c, f) { var g = c.target; if (!f && c._paused) g && (g.tweenjs_count = g.tweenjs_count ? g.tweenjs_count + 1 : 1), (g = a._tweenTail) ? (a._tweenTail = g._next = c, c._prev = g) : a._tweenHead = a._tweenTail = c, !a._inited && createjs.Ticker && (createjs.Ticker.addEventListener("tick", a), a._inited = !0); else if (f && !c._paused) { g && g.tweenjs_count--; g = c._next; var h = c._prev; g ? g._prev = h : a._tweenTail = h; h ? h._next = g : a._tweenHead = g; c._next = c._prev = null } c._paused = f }; d.wait = function(c, f) { 0 < c && this._addStep(+c, this._stepTail.props, null, f); return this }; d.to = function(c, f, g) { if (null == f || 0 > f) f = 0; f = this._addStep(+f, null, g); this._appendProps(c, f); return this }; d.label = function(c) { this.addLabel(c, this.duration); return this }; d.call = function(c, f, g) { return this._addAction(g || this.target, c, f || [this]) }; d.set = function(c, f) { return this._addAction(f || this.target, this._set, [c]) }; d.play = function(c) { return this._addAction(c || this, this._set, [{ paused: !1 }]) }; d.pause = function(c) { return this._addAction(c || this, this._set, [{ paused: !0 }]) }; d.w = d.wait; d.t = d.to; d.c = d.call; d.s = d.set; d.toString = function() { return "[Tween]" }; d.clone = function() { throw "Tween can not be cloned."; }; d._addPlugin = function(c) { var f = this._pluginIds || (this._pluginIds = {}), g = c.ID; if (g && !f[g]) { f[g] = !0; f = this._plugins || (this._plugins = []); g = c.priority || 0; for (var h = 0, l = f.length; h < l; h++) if (g < f[h].priority) { f.splice(h, 0, c); return } f.push(c) } }; d._updatePosition = function(c, f) { var g = this._stepHead.next, h = this.position, l = this.duration; if (this.target && g) { for (var k = g.next; k && k.t <= h;) g = g.next, k = g.next; this._updateTargetProps(g, f ? 0 === l ? 1 : h / l : (h - g.t) / g.d, f) } this._stepPosition = g ? h - g.t : 0 }; d._updateTargetProps = function(c, f, g) { if (!(this.passive = !!c.passive)) { var h, l = c.prev.props, k = c.props; if (h = c.ease) f = h(f, 0, 1, 1); h = this._plugins; var n; a: for (n in l) { var v = l[n]; var r = k[n]; v = v !== r && "number" === typeof v ? v + (r - v) * f : 1 <= f ? r : v; if (h) { r = 0; for (var A = h.length; r < A; r++) { var x = h[r].change(this, c, n, v, f, g); if (x === a.IGNORE) continue a; void 0 !== x && (v = x) } } this.target[n] = v } } }; d._runActionsRange = function(c, f, g, h) { var l = (g = c > f) ? this._actionTail : this._actionHead, k = f, n = c; g && (k = c, n = f); for (var v = this.position; l;) { var r = l.t; if (r === f || r > n && r < k || h && r === c) if (l.funct.apply(l.scope, l.params), v !== this.position) return !0; l = g ? l.prev : l.next } }; d._appendProps = function(c, f, g) { var h = this._stepHead.props, l = this.target, k = a._plugins, n, v, r = f.prev, A = r.props, x = f.props || (f.props = this._cloneProps(A)), G = {}; for (n in c) if (c.hasOwnProperty(n) && (G[n] = x[n] = c[n], void 0 === h[n])) { var B = void 0; if (k) for (v = k.length - 1; 0 <= v; v--) { var O = k[v].init(this, n, B); void 0 !== O && (B = O); if (B === a.IGNORE) { delete x[n]; delete G[n]; break } } B !== a.IGNORE && (void 0 === B && (B = l[n]), A[n] = void 0 === B ? null : B) } for (n in G) { var u; for (c = r; (u = c) && (c = u.prev);) if (c.props !== u.props) { if (void 0 !== c.props[n]) break; c.props[n] = A[n] } } if (!1 !== g && (k = this._plugins)) for (v = k.length - 1; 0 <= v; v--) k[v].step(this, f, G); if (g = this._injected) this._injected = null, this._appendProps(g, f, !1) }; d._injectProp = function(c, f) { (this._injected || (this._injected = {}))[c] = f }; d._addStep = function(c, f, g, h) { f = new e(this._stepTail, this.duration, c, f, g, h || !1); this.duration += c; return this._stepTail = this._stepTail.next = f }; d._addAction = function(c, f, g) { c = new b(this._actionTail, this.duration, c, f, g); this._actionTail ? this._actionTail.next = c : this._actionHead = c; this._actionTail = c; return this }; d._set = function(c) { for (var f in c) this[f] = c[f] }; d._cloneProps = function(c) { var f = {}, g; for (g in c) f[g] = c[g]; return f }; createjs.Tween = createjs.promote(a, "AbstractTween") })(); this.createjs = this.createjs || {}; (function() { function a(b) { if (b instanceof Array || null == b && 1 < arguments.length) { var d = b; var c = arguments[1]; b = arguments[2] } else b && (d = b.tweens, c = b.labels); this.AbstractTween_constructor(b); this.tweens = []; d && this.addTween.apply(this, d); this.setLabels(c); this._init(b) } var e = createjs.extend(a, createjs.AbstractTween); e.addTween = function(b) { b._parent && b._parent.removeTween(b); var d = arguments.length; if (1 < d) { for (var c = 0; c < d; c++) this.addTween(arguments[c]); return arguments[d - 1] } if (0 === d) return null; this.tweens.push(b); b._parent = this; b.paused = !0; d = b.duration; 0 < b.loop && (d *= b.loop + 1); d > this.duration && (this.duration = d); 0 <= this.rawPosition && b.setPosition(this.rawPosition); return b }; e.removeTween = function(b) { var d = arguments.length; if (1 < d) { for (var c = !0, f = 0; f < d; f++) c = c && this.removeTween(arguments[f]); return c } if (0 === d) return !0; d = this.tweens; for (f = d.length; f--;) if (d[f] === b) return d.splice(f, 1), b._parent = null, b.duration >= this.duration && this.updateDuration(), !0; return !1 }; e.updateDuration = function() { for (var b = this.duration = 0, d = this.tweens.length; b < d; b++) { var c = this.tweens[b], f = c.duration; 0 < c.loop && (f *= c.loop + 1); f > this.duration && (this.duration = f) } }; e.toString = function() { return "[Timeline]" }; e.clone = function() { throw "Timeline can not be cloned."; }; e._updatePosition = function(b, d) { for (var c = this.position, f = 0, g = this.tweens.length; f < g; f++) this.tweens[f].setPosition(c, !0, b) }; e._runActionsRange = function(b, d, c, f) { for (var g = this.position, h = 0, l = this.tweens.length; h < l; h++) if (this.tweens[h]._runActions(b, d, c, f), g !== this.position) return !0 }; createjs.Timeline = createjs.promote(a, "AbstractTween") })(); this.createjs = this.createjs || {}; (function() { function a() { throw "Ease cannot be instantiated."; } a.linear = function(e) { return e }; a.none = a.linear; a.get = function(e) { -1 > e ? e = -1 : 1 < e && (e = 1); return function(b) { return 0 == e ? b : 0 > e ? b * (b * -e + 1 + e) : b * ((2 - b) * e + (1 - e)) } }; a.getPowIn = function(e) { return function(b) { return Math.pow(b, e) } }; a.getPowOut = function(e) { return function(b) { return 1 - Math.pow(1 - b, e) } }; a.getPowInOut = function(e) { return function(b) { return 1 > (b *= 2) ? .5 * Math.pow(b, e) : 1 - .5 * Math.abs(Math.pow(2 - b, e)) } }; a.quadIn = a.getPowIn(2); a.quadOut = a.getPowOut(2); a.quadInOut = a.getPowInOut(2); a.cubicIn = a.getPowIn(3); a.cubicOut = a.getPowOut(3); a.cubicInOut = a.getPowInOut(3); a.quartIn = a.getPowIn(4); a.quartOut = a.getPowOut(4); a.quartInOut = a.getPowInOut(4); a.quintIn = a.getPowIn(5); a.quintOut = a.getPowOut(5); a.quintInOut = a.getPowInOut(5); a.sineIn = function(e) { return 1 - Math.cos(e * Math.PI / 2) }; a.sineOut = function(e) { return Math.sin(e * Math.PI / 2) }; a.sineInOut = function(e) { return -.5 * (Math.cos(Math.PI * e) - 1) }; a.getBackIn = function(e) { return function(b) { return b * b * ((e + 1) * b - e) } }; a.backIn = a.getBackIn(1.7); a.getBackOut = function(e) { return function(b) { return --b * b * ((e + 1) * b + e) + 1 } }; a.backOut = a.getBackOut(1.7); a.getBackInOut = function(e) { e *= 1.525; return function(b) { return 1 > (b *= 2) ? .5 * b * b * ((e + 1) * b - e) : .5 * ((b -= 2) * b * ((e + 1) * b + e) + 2) } }; a.backInOut = a.getBackInOut(1.7); a.circIn = function(e) { return -(Math.sqrt(1 - e * e) - 1) }; a.circOut = function(e) { return Math.sqrt(1 - --e * e) }; a.circInOut = function(e) { return 1 > (e *= 2) ? -.5 * (Math.sqrt(1 - e * e) - 1) : .5 * (Math.sqrt(1 - (e -= 2) * e) + 1) }; a.bounceIn = function(e) { return 1 - a.bounceOut(1 - e) }; a.bounceOut = function(e) { return e < 1 / 2.75 ? 7.5625 * e * e : e < 2 / 2.75 ? 7.5625 * (e -= 1.5 / 2.75) * e + .75 : e < 2.5 / 2.75 ? 7.5625 * (e -= 2.25 / 2.75) * e + .9375 : 7.5625 * (e -= 2.625 / 2.75) * e + .984375 }; a.bounceInOut = function(e) { return .5 > e ? .5 * a.bounceIn(2 * e) : .5 * a.bounceOut(2 * e - 1) + .5 }; a.getElasticIn = function(e, b) { var d = 2 * Math.PI; return function(c) { if (0 == c || 1 == c) return c; var f = b / d * Math.asin(1 / e); return -(e * Math.pow(2, 10 * --c) * Math.sin((c - f) * d / b)) } }; a.elasticIn = a.getElasticIn(1, .3); a.getElasticOut = function(e, b) { var d = 2 * Math.PI; return function(c) { return 0 == c || 1 == c ? c : e * Math.pow(2, -10 * c) * Math.sin((c - b / d * Math.asin(1 / e)) * d / b) + 1 } }; a.elasticOut = a.getElasticOut(1, .3); a.getElasticInOut = function(e, b) { var d = 2 * Math.PI; return function(c) { var f = b / d * Math.asin(1 / e); return 1 > (c *= 2) ? -.5 * e * Math.pow(2, 10 * --c) * Math.sin((c - f) * d / b) : e * Math.pow(2, -10 * --c) * Math.sin((c - f) * d / b) * .5 + 1 } }; a.elasticInOut = a.getElasticInOut(1, .3 * 1.5); createjs.Ease = a })(); this.createjs = this.createjs || {}; (function() { function a() { throw "MotionGuidePlugin cannot be instantiated."; } a.priority = 0; a.ID = "MotionGuide"; a.install = function() { createjs.Tween._installPlugin(a); return createjs.Tween.IGNORE }; a.init = function(e, b, d) { "guide" == b && e._addPlugin(a) }; a.step = function(e, b, d) { for (var c in d) if ("guide" === c) { var f = b.props.guide, g = a._solveGuideData(d.guide, f); f.valid = !g; var h = f.endData; e._injectProp("x", h.x); e._injectProp("y", h.y); if (g || !f.orient) break; f.startOffsetRot = (void 0 === b.prev.props.rotation ? e.target.rotation || 0 : b.prev.props.rotation) - f.startData.rotation; if ("fixed" == f.orient) f.endAbsRot = h.rotation + f.startOffsetRot, f.deltaRotation = 0; else { g = void 0 === d.rotation ? e.target.rotation || 0 : d.rotation; h = g - f.endData.rotation - f.startOffsetRot; var l = h % 360; f.endAbsRot = g; switch (f.orient) { case "auto": f.deltaRotation = h; break; case "cw": f.deltaRotation = (l + 360) % 360 + 360 * Math.abs(h / 360 | 0); break; case "ccw": f.deltaRotation = (l - 360) % 360 + -360 * Math.abs(h / 360 | 0) } } e._injectProp("rotation", f.endAbsRot) } }; a.change = function(e, b, d, c, f, g) { if ((c = b.props.guide) && b.props !== b.prev.props && c !== b.prev.props.guide) { if ("guide" === d && !c.valid || "x" == d || "y" == d || "rotation" === d && c.orient) return createjs.Tween.IGNORE; a._ratioToPositionData(f, c, e.target) } }; a.debug = function(e, b, d) { e = e.guide || e; var c = a._findPathProblems(e); c && console.error("MotionGuidePlugin Error found: \n" + c); if (!b) return c; var f, g = e.path, h = g.length; b.save(); b.lineCap = "round"; b.lineJoin = "miter"; b.beginPath(); b.moveTo(g[0], g[1]); for (f = 2; f < h; f += 4) b.quadraticCurveTo(g[f], g[f + 1], g[f + 2], g[f + 3]); b.strokeStyle = "black"; b.lineWidth = 4.5; b.stroke(); b.strokeStyle = "white"; b.lineWidth = 3; b.stroke(); b.closePath(); g = d.length; if (d && g) { h = {}; var l = {}; a._solveGuideData(e, h); for (f = 0; f < g; f++) h.orient = "fixed", a._ratioToPositionData(d[f], h, l), b.beginPath(), b.moveTo(l.x, l.y), b.lineTo(l.x + 9 * Math.cos(.0174533 * l.rotation), l.y + 9 * Math.sin(.0174533 * l.rotation)), b.strokeStyle = "black", b.lineWidth = 4.5, b.stroke(), b.strokeStyle = "red", b.lineWidth = 3, b.stroke(), b.closePath() } b.restore(); return c }; a._solveGuideData = function(e, b) { var d; if (d = a.debug(e)) return d; var c = b.path = e.path; b.orient = e.orient; b.subLines = []; b.totalLength = 0; b.startOffsetRot = 0; b.deltaRotation = 0; b.startData = { ratio: 0 }; b.endData = { ratio: 1 }; b.animSpan = 1; var f = c.length, g, h = {}; var l = c[0]; var k = c[1]; for (d = 2; d < f; d += 4) { var n = c[d]; var v = c[d + 1]; var r = c[d + 2]; var A = c[d + 3]; var x = { weightings: [], estLength: 0, portion: 0 }, G = l; var B = k; for (g = 1; 10 >= g; g++) a._getParamsForCurve(l, k, n, v, r, A, g / 10, !1, h), G = h.x - G, B = h.y - B, B = Math.sqrt(G * G + B * B), x.weightings.push(B), x.estLength += B, G = h.x, B = h.y; b.totalLength += x.estLength; for (g = 0; 10 > g; g++) B = x.estLength, x.weightings[g] /= B; b.subLines.push(x); l = r; k = A } B = b.totalLength; c = b.subLines.length; for (d = 0; d < c; d++) b.subLines[d].portion = b.subLines[d].estLength / B; d = isNaN(e.start) ? 0 : e.start; c = isNaN(e.end) ? 1 : e.end; a._ratioToPositionData(d, b, b.startData); a._ratioToPositionData(c, b, b.endData); b.startData.ratio = d; b.endData.ratio = c; b.animSpan = b.endData.ratio - b.startData.ratio }; a._ratioToPositionData = function(e, b, d) { var c = b.subLines, f, g = 0, h = e * b.animSpan + b.startData.ratio; var l = c.length; for (f = 0; f < l; f++) { var k = c[f].portion; if (g + k >= h) { var n = f; break } g += k } void 0 === n && (n = l - 1, g -= k); c = c[n].weightings; var v = k; l = c.length; for (f = 0; f < l; f++) { k = c[f] * v; if (g + k >= h) break; g += k } n = 4 * n + 2; l = b.path; a._getParamsForCurve(l[n - 2], l[n - 1], l[n], l[n + 1], l[n + 2], l[n + 3], f / 10 + (h - g) / k * .1, b.orient, d); b.orient && (d.rotation = .99999 <= e && 1.00001 >= e && void 0 !== b.endAbsRot ? b.endAbsRot : d.rotation + (b.startOffsetRot + e * b.deltaRotation)); return d }; a._getParamsForCurve = function(e, b, d, c, f, g, h, l, k) { var n = 1 - h; k.x = n * n * e + 2 * n * h * d + h * h * f; k.y = n * n * b + 2 * n * h * c + h * h * g; l && (k.rotation = 57.2957795 * Math.atan2((c - b) * n + (g - c) * h, (d - e) * n + (f - d) * h)) }; a._findPathProblems = function(e) { var b = e.path, d = b && b.length || 0; if (6 > d || (d - 2) % 4) return "\tCannot parse 'path' array due to invalid number of entries in path. There should be an odd number of points, at least 3 points, and 2 entries per point (x & y). See 'CanvasRenderingContext2D.quadraticCurveTo' for details as 'path' models a quadratic bezier.\n\nOnly [ " + (d + " ] values found. Expected: " + Math.max(4 * Math.ceil((d - 2) / 4) + 2, 6)); for (var c = 0; c < d; c++) if (isNaN(b[c])) return "All data in path array must be numeric"; b = e.start; if (isNaN(b) && void 0 !== b) return "'start' out of bounds. Expected 0 to 1, got: " + b; b = e.end; if (isNaN(b) && void 0 !== b) return "'end' out of bounds. Expected 0 to 1, got: " + b; if ((e = e.orient) && "fixed" != e && "auto" != e && "cw" != e && "ccw" != e) return 'Invalid orientation value. Expected ["fixed", "auto", "cw", "ccw", undefined], got: ' + e }; createjs.MotionGuidePlugin = a })(); this.createjs = this.createjs || {}; (function() { var a = createjs.TweenJS = createjs.TweenJS || {}; a.version = "1.0.0"; a.buildDate = "Thu, 14 Sep 2017 19:47:47 GMT" })(); (function() { var a = "undefined" !== typeof window && "undefined" !== typeof window.document ? window.document : {}, e = "undefined" !== typeof module && module.exports, b = function() { for (var f, g = ["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(" ") ], h = 0, l = g.length, k = {}; h < l; h++) if ((f = g[h]) && f[1] in a) { for (h = 0; h < f.length; h++) k[g[0][h]] = f[h]; return k } return !1 }(), d = { change: b.fullscreenchange, error: b.fullscreenerror }, c = { request: function(f) { return new Promise(function(g, h) { var l = function() { this.off("change", l); g() }.bind(this); this.on("change", l); f = f || a.documentElement; Promise.resolve(f[b.requestFullscreen]())["catch"](h) }.bind(this)) }, exit: function() { return new Promise(function(f, g) { if (this.isFullscreen) { var h = function() { this.off("change", h); f() }.bind(this); this.on("change", h); Promise.resolve(a[b.exitFullscreen]())["catch"](g) } else f() }.bind(this)) }, toggle: function(f) { return this.isFullscreen ? this.exit() : this.request(f) }, onchange: function(f) { this.on("change", f) }, onerror: function(f) { this.on("error", f) }, on: function(f, g) { var h = d[f]; h && a.addEventListener(h, g, !1) }, off: function(f, g) { var h = d[f]; h && a.removeEventListener(h, g, !1) }, raw: b }; b ? (Object.defineProperties(c, { 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] } } }), e ? module.exports = c : window.screenfull = c) : e ? module.exports = { isEnabled: !1 } : window.screenfull = { isEnabled: !1 } })(); (function() { function a(u) { u = String(u); return u.charAt(0).toUpperCase() + u.slice(1) } function e(u, M) { var I = -1, F = u ? u.length : 0; if ("number" == typeof F && -1 < F && F <= A) for (; ++I < F;) M(u[I], I, u); else d(u, M) } function b(u) { u = String(u).replace(/^ +| +$/g, ""); return /^(?:webOS|i(?:OS|P))/.test(u) ? u : a(u) } function d(u, M) { for (var I in u) G.call(u, I) && M(u[I], I, u) } function c(u) { return null == u ? a(u) : B.call(u).slice(8, -1) } function f(u, M) { var I = null != u ? typeof u[M] : "number"; return !/^(?:boolean|number|string|undefined)$/.test(I) && ("object" == I ? !!u[M] : !0) } function g(u) { return String(u).replace(/([ -])(?!$)/g, "$1?") } function h(u, M) { var I = null; e(u, function(F, D) { I = M(I, F, D, u) }); return I } function l(u) { function M(R) { return h(R, function(N, Q) { var W = Q.pattern || g(Q); !N && (N = RegExp("\\b" + W + " *\\d+[.\\w_]*", "i").exec(u) || RegExp("\\b" + W + " *\\w+-[\\w]*", "i").exec(u) || RegExp("\\b" + W + "(?:; *(?:[a-z]+[_-])?[a-z]+\\d+|[^ ();-]*)", "i").exec(u)) && ((N = String(Q.label && !RegExp(W, "i").test(Q.label) ? Q.label : N).split("/"))[1] && !/[\d.]+/.test(N[0]) && (N[0] += " " + N[1]), Q = Q.label || Q, N = b(N[0].replace(RegExp(W, "i"), Q).replace(RegExp("; *(?:" + Q + "[_-])?", "i"), " ").replace(RegExp("(" + Q + ")[-_.]?(\\w)", "i"), "$1 $2"))); return N }) } function I(R) { return h(R, function(N, Q) { return N || (RegExp(Q + "(?:-[\\d.]+/|(?: for [\\w-]+)?[ /-])([\\d.]+[^ ();/_-]*)", "i").exec(u) || 0)[1] || null }) } var F = n, D = u && "object" == typeof u && "String" != c(u); D && (F = u, u = null); var K = F.navigator || {}, C = K.userAgent || ""; u || (u = C); var P = D ? !!K.likeChrome : /\bChrome\b/.test(u) && !/internal|\n/i.test(B.toString()), E = D ? "Object" : "ScriptBridgingProxyObject", z = D ? "Object" : "Environment", H = D && F.java ? "JavaPackage" : c(F.java), L = D ? "Object" : "RuntimeObject"; z = (H = /\bJava/.test(H) && F.java) && c(F.environment) == z; var U = H ? "a" : "\u03b1", S = H ? "b" : "\u03b2", T = F.document || {}, V = F.operamini || F.opera, aa = x.test(aa = D && V ? V["[[Class]]"] : c(V)) ? aa : V = null, p, ba = u; D = []; var X = null, Y = u == C; C = Y && V && "function" == typeof V.version && V.version(); var m = function(R) { return h(R, function(N, Q) { return N || RegExp("\\b" + (Q.pattern || g(Q)) + "\\b", "i").exec(u) && (Q.label || Q) }) }([{ label: "EdgeHTML", pattern: "Edge" }, "Trident", { label: "WebKit", pattern: "AppleWebKit" }, "iCab", "Presto", "NetFront", "Tasman", "KHTML", "Gecko"]), q = function(R) { return h(R, function(N, Q) { return N || RegExp("\\b" + (Q.pattern || g(Q)) + "\\b", "i").exec(u) && (Q.label || Q) }) }(["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" ]), w = M([{ 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" ]), y = function(R) { return h(R, function(N, Q, W) { return N || (Q[w] || Q[/^[a-z]+(?: +[a-z]+\b)*/i.exec(w)] || RegExp("\\b" + g(W) + "(?:\\b|\\w*\\d)", "i").exec(u)) && W }) }({ 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 } }), t = function(R) { return h(R, function(N, Q) { var W = Q.pattern || g(Q); if (!N && (N = RegExp("\\b" + W + "(?:/[\\d.]+|[ \\w.]*)", "i").exec(u))) { var Z = N, ca = Q.label || Q, da = { "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" }; W && ca && /^Win/i.test(Z) && !/^Windows Phone /i.test(Z) && (da = da[/[\d.]+$/.exec(Z)]) && (Z = "Windows " + da); Z = String(Z); W && ca && (Z = Z.replace(RegExp(W, "i"), ca)); N = Z = b(Z.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 " ]); m && (m = [m]); y && !w && (w = M([y])); if (p = /\bGoogle TV\b/.exec(w)) w = p[0]; /\bSimulator\b/i.test(u) && (w = (w ? w + " " : "") + "Simulator"); "Opera Mini" == q && /\bOPiOS\b/.test(u) && D.push("running in Turbo/Uncompressed mode"); "IE" == q && /\blike iPhone OS\b/.test(u) ? (p = l(u.replace(/like iPhone OS/, "")), y = p.manufacturer, w = p.product) : /^iP/.test(w) ? (q || (q = "Safari"), t = "iOS" + ((p = / OS ([\d_]+)/i.exec(u)) ? " " + p[1].replace(/_/g, ".") : "")) : "Konqueror" != q || /buntu/i.test(t) ? y && "Google" != y && (/Chrome/.test(q) && !/\bMobile Safari\b/i.test(u) || /\bVita\b/.test(w)) || /\bAndroid\b/.test(t) && /^Chrome/.test(q) && /\bVersion\//i.test(u) ? (q = "Android Browser", t = /\bAndroid\b/.test(t) ? t : "Android") : "Silk" == q ? (/\bMobi/i.test(u) || (t = "Android", D.unshift("desktop mode")), /Accelerated *= *true/i.test(u) && D.unshift("accelerated")) : "PaleMoon" == q && (p = /\bFirefox\/([\d.]+)\b/.exec(u)) ? D.push("identifying as Firefox " + p[1]) : "Firefox" == q && (p = /\b(Mobile|Tablet|TV)\b/i.exec(u)) ? (t || (t = "Firefox OS"), w || (w = p[1])) : !q || (p = !/\bMinefield\b/i.test(u) && /\b(?:Firefox|Safari)\b/.exec(q)) ? (q && !w && /[\/,]|^[^(]+?\)/.test(u.slice(u.indexOf(p + "/") + 8)) && (q = null), (p = w || y || t) && (w || y || /\b(?:Android|Symbian OS|Tablet OS|webOS)\b/.test(t)) && (q = /[a-z]+(?: Hat)?/i.exec(/\bAndroid\b/.test(t) ? t : p) + " Browser")) : "Electron" == q && (p = (/\bChrome\/([\d.]+)\b/.exec(u) || 0)[1]) && D.push("Chromium " + p) : t = "Kubuntu"; C || (C = I(["(?:Cloud9|CriOS|CrMo|Edge|FxiOS|IEMobile|Iron|Opera ?Mini|OPiOS|OPR|Raven|SamsungBrowser|Silk(?!/[\\d.]+$))", "Version", g(q), "(?:Firefox|Minefield|NetFront)" ])); if (p = "iCab" == m && 3 < parseFloat(C) && "WebKit" || /\bOpera\b/.test(q) && (/\bOPR\b/.test(u) ? "Blink" : "Presto") || /\b(?:Midori|Nook|Safari)\b/i.test(u) && !/^(?:Trident|EdgeHTML)$/.test(m) && "WebKit" || !m && /\bMSIE\b/i.test(u) && ("Mac OS" == t ? "Tasman" : "Trident") || "WebKit" == m && /\bPlayStation\b(?! Vita\b)/i.test(q) && "NetFront") m = [p]; "IE" == q && (p = (/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(u) || 0)[1]) ? (q += " Mobile", t = "Windows Phone " + (/\+$/.test(p) ? p : p + ".x"), D.unshift("desktop mode")) : /\bWPDesktop\b/i.test(u) ? (q = "IE Mobile", t = "Windows Phone 8.x", D.unshift("desktop mode"), C || (C = (/\brv:([\d.]+)/.exec(u) || 0)[1])) : "IE" != q && "Trident" == m && (p = /\brv:([\d.]+)/.exec(u)) && (q && D.push("identifying as " + q + (C ? " " + C : "")), q = "IE", C = p[1]); if (Y) { if (f(F, "global")) if (H && (p = H.lang.System, ba = p.getProperty("os.arch"), t = t || p.getProperty("os.name") + " " + p.getProperty("os.version")), z) { try { C = F.require("ringo/engine").version.join("."), q = "RingoJS" } catch (R) { (p = F.system) && p.global.system == F.system && (q = "Narwhal", t || (t = p[0].os || null)) } q || (q = "Rhino") } else "object" == typeof F.process && !F.process.browser && (p = F.process) && ("object" == typeof p.versions && ("string" == typeof p.versions.electron ? (D.push("Node " + p.versions.node), q = "Electron", C = p.versions.electron) : "string" == typeof p.versions.nw && (D.push("Chromium " + C, "Node " + p.versions.node), q = "NW.js", C = p.versions.nw)), q || (q = "Node.js", ba = p.arch, t = p.platform, C = (C = /[\d.]+/.exec(p.version)) ? C[0] : null)); else c(p = F.runtime) == E ? (q = "Adobe AIR", t = p.flash.system.Capabilities.os) : c(p = F.phantom) == L ? (q = "PhantomJS", C = (p = p.version || null) && p.major + "." + p.minor + "." + p.patch) : "number" == typeof T.documentMode && (p = /\bTrident\/(\d+)/i.exec(u)) ? (C = [C, T.documentMode], (p = +p[1] + 4) != C[1] && (D.push("IE " + C[1] + " mode"), m && (m[1] = ""), C[1] = p), C = "IE" == q ? String(C[1].toFixed(1)) : C[0]) : "number" == typeof T.documentMode && /^(?:Chrome|Firefox)\b/.test(q) && (D.push("masking as " + q + " " + C), q = "IE", C = "11.0", m = ["Trident"], t = "Windows"); t = t && b(t) } C && (p = /(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(C) || /(?:alpha|beta)(?: ?\d)?/i.exec(u + ";" + (Y && K.appMinorVersion)) || /\bMinefield\b/i.test(u) && "a") && (X = /b/i.test(p) ? "beta" : "alpha", C = C.replace(RegExp(p + "\\+?$"), "") + ("beta" == X ? S : U) + (/\d+\+?/.exec(p) || "")); if ("Fennec" == q || "Firefox" == q && /\b(?:Android|Firefox OS)\b/.test(t)) q = "Firefox Mobile"; else if ("Maxthon" == q && C) C = C.replace(/\.[\d.]+/, ".x"); else if (/\bXbox\b/i.test(w)) "Xbox 360" == w && (t = null), "Xbox 360" == w && /\bIEMobile\b/.test(u) && D.unshift("mobile mode"); else if (!/^(?:Chrome|IE|Opera)$/.test(q) && (!q || w || /Browser|Mobi/.test(q)) || "Windows CE" != t && !/Mobi/i.test(u)) if ("IE" == q && Y) try { null === F.external && D.unshift("platform preview") } catch (R) { D.unshift("embedded") } else(/\bBlackBerry\b/.test(w) || /\bBB10\b/.test(u)) && (p = (RegExp(w.replace(/ +/g, " *") + "/([.\\d]+)", "i").exec(u) || 0)[1] || C) ? (p = [p, /BB10/.test(u)], t = (p[1] ? (w = null, y = "BlackBerry") : "Device Software") + " " + p[0], C = null) : this != d && "Wii" != w && (Y && V || /Opera/.test(q) && /\b(?:MSIE|Firefox)\b/i.test(u) || "Firefox" == q && /\bOS X (?:\d+\.){2,}/.test(t) || "IE" == q && (t && !/^Win/.test(t) && 5.5 < C || /\bWindows XP\b/.test(t) && 8 < C || 8 == C && !/\bTrident\b/.test(u))) && !x.test(p = l.call(d, u.replace(x, "") + ";")) && p.name && (p = "ing as " + p.name + ((p = p.version) ? " " + p : ""), x.test(q) ? (/\bIE\b/.test(p) && "Mac OS" == t && (t = null), p = "identify" + p) : (p = "mask" + p, q = aa ? b(aa.replace(/([a-z])([A-Z])/g, "$1 $2")) : "Opera", /\bIE\b/.test(p) && (t = null), Y || (C = null)), m = ["Presto"], D.push(p)); else q += " Mobile"; if (p = (/\bAppleWebKit\/([\d.]+\+?)/i.exec(u) || 0)[1]) { p = [parseFloat(p.replace(/\.(\d)$/, ".0$1")), p]; if ("Safari" == q && "+" == p[1].slice(-1)) q = "WebKit Nightly", X = "alpha", C = p[1].slice(0, -1); else if (C == p[1] || C == (p[2] = (/\bSafari\/([\d.]+\+?)/i.exec(u) || 0)[1])) C = null; p[1] = (/\bChrome\/([\d.]+)/i.exec(u) || 0)[1]; 537.36 == p[0] && 537.36 == p[2] && 28 <= parseFloat(p[1]) && "WebKit" == m && (m = ["Blink"]); Y && (P || p[1]) ? (m && (m[1] = "like Chrome"), p = p[1] || (p = p[0], 530 > p ? 1 : 532 > p ? 2 : 532.05 > p ? 3 : 533 > p ? 4 : 534.03 > p ? 5 : 534.07 > p ? 6 : 534.1 > p ? 7 : 534.13 > p ? 8 : 534.16 > p ? 9 : 534.24 > p ? 10 : 534.3 > p ? 11 : 535.01 > p ? 12 : 535.02 > p ? "13+" : 535.07 > p ? 15 : 535.11 > p ? 16 : 535.19 > p ? 17 : 536.05 > p ? 18 : 536.1 > p ? 19 : 537.01 > p ? 20 : 537.11 > p ? "21+" : 537.13 > p ? 23 : 537.18 > p ? 24 : 537.24 > p ? 25 : 537.36 > p ? 26 : "Blink" != m ? "27" : "28")) : (m && (m[1] = "like Safari"), p = (p = p[0], 400 > p ? 1 : 500 > p ? 2 : 526 > p ? 3 : 533 > p ? 4 : 534 > p ? "4+" : 535 > p ? 5 : 537 > p ? 6 : 538 > p ? 7 : 601 > p ? 8 : "8")); m && (m[1] += " " + (p += "number" == typeof p ? ".x" : /[.+]/.test(p) ? "" : "+")); "Safari" == q && (!C || 45 < parseInt(C)) && (C = p) } "Opera" == q && (p = /\bzbov|zvav$/.exec(t)) ? (q += " ", D.unshift("desktop mode"), "zvav" == p ? (q += "Mini", C = null) : q += "Mobile", t = t.replace(RegExp(" *" + p + "$"), "")) : "Safari" == q && /\bChrome\b/.exec(m && m[1]) && (D.unshift("desktop mode"), q = "Chrome Mobile", C = null, /\bOS X\b/.test(t) ? (y = "Apple", t = "iOS 4.3+") : t = null); C && 0 == C.indexOf(p = /[\d.]+$/.exec(t)) && -1 < u.indexOf("/" + p + "-") && (t = String(t.replace(p, "")).replace(/^ +| +$/g, "")); m && !/\b(?:Avant|Nook)\b/.test(q) && (/Browser|Lunascape|Maxthon/.test(q) || "Safari" != q && /^iOS/.test(t) && /\bSafari\b/.test(m[1]) || /^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|Web)/.test(q) && m[1]) && (p = m[m.length - 1]) && D.push(p); D.length && (D = ["(" + D.join("; ") + ")"]); y && w && 0 > w.indexOf(y) && D.push("on " + y); w && D.push((/^on /.test(D[D.length - 1]) ? "" : "on ") + w); if (t) { var J = (p = / ([\d.+]+)$/.exec(t)) && "/" == t.charAt(t.length - p[0].length - 1); t = { architecture: 32, family: p && !J ? t.replace(p[0], "") : t, version: p ? p[1] : null, toString: function() { var R = this.version; return this.family + (R && !J ? " " + R : "") + (64 == this.architecture ? " 64-bit" : "") } } }(p = /\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(ba)) && !/\bi686\b/i.test(ba) ? (t && (t.architecture = 64, t.family = t.family.replace(RegExp(" *" + p), "")), q && (/\bWOW64\b/i.test(u) || Y && /\w(?:86|32)$/.test(K.cpuClass || K.platform) && !/\bWin64; x64\b/i.test(u)) && D.unshift("32-bit")) : t && /^OS X/.test(t.family) && "Chrome" == q && 39 <= parseFloat(C) && (t.architecture = 64); u || (u = null); F = {}; F.description = u; F.layout = m && m[0]; F.manufacturer = y; F.name = q; F.prerelease = X; F.product = w; F.ua = u; F.version = q && C; F.os = t || { architecture: null, family: null, version: null, toString: function() { return "null" } }; F.parse = l; F.toString = function() { return this.description || "" }; F.version && D.unshift(C); F.name && D.unshift(q); t && q && (t != String(t).split(" ")[0] || t != q.split(" ")[0] && !w) && D.push(w ? "(" + t + ")" : "on " + t); D.length && (F.description = D.join(" ")); return F } var k = { "function": !0, object: !0 }, n = k[typeof window] && window || this, v = k[typeof exports] && exports; k = k[typeof module] && module && !module.nodeType && module; var r = v && k && "object" == typeof global && global; !r || r.global !== r && r.window !== r && r.self !== r || (n = r); var A = Math.pow(2, 53) - 1, x = /\bOpera/; r = Object.prototype; var G = r.hasOwnProperty, B = r.toString, O = l(); "function" == typeof define && "object" == typeof define.amd && define.amd ? (n.platform = O, define(function() { return O })) : v && k ? d(O, function(u, M) { v[M] = u }) : n.platform = O }).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" }], e = 0; e < a.length; e++) { var b = document.createElement("meta"); b.name = a[e].name; b.content = a[e].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, e = a.family.toLowerCase(); a = parseFloat(a.version); return "ios" === e && 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 e = 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 c = b.createElement("body"); c.id = "vpw-test-b"; c.style.cssText = "overflow:scroll"; var f = b.createElement("div"); f.id = "vpw-test-d"; f.style.cssText = "position:absolute;top:-1000px"; f.innerHTML = "<style>@media(" + e + ":" + d["client" + a] + "px){body#vpw-test-b div#vpw-test-d{" + e + ":7px!important}}</style>"; c.appendChild(f); d.insertBefore(c, b.head); a = 7 == f["offset" + a] ? d["client" + a] : window["inner" + a]; d.removeChild(c) } 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() { for (var a = "iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";"); a.length;) if (navigator.platform === a.pop()) return s_bIsIphone = !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 e = getSize("Width"); s_bFocus && _checkOrientation(e, a); var b = Math.min(a / CANVAS_HEIGHT, e / CANVAS_WIDTH), d = Math.round(CANVAS_WIDTH * b); b = Math.round(CANVAS_HEIGHT * b); if (b < a) { var c = a - b; b += c; d += CANVAS_WIDTH / CANVAS_HEIGHT * c } else d < e && (c = e - d, d += c, b += CANVAS_HEIGHT / CANVAS_WIDTH * c); c = a / 2 - b / 2; var f = e / 2 - d / 2, g = CANVAS_WIDTH / d; if (f * g < -EDGEBOARD_X || c * g < -EDGEBOARD_Y) b = Math.min(a / (CANVAS_HEIGHT - 2 * EDGEBOARD_Y), e / (CANVAS_WIDTH - 2 * EDGEBOARD_X)), d = Math.round(CANVAS_WIDTH * b), b = Math.round(CANVAS_HEIGHT * b), c = (a - b) / 2, f = (e - d) / 2, g = CANVAS_WIDTH / d; s_iOffsetX = -1 * f * g; s_iOffsetY = -1 * c * g; 0 <= c && (s_iOffsetY = 0); 0 <= f && (s_iOffsetX = 0); null !== s_oInterface && s_oInterface.refreshButtonPos(s_iOffsetX, s_iOffsetY); null !== s_oModeMenu && s_oModeMenu.refreshButtonPos(s_iOffsetX, s_iOffsetY); null !== s_oMenu && s_oMenu.refreshButtonPos(s_iOffsetX, s_iOffsetY); $("#canvas").css("width", d + "px"); $("#canvas").css("height", b + "px"); 0 > c || (c = (a - b) / 2); $("#canvas").css("top", c + "px"); $("#canvas").css("left", f + "px"); fullscreenHandler() } } function createBitmap(a, e, b) { var d = new createjs.Bitmap(a), c = new createjs.Shape; e && b ? c.graphics.beginFill("#fff").drawRect(0, 0, e, b) : c.graphics.beginFill("#ff0").drawRect(0, 0, a.width, a.height); d.hitArea = c; return d } function createSprite(a, e, b, d, c, f) { a = null !== e ? new createjs.Sprite(a, e) : new createjs.Sprite(a); e = new createjs.Shape; e.graphics.beginFill("#000000").drawRect(-b, -d, c, f); a.hitArea = e; return a } function _checkOrientation(a, e) { s_bMobile && ENABLE_CHECK_ORIENTATION && (a > e ? "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 randomFloatBetween(a, e, b) { "undefined" === typeof b && (b = 2); return parseFloat(Math.min(a + Math.random() * (e - a), e).toFixed(b)) } function shuffle(a) { for (var e = a.length, b, d; 0 !== e;) d = Math.floor(Math.random() * e), --e, b = a[e], a[e] = a[d], a[d] = b; return a } function bubbleSort(a) { do { var e = !1; for (var b = 0; b < a.length - 1; b++) a[b] > a[b + 1] && (e = a[b], a[b] = a[b + 1], a[b + 1] = e, e = !0) } while (e) } function easeLinear(a, e, b, d) { return b * a / d + e } function easeInQuad(a, e, b, d) { return b * (a /= d) * a + e } function easeInSine(a, e, b, d) { return -b * Math.cos(a / d * (Math.PI / 2)) + b + e } function easeInCubic(a, e, b, d) { return b * (a /= d) * a * a + e } function getTrajectoryPoint(a, e) { var b = new createjs.Point, d = (1 - a) * (1 - a), c = a * a; b.x = d * e.start.x + 2 * (1 - a) * a * e.traj.x + c * e.end.x; b.y = d * e.start.y + 2 * (1 - a) * a * e.traj.y + c * e.end.y; return b } function formatTime(a) { a /= 1E3; var e = Math.floor(a / 60); a = parseFloat(a - 60 * e).toFixed(1); var b = ""; b = 10 > e ? b + ("0" + e + ":") : b + (e + ":"); return 10 > a ? b + ("0" + a) : b + a } function degreesToRadians(a) { return a * Math.PI / 180 } function checkRectCollision(a, e) { var b = getBounds(a, .9); var d = getBounds(e, .98); return calculateIntersection(b, d) } function calculateIntersection(a, e) { var b, d, c, f; var g = a.x + (b = a.width / 2); var h = a.y + (d = a.height / 2); var l = e.x + (c = e.width / 2); var k = e.y + (f = e.height / 2); g = Math.abs(g - l) - (b + c); h = Math.abs(h - k) - (d + f); return 0 > g && 0 > h ? (g = Math.min(Math.min(a.width, e.width), -g), h = Math.min(Math.min(a.height, e.height), -h), { x: Math.max(a.x, e.x), y: Math.max(a.y, e.y), width: g, height: h, rect1: a, rect2: e }) : null } function getBounds(a, e) { var b = { x: Infinity, y: Infinity, width: 0, height: 0 }; if (a instanceof createjs.Container) { b.x2 = -Infinity; b.y2 = -Infinity; var d = a.children, c = d.length, f; for (f = 0; f < c; f++) { var g = getBounds(d[f], 1); g.x < b.x && (b.x = g.x); g.y < b.y && (b.y = g.y); g.x + g.width > b.x2 && (b.x2 = g.x + g.width); g.y + g.height > b.y2 && (b.y2 = g.y + g.height) } Infinity == b.x && (b.x = 0); Infinity == b.y && (b.y = 0); Infinity == b.x2 && (b.x2 = 0); Infinity == b.y2 && (b.y2 = 0); b.width = b.x2 - b.x; b.height = b.y2 - b.y; delete b.x2; delete b.y2 } else { if (a instanceof createjs.Bitmap) { c = a.sourceRect || a.image; f = c.width * e; var h = c.height * e } else if (a instanceof createjs.Sprite) if (a.spriteSheet._frames && a.spriteSheet._frames[a.currentFrame] && a.spriteSheet._frames[a.currentFrame].image) { c = a.spriteSheet.getFrame(a.currentFrame); f = c.rect.width; h = c.rect.height; d = c.regX; var l = c.regY } else b.x = a.x || 0, b.y = a.y || 0; else b.x = a.x || 0, b.y = a.y || 0; d = d || 0; f = f || 0; l = l || 0; h = h || 0; b.regX = d; b.regY = l; c = a.localToGlobal(0 - d, 0 - l); g = a.localToGlobal(f - d, h - l); f = a.localToGlobal(f - d, 0 - l); d = a.localToGlobal(0 - d, h - l); b.x = Math.min(Math.min(Math.min(c.x, g.x), f.x), d.x); b.y = Math.min(Math.min(Math.min(c.y, g.y), f.y), d.y); b.width = Math.max(Math.max(Math.max(c.x, g.x), f.x), d.x) - b.x; b.height = Math.max(Math.max(Math.max(c.y, g.y), f.y), d.y) - b.y } return b } function NoClickDelay(a) { this.element = a; window.Touch && this.element.addEventListener("touchstart", this, !1) } function shuffle(a) { for (var e = a.length, b, d; 0 < e;) d = Math.floor(Math.random() * e), e--, b = a[e], a[e] = 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 e = document.createEvent("MouseEvents"); e.initEvent("click", !0, !0); a.dispatchEvent(e) } } }; (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[e] ? "hidden" : "visible", "hidden" === document.body.className ? (s_oMain.stopUpdate(), s_bFocus = !1) : (s_oMain.startUpdate(), s_bFocus = !0)) } var e = "hidden"; e in document ? document.addEventListener("visibilitychange", a) : (e = "mozHidden") in document ? document.addEventListener("mozvisibilitychange", a) : (e = "webkitHidden") in document ? document.addEventListener("webkitvisibilitychange", a) : (e = "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 e = window.location.search.substring(1).split("&"), b = 0; b < e.length; b++) { var d = e[b].split("="); if (d[0] == a) return d[1] } } function playSound(a, e, b) { return !1 === DISABLE_SOUND_MOBILE || !1 === s_bMobile ? (s_aSounds[a].play(), s_aSounds[a].volume(e), 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, e) { !1 !== DISABLE_SOUND_MOBILE && !1 !== s_bMobile || s_aSounds[a].volume(e) } function setMute(a, e) { !1 !== DISABLE_SOUND_MOBILE && !1 !== s_bMobile || s_aSounds[a].mute(e) } function fullscreenHandler() { ENABLE_FULLSCREEN && screenfull.isEnabled && (s_bFullscreen = screenfull.isFullscreen, null !== s_oInterface && s_oInterface.resetFullscreenBut(), null !== s_oMenu && s_oMenu.resetFullscreenBut(), null !== s_oModeMenu && s_oModeMenu.resetFullscreenBut()) } if (screenfull.isEnabled) screenfull.on("change", function() { s_bFullscreen = screenfull.isFullscreen; null !== s_oInterface && s_oInterface.resetFullscreenBut(); null !== s_oMenu && s_oMenu.resetFullscreenBut(); null !== s_oModeMenu && s_oModeMenu.resetFullscreenBut() }); function CSpriteLibrary() { var a = {}, e, b, d, c, f, g; this.init = function(h, l, k) { e = {}; d = b = 0; c = h; f = l; g = k }; this.addSprite = function(h, l) { if (!a.hasOwnProperty(h)) { var k = new Image; a[h] = e[h] = { szPath: l, oSprite: k, bLoaded: !1 }; b++ } }; this.getSprite = function(h) { return a.hasOwnProperty(h) ? a[h].oSprite : null }; this._onSpritesLoaded = function() { b = 0; f.call(g) }; this._onSpriteLoaded = function() { c.call(g); ++d === b && this._onSpritesLoaded() }; this.loadSprites = function() { for (var h in e) e[h].oSprite.oSpriteLibrary = this, e[h].oSprite.szKey = h, e[h].oSprite.onload = function() { this.oSpriteLibrary.setLoaded(this.szKey); this.oSpriteLibrary._onSpriteLoaded(this.szKey) }, e[h].oSprite.onerror = function(l) { var k = l.currentTarget; setTimeout(function() { e[k.szKey].oSprite.src = e[k.szKey].szPath }, 500) }, e[h].oSprite.src = e[h].szPath }; this.setLoaded = function(h) { a[h].bLoaded = !0 }; this.isLoaded = function(h) { return a[h].bLoaded }; this.getNumSprites = function() { return b } } var CANVAS_WIDTH = 1600, CANVAS_HEIGHT = 768, EDGEBOARD_X = 250, EDGEBOARD_Y = 88, FPS = 60, FPS_TIME = 1E3 / FPS, DISABLE_SOUND_MOBILE = !1, GAME_NAME = "spider_solitaire", PRIMARY_FONT = "arialbold", SOUNDTRACK_VOLUME_IN_GAME = 1, DEBUG_MODE = !1, STATE_LOADING = 0, STATE_MENU = 1, STATE_HELP = 1, STATE_GAME = 3, ON_BUT_YES_DOWN = 0, STATE_GAME_WAITING_FOR_BET = 0, STATE_GAME_DEAL = 1, STATE_GAME_CHOOSE_HOLD = 2, STATE_GAME_DRAW = 3, STATE_GAME_EVALUATE = 4, ON_CARD_SHOWN = "ON_CARD_SHOWN", ON_CARD_HIDE = "ON_CARD_HIDE", ON_MOUSE_DOWN = 0, ON_MOUSE_UP = 1, ON_MOUSE_OVER = 2, ON_MOUSE_OUT = 3, ON_DRAG_START = 4, ON_DRAG_END = 5, MODE_EASY = 0, MODE_NORMAL = 1, MODE_HARD = 2, SUIT_HEARTS = 0, SUIT_SPADES = 1, SUIT_DIAMONDS = 2, SUIT_CLUBS = 3, LABEL_EMPTY = 0, LABEL_HIDDEN = 1, LABEL_SHOWN = 2, CARD_WIDTH = 70, CARD_HEIGHT = 112, POINTS_TO_LOSE, POINTS_TO_WIN, ENABLE_FULLSCREEN, ENABLE_CHECK_ORIENTATION; function CPreloader() { var a, e, b, d, c, f, g, h, l, k; 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(); k = new createjs.Container; s_oStage.addChild(k) }; this.unload = function() { k.removeAllChildren(); l.unload() }; this._onImagesLoaded = function() {}; this._onAllImagesLoaded = function() { this.attachSprites(); s_oMain.preloaderReady() }; this.attachSprites = function() { var n = new createjs.Shape; n.graphics.beginFill("black").drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT); k.addChild(n); n = s_oSpriteLibrary.getSprite("200x200"); g = createBitmap(n); g.regX = .5 * n.width; g.regY = .5 * n.height; g.x = CANVAS_WIDTH / 2; g.y = CANVAS_HEIGHT / 2 - 180; k.addChild(g); h = new createjs.Shape; h.graphics.beginFill("rgba(0,0,0,0.01)").drawRoundRect(g.x - 100, g.y - 100, 200, 200, 10); k.addChild(h); g.mask = h; n = s_oSpriteLibrary.getSprite("progress_bar"); d = createBitmap(n); d.x = CANVAS_WIDTH / 2 - n.width / 2; d.y = CANVAS_HEIGHT / 2 + 50; k.addChild(d); a = n.width; e = n.height; c = new createjs.Shape; c.graphics.beginFill("rgba(0,0,0,0.01)").drawRect(d.x, d.y, 1, e); k.addChild(c); d.mask = c; b = new createjs.Text("", "30px " + PRIMARY_FONT, "#fff"); b.x = CANVAS_WIDTH / 2; b.y = CANVAS_HEIGHT / 2 + 100; b.textBaseline = "alphabetic"; b.textAlign = "center"; k.addChild(b); n = s_oSpriteLibrary.getSprite("but_start"); l = new CTextButton(CANVAS_WIDTH / 2, CANVAS_HEIGHT / 2, n, TEXT_PRELOADER_CONTINUE, "Arial", "#000", 50, k); l.addEventListener(ON_MOUSE_UP, this._onButStartRelease, this); l.setVisible(!1); l.removeStroke(); f = new createjs.Shape; f.graphics.beginFill("black").drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT); k.addChild(f); createjs.Tween.get(f).to({ alpha: 0 }, 500).call(function() { createjs.Tween.removeTweens(f); k.removeChild(f) }) }; this._onButStartRelease = function() { s_oMain._onRemovePreloader() }; this.refreshLoader = function(n) { b.text = n + "%"; 100 === n && (b.visible = !1, d.visible = !1, s_oMain._onRemovePreloader()); c.graphics.clear(); n = Math.floor(n * a / 100); c.graphics.beginFill("rgba(0,0,0,0.01)").drawRect(d.x, d.y, n, e) }; this._init() } function CMain(a) { var e, b = 0, d = 0, c = STATE_LOADING, f, g; this.initContainer = function() { s_oCanvas = document.getElementById("canvas"); s_oStage = new createjs.Stage(s_oCanvas); createjs.Touch.enable(s_oStage, !0); s_bMobile = isMobile(); !1 === s_bMobile && (s_oStage.enableMouseOver(20), $("body").on("contextmenu", "#canvas", function(l) { return !1 })); 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; f = new CPreloader; }; this.preloaderReady = function() { this._loadImages(); !1 !== DISABLE_SOUND_MOBILE && !1 !== s_bMobile || this._initSounds(); e = !0 }; this.soundLoaded = function() { b++; f.refreshLoader(Math.floor(b / d * 100)) }; this._initSounds = function() { Howler.mute(!s_bAudioActive); s_aSoundsInfo = []; s_aSoundsInfo.push({ path: "./sounds/", filename: "card_dealing", loop: !1, volume: 1, ingamename: "card_dealing" }); s_aSoundsInfo.push({ path: "./sounds/", filename: "click", loop: !1, volume: 1, ingamename: "click" }); s_aSoundsInfo.push({ path: "./sounds/", filename: "snap", loop: !1, volume: 1, ingamename: "snap" }); s_aSoundsInfo.push({ path: "./sounds/", filename: "game_over", loop: !1, volume: 1, ingamename: "game_over" }); s_aSoundsInfo.push({ path: "./sounds/", filename: "card", loop: !1, volume: 1, ingamename: "card" }); s_aSoundsInfo.push({ path: "./sounds/", filename: "soundtrack", loop: !0, volume: 1, ingamename: "soundtrack" }); d += s_aSoundsInfo.length; s_aSounds = []; for (var l = 0; l < s_aSoundsInfo.length; l++) this.tryToLoadSound(s_aSoundsInfo[l], !1) }; this.tryToLoadSound = function(l, k) { setTimeout(function() { s_aSounds[l.ingamename] = new Howl({ src: [l.path + l.filename + ".mp3"], autoplay: !1, preload: !0, loop: l.loop, volume: l.volume, onload: s_oMain.soundLoaded, onloaderror: function(n, v) { for (var r = 0; r < s_aSoundsInfo.length; r++) if (n === s_aSounds[s_aSoundsInfo[r].ingamename]._sounds[0]._id) { s_oMain.tryToLoadSound(s_aSoundsInfo[r], !0); break } }, onplayerror: function(n) { for (var v = 0; v < s_aSoundsInfo.length; v++) if (n === s_aSounds[s_aSoundsInfo[v].ingamename]._sounds[0]._id) { s_aSounds[s_aSoundsInfo[v].ingamename].once("unlock", function() { s_aSounds[s_aSoundsInfo[v].ingamename].play(); "soundtrack" === s_aSoundsInfo[v].ingamename && null !== s_oGame && setVolume("soundtrack", SOUNDTRACK_VOLUME_IN_GAME) }); break } } }) }, k ? 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("bg_menu", "./sprites/bg_menu.jpg"); s_oSpriteLibrary.addSprite("bg_layout", "./sprites/bg_layout.jpg"); s_oSpriteLibrary.addSprite("bg_game", "./sprites/bg_game.jpg"); s_oSpriteLibrary.addSprite("bg_help", "./sprites/bg_help.png"); s_oSpriteLibrary.addSprite("arrow", "./sprites/arrow.png"); s_oSpriteLibrary.addSprite("hintpanel", "./sprites/hintpanel.png"); s_oSpriteLibrary.addSprite("but_yes", "./sprites/but_yes.png"); s_oSpriteLibrary.addSprite("but_no", "./sprites/but_no.png"); s_oSpriteLibrary.addSprite("but_exit", "./sprites/but_exit.png"); s_oSpriteLibrary.addSprite("audio_icon", "./sprites/audio_icon.png"); s_oSpriteLibrary.addSprite("but_help", "./sprites/but_help.png"); s_oSpriteLibrary.addSprite("but_shuffle", "./sprites/but_shuffle.png"); s_oSpriteLibrary.addSprite("score_moves_display", "./sprites/score_moves_display.png"); for (var l = 0; 4 > l; l++) for (var k = 1; 14 > k; k++) s_oSpriteLibrary.addSprite("card_" + l + "_" + k, "./sprites/cards/card_" + l + "_" + k + ".png"); s_oSpriteLibrary.addSprite("card_back", "./sprites/cards/card_back.png"); s_oSpriteLibrary.addSprite("hearts_suit", "./sprites/hearts_suit.png"); s_oSpriteLibrary.addSprite("diamonds_suit", "./sprites/diamonds_suit.png"); s_oSpriteLibrary.addSprite("clubs_suit", "./sprites/clubs_suit.png"); s_oSpriteLibrary.addSprite("spades_suit", "./sprites/spades_suit.png"); s_oSpriteLibrary.addSprite("but_credits", "./sprites/but_credits.png"); s_oSpriteLibrary.addSprite("but_fullscreen", "./sprites/but_fullscreen.png"); s_oSpriteLibrary.addSprite("ctl_logo", "./sprites/ctl_logo.png"); d += s_oSpriteLibrary.getNumSprites(); s_oSpriteLibrary.loadSprites() }; this._onImagesLoaded = function() { b++; f.refreshLoader(Math.floor(b / d * 100)) }; this._onAllImagesLoaded = function() {}; this._onRemovePreloader = function() { f.unload(); s_oSoundTrack = playSound("soundtrack", 1, !0); this.gotoMenu() }; this.gotoMenu = function() { new CMenu; c = STATE_MENU }; this.goToModeMenu = function() { new CModeMenu; c = STATE_MENU }; this.gotoGame = function(l) { s_iMode = l; g = new CGame(h); c = STATE_GAME }; this.gotoHelp = function() { new CHelp; c = STATE_HELP }; this.stopUpdate = function() { e = !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(); e = !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(l) { if (!1 !== e) { var k = (new Date).getTime(); s_iTimeElaps = k - s_iPrevTime; s_iCntTime += s_iTimeElaps; s_iCntFps++; s_iPrevTime = k; 1E3 <= s_iCntTime && (s_iCurFps = s_iCntFps, s_iCntTime -= 1E3, s_iCntFps = 0); c === STATE_GAME && g.update(); s_oStage.update(l) } }; s_oMain = this; var h = a; ENABLE_FULLSCREEN = a.fullscreen; ENABLE_CHECK_ORIENTATION = a.check_orientation; s_bAudioActive = a.audio_enable_on_startup; this.initContainer() } var s_bMobile, s_iMode, s_bAudioActive = !1, s_bFullscreen = !1, s_iCntTime = 0, s_iTimeElaps = 0, s_iPrevTime = 0, s_iCntFps = 0, s_iCurFps = 0, s_oDrawLayer, s_oStage, s_oMain, s_oSpriteLibrary, s_oSoundTrack = null, s_oCanvas, s_aSounds, s_aSoundsInfo; function CTextButton(a, e, b, d, c, f, g, h) { var l, k, n, v, r, A, x; this._init = function(G, B, O, u, M, I, F, D) { l = []; k = []; var K = createBitmap(O), C = Math.ceil(F / 20); r = new createjs.Text(u, F + "px " + M, "#000000"); r.textAlign = "center"; r.textBaseline = "alphabetic"; var P = r.getBounds(); r.x = O.width / 2 + C; r.y = Math.floor(O.height / 2) + P.height / 3 + C; v = new createjs.Text(u, F + "px " + M, I); v.textAlign = "center"; v.textBaseline = "alphabetic"; P = v.getBounds(); v.x = O.width / 2; v.y = Math.floor(O.height / 2) + P.height / 3; n = new createjs.Container; n.x = G; n.y = B; n.regX = O.width / 2; n.regY = O.height / 2; n.addChild(K, r, v); s_bMobile || (n.cursor = "pointer"); D.addChild(n); this._initListener() }; this.unload = function() { n.off("mousedown", A); n.off("pressup", x); h.removeChild(n) }; this.setVisible = function(G) { n.visible = G }; this._initListener = function() { oParent = this; A = n.on("mousedown", this.buttonDown); x = n.on("pressup", this.buttonRelease) }; this.addEventListener = function(G, B, O) { l[G] = B; k[G] = O }; this.buttonRelease = function() { n.scaleX = 1; n.scaleY = 1; l[ON_MOUSE_UP] && l[ON_MOUSE_UP].call(k[ON_MOUSE_UP]) }; this.buttonDown = function() { n.scaleX = .9; n.scaleY = .9; l[ON_MOUSE_DOWN] && l[ON_MOUSE_DOWN].call(k[ON_MOUSE_DOWN]) }; this.setTextPosition = function(G) { v.y = G; r.y = G + 2 }; this.setPosition = function(G, B) { n.x = G; n.y = B }; this.setX = function(G) { n.x = G }; this.setY = function(G) { n.y = G }; this.getButtonImage = function() { return n }; this.getX = function() { return n.x }; this.getY = function() { return n.y }; this.removeStroke = function() { r.visible = !1 }; this._init(a, e, b, d, c, f, g, h); return this } function CToggle(a, e, b, d, c) { var f, g, h, l, k, n; this._init = function(r, A, x, G) { g = []; h = []; var B = 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] } }); f = G; l = createSprite(B, "state_" + f, x.width / 2 / 2, x.height / 2, x.width / 2, x.height); l.x = r; l.y = A; l.stop(); s_bMobile || (l.cursor = "pointer"); v.addChild(l); this._initListener() }; this.unload = function() { l.off("mousedown", k); l.off("pressup", n); v.removeChild(l) }; this._initListener = function() { k = l.on("mousedown", this.buttonDown); n = l.on("pressup", this.buttonRelease) }; this.addEventListener = function(r, A, x) { g[r] = A; h[r] = x }; this.setActive = function(r) { f = r; l.gotoAndStop("state_" + f) }; this.setPosition = function(r, A) { l.x = r; l.y = A }; this.buttonRelease = function() { l.scaleX = 1; l.scaleY = 1; playSound("click", 1, !1); f = !f; l.gotoAndStop("state_" + f); g[ON_MOUSE_UP] && g[ON_MOUSE_UP].call(h[ON_MOUSE_UP], f) }; this.buttonDown = function() { l.scaleX = .9; l.scaleY = .9; g[ON_MOUSE_DOWN] && g[ON_MOUSE_DOWN].call(h[ON_MOUSE_DOWN]) }; var v = c; this._init(a, e, b, d) } function CGfxButton(a, e, b, d) { var c, f, g, h, l = [], k, n, v, r; this._init = function(A, x, G, B) { c = !1; f = 1; g = []; h = []; k = createBitmap(G); k.x = A; k.y = x; k.scaleX = k.scaleY = f; k.regX = G.width / 2; k.regY = G.height / 2; B.addChild(k); this._initListener() }; this.unload = function() { s_bMobile ? k.off("mousedown", n) : (k.off("mousedown", n), k.off("mouseover", v)); k.off("pressup", r); d.removeChild(k) }; this.setVisible = function(A) { k.visible = A }; this.setClickable = function(A) { c = !A }; this._initListener = function() { s_bMobile ? n = k.on("mousedown", this.buttonDown) : (n = k.on("mousedown", this.buttonDown), v = k.on("mouseover", this.buttonOver)); r = k.on("pressup", this.buttonRelease) }; this.addEventListener = function(A, x, G) { g[A] = x; h[A] = G }; this.addEventListenerWithParams = function(A, x, G, B) { g[A] = x; h[A] = G; l = B }; this.buttonRelease = function() { c || (k.scaleX = f, k.scaleY = f, g[ON_MOUSE_UP] && g[ON_MOUSE_UP].call(h[ON_MOUSE_UP], l)) }; this.buttonDown = function() { c || (k.scaleX = .9 * f, k.scaleY = .9 * f, playSound("click", 1, !1), g[ON_MOUSE_DOWN] && g[ON_MOUSE_DOWN].call(h[ON_MOUSE_DOWN], l)) }; this.buttonOver = function(A) { s_bMobile || c || (A.target.cursor = "pointer") }; this.pulseAnimation = function() { createjs.Tween.get(k, { loop: !0 }).to({ scaleX: 1.1 * f, scaleY: 1.1 * f }, 850, createjs.Ease.quadOut).to({ scaleX: f, scaleY: f }, 650, createjs.Ease.quadIn) }; this.trembleAnimation = function() { createjs.Tween.get(k, { loop: !0 }).to({ rotation: 5 }, 75, createjs.Ease.quadOut).to({ rotation: -5 }, 140, createjs.Ease.quadIn).to({ rotation: 0 }, 75, createjs.Ease.quadIn).wait(750) }; this.setPosition = function(A, x) { k.x = A; k.y = x }; this.setX = function(A) { k.x = A }; this.setY = function(A) { k.y = A }; this.getButtonImage = function() { return k }; this.getX = function() { return k.x }; this.getY = function() { return k.y }; this._init(a, e, b, d); return this } function CMenu() { var a, e, b, d, c, f, g, h, l, k, n, v, r = null, A = null; this._init = function() { g = createBitmap(s_oSpriteLibrary.getSprite("bg_menu")); s_oStage.addChild(g); var x = s_oSpriteLibrary.getSprite("but_play"); h = new CGfxButton(CANVAS_WIDTH / 2, CANVAS_HEIGHT - 160, x, s_oStage); h.addEventListener(ON_MOUSE_UP, this._onButPlayRelease, this); if (!1 === DISABLE_SOUND_MOBILE || !1 === s_bMobile) x = s_oSpriteLibrary.getSprite("audio_icon"), c = CANVAS_WIDTH - x.height / 2 - 10, f = x.height / 2 + 10, k = new CToggle(c, f, x, s_bAudioActive, s_oStage), k.addEventListener(ON_MOUSE_UP, this._onAudioToggle, this); x = s_oSpriteLibrary.getSprite("but_credits"); b = x.height / 2 + 10; d = x.height / 2 + 10; n = new CGfxButton(b, d, x, s_oStage); n.addEventListener(ON_MOUSE_UP, this._onButCreditRelease, this); x = window.document; var G = x.documentElement; r = G.requestFullscreen || G.mozRequestFullScreen || G.webkitRequestFullScreen || G.msRequestFullscreen; A = x.exitFullscreen || x.mozCancelFullScreen || x.webkitExitFullscreen || x.msExitFullscreen; !1 === ENABLE_FULLSCREEN && (r = !1); r && screenfull.isEnabled && (x = s_oSpriteLibrary.getSprite("but_fullscreen"), a = b + x.width / 2 + 10, e = d, v = new CToggle(a, e, x, s_bFullscreen, s_oStage), v.addEventListener(ON_MOUSE_UP, this._onFullscreenRelease, this)); l = new createjs.Shape; l.graphics.beginFill("black").drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT); s_oStage.addChild(l); createjs.Tween.get(l).to({ alpha: 0 }, 1E3).call(function() { l.visible = !1 }); this.refreshButtonPos(s_iOffsetX, s_iOffsetY) }; this.refreshButtonPos = function(x, G) { n.setPosition(b + s_iOffsetX, s_iOffsetY + d); !1 !== DISABLE_SOUND_MOBILE && !1 !== s_bMobile || k.setPosition(c - x, G + f); r && screenfull.isEnabled && v.setPosition(a + s_iOffsetX, e + s_iOffsetY) }; this.unload = function() { h.unload(); h = null; n.unload(); if (!1 === DISABLE_SOUND_MOBILE || !1 === s_bMobile) k.unload(), k = null; r && screenfull.isEnabled && v.unload(); s_oStage.removeChild(g); s_oMenu = g = null }; this._onAudioToggle = function() { Howler.mute(s_bAudioActive); s_bAudioActive = !s_bAudioActive }; this._onButPlayRelease = function() { this.unload(); s_oMain.goToModeMenu(); $(s_oMain).trigger("start_session") }; this._onButCreditRelease = function() { new CCreditsPanel }; this.resetFullscreenBut = function() { r && screenfull.isEnabled && v.setActive(s_bFullscreen) }; this._onFullscreenRelease = function() { s_bFullscreen ? A.call(window.document) : r.call(window.document.documentElement); sizeHandler() }; s_oMenu = this; this._init() } var s_oMenu = null; function CModeMenu() { var a, e, b, d, c, f, g, h, l, k, n, v, r, A, x, G, B, O, u, M = null, I = null, F, D, K, C, P; this._init = function() { c = createBitmap(s_oSpriteLibrary.getSprite("bg_layout")); s_oStage.addChild(c); var z = 600, H = 70, L = CANVAS_WIDTH / 2; O = new CTLText(s_oStage, L - z / 2, CANVAS_HEIGHT / 2 - 160 - H / 2, z, H, 60, "center", "#fff", PRIMARY_FONT, 1, 2, 2, TEXT_TOP_MODE, !0, !0, !1, !1); O.setShadow("#000000", 3, 3, 3); f = new createjs.Container; f.x = CANVAS_WIDTH / 2 - 440; f.y = 369; s_bMobile || (f.cursor = "pointer"); g = new createjs.Container; g.x = CANVAS_WIDTH / 2 - 120; g.y = 369; s_bMobile || (g.cursor = "pointer"); h = new createjs.Container; h.x = CANVAS_WIDTH / 2 + 200; h.y = 369; s_bMobile || (h.cursor = "pointer"); z = 200; H = 40; L = 122; l = new CTLText(f, L - z / 2, 80 - H / 2, z, H, 28, "center", "#01ff8f", PRIMARY_FONT, 1, 2, 2, TEXT_MODE_1, !0, !0, !1, !1); l.setShadow("#000000", 3, 3, 3); k = new CTLText(f, L - z / 2, 25 - H / 2, z, H, 34, "center", "#ffffff", PRIMARY_FONT, 1, 2, 2, TEXT_EASY, !0, !0, !1, !1); k.setShadow("#000000", 3, 3, 3); n = new CTLText(g, L - z / 2, 80 - H / 2, z, H, 28, "center", "#01ff8f", PRIMARY_FONT, 1, 2, 2, TEXT_MODE_2, !0, !0, !1, !1); n.setShadow("#000000", 3, 3, 3); v = new CTLText(g, L - z / 2, 25 - H / 2, z, H, 34, "center", "#ffffff", PRIMARY_FONT, 1, 2, 2, TEXT_NORMAL, !0, !0, !1, !1); v.setShadow("#000000", 3, 3, 3); r = new CTLText(h, L - z / 2, 80 - H / 2, z, H, 28, "center", "#01ff8f", PRIMARY_FONT, 1, 2, 2, TEXT_MODE_3, !0, !0, !1, !1); r.setShadow("#000000", 3, 3, 3); A = new CTLText(h, L - z / 2, 25 - H / 2, z, H, 34, "center", "#ffffff", PRIMARY_FONT, 1, 2, 2, TEXT_HARD, !0, !0, !1, !1); A.setShadow("#000000", 3, 3, 3); s_oStage.addChild(f); s_oStage.addChild(g); s_oStage.addChild(h); if (!1 === DISABLE_SOUND_MOBILE || !1 === s_bMobile) z = s_oSpriteLibrary.getSprite("audio_icon"), b = CANVAS_WIDTH - z.height / 2 - 10, d = z.height / 2 + 10, D = new CToggle(b, d, z, s_bAudioActive, s_oStage), D.addEventListener(ON_MOUSE_UP, this._onAudioToggle, this); z = window.document; H = z.documentElement; M = H.requestFullscreen || H.mozRequestFullScreen || H.webkitRequestFullScreen || H.msRequestFullscreen; I = z.exitFullscreen || z.mozCancelFullScreen || z.webkitExitFullscreen || z.msExitFullscreen; !1 === ENABLE_FULLSCREEN && (M = !1); M && screenfull.isEnabled && (z = s_oSpriteLibrary.getSprite("but_fullscreen"), a = z.width / 4 + 10, e = z.height / 2 + 10, u = new CToggle(a, e, z, s_bFullscreen, s_oStage), u.addEventListener(ON_MOUSE_UP, this._onFullscreenRelease, this)); z = (new createjs.Graphics).beginFill("rgba(158,158,158,0.01)").drawRect(4, 0, 240, 250); x = new createjs.Shape(z); f.addChild(x); K = x.on("pressup", this._selectEasy); G = new createjs.Shape(z); g.addChild(G); C = G.on("pressup", this._selectNormal); B = new createjs.Shape(z); h.addChild(B); P = B.on("pressup", this._selectHard); F = new createjs.Shape; F.graphics.beginFill("black").drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT); s_oStage.addChild(F); createjs.Tween.get(F).to({ alpha: 0 }, 1E3).call(function() { F.visible = !1 }); this.refreshButtonPos(s_iOffsetX, s_iOffsetY) }; this.refreshButtonPos = function(z, H) { !1 !== DISABLE_SOUND_MOBILE && !1 !== s_bMobile || D.setPosition(b - z, H + d); M && screenfull.isEnabled && u.setPosition(a + s_iOffsetX, e + s_iOffsetY) }; this._selectEasy = function() { playSound("click", 1, !1); E.unload(); s_oMain.gotoGame(MODE_EASY) }; this._selectNormal = function() { playSound("click", 1, !1); E.unload(); s_oMain.gotoGame(MODE_NORMAL) }; this._selectHard = function() { playSound("click", 1, !1); E.unload(); s_oMain.gotoGame(MODE_HARD) }; this.unload = function() { if (!1 === DISABLE_SOUND_MOBILE || !1 === s_bMobile) D.unload(), D = null; M && screenfull.isEnabled && u.unload(); x.off("pressup", K); G.off("pressup", C); B.off("pressup", P); s_oStage.removeAllChildren(); s_oModeMenu = c = null }; this._onAudioToggle = function() { Howler.mute(s_bAudioActive); s_bAudioActive = !s_bAudioActive }; this._onButPlayRelease = function() { this.unload(); playSound("click", 1, !1); s_oMain.gotoGame() }; this.resetFullscreenBut = function() { M && screenfull.isEnabled && u.setActive(s_bFullscreen) }; this._onFullscreenRelease = function() { s_bFullscreen ? I.call(window.document) : M.call(window.document.documentElement); sizeHandler() }; var E = this; s_oModeMenu = this; this._init() } var s_oModeMenu = null; function CGame(a) { var e, b, d, c, f, g, h, l, k, n, v, r, A, x, G, B, O, u, M, I, F, D, K, C, P, E, z, H, L, U = null, S, T, V, aa, p, ba, X; this._init = function() { G = 23; M = O = B = x = A = 0; l = 500; k = 0; f = g = !0; h = !1; T = null; X = 3; playSound("card_dealing", 1, !0); var m = createBitmap(s_oSpriteLibrary.getSprite("bg_game")); s_oStage.addChild(m); C = []; P = []; z = []; r = 0; F = []; for (m = 0; 7 > m; m++) for (var q = 0; 10 > q; q++) F[r] = { x: 299 + 81 * q, y: 220 + 10 * m }, 4 < q && (F[r] = { x: 300 + 81 * q, y: 220 + 10 * m }), r++; ba = new createjs.Container; s_oStage.addChild(ba); S = new createjs.Container; s_oStage.addChild(S); D = []; D[SUIT_HEARTS] = { x: 1212, y: 220 }; D[SUIT_SPADES] = { x: 1302, y: 220 }; D[SUIT_DIAMONDS] = { x: 1212, y: 350 }; D[SUIT_CLUBS] = { x: 1302, y: 350 }; m = (new createjs.Graphics).beginFill("rgba(158,158,158,0.01)").drawRect(D[SUIT_HEARTS].x - CARD_WIDTH / 2, D[SUIT_HEARTS].y - CARD_HEIGHT / 2, 170, 250); aa = new createjs.Shape(m); aa.on("click", this._denyClick); s_oStage.addChild(aa); K = []; for (m = 0; 5 > m; m++) K[m] = { x: 1212 + 22 * m, y: 614 }; E = []; for (m = 0; 40 > m; m++) for (E[m] = [], q = 0; 10 > q; q++) E[m][q] = { status: LABEL_EMPTY, oCard: null }; m = this._initCards(s_iMode); this._shuffleCard(m, DEBUG_MODE); this._setBoard(); m = (new createjs.Graphics).beginFill("rgba(158,158,158,0.01)").drawRect(K[B].x - CARD_WIDTH / 2, K[B].y - CARD_HEIGHT / 2, CARD_WIDTH, CARD_HEIGHT); V = new createjs.Shape(m); V.on("click", this._turnDeck); V.cursor = "pointer"; V.visible = !1; s_oStage.addChild(V); m = (new createjs.Graphics).beginFill("rgba(158,158,158,0.01)").drawRect(K[B].x - CARD_WIDTH / 2, K[B].y - CARD_HEIGHT / 2, CARD_WIDTH, CARD_HEIGHT); p = new createjs.Shape(m); p.on("click", this._hintForDeck); p.visible = !1; s_oStage.addChild(p); L = new CInterface; L.refreshScore(l); s_oStage.addEventListener("stagemousemove", this.dragCard, !1); s_oStage.addEventListener("stagemouseup", this.releaseCard, !1); $(s_oMain).trigger("start_level", 1) }; this._initCards = function(m) { if (m === MODE_EASY) { m = 13; var q = 25; var w = 1 } else m === MODE_NORMAL ? (m = 0, q = 25) : (m = 0, q = 51), w = 0; for (var y = w, t = m, J = [], R = 0; 104 > R; R++) { var N = (R + 1) % 13; 0 === N && (N = 13); J.push({ fotogram: t, rank: N, suit: y }); 13 === N && y++; t++; t > q && (t = m, y = w) } return J }; this._shuffleCard = function(m, q) { for (var w = [], y = 0; y < m.length; y++) w[y] = m[y]; for (var t = []; 0 < w.length;) t.push(w.splice(Math.round(Math.random() * (w.length - 1)), 1)[0]); if (q) for (y = 0; y < t.length; y++) C[y] = new CCard(K[0].x, K[0].y, S, m[y].fotogram, m[y].rank, m[y].suit); else for (y = 0; y < t.length; y++) C[y] = new CCard(K[0].x, K[0].y, S, t[y].fotogram, t[y].rank, t[y].suit) }; this._setBoard = function() { for (var m = 0, q = C.length - 1, w = C.length - 1; 50 <= w; w--) C[w].moveCard(F[C.length - 1 - w].x, F[C.length - 1 - w].y, 150, m), m += 50; for (w = 0; 6 > w; w++) for (m = 0; 10 > m && (E[w][m].oCard = C[q], E[w][m].status = LABEL_HIDDEN, q--, 5 !== w || 3 !== m); m++); for (w = 54; w < C.length; w++) P[C.length - 1 - w] = C[C.length - 1 - w] }; this.scaleDepth = function(m) { S.setChildIndex(m, A); A++ }; this.pickCard = function(m, q) { if (0 === z.length && !f) { f = !0; d = m.getPos().x; c = m.getPos().y; e = q.stageX / s_iScaleFactor - d; b = q.stageY / s_iScaleFactor - c; for (var w = 0; 10 > w; w++) for (var y = E.length - 1; 0 <= y; y--) E[y][w].oCard === m && (T = { row: y, column: w }); w = 0; var t = m.getRank(); for (y = T.row; y < E.length; y++) if (E[y][T.column].status === LABEL_SHOWN && E[y][T.column].oCard.getSuit() === m.getSuit()) if (E[y][T.column].oCard.getRank() === t) w++, t--; else { w = 0; break } else if (E[y][T.column].status === LABEL_EMPTY) break; else if (E[y][T.column].oCard.getSuit() !== m.getSuit()) { w = 0; break } t = []; for (y = 0; y < w; y++) t[y] = E[T.row + y][T.column].oCard.saveInfo(), z[y] = new CCard(d, c + y * G, S, t[y].szFotogram, t[y].iRank, t[y].iSuit), E[T.row + y][T.column].oCard.unload(), z[y].instantShow() } }; this.dragCard = function(m) { n = parseInt(m.stageX / s_iScaleFactor); v = parseInt(m.stageY / s_iScaleFactor); if (!g && f) for (m = 0; m < z.length; m++) z[m].setPos(n - e, v - b + m * G) }; this.releaseCard = function(m) { h || 0 < O || (!1 === g && 0 < z.length ? (f = !1, Y._checkCardCollision(z), T = null, z = []) : f = !1) }; this._checkCardCollision = function(m) { for (var q = 0, w = [], y = [], t = 0; 10 > t; t++) for (var J = E.length - 1; 0 <= J; J--) if (E[J][t].status === LABEL_SHOWN) { w[q] = E[J][t].oCard.getLogicRect(); y[q] = { oCard: E[J][t].oCard, x: E[J][t].oCard.getPos().x, y: E[J][t].oCard.getPos().y, row: J, column: t }; q++; break } else 0 === J && (w[q] = new createjs.Rectangle(F[t].x - CARD_WIDTH / 2, F[t].y - CARD_HEIGHT / 2, CARD_WIDTH, CARD_HEIGHT), q++); q = 0; t = -1; var R = m[0].getLogicRect(); for (J = 0; J < w.length; J++) { var N = R.intersection(w[J]); null !== N && q < N.width * N.height && (q = N.width * N.height, t = J) } if (0 > t) for (J = 0; J < m.length; J++) m[J].stackInPlace(d, c + J * G, 200), E[T.row + J][T.column].oCard = m[J]; else if (E[0][t].status === LABEL_EMPTY) { for (J = 0; J < m.length; J++) m[J].stackInPlace(F[t].x, F[t].y + J * G, 200), E[J][t].status = LABEL_SHOWN, E[T.row + J][T.column].status = LABEL_EMPTY, E[J][t].oCard = m[J]; this._updateMoves(); this._removeScore(); this._checkBoard(m[0], t); this._checkMoves() } else if (1 === y[t].oCard.getRank() - m[0].getRank()) { for (J = 0; J < m.length; J++) m[J].stackInPlace(y[t].x, y[t].y + G + J * G, 200), E[y[t].row + 1 + J][y[t].column].status = LABEL_SHOWN, E[T.row + J][T.column].status = LABEL_EMPTY, E[y[t].row + 1 + J][y[t].column].oCard = m[J]; this._updateMoves(); this._removeScore(); this._checkBoard(m[0], t); this._checkMoves() } else for (J = 0; J < m.length; J++) m[J].stackInPlace(d, c + J * G, 200), E[T.row + J][T.column].oCard = m[J] }; this._checkBoard = function(m, q) { this._turnCard(T.column); u = q; var w = 1; H = []; for (var y = E.length - 1; 0 <= y; y--) if (E[y][q].status === LABEL_EMPTY) var t = y; else if (E[y][q].oCard.getRank() === w && E[y][q].oCard.getSuit() === m.getSuit() && E[y][q].status === LABEL_SHOWN) w++, t = y, H.push(E[y][q].oCard); else break; w = m.getSuit(); if (13 === H.length) { h = f = !0; I = 0; playSound("snap", 1, !1); for (y = 0; 13 > y; y++) E[t + 12 - y][q].status = LABEL_EMPTY, E[t + 12 - y][q].oCard = null; H[I].moveToSuit(D[w].x + X, D[w].y + X, 210) } this._checkIfActiveDeck() }; this._turnCard = function(m) { for (var q = E.length - 1; 0 <= q && E[q][m].status !== LABEL_SHOWN; q--) if (E[q][m].status === LABEL_HIDDEN) { E[q][m].oCard.showCard(); E[q][m].status = LABEL_SHOWN; break } }; this.stackInSuit = function(m) { I++; 13 > I ? (m = H[I].getSuit(), 1 < I && H[I - 2].setVisible(!1), S.swapChildren(H[I].getSprite(), H[I - 1].getSprite()), H[I].moveToSuit(D[m].x + X, D[m].y + X, 0)) : (I = 0, M++, h = f = !1, this._turnCard(u), this._calculateScore(m, POINTS_TO_WIN), 8 === M ? this.gameOver() : (0 < P.length && 10 > this._getNumCardsOnBoard() && (this.gameOver(), U.changeTitle(TEXT_GAME_OVER), U.changeExpl(TEXT_STALL)), f = !1)) }; this._checkIfActiveDeck = function() { for (var m = 0, q = 0; 10 > q; q++) E[0][q].status === LABEL_EMPTY && m++; 0 < m ? (V.visible = !1, p.visible = !0, 5 === B && p.visible["false"]) : (p.visible = !1, V.visible = !0) }; this._hintForDeck = function() { L.showHint("deck") }; this._turnDeck = function() { if (!f && 5 !== B) { f = !0; Y.activeDeck(); B++; V.x = 22 * B; p.x = 22 * B; for (var m = [], q = 0; 10 > q; q++) for (var w = E.length - 1; 0 <= w; w--) if (E[w][q].status === LABEL_SHOWN) { m[q] = { x: E[w][q].oCard.getPos().x, y: E[w][q].oCard.getPos().y + G, row: w + 1, column: q }; break } else 0 === w && (m[q] = { row: 0, column: q }); q = 100; var y = [], t = []; for (w = 0; 10 > w; w++) y[w] = P[P.length - 10 + w].saveInfo(), P[P.length - 10 + w].unload(), P.splice(P.length - 10 + w, 1), t[w] = new CCard(K[B - 1].x, K[B - 1].y, S, y[w].szFotogram, y[w].iRank, y[w].iSuit); for (w = 0; 10 > w; w++) E[m[w].row][w].oCard = t[9 - w], E[m[w].row][w].status = LABEL_SHOWN, t[9 - w].moveDeckCard(m[w].x, m[w].y, 200, q), q += 100; Y._checkMoves() } }; this.activeDeck = function() { O++; 11 === O ? (f = !1, V.visible = !0, O = 0, this._checkScaleAllColumn()) : V.visible = !1 }; this._checkScaleAllColumn = function() { for (var m = 0; 10 > m; m++) { for (var q = 1, w, y, t = E.length - 1; 0 <= t; t--) if (E[t][m].status === LABEL_SHOWN) { w = E[t][m].oCard.getSuit(); y = t; break } for (t = y; 0 <= t; t--) if (E[t][m].oCard.getRank() === q && E[t][m].oCard.getSuit() === w && E[t][m].status === LABEL_SHOWN) q++; else break; var J = 300; if (14 === q) { playSound("snap", 1, !1); u = m; q = y - 12; var R = E[q][m].oCard.getSuit(); for (t = 0; 13 > t; t++) E[q + 12 - t][m].oCard.moveToSuit(D[R].x + X, D[R].y + X, 100, J), E[q + 12 - t][m].status = LABEL_EMPTY, E[q + 12 - t][m].oCard = null, J += 100 } } this._checkIfActiveDeck() }; this._denyClick = function() {}; this._checkMoves = function() { if (!(5 > B)) { for (var m = 0; 10 > m; m++) if (E[0][m].status === LABEL_EMPTY) return; for (var q = [], w = [], y = 0; 10 > y; y++) for (m = E.length - 1; 0 <= m; m--) if (E[m][y].status === LABEL_SHOWN) { q.push(E[m][y].oCard); w.push({ row: m, column: y }); break } var t = []; for (y = 0; y < w.length; y++) { var J = w[y].column; m = w[y].row; for (var R = E[m][J].oCard.getRank(), N = E[m][J].oCard.getSuit(); 0 <= m; m--) if (E[m][J].oCard.getSuit() === N && E[m][J].oCard.getRank() === R && E[m][J].status === LABEL_SHOWN) t[y] = E[m][J].oCard, R++; else break } if (!(10 > w.length)) { for (m = 0; m < q.length; m++) for (y = 0; y < t.length; y++) if (1 === q[m].getRank() - t[y].getRank()) return; L.showHint("nomoves") } } }; this.unload = function() { for (var m = 0; m < C.length; m++) C[m].unload(); L.unload(); null !== U && U.unload(); stopSound("card_dealing"); createjs.Tween.removeAllTweens(); s_oStage.removeAllChildren() }; this.getSuitContainer = function() { return ba }; this.onExit = function() { this.unload(); s_oMain.gotoMenu() }; this._onExitHelp = function() {}; this.gameOver = function() { playSound("game_over", 1, !1); U = new CEndPanel(s_oSpriteLibrary.getSprite("msg_box")); U.show(l) }; this.restartGame = function() { this.unload(); this._init() }; this.pauseGame = function() {}; this._calculateScore = function(m, q) { l += q; (new CScore).showScore(m.getPos(), q) }; this._removeScore = function() { l--; 0 > l && (l = 0); (new CScore).removeScore(l, 750); L.fadeScore(l, 750) }; this.updateScore = function(m) { l += m * s_iMode }; this.updateVisualScore = function() { L.refreshScore(l) }; this._updateMoves = function() { k++; (new CScore).displayMoves(k, 750); L.fadeMove(k, 750) }; this._getNumCardsOnBoard = function() { for (var m = 0, q = 0; q < E.length; q++) for (var w = 0; w < E[q].length; w++) E[q][w].status !== LABEL_EMPTY && m++; return m }; this.update = function() { if (g && C[51].getPlaced()) if (stopSound("card_dealing"), x++, 4 === x) C[59].showCard(), E[4][4].status = LABEL_SHOWN; else if (8 === x) C[58].showCard(), E[4][5].status = LABEL_SHOWN; else if (12 === x) C[57].showCard(), E[4][6].status = LABEL_SHOWN; else if (16 === x) C[56].showCard(), E[4][7].status = LABEL_SHOWN; else if (20 === x) C[55].showCard(), E[4][8].status = LABEL_SHOWN; else if (24 === x) C[54].showCard(), E[4][9].status = LABEL_SHOWN; else if (28 === x) C[53].showCard(), E[5][0].status = LABEL_SHOWN; else if (32 === x) C[52].showCard(), E[5][1].status = LABEL_SHOWN; else if (36 === x) C[51].showCard(), E[5][2].status = LABEL_SHOWN; else if (40 === x) C[50].showCard(), E[5][3].status = LABEL_SHOWN; else if (44 === x) for (var m = 0; 10 > m; m++) P[39 - m].stackAndDeactive(K[1].x, K[1].y, 1E3); else if (56 === x) for (m = 0; 10 > m; m++) P[29 - m].stackAndDeactive(K[2].x, K[2].y, 1E3); else if (68 === x) for (m = 0; 10 > m; m++) P[19 - m].stackAndDeactive(K[3].x, K[3].y, 1E3); else if (80 === x) { for (m = 0; 10 > m; m++) P[9 - m].stackAndDeactive(K[4].x, K[4].y, 1E3); f = g = !1; V.visible = !0; L.setVisibleButHelp() } }; s_oGame = this; POINTS_TO_LOSE = a.points_to_lose; POINTS_TO_WIN = a.points_to_win; var Y = this; this._init() } var s_oGame; function CInterface() { var a, e, b, d, c, f, g, h, l, k, n, v, r, A, x, G = null, B, O, u, M, I, F, D, K, C, P = null, E = null; this._init = function() { var z = s_oSpriteLibrary.getSprite("but_exit"); l = CANVAS_WIDTH - z.height / 2 - 10; k = z.height / 2 + 10; r = new CGfxButton(l, k, z, s_oStage); r.addEventListener(ON_MOUSE_UP, this._onExit, this); var H = CANVAS_WIDTH - z.width / 2 - 80; if (!1 === DISABLE_SOUND_MOBILE || !1 === s_bMobile) z = s_oSpriteLibrary.getSprite("audio_icon"), g = H, h = z.height / 2 + 10, v = new CToggle(g, h, z, s_bAudioActive, s_oStage), v.addEventListener(ON_MOUSE_UP, this._onAudioToggle, this); H -= 68; z = s_oSpriteLibrary.getSprite("but_help"); c = H; f = z.height / 2 + 10; A = new CGfxButton(c, f, z, s_oStage); A.addEventListener(ON_MOUSE_UP, this._onButHelpRelease, this); A.setVisible(!1); H -= 68; z = s_oSpriteLibrary.getSprite("but_shuffle"); b = H; d = z.height / 2 + 10; x = new CGfxButton(b, d, z, s_oStage); x.addEventListener(ON_MOUSE_UP, this._onButRestartRelease, this); z = window.document; H = z.documentElement; P = H.requestFullscreen || H.mozRequestFullScreen || H.webkitRequestFullScreen || H.msRequestFullscreen; E = z.exitFullscreen || z.mozCancelFullScreen || z.webkitExitFullscreen || z.msExitFullscreen; !1 === ENABLE_FULLSCREEN && (P = !1); P && screenfull.isEnabled && (z = s_oSpriteLibrary.getSprite("but_fullscreen"), a = z.width / 4 + 10, e = z.height / 2 + 10, K = new CToggle(a, e, z, s_bFullscreen, s_oStage), K.addEventListener(ON_MOUSE_UP, this._onFullscreenRelease, this)); z = s_oSpriteLibrary.getSprite("score_moves_display"); B = createBitmap(z); B.x = 562; B.y = 79; s_oStage.addChild(B); H = 46; var L = z.height / 2, U = B.x + 32, S = B.y + 22; O = new CTLText(s_oStage, U - H / 2, S - L / 2, H, L, 25, "right", "#fff", PRIMARY_FONT, 1, 2, 0, "0", !0, !0, !1, !1); H = 100; L = z.height / 2; U = B.x - 50; S = B.y + 22; new CTLText(s_oStage, U - H / 2, S - L / 2, H, L, 25, "right", "#fff", PRIMARY_FONT, 1, 2, 0, TEXT_MOVES, !0, !0, !1, !1); z = s_oSpriteLibrary.getSprite("score_moves_display"); u = createBitmap(z); u.scaleX = 1.4; u.x = 352; u.y = 79; s_oStage.addChild(u); H = 68; L = z.height / 2; U = u.x + 44; S = u.y + 22; M = new CTLText(s_oStage, U - H / 2, S - L / 2, H, L, 25, "right", "#fff", PRIMARY_FONT, 1, 2, 0, "0", !0, !0, !1, !1); H = 100; L = z.height / 2; U = u.x - 50; S = u.y + 22; new CTLText(s_oStage, U - H / 2, S - L / 2, H, L, 25, "right", "#fff", PRIMARY_FONT, 1, 2, 0, TEXT_SCORE, !0, !0, !1, !1); D = new createjs.Container; D.x = 1102; D.y = 494; D.alpha = 0; s_oStage.addChild(D); z = s_oSpriteLibrary.getSprite("hintpanel"); F = createBitmap(z); D.addChild(F); H = z.width - 24; L = z.height / 2 + 6; U = z.width / 2 - 2; S = z.height / 2 - 4; I = new CTLText(D, U - H / 2, S - L / 2, H, L, 12, "center", "#fff", PRIMARY_FONT, 1.2, 2, 2, TEXT_HINT2, !0, !0, !0, !1); n = []; n[0] = { x: 1212 - CARD_WIDTH / 2, y: 220 - CARD_HEIGHT / 2 }; n[1] = { x: 1302 - CARD_WIDTH / 2, y: 220 - CARD_HEIGHT / 2 }; n[2] = { x: 1212 - CARD_WIDTH / 2, y: 350 - CARD_HEIGHT / 2 }; n[3] = { x: 1302 - CARD_WIDTH / 2, y: 350 - CARD_HEIGHT / 2 }; z = createBitmap(s_oSpriteLibrary.getSprite("hearts_suit")); z.x = n[0].x; z.y = n[0].y; H = createBitmap(s_oSpriteLibrary.getSprite("spades_suit")); H.x = n[1].x; H.y = n[1].y; L = createBitmap(s_oSpriteLibrary.getSprite("diamonds_suit")); L.x = n[2].x; L.y = n[2].y; U = createBitmap(s_oSpriteLibrary.getSprite("clubs_suit")); U.x = n[3].x; U.y = n[3].y; S = s_oGame.getSuitContainer(); switch (s_iMode) { case MODE_EASY: S.addChild(H); break; case MODE_NORMAL: S.addChild(H); S.addChild(z); break; case MODE_HARD: S.addChild(H), S.addChild(z), S.addChild(L), S.addChild(U) } C = new CAreYouSurePanel(s_oStage); C.addEventListener(ON_BUT_YES_DOWN, this._onConfirmExit); this.refreshButtonPos(s_iOffsetX, s_iOffsetY) }; this.refreshButtonPos = function(z, H) { r.setPosition(l - z, k + H); A.setPosition(c - z, f + H); x.setPosition(b - z, d + H); !1 !== DISABLE_SOUND_MOBILE && !1 !== s_bMobile || v.setPosition(g - z, h + H); P && screenfull.isEnabled && K.setPosition(a + s_iOffsetX, e + s_iOffsetY) }; this.unload = function() { if (!1 === DISABLE_SOUND_MOBILE || !1 === s_bMobile) v.unload(), v = null; P && screenfull.isEnabled && K.unload(); r.unload(); A.unload(); x.unload(); null !== G && G.unload(); s_oInterface = C = null }; this.refreshScore = function(z) { M.getText().alpha = 1; M.refreshText(z) }; this.fadeScore = function(z, H) { var L = this; createjs.Tween.get(M.getText()).to({ alpha: 0 }, H, createjs.Ease.linear).call(function() { L.refreshScore(z) }) }; this._refreshMove = function(z) { O.getText().alpha = 1; O.refreshText(z) }; this.fadeMove = function(z, H) { var L = this; createjs.Tween.get(O.getText()).to({ alpha: 0 }, H, createjs.Ease.linear).call(function() { L._refreshMove(z) }) }; this.showHint = function(z) { "deck" === z ? (I.y = 16, I.refreshText(TEXT_HINT1), createjs.Tween.get(D, { override: !0 }).to({ alpha: 1 }, 3E3, createjs.Ease.linear).call(function() { createjs.Tween.get(D).to({ alpha: 0 }, 3E3, createjs.Ease.linear) })) : (I.y = 22, I.refreshText(TEXT_HINT2), createjs.Tween.get(D, { override: !0 }).to({ alpha: 1 }, 3E3, createjs.Ease.linear)) }; this.setVisibleButHelp = function() { A.setVisible(!0) }; this._onButHelpRelease = function() { G = new CHelpPanel }; this._onButRestartRelease = function() { s_oGame.restartGame(); $(s_oMain).trigger("restart_level", 1); $(s_oMain).trigger("show_interlevel_ad") }; this.onExitFromHelp = function() { G.unload() }; this._onAudioToggle = function() { Howler.mute(s_bAudioActive); s_bAudioActive = !s_bAudioActive }; this._onExit = function() { C.show() }; this._onConfirmExit = function() { s_oGame.onExit(); $(s_oMain).trigger("end_level", 1); $(s_oMain).trigger("end_session"); $(s_oMain).trigger("show_interlevel_ad") }; this.resetFullscreenBut = function() { P && screenfull.isEnabled && K.setActive(s_bFullscreen) }; this._onFullscreenRelease = function() { s_bFullscreen ? E.call(window.document) : P.call(window.document.documentElement); sizeHandler() }; s_oInterface = this; this._init(); return this } var s_oInterface = null; function CHelpPanel() { var a, e, b, d, c, f, g, h; this._init = function() { var k = this; c = new createjs.Container; c.alpha = 0; s_oStage.addChild(c); a = createBitmap(s_oSpriteLibrary.getSprite("bg_help")); c.addChild(a); var n = 400, v = 60, r = CANVAS_WIDTH / 2, A = CANVAS_HEIGHT / 2 - 170; (new CTLText(c, r - n / 2, A - v / 2, n, v, 20, "center", "#fff", PRIMARY_FONT, 1.2, 2, 2, TEXT_HELP1, !0, !0, !0, !1)).setShadow("#000000", 2, 2, 3); r = CANVAS_WIDTH / 2 - 180; A = CANVAS_HEIGHT / 2; n = 300; v = 90; (new CTLText(c, r - n / 2, A - v / 2, n, v, 20, "center", "#fff", PRIMARY_FONT, 1.2, 2, 2, TEXT_HELP2, !0, !0, !0, !1)).setShadow("#000000", 2, 2, 3); r = CANVAS_WIDTH / 2; A = CANVAS_HEIGHT / 2 + 140; n = 500; v = 90; (new CTLText(c, r - n / 2, A - v / 2, n, v, 20, "center", "#fff", PRIMARY_FONT, 1.2, 2, 2, TEXT_HELP3, !0, !0, !0, !1)).setShadow("#000000", 2, 2, 3); createjs.Tween.get(c).to({ alpha: 1 }, 700).call(function() { s_oGame.pauseGame() }); g = c.on("pressup", function() { k._onExitHelp() }); f = new createjs.Container; f.visible = 0; s_oStage.addChild(f); e = createBitmap(s_oSpriteLibrary.getSprite("msg_box")); f.addChild(e); n = 400; v = 50; r = CANVAS_WIDTH / 2; A = CANVAS_HEIGHT / 2 - 190; (new CTLText(f, r - n / 2, A - v / 2, n, v, 40, "center", "#fff", PRIMARY_FONT, 1, 2, 2, TEXT_HELP1_PAGE2, !0, !0, !1, !1)).setShadow("#000000", 2, 2, 3); v = 80; r = CANVAS_WIDTH / 2 - 328; A = CANVAS_HEIGHT / 2 - 50; (new CTLText(f, r, A - v / 2, 600, v, 28, "left", "#fff", PRIMARY_FONT, 1.2, 2, 2, sprintf(TEXT_HELP2_PAGE2, POINTS_TO_WIN), !0, !0, !0, !1)).setShadow("#000000", 2, 2, 3); v = 80; r = CANVAS_WIDTH / 2 - 328; A = CANVAS_HEIGHT / 2 + 80; (new CTLText(f, r, A - v / 2, 600, v, 28, "left", "#fff", PRIMARY_FONT, 1.2, 2, 2, sprintf(TEXT_LOSE1_PAGE2, POINTS_TO_LOSE), !0, !0, !0, !1)).setShadow("#000000", 2, 2, 3); h = f.on("pressup", function() { k._onExitHelp() }); createjs.Tween.get(f).to({ alpha: 1 }, 700); b = createBitmap(s_oSpriteLibrary.getSprite("arrow")); b.x = 1202; b.y = 564; b.alpha = 0; b.on("click", k._changePageTo2); s_oStage.addChild(b); d = createBitmap(s_oSpriteLibrary.getSprite("arrow")); d.scaleX = -1; d.x = 392; d.y = 564; d.visible = !1; d.on("click", k._changePageTo1); s_oStage.addChild(d); createjs.Tween.get(b).to({ alpha: 1 }, 700) }; this.unload = function() { s_oStage.removeChild(c, f, b, d); c.off("pressup", g); f.off("pressup", h) }; this._changePageTo1 = function() { f.visible = !1; d.visible = !1; c.visible = !0; b.visible = !0 }; this._changePageTo2 = function() { c.visible = !1; b.visible = !1; f.visible = !0; d.visible = !0 }; this._onExitHelp = function() { l.unload(); $(s_oMain).trigger("show_interlevel_ad"); s_oGame._onExitHelp() }; var l = this; this._init() } function CCreditsPanel() { var a, e, b, d, c; this._init = function() { a = new createjs.Container; s_oStage.addChild(a); var f = s_oSpriteLibrary.getSprite("msg_box"); d = createBitmap(f); d.regX = f.width / 2; d.regY = f.height / 2; c = d.on("click", this._onLogoButRelease); a.addChild(d); a.x = CANVAS_WIDTH / 2; a.y = CANVAS_HEIGHT / 2; f = 600; var g = 70; new CTLText(a, -(f / 2), -100 - g / 2, f, g, 60, "center", "#fff", PRIMARY_FONT, 1, 2, 2, TEXT_DEVELOPED, !0, !0, !1, !1); f = 600; g = 60; new CTLText(a, -(f / 2), 90 - g / 2, f, g, 44, "center", "#fff", PRIMARY_FONT, 1, 2, 2, "www.codethislab.com", !0, !0, !1, !1); f = s_oSpriteLibrary.getSprite("ctl_logo"); b = createBitmap(f); b.regX = f.width / 2; b.regY = f.height / 2; a.addChild(b); f = s_oSpriteLibrary.getSprite("but_exit"); e = new CGfxButton(320, -190, f, a); e.addEventListener(ON_MOUSE_UP, this.unload, this) }; this.unload = function() { s_oStage.removeChild(void 0); s_oStage.removeChild(a); e.unload(); d.off("click", c) }; this._onLogoButRelease = function() { window.open("http://www.codethislab.com/index.php?&l=en") }; this._init() } function CEndPanel(a) { var e, b, d, c, f, g; this._init = function(h) { b = new createjs.Container; b.alpha = 0; b.visible = !1; e = createBitmap(h); b.addChild(e); d = new createjs.Text("", "60px " + PRIMARY_FONT, "#000"); d.x = CANVAS_WIDTH / 2 + 1; d.y = CANVAS_HEIGHT / 2 - 160; d.textAlign = "center"; b.addChild(d); c = new createjs.Text("", "60px " + PRIMARY_FONT, "#ffffff"); c.x = CANVAS_WIDTH / 2; c.y = CANVAS_HEIGHT / 2 - 162; c.textAlign = "center"; b.addChild(c); f = new CTLText(b, CANVAS_WIDTH / 2 - 325, CANVAS_HEIGHT / 2 + 50 - 75, 650, 150, 38, "center", "#fff", PRIMARY_FONT, 1, 2, 2, " ", !0, !0, !0, !1); f.setShadow("#000", 1, 1, 1); s_oStage.addChild(b) }; this.unload = function() { b.off("mousedown", g) }; this._initListener = function() { g = b.on("mousedown", this._onExit) }; this.show = function(h) { playSound("game_over", 1, !1); d.text = TEXT_WIN; c.text = TEXT_WIN; f.refreshText(TEXT_SCORE + ": " + h); b.visible = !0; var l = this; createjs.Tween.get(b).to({ alpha: 1 }, 500).call(function() { l._initListener() }); $(s_oMain).trigger("save_score", [h, s_iMode]); $(s_oMain).trigger("end_level", 1); $(s_oMain).trigger("share_event", [h]) }; this.changeTitle = function(h) { d.text = h; c.text = h }; this.changeExpl = function(h) { f.refreshText(h) }; this._onExit = function() { $(s_oMain).trigger("show_interlevel_ad"); $(s_oMain).trigger("end_session", 1); b.off("mousedown", g); s_oStage.removeChild(b); s_oGame.onExit() }; this._init(a); return this } function CCard(a, e, b, d, c, f) { var g = !1, h, l, k, n, v, r, A, x, G, B, O, u; this._init = function(I, F, D, K, C, P) { O = D; k = K; n = C; v = P; h = !1; l = 0 === v || 2 === v ? "red" : "black"; B = new createjs.Container; B.x = I; B.y = F; O.addChild(B); I = []; F = {}; for (K = D = 0; 4 > K; K++) for (C = 1; 14 > C; C++) I.push(s_oSpriteLibrary.getSprite("card_" + K + "_" + C)), F["card_" + K + "_" + C] = D, D++; F.back = 52; I.push(s_oSpriteLibrary.getSprite("card_back")); I = new createjs.SpriteSheet({ images: I, frames: { width: CARD_WIDTH, height: CARD_HEIGHT, regX: CARD_WIDTH / 2, regY: CARD_HEIGHT / 2 }, animations: F }); x = createSprite(I, "back", 0, 0, CARD_WIDTH, CARD_HEIGHT); x.stop(); B.addChild(x); G = new createjs.Shape; G.graphics.beginFill("rgba(255,255,255,0.01)").drawRect(-CARD_WIDTH / 2, -CARD_HEIGHT / 2, CARD_WIDTH, CARD_HEIGHT); u = G.on("mousedown", this._mouseDown); B.addChild(G); s_bMobile || (G.cursor = "pointer"); r = []; A = [] }; this.unload = function() { G.off("mousedown", u); O.removeChild(B) }; this.saveInfo = function() { return { szFotogram: k, iRank: n, iSuit: v, bValue: !0 } }; this.changeInfo = function(I, F, D) { k = I; n = F; v = D }; this.instantShow = function() { x.gotoAndStop(k) }; this.setValue = function(I) { x.gotoAndStop(k); playSound("card", 1, !1); createjs.Tween.get(B).to({ scaleX: 1 }, 200) }; this.setActive = function(I) { I ? B.addChild(G) : B.removeChild(G) }; this.setVisible = function(I) { B.visible = !0 === I ? !0 : !1 }; this.moveCard = function(I, F, D, K) { createjs.Tween.get(B).wait(K).to({ x: I, y: F }, D, createjs.Ease.linear).call(function() { M.setPlaced() }) }; this.moveDeckCard = function(I, F, D, K) { createjs.Tween.get(B).wait(K).to({ x: I, y: F }, D, createjs.Ease.linear).call(function() { s_oGame.activeDeck(); M.showCard() }) }; this.moveToSuit = function(I, F, D) { createjs.Tween.get(B).wait(D).to({ x: I, y: F }, 200, createjs.Ease.cubicOut).call(function() { s_oGame.stackInSuit(M) }) }; this.setPlaced = function() { g = !0; s_oGame.scaleDepth(this.getSprite()) }; this.stackInPlace = function(I, F, D) { createjs.Tween.get(B).to({ x: I, y: F }, D, createjs.Ease.cubicOut).call(function() { h = !0 }) }; this.stackAndDeactive = function(I, F, D) { createjs.Tween.get(B).to({ x: I, y: F }, D, createjs.Ease.cubicOut) }; this._mouseDown = function(I) { !1 !== h && (O.getChildIndex(B), s_oGame.pickCard(M, I)) }; this.getPlaced = function() { return g }; this.showCard = function() { var I = this; createjs.Tween.get(B).to({ scaleX: .1 }, 200).call(function() { I.setValue() }).call(function() { h = !0 }) }; this.hideCard = function() { var I = this; createjs.Tween.get(B).to({ scaleX: .1 }, 200).call(function() { I.setBack() }) }; this.setPos = function(I, F) { B.x = I; B.y = F }; this.setBack = function() { h = !1; x.gotoAndStop("back"); var I = this; createjs.Tween.get(B).to({ scaleX: 1 }, 200).call(function() { I.cardHidden() }) }; this.cardHidden = function() { r[ON_CARD_HIDE] && r[ON_CARD_HIDE].call(A[ON_CARD_HIDE], this) }; this.getRank = function() { return n }; this.getSuit = function() { return v }; this.getColor = function() { return l }; this.getFotogram = function() { return k }; this.getPos = function() { return { x: B.x, y: B.y } }; this.getSprite = function() { return B }; this.getLogicRect = function() { return new createjs.Rectangle(B.x - CARD_WIDTH / 2, B.y - CARD_HEIGHT / 2, CARD_WIDTH, CARD_HEIGHT) }; var M = this; this._init(a, e, b, d, c, f) } function CScore() { this.showScore = function(a, e) { var b = new createjs.Text("+" + e, "26px " + PRIMARY_FONT, "#000000"); b.x = a.x; b.y = a.y; b.scaleX = 2; b.scaleY = 2; b.textAlign = "right"; b.textBaseline = "alphabetic"; b.outline = 4; s_oStage.addChild(b); var d = new createjs.Text("+" + e, "26px " + PRIMARY_FONT, "#fff"); d.x = a.x; d.y = a.y; d.scaleX = 2; d.scaleY = 2; d.textAlign = "right"; d.textBaseline = "alphabetic"; s_oStage.addChild(d); s_oGame.updateScore(e); createjs.Tween.get(d).to({ x: 425, y: 109 }, 1E3, createjs.Ease.cubicIn).call(function() { s_oGame.updateVisualScore(e); s_oStage.removeChild(d) }); createjs.Tween.get(d).to({ scaleX: 1, scaleY: 1 }, 1E3, createjs.Ease.linear); createjs.Tween.get(b).to({ x: 425, y: 109 }, 1E3, createjs.Ease.cubicIn).call(function() { s_oStage.removeChild(b) }); createjs.Tween.get(b).to({ scaleX: 1, scaleY: 1 }, 1E3, createjs.Ease.linear) }; this.removeScore = function(a, e) { var b = new createjs.Text(a, "25px " + PRIMARY_FONT, "#ffffff"); b.x = 428; b.y = 109; b.alpha = 0; b.textAlign = "right"; b.textBaseline = "alphabetic"; b.lineWidth = 200; s_oStage.addChild(b); createjs.Tween.get(b).to({ alpha: 1 }, e, createjs.Ease.linear).call(function() { s_oStage.removeChild(b) }) }; this.displayMoves = function(a, e) { var b = new createjs.Text(a, "25px " + PRIMARY_FONT, "#ffffff"); b.x = 615; b.y = 109; b.alpha = 0; b.textAlign = "right"; b.textBaseline = "alphabetic"; b.lineWidth = 200; s_oStage.addChild(b); createjs.Tween.get(b).to({ alpha: 1 }, e, createjs.Ease.linear).call(function() { s_oStage.removeChild(b) }) } } function CAreYouSurePanel(a) { var e, b, d, c, f, g, h, l, k, n, v = this; this._init = function() { b = []; d = []; l = new createjs.Container; l.visible = !1; r.addChild(l); k = new createjs.Shape; k.graphics.beginFill("black").drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT); k.alpha = .7; c = k.on("click", function() {}); l.addChild(k); n = new createjs.Container; l.addChild(n); var A = s_oSpriteLibrary.getSprite("msg_box"); f = createBitmap(A); f.regX = .5 * A.width; f.regY = .5 * A.height; n.addChild(f); n.x = CANVAS_WIDTH / 2; n.y = e = CANVAS_HEIGHT / 2; new CTLText(n, -300, -140, 600, 80, 70, "center", "#fff", PRIMARY_FONT, 1, 2, 2, TEXT_ARE_YOU_SURE, !0, !0, !1, !1); g = new CGfxButton(100, 100, s_oSpriteLibrary.getSprite("but_yes"), n); g.addEventListener(ON_MOUSE_UP, this._onButYes, this); h = new CGfxButton(-100, 100, s_oSpriteLibrary.getSprite("but_no"), n); h.addEventListener(ON_MOUSE_UP, this._onButNo, this); h.pulseAnimation() }; this.addEventListener = function(A, x, G) { b[A] = x; d[A] = G }; this.show = function() { n.y = e; l.visible = !0 }; this.hide = function() { l.visible = !1 }; this.unload = function() { h.unload(); g.unload(); k.off("click", c) }; this._onButYes = function() { v.hide(); b[ON_BUT_YES_DOWN] && b[ON_BUT_YES_DOWN].call(d[ON_BUT_YES_DOWN]) }; this._onButNo = function() { v.hide() }; var r = a; this._init() } 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, e, b, d) { null !== this._oText && (this._oText.shadow = new createjs.Shadow(a, e, b, d)) }, setColor: function(a) { this._oText.color = a }, setAlpha: function(a) { this._oText.alpha = a }, setY: function(a) { this._y = this._oText.y = 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, e, b, d, c, f, g, h, l, k, n, v, r, A, x, G, B) { this._oContainer = a; this._x = e; this._y = b; this._iWidth = d; this._iHeight = c; this._bMultiline = G; this._iFontSize = f; this._szAlign = g; this._szColor = h; this._szFont = l; this._iPaddingH = n; this._iPaddingV = v; this._bVerticalAlign = x; this._bFitText = A; this._bDebug = B; this._oDebugShape = null; this._fLineHeightFactor = k; this._oText = null; r && this.__createText(r) }! function() { function a(c) { var f = c; if (d[f]) f = d[f]; else { for (var g = f, h, l = [], k = 0; g;) { if (null !== (h = b.text.exec(g))) l.push(h[0]); else if (null !== (h = b.modulo.exec(g))) l.push("%"); else if (null !== (h = b.placeholder.exec(g))) { if (h[2]) { k |= 1; var n = [], v = h[2], r; if (null !== (r = b.key.exec(v))) for (n.push(r[1]); "" !== (v = v.substring(r[0].length));) if (null !== (r = b.key_access.exec(v))) n.push(r[1]); else if (null !== (r = b.index_access.exec(v))) n.push(r[1]); else throw new SyntaxError("[sprintf] failed to parse named argument key"); else throw new SyntaxError("[sprintf] failed to parse named argument key"); h[2] = n } else k |= 2; if (3 === k) throw Error("[sprintf] mixing positional and named placeholders is not (yet) supported"); l.push({ placeholder: h[0], param_no: h[1], keys: h[2], sign: h[3], pad_char: h[4], align: h[5], width: h[6], precision: h[7], type: h[8] }) } else throw new SyntaxError("[sprintf] unexpected placeholder"); g = g.substring(h[0].length) } f = d[f] = l } g = arguments; h = 1; l = f.length; n = ""; var A, x; for (v = 0; v < l; v++) if ("string" === typeof f[v]) n += f[v]; else if ("object" === typeof f[v]) { r = f[v]; if (r.keys) for (k = g[h], A = 0; A < r.keys.length; A++) { if (void 0 == k) throw Error(a('[sprintf] Cannot access property "%s" of undefined value "%s"', r.keys[A], r.keys[A - 1])); k = k[r.keys[A]] } else k = r.param_no ? g[r.param_no] : g[h++]; b.not_type.test(r.type) && b.not_primitive.test(r.type) && k instanceof Function && (k = k()); if (b.numeric_arg.test(r.type) && "number" !== typeof k && isNaN(k)) throw new TypeError(a("[sprintf] expecting number but found %T", k)); b.number.test(r.type) && (x = 0 <= k); switch (r.type) { case "b": k = parseInt(k, 10).toString(2); break; case "c": k = String.fromCharCode(parseInt(k, 10)); break; case "d": case "i": k = parseInt(k, 10); break; case "j": k = JSON.stringify(k, null, r.width ? parseInt(r.width) : 0); break; case "e": k = r.precision ? parseFloat(k).toExponential(r.precision) : parseFloat(k).toExponential(); break; case "f": k = r.precision ? parseFloat(k).toFixed(r.precision) : parseFloat(k); break; case "g": k = r.precision ? String(Number(k.toPrecision(r.precision))) : parseFloat(k); break; case "o": k = (parseInt(k, 10) >>> 0).toString(8); break; case "s": k = String(k); k = r.precision ? k.substring(0, r.precision) : k; break; case "t": k = String(!!k); k = r.precision ? k.substring(0, r.precision) : k; break; case "T": k = Object.prototype.toString.call(k).slice(8, -1).toLowerCase(); k = r.precision ? k.substring(0, r.precision) : k; break; case "u": k = parseInt(k, 10) >>> 0; break; case "v": k = k.valueOf(); k = r.precision ? k.substring(0, r.precision) : k; break; case "x": k = (parseInt(k, 10) >>> 0).toString(16); break; case "X": k = (parseInt(k, 10) >>> 0).toString(16).toUpperCase() } if (b.json.test(r.type)) n += k; else { if (!b.number.test(r.type) || x && !r.sign) var G = ""; else G = x ? "+" : "-", k = k.toString().replace(b.sign, ""); A = r.pad_char ? "0" === r.pad_char ? "0" : r.pad_char.charAt(1) : " "; var B = r.width - (G + k).length; B = r.width ? 0 < B ? A.repeat(B) : "" : ""; n += r.align ? G + k + B : "0" === A ? G + B + k : B + G + k } } return n } function e(c, f) { return a.apply(null, [c].concat(f || [])) } var b = { not_string: /[^s]/, not_bool: /[^t]/, not_type: /[^T]/, not_primitive: /[^v]/, number: /[diefg]/, numeric_arg: /[bcdiefguxX]/, json: /[j]/, not_json: /[^j]/, text: /^[^\x25]+/, modulo: /^\x25{2}/, placeholder: /^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/, key: /^([a-z_][a-z_\d]*)/i, key_access: /^\.([a-z_][a-z_\d]*)/i, index_access: /^\[(\d+)\]/, sign: /^[+-]/ }, d = Object.create(null); "undefined" !== typeof exports && (exports.sprintf = a, exports.vsprintf = e); "undefined" !== typeof window && (window.sprintf = a, window.vsprintf = e, "function" === typeof define && define.amd && define(function() { return { sprintf: a, vsprintf: e } })) }(); 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 e = a.split("."), b = e.length; 2 < b && (a = e[b - 2] + "." + e[b - 1]); return a } var getClosestTop = function() { var a = window, e = !1; try { for (; a.parent.document !== a.document;) if (a.parent.document) a = a.parent; else { e = !0; break } } catch (b) { e = !0 } return { topFrame: a, err: e } }, getBestPageUrl = function(a) { var e = a.topFrame, b = ""; if (a.err) try { try { b = window.top.location.href } catch (c) { var d = window.location.ancestorOrigins; b = d[d.length - 1] } } catch (c) { b = e.document.referrer } else b = e.location.href; return b }, TOPFRAMEOBJ = getClosestTop(), PAGE_URL = getBestPageUrl(TOPFRAMEOBJ); function seekAndDestroy() { for (var a = extractRootDomain(PAGE_URL), e = [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 < e.length; b++) if (e[b] === a) return !0; return !1 };
| ver. 1.4 |
Github
|
.
| PHP 8.2.29 | Генераци� �траницы: 0 |
proxy
|
phpinfo
|
�а�тройка