var liveViewLabel='Live View',formCodeLabel='Have you got a code? Enter it here',formNameLabel='Name',formEmailAddressLabel='Email Address',formTelephoneLabel='Telephone',personalVideoLabel='Personal Video',formNotesLabel='What would you like to see?',submitLabel='Submit',cancelLabel='Cancel',commentsLabel='Comments',closeLabel='Close',requiredFieldLabel='Required Field',loadingImagesLabel='Loading Images',krte='',liveViewCSS='https://player.aos.tv/css/liveView.css',threeSixtyCSS='https://player.aos.tv/css/threeSixty.css',logScript='https://player.aos.tv/log.php',playerDomain='https://player.aos.tv',pageProtocol='https://https';function createMethod(a) { return function () { throw new Error('The "' + a + "\" method is not available on the playback technology's API") } } function playList(a, b) { var c = this; c.pl = c.pl || {}; var d = parseInt(a, 10); return c.pl._guessVideoType = function (a) { var b = { webm: "video/webm", mp4: "video/mp4", ogv: "video/ogg" }, c = a.split(".").pop().split("?").shift(); return b[c] || "" }, c.pl.init = function (a, b) { b = b || {}, c.pl.videos = [], c.pl.current = 0, c.on("ended", c.pl._videoEnd), b.getVideoSource && (c.pl.getVideoSource = b.getVideoSource), c.pl._addVideos(a) }, c.pl._updatePoster = function (a) { c.poster(a), c.removeChild(c.posterImage), c.posterImage = c.addChild("posterImage") }, c.pl._addVideos = function (a) { for (var b = 0, d = a.length; d > b; b++) { for (var e = [], f = 0, g = a[b].src.length; g > f; f++) e.push({ type: c.pl._guessVideoType(a[b].src[f]), src: a[b].src[f] }); a[b].src = e, c.pl.videos.push(a[b]) } }, c.pl._nextPrev = function (a) { var b, d; if ("next" === a ? (b = c.pl.videos.length - 1, d = 1) : (b = 0, d = -1), c.pl.current !== b) { var e = c.pl.current + d; c.pl._setVideo(e), c.trigger(a, [c.pl.videos[e]]) } }, c.pl._setVideo = function (a) { a < c.pl.videos.length && (c.pl.current = a, c.pl.currentVideo = c.pl.videos[a], c.paused() || c.pl._resumeVideo(), c.pl.getVideoSource ? c.pl.getVideoSource(c.pl.videos[a], function (a, b) { c.pl._setVideoSource(a, b) }) : c.pl._setVideoSource(c.pl.videos[a].src, c.pl.videos[a].poster)), c.liveContent.setEnabled && c.liveContent.setEnabled(c.pl.videos[a].lc) }, c.pl._setVideoSource = function (a, b) { c.src(a), c.pl._updatePoster(b) }, c.pl._resumeVideo = function () { c.one("loadstart", function () { c.play() }) }, c.pl._videoEnd = function () { c.pl.current === c.pl.videos.length - 1 ? c.trigger("lastVideoEnded") : (c.pl._resumeVideo(), c.next()) }, a instanceof Array ? (c.pl.init(a, b), c.pl._setVideo(0), c) : d === d ? (c.pl._setVideo(d), c) : "string" == typeof a && "undefined" != typeof c.pl[a] ? (c.pl[a].apply(c), c) : void 0 } function onresizeFunc(a, b) { b.css({ "margin-top": 0, top: "0px", left: "0px" }), losjqisafe("#colors_ctrls").css({ top: a.offset().top + a.height - 50, left: a.offset().left }) } function preload(a) { if ("undefined" != typeof document.body) try { var b = document.createElement("div"); b.className = "preloadDiv"; var c = b.style; c.position = "absolute", c.top = c.left = 0, c.visibility = "hidden", document.body.appendChild(b), b.innerHTML = '' } catch (a) {} } var jqueryloaded = !1; if ("undefined" != typeof jQuery) { var jQueryCurrent = jQuery.noConflict(); jqueryloaded = !0 } !function (a, b) { function c(a) { return K.isWindow(a) ? a : 9 === a.nodeType && (a.defaultView || a.parentWindow) } function d(a) { if (!sb[a]) { var b = H.body, c = K("<" + a + ">").appendTo(b), d = c.css("display"); c.remove(), ("none" === d || "" === d) && (ob || (ob = H.createElement("iframe"), ob.frameBorder = ob.width = ob.height = 0), b.appendChild(ob), pb && ob.createElement || (pb = (ob.contentWindow || ob.contentDocument).document, pb.write(("CSS1Compat" === H.compatMode ? "" : "") + ""), pb.close()), c = pb.createElement(a), pb.body.appendChild(c), d = K.css(c, "display"), b.removeChild(ob)), sb[a] = d } return sb[a] } function e(a, b) { var c = {}; return K.each(vb.concat.apply([], vb.slice(0, b)), function () { c[this] = a }), c } function f() { rb = b } function g() { return setTimeout(f, 0), rb = K.now() } function h() { try { return new a.ActiveXObject("Microsoft.XMLHTTP") } catch (a) {} } function i() { try { return new a.XMLHttpRequest } catch (a) {} } function j(a, c) { a.dataFilter && (c = a.dataFilter(c, a.dataType)); var d, e, f, g, h, i, j, k, l = a.dataTypes, m = {}, n = l.length, o = l[0]; for (d = 1; n > d; d++) { if (1 === d) for (e in a.converters) "string" == typeof e && (m[e.toLowerCase()] = a.converters[e]); if (g = o, o = l[d], "*" === o) o = g; else if ("*" !== g && g !== o) { if (h = g + " " + o, i = m[h] || m["* " + o], !i) { k = b; for (j in m) if (f = j.split(" "), (f[0] === g || "*" === f[0]) && (k = m[f[1] + " " + o])) { j = m[j], j === !0 ? i = k : k === !0 && (i = j); break } } !i && !k && K.error("No conversion from " + h.replace(" ", " to ")), i !== !0 && (c = i ? i(c) : k(j(c))) } } return c } function k(a, c, d) { var e, f, g, h, i = a.contents, j = a.dataTypes, k = a.responseFields; for (f in k) f in d && (c[k[f]] = d[f]); for (; "*" === j[0]; ) j.shift(), e === b && (e = a.mimeType || c.getResponseHeader("content-type")); if (e) for (f in i) if (i[f] && i[f].test(e)) { j.unshift(f); break } if (j[0]in d) g = j[0]; else { for (f in d) { if (!j[0] || a.converters[f + " " + j[0]]) { g = f; break } h || (h = f) } g = g || h } return g ? (g !== j[0] && j.unshift(g), d[g]) : void 0 } function l(a, b, c, d) { if (K.isArray(b)) K.each(b, function (b, e) { c || Ta.test(a) ? d(a, e) : l(a + "[" + ("object" == typeof e || K.isArray(e) ? b : "") + "]", e, c, d) }); else if (c || null == b || "object" != typeof b) d(a, b); else for (var e in b) l(a + "[" + e + "]", b[e], c, d) } function m(a, c) { var d, e, f = K.ajaxSettings.flatOptions || {}; for (d in c) c[d] !== b && ((f[d] ? a : e || (e = {}))[d] = c[d]); e && K.extend(!0, a, e) } function n(a, c, d, e, f, g) { f = f || c.dataTypes[0], g = g || {}, g[f] = !0; for (var h, i = a[f], j = 0, k = i ? i.length : 0, l = a === gb; k > j && (l || !h); j++) h = i[j](c, d, e), "string" == typeof h && (!l || g[h] ? h = b : (c.dataTypes.unshift(h), h = n(a, c, d, e, h, g))); return (l || !h) && !g["*"] && (h = n(a, c, d, e, "*", g)), h } function o(a) { return function (b, c) { if ("string" != typeof b && (c = b, b = "*"), K.isFunction(c)) for (var d, e, f, g = b.toLowerCase().split(cb), h = 0, i = g.length; i > h; h++) d = g[h], f = /^\+/.test(d), f && (d = d.substr(1) || "*"), e = a[d] = a[d] || [], e[f ? "unshift" : "push"](c) } } function p(a, b, c) { var d = "width" === b ? a.offsetWidth : a.offsetHeight, e = "width" === b ? Oa : Pa, f = 0, g = e.length; if (d > 0) { if ("border" !== c) for (; g > f; f++) c || (d -= parseFloat(K.css(a, "padding" + e[f])) || 0), "margin" === c ? d += parseFloat(K.css(a, c + e[f])) || 0 : d -= parseFloat(K.css(a, "border" + e[f] + "Width")) || 0; return d + "px" } if (d = Ea(a, b, b), (0 > d || null == d) && (d = a.style[b] || 0), d = parseFloat(d) || 0, c) for (; g > f; f++) d += parseFloat(K.css(a, "padding" + e[f])) || 0, "padding" !== c && (d += parseFloat(K.css(a, "border" + e[f] + "Width")) || 0), "margin" === c && (d += parseFloat(K.css(a, c + e[f])) || 0); return d + "px" } function q(a, b) { b.src ? K.ajax({ url: b.src, async: !1, dataType: "script" }) : K.globalEval((b.text || b.textContent || b.innerHTML || "").replace(Ba, "/*$0*/")), b.parentNode && b.parentNode.removeChild(b) } function r(a) { var b = H.createElement("div"); return Da.appendChild(b), b.innerHTML = a.outerHTML, b.firstChild } function s(a) { var b = (a.nodeName || "").toLowerCase(); "input" === b ? t(a) : "script" !== b && "undefined" != typeof a.getElementsByTagName && K.grep(a.getElementsByTagName("input"), t) } function t(a) { ("checkbox" === a.type || "radio" === a.type) && (a.defaultChecked = a.checked) } function u(a) { return "undefined" != typeof a.getElementsByTagName ? a.getElementsByTagName("*") : "undefined" != typeof a.querySelectorAll ? a.querySelectorAll("*") : [] } function v(a, b) { var c; 1 === b.nodeType && (b.clearAttributes && b.clearAttributes(), b.mergeAttributes && b.mergeAttributes(a), c = b.nodeName.toLowerCase(), "object" === c ? b.outerHTML = a.outerHTML : "input" !== c || "checkbox" !== a.type && "radio" !== a.type ? "option" === c ? b.selected = a.defaultSelected : ("input" === c || "textarea" === c) && (b.defaultValue = a.defaultValue) : (a.checked && (b.defaultChecked = b.checked = a.checked), b.value !== a.value && (b.value = a.value)), b.removeAttribute(K.expando)) } function w(a, b) { if (1 === b.nodeType && K.hasData(a)) { var c, d, e, f = K._data(a), g = K._data(b, f), h = f.events; if (h) { delete g.handle, g.events = {}; for (c in h) for (d = 0, e = h[c].length; e > d; d++) K.event.add(b, c + (h[c][d].namespace ? "." : "") + h[c][d].namespace, h[c][d], h[c][d].data) } g.data && (g.data = K.extend({}, g.data)) } } function x(a) { return K.nodeName(a, "table") ? a.getElementsByTagName("tbody")[0] || a.appendChild(a.ownerDocument.createElement("tbody")) : a } function y(a) { var b = pa.split("|"), c = a.createDocumentFragment(); if (c.createElement) for (; b.length; ) c.createElement(b.pop()); return c } function z(a, b, c) { if (b = b || 0, K.isFunction(b)) return K.grep(a, function (a, d) { var e = !!b.call(a, d, a); return e === c }); if (b.nodeType) return K.grep(a, function (a) { return a === b === c }); if ("string" == typeof b) { var d = K.grep(a, function (a) { return 1 === a.nodeType }); if (la.test(b)) return K.filter(b, d, !c); b = K.filter(b, d) } return K.grep(a, function (a) { return K.inArray(a, b) >= 0 === c }) } function A(a) { return !a || !a.parentNode || 11 === a.parentNode.nodeType } function B() { return !0 } function C() { return !1 } function D(a, b, c) { var d = b + "defer", e = b + "queue", f = b + "mark", g = K._data(a, d); g && ("queue" === c || !K._data(a, e)) && ("mark" === c || !K._data(a, f)) && setTimeout(function () { !K._data(a, e) && !K._data(a, f) && (K.removeData(a, d, !0), g.fire()) }, 0) } function E(a) { for (var b in a) if (("data" !== b || !K.isEmptyObject(a[b])) && "toJSON" !== b) return !1; return !0 } function F(a, c, d) { if (d === b && 1 === a.nodeType) { var e = "data-" + c.replace(O, "-$1").toLowerCase(); if (d = a.getAttribute(e), "string" == typeof d) { try { d = "true" === d || "false" !== d && ("null" === d ? null : K.isNumeric(d) ? parseFloat(d) : N.test(d) ? K.parseJSON(d) : d) } catch (a) {} K.data(a, c, d) } else d = b } return d } function G(a) { var b, c, d = L[a] = {}; for (a = a.split(/\s+/), b = 0, c = a.length; c > b; b++) d[a[b]] = !0; return d } var H = a.document, I = a.navigator, J = a.location, K = function () { function c() { if (!h.isReady) { try { H.documentElement.doScroll("left") } catch (a) { return void setTimeout(c, 1) } h.ready() } } var d, e, f, g, h = function (a, b) { return new h.fn.init(a, b, d) }, i = a.jQuery, j = a.$, k = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/, l = /\S/, m = /^\s+/, n = /\s+$/, o = /^<(\w+)\s*\/?>(?:<\/\1>)?$/, p = /^[\],:{}\s]*$/, q = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, r = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, s = /(?:^|:|,)(?:\s*\[)+/g, t = /(webkit)[ \/]([\w.]+)/, u = /(opera)(?:.*version)?[ \/]([\w.]+)/, v = /(msie) ([\w.]+)/, w = /(mozilla)(?:.*? rv:([\w.]+))?/, x = /-([a-z]|[0-9])/gi, y = /^-ms-/, z = function (a, b) { return (b + "").toUpperCase() }, A = I.userAgent, B = Object.prototype.toString, C = Object.prototype.hasOwnProperty, D = Array.prototype.push, E = Array.prototype.slice, F = String.prototype.trim, G = Array.prototype.indexOf, J = {}; return h.fn = h.prototype = { constructor: h, init: function (a, c, d) { var e, f, g, i; if (!a) return this; if (a.nodeType) return this.context = this[0] = a, this.length = 1, this; if ("body" === a && !c && H.body) return this.context = H, this[0] = H.body, this.selector = a, this.length = 1, this; if ("string" == typeof a) { if (e = "<" !== a.charAt(0) || ">" !== a.charAt(a.length - 1) || a.length < 3 ? k.exec(a) : [null, a, null], e && (e[1] || !c)) { if (e[1]) return c = c instanceof h ? c[0] : c, i = c ? c.ownerDocument || c : H, g = o.exec(a), g ? h.isPlainObject(c) ? (a = [H.createElement(g[1])], h.fn.attr.call(a, c, !0)) : a = [i.createElement(g[1])] : (g = h.buildFragment([e[1]], [i]), a = (g.cacheable ? h.clone(g.fragment) : g.fragment).childNodes), h.merge(this, a); if (f = H.getElementById(e[2]), f && f.parentNode) { if (f.id !== e[2]) return d.find(a); this.length = 1, this[0] = f } return this.context = H, this.selector = a, this } return !c || c.jquery ? (c || d).find(a) : this.constructor(c).find(a) } return h.isFunction(a) ? d.ready(a) : (a.selector !== b && (this.selector = a.selector, this.context = a.context), h.makeArray(a, this)) }, selector: "", jquery: "1.7.1", length: 0, size: function () { return this.length }, toArray: function () { return E.call(this, 0) }, get: function (a) { return null == a ? this.toArray() : 0 > a ? this[this.length + a] : this[a] }, pushStack: function (a, b, c) { var d = this.constructor(); return h.isArray(a) ? D.apply(d, a) : h.merge(d, a), d.prevObject = this, d.context = this.context, "find" === b ? d.selector = this.selector + (this.selector ? " " : "") + c : b && (d.selector = this.selector + "." + b + "(" + c + ")"), d }, each: function (a, b) { return h.each(this, a, b) }, ready: function (a) { return h.bindReady(), f.add(a), this }, eq: function (a) { return a = +a, -1 === a ? this.slice(a) : this.slice(a, a + 1) }, first: function () { return this.eq(0) }, last: function () { return this.eq(-1) }, slice: function () { return this.pushStack(E.apply(this, arguments), "slice", E.call(arguments).join(",")) }, map: function (a) { return this.pushStack(h.map(this, function (b, c) { return a.call(b, c, b) })) }, end: function () { return this.prevObject || this.constructor(null) }, push: D, sort: [].sort, splice: [].splice }, h.fn.init.prototype = h.fn, h.extend = h.fn.extend = function () { var a, c, d, e, f, g, i = arguments[0] || {}, j = 1, k = arguments.length, l = !1; for ("boolean" == typeof i && (l = i, i = arguments[1] || {}, j = 2), "object" != typeof i && !h.isFunction(i) && (i = {}), k === j && (i = this, --j); k > j; j++) if (null != (a = arguments[j])) for (c in a) d = i[c], e = a[c], i !== e && (l && e && (h.isPlainObject(e) || (f = h.isArray(e))) ? (f ? (f = !1, g = d && h.isArray(d) ? d : []) : g = d && h.isPlainObject(d) ? d : {}, i[c] = h.extend(l, g, e)) : e !== b && (i[c] = e)); return i }, h.extend({ noConflict: function (b) { return a.$ === h && (a.$ = j), b && a.jQuery === h && (a.jQuery = i), h }, isReady: !1, readyWait: 1, holdReady: function (a) { a ? h.readyWait++ : h.ready(!0) }, ready: function (a) { if (a === !0 && !--h.readyWait || a !== !0 && !h.isReady) { if (!H.body) return setTimeout(h.ready, 1); if (h.isReady = !0, a !== !0 && --h.readyWait > 0) return; f.fireWith(H, [h]), h.fn.trigger && h(H).trigger("ready").off("ready") } }, bindReady: function () { if (!f) { if (f = h.Callbacks("once memory"), "complete" === H.readyState) return setTimeout(h.ready, 1); if (H.addEventListener) H.addEventListener("DOMContentLoaded", g, !1), a.addEventListener("load", h.ready, !1); else if (H.attachEvent) { H.attachEvent("onreadystatechange", g), a.attachEvent("onload", h.ready); var b = !1; try { b = null == a.frameElement } catch (a) {} H.documentElement.doScroll && b && c() } } }, isFunction: function (a) { return "function" === h.type(a) }, isArray: Array.isArray || function (a) { return "array" === h.type(a) }, isWindow: function (a) { return a && "object" == typeof a && "setInterval" in a }, isNumeric: function (a) { return !isNaN(parseFloat(a)) && isFinite(a) }, type: function (a) { return null == a ? String(a) : J[B.call(a)] || "object" }, isPlainObject: function (a) { if (!a || "object" !== h.type(a) || a.nodeType || h.isWindow(a)) return !1; try { if (a.constructor && !C.call(a, "constructor") && !C.call(a.constructor.prototype, "isPrototypeOf")) return !1 } catch (a) { return !1 } var c; for (c in a); return c === b || C.call(a, c) }, isEmptyObject: function (a) { for (var b in a) return !1; return !0 }, error: function (a) { throw new Error(a) }, parseJSON: function (b) { return "string" == typeof b && b ? (b = h.trim(b), a.JSON && a.JSON.parse ? a.JSON.parse(b) : p.test(b.replace(q, "@").replace(r, "]").replace(s, "")) ? new Function("return " + b)() : void h.error("Invalid JSON: " + b)) : null }, parseXML: function (c) { var d, e; try { a.DOMParser ? (e = new DOMParser, d = e.parseFromString(c, "text/xml")) : (d = new ActiveXObject("Microsoft.XMLDOM"), d.async = "false", d.loadXML(c)) } catch (a) { d = b } return (!d || !d.documentElement || d.getElementsByTagName("parsererror").length) && h.error("Invalid XML: " + c), d }, noop: function () {}, globalEval: function (b) { b && l.test(b) && (a.execScript || function (b) { a.eval.call(a, b) })(b) }, camelCase: function (a) { return a.replace(y, "ms-").replace(x, z) }, nodeName: function (a, b) { return a.nodeName && a.nodeName.toUpperCase() === b.toUpperCase() }, each: function (a, c, d) { var e, f = 0, g = a.length, i = g === b || h.isFunction(a); if (d) if (i) { for (e in a) if (c.apply(a[e], d) === !1) break } else for (; g > f && c.apply(a[f++], d) !== !1; ); else if (i) { for (e in a) if (c.call(a[e], e, a[e]) === !1) break } else for (; g > f && c.call(a[f], f, a[f++]) !== !1; ); return a }, trim: F ? function (a) { return null == a ? "" : F.call(a) } : function (a) { return null == a ? "" : (a + "").replace(m, "").replace(n, "") }, makeArray: function (a, b) { var c = b || []; if (null != a) { var d = h.type(a); null == a.length || "string" === d || "function" === d || "regexp" === d || h.isWindow(a) ? D.call(c, a) : h.merge(c, a) } return c }, inArray: function (a, b, c) { var d; if (b) { if (G) return G.call(b, a, c); for (d = b.length, c = c ? 0 > c ? Math.max(0, d + c) : c : 0; d > c; c++) if (c in b && b[c] === a) return c } return -1 }, merge: function (a, c) { var d = a.length, e = 0; if ("number" == typeof c.length) for (var f = c.length; f > e; e++) a[d++] = c[e]; else for (; c[e] !== b; ) a[d++] = c[e++]; return a.length = d, a }, grep: function (a, b, c) { var d, e = []; c = !!c; for (var f = 0, g = a.length; g > f; f++) d = !!b(a[f], f), c !== d && e.push(a[f]); return e }, map: function (a, c, d) { var e, f, g = [], i = 0, j = a.length, k = a instanceof h || j !== b && "number" == typeof j && (j > 0 && a[0] && a[j - 1] || 0 === j || h.isArray(a)); if (k) for (; j > i; i++) e = c(a[i], i, d), null != e && (g[g.length] = e); else for (f in a) e = c(a[f], f, d), null != e && (g[g.length] = e); return g.concat.apply([], g) }, guid: 1, proxy: function (a, c) { if ("string" == typeof c) { var d = a[c]; c = a, a = d } if (!h.isFunction(a)) return b; var e = E.call(arguments, 2), f = function () { return a.apply(c, e.concat(E.call(arguments))) }; return f.guid = a.guid = a.guid || f.guid || h.guid++, f }, access: function (a, c, d, e, f, g) { var i = a.length; if ("object" == typeof c) { for (var j in c) h.access(a, j, c[j], e, f, d); return a } if (d !== b) { e = !g && e && h.isFunction(d); for (var k = 0; i > k; k++) f(a[k], c, e ? d.call(a[k], k, f(a[k], c)) : d, g); return a } return i ? f(a[0], c) : b }, now: function () { return (new Date).getTime() }, uaMatch: function (a) { a = a.toLowerCase(); var b = t.exec(a) || u.exec(a) || v.exec(a) || a.indexOf("compatible") < 0 && w.exec(a) || []; return { browser: b[1] || "", version: b[2] || "0" } }, sub: function () { function a(b, c) { return new a.fn.init(b, c) } h.extend(!0, a, this), a.superclass = this, a.fn = a.prototype = this(), a.fn.constructor = a, a.sub = this.sub, a.fn.init = function (c, d) { return d && d instanceof h && !(d instanceof a) && (d = a(d)), h.fn.init.call(this, c, d, b) }, a.fn.init.prototype = a.fn; var b = a(H); return a }, browser: {} }), h.each("Boolean Number String Function Array Date RegExp Object".split(" "), function (a, b) { J["[object " + b + "]"] = b.toLowerCase() }), e = h.uaMatch(A), e.browser && (h.browser[e.browser] = !0, h.browser.version = e.version), h.browser.webkit && (h.browser.safari = !0), l.test(" ") && (m = /^[\s\xA0]+/, n = /[\s\xA0]+$/), d = h(H), H.addEventListener ? g = function () { H.removeEventListener("DOMContentLoaded", g, !1), h.ready() } : H.attachEvent && (g = function () { "complete" === H.readyState && (H.detachEvent("onreadystatechange", g), h.ready()) }), h } (), L = {}; K.Callbacks = function (a) { a = a ? L[a] || G(a) : {}; var c, d, e, f, g, h = [], i = [], j = function (b) { var c, d, e, f; for (c = 0, d = b.length; d > c; c++) e = b[c], f = K.type(e), "array" === f ? j(e) : "function" === f && (!a.unique || !l.has(e)) && h.push(e) }, k = function (b, j) { for (j = j || [], c = !a.memory || [b, j], d = !0, g = e || 0, e = 0, f = h.length; h && f > g; g++) if (h[g].apply(b, j) === !1 && a.stopOnFalse) { c = !0; break } d = !1, h && (a.once ? c === !0 ? l.disable() : h = [] : i && i.length && (c = i.shift(), l.fireWith(c[0], c[1]))) }, l = { add: function () { if (h) { var a = h.length; j(arguments), d ? f = h.length : c && c !== !0 && (e = a, k(c[0], c[1])) } return this }, remove: function () { if (h) for (var b = arguments, c = 0, e = b.length; e > c; c++) for (var i = 0; i < h.length && (b[c] !== h[i] || (d && f >= i && (f--, g >= i && g--), h.splice(i--, 1), !a.unique)); i++); return this }, has: function (a) { if (h) for (var b = 0, c = h.length; c > b; b++) if (a === h[b]) return !0; return !1 }, empty: function () { return h = [], this }, disable: function () { return h = i = c = b, this }, disabled: function () { return !h }, lock: function () { return i = b, (!c || c === !0) && l.disable(), this }, locked: function () { return !i }, fireWith: function (b, e) { return i && (d ? a.once || i.push([b, e]) : (!a.once || !c) && k(b, e)), this }, fire: function () { return l.fireWith(this, arguments), this }, fired: function () { return !!c } }; return l }; var M = [].slice; K.extend({ Deferred: function (a) { var b, c = K.Callbacks("once memory"), d = K.Callbacks("once memory"), e = K.Callbacks("memory"), f = "pending", g = { resolve: c, reject: d, notify: e }, h = { done: c.add, fail: d.add, progress: e.add, state: function () { return f }, isResolved: c.fired, isRejected: d.fired, then: function (a, b, c) { return i.done(a).fail(b).progress(c), this }, always: function () { return i.done.apply(i, arguments).fail.apply(i, arguments), this }, pipe: function (a, b, c) { return K.Deferred(function (d) { K.each({ done: [a, "resolve"], fail: [b, "reject"], progress: [c, "notify"] }, function (a, b) { var c, e = b[0], f = b[1]; K.isFunction(e) ? i[a](function () { c = e.apply(this, arguments), c && K.isFunction(c.promise) ? c.promise().then(d.resolve, d.reject, d.notify) : d[f + "With"](this === i ? d : this, [c]) }) : i[a](d[f]) }) }).promise() }, promise: function (a) { if (null == a) a = h; else for (var b in h) a[b] = h[b]; return a } }, i = h.promise({}); for (b in g) i[b] = g[b].fire, i[b + "With"] = g[b].fireWith; return i.done(function () { f = "resolved" }, d.disable, e.lock).fail(function () { f = "rejected" }, c.disable, e.lock), a && a.call(i, i), i }, when: function (a) { function b(a) { return function (b) { g[a] = arguments.length > 1 ? M.call(arguments, 0) : b, i.notifyWith(j, g) } } function c(a) { return function (b) { d[a] = arguments.length > 1 ? M.call(arguments, 0) : b, --h || i.resolveWith(i, d) } } var d = M.call(arguments, 0), e = 0, f = d.length, g = Array(f), h = f, i = 1 >= f && a && K.isFunction(a.promise) ? a : K.Deferred(), j = i.promise(); if (f > 1) { for (; f > e; e++) d[e] && d[e].promise && K.isFunction(d[e].promise) ? d[e].promise().then(c(e), i.reject, b(e)) : --h; h || i.resolveWith(i, d) } else i !== a && i.resolveWith(i, f ? [a] : []); return j } }), K.support = function () { var b, c, d, e, f, g, h, i, j, k, l, m, n = H.createElement("div"); if (H.documentElement, n.setAttribute("className", "t"), n.innerHTML = "
a", c = n.getElementsByTagName("*"), d = n.getElementsByTagName("a")[0], !c || !c.length || !d) return {}; e = H.createElement("select"), f = e.appendChild(H.createElement("option")), g = n.getElementsByTagName("input")[0], b = { leadingWhitespace: 3 === n.firstChild.nodeType, tbody: !n.getElementsByTagName("tbody").length, htmlSerialize: !!n.getElementsByTagName("link").length, style: /top/.test(d.getAttribute("style")), hrefNormalized: "/a" === d.getAttribute("href"), opacity: /^0.55/.test(d.style.opacity), cssFloat: !!d.style.cssFloat, checkOn: "on" === g.value, optSelected: f.selected, getSetAttribute: "t" !== n.className, enctype: !!H.createElement("form").enctype, html5Clone: "<:nav>" !== H.createElement("nav").cloneNode(!0).outerHTML, submitBubbles: !0, changeBubbles: !0, focusinBubbles: !1, deleteExpando: !0, noCloneEvent: !0, inlineBlockNeedsLayout: !1, shrinkWrapBlocks: !1, reliableMarginRight: !0 }, g.checked = !0, b.noCloneChecked = g.cloneNode(!0).checked, e.disabled = !0, b.optDisabled = !f.disabled; try { delete n.test } catch (a) { b.deleteExpando = !1 } if (!n.addEventListener && n.attachEvent && n.fireEvent && (n.attachEvent("onclick", function () { b.noCloneEvent = !1 }), n.cloneNode(!0).fireEvent("onclick")), g = H.createElement("input"), g.value = "t", g.setAttribute("type", "radio"), b.radioValue = "t" === g.value, g.setAttribute("checked", "checked"), n.appendChild(g), i = H.createDocumentFragment(), i.appendChild(n.lastChild), b.checkClone = i.cloneNode(!0).cloneNode(!0).lastChild.checked, b.appendChecked = g.checked, i.removeChild(g), i.appendChild(n), n.innerHTML = "", a.getComputedStyle && (h = H.createElement("div"), h.style.width = "0", h.style.marginRight = "0", n.style.width = "2px", n.appendChild(h), b.reliableMarginRight = 0 === (parseInt((a.getComputedStyle(h, null) || { marginRight: 0 }).marginRight, 10) || 0)), n.attachEvent) for (l in { submit: 1, change: 1, focusin: 1 }) k = "on" + l, m = k in n, m || (n.setAttribute(k, "return;"), m = "function" == typeof n[k]), b[l + "Bubbles"] = m; return i.removeChild(n), i = e = f = h = n = g = null, K(function () { var a, c, d, e, f, g, h, i, k, l, o = H.getElementsByTagName("body")[0]; !o || (g = 1, h = "position:absolute;top:0;left:0;width:1px;height:1px;margin:0;", i = "visibility:hidden;border:0;", k = "style='" + h + "border:5px solid #000;padding:0;'", l = "
", a = H.createElement("div"), a.style.cssText = i + "width:0;height:0;position:static;top:0;margin-top:" + g + "px", o.insertBefore(a, o.firstChild), n = H.createElement("div"), a.appendChild(n), n.innerHTML = "
t
", j = n.getElementsByTagName("td"), m = 0 === j[0].offsetHeight, j[0].style.display = "", j[1].style.display = "none", b.reliableHiddenOffsets = m && 0 === j[0].offsetHeight, n.innerHTML = "", n.style.width = n.style.paddingLeft = "1px", K.boxModel = b.boxModel = 2 === n.offsetWidth, "undefined" != typeof n.style.zoom && (n.style.display = "inline", n.style.zoom = 1, b.inlineBlockNeedsLayout = 2 === n.offsetWidth, n.style.display = "", n.innerHTML = "
", b.shrinkWrapBlocks = 2 !== n.offsetWidth), n.style.cssText = h + i, n.innerHTML = l, c = n.firstChild, d = c.firstChild, e = c.nextSibling.firstChild.firstChild, f = { doesNotAddBorder: 5 !== d.offsetTop, doesAddBorderForTableAndCells: 5 === e.offsetTop }, d.style.position = "fixed", d.style.top = "20px", f.fixedPosition = 20 === d.offsetTop || 15 === d.offsetTop, d.style.position = d.style.top = "", c.style.overflow = "hidden", c.style.position = "relative", f.subtractsBorderForOverflowNotVisible = -5 === d.offsetTop, f.doesNotIncludeMarginInBodyOffset = o.offsetTop !== g, o.removeChild(a), n = a = null, K.extend(b, f)) }), b } (); var N = /^(?:\{.*\}|\[.*\])$/, O = /([A-Z])/g; K.extend({ cache: {}, uuid: 0, expando: "jQuery" + (K.fn.jquery + Math.random()).replace(/\D/g, ""), noData: { embed: !0, object: "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000", applet: !0 }, hasData: function (a) { return a = a.nodeType ? K.cache[a[K.expando]] : a[K.expando], !!a && !E(a) }, data: function (a, c, d, e) { if (K.acceptData(a)) { var f, g, h, i = K.expando, j = "string" == typeof c, k = a.nodeType, l = k ? K.cache : a, m = k ? a[i] : a[i] && i, n = "events" === c; if ((!m || !l[m] || !n && !e && !l[m].data) && j && d === b) return; return m || (k ? a[i] = m = ++K.uuid : m = i), l[m] || (l[m] = {}, k || (l[m].toJSON = K.noop)), ("object" == typeof c || "function" == typeof c) && (e ? l[m] = K.extend(l[m], c) : l[m].data = K.extend(l[m].data, c)), f = g = l[m], e || (g.data || (g.data = {}), g = g.data), d !== b && (g[K.camelCase(c)] = d), n && !g[c] ? f.events : (j ? (h = g[c], null == h && (h = g[K.camelCase(c)])) : h = g, h) } }, removeData: function (a, b, c) { if (K.acceptData(a)) { var d, e, f, g = K.expando, h = a.nodeType, i = h ? K.cache : a, j = h ? a[g] : g; if (!i[j]) return; if (b && (d = c ? i[j] : i[j].data)) { K.isArray(b) || (b in d ? b = [b] : (b = K.camelCase(b), b = b in d ? [b] : b.split(" "))); for (e = 0, f = b.length; f > e; e++) delete d[b[e]]; if (!(c ? E : K.isEmptyObject)(d)) return } if (!c && (delete i[j].data, !E(i[j]))) return; K.support.deleteExpando || !i.setInterval ? delete i[j] : i[j] = null, h && (K.support.deleteExpando ? delete a[g] : a.removeAttribute ? a.removeAttribute(g) : a[g] = null) } }, _data: function (a, b, c) { return K.data(a, b, c, !0) }, acceptData: function (a) { if (a.nodeName) { var b = K.noData[a.nodeName.toLowerCase()]; if (b) return b !== !0 && a.getAttribute("classid") === b } return !0 } }), K.fn.extend({ data: function (a, c) { var d, e, f, g = null; if ("undefined" == typeof a) { if (this.length && (g = K.data(this[0]), 1 === this[0].nodeType && !K._data(this[0], "parsedAttrs"))) { e = this[0].attributes; for (var h = 0, i = e.length; i > h; h++) f = e[h].name, 0 === f.indexOf("data-") && (f = K.camelCase(f.substring(5)), F(this[0], f, g[f])); K._data(this[0], "parsedAttrs", !0) } return g } return "object" == typeof a ? this.each(function () { K.data(this, a) }) : (d = a.split("."), d[1] = d[1] ? "." + d[1] : "", c === b ? (g = this.triggerHandler("getData" + d[1] + "!", [d[0]]), g === b && this.length && (g = K.data(this[0], a), g = F(this[0], a, g)), g === b && d[1] ? this.data(d[0]) : g) : this.each(function () { var b = K(this), e = [d[0], c]; b.triggerHandler("setData" + d[1] + "!", e), K.data(this, a, c), b.triggerHandler("changeData" + d[1] + "!", e) })) }, removeData: function (a) { return this.each(function () { K.removeData(this, a) }) } }), K.extend({ _mark: function (a, b) { a && (b = (b || "fx") + "mark", K._data(a, b, (K._data(a, b) || 0) + 1)) }, _unmark: function (a, b, c) { if (a !== !0 && (c = b, b = a, a = !1), b) { c = c || "fx"; var d = c + "mark", e = a ? 0 : (K._data(b, d) || 1) - 1; e ? K._data(b, d, e) : (K.removeData(b, d, !0), D(b, c, "mark")) } }, queue: function (a, b, c) { var d; return a ? (b = (b || "fx") + "queue", d = K._data(a, b), c && (!d || K.isArray(c) ? d = K._data(a, b, K.makeArray(c)) : d.push(c)), d || []) : void 0 }, dequeue: function (a, b) { b = b || "fx"; var c = K.queue(a, b), d = c.shift(), e = {}; "inprogress" === d && (d = c.shift()), d && ("fx" === b && c.unshift("inprogress"), K._data(a, b + ".run", e), d.call(a, function () { K.dequeue(a, b) }, e)), c.length || (K.removeData(a, b + "queue " + b + ".run", !0), D(a, b, "queue")) } }), K.fn.extend({ queue: function (a, c) { return "string" != typeof a && (c = a, a = "fx"), c === b ? K.queue(this[0], a) : this.each(function () { var b = K.queue(this, a, c); "fx" === a && "inprogress" !== b[0] && K.dequeue(this, a) }) }, dequeue: function (a) { return this.each(function () { K.dequeue(this, a) }) }, delay: function (a, b) { return a = K.fx ? K.fx.speeds[a] || a : a, b = b || "fx", this.queue(b, function (b, c) { var d = setTimeout(b, a); c.stop = function () { clearTimeout(d) } }) }, clearQueue: function (a) { return this.queue(a || "fx", []) }, promise: function (a, c) { function d() { --i || f.resolveWith(g, [g]) } "string" != typeof a && (c = a, a = b), a = a || "fx"; for (var e, f = K.Deferred(), g = this, h = g.length, i = 1, j = a + "defer", k = a + "queue", l = a + "mark"; h--; ) (e = K.data(g[h], j, b, !0) || (K.data(g[h], k, b, !0) || K.data(g[h], l, b, !0)) && K.data(g[h], j, K.Callbacks("once memory"), !0)) && (i++, e.add(d)); return d(), f.promise() } }); var P, Q, R, S = /[\n\t\r]/g, T = /\s+/, U = /\r/g, V = /^(?:button|input)$/i, W = /^(?:button|input|object|select|textarea)$/i, X = /^a(?:rea)?$/i, Y = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i, Z = K.support.getSetAttribute; K.fn.extend({ attr: function (a, b) { return K.access(this, a, b, !0, K.attr) }, removeAttr: function (a) { return this.each(function () { K.removeAttr(this, a) }) }, prop: function (a, b) { return K.access(this, a, b, !0, K.prop) }, removeProp: function (a) { return a = K.propFix[a] || a, this.each(function () { try { this[a] = b, delete this[a] } catch (a) {} }) }, addClass: function (a) { var b, c, d, e, f, g, h; if (K.isFunction(a)) return this.each(function (b) { K(this).addClass(a.call(this, b, this.className)) }); if (a && "string" == typeof a) for (b = a.split(T), c = 0, d = this.length; d > c; c++) if (e = this[c], 1 === e.nodeType) if (e.className || 1 !== b.length) { for (f = " " + e.className + " ", g = 0, h = b.length; h > g; g++) ~f.indexOf(" " + b[g] + " ") || (f += b[g] + " "); e.className = K.trim(f) } else e.className = a; return this }, removeClass: function (a) { var c, d, e, f, g, h, i; if (K.isFunction(a)) return this.each(function (b) { K(this).removeClass(a.call(this, b, this.className)) }); if (a && "string" == typeof a || a === b) for (c = (a || "").split(T), d = 0, e = this.length; e > d; d++) if (f = this[d], 1 === f.nodeType && f.className) if (a) { for (g = (" " + f.className + " ").replace(S, " "), h = 0, i = c.length; i > h; h++) g = g.replace(" " + c[h] + " ", " "); f.className = K.trim(g) } else f.className = ""; return this }, toggleClass: function (a, b) { var c = typeof a, d = "boolean" == typeof b; return K.isFunction(a) ? this.each(function (c) { K(this).toggleClass(a.call(this, c, this.className, b), b) }) : this.each(function () { if ("string" === c) for (var e, f = 0, g = K(this), h = b, i = a.split(T); e = i[f++]; ) h = d ? h : !g.hasClass(e), g[h ? "addClass" : "removeClass"](e); else ("undefined" === c || "boolean" === c) && (this.className && K._data(this, "__className__", this.className), this.className = this.className || a === !1 ? "" : K._data(this, "__className__") || "") }) }, hasClass: function (a) { for (var b = " " + a + " ", c = 0, d = this.length; d > c; c++) if (1 === this[c].nodeType && (" " + this[c].className + " ").replace(S, " ").indexOf(b) > -1) return !0; return !1 }, val: function (a) { var c, d, e, f = this[0]; return arguments.length ? (e = K.isFunction(a), this.each(function (d) { var f, g = K(this); 1 === this.nodeType && (f = e ? a.call(this, d, g.val()) : a, null == f ? f = "" : "number" == typeof f ? f += "" : K.isArray(f) && (f = K.map(f, function (a) { return null == a ? "" : a + "" })), c = K.valHooks[this.nodeName.toLowerCase()] || K.valHooks[this.type], c && "set" in c && c.set(this, f, "value") !== b || (this.value = f)) })) : f ? (c = K.valHooks[f.nodeName.toLowerCase()] || K.valHooks[f.type], c && "get" in c && (d = c.get(f, "value")) !== b ? d : (d = f.value, "string" == typeof d ? d.replace(U, "") : null == d ? "" : d)) : void 0 } }), K.extend({ valHooks: { option: { get: function (a) { var b = a.attributes.value; return !b || b.specified ? a.value : a.text } }, select: { get: function (a) { var b, c, d, e, f = a.selectedIndex, g = [], h = a.options, i = "select-one" === a.type; if (0 > f) return null; for (c = i ? f : 0, d = i ? f + 1 : h.length; d > c; c++) if (e = h[c], e.selected && (K.support.optDisabled ? !e.disabled : null === e.getAttribute("disabled")) && (!e.parentNode.disabled || !K.nodeName(e.parentNode, "optgroup"))) { if (b = K(e).val(), i) return b; g.push(b) } return i && !g.length && h.length ? K(h[f]).val() : g }, set: function (a, b) { var c = K.makeArray(b); return K(a).find("option").each(function () { this.selected = K.inArray(K(this).val(), c) >= 0 }), c.length || (a.selectedIndex = -1), c } } }, attrFn: { val: !0, css: !0, html: !0, text: !0, data: !0, width: !0, height: !0, offset: !0 }, attr: function (a, c, d, e) { var f, g, h, i = a.nodeType; return a && 3 !== i && 8 !== i && 2 !== i ? e && c in K.attrFn ? K(a)[c](d) : "undefined" == typeof a.getAttribute ? K.prop(a, c, d) : (h = 1 !== i || !K.isXMLDoc(a), h && (c = c.toLowerCase(), g = K.attrHooks[c] || (Y.test(c) ? Q : P)), d !== b ? null === d ? void K.removeAttr(a, c) : g && "set" in g && h && (f = g.set(a, d, c)) !== b ? f : (a.setAttribute(c, "" + d), d) : g && "get" in g && h && null !== (f = g.get(a, c)) ? f : (f = a.getAttribute(c), null === f ? b : f)) : void 0 }, removeAttr: function (a, b) { var c, d, e, f, g = 0; if (b && 1 === a.nodeType) for (d = b.toLowerCase().split(T), f = d.length; f > g; g++) e = d[g], e && (c = K.propFix[e] || e, K.attr(a, e, ""), a.removeAttribute(Z ? e : c), Y.test(e) && c in a && (a[c] = !1)) }, attrHooks: { type: { set: function (a, b) { if (V.test(a.nodeName) && a.parentNode) K.error("type property can't be changed"); else if (!K.support.radioValue && "radio" === b && K.nodeName(a, "input")) { var c = a.value; return a.setAttribute("type", b), c && (a.value = c), b } } }, value: { get: function (a, b) { return P && K.nodeName(a, "button") ? P.get(a, b) : b in a ? a.value : null }, set: function (a, b, c) { return P && K.nodeName(a, "button") ? P.set(a, b, c) : void(a.value = b) } } }, propFix: { tabindex: "tabIndex", readonly: "readOnly", for : "htmlFor", class: "className", maxlength: "maxLength", cellspacing: "cellSpacing", cellpadding: "cellPadding", rowspan: "rowSpan", colspan: "colSpan", usemap: "useMap", frameborder: "frameBorder", contenteditable: "contentEditable" }, prop: function (a, c, d) { var e, f, g, h = a.nodeType; return a && 3 !== h && 8 !== h && 2 !== h ? (g = 1 !== h || !K.isXMLDoc(a), g && (c = K.propFix[c] || c, f = K.propHooks[c]), d !== b ? f && "set" in f && (e = f.set(a, d, c)) !== b ? e : a[c] = d : f && "get" in f && null !== (e = f.get(a, c)) ? e : a[c]) : void 0 }, propHooks: { tabIndex: { get: function (a) { var c = a.getAttributeNode("tabindex"); return c && c.specified ? parseInt(c.value, 10) : W.test(a.nodeName) || X.test(a.nodeName) && a.href ? 0 : b } } } }), K.attrHooks.tabindex = K.propHooks.tabIndex, Q = { get: function (a, c) { var d, e = K.prop(a, c); return e === !0 || "boolean" != typeof e && (d = a.getAttributeNode(c)) && d.nodeValue !== !1 ? c.toLowerCase() : b }, set: function (a, b, c) { var d; return b === !1 ? K.removeAttr(a, c) : (d = K.propFix[c] || c, d in a && (a[d] = !0), a.setAttribute(c, c.toLowerCase())), c } }, Z || (R = { name: !0, id: !0 }, P = K.valHooks.button = { get: function (a, c) { var d; return d = a.getAttributeNode(c), d && (R[c] ? "" !== d.nodeValue : d.specified) ? d.nodeValue : b }, set: function (a, b, c) { var d = a.getAttributeNode(c); return d || (d = H.createAttribute(c), a.setAttributeNode(d)), d.nodeValue = b + "" } }, K.attrHooks.tabindex.set = P.set, K.each(["width", "height"], function (a, b) { K.attrHooks[b] = K.extend(K.attrHooks[b], { set: function (a, c) { return "" === c ? (a.setAttribute(b, "auto"), c) : void 0 } }) }), K.attrHooks.contenteditable = { get: P.get, set: function (a, b, c) { "" === b && (b = "false"), P.set(a, b, c) } }), K.support.hrefNormalized || K.each(["href", "src", "width", "height"], function (a, c) { K.attrHooks[c] = K.extend(K.attrHooks[c], { get: function (a) { var d = a.getAttribute(c, 2); return null === d ? b : d } }) }), K.support.style || (K.attrHooks.style = { get: function (a) { return a.style.cssText.toLowerCase() || b }, set: function (a, b) { return a.style.cssText = "" + b } }), K.support.optSelected || (K.propHooks.selected = K.extend(K.propHooks.selected, { get: function (a) { var b = a.parentNode; return b && (b.selectedIndex, b.parentNode && b.parentNode.selectedIndex), null } })), K.support.enctype || (K.propFix.enctype = "encoding"), K.support.checkOn || K.each(["radio", "checkbox"], function () { K.valHooks[this] = { get: function (a) { return null === a.getAttribute("value") ? "on" : a.value } } }), K.each(["radio", "checkbox"], function () { K.valHooks[this] = K.extend(K.valHooks[this], { set: function (a, b) { return K.isArray(b) ? a.checked = K.inArray(K(a).val(), b) >= 0 : void 0 } }) }); var $ = /^(?:textarea|input|select)$/i, _ = /^([^\.]*)?(?:\.(.+))?$/, aa = /\bhover(\.\S+)?\b/, ba = /^key/, ca = /^(?:mouse|contextmenu)|click/, da = /^(?:focusinfocus|focusoutblur)$/, ea = /^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/, fa = function (a) { var b = ea.exec(a); return b && (b[1] = (b[1] || "").toLowerCase(), b[3] = b[3] && new RegExp("(?:^|\\s)" + b[3] + "(?:\\s|$)")), b }, ga = function (a, b) { var c = a.attributes || {}; return (!b[1] || a.nodeName.toLowerCase() === b[1]) && (!b[2] || (c.id || {}).value === b[2]) && (!b[3] || b[3].test((c.class || {}).value)) }, ha = function (a) { return K.event.special.hover ? a : a.replace(aa, "mouseenter$1 mouseleave$1") }; K.event = { add: function (a, c, d, e, f) { var g, h, i, j, k, l, m, n, o, p, q; if (3 !== a.nodeType && 8 !== a.nodeType && c && d && (g = K._data(a))) { for (d.handler && (o = d, d = o.handler), d.guid || (d.guid = K.guid++), i = g.events, i || (g.events = i = {}), h = g.handle, h || (g.handle = h = function (a) { return "undefined" == typeof K || a && K.event.triggered === a.type ? b : K.event.dispatch.apply(h.elem, arguments) }, h.elem = a), c = K.trim(ha(c)).split(" "), j = 0; j < c.length; j++) k = _.exec(c[j]) || [], l = k[1], m = (k[2] || "") .split(".").sort(), q = K.event.special[l] || {}, l = (f ? q.delegateType : q.bindType) || l, q = K.event.special[l] || {}, n = K.extend({ type: l, origType: k[1], data: e, handler: d, guid: d.guid, selector: f, quick: fa(f), namespace: m.join(".") }, o), p = i[l], p || (p = i[l] = [], p.delegateCount = 0, q.setup && q.setup.call(a, e, m, h) !== !1 || (a.addEventListener ? a.addEventListener(l, h, !1) : a.attachEvent && a.attachEvent("on" + l, h))), q.add && (q.add.call(a, n), n.handler.guid || (n.handler.guid = d.guid)), f ? p.splice(p.delegateCount++, 0, n) : p.push(n), K.event.global[l] = !0; a = null } }, global: {}, remove: function (a, b, c, d, e) { var f, g, h, i, j, k, l, m, n, o, p, q, r = K.hasData(a) && K._data(a); if (r && (m = r.events)) { for (b = K.trim(ha(b || "")).split(" "), f = 0; f < b.length; f++) if (g = _.exec(b[f]) || [], h = i = g[1], j = g[2], h) { for (n = K.event.special[h] || {}, h = (d ? n.delegateType : n.bindType) || h, p = m[h] || [], k = p.length, j = j ? new RegExp("(^|\\.)" + j.split(".").sort().join("\\.(?:.*\\.)?") + "(\\.|$)") : null, l = 0; l < p.length; l++) q = p[l], (e || i === q.origType) && (!c || c.guid === q.guid) && (!j || j.test(q.namespace)) && (!d || d === q.selector || "**" === d && q.selector) && (p.splice(l--, 1), q.selector && p.delegateCount--, n.remove && n.remove.call(a, q)); 0 === p.length && k !== p.length && ((!n.teardown || n.teardown.call(a, j) === !1) && K.removeEvent(a, h, r.handle), delete m[h]) } else for (h in m) K.event.remove(a, h + b[f], c, d, !0); K.isEmptyObject(m) && (o = r.handle, o && (o.elem = null), K.removeData(a, ["events", "handle"], !0)) } }, customEvent: { getData: !0, setData: !0, changeData: !0 }, trigger: function (c, d, e, f) { if (!e || 3 !== e.nodeType && 8 !== e.nodeType) { var g, h, i, j, k, l, m, n, o, p, q = c.type || c, r = []; if (da.test(q + K.event.triggered)) return; if (q.indexOf("!") >= 0 && (q = q.slice(0, -1), h = !0), q.indexOf(".") >= 0 && (r = q.split("."), q = r.shift(), r.sort()), (!e || K.event.customEvent[q]) && !K.event.global[q]) return; if (c = "object" == typeof c ? c[K.expando] ? c : new K.Event(q, c) : new K.Event(q), c.type = q, c.isTrigger = !0, c.exclusive = h, c.namespace = r.join("."), c.namespace_re = c.namespace ? new RegExp("(^|\\.)" + r.join("\\.(?:.*\\.)?") + "(\\.|$)") : null, l = q.indexOf(":") < 0 ? "on" + q : "", !e) { g = K.cache; for (i in g) g[i].events && g[i].events[q] && K.event.trigger(c, d, g[i].handle.elem, !0); return } if (c.result = b, c.target || (c.target = e), d = null != d ? K.makeArray(d) : [], d.unshift(c), m = K.event.special[q] || {}, m.trigger && m.trigger.apply(e, d) === !1) return; if (o = [[e, m.bindType || q]], !f && !m.noBubble && !K.isWindow(e)) { for (p = m.delegateType || q, j = da.test(p + q) ? e : e.parentNode, k = null; j; j = j.parentNode) o.push([j, p]), k = j; k && k === e.ownerDocument && o.push([k.defaultView || k.parentWindow || a, p]) } for (i = 0; i < o.length && !c.isPropagationStopped(); i++) j = o[i][0], c.type = o[i][1], n = (K._data(j, "events") || {})[c.type] && K._data(j, "handle"), n && n.apply(j, d), n = l && j[l], n && K.acceptData(j) && n.apply(j, d) === !1 && c.preventDefault(); return c.type = q, !f && !c.isDefaultPrevented() && (!m._default || m._default.apply(e.ownerDocument, d) === !1) && ("click" !== q || !K.nodeName(e, "a")) && K.acceptData(e) && l && e[q] && ("focus" !== q && "blur" !== q || 0 !== c.target.offsetWidth) && !K.isWindow(e) && (k = e[l], k && (e[l] = null), K.event.triggered = q, e[q](), K.event.triggered = b, k && (e[l] = k)), c.result } }, dispatch: function (c) { c = K.event.fix(c || a.event); var d, e, f, g, h, i, j, k, l, m, n = (K._data(this, "events") || {})[c.type] || [], o = n.delegateCount, p = [].slice.call(arguments, 0), q = !c.exclusive && !c.namespace, r = []; if (p[0] = c, c.delegateTarget = this, o && !c.target.disabled && (!c.button || "click" !== c.type)) for (g = K(this), g.context = this.ownerDocument || this, f = c.target; f != this; f = f.parentNode || this) { for (i = {}, k = [], g[0] = f, d = 0; o > d; d++) l = n[d], m = l.selector, i[m] === b && (i[m] = l.quick ? ga(f, l.quick) : g.is(m)), i[m] && k.push(l); k.length && r.push({ elem: f, matches: k }) } for (n.length > o && r.push({ elem: this, matches: n.slice(o) }), d = 0; d < r.length && !c.isPropagationStopped(); d++) for (j = r[d], c.currentTarget = j.elem, e = 0; e < j.matches.length && !c.isImmediatePropagationStopped(); e++) l = j.matches[e], (q || !c.namespace && !l.namespace || c.namespace_re && c.namespace_re.test(l.namespace)) && (c.data = l.data, c.handleObj = l, h = ((K.event.special[l.origType] || {}).handle || l.handler).apply(j.elem, p), h !== b && (c.result = h, h === !1 && (c.preventDefault(), c.stopPropagation()))); return c.result }, props: "attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), fixHooks: {}, keyHooks: { props: "char charCode key keyCode".split(" "), filter: function (a, b) { return null == a.which && (a.which = null != b.charCode ? b.charCode : b.keyCode), a } }, mouseHooks: { props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "), filter: function (a, c) { var d, e, f, g = c.button, h = c.fromElement; return null == a.pageX && null != c.clientX && (d = a.target.ownerDocument || H, e = d.documentElement, f = d.body, a.pageX = c.clientX + (e && e.scrollLeft || f && f.scrollLeft || 0) - (e && e.clientLeft || f && f.clientLeft || 0), a.pageY = c.clientY + (e && e.scrollTop || f && f.scrollTop || 0) - (e && e.clientTop || f && f.clientTop || 0)), !a.relatedTarget && h && (a.relatedTarget = h === a.target ? c.toElement : h), !a.which && g !== b && (a.which = 1 & g ? 1 : 2 & g ? 3 : 4 & g ? 2 : 0), a } }, fix: function (a) { if (a[K.expando]) return a; var c, d, e = a, f = K.event.fixHooks[a.type] || {}, g = f.props ? this.props.concat(f.props) : this.props; for (a = K.Event(e), c = g.length; c; ) d = g[--c], a[d] = e[d]; return a.target || (a.target = e.srcElement || H), 3 === a.target.nodeType && (a.target = a.target.parentNode), a.metaKey === b && (a.metaKey = a.ctrlKey), f.filter ? f.filter(a, e) : a }, special: { ready: { setup: K.bindReady }, load: { noBubble: !0 }, focus: { delegateType: "focusin" }, blur: { delegateType: "focusout" }, beforeunload: { setup: function (a, b, c) { K.isWindow(this) && (this.onbeforeunload = c) }, teardown: function (a, b) { this.onbeforeunload === b && (this.onbeforeunload = null) } } }, simulate: function (a, b, c, d) { var e = K.extend(new K.Event, c, { type: a, isSimulated: !0, originalEvent: {} }); d ? K.event.trigger(e, null, b) : K.event.dispatch.call(b, e), e.isDefaultPrevented() && c.preventDefault() } }, K.event.handle = K.event.dispatch, K.removeEvent = H.removeEventListener ? function (a, b, c) { a.removeEventListener && a.removeEventListener(b, c, !1) } : function (a, b, c) { a.detachEvent && a.detachEvent("on" + b, c) }, K.Event = function (a, b) { return this instanceof K.Event ? (a && a.type ? (this.originalEvent = a, this.type = a.type, this.isDefaultPrevented = a.defaultPrevented || a.returnValue === !1 || a.getPreventDefault && a.getPreventDefault() ? B : C) : this.type = a, b && K.extend(this, b), this.timeStamp = a && a.timeStamp || K.now(), void(this[K.expando] = !0)) : new K.Event(a, b) }, K.Event.prototype = { preventDefault: function () { this.isDefaultPrevented = B; var a = this.originalEvent; !a || (a.preventDefault ? a.preventDefault() : a.returnValue = !1) }, stopPropagation: function () { this.isPropagationStopped = B; var a = this.originalEvent; !a || (a.stopPropagation && a.stopPropagation(), a.cancelBubble = !0) }, stopImmediatePropagation: function () { this.isImmediatePropagationStopped = B, this.stopPropagation() }, isDefaultPrevented: C, isPropagationStopped: C, isImmediatePropagationStopped: C }, K.each({ mouseenter: "mouseover", mouseleave: "mouseout" }, function (a, b) { K.event.special[a] = { delegateType: b, bindType: b, handle: function (a) { var c, d = this, e = a.relatedTarget, f = a.handleObj; return f.selector, (!e || e !== d && !K.contains(d, e)) && (a.type = f.origType, c = f.handler.apply(this, arguments), a.type = b), c } } }), K.support.submitBubbles || (K.event.special.submit = { setup: function () { return !K.nodeName(this, "form") && void K.event.add(this, "click._submit keypress._submit", function (a) { var c = a.target, d = K.nodeName(c, "input") || K.nodeName(c, "button") ? c.form : b; d && !d._submit_attached && (K.event.add(d, "submit._submit", function (a) { this.parentNode && !a.isTrigger && K.event.simulate("submit", this.parentNode, a, !0) }), d._submit_attached = !0) }) }, teardown: function () { return !K.nodeName(this, "form") && void K.event.remove(this, "._submit") } }), K.support.changeBubbles || (K.event.special.change = { setup: function () { return $.test(this.nodeName) ? (("checkbox" === this.type || "radio" === this.type) && (K.event.add(this, "propertychange._change", function (a) { "checked" === a.originalEvent.propertyName && (this._just_changed = !0) }), K.event.add(this, "click._change", function (a) { this._just_changed && !a.isTrigger && (this._just_changed = !1, K.event.simulate("change", this, a, !0)) })), !1) : void K.event.add(this, "beforeactivate._change", function (a) { var b = a.target; $.test(b.nodeName) && !b._change_attached && (K.event.add(b, "change._change", function (a) { this.parentNode && !a.isSimulated && !a.isTrigger && K.event.simulate("change", this.parentNode, a, !0) }), b._change_attached = !0) }) }, handle: function (a) { var b = a.target; return this !== b || a.isSimulated || a.isTrigger || "radio" !== b.type && "checkbox" !== b.type ? a.handleObj.handler.apply(this, arguments) : void 0 }, teardown: function () { return K.event.remove(this, "._change"), $.test(this.nodeName) } }), K.support.focusinBubbles || K.each({ focus: "focusin", blur: "focusout" }, function (a, b) { var c = 0, d = function (a) { K.event.simulate(b, a.target, K.event.fix(a), !0) }; K.event.special[b] = { setup: function () { 0 === c++ && H.addEventListener(a, d, !0) }, teardown: function () { 0 === --c && H.removeEventListener(a, d, !0) } } }), K.fn.extend({ on: function (a, c, d, e, f) { var g, h; if ("object" == typeof a) { "string" != typeof c && (d = c, c = b); for (h in a) this.on(h, c, d, a[h], f); return this } if (null == d && null == e ? (e = c, d = c = b) : null == e && ("string" == typeof c ? (e = d, d = b) : (e = d, d = c, c = b)), e === !1) e = C; else if (!e) return this; return 1 === f && (g = e, e = function (a) { return K().off(a), g.apply(this, arguments) }, e.guid = g.guid || (g.guid = K.guid++)), this.each(function () { K.event.add(this, a, e, d, c) }) }, one: function (a, b, c, d) { return this.on.call(this, a, b, c, d, 1) }, off: function (a, c, d) { if (a && a.preventDefault && a.handleObj) { var e = a.handleObj; return K(a.delegateTarget).off(e.namespace ? e.type + "." + e.namespace : e.type, e.selector, e.handler), this } if ("object" == typeof a) { for (var f in a) this.off(f, c, a[f]); return this } return (c === !1 || "function" == typeof c) && (d = c, c = b), d === !1 && (d = C), this.each(function () { K.event.remove(this, a, d, c) }) }, bind: function (a, b, c) { return this.on(a, null, b, c) }, unbind: function (a, b) { return this.off(a, null, b) }, live: function (a, b, c) { return K(this.context).on(a, this.selector, b, c), this }, die: function (a, b) { return K(this.context).off(a, this.selector || "**", b), this }, delegate: function (a, b, c, d) { return this.on(b, a, c, d) }, undelegate: function (a, b, c) { return 1 == arguments.length ? this.off(a, "**") : this.off(b, a, c) }, trigger: function (a, b) { return this.each(function () { K.event.trigger(a, b, this) }) }, triggerHandler: function (a, b) { return this[0] ? K.event.trigger(a, b, this[0], !0) : void 0 }, toggle: function (a) { var b = arguments, c = a.guid || K.guid++, d = 0, e = function (c) { var e = (K._data(this, "lastToggle" + a.guid) || 0) % d; return K._data(this, "lastToggle" + a.guid, e + 1), c.preventDefault(), b[e].apply(this, arguments) || !1 }; for (e.guid = c; d < b.length; ) b[d++].guid = c; return this.click(e) }, hover: function (a, b) { return this.mouseenter(a).mouseleave(b || a) } }), K.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "), function (a, b) { K.fn[b] = function (a, c) { return null == c && (c = a, a = null), arguments.length > 0 ? this.on(b, null, a, c) : this.trigger(b) }, K.attrFn && (K.attrFn[b] = !0), ba.test(b) && (K.event.fixHooks[b] = K.event.keyHooks), ca.test(b) && (K.event.fixHooks[b] = K.event.mouseHooks) }), function () { function a(a, b, c, d, f, g) { for (var h = 0, i = d.length; i > h; h++) { var j = d[h]; if (j) { var k = !1; for (j = j[a]; j; ) { if (j[e] === c) { k = d[j.sizset]; break } if (1 === j.nodeType) if (g || (j[e] = c, j.sizset = h), "string" != typeof b) { if (j === b) { k = !0; break } } else if (m.filter(b, [j]).length > 0) { k = j; break } j = j[a] } d[h] = k } } } function c(a, b, c, d, f, g) { for (var h = 0, i = d.length; i > h; h++) { var j = d[h]; if (j) { var k = !1; for (j = j[a]; j; ) { if (j[e] === c) { k = d[j.sizset]; break } if (1 === j.nodeType && !g && (j[e] = c, j.sizset = h), j.nodeName.toLowerCase() === b) { k = j; break } j = j[a] } d[h] = k } } } var d = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, e = "sizcache" + (Math.random() + "").replace(".", ""), f = 0, g = Object.prototype.toString, h = !1, i = !0, j = /\\/g, k = /\r\n/g, l = /\W/; [0, 0].sort(function () { return i = !1, 0 }); var m = function (a, b, c, e) { c = c || [], b = b || H; var f = b; if (1 !== b.nodeType && 9 !== b.nodeType) return []; if (!a || "string" != typeof a) return c; var h, i, j, k, l, n, q, r, t = !0, u = m.isXML(b), w = [], x = a; do if (d.exec(""), h = d.exec(x), h && (x = h[3], w.push(h[1]), h[2])) { k = h[3]; break } while (h); if (w.length > 1 && p.exec(a)) if (2 === w.length && o.relative[w[0]]) i = v(w[0] + w[1], b, e); else for (i = o.relative[w[0]] ? [b] : m(w.shift(), b); w.length; ) a = w.shift(), o.relative[a] && (a += w.shift()), i = v(a, i, e); else if (!e && w.length > 1 && 9 === b.nodeType && !u && o.match.ID.test(w[0]) && !o.match.ID.test(w[w.length - 1]) && (l = m.find(w.shift(), b, u), b = l.expr ? m.filter(l.expr, l.set)[0] : l.set[0]), b) for (l = e ? { expr: w.pop(), set: s(e) } : m.find(w.pop(), 1 !== w.length || "~" !== w[0] && "+" !== w[0] || !b.parentNode ? b : b.parentNode, u), i = l.expr ? m.filter(l.expr, l.set) : l.set, w.length > 0 ? j = s(i) : t = !1; w.length; ) n = w.pop(), q = n, o.relative[n] ? q = w.pop() : n = "", null == q && (q = b), o.relative[n](j, q, u); else j = w = []; if (j || (j = i), j || m.error(n || a), "[object Array]" === g.call(j)) if (t) if (b && 1 === b.nodeType) for (r = 0; null != j[r]; r++) j[r] && (j[r] === !0 || 1 === j[r].nodeType && m.contains(b, j[r])) && c.push(i[r]); else for (r = 0; null != j[r]; r++) j[r] && 1 === j[r].nodeType && c.push(i[r]); else c.push.apply(c, j); else s(j, c); return k && (m(k, f, c, e), m.uniqueSort(c)), c }; m.uniqueSort = function (a) { if (t && (h = i, a.sort(t), h)) for (var b = 1; b < a.length; b++) a[b] === a[b - 1] && a.splice(b--, 1); return a }, m.matches = function (a, b) { return m(a, null, null, b) }, m.matchesSelector = function (a, b) { return m(b, null, null, [a]).length > 0 }, m.find = function (a, b, c) { var d, e, f, g, h, i; if (!a) return []; for (e = 0, f = o.order.length; f > e; e++) if (h = o.order[e], (g = o.leftMatch[h].exec(a)) && (i = g[1], g.splice(1, 1), "\\" !== i.substr(i.length - 1) && (g[1] = (g[1] || "").replace(j, ""), d = o.find[h](g, b, c), null != d))) { a = a.replace(o.match[h], ""); break } return d || (d = "undefined" != typeof b.getElementsByTagName ? b.getElementsByTagName("*") : []), { set: d, expr: a } }, m.filter = function (a, c, d, e) { for (var f, g, h, i, j, k, l, n, p, q = a, r = [], s = c, t = c && c[0] && m.isXML(c[0]); a && c.length; ) { for (h in o.filter) if (null != (f = o.leftMatch[h].exec(a)) && f[2]) { if (k = o.filter[h], l = f[1], g = !1, f.splice(1, 1), "\\" === l.substr(l.length - 1)) continue; if (s === r && (r = []), o.preFilter[h]) if (f = o.preFilter[h](f, s, d, r, e, t)) { if (f === !0) continue } else g = i = !0; if (f) for (n = 0; null != (j = s[n]); n++) j && (i = k(j, f, n, s), p = e ^ i, d && null != i ? p ? g = !0 : s[n] = !1 : p && (r.push(j), g = !0)); if (i !== b) { if (d || (s = r), a = a.replace(o.match[h], ""), !g) return []; break } } if (a === q) { if (null != g) break; m.error(a) } q = a } return s }, m.error = function (a) { throw new Error("Syntax error, unrecognized expression: " + a) }; var n = m.getText = function (a) { var b, c, d = a.nodeType, e = ""; if (d) { if (1 === d || 9 === d) { if ("string" == typeof a.textContent) return a.textContent; if ("string" == typeof a.innerText) return a.innerText.replace(k, ""); for (a = a.firstChild; a; a = a.nextSibling) e += n(a) } else if (3 === d || 4 === d) return a.nodeValue } else for (b = 0; c = a[b]; b++) 8 !== c.nodeType && (e += n(c)); return e }, o = m.selectors = { order: ["ID", "NAME", "TAG"], match: { ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/, ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/, TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/, CHILD: /:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/, POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/, PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/ }, leftMatch: {}, attrMap: { class: "className", for : "htmlFor" }, attrHandle: { href: function (a) { return a.getAttribute("href") }, type: function (a) { return a.getAttribute("type") } }, relative: { "+": function (a, b) { var c = "string" == typeof b, d = c && !l.test(b), e = c && !d; d && (b = b.toLowerCase()); for (var f, g = 0, h = a.length; h > g; g++) if (f = a[g]) { for (; (f = f.previousSibling) && 1 !== f.nodeType; ); a[g] = e || f && f.nodeName.toLowerCase() === b ? f || !1 : f === b } e && m.filter(b, a, !0) }, ">": function (a, b) { var c, d = "string" == typeof b, e = 0, f = a.length; if (d && !l.test(b)) { for (b = b.toLowerCase(); f > e; e++) if (c = a[e]) { var g = c.parentNode; a[e] = g.nodeName.toLowerCase() === b && g } } else { for (; f > e; e++) c = a[e], c && (a[e] = d ? c.parentNode : c.parentNode === b); d && m.filter(b, a, !0) } }, "": function (b, d, e) { var g, h = f++, i = a; "string" == typeof d && !l.test(d) && (d = d.toLowerCase(), g = d, i = c), i("parentNode", d, h, b, g, e) }, "~": function (b, d, e) { var g, h = f++, i = a; "string" == typeof d && !l.test(d) && (d = d.toLowerCase(), g = d, i = c), i("previousSibling", d, h, b, g, e) } }, find: { ID: function (a, b, c) { if ("undefined" != typeof b.getElementById && !c) { var d = b.getElementById(a[1]); return d && d.parentNode ? [d] : [] } }, NAME: function (a, b) { if ("undefined" != typeof b.getElementsByName) { for (var c = [], d = b.getElementsByName(a[1]), e = 0, f = d.length; f > e; e++) d[e].getAttribute("name") === a[1] && c.push(d[e]); return 0 === c.length ? null : c } }, TAG: function (a, b) { return "undefined" != typeof b.getElementsByTagName ? b.getElementsByTagName(a[1]) : void 0 } }, preFilter: { CLASS: function (a, b, c, d, e, f) { if (a = " " + a[1].replace(j, "") + " ", f) return a; for (var g, h = 0; null != (g = b[h]); h++) g && (e ^ (g.className && (" " + g.className + " ").replace(/[\t\n\r]/g, " ").indexOf(a) >= 0) ? c || d.push(g) : c && (b[h] = !1)); return !1 }, ID: function (a) { return a[1].replace(j, "") }, TAG: function (a) { return a[1].replace(j, "").toLowerCase() }, CHILD: function (a) { if ("nth" === a[1]) { a[2] || m.error(a[0]), a[2] = a[2].replace(/^\+|\s*/g, ""); var b = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec("even" === a[2] && "2n" || "odd" === a[2] && "2n+1" || !/\D/.test(a[2]) && "0n+" + a[2] || a[2]); a[2] = b[1] + (b[2] || 1) - 0, a[3] = b[3] - 0 } else a[2] && m.error(a[0]); return a[0] = f++, a }, ATTR: function (a, b, c, d, e, f) { var g = a[1] = a[1].replace(j, ""); return !f && o.attrMap[g] && (a[1] = o.attrMap[g]), a[4] = (a[4] || a[5] || "").replace(j, ""), "~=" === a[2] && (a[4] = " " + a[4] + " "), a }, PSEUDO: function (a, b, c, e, f) { if ("not" === a[1]) { if (!((d.exec(a[3]) || "").length > 1 || /^\w/.test(a[3]))) { var g = m.filter(a[3], b, c, !0 ^ f); return c || e.push.apply(e, g), !1 } a[3] = m(a[3], null, null, b) } else if (o.match.POS.test(a[0]) || o.match.CHILD.test(a[0])) return !0; return a }, POS: function (a) { return a.unshift(!0), a } }, filters: { enabled: function (a) { return a.disabled === !1 && "hidden" !== a.type }, disabled: function (a) { return a.disabled === !0 }, checked: function (a) { return a.checked === !0 }, selected: function (a) { return a.parentNode && a.parentNode.selectedIndex, a.selected === !0 }, parent: function (a) { return !!a.firstChild }, empty: function (a) { return !a.firstChild }, has: function (a, b, c) { return !!m(c[3], a).length }, header: function (a) { return /h\d/i.test(a.nodeName) }, text: function (a) { var b = a.getAttribute("type"), c = a.type; return "input" === a.nodeName.toLowerCase() && "text" === c && (b === c || null === b) }, radio: function (a) { return "input" === a.nodeName.toLowerCase() && "radio" === a.type }, checkbox: function (a) { return "input" === a.nodeName.toLowerCase() && "checkbox" === a.type }, file: function (a) { return "input" === a.nodeName.toLowerCase() && "file" === a.type }, password: function (a) { return "input" === a.nodeName.toLowerCase() && "password" === a.type }, submit: function (a) { var b = a.nodeName.toLowerCase(); return ("input" === b || "button" === b) && "submit" === a.type }, image: function (a) { return "input" === a.nodeName.toLowerCase() && "image" === a.type }, reset: function (a) { var b = a.nodeName.toLowerCase(); return ("input" === b || "button" === b) && "reset" === a.type }, button: function (a) { var b = a.nodeName.toLowerCase(); return "input" === b && "button" === a.type || "button" === b }, input: function (a) { return /input|select|textarea|button/i.test(a.nodeName) }, focus: function (a) { return a === a.ownerDocument.activeElement } }, setFilters: { first: function (a, b) { return 0 === b }, last: function (a, b, c, d) { return b === d.length - 1 }, even: function (a, b) { return b % 2 === 0 }, odd: function (a, b) { return b % 2 === 1 }, lt: function (a, b, c) { return b < c[3] - 0 }, gt: function (a, b, c) { return b > c[3] - 0 }, nth: function (a, b, c) { return c[3] - 0 === b }, eq: function (a, b, c) { return c[3] - 0 === b } }, filter: { PSEUDO: function (a, b, c, d) { var e = b[1], f = o.filters[e]; if (f) return f(a, c, b, d); if ("contains" === e) return (a.textContent || a.innerText || n([a]) || "").indexOf(b[3]) >= 0; if ("not" === e) { for (var g = b[3], h = 0, i = g.length; i > h; h++) if (g[h] === a) return !1; return !0 } m.error(e) }, CHILD: function (a, b) { var c, d, f, g, h, i, j = b[1], k = a; switch (j) { case "only": case "first": for (; k = k.previousSibling; ) if (1 === k.nodeType) return !1; if ("first" === j) return !0; k = a; case "last": for (; k = k.nextSibling; ) if (1 === k.nodeType) return !1; return !0; case "nth": if (c = b[2], d = b[3], 1 === c && 0 === d) return !0; if (f = b[0], g = a.parentNode, g && (g[e] !== f || !a.nodeIndex)) { for (h = 0, k = g.firstChild; k; k = k.nextSibling) 1 === k.nodeType && (k.nodeIndex = ++h); g[e] = f } return i = a.nodeIndex - d, 0 === c ? 0 === i : i % c === 0 && i / c >= 0 } }, ID: function (a, b) { return 1 === a.nodeType && a.getAttribute("id") === b }, TAG: function (a, b) { return "*" === b && 1 === a.nodeType || !!a.nodeName && a.nodeName.toLowerCase() === b }, CLASS: function (a, b) { return (" " + (a.className || a.getAttribute("class")) + " ").indexOf(b) > -1 }, ATTR: function (a, b) { var c = b[1], d = m.attr ? m.attr(a, c) : o.attrHandle[c] ? o.attrHandle[c](a) : null != a[c] ? a[c] : a.getAttribute(c), e = d + "", f = b[2], g = b[4]; return null == d ? "!=" === f : !f && m.attr ? null != d : "=" === f ? e === g : "*=" === f ? e.indexOf(g) >= 0 : "~=" === f ? (" " + e + " ").indexOf(g) >= 0 : g ? "!=" === f ? e !== g : "^=" === f ? 0 === e.indexOf(g) : "$=" === f ? e.substr(e.length - g.length) === g : "|=" === f && (e === g || e.substr(0, g.length + 1) === g + "-") : e && d !== !1 }, POS: function (a, b, c, d) { var e = b[2], f = o.setFilters[e]; return f ? f(a, c, b, d) : void 0 } } }, p = o.match.POS, q = function (a, b) { return "\\" + (b - 0 + 1) }; for (var r in o.match) o.match[r] = new RegExp(o.match[r].source + /(?![^\[]*\])(?![^\(]*\))/.source), o.leftMatch[r] = new RegExp(/(^(?:.|\r|\n)*?)/.source + o.match[r].source.replace(/\\(\d+)/g, q)); var s = function (a, b) { return a = Array.prototype.slice.call(a, 0), b ? (b.push.apply(b, a), b) : a }; try { Array.prototype.slice.call(H.documentElement.childNodes, 0)[0].nodeType } catch (a) { s = function (a, b) { var c = 0, d = b || []; if ("[object Array]" === g.call(a)) Array.prototype.push.apply(d, a); else if ("number" == typeof a.length) for (var e = a.length; e > c; c++) d.push(a[c]); else for (; a[c]; c++) d.push(a[c]); return d } } var t, u; H.documentElement.compareDocumentPosition ? t = function (a, b) { return a === b ? (h = !0, 0) : a.compareDocumentPosition && b.compareDocumentPosition ? 4 & a.compareDocumentPosition(b) ? -1 : 1 : a.compareDocumentPosition ? -1 : 1 } : (t = function (a, b) { if (a === b) return h = !0, 0; if (a.sourceIndex && b.sourceIndex) return a.sourceIndex - b.sourceIndex; var c, d, e = [], f = [], g = a.parentNode, i = b.parentNode, j = g; if (g === i) return u(a, b); if (!g) return -1; if (!i) return 1; for (; j; ) e.unshift(j), j = j.parentNode; for (j = i; j; ) f.unshift(j), j = j.parentNode; c = e.length, d = f.length; for (var k = 0; c > k && d > k; k++) if (e[k] !== f[k]) return u(e[k], f[k]); return k === c ? u(a, f[k], -1) : u(e[k], b, 1) }, u = function (a, b, c) { if (a === b) return c; for (var d = a.nextSibling; d; ) { if (d === b) return -1; d = d.nextSibling } return 1 }), function () { var a = H.createElement("div"), c = "script" + (new Date).getTime(), d = H.documentElement; a.innerHTML = "", d.insertBefore(a, d.firstChild), H.getElementById(c) && (o.find.ID = function (a, c, d) { if ("undefined" != typeof c.getElementById && !d) { var e = c.getElementById(a[1]); return e ? e.id === a[1] || "undefined" != typeof e.getAttributeNode && e.getAttributeNode("id").nodeValue === a[1] ? [e] : b : [] } }, o.filter.ID = function (a, b) { var c = "undefined" != typeof a.getAttributeNode && a.getAttributeNode("id"); return 1 === a.nodeType && c && c.nodeValue === b }), d.removeChild(a), d = a = null } (), function () { var a = H.createElement("div"); a.appendChild(H.createComment("")), a.getElementsByTagName("*").length > 0 && (o.find.TAG = function (a, b) { var c = b.getElementsByTagName(a[1]); if ("*" === a[1]) { for (var d = [], e = 0; c[e]; e++) 1 === c[e].nodeType && d.push(c[e]); c = d } return c }), a.innerHTML = "", a.firstChild && "undefined" != typeof a.firstChild.getAttribute && "#" !== a.firstChild.getAttribute("href") && (o.attrHandle.href = function (a) { return a.getAttribute("href", 2) }), a = null } (), H.querySelectorAll && function () { var a = m, b = H.createElement("div"), c = "__sizzle__"; if (b.innerHTML = "

", !b.querySelectorAll || 0 !== b.querySelectorAll(".TEST").length) { m = function (b, d, e, f) { if (d = d || H, !f && !m.isXML(d)) { var g = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b); if (g && (1 === d.nodeType || 9 === d.nodeType)) { if (g[1]) return s(d.getElementsByTagName(b), e); if (g[2] && o.find.CLASS && d.getElementsByClassName) return s(d.getElementsByClassName(g[2]), e) } if (9 === d.nodeType) { if ("body" === b && d.body) return s([d.body], e); if (g && g[3]) { var h = d.getElementById(g[3]); if (!h || !h.parentNode) return s([], e); if (h.id === g[3]) return s([h], e) } try { return s(d.querySelectorAll(b), e) } catch (a) {} } else if (1 === d.nodeType && "object" !== d.nodeName.toLowerCase()) { var i = d, j = d.getAttribute("id"), k = j || c, l = d.parentNode, n = /^\s*[+~]/.test(b); j ? k = k.replace(/'/g, "\\$&") : d.setAttribute("id", k), n && l && (d = d.parentNode); try { if (!n || l) return s(d.querySelectorAll("[id='" + k + "'] " + b), e) } catch (a) {} finally { j || i.removeAttribute("id") } } } return a(b, d, e, f) }; for (var d in a) m[d] = a[d]; b = null } } (), function () { var a = H.documentElement, b = a.matchesSelector || a.mozMatchesSelector || a.webkitMatchesSelector || a.msMatchesSelector; if (b) { var c = !b.call(H.createElement("div"), "div"), d = !1; try { b.call(H.documentElement, "[test!='']:sizzle") } catch (a) { d = !0 } m.matchesSelector = function (a, e) { if (e = e.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']"), !m.isXML(a)) try { if (d || !o.match.PSEUDO.test(e) && !/!=/.test(e)) { var f = b.call(a, e); if (f || !c || a.document && 11 !== a.document.nodeType) return f } } catch (a) {} return m(e, null, null, [a]).length > 0 } } } (), function () { var a = H.createElement("div"); if (a.innerHTML = "
", a.getElementsByClassName && 0 !== a.getElementsByClassName("e").length) { if (a.lastChild.className = "e", 1 === a.getElementsByClassName("e").length) return; o.order.splice(1, 0, "CLASS"), o.find.CLASS = function (a, b, c) { return "undefined" == typeof b.getElementsByClassName || c ? void 0 : b.getElementsByClassName(a[1]) }, a = null } } (), H.documentElement.contains ? m.contains = function (a, b) { return a !== b && (!a.contains || a.contains(b)) } : H.documentElement.compareDocumentPosition ? m.contains = function (a, b) { return !!(16 & a.compareDocumentPosition(b)) } : m.contains = function () { return !1 }, m.isXML = function (a) { var b = (a ? a.ownerDocument || a : 0).documentElement; return !!b && "HTML" !== b.nodeName }; var v = function (a, b, c) { for (var d, e = [], f = "", g = b.nodeType ? [b] : b; d = o.match.PSEUDO.exec(a); ) f += d[0], a = a.replace(o.match.PSEUDO, ""); a = o.relative[a] ? a + "*" : a; for (var h = 0, i = g.length; i > h; h++) m(a, g[h], e, c); return m.filter(f, e) }; m.attr = K.attr, m.selectors.attrMap = {}, K.find = m, K.expr = m.selectors, K.expr[":"] = K.expr.filters, K.unique = m.uniqueSort, K.text = m.getText, K.isXMLDoc = m.isXML, K.contains = m.contains } (); var ia = /Until$/, ja = /^(?:parents|prevUntil|prevAll)/, ka = /,/, la = /^.[^:#\[\.,]*$/, ma = Array.prototype.slice, na = K.expr.match.POS, oa = { children: !0, contents: !0, next: !0, prev: !0 }; K.fn.extend({ find: function (a) { var b, c, d = this; if ("string" != typeof a) return K(a).filter(function () { for (b = 0, c = d.length; c > b; b++) if (K.contains(d[b], this)) return !0 }); var e, f, g, h = this.pushStack("", "find", a); for (b = 0, c = this.length; c > b; b++) if (e = h.length, K.find(a, this[b], h), b > 0) for (f = e; f < h.length; f++) for (g = 0; e > g; g++) if (h[g] === h[f]) { h.splice(f--, 1); break } return h }, has: function (a) { var b = K(a); return this.filter(function () { for (var a = 0, c = b.length; c > a; a++) if (K.contains(this, b[a])) return !0 }) }, not: function (a) { return this.pushStack(z(this, a, !1), "not", a) }, filter: function (a) { return this.pushStack(z(this, a, !0), "filter", a) }, is: function (a) { return !!a && ("string" == typeof a ? na.test(a) ? K(a, this.context).index(this[0]) >= 0 : K.filter(a, this).length > 0 : this.filter(a).length > 0) }, closest: function (a, b) { var c, d, e = [], f = this[0]; if (K.isArray(a)) { for (var g = 1; f && f.ownerDocument && f !== b; ) { for (c = 0; c < a.length; c++) K(f).is(a[c]) && e.push({ selector: a[c], elem: f, level: g }); f = f.parentNode, g++ } return e } var h = na.test(a) || "string" != typeof a ? K(a, b || this.context) : 0; for (c = 0, d = this.length; d > c; c++) for (f = this[c]; f; ) { if (h ? h.index(f) > -1 : K.find.matchesSelector(f, a)) { e.push(f); break } if (f = f.parentNode, !f || !f.ownerDocument || f === b || 11 === f.nodeType) break } return e = e.length > 1 ? K.unique(e) : e, this.pushStack(e, "closest", a) }, index: function (a) { return a ? "string" == typeof a ? K.inArray(this[0], K(a)) : K.inArray(a.jquery ? a[0] : a, this) : this[0] && this[0].parentNode ? this.prevAll().length : -1 }, add: function (a, b) { var c = "string" == typeof a ? K(a, b) : K.makeArray(a && a.nodeType ? [a] : a), d = K.merge(this.get(), c); return this.pushStack(A(c[0]) || A(d[0]) ? d : K.unique(d)) }, andSelf: function () { return this.add(this.prevObject) } }), K.each({ parent: function (a) { var b = a.parentNode; return b && 11 !== b.nodeType ? b : null }, parents: function (a) { return K.dir(a, "parentNode") }, parentsUntil: function (a, b, c) { return K.dir(a, "parentNode", c) }, next: function (a) { return K.nth(a, 2, "nextSibling") }, prev: function (a) { return K.nth(a, 2, "previousSibling") }, nextAll: function (a) { return K.dir(a, "nextSibling") }, prevAll: function (a) { return K.dir(a, "previousSibling") }, nextUntil: function (a, b, c) { return K.dir(a, "nextSibling", c) }, prevUntil: function (a, b, c) { return K.dir(a, "previousSibling", c) }, siblings: function (a) { return K.sibling(a.parentNode.firstChild, a) }, children: function (a) { return K.sibling(a.firstChild) }, contents: function (a) { return K.nodeName(a, "iframe") ? a.contentDocument || a.contentWindow.document : K.makeArray(a.childNodes) } }, function (a, b) { K.fn[a] = function (c, d) { var e = K.map(this, b, c); return ia.test(a) || (d = c), d && "string" == typeof d && (e = K.filter(d, e)), e = this.length > 1 && !oa[a] ? K.unique(e) : e, (this.length > 1 || ka.test(d)) && ja.test(a) && (e = e.reverse()), this.pushStack(e, a, ma.call(arguments).join(",")) } }), K.extend({ filter: function (a, b, c) { return c && (a = ":not(" + a + ")"), 1 === b.length ? K.find.matchesSelector(b[0], a) ? [b[0]] : [] : K.find.matches(a, b) }, dir: function (a, c, d) { for (var e = [], f = a[c]; f && 9 !== f.nodeType && (d === b || 1 !== f.nodeType || !K(f).is(d)); ) 1 === f.nodeType && e.push(f), f = f[c]; return e }, nth: function (a, b, c) { b = b || 1; for (var d = 0; a && (1 !== a.nodeType || ++d !== b); a = a[c]); return a }, sibling: function (a, b) { for (var c = []; a; a = a.nextSibling) 1 === a.nodeType && a !== b && c.push(a); return c } }); var pa = "abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video", qa = / jQuery\d+="(?:\d+|null)"/g, ra = /^\s+/, sa = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, ta = /<([\w:]+)/, ua = /", ""], legend: [1, "
", "
"], thead: [1, "", "
"], tr: [2, "", "
"], td: [3, "", "
"], col: [2, "", "
"], area: [1, "", ""], _default: [0, "", ""] }, Da = y(H); Ca.optgroup = Ca.option, Ca.tbody = Ca.tfoot = Ca.colgroup = Ca.caption = Ca.thead, Ca.th = Ca.td, K.support.htmlSerialize || (Ca._default = [1, "div
", "
"]), K.fn.extend({ text: function (a) { return K.isFunction(a) ? this.each(function (b) { var c = K(this); c.text(a.call(this, b, c.text())) }) : "object" != typeof a && a !== b ? this.empty().append((this[0] && this[0].ownerDocument || H).createTextNode(a)) : K.text(this) }, wrapAll: function (a) { if (K.isFunction(a)) return this.each(function (b) { K(this).wrapAll(a.call(this, b)) }); if (this[0]) { var b = K(a, this[0].ownerDocument).eq(0).clone(!0); this[0].parentNode && b.insertBefore(this[0]), b.map(function () { for (var a = this; a.firstChild && 1 === a.firstChild.nodeType; ) a = a.firstChild; return a }).append(this) } return this }, wrapInner: function (a) { return K.isFunction(a) ? this.each(function (b) { K(this).wrapInner(a.call(this, b)) }) : this.each(function () { var b = K(this), c = b.contents(); c.length ? c.wrapAll(a) : b.append(a) }) }, wrap: function (a) { var b = K.isFunction(a); return this.each(function (c) { K(this).wrapAll(b ? a.call(this, c) : a) }) }, unwrap: function () { return this.parent().each(function () { K.nodeName(this, "body") || K(this).replaceWith(this.childNodes) }).end() }, append: function () { return this.domManip(arguments, !0, function (a) { 1 === this.nodeType && this.appendChild(a) }) }, prepend: function () { return this.domManip(arguments, !0, function (a) { 1 === this.nodeType && this.insertBefore(a, this.firstChild) }) }, before: function () { if (this[0] && this[0].parentNode) return this.domManip(arguments, !1, function (a) { this.parentNode.insertBefore(a, this) }); if (arguments.length) { var a = K.clean(arguments); return a.push.apply(a, this.toArray()), this.pushStack(a, "before", arguments) } }, after: function () { if (this[0] && this[0].parentNode) return this.domManip(arguments, !1, function (a) { this.parentNode.insertBefore(a, this.nextSibling) }); if (arguments.length) { var a = this.pushStack(this, "after", arguments); return a.push.apply(a, K.clean(arguments)), a } }, remove: function (a, b) { for (var c, d = 0; null != (c = this[d]); d++) (!a || K.filter(a, [c]).length) && (!b && 1 === c.nodeType && (K.cleanData(c.getElementsByTagName("*")), K.cleanData([c])), c.parentNode && c.parentNode.removeChild(c)); return this }, empty: function () { for (var a, b = 0; null != (a = this[b]); b++) for (1 === a.nodeType && K.cleanData(a.getElementsByTagName("*")); a.firstChild; ) a.removeChild(a.firstChild); return this }, clone: function (a, b) { return a = null != a && a, b = null == b ? a : b, this.map(function () { return K.clone(this, a, b) }) }, html: function (a) { if (a === b) return this[0] && 1 === this[0].nodeType ? this[0].innerHTML.replace(qa, "") : null; if ("string" != typeof a || wa.test(a) || !K.support.leadingWhitespace && ra.test(a) || Ca[(ta.exec(a) || ["", ""])[1].toLowerCase()]) K.isFunction(a) ? this.each(function (b) { var c = K(this); c.html(a.call(this, b, c.html())) }) : this.empty().append(a); else { a = a.replace(sa, "<$1>"); try { for (var c = 0, d = this.length; d > c; c++) 1 === this[c].nodeType && (K.cleanData(this[c].getElementsByTagName("*")), this[c].innerHTML = a) } catch (b) { this.empty().append(a) } } return this }, replaceWith: function (a) { return this[0] && this[0].parentNode ? K.isFunction(a) ? this.each(function (b) { var c = K(this), d = c.html(); c.replaceWith(a.call(this, b, d)) }) : ("string" != typeof a && (a = K(a).detach()), this.each(function () { var b = this.nextSibling, c = this.parentNode; K(this).remove(), b ? K(b).before(a) : K(c).append(a) })) : this.length ? this.pushStack(K(K.isFunction(a) ? a() : a), "replaceWith", a) : this }, detach: function (a) { return this.remove(a, !0) }, domManip: function (a, c, d) { var e, f, g, h, i = a[0], j = []; if (!K.support.checkClone && 3 === arguments.length && "string" == typeof i && za.test(i)) return this.each(function () { K(this).domManip(a, c, d, !0) }); if (K.isFunction(i)) return this.each(function (e) { var f = K(this); a[0] = i.call(this, e, c ? f.html() : b), f.domManip(a, c, d) }); if (this[0]) { if (h = i && i.parentNode, e = K.support.parentNode && h && 11 === h.nodeType && h.childNodes.length === this.length ? { fragment: h } : K.buildFragment(a, this, j), g = e.fragment, f = 1 === g.childNodes.length ? g = g.firstChild : g.firstChild) { c = c && K.nodeName(f, "tr"); for (var k = 0, l = this.length, m = l - 1; l > k; k++) d.call(c ? x(this[k], f) : this[k], e.cacheable || l > 1 && m > k ? K.clone(g, !0, !0) : g) } j.length && K.each(j, q) } return this } }), K.buildFragment = function (a, b, c) { var d, e, f, g, h = a[0]; return b && b[0] && (g = b[0].ownerDocument || b[0]), g.createDocumentFragment || (g = H), 1 === a.length && "string" == typeof h && h.length < 512 && g === H && "<" === h.charAt(0) && !xa.test(h) && (K.support.checkClone || !za.test(h)) && (K.support.html5Clone || !ya.test(h)) && (e = !0, f = K.fragments[h], f && 1 !== f && (d = f)), d || (d = g.createDocumentFragment(), K.clean(a, g, d, c)), e && (K.fragments[h] = f ? d : 1), { fragment: d, cacheable: e } }, K.fragments = {}, K.each({ appendTo: "append", prependTo: "prepend", insertBefore: "before", insertAfter: "after", replaceAll: "replaceWith" }, function (a, b) { K.fn[a] = function (c) { var d = [], e = K(c), f = 1 === this.length && this[0].parentNode; if (f && 11 === f.nodeType && 1 === f.childNodes.length && 1 === e.length) return e[b](this[0]), this; for (var g = 0, h = e.length; h > g; g++) { var i = (g > 0 ? this.clone(!0) : this).get(); K(e[g])[b](i), d = d.concat(i) } return this.pushStack(d, a, e.selector) } }), K.extend({ clone: function (a, b, c) { var d, e, f, g = K.support.html5Clone || !ya.test("<" + a.nodeName) ? a.cloneNode(!0) : r(a); if (!(K.support.noCloneEvent && K.support.noCloneChecked || 1 !== a.nodeType && 11 !== a.nodeType || K.isXMLDoc(a))) for (v(a, g), d = u(a), e = u(g), f = 0; d[f]; ++f) e[f] && v(d[f], e[f]); if (b && (w(a, g), c)) for (d = u(a), e = u(g), f = 0; d[f]; ++f) w(d[f], e[f]); return d = e = null, g }, clean: function (a, b, c, d) { var e; b = b || H, "undefined" == typeof b.createElement && (b = b.ownerDocument || b[0] && b[0].ownerDocument || H); for (var f, g, h = [], i = 0; null != (g = a[i]); i++) if ("number" == typeof g && (g += ""), g) { if ("string" == typeof g) if (va.test(g)) { g = g.replace(sa, "<$1>"); var j = (ta.exec(g) || ["", ""])[1].toLowerCase(), k = Ca[j] || Ca._default, l = k[0], m = b.createElement("div"); for (b === H ? Da.appendChild(m) : y(b).appendChild(m), m.innerHTML = k[1] + g + k[2]; l--; ) m = m.lastChild; if (!K.support.tbody) { var n = ua.test(g), o = "table" !== j || n ? "" !== k[1] || n ? [] : m.childNodes : m.firstChild && m.firstChild.childNodes; for (f = o.length - 1; f >= 0; --f) K.nodeName(o[f], "tbody") && !o[f].childNodes.length && o[f].parentNode.removeChild(o[f]) } !K.support.leadingWhitespace && ra.test(g) && m.insertBefore(b.createTextNode(ra.exec(g)[0]), m.firstChild), g = m.childNodes } else g = b.createTextNode(g); var p; if (!K.support.appendChecked) if (g[0] && "number" == typeof(p = g.length)) for (f = 0; p > f; f++) s(g[f]); else s(g); g.nodeType ? h.push(g) : h = K.merge(h, g) } if (c) for (e = function (a) { return !a.type || Aa.test(a.type) }, i = 0; h[i]; i++) if (!d || !K.nodeName(h[i], "script") || h[i].type && "text/javascript" !== h[i].type.toLowerCase()) { if (1 === h[i].nodeType) { var q = K.grep(h[i].getElementsByTagName("script"), e); h.splice.apply(h, [i + 1, 0].concat(q)) } c.appendChild(h[i]) } else d.push(h[i].parentNode ? h[i].parentNode.removeChild(h[i]) : h[i]); return h }, cleanData: function (a) { for (var b, c, d, e = K.cache, f = K.event.special, g = K.support.deleteExpando, h = 0; null != (d = a[h]); h++) if ((!d.nodeName || !K.noData[d.nodeName.toLowerCase()]) && (c = d[K.expando])) { if (b = e[c], b && b.events) { for (var i in b.events) f[i] ? K.event.remove(d, i) : K.removeEvent(d, i, b.handle); b.handle && (b.handle.elem = null) } g ? delete d[K.expando] : d.removeAttribute && d.removeAttribute(K.expando), delete e[c] } } }); var Ea, Fa, Ga, Ha = /alpha\([^)]*\)/i, Ia = /opacity=([^)]*)/, Ja = /([A-Z]|^ms)/g, Ka = /^-?\d+(?:px)?$/i, La = /^-?\d/, Ma = /^([\-+])=([\-+.\de]+)/, Na = { position: "absolute", visibility: "hidden", display: "block" }, Oa = ["Left", "Right"], Pa = ["Top", "Bottom"]; K.fn.css = function (a, c) { return 2 === arguments.length && c === b ? this : K.access(this, a, c, !0, function (a, c, d) { return d !== b ? K.style(a, c, d) : K.css(a, c) }) }, K.extend({ cssHooks: { opacity: { get: function (a, b) { if (b) { var c = Ea(a, "opacity", "opacity"); return "" === c ? "1" : c } return a.style.opacity } } }, cssNumber: { fillOpacity: !0, fontWeight: !0, lineHeight: !0, opacity: !0, orphans: !0, widows: !0, zIndex: !0, zoom: !0 }, cssProps: { float: K.support.cssFloat ? "cssFloat" : "styleFloat" }, style: function (a, c, d, e) { if (a && 3 !== a.nodeType && 8 !== a.nodeType && a.style) { var f, g, h = K.camelCase(c), i = a.style, j = K.cssHooks[h]; if (c = K.cssProps[h] || h, d === b) return j && "get" in j && (f = j.get(a, !1, e)) !== b ? f : i[c]; if (g = typeof d, "string" === g && (f = Ma.exec(d)) && (d = + (f[1] + 1) * +f[2] + parseFloat(K.css(a, c)), g = "number"), null == d || "number" === g && isNaN(d)) return; if ("number" === g && !K.cssNumber[h] && (d += "px"), !(j && "set" in j && (d = j.set(a, d)) === b)) try { i[c] = d } catch (a) {} } }, css: function (a, c, d) { var e, f; return c = K.camelCase(c), f = K.cssHooks[c], c = K.cssProps[c] || c, "cssFloat" === c && (c = "float"), f && "get" in f && (e = f.get(a, !0, d)) !== b ? e : Ea ? Ea(a, c) : void 0 }, swap: function (a, b, c) { var d = {}; for (var e in b) d[e] = a.style[e], a.style[e] = b[e]; c.call(a); for (e in b) a.style[e] = d[e] } }), K.curCSS = K.css, K.each(["height", "width"], function (a, b) { K.cssHooks[b] = { get: function (a, c, d) { var e; return c ? 0 !== a.offsetWidth ? p(a, b, d) : (K.swap(a, Na, function () { e = p(a, b, d) }), e) : void 0 }, set: function (a, b) { return Ka.test(b) ? (b = parseFloat(b), b >= 0 ? b + "px" : void 0) : b } } }), K.support.opacity || (K.cssHooks.opacity = { get: function (a, b) { return Ia.test((b && a.currentStyle ? a.currentStyle.filter : a.style.filter) || "") ? parseFloat(RegExp.$1) / 100 + "" : b ? "1" : "" }, set: function (a, b) { var c = a.style, d = a.currentStyle, e = K.isNumeric(b) ? "alpha(opacity=" + 100 * b + ")" : "", f = d && d.filter || c.filter || ""; c.zoom = 1, b >= 1 && "" === K.trim(f.replace(Ha, "")) && (c.removeAttribute("filter"), d && !d.filter) || (c.filter = Ha.test(f) ? f.replace(Ha, e) : f + " " + e) } }), K(function () { K.support.reliableMarginRight || (K.cssHooks.marginRight = { get: function (a, b) { var c; return K.swap(a, { display: "inline-block" }, function () { c = b ? Ea(a, "margin-right", "marginRight") : a.style.marginRight }), c } }) }), H.defaultView && H.defaultView.getComputedStyle && (Fa = function (a, b) { var c, d, e; return b = b.replace(Ja, "-$1").toLowerCase(), (d = a.ownerDocument.defaultView) && (e = d.getComputedStyle(a, null)) && (c = e.getPropertyValue(b), "" === c && !K.contains(a.ownerDocument.documentElement, a) && (c = K.style(a, b))), c }), H.documentElement.currentStyle && (Ga = function (a, b) { var c, d, e, f = a.currentStyle && a.currentStyle[b], g = a.style; return null === f && g && (e = g[b]) && (f = e), !Ka.test(f) && La.test(f) && (c = g.left, d = a.runtimeStyle && a.runtimeStyle.left, d && (a.runtimeStyle.left = a.currentStyle.left), g.left = "fontSize" === b ? "1em" : f || 0, f = g.pixelLeft + "px", g.left = c, d && (a.runtimeStyle.left = d)), "" === f ? "auto" : f }), Ea = Fa || Ga, K.expr && K.expr.filters && (K.expr.filters.hidden = function (a) { var b = a.offsetWidth, c = a.offsetHeight; return 0 === b && 0 === c || !K.support.reliableHiddenOffsets && "none" === (a.style && a.style.display || K.css(a, "display")) }, K.expr.filters.visible = function (a) { return !K.expr.filters.hidden(a) }); var Qa, Ra, Sa = /%20/g, Ta = /\[\]$/, Ua = /\r?\n/g, Va = /#.*$/, Wa = /^(.*?):[ \t]*([^\r\n]*)\r?$/gm, Xa = /^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i, Ya = /^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/, Za = /^(?:GET|HEAD)$/, $a = /^\/\//, _a = /\?/, ab = /)<[^<]*)*<\/script>/gi, bb = /^(?:select|textarea)/i, cb = /\s+/, db = /([?&])_=[^&]*/, eb = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/, fb = K.fn.load, gb = {}, hb = {}, ib = ["*/"] + ["*"]; try { Qa = J.href } catch (a) { Qa = H.createElement("a"), Qa.href = "", Qa = Qa.href } Ra = eb.exec(Qa.toLowerCase()) || [], K.fn.extend({ load: function (a, c, d) { if ("string" != typeof a && fb) return fb.apply(this, arguments); if (!this.length) return this; var e = a.indexOf(" "); if (e >= 0) { var f = a.slice(e, a.length); a = a.slice(0, e) } var g = "GET"; c && (K.isFunction(c) ? (d = c, c = b) : "object" == typeof c && (c = K.param(c, K.ajaxSettings.traditional), g = "POST")); var h = this; return K.ajax({ url: a, type: g, dataType: "html", data: c, complete: function (a, b, c) { c = a.responseText, a.isResolved() && (a.done(function (a) { c = a }), h.html(f ? K("
").append(c.replace(ab, "")).find(f) : c)), d && h.each(d, [c, b, a]) } }), this }, serialize: function () { return K.param(this.serializeArray()) }, serializeArray: function () { return this.map(function () { return this.elements ? K.makeArray(this.elements) : this }).filter(function () { return this.name && !this.disabled && (this.checked || bb.test(this.nodeName) || Xa.test(this.type)) }).map(function (a, b) { var c = K(this).val(); return null == c ? null : K.isArray(c) ? K.map(c, function (a) { return { name: b.name, value: a.replace(Ua, "\r\n") } }) : { name: b.name, value: c.replace(Ua, "\r\n") } }).get() } }), K.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "), function (a, b) { K.fn[b] = function (a) { return this.on(b, a) } }), K.each(["get", "post"], function (a, c) { K[c] = function (a, d, e, f) { return K.isFunction(d) && (f = f || e, e = d, d = b), K.ajax({ type: c, url: a, data: d, success: e, dataType: f }) } }), K.extend({ getScript: function (a, c) { return K.get(a, b, c, "script") }, getJSON: function (a, b, c) { return K.get(a, b, c, "json") }, ajaxSetup: function (a, b) { return b ? m(a, K.ajaxSettings) : (b = a, a = K.ajaxSettings), m(a, b), a }, ajaxSettings: { url: Qa, isLocal: Ya.test(Ra[1]), global: !0, type: "GET", contentType: "application/x-www-form-urlencoded", processData: !0, async: !0, accepts: { xml: "application/xml, text/xml", html: "text/html", text: "text/plain", json: "application/json, text/javascript", "*": ib }, contents: { xml: /xml/, html: /html/, json: /json/ }, responseFields: { xml: "responseXML", text: "responseText" }, converters: { "* text": a.String, "text html": !0, "text json": K.parseJSON, "text xml": K.parseXML }, flatOptions: { context: !0, url: !0 } }, ajaxPrefilter: o(gb), ajaxTransport: o(hb), ajax: function (a, c) { function d(a, c, d, g) { if (2 !== x) { x = 2, i && clearTimeout(i), h = b, f = g || "", y.readyState = a > 0 ? 4 : 0; var l, n, o, v, w, z = c, A = d ? k(p, y, d) : b; if (a >= 200 && 300 > a || 304 === a) if (p.ifModified && ((v = y.getResponseHeader("Last-Modified")) && (K.lastModified[e] = v), (w = y.getResponseHeader("Etag")) && (K.etag[e] = w)), 304 === a) z = "notmodified", l = !0; else try { n = j(p, A), z = "success", l = !0 } catch (a) { z = "parsererror", o = a } else o = z, (!z || a) && (z = "error", 0 > a && (a = 0)); y.status = a, y.statusText = "" + (c || z), l ? s.resolveWith(q, [n, z, y]) : s.rejectWith(q, [y, z, o]), y.statusCode(u), u = b, m && r.trigger("ajax" + (l ? "Success" : "Error"), [y, p, l ? n : o]), t.fireWith(q, [y, z]), m && (r.trigger("ajaxComplete", [y, p]), --K.active || K.event.trigger("ajaxStop")) } } "object" == typeof a && (c = a, a = b), c = c || {}; var e, f, g, h, i, l, m, o, p = K.ajaxSetup({}, c), q = p.context || p, r = q !== p && (q.nodeType || q instanceof K) ? K(q) : K.event, s = K.Deferred(), t = K.Callbacks("once memory"), u = p.statusCode || {}, v = {}, w = {}, x = 0, y = { readyState: 0, setRequestHeader: function (a, b) { if (!x) { var c = a.toLowerCase(); a = w[c] = w[c] || a, v[a] = b } return this }, getAllResponseHeaders: function () { return 2 === x ? f : null }, getResponseHeader: function (a) { var c; if (2 === x) { if (!g) for (g = {}; c = Wa.exec(f); ) g[c[1].toLowerCase()] = c[2]; c = g[a.toLowerCase()] } return c === b ? null : c }, overrideMimeType: function (a) { return x || (p.mimeType = a), this }, abort: function (a) { return a = a || "abort", h && h.abort(a), d(0, a), this } }; if (s.promise(y), y.success = y.done, y.error = y.fail, y.complete = t.add, y.statusCode = function (a) { if (a) { var b; if (2 > x) for (b in a) u[b] = [u[b], a[b]]; else b = a[y.status], y.then(b, b) } return this }, p.url = ((a || p.url) + "").replace(Va, "").replace($a, Ra[1] + "//"), p.dataTypes = K.trim(p.dataType || "*").toLowerCase().split(cb), null == p.crossDomain && (l = eb.exec(p.url.toLowerCase()), p.crossDomain = !(!l || l[1] == Ra[1] && l[2] == Ra[2] && (l[3] || ("http:" === l[1] ? 80 : 443)) == (Ra[3] || ("http:" === Ra[1] ? 80 : 443)))), p.data && p.processData && "string" != typeof p.data && (p.data = K.param(p.data, p.traditional)), n(gb, p, c, y), 2 === x) return !1; if (m = p.global, p.type = p.type.toUpperCase(), p.hasContent = !Za.test(p.type), m && 0 === K.active++ && K.event.trigger("ajaxStart"), !p.hasContent && (p.data && (p.url += (_a.test(p.url) ? "&" : "?") + p.data, delete p.data), e = p.url, p.cache === !1)) { var z = K.now(), A = p.url.replace(db, "$1_=" + z); p.url = A + (A === p.url ? (_a.test(p.url) ? "&" : "?") + "_=" + z : "") } (p.data && p.hasContent && p.contentType !== !1 || c.contentType) && y.setRequestHeader("Content-Type", p.contentType), p.ifModified && (e = e || p.url, K.lastModified[e] && y.setRequestHeader("If-Modified-Since", K.lastModified[e]), K.etag[e] && y.setRequestHeader("If-None-Match", K.etag[e])), y.setRequestHeader("Accept", p.dataTypes[0] && p.accepts[p.dataTypes[0]] ? p.accepts[p.dataTypes[0]] + ("*" !== p.dataTypes[0] ? ", " + ib + "; q=0.01" : "") : p.accepts["*"]); for (o in p.headers) y.setRequestHeader(o, p.headers[o]); if (p.beforeSend && (p.beforeSend.call(q, y, p) === !1 || 2 === x)) return y.abort(), !1; for (o in { success: 1, error: 1, complete: 1 }) y[o](p[o]); if (h = n(hb, p, c, y)) { y.readyState = 1, m && r.trigger("ajaxSend", [y, p]), p.async && p.timeout > 0 && (i = setTimeout(function () { y.abort("timeout") }, p.timeout)); try { x = 1, h.send(v, d) } catch (a) { if (!(2 > x)) throw a; d(-1, a) } } else d(-1, "No Transport"); return y }, param: function (a, c) { var d = [], e = function (a, b) { b = K.isFunction(b) ? b() : b, d[d.length] = encodeURIComponent(a) + "=" + encodeURIComponent(b) }; if (c === b && (c = K.ajaxSettings.traditional), K.isArray(a) || a.jquery && !K.isPlainObject(a)) K.each(a, function () { e(this.name, this.value) }); else for (var f in a) l(f, a[f], c, e); return d.join("&").replace(Sa, "+") } }), K.extend({ active: 0, lastModified: {}, etag: {} }); var jb = K.now(), kb = /(\=)\?(&|$)|\?\?/i; K.ajaxSetup({ jsonp: "callback", jsonpCallback: function () { return K.expando + "_" + jb++ } }), K.ajaxPrefilter("json jsonp", function (b, c, d) { var e = "application/x-www-form-urlencoded" === b.contentType && "string" == typeof b.data; if ("jsonp" === b.dataTypes[0] || b.jsonp !== !1 && (kb.test(b.url) || e && kb.test(b.data))) { var f, g = b.jsonpCallback = K.isFunction(b.jsonpCallback) ? b.jsonpCallback() : b.jsonpCallback, h = a[g], i = b.url, j = b.data, k = "$1" + g + "$2"; return b.jsonp !== !1 && (i = i.replace(kb, k), b.url === i && (e && (j = j.replace(kb, k)), b.data === j && (i += (/\?/.test(i) ? "&" : "?") + b.jsonp + "=" + g))), b.url = i, b.data = j, a[g] = function (a) { f = [a] }, d.always(function () { a[g] = h, f && K.isFunction(h) && a[g](f[0]) }), b.converters["script json"] = function () { return f || K.error(g + " was not called"), f[0] }, b.dataTypes[0] = "json", "script" } }), K.ajaxSetup({ accepts: { script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript" }, contents: { script: /javascript|ecmascript/ }, converters: { "text script": function (a) { return K.globalEval(a), a } } }), K.ajaxPrefilter("script", function (a) { a.cache === b && (a.cache = !1), a.crossDomain && (a.type = "GET", a.global = !1) }), K.ajaxTransport("script", function (a) { if (a.crossDomain) { var c, d = H.head || H.getElementsByTagName("head")[0] || H.documentElement; return { send: function (e, f) { c = H.createElement("script"), c.async = "async", a.scriptCharset && (c.charset = a.scriptCharset), c.src = a.url, c.onload = c.onreadystatechange = function (a, e) { (e || !c.readyState || /loaded|complete/.test(c.readyState)) && (c.onload = c.onreadystatechange = null, d && c.parentNode && d.removeChild(c), c = b, e || f(200, "success")) }, d.insertBefore(c, d.firstChild) }, abort: function () { c && c.onload(0, 1) } } } }); var lb, mb = !!a.ActiveXObject && function () { for (var a in lb) lb[a](0, 1) }, nb = 0; K.ajaxSettings.xhr = a.ActiveXObject ? function () { return !this.isLocal && i() || h() } : i, function (a) { K.extend(K.support, { ajax: !!a, cors: !!a && "withCredentials" in a }) } (K.ajaxSettings.xhr()), K.support.ajax && K.ajaxTransport(function (c) { if (!c.crossDomain || K.support.cors) { var d; return { send: function (e, f) { var g, h, i = c.xhr(); if (c.username ? i.open(c.type, c.url, c.async, c.username, c.password) : i.open(c.type, c.url, c.async), c.xhrFields) for (h in c.xhrFields) i[h] = c.xhrFields[h]; c.mimeType && i.overrideMimeType && i.overrideMimeType(c.mimeType), !c.crossDomain && !e["X-Requested-With"] && (e["X-Requested-With"] = "XMLHttpRequest"); try { for (h in e) i.setRequestHeader(h, e[h]) } catch (a) {} i.send(c.hasContent && c.data || null), d = function (a, e) { var h, j, k, l, m; try { if (d && (e || 4 === i.readyState)) if (d = b, g && (i.onreadystatechange = K.noop, mb && delete lb[g]), e) 4 !== i.readyState && i.abort(); else { h = i.status, k = i.getAllResponseHeaders(), l = {}, m = i.responseXML, m && m.documentElement && (l.xml = m), l.text = i.responseText; try { j = i.statusText } catch (a) { j = "" } h || !c.isLocal || c.crossDomain ? 1223 === h && (h = 204) : h = l.text ? 200 : 404 } } catch (a) { e || f(-1, a) } l && f(h, j, l, k) }, c.async && 4 !== i.readyState ? (g = ++nb, mb && (lb || (lb = {}, K(a).unload(mb)), lb[g] = d), i.onreadystatechange = d) : d() }, abort: function () { d && d(0, 1) } } } }); var ob, pb, qb, rb, sb = {}, tb = /^(?:toggle|show|hide)$/, ub = /^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i, vb = [["height", "marginTop", "marginBottom", "paddingTop", "paddingBottom"], ["width", "marginLeft", "marginRight", "paddingLeft", "paddingRight"], ["opacity"]]; K.fn.extend({ show: function (a, b, c) { var f, g; if (a || 0 === a) return this.animate(e("show", 3), a, b, c); for (var h = 0, i = this.length; i > h; h++) f = this[h], f.style && (g = f.style.display, !K._data(f, "olddisplay") && "none" === g && (g = f.style.display = ""), "" === g && "none" === K.css(f, "display") && K._data(f, "olddisplay", d(f.nodeName))); for (h = 0; i > h; h++) f = this[h], f.style && (g = f.style.display, ("" === g || "none" === g) && (f.style.display = K._data(f, "olddisplay") || "")); return this }, hide: function (a, b, c) { if (a || 0 === a) return this.animate(e("hide", 3), a, b, c); for (var d, f, g = 0, h = this.length; h > g; g++) d = this[g], d.style && (f = K.css(d, "display"), "none" !== f && !K._data(d, "olddisplay") && K._data(d, "olddisplay", f)); for (g = 0; h > g; g++) this[g].style && (this[g].style.display = "none"); return this }, _toggle: K.fn.toggle, toggle: function (a, b, c) { var d = "boolean" == typeof a; return K.isFunction(a) && K.isFunction(b) ? this._toggle.apply(this, arguments) : null == a || d ? this.each(function () { var b = d ? a : K(this).is(":hidden"); K(this)[b ? "show" : "hide"]() }) : this.animate(e("toggle", 3), a, b, c), this }, fadeTo: function (a, b, c, d) { return this.filter(":hidden").css("opacity", 0).show().end().animate({ opacity: b }, a, c, d) }, animate: function (a, b, c, e) { function f() { g.queue === !1 && K._mark(this); var b, c, e, f, h, i, j, k, l, m = K.extend({}, g), n = 1 === this.nodeType, o = n && K(this).is(":hidden"); m.animatedProperties = {}; for (e in a) { if (b = K.camelCase(e), e !== b && (a[b] = a[e], delete a[e]), c = a[b], K.isArray(c) ? (m.animatedProperties[b] = c[1], c = a[b] = c[0]) : m.animatedProperties[b] = m.specialEasing && m.specialEasing[b] || m.easing || "swing", "hide" === c && o || "show" === c && !o) return m.complete.call(this); n && ("height" === b || "width" === b) && (m.overflow = [this.style.overflow, this.style.overflowX, this.style.overflowY], "inline" === K.css(this, "display") && "none" === K.css(this, "float") && (K.support.inlineBlockNeedsLayout && "inline" !== d(this.nodeName) ? this.style.zoom = 1 : this.style.display = "inline-block")) } null != m.overflow && (this.style.overflow = "hidden"); for (e in a) f = new K.fx(this, m, e), c = a[e], tb.test(c) ? (l = K._data(this, "toggle" + e) || ("toggle" === c ? o ? "show" : "hide" : 0), l ? (K._data(this, "toggle" + e, "show" === l ? "hide" : "show"), f[l]()) : f[c]()) : (h = ub.exec(c), i = f.cur(), h ? (j = parseFloat(h[2]), k = h[3] || (K.cssNumber[e] ? "" : "px"), "px" !== k && (K.style(this, e, (j || 1) + k), i = (j || 1) / f.cur() * i, K.style(this, e, i + k)), h[1] && (j = ("-=" === h[1] ? -1 : 1) * j + i), f.custom(i, j, k)) : f.custom(i, c, "")); return !0 } var g = K.speed(b, c, e); return K.isEmptyObject(a) ? this.each(g.complete, [!1]) : (a = K.extend({}, a), g.queue === !1 ? this.each(f) : this.queue(g.queue, f)) }, stop: function (a, c, d) { return "string" != typeof a && (d = c, c = a, a = b), c && a !== !1 && this.queue(a || "fx", []), this.each(function () { function b(a, b, c) { var e = b[c]; K.removeData(a, c, !0), e.stop(d) } var c, e = !1, f = K.timers, g = K._data(this); if (d || K._unmark(!0, this), null == a) for (c in g) g[c] && g[c].stop && c.indexOf(".run") === c.length - 4 && b(this, g, c); else g[c = a + ".run"] && g[c].stop && b(this, g, c); for (c = f.length; c--; ) f[c].elem === this && (null == a || f[c].queue === a) && (d ? f[c](!0) : f[c].saveState(), e = !0, f.splice(c, 1)); (!d || !e) && K.dequeue(this, a) }) } }), K.each({ slideDown: e("show", 1), slideUp: e("hide", 1), slideToggle: e("toggle", 1), fadeIn: { opacity: "show" }, fadeOut: { opacity: "hide" }, fadeToggle: { opacity: "toggle" } }, function (a, b) { K.fn[a] = function (a, c, d) { return this.animate(b, a, c, d) } }), K.extend({ speed: function (a, b, c) { var d = a && "object" == typeof a ? K.extend({}, a) : { complete: c || !c && b || K.isFunction(a) && a, duration: a, easing: c && b || b && !K.isFunction(b) && b }; return d.duration = K.fx.off ? 0 : "number" == typeof d.duration ? d.duration : d.duration in K.fx.speeds ? K.fx.speeds[d.duration] : K.fx.speeds._default, (null == d.queue || d.queue === !0) && (d.queue = "fx"), d.old = d.complete, d.complete = function (a) { K.isFunction(d.old) && d.old.call(this), d.queue ? K.dequeue(this, d.queue) : a !== !1 && K._unmark(this) }, d }, easing: { linear: function (a, b, c, d) { return c + d * a }, swing: function (a, b, c, d) { return (-Math.cos(a * Math.PI) / 2 + .5) * d + c } }, timers: [], fx: function (a, b, c) { this.options = b, this.elem = a, this.prop = c, b.orig = b.orig || {} } }), K.fx.prototype = { update: function () { this.options.step && this.options.step.call(this.elem, this.now, this), (K.fx.step[this.prop] || K.fx.step._default)(this) }, cur: function () { if (null != this.elem[this.prop] && (!this.elem.style || null == this.elem.style[this.prop])) return this.elem[this.prop]; var a, b = K.css(this.elem, this.prop); return isNaN(a = parseFloat(b)) ? b && "auto" !== b ? b : 0 : a }, custom: function (a, c, d) { function e(a) { return f.step(a) } var f = this, h = K.fx; this.startTime = rb || g(), this.end = c, this.now = this.start = a, this.pos = this.state = 0, this.unit = d || this.unit || (K.cssNumber[this.prop] ? "" : "px"), e.queue = this.options.queue, e.elem = this.elem, e.saveState = function () { f.options.hide && K._data(f.elem, "fxshow" + f.prop) === b && K._data(f.elem, "fxshow" + f.prop, f.start) }, e() && K.timers.push(e) && !qb && (qb = setInterval(h.tick, h.interval)) }, show: function () { var a = K._data(this.elem, "fxshow" + this.prop); this.options.orig[this.prop] = a || K.style(this.elem, this.prop), this.options.show = !0, a !== b ? this.custom(this.cur(), a) : this.custom("width" === this.prop || "height" === this.prop ? 1 : 0, this.cur()), K(this.elem).show() }, hide: function () { this.options.orig[this.prop] = K._data(this.elem, "fxshow" + this.prop) || K.style(this.elem, this.prop), this.options.hide = !0, this.custom(this.cur(), 0) }, step: function (a) { var b, c, d, e = rb || g(), f = !0, h = this.elem, i = this.options; if (a || e >= i.duration + this.startTime) { this.now = this.end, this.pos = this.state = 1, this.update(), i.animatedProperties[this.prop] = !0; for (b in i.animatedProperties) i.animatedProperties[b] !== !0 && (f = !1); if (f) { if (null != i.overflow && !K.support.shrinkWrapBlocks && K.each(["", "X", "Y"], function (a, b) { h.style["overflow" + b] = i.overflow[a] }), i.hide && K(h).hide(), i.hide || i.show) for (b in i.animatedProperties) K.style(h, b, i.orig[b]), K.removeData(h, "fxshow" + b, !0), K.removeData(h, "toggle" + b, !0); d = i.complete, d && (i.complete = !1, d.call(h)) } return !1 } return i.duration == 1 / 0 ? this.now = e : (c = e - this.startTime, this.state = c / i.duration, this.pos = K.easing[i.animatedProperties[this.prop]](this.state, c, 0, 1, i.duration), this.now = this.start + (this.end - this.start) * this.pos), this.update(), !0 } }, K.extend(K.fx, { tick: function () { for (var a, b = K.timers, c = 0; c < b.length; c++) a = b[c], !a() && b[c] === a && b.splice(c--, 1); b.length || K.fx.stop() }, interval: 13, stop: function () { clearInterval(qb), qb = null }, speeds: { slow: 600, fast: 200, _default: 400 }, step: { opacity: function (a) { K.style(a.elem, "opacity", a.now) }, _default: function (a) { a.elem.style && null != a.elem.style[a.prop] ? a.elem.style[a.prop] = a.now + a.unit : a.elem[a.prop] = a.now } } }), K.each(["width", "height"], function (a, b) { K.fx.step[b] = function (a) { K.style(a.elem, b, Math.max(0, a.now) + a.unit) } }), K.expr && K.expr.filters && (K.expr.filters.animated = function (a) { return K.grep(K.timers, function (b) { return a === b.elem }).length }); var wb = /^t(?:able|d|h)$/i, xb = /^(?:body|html)$/i; "getBoundingClientRect" in H.documentElement ? K.fn.offset = function (a) { var b, d = this[0]; if (a) return this.each(function (b) { K.offset.setOffset(this, a, b) }); if (!d || !d.ownerDocument) return null; if (d === d.ownerDocument.body) return K.offset.bodyOffset(d); try { b = d.getBoundingClientRect() } catch (a) {} var e = d.ownerDocument, f = e.documentElement; if (!b || !K.contains(f, d)) return b ? { top: b.top, left: b.left } : { top: 0, left: 0 }; var g = e.body, h = c(e), i = f.clientTop || g.clientTop || 0, j = f.clientLeft || g.clientLeft || 0, k = h.pageYOffset || K.support.boxModel && f.scrollTop || g.scrollTop, l = h.pageXOffset || K.support.boxModel && f.scrollLeft || g.scrollLeft, m = b.top + k - i, n = b.left + l - j; return { top: m, left: n } } : K.fn.offset = function (a) { var b = this[0]; if (a) return this.each(function (b) { K.offset.setOffset(this, a, b) }); if (!b || !b.ownerDocument) return null; if (b === b.ownerDocument.body) return K.offset.bodyOffset(b); for (var c, d = b.offsetParent, e = b, f = b.ownerDocument, g = f.documentElement, h = f.body, i = f.defaultView, j = i ? i.getComputedStyle(b, null) : b.currentStyle, k = b.offsetTop, l = b.offsetLeft; (b = b.parentNode) && b !== h && b !== g && (!K.support.fixedPosition || "fixed" !== j.position); ) c = i ? i.getComputedStyle(b, null) : b.currentStyle, k -= b.scrollTop, l -= b.scrollLeft, b === d && (k += b.offsetTop, l += b.offsetLeft, K.support.doesNotAddBorder && (!K.support.doesAddBorderForTableAndCells || !wb.test(b.nodeName)) && (k += parseFloat(c.borderTopWidth) || 0, l += parseFloat(c.borderLeftWidth) || 0), e = d, d = b.offsetParent), K.support.subtractsBorderForOverflowNotVisible && "visible" !== c.overflow && (k += parseFloat(c.borderTopWidth) || 0, l += parseFloat(c.borderLeftWidth) || 0), j = c; return ("relative" === j.position || "static" === j.position) && (k += h.offsetTop, l += h.offsetLeft), K.support.fixedPosition && "fixed" === j.position && (k += Math.max(g.scrollTop, h.scrollTop), l += Math.max(g.scrollLeft, h.scrollLeft)), { top: k, left: l } }, K.offset = { bodyOffset: function (a) { var b = a.offsetTop, c = a.offsetLeft; return K.support.doesNotIncludeMarginInBodyOffset && (b += parseFloat(K.css(a, "marginTop")) || 0, c += parseFloat(K.css(a, "marginLeft")) || 0), { top: b, left: c } }, setOffset: function (a, b, c) { var d = K.css(a, "position"); "static" === d && (a.style.position = "relative"); var e, f, g = K(a), h = g.offset(), i = K.css(a, "top"), j = K.css(a, "left"), k = ("absolute" === d || "fixed" === d) && K.inArray("auto", [i, j]) > -1, l = {}, m = {}; k ? (m = g.position(), e = m.top, f = m.left) : (e = parseFloat(i) || 0, f = parseFloat(j) || 0), K.isFunction(b) && (b = b.call(a, c, h)), null != b.top && (l.top = b.top - h.top + e), null != b.left && (l.left = b.left - h.left + f), "using" in b ? b.using.call(a, l) : g.css(l) } }, K.fn.extend({ position: function () { if (!this[0]) return null; var a = this[0], b = this.offsetParent(), c = this.offset(), d = xb.test(b[0].nodeName) ? { top: 0, left: 0 } : b.offset(); return c.top -= parseFloat(K.css(a, "marginTop")) || 0, c.left -= parseFloat(K.css(a, "marginLeft")) || 0, d.top += parseFloat(K.css(b[0], "borderTopWidth")) || 0, d.left += parseFloat(K.css(b[0], "borderLeftWidth")) || 0, { top: c.top - d.top, left: c.left - d.left } }, offsetParent: function () { return this.map(function () { for (var a = this.offsetParent || H.body; a && !xb.test(a.nodeName) && "static" === K.css(a, "position"); ) a = a.offsetParent; return a }) } }), K.each(["Left", "Top"], function (a, d) { var e = "scroll" + d; K.fn[e] = function (d) { var f, g; return d === b ? (f = this[0]) ? (g = c(f), g ? "pageXOffset" in g ? g[a ? "pageYOffset" : "pageXOffset"] : K.support.boxModel && g.document.documentElement[e] || g.document.body[e] : f[e]) : null : this.each(function () { g = c(this), g ? g.scrollTo(a ? K(g).scrollLeft() : d, a ? d : K(g).scrollTop()) : this[e] = d }) } }), K.each(["Height", "Width"], function (a, c) { var d = c.toLowerCase(); K.fn["inner" + c] = function () { var a = this[0]; return a ? a.style ? parseFloat(K.css(a, d, "padding")) : this[d]() : null }, K.fn["outer" + c] = function (a) { var b = this[0]; return b ? b.style ? parseFloat(K.css(b, d, a ? "margin" : "border")) : this[d]() : null }, K.fn[d] = function (a) { var e = this[0]; if (!e) return null == a ? null : this; if (K.isFunction(a)) return this.each(function (b) { var c = K(this); c[d](a.call(this, b, c[d]())) }); if (K.isWindow(e)) { var f = e.document.documentElement["client" + c], g = e.document.body; return "CSS1Compat" === e.document.compatMode && f || g && g["client" + c] || f } if (9 === e.nodeType) return Math.max(e.documentElement["client" + c], e.body["scroll" + c], e.documentElement["scroll" + c], e.body["offset" + c], e.documentElement["offset" + c]); if (a === b) { var h = K.css(e, d), i = parseFloat(h); return K.isNumeric(i) ? i : h } return this.css(d, "string" == typeof a ? a : a + "px") } }), a.jQuery = a.$ = K, "function" == typeof define && define.amd && define.amd.jQuery && define("jquery", [], function () { return K }) } (window); var losjqisafe = $.noConflict(); jqueryloaded && ($ = jQueryCurrent, jQuery = jQueryCurrent), this.createjs = this.createjs || {}, function () { var a = function (a, b, c) { this.initialize(a, b, c) }, b = a.prototype; b.type = null, b.target = null, b.currentTarget = null, b.eventPhase = 0, b.bubbles = !1, b.cancelable = !1, b.timeStamp = 0, b.defaultPrevented = !1, b.propagationStopped = !1, b.immediatePropagationStopped = !1, b.removed = !1, b.initialize = function (a, b, c) { this.type = a, this.bubbles = b, this.cancelable = c, this.timeStamp = (new Date).getTime() }, b.preventDefault = function () { this.defaultPrevented = !0 }, b.stopPropagation = function () { this.propagationStopped = !0 }, b.stopImmediatePropagation = function () { this.immediatePropagationStopped = this.propagationStopped = !0 }, b.remove = function () { this.removed = !0 }, b.clone = function () { return new a(this.type, this.bubbles, this.cancelable) }, b.toString = function () { return "[Event (type=" + this.type + ")]" }, createjs.Event = a } (), this.createjs = this.createjs || {}, function () { var a = function () {}, b = a.prototype; a.initialize = function (a) { a.addEventListener = b.addEventListener, a.on = b.on, a.removeEventListener = a.off = b.removeEventListener, a.removeAllEventListeners = b.removeAllEventListeners, a.hasEventListener = b.hasEventListener, a.dispatchEvent = b.dispatchEvent, a._dispatchEvent = b._dispatchEvent }, b._listeners = null, b._captureListeners = null, b.initialize = function () {}, b.addEventListener = function (a, b, c) { var d; d = c ? this._captureListeners = this._captureListeners || {} : this._listeners = this._listeners || {}; var e = d[a]; return e && this.removeEventListener(a, b, c), e = d[a], e ? e.push(b) : d[a] = [b], b }, b.on = function (a, b, c, d, e, f) { return b.handleEvent && (c = c || b, b = b.handleEvent), c = c || this, this.addEventListener(a, function (a) { b.call(c, a, e), d && a.remove() }, f) }, b.removeEventListener = function (a, b, c) { var d = c ? this._captureListeners : this._listeners; if (d) { var e = d[a]; if (e) for (var f = 0, g = e.length; g > f; f++) if (e[f] == b) { 1 == g ? delete d[a] : e.splice(f, 1); break } } }, b.off = b.removeEventListener, b.removeAllEventListeners = function (a) { a ? (this._listeners && delete this._listeners[a], this._captureListeners && delete this._captureListeners[a]) : this._listeners = this._captureListeners = null }, b.dispatchEvent = function (a, b) { if ("string" == typeof a) { var c = this._listeners; if (!c || !c[a]) return !1; a = new createjs.Event(a) } if (a.target = b || this, a.bubbles && this.parent) { for (var d = this, e = [d]; d.parent; ) e.push(d = d.parent); var f, g = e.length; for (f = g - 1; f >= 0 && !a.propagationStopped; f--) e[f]._dispatchEvent(a, 1 + (0 == f)); for (f = 1; g > f && !a.propagationStopped; f++) e[f]._dispatchEvent(a, 3) } else this._dispatchEvent(a, 2); return a.defaultPrevented }, b.hasEventListener = function (a) { var b = this._listeners, c = this._captureListeners; return !!(b && b[a] || c && c[a]) }, b.toString = function () { return "[EventDispatcher]" }, b._dispatchEvent = function (a, b) { var c, d = 1 == b ? this._captureListeners : this._listeners; if (a && d) { var e = d[a.type]; if (!e || !(c = e.length)) return; a.currentTarget = this, a.eventPhase = b, a.removed = !1, e = e.slice(); for (var f = 0; c > f && !a.immediatePropagationStopped; f++) { var g = e[f]; g.handleEvent ? g.handleEvent(a) : g(a), a.removed && (this.off(a.type, g, 1 == b), a.removed = !1) } } }, createjs.EventDispatcher = a } (), this.createjs = this.createjs || {}, function () { createjs.indexOf = function (a, b) { for (var c = 0, d = a.length; d > c; c++) if (b === a[c]) return c; return -1 } } (), this.createjs = this.createjs || {}, function () { var a = function () { throw "UID cannot be instantiated" }; a._nextID = 0, a.get = function () { return a._nextID++ }, createjs.UID = a } (), this.createjs = this.createjs || {}, function () { var a = function () { throw "Ticker cannot be instantiated." }; a.RAF_SYNCHED = "synched", a.RAF = "raf", a.TIMEOUT = "timeout", a.useRAF = !1, a.timingMode = null, a.maxDelta = 0, 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(), a._addEventListener.apply(a, arguments) }, a._paused = !1, 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.init = function () { a._inited || (a._inited = !0, a._times = [], a._tickTimes = [], a._startTime = a._getTime(), a._times.push(a._lastTime = 0), a.setInterval(a._interval)) }, a.reset = function () { if (a._raf) { var b = window.cancelAnimationFrame || window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || window.oCancelAnimationFrame || window.msCancelAnimationFrame; b && b(a._timerId) } else clearTimeout(a._timerId); a.removeAllEventListeners("tick") }, a.setInterval = function (b) { a._interval = b, a._inited && a._setupTick() }, a.getInterval = function () { return a._interval }, a.setFPS = function (b) { a.setInterval(1e3 / b) }, a.getFPS = function () { return 1e3 / a._interval }, a.getMeasuredTickTime = function (b) { var c = 0, d = a._tickTimes; if (d.length < 1) return -1; b = Math.min(d.length, b || 0 | a.getFPS()); for (var e = 0; b > e; e++) c += d[e]; return d / b }, a.getMeasuredFPS = function (b) { var c = a._times; return c.length < 2 ? -1 : (b = Math.min(c.length - 1, b || 0 | a.getFPS()), 1e3 / ((c[0] - c[b]) / b)) }, a.setPaused = function (b) { a._paused = b }, a.getPaused = function () { return a._paused }, a.getTime = function (b) { return a._getTime() - a._startTime - (b ? a._pausedTime : 0) }, a.getEventTime = function (b) { return (a._lastTime || a._startTime) - (b ? a._pausedTime : 0) }, a.getTicks = function (b) { return a._ticks - (b ? a._pausedTicks : 0) }, a._handleSynch = function () { var b = a._getTime() - a._startTime; a._timerId = null, a._setupTick(), b - 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 b = a.timingMode || a.useRAF && a.RAF_SYNCHED; if (b == a.RAF_SYNCHED || b == a.RAF) { var c = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame; if (c) return a._timerId = c(b == a.RAF ? a._handleRAF : a._handleSynch), void(a._raf = !0) } a._raf = !1, a._timerId = setTimeout(a._handleTimeout, a._interval) } }, a._tick = function () { var b = a._getTime() - a._startTime, c = b - a._lastTime, d = a._paused; if (a._ticks++, d && (a._pausedTicks++, a._pausedTime += c), a._lastTime = b, a.hasEventListener("tick")) { var e = new createjs.Event("tick"), f = a.maxDelta; e.delta = f && c > f ? f : c, e.paused = d, e.time = b, e.runTime = b - a._pausedTime, a.dispatchEvent(e) } for (a._tickTimes.unshift(a._getTime() - b); a._tickTimes.length > 100; ) a._tickTimes.pop(); for (a._times.unshift(b); a._times.length > 100; ) a._times.pop() }; var b = window.performance && (performance.now || performance.mozNow || performance.msNow || performance.oNow || performance.webkitNow); a._getTime = function () { return b && b.call(performance) || (new Date).getTime() }, createjs.Ticker = a } (), this.createjs = this.createjs || {}, function () { var a = function (a, b, c, d, e, f, g, h, i, j) { this.initialize(a, b, c, d, e, f, g, h, i, j) }, b = a.prototype = new createjs.Event; b.stageX = 0, b.stageY = 0, b.rawX = 0, b.rawY = 0, b.nativeEvent = null, b.pointerID = 0, b.primary = !1, b.addEventListener = null, b.removeEventListener = null, b.removeAllEventListeners = null, b.dispatchEvent = null, b.hasEventListener = null, b._listeners = null, createjs.EventDispatcher.initialize(b), b.Event_initialize = b.initialize, b.initialize = function (a, b, c, d, e, f, g, h, i, j) { this.Event_initialize(a, b, c), this.stageX = d, this.stageY = e, this.nativeEvent = f, this.pointerID = g, this.primary = h, this.rawX = null == i ? d : i, this.rawY = null == j ? e : j }, b.clone = function () { return new a(this.type, this.bubbles, this.cancelable, this.stageX, this.stageY, this.target, this.nativeEvent, this.pointerID, this.primary, this.rawX, this.rawY) }, b.toString = function () { return "[MouseEvent (type=" + this.type + " stageX=" + this.stageX + " stageY=" + this.stageY + ")]" }, createjs.MouseEvent = a } (), this.createjs = this.createjs || {}, function () { var a = function (a, b, c, d, e, f) { this.initialize(a, b, c, d, e, f) }, b = a.prototype; a.identity = null, a.DEG_TO_RAD = Math.PI / 180, b.a = 1, b.b = 0, b.c = 0, b.d = 1, b.tx = 0, b.ty = 0, b.alpha = 1, b.shadow = null, b.compositeOperation = null, b.initialize = function (a, b, c, d, e, f) { return this.a = null == a ? 1 : a, this.b = b || 0, this.c = c || 0, this.d = null == d ? 1 : d, this.tx = e || 0, this.ty = f || 0, this }, b.prepend = function (a, b, c, d, e, f) { var g = this.tx; if (1 != a || 0 != b || 0 != c || 1 != d) { var h = this.a, i = this.c; this.a = h * a + this.b * c, this.b = h * b + this.b * d, this.c = i * a + this.d * c, this.d = i * b + this.d * d } return this.tx = g * a + this.ty * c + e, this.ty = g * b + this.ty * d + f, this }, b.append = function (a, b, c, d, e, f) { var g = this.a, h = this.b, i = this.c, j = this.d; return this.a = a * g + b * i, this.b = a * h + b * j, this.c = c * g + d * i, this.d = c * h + d * j, this.tx = e * g + f * i + this.tx, this.ty = e * h + f * j + this.ty, this }, b.prependMatrix = function (a) { return this.prepend(a.a, a.b, a.c, a.d, a.tx, a.ty), this.prependProperties(a.alpha, a.shadow, a.compositeOperation), this }, b.appendMatrix = function (a) { return this.append(a.a, a.b, a.c, a.d, a.tx, a.ty), this.appendProperties(a.alpha, a.shadow, a.compositeOperation), this }, b.prependTransform = function (b, c, d, e, f, g, h, i, j) { if (f % 360) var k = f * a.DEG_TO_RAD, l = Math.cos(k), m = Math.sin(k); else l = 1, m = 0; return (i || j) && (this.tx -= i, this.ty -= j), g || h ? (g *= a.DEG_TO_RAD, h *= a.DEG_TO_RAD, this.prepend(l * d, m * d, -m * e, l * e, 0, 0), this.prepend(Math.cos(h), Math.sin(h), -Math.sin(g), Math.cos(g), b, c)) : this.prepend(l * d, m * d, -m * e, l * e, b, c), this }, b.appendTransform = function (b, c, d, e, f, g, h, i, j) { if (f % 360) var k = f * a.DEG_TO_RAD, l = Math.cos(k), m = Math.sin(k); else l = 1, m = 0; return g || h ? (g *= a.DEG_TO_RAD, h *= a.DEG_TO_RAD, this.append(Math.cos(h), Math.sin(h), -Math.sin(g), Math.cos(g), b, c), this.append(l * d, m * d, -m * e, l * e, 0, 0)) : this.append(l * d, m * d, -m * e, l * e, b, c), (i || j) && (this.tx -= i * this.a + j * this.c, this.ty -= i * this.b + j * this.d), this }, b.rotate = function (a) { var b = Math.cos(a), c = Math.sin(a), d = this.a, e = this.c, f = this.tx; return this.a = d * b - this.b * c, this.b = d * c + this.b * b, this.c = e * b - this.d * c, this.d = e * c + this.d * b, this.tx = f * b - this.ty * c, this.ty = f * c + this.ty * b, this }, b.skew = function (b, c) { return b *= a.DEG_TO_RAD, c *= a.DEG_TO_RAD, this.append(Math.cos(c), Math.sin(c), -Math.sin(b), Math.cos(b), 0, 0), this }, b.scale = function (a, b) { return this.a *= a, this.d *= b, this.c *= a, this.b *= b, this.tx *= a, this.ty *= b, this }, b.translate = function (a, b) { return this.tx += a, this.ty += b, this }, b.identity = function () { return this.alpha = this.a = this.d = 1, this.b = this.c = this.tx = this.ty = 0, this.shadow = this.compositeOperation = null, this }, b.invert = function () { var a = this.a, b = this.b, c = this.c, d = this.d, e = this.tx, f = a * d - b * c; return this.a = d / f, this.b = -b / f, this.c = -c / f, this.d = a / f, this.tx = (c * this.ty - d * e) / f, this.ty = - (a * this.ty - b * e) / f, this }, b.isIdentity = function () { return 0 == this.tx && 0 == this.ty && 1 == this.a && 0 == this.b && 0 == this.c && 1 == this.d }, b.transformPoint = function (a, b, c) { return c = c || {}, c.x = a * this.a + b * this.c + this.tx, c.y = a * this.b + b * this.d + this.ty, c }, b.decompose = function (b) { null == b && (b = {}), b.x = this.tx, b.y = this.ty, b.scaleX = Math.sqrt(this.a * this.a + this.b * this.b), b.scaleY = Math.sqrt(this.c * this.c + this.d * this.d); var c = Math.atan2(-this.c, this.d), d = Math.atan2(this.b, this.a); return c == d ? (b.rotation = d / a.DEG_TO_RAD, this.a < 0 && this.d >= 0 && (b.rotation += b.rotation <= 0 ? 180 : -180), b.skewX = b.skewY = 0) : (b.skewX = c / a.DEG_TO_RAD, b.skewY = d / a.DEG_TO_RAD), b }, b.reinitialize = function (a, b, c, d, e, f, g, h, i) { return this.initialize(a, b, c, d, e, f), this.alpha = null == g ? 1 : g, this.shadow = h, this.compositeOperation = i, this }, b.copy = function (a) { return this.reinitialize(a.a, a.b, a.c, a.d, a.tx, a.ty, a.alpha, a.shadow, a.compositeOperation) }, b.appendProperties = function (a, b, c) { return this.alpha *= a, this.shadow = b || this.shadow, this.compositeOperation = c || this.compositeOperation, this }, b.prependProperties = function (a, b, c) { return this.alpha *= a, this.shadow = this.shadow || b, this.compositeOperation = this.compositeOperation || c, this }, b.clone = function () { return (new a).copy(this) }, b.toString = function () { return "[Matrix2D (a=" + this.a + " b=" + this.b + " c=" + this.c + " d=" + this.d + " tx=" + this.tx + " ty=" + this.ty + ")]" }, a.identity = new a, createjs.Matrix2D = a } (), this.createjs = this.createjs || {}, function () { var a = function (a, b) { this.initialize(a, b) }, b = a.prototype; b.x = 0, b.y = 0, b.initialize = function (a, b) { return this.x = null == a ? 0 : a, this.y = null == b ? 0 : b, this }, b.copy = function (a) { return this.initialize(a.x, a.y) }, b.clone = function () { return new a(this.x, this.y) }, b.toString = function () { return "[Point (x=" + this.x + " y=" + this.y + ")]" }, createjs.Point = a } (), this.createjs = this.createjs || {}, function () { var a = function (a, b, c, d) { this.initialize(a, b, c, d) }, b = a.prototype; b.x = 0, b.y = 0, b.width = 0, b.height = 0, b.initialize = function (a, b, c, d) { return this.x = a || 0, this.y = b || 0, this.width = c || 0, this.height = d || 0, this }, b.copy = function (a) { return this.initialize(a.x, a.y, a.width, a.height) }, b.clone = function () { return new a(this.x, this.y, this.width, this.height) }, b.toString = function () { return "[Rectangle (x=" + this.x + " y=" + this.y + " width=" + this.width + " height=" + this.height + ")]" }, createjs.Rectangle = a } (), this.createjs = this.createjs || {}, function () { var a = function (a, b, c, d, e, f, g) { this.initialize(a, b, c, d, e, f, g) }, b = a.prototype; b.target = null, b.overLabel = null, b.outLabel = null, b.downLabel = null, b.play = !1, b._isPressed = !1, b._isOver = !1, b.initialize = function (a, b, c, d, e, f, g) { a.addEventListener && (this.target = a, a.cursor = "pointer", this.overLabel = null == c ? "over" : c, this.outLabel = null == b ? "out" : b, this.downLabel = null == d ? "down" : d, this.play = e, this.setEnabled(!0), this.handleEvent({}), f && (g && (f.actionsEnabled = !1, f.gotoAndStop && f.gotoAndStop(g)), a.hitArea = f)) }, b.setEnabled = function (a) { var b = this.target; a ? (b.addEventListener("rollover", this), b.addEventListener("rollout", this), b.addEventListener("mousedown", this), b.addEventListener("pressup", this)) : (b.removeEventListener("rollover", this), b.removeEventListener("rollout", this), b.removeEventListener("mousedown", this), b.removeEventListener("pressup", this)) }, b.toString = function () { return "[ButtonHelper]" }, b.handleEvent = function (a) { var b, c = this.target, d = a.type; "mousedown" == d ? (this._isPressed = !0, b = this.downLabel) : "pressup" == d ? (this._isPressed = !1, b = this._isOver ? this.overLabel : this.outLabel) : "rollover" == d ? (this._isOver = !0, b = this._isPressed ? this.downLabel : this.overLabel) : (this._isOver = !1, b = this._isPressed ? this.overLabel : this.outLabel), this.play ? c.gotoAndPlay && c.gotoAndPlay(b) : c.gotoAndStop && c.gotoAndStop(b) }, createjs.ButtonHelper = a } (), this.createjs = this.createjs || {}, function () { var a = function (a, b, c, d) { this.initialize(a, b, c, d) }, b = a.prototype; a.identity = null, b.color = null, b.offsetX = 0, b.offsetY = 0, b.blur = 0, b.initialize = function (a, b, c, d) { this.color = a, this.offsetX = b, this.offsetY = c, this.blur = d }, b.toString = function () { return "[Shadow]" }, b.clone = function () { return new a(this.color, this.offsetX, this.offsetY, this.blur) }, a.identity = new a("transparent", 0, 0, 0), createjs.Shadow = a } (), this.createjs = this.createjs || {}, function () { var a = function (a) { this.initialize(a) }, b = a.prototype = new createjs.EventDispatcher; b.complete = !0, b.framerate = 0, b._animations = null, b._frames = null, b._images = null, b._data = null, b._loadCount = 0, b._frameHeight = 0, b._frameWidth = 0, b._numFrames = 0, b._regX = 0, b._regY = 0, b.initialize = function (a) { var b, c, d, e; if (null != a) { if (this.framerate = a.framerate || 0, a.images && (c = a.images.length) > 0) for (e = this._images = [], b = 0; c > b; b++) { var f = a.images[b]; if ("string" == typeof f) { var g = f; f = new Image, f.src = g } e.push(f), f.getContext || f.complete || (this._loadCount++, this.complete = !1, function (a) { f.onload = function () { a._handleImageLoad() } } (this)) } if (null == a.frames); else if (a.frames instanceof Array) for (this._frames = [], e = a.frames, b = 0, c = e.length; c > b; b++) { var h = e[b]; this._frames.push({ image: this._images[h[4] ? h[4] : 0], rect: new createjs.Rectangle(h[0], h[1], h[2], h[3]), regX: h[5] || 0, regY: h[6] || 0 }) } else d = a.frames, this._frameWidth = d.width, this._frameHeight = d.height, this._regX = d.regX || 0, this._regY = d.regY || 0, this._numFrames = d.count, 0 == this._loadCount && this._calculateFrames(); if (this._animations = [], null != (d = a.animations)) { this._data = {}; var i; for (i in d) { var j = { name: i }, k = d[i]; if ("number" == typeof k) e = j.frames = [k]; else if (k instanceof Array) if (1 == k.length) j.frames = [k[0]]; else for (j.speed = k[3], j.next = k[2], e = j.frames = [], b = k[0]; b <= k[1]; b++) e.push(b); else { j.speed = k.speed, j.next = k.next; var l = k.frames; e = j.frames = "number" == typeof l ? [l] : l.slice(0) } (j.next === !0 || void 0 === j.next) && (j.next = i), (j.next === !1 || e.length < 2 && j.next == i) && (j.next = null), j.speed || (j.speed = 1), this._animations.push(i), this._data[i] = j } } } }, b.getNumFrames = function (a) { if (null == a) return this._frames ? this._frames.length : this._numFrames; var b = this._data[a]; return null == b ? 0 : b.frames.length }, b.getAnimations = function () { return this._animations.slice(0) }, b.getAnimation = function (a) { return this._data[a] }, b.getFrame = function (a) { var b; return this._frames && (b = this._frames[a]) ? b : null }, b.getFrameBounds = function (a, b) { var c = this.getFrame(a); return c ? (b || new createjs.Rectangle).initialize(-c.regX, -c.regY, c.rect.width, c.rect.height) : null }, b.toString = function () { return "[SpriteSheet]" }, b.clone = function () { var b = new a; return b.complete = this.complete, b._animations = this._animations, b._frames = this._frames, b._images = this._images, b._data = this._data, b._frameHeight = this._frameHeight, b._frameWidth = this._frameWidth, b._numFrames = this._numFrames, b._loadCount = this._loadCount, b }, b._handleImageLoad = function () { 0 == --this._loadCount && (this._calculateFrames(), this.complete = !0, this.dispatchEvent("complete")) }, b._calculateFrames = function () { if (!this._frames && 0 != this._frameWidth) { this._frames = []; for (var a = 0, b = this._frameWidth, c = this._frameHeight, d = 0, e = this._images; d < e.length; d++) { for (var f = e[d], g = 0 | (f.width + 1) / b, h = 0 | (f.height + 1) / c, i = this._numFrames > 0 ? Math.min(this._numFrames - a, g * h) : g * h, j = 0; i > j; j++) this._frames.push({ image: f, rect: new createjs.Rectangle(j % g * b, (0 | j / g) * c, b, c), regX: this._regX, regY: this._regY }); a += i } this._numFrames = a } }, createjs.SpriteSheet = a } (), this.createjs = this.createjs || {}, function () { function a(a, b, c) { this.f = a, this.params = b, this.path = null == c || c } a.prototype.exec = function (a) { this.f.apply(a, this.params) }; var b = function () { this.initialize() }, c = b.prototype; b.getRGB = function (a, b, c, d) { return null != a && null == c && (d = b, c = 255 & a, b = 255 & a >> 8, a = 255 & a >> 16), null == d ? "rgb(" + a + "," + b + "," + c + ")" : "rgba(" + a + "," + b + "," + c + "," + d + ")" }, b.getHSL = function (a, b, c, d) { return null == d ? "hsl(" + a % 360 + "," + b + "%," + c + "%)" : "hsla(" + a % 360 + "," + b + "%," + c + "%," + d + ")" }, b.Command = a, b.BASE_64 = { A: 0, B: 1, C: 2, D: 3, E: 4, F: 5, G: 6, H: 7, I: 8, J: 9, K: 10, L: 11, M: 12, N: 13, O: 14, P: 15, Q: 16, R: 17, S: 18, T: 19, U: 20, V: 21, W: 22, X: 23, Y: 24, Z: 25, a: 26, b: 27, c: 28, d: 29, e: 30, f: 31, g: 32, h: 33, i: 34, j: 35, k: 36, l: 37, m: 38, n: 39, o: 40, p: 41, q: 42, r: 43, s: 44, t: 45, u: 46, v: 47, w: 48, x: 49, y: 50, z: 51, 0: 52, 1: 53, 2: 54, 3: 55, 4: 56, 5: 57, 6: 58, 7: 59, 8: 60, 9: 61, "+": 62, "/": 63 }, b.STROKE_CAPS_MAP = ["butt", "round", "square"], b.STROKE_JOINTS_MAP = ["miter", "round", "bevel"]; var d = createjs.createCanvas ? createjs.createCanvas() : document.createElement("canvas"); if (d.getContext) { var e = b._ctx = d.getContext("2d"); b.beginCmd = new a(e.beginPath, [], !1), b.fillCmd = new a(e.fill, [], !1), b.strokeCmd = new a(e.stroke, [], !1), d.width = d.height = 1 } c._strokeInstructions = null, c._strokeStyleInstructions = null, c._strokeIgnoreScale = !1, c._fillInstructions = null, c._fillMatrix = null, c._instructions = null, c._oldInstructions = null, c._activeInstructions = null, c._active = !1, c._dirty = !1, c.initialize = function () { this.clear(), this._ctx = b._ctx }, c.isEmpty = function () { return !(this._instructions.length || this._oldInstructions.length || this._activeInstructions.length) }, c.draw = function (a) { this._dirty && this._updateInstructions(); for (var b = this._instructions, c = 0, d = b.length; d > c; c++) b[c].exec(a) }, c.drawAsPath = function (a) { this._dirty && this._updateInstructions(); for (var b, c = this._instructions, d = 0, e = c.length; e > d; d++) ((b = c[d]).path || 0 == d) && b.exec(a) }, c.moveTo = function (b, c) { return this._activeInstructions.push(new a(this._ctx.moveTo, [b, c])), this }, c.lineTo = function (b, c) { return this._dirty = this._active = !0, this._activeInstructions.push(new a(this._ctx.lineTo, [b, c])), this }, c.arcTo = function (b, c, d, e, f) { return this._dirty = this._active = !0, this._activeInstructions.push(new a(this._ctx.arcTo, [b, c, d, e, f])), this }, c.arc = function (b, c, d, e, f, g) { return this._dirty = this._active = !0, null == g && (g = !1), this._activeInstructions.push(new a(this._ctx.arc, [b, c, d, e, f, g])), this }, c.quadraticCurveTo = function (b, c, d, e) { return this._dirty = this._active = !0, this._activeInstructions.push(new a(this._ctx.quadraticCurveTo, [b, c, d, e])), this }, c.bezierCurveTo = function (b, c, d, e, f, g) { return this._dirty = this._active = !0, this._activeInstructions.push(new a(this._ctx.bezierCurveTo, [b, c, d, e, f, g])), this }, c.rect = function (b, c, d, e) { return this._dirty = this._active = !0, this._activeInstructions.push(new a(this._ctx.rect, [b, c, d, e])), this }, c.closePath = function () { return this._active && (this._dirty = !0, this._activeInstructions.push(new a(this._ctx.closePath, []))), this }, c.clear = function () { return this._instructions = [], this._oldInstructions = [], this._activeInstructions = [], this._strokeStyleInstructions = this._strokeInstructions = this._fillInstructions = this._fillMatrix = null, this._active = this._dirty = this._strokeIgnoreScale = !1, this }, c.beginFill = function (b) { return this._active && this._newPath(), this._fillInstructions = b ? [new a(this._setProp, ["fillStyle", b], !1)] : null, this._fillMatrix = null, this }, c.beginLinearGradientFill = function (b, c, d, e, f, g) { this._active && this._newPath(); for (var h = this._ctx.createLinearGradient(d, e, f, g), i = 0, j = b.length; j > i; i++) h.addColorStop(c[i], b[i]); return this._fillInstructions = [new a(this._setProp, ["fillStyle", h], !1)], this._fillMatrix = null, this }, c.beginRadialGradientFill = function (b, c, d, e, f, g, h, i) { this._active && this._newPath(); for (var j = this._ctx.createRadialGradient(d, e, f, g, h, i), k = 0, l = b.length; l > k; k++) j.addColorStop(c[k], b[k]); return this._fillInstructions = [new a(this._setProp, ["fillStyle", j], !1)], this._fillMatrix = null, this }, c.beginBitmapFill = function (b, c, d) { this._active && this._newPath(), c = c || ""; var e = this._ctx.createPattern(b, c); return this._fillInstructions = [new a(this._setProp, ["fillStyle", e], !1)], this._fillMatrix = d ? [d.a, d.b, d.c, d.d, d.tx, d.ty] : null, this }, c.endFill = function () { return this.beginFill() }, c.setStrokeStyle = function (c, d, e, f, g) { return this._active && this._newPath(), this._strokeStyleInstructions = [new a(this._setProp, ["lineWidth", null == c ? "1" : c], !1), new a(this._setProp, ["lineCap", null == d ? "butt" : isNaN(d) ? d : b.STROKE_CAPS_MAP[d]], !1), new a(this._setProp, ["lineJoin", null == e ? "miter" : isNaN(e) ? e : b.STROKE_JOINTS_MAP[e]], !1), new a(this._setProp, ["miterLimit", null == f ? "10" : f], !1)], this._strokeIgnoreScale = g, this }, c.beginStroke = function (b) { return this._active && this._newPath(), this._strokeInstructions = b ? [new a(this._setProp, ["strokeStyle", b], !1)] : null, this }, c.beginLinearGradientStroke = function (b, c, d, e, f, g) { this._active && this._newPath(); for (var h = this._ctx.createLinearGradient(d, e, f, g), i = 0, j = b.length; j > i; i++) h.addColorStop(c[i], b[i]); return this._strokeInstructions = [new a(this._setProp, ["strokeStyle", h], !1)], this }, c.beginRadialGradientStroke = function (b, c, d, e, f, g, h, i) { this._active && this._newPath(); for (var j = this._ctx.createRadialGradient(d, e, f, g, h, i), k = 0, l = b.length; l > k; k++) j.addColorStop(c[k], b[k]); return this._strokeInstructions = [new a(this._setProp, ["strokeStyle", j], !1)], this }, c.beginBitmapStroke = function (b, c) { this._active && this._newPath(), c = c || ""; var d = this._ctx.createPattern(b, c); return this._strokeInstructions = [new a(this._setProp, ["strokeStyle", d], !1)], this }, c.endStroke = function () { return this.beginStroke(), this }, c.curveTo = c.quadraticCurveTo, c.drawRect = c.rect, c.drawRoundRect = function (a, b, c, d, e) { return this.drawRoundRectComplex(a, b, c, d, e, e, e, e), this }, c.drawRoundRectComplex = function (b, c, d, e, f, g, h, i) { var j = (e > d ? d : e) / 2, k = 0, l = 0, m = 0, n = 0; 0 > f && (f *= k = -1), f > j && (f = j), 0 > g && (g *= l = -1), g > j && (g = j), 0 > h && (h *= m = -1), h > j && (h = j), 0 > i && (i *= n = -1), i > j && (i = j), this._dirty = this._active = !0; var o = this._ctx.arcTo, p = this._ctx.lineTo; return this._activeInstructions.push(new a(this._ctx.moveTo, [b + d - g, c]), new a(o, [b + d + g * l, c - g * l, b + d, c + g, g]), new a(p, [b + d, c + e - h]), new a(o, [b + d + h * m, c + e + h * m, b + d - h, c + e, h]), new a(p, [b + i, c + e]), new a(o, [b - i * n, c + e + i * n, b, c + e - i, i]), new a(p, [b, c + f]), new a(o, [b - f * k, c - f * k, b + f, c, f]), new a(this._ctx.closePath)), this }, c.drawCircle = function (a, b, c) { return this.arc(a, b, c, 0, 2 * Math.PI), this }, c.drawEllipse = function (b, c, d, e) { this._dirty = this._active = !0; var f = .5522848, g = d / 2 * f, h = e / 2 * f, i = b + d, j = c + e, k = b + d / 2, l = c + e / 2; return this._activeInstructions.push(new a(this._ctx.moveTo, [b, l]), new a(this._ctx.bezierCurveTo, [b, l - h, k - g, c, k, c]), new a(this._ctx.bezierCurveTo, [k + g, c, i, l - h, i, l]), new a(this._ctx.bezierCurveTo, [i, l + h, k + g, j, k, j]), new a(this._ctx.bezierCurveTo, [k - g, j, b, l + h, b, l])), this }, c.inject = function (b, c) { return this._dirty = this._active = !0, this._activeInstructions.push(new a(b, [c])), this }, c.drawPolyStar = function (b, c, d, e, f, g) { this._dirty = this._active = !0, null == f && (f = 0), f = 1 - f, null == g ? g = 0 : g /= 180 / Math.PI; var h = Math.PI / e; this._activeInstructions.push(new a(this._ctx.moveTo, [b + Math.cos(g) * d, c + Math.sin(g) * d])); for (var i = 0; e > i; i++) g += h, 1 != f && this._activeInstructions.push(new a(this._ctx.lineTo, [b + Math.cos(g) * d * f, c + Math.sin(g) * d * f])), g += h, this._activeInstructions.push(new a(this._ctx.lineTo, [b + Math.cos(g) * d, c + Math.sin(g) * d])); return this }, c.decodePath = function (a) { for (var c = [this.moveTo, this.lineTo, this.quadraticCurveTo, this.bezierCurveTo, this.closePath], d = [2, 2, 4, 6, 0], e = 0, f = a.length, g = [], h = 0, i = 0, j = b.BASE_64; f > e; ) { var k = a.charAt(e), l = j[k], m = l >> 3, n = c[m]; if (!n || 3 & l) throw "bad path data (@" + e + "): " + k; var o = d[m]; m || (h = i = 0), g.length = 0, e++; for (var p = (1 & l >> 2) + 2, q = 0; o > q; q++) { var r = j[a.charAt(e)], s = r >> 5 ? -1 : 1; r = (31 & r) << 6 | j[a.charAt(e + 1)], 3 == p && (r = r << 6 | j[a.charAt(e + 2)]), r = s * r / 10, q % 2 ? h = r += h : i = r += i, g[q] = r, e += p } n.apply(this, g) } return this }, c.clone = function () { var a = new b; return a._instructions = this._instructions.slice(), a._activeInstructions = this._activeInstructions.slice(), a._oldInstructions = this._oldInstructions.slice(), this._fillInstructions && (a._fillInstructions = this._fillInstructions.slice()), this._strokeInstructions && (a._strokeInstructions = this._strokeInstructions.slice()), this._strokeStyleInstructions && (a._strokeStyleInstructions = this._strokeStyleInstructions.slice()), a._active = this._active, a._dirty = this._dirty, a._fillMatrix = this._fillMatrix, a._strokeIgnoreScale = this._strokeIgnoreScale, a }, c.toString = function () { return "[Graphics]" }, c.mt = c.moveTo, c.lt = c.lineTo, c.at = c.arcTo, c.bt = c.bezierCurveTo, c.qt = c.quadraticCurveTo, c.a = c.arc, c.r = c.rect, c.cp = c.closePath, c.c = c.clear, c.f = c.beginFill, c.lf = c.beginLinearGradientFill, c.rf = c.beginRadialGradientFill, c.bf = c.beginBitmapFill, c.ef = c.endFill, c.ss = c.setStrokeStyle, c.s = c.beginStroke, c.ls = c.beginLinearGradientStroke, c.rs = c.beginRadialGradientStroke, c.bs = c.beginBitmapStroke, c.es = c.endStroke, c.dr = c.drawRect, c.rr = c.drawRoundRect, c.rc = c.drawRoundRectComplex, c.dc = c.drawCircle, c.de = c.drawEllipse, c.dp = c.drawPolyStar, c.p = c.decodePath, c._updateInstructions = function () { this._instructions = this._oldInstructions.slice(), this._instructions.push(b.beginCmd), this._appendInstructions(this._fillInstructions), this._appendInstructions(this._strokeInstructions), this._appendInstructions(this._strokeInstructions && this._strokeStyleInstructions), this._appendInstructions(this._activeInstructions), this._fillInstructions && this._appendDraw(b.fillCmd, this._fillMatrix), this._strokeInstructions && this._appendDraw(b.strokeCmd, this._strokeIgnoreScale && [1, 0, 0, 1, 0, 0]) }, c._appendInstructions = function (a) { a && this._instructions.push.apply(this._instructions, a) }, c._appendDraw = function (b, c) { c ? this._instructions.push(new a(this._ctx.save, [], !1), new a(this._ctx.transform, c, !1), b, new a(this._ctx.restore, [], !1)) : this._instructions.push(b) }, c._newPath = function () { this._dirty && this._updateInstructions(), this._oldInstructions = this._instructions, this._activeInstructions = [], this._active = this._dirty = !1 }, c._setProp = function (a, b) { this[a] = b }, createjs.Graphics = b } (), this.createjs = this.createjs || {}, function () { var a = function () { this.initialize() }, b = a.prototype = new createjs.EventDispatcher; a.suppressCrossDomainErrors = !1; var c = createjs.createCanvas ? createjs.createCanvas() : document.createElement("canvas"); c.getContext && (a._hitTestCanvas = c, a._hitTestContext = c.getContext("2d"), c.width = c.height = 1), a._nextCacheID = 1, b.alpha = 1, b.cacheCanvas = null, b.id = -1, b.mouseEnabled = !0, b.name = null, b.parent = null, b.regX = 0, b.regY = 0, b.rotation = 0, b.scaleX = 1, b.scaleY = 1, b.skewX = 0, b.skewY = 0, b.shadow = null, b.visible = !0, b.x = 0, b.y = 0, b.compositeOperation = null, b.snapToPixel = !1, b.filters = null, b.cacheID = 0, b.mask = null, b.hitArea = null, b.cursor = null, b._cacheOffsetX = 0, b._cacheOffsetY = 0, b._cacheScale = 1, b._cacheDataURLID = 0, b._cacheDataURL = null, b._matrix = null, b._rectangle = null, b._bounds = null, b.initialize = function () { this.id = createjs.UID.get(), this._matrix = new createjs.Matrix2D, this._rectangle = new createjs.Rectangle }, b.isVisible = function () { return !!(this.visible && this.alpha > 0 && 0 != this.scaleX && 0 != this.scaleY) }, b.draw = function (a, b) { var c = this.cacheCanvas; if (b || !c) return !1; var d, e = this._cacheScale, f = this._cacheOffsetX, g = this._cacheOffsetY; return (d = this._applyFilterBounds(f, g, 0, 0)) && (f = d.x, g = d.y), a.drawImage(c, f, g, c.width / e, c.height / e), !0 }, b.updateContext = function (a) { var b, c = this.mask, d = this; c && c.graphics && !c.graphics.isEmpty() && (b = c.getMatrix(c._matrix), a.transform(b.a, b.b, b.c, b.d, b.tx, b.ty), c.graphics.drawAsPath(a), a.clip(), b.invert(), a.transform(b.a, b.b, b.c, b.d, b.tx, b.ty)), b = d._matrix.identity().appendTransform(d.x, d.y, d.scaleX, d.scaleY, d.rotation, d.skewX, d.skewY, d.regX, d.regY), createjs.Stage._snapToPixelEnabled && d.snapToPixel ? a.transform(b.a, b.b, b.c, b.d, 0 | b.tx + .5, 0 | b.ty + .5) : a.transform(b.a, b.b, b.c, b.d, b.tx, b.ty), a.globalAlpha *= d.alpha, d.compositeOperation && (a.globalCompositeOperation = d.compositeOperation), d.shadow && this._applyShadow(a, d.shadow) }, b.cache = function (a, b, c, d, e) { e = e || 1, this.cacheCanvas || (this.cacheCanvas = createjs.createCanvas ? createjs.createCanvas() : document.createElement("canvas")), this._cacheWidth = c, this._cacheHeight = d, this._cacheOffsetX = a, this._cacheOffsetY = b, this._cacheScale = e, this.updateCache() }, b.updateCache = function (b) { var c, d = this.cacheCanvas, e = this._cacheScale, f = this._cacheOffsetX * e, g = this._cacheOffsetY * e, h = this._cacheWidth, i = this._cacheHeight; if (!d) throw "cache() must be called before updateCache()"; var j = d.getContext("2d"); (c = this._applyFilterBounds(f, g, h, i)) && (f = c.x, g = c.y, h = c.width, i = c.height), h = Math.ceil(h * e), i = Math.ceil(i * e), h != d.width || i != d.height ? (d.width = h, d.height = i) : b || j.clearRect(0, 0, h + 1, i + 1), j.save(), j.globalCompositeOperation = b, j.setTransform(e, 0, 0, e, -f, -g), this.draw(j, !0), this._applyFilters(), j.restore(), this.cacheID = a._nextCacheID++ }, b.uncache = function () { this._cacheDataURL = this.cacheCanvas = null, this.cacheID = this._cacheOffsetX = this._cacheOffsetY = 0, this._cacheScale = 1 }, b.getCacheDataURL = function () { return this.cacheCanvas ? (this.cacheID != this._cacheDataURLID && (this._cacheDataURL = this.cacheCanvas.toDataURL()), this._cacheDataURL) : null }, b.getStage = function () { for (var a = this; a.parent; ) a = a.parent; return a instanceof createjs.Stage ? a : null }, b.localToGlobal = function (a, b) { var c = this.getConcatenatedMatrix(this._matrix); return null == c ? null : (c.append(1, 0, 0, 1, a, b), new createjs.Point(c.tx, c.ty)) }, b.globalToLocal = function (a, b) { var c = this.getConcatenatedMatrix(this._matrix); return null == c ? null : (c.invert(), c.append(1, 0, 0, 1, a, b), new createjs.Point(c.tx, c.ty)) }, b.localToLocal = function (a, b, c) { var d = this.localToGlobal(a, b); return c.globalToLocal(d.x, d.y) }, b.setTransform = function (a, b, c, d, e, f, g, h, i) { return this.x = a || 0, this.y = b || 0, this.scaleX = null == c ? 1 : c, this.scaleY = null == d ? 1 : d, this.rotation = e || 0, this.skewX = f || 0, this.skewY = g || 0, this.regX = h || 0, this.regY = i || 0, this }, b.getMatrix = function (a) { var b = this; return (a ? a.identity() : new createjs.Matrix2D).appendTransform(b.x, b.y, b.scaleX, b.scaleY, b.rotation, b.skewX, b.skewY, b.regX, b.regY).appendProperties(b.alpha, b.shadow, b.compositeOperation) }, b.getConcatenatedMatrix = function (a) { a ? a.identity() : a = new createjs.Matrix2D; for (var b = this; null != b; ) a.prependTransform(b.x, b.y, b.scaleX, b.scaleY, b.rotation, b.skewX, b.skewY, b.regX, b.regY).prependProperties(b.alpha, b.shadow, b.compositeOperation), b = b.parent; return a }, b.hitTest = function (b, c) { var d = a._hitTestContext; d.setTransform(1, 0, 0, 1, -b, -c), this.draw(d); var e = this._testHit(d); return d.setTransform(1, 0, 0, 1, 0, 0), d.clearRect(0, 0, 2, 2), e }, b.set = function (a) { for (var b in a) this[b] = a[b]; return this }, b.getBounds = function () { if (this._bounds) return this._rectangle.copy(this._bounds); var a = this.cacheCanvas; if (a) { var b = this._cacheScale; return this._rectangle.initialize(this._cacheOffsetX, this._cacheOffsetY, a.width / b, a.height / b) } return null }, b.getTransformedBounds = function () { return this._getBounds() }, b.setBounds = function (a, b, c, d) { null == a && (this._bounds = a), this._bounds = (this._bounds || new createjs.Rectangle).initialize(a, b, c, d) }, b.clone = function () { var b = new a; return this.cloneProps(b), b }, b.toString = function () { return "[DisplayObject (name=" + this.name + ")]" }, b.cloneProps = function (a) { a.alpha = this.alpha, a.name = this.name, a.regX = this.regX, a.regY = this.regY, a.rotation = this.rotation, a.scaleX = this.scaleX, a.scaleY = this.scaleY, a.shadow = this.shadow, a.skewX = this.skewX, a.skewY = this.skewY, a.visible = this.visible, a.x = this.x, a.y = this.y, a._bounds = this._bounds, a.mouseEnabled = this.mouseEnabled, a.compositeOperation = this.compositeOperation }, b._applyShadow = function (a, b) { b = b || Shadow.identity, a.shadowColor = b.color, a.shadowOffsetX = b.offsetX, a.shadowOffsetY = b.offsetY, a.shadowBlur = b.blur }, b._tick = function (a) { var b = this._listeners; if (b && b.tick) { var c = new createjs.Event("tick"); c.params = a, this._dispatchEvent(c, this, 2) } }, b._testHit = function (b) { try { var c = b.getImageData(0, 0, 1, 1).data[3] > 1 } catch (b) { if (!a.suppressCrossDomainErrors) throw "An error has occurred. This is most likely due to security restrictions on reading canvas pixel data with local or cross-domain images." } return c }, b._applyFilters = function () { if (this.filters && 0 != this.filters.length && this.cacheCanvas) for (var a = this.filters.length, b = this.cacheCanvas.getContext("2d"), c = this.cacheCanvas.width, d = this.cacheCanvas.height, e = 0; a > e; e++) this.filters[e].applyFilter(b, 0, 0, c, d) }, b._applyFilterBounds = function (a, b, c, d) { var e, f, g = this.filters; if (g && (f = g.length)) { for (var h = 0; f > h; h++) { var i = this.filters[h], j = i.getBounds && i.getBounds(); j && (e || (e = this._rectangle.initialize(a, b, c, d)), e.x += j.x, e.y += j.y, e.width += j.width, e.height += j.height) } return e } }, b._getBounds = function (a, b) { return this._transformBounds(this.getBounds(), a, b) }, b._transformBounds = function (a, b, c) { if (!a) return a; var d = a.x, e = a.y, f = a.width, g = a.height, h = c ? this._matrix.identity() : this.getMatrix(this._matrix); (d || e) && h.appendTransform(0, 0, 1, 1, 0, 0, 0, -d, -e), b && h.prependMatrix(b); var i = f * h.a, j = f * h.b, k = g * h.c, l = g * h.d, m = h.tx, n = h.ty, o = m, p = m, q = n, r = n; return (d = i + m) < o ? o = d : d > p && (p = d), (d = i + k + m) < o ? o = d : d > p && (p = d), (d = k + m) < o ? o = d : d > p && (p = d), (e = j + n) < q ? q = e : e > r && (r = e), (e = j + l + n) < q ? q = e : e > r && (r = e), (e = l + n) < q ? q = e : e > r && (r = e), a.initialize(o, q, p - o, r - q) }, createjs.DisplayObject = a } (), this.createjs = this.createjs || {}, function () { var a = function () { this.initialize() }, b = a.prototype = new createjs.DisplayObject; b.children = null, b.mouseChildren = !0, b.DisplayObject_initialize = b.initialize, b.initialize = function () { this.DisplayObject_initialize(), this.children = [] }, b.isVisible = function () { var a = this.cacheCanvas || this.children.length; return !!(this.visible && this.alpha > 0 && 0 != this.scaleX && 0 != this.scaleY && a) }, b.DisplayObject_draw = b.draw, b.draw = function (a, b) { if (this.DisplayObject_draw(a, b)) return !0; for (var c = this.children.slice(0), d = 0, e = c.length; e > d; d++) { var f = c[d]; f.isVisible() && (a.save(), f.updateContext(a), f.draw(a), a.restore()) } return !0 }, b.addChild = function (a) { if (null == a) return a; var b = arguments.length; if (b > 1) { for (var c = 0; b > c; c++) this.addChild(arguments[c]); return arguments[b - 1] } return a.parent && a.parent.removeChild(a), a.parent = this, this.children.push(a), a }, b.addChildAt = function (a, b) { var c = arguments.length, d = arguments[c - 1]; if (0 > d || d > this.children.length) return arguments[c - 2]; if (c > 2) { for (var e = 0; c - 1 > e; e++) this.addChildAt(arguments[e], d + e); return arguments[c - 2] } return a.parent && a.parent.removeChild(a), a.parent = this, this.children.splice(b, 0, a), a }, b.removeChild = function (a) { var b = arguments.length; if (b > 1) { for (var c = !0, d = 0; b > d; d++) c = c && this.removeChild(arguments[d]); return c } return this.removeChildAt(createjs.indexOf(this.children, a)) }, b.removeChildAt = function (a) { var b = arguments.length; if (b > 1) { for (var c = [], d = 0; b > d; d++) c[d] = arguments[d]; c.sort(function (a, b) { return b - a }); for (var e = !0, d = 0; b > d; d++) e = e && this.removeChildAt(c[d]); return e } if (0 > a || a > this.children.length - 1) return !1; var f = this.children[a]; return f && (f.parent = null), this.children.splice(a, 1), !0 }, b.removeAllChildren = function () { for (var a = this.children; a.length; ) a.pop().parent = null }, b.getChildAt = function (a) { return this.children[a] }, b.getChildByName = function (a) { for (var b = this.children, c = 0, d = b.length; d > c; c++) if (b[c].name == a) return b[c]; return null }, b.sortChildren = function (a) { this.children.sort(a) }, b.getChildIndex = function (a) { return createjs.indexOf(this.children, a) }, b.getNumChildren = function () { return this.children.length }, b.swapChildrenAt = function (a, b) { var c = this.children, d = c[a], e = c[b]; d && e && (c[a] = e, c[b] = d) }, b.swapChildren = function (a, b) { for (var c, d, e = this.children, f = 0, g = e.length; g > f && (e[f] == a && (c = f), e[f] == b && (d = f), null == c || null == d); f++); f != g && (e[c] = b, e[d] = a) }, b.setChildIndex = function (a, b) { var c = this.children, d = c.length; if (!(a.parent != this || 0 > b || b >= d)) { for (var e = 0; d > e && c[e] != a; e++); e != d && e != b && (c.splice(e, 1), c.splice(b, 0, a)) } }, b.contains = function (a) { for (; a; ) { if (a == this) return !0; a = a.parent } return !1 }, b.hitTest = function (a, b) { return null != this.getObjectUnderPoint(a, b) }, b.getObjectsUnderPoint = function (a, b) { var c = [], d = this.localToGlobal(a, b); return this._getObjectsUnderPoint(d.x, d.y, c), c }, b.getObjectUnderPoint = function (a, b) { var c = this.localToGlobal(a, b); return this._getObjectsUnderPoint(c.x, c.y) }, b.DisplayObject_getBounds = b.getBounds, b.getBounds = function () { return this._getBounds(null, !0) }, b.getTransformedBounds = function () { return this._getBounds() }, b.clone = function (b) { var c = new a; if (this.cloneProps(c), b) for (var d = c.children = [], e = 0, f = this.children.length; f > e; e++) { var g = this.children[e].clone(b); g.parent = c, d.push(g) } return c }, b.toString = function () { return "[Container (name=" + this.name + ")]" }, b.DisplayObject__tick = b._tick, b._tick = function (a) { for (var b = this.children.length - 1; b >= 0; b--) { var c = this.children[b]; c._tick && c._tick(a) } this.DisplayObject__tick(a) }, b._getObjectsUnderPoint = function (b, c, d, e) { for (var f = createjs.DisplayObject._hitTestContext, g = this._matrix, h = this.children.length, i = h - 1; i >= 0; i--) { var j = this.children[i], k = e && j.hitArea; if (j.visible && (k || j.isVisible()) && (!e || j.mouseEnabled)) if (!k && j instanceof a) { var l = j._getObjectsUnderPoint(b, c, d, e); if (!d && l) return l } else { if (j.getConcatenatedMatrix(g), k && (g.appendTransform(k.x, k.y, k.scaleX, k.scaleY, k.rotation, k.skewX, k.skewY, k.regX, k.regY), g.alpha = k.alpha), f.globalAlpha = g.alpha, f.setTransform(g.a, g.b, g.c, g.d, g.tx - b, g.ty - c), (k || j).draw(f), !this._testHit(f)) continue; if (f.setTransform(1, 0, 0, 1, 0, 0), f.clearRect(0, 0, 2, 2), !d) return e && !this.mouseChildren ? this : j; d.push(j) } } return null }, b._getBounds = function (a, b) { var c = this.DisplayObject_getBounds(); if (c) return this._transformBounds(c, a, b); var d, e, f, g, h = b ? this._matrix.identity() : this.getMatrix(this._matrix); a && h.prependMatrix(a); for (var i = this.children.length, j = 0; i > j; j++) { var k = this.children[j]; if (k.visible && (c = k._getBounds(h))) { var l = c.x, m = c.y, n = l + c.width, o = m + c.height; (d > l || null == d) && (d = l), (n > e || null == e) && (e = n), (f > m || null == f) && (f = m), (o > g || null == g) && (g = o) } } return null == e ? null : this._rectangle.initialize(d, f, e - d, g - f) }, createjs.Container = a } (), this.createjs = this.createjs || {}, function () { var a = function (a) { this.initialize(a) }, b = a.prototype = new createjs.Container; a._snapToPixelEnabled = !1, b.autoClear = !0, b.canvas = null, b.mouseX = 0, b.mouseY = 0, b.snapToPixelEnabled = !1, b.mouseInBounds = !1, b.tickOnUpdate = !0, b.mouseMoveOutside = !1, b.nextStage = null, b._pointerData = null, b._pointerCount = 0, b._primaryPointerID = null, b._mouseOverIntervalID = null, b.Container_initialize = b.initialize, b.initialize = function (a) { this.Container_initialize(), this.canvas = "string" == typeof a ? document.getElementById(a) : a, this._pointerData = {}, this.enableDOMEvents(!0) }, b.update = function () { if (this.canvas) { this.tickOnUpdate && (this.dispatchEvent("tickstart"), this._tick(arguments.length ? arguments : null), this.dispatchEvent("tickend")), this.dispatchEvent("drawstart"), a._snapToPixelEnabled = this.snapToPixelEnabled, this.autoClear && this.clear(); var b = this.canvas.getContext("2d"); b.save(), this.updateContext(b), this.draw(b, !1), b.restore(), this.dispatchEvent("drawend") } }, b.handleEvent = function (a) { "tick" == a.type && this.update(a) }, b.clear = function () { if (this.canvas) { var a = this.canvas.getContext("2d"); a.setTransform(1, 0, 0, 1, 0, 0), a.clearRect(0, 0, this.canvas.width + 1, this.canvas.height + 1) } }, b.toDataURL = function (a, b) { b || (b = "image/png"); var c, d = this.canvas.getContext("2d"), e = this.canvas.width, f = this.canvas.height; if (a) { c = d.getImageData(0, 0, e, f); var g = d.globalCompositeOperation; d.globalCompositeOperation = "destination-over", d.fillStyle = a, d.fillRect(0, 0, e, f) } var h = this.canvas.toDataURL(b); return a && (d.clearRect(0, 0, e + 1, f + 1), d.putImageData(c, 0, 0), d.globalCompositeOperation = g), h }, b.enableMouseOver = function (a) { if (this._mouseOverIntervalID && (clearInterval(this._mouseOverIntervalID), this._mouseOverIntervalID = null, 0 == a && this._testMouseOver(!0)), null == a) a = 20; else if (0 >= a) return; var b = this; this._mouseOverIntervalID = setInterval(function () { b._testMouseOver() }, 1e3 / Math.min(50, a)) }, b.enableDOMEvents = function (a) { null == a && (a = !0); var b, c, d = this._eventListeners; if (!a && d) { for (b in d) c = d[b], c.t.removeEventListener(b, c.f, !1); this._eventListeners = null } else if (a && !d && this.canvas) { var e = window.addEventListener ? window : document, f = this; d = this._eventListeners = {}, d.mouseup = { t: e, f: function (a) { f._handleMouseUp(a) } }, d.mousemove = { t: e, f: function (a) { f._handleMouseMove(a) } }, d.dblclick = { t: e, f: function (a) { f._handleDoubleClick(a) } }, d.mousedown = { t: this.canvas, f: function (a) { f._handleMouseDown(a) } }; for (b in d) c = d[b], c.t.addEventListener(b, c.f, !1) } }, b.clone = function () { var b = new a(null); return this.cloneProps(b), b }, b.toString = function () { return "[Stage (name=" + this.name + ")]" }, b._getElementRect = function (a) { var b; try { b = a.getBoundingClientRect() } catch (c) { b = { top: a.offsetTop, left: a.offsetLeft, width: a.offsetWidth, height: a.offsetHeight } } var c = (window.pageXOffset || document.scrollLeft || 0) - (document.clientLeft || document.body.clientLeft || 0), d = (window.pageYOffset || document.scrollTop || 0) - (document.clientTop || document.body.clientTop || 0), e = window.getComputedStyle ? getComputedStyle(a) : a.currentStyle, f = parseInt(e.paddingLeft) + parseInt(e.borderLeftWidth), g = parseInt(e.paddingTop) + parseInt(e.borderTopWidth), h = parseInt(e.paddingRight) + parseInt(e.borderRightWidth), i = parseInt(e.paddingBottom) + parseInt(e.borderBottomWidth); return { left: b.left + c + f, right: b.right + c - h, top: b.top + d + g, bottom: b.bottom + d - i } }, b._getPointerData = function (a) { var b = this._pointerData[a]; return b || (b = this._pointerData[a] = { x: 0, y: 0 }, null == this._primaryPointerID && (this._primaryPointerID = a)), b }, b._handleMouseMove = function (a) { a || (a = window.event), this._handlePointerMove(-1, a, a.pageX, a.pageY) }, b._handlePointerMove = function (a, b, c, d) { if (this.canvas) { var e = this._getPointerData(a), f = e.inBounds; if (this._updatePointerPosition(a, b, c, d), f || e.inBounds || this.mouseMoveOutside) { -1 == a && e.inBounds == !f && this._dispatchMouseEvent(this, f ? "mouseleave" : "mouseenter", !1, a, e, b), this._dispatchMouseEvent(this, "stagemousemove", !1, a, e, b), this._dispatchMouseEvent(e.target, "pressmove", !0, a, e, b); var g = e.event; g && g.hasEventListener("mousemove") && g.dispatchEvent(new createjs.MouseEvent("mousemove", !1, !1, e.x, e.y, b, a, a == this._primaryPointerID, e.rawX, e.rawY), oTarget), this.nextStage && this.nextStage._handlePointerMove(a, b, c, d) } } }, b._updatePointerPosition = function (a, b, c, d) { var e = this._getElementRect(this.canvas); c -= e.left, d -= e.top; var f = this.canvas.width, g = this.canvas.height; c /= (e.right - e.left) / f, d /= (e.bottom - e.top) / g; var h = this._getPointerData(a); (h.inBounds = c >= 0 && d >= 0 && f - 1 >= c && g - 1 >= d) ? (h.x = c, h.y = d) : this.mouseMoveOutside && (h.x = 0 > c ? 0 : c > f - 1 ? f - 1 : c, h.y = 0 > d ? 0 : d > g - 1 ? g - 1 : d), h.posEvtObj = b, h.rawX = c, h.rawY = d, a == this._primaryPointerID && (this.mouseX = h.x, this.mouseY = h.y, this.mouseInBounds = h.inBounds) }, b._handleMouseUp = function (a) { this._handlePointerUp(-1, a, !1) }, b._handlePointerUp = function (a, b, c) { var d = this._getPointerData(a); this._dispatchMouseEvent(this, "stagemouseup", !1, a, d, b); var e = d.target; e && (this._getObjectsUnderPoint(d.x, d.y, null, !0) == e && this._dispatchMouseEvent(e, "click", !0, a, d, b), this._dispatchMouseEvent(e, "pressup", !0, a, d, b)); var f = d.event; f && f.hasEventListener("mouseup") && f.dispatchEvent(new createjs.MouseEvent("mouseup", !1, !1, d.x, d.y, b, a, a == this._primaryPointerID, d.rawX, d.rawY), e), c ? (a == this._primaryPointerID && (this._primaryPointerID = null), delete this._pointerData[a]) : d.event = d.target = null, this.nextStage && this.nextStage._handlePointerUp(a, b, c) }, b._handleMouseDown = function (a) { this._handlePointerDown(-1, a) }, b._handlePointerDown = function (a, b, c, d) { null != d && this._updatePointerPosition(a, b, c, d); var e = this._getPointerData(a); this._dispatchMouseEvent(this, "stagemousedown", !1, a, e, b), e.target = this._getObjectsUnderPoint(e.x, e.y, null, !0), this._dispatchMouseEvent(e.target, "mousedown", !0, a, e, b), this.nextStage && this.nextStage._handlePointerDown(a, b, c, d) }, b._testMouseOver = function (a) { if (-1 == this._primaryPointerID && (a || this.mouseX != this._mouseOverX || this.mouseY != this._mouseOverY || !this.mouseInBounds)) { var b, c, d, e, f = this._getPointerData(-1), g = f.posEvtObj, h = -1, i = ""; (a || this.mouseInBounds && g && g.target == this.canvas) && (b = this._getObjectsUnderPoint(this.mouseX, this.mouseY, null, !0), this._mouseOverX = this.mouseX, this._mouseOverY = this.mouseY); var j = this._mouseOverTarget || [], k = j[j.length - 1], l = this._mouseOverTarget = []; for (c = b; c; ) l.unshift(c), null != c.cursor && (i = c.cursor), c = c.parent; for (this.canvas.style.cursor = i, d = 0, e = l.length; e > d && l[d] == j[d]; d++) h = d; for (k != b && this._dispatchMouseEvent(k, "mouseout", !0, -1, f, g), d = j.length - 1; d > h; d--) this._dispatchMouseEvent(j[d], "rollout", !1, -1, f, g); for (d = l.length - 1; d > h; d--) this._dispatchMouseEvent(l[d], "rollover", !1, -1, f, g); k != b && this._dispatchMouseEvent(b, "mouseover", !0, -1, f, g) } }, b._handleDoubleClick = function (a) { var b = this._getPointerData(-1), c = this._getObjectsUnderPoint(b.x, b.y, null, !0); this._dispatchMouseEvent(c, "dblclick", !0, -1, b, a), this.nextStage && this.nextStage._handleDoubleClick(a) }, b._dispatchMouseEvent = function (a, b, c, d, e, f) { if (a && (c || a.hasEventListener(b))) { var g = new createjs.MouseEvent(b, c, !1, e.x, e.y, f, d, d == this._primaryPointerID, e.rawX, e.rawY); a.dispatchEvent(g) } }, createjs.Stage = a } (), this.createjs = this.createjs || {}, function () { var a = function (a) { this.initialize(a) }, b = a.prototype = new createjs.DisplayObject; b.image = null, b.snapToPixel = !0, b.sourceRect = null, b.DisplayObject_initialize = b.initialize, b.initialize = function (a) { this.DisplayObject_initialize(), "string" == typeof a ? (this.image = new Image, this.image.src = a) : this.image = a }, b.isVisible = function () { var a = this.cacheCanvas || this.image && (this.image.complete || this.image.getContext || this.image.readyState >= 2); return !!(this.visible && this.alpha > 0 && 0 != this.scaleX && 0 != this.scaleY && a) }, b.DisplayObject_draw = b.draw, b.draw = function (a, b) { if (this.DisplayObject_draw(a, b)) return !0; var c = this.sourceRect; return c ? a.drawImage(this.image, c.x, c.y, c.width, c.height, 0, 0, c.width, c.height) : a.drawImage(this.image, 0, 0), !0 }, b.DisplayObject_getBounds = b.getBounds, b.getBounds = function () { var a = this.DisplayObject_getBounds(); if (a) return a; var b = this.sourceRect || this.image, c = this.image && (this.image.complete || this.image.getContext || this.image.readyState >= 2); return c ? this._rectangle.initialize(0, 0, b.width, b.height) : null }, b.clone = function () { var b = new a(this.image); return this.sourceRect && (b.sourceRect = this.sourceRect.clone()), this.cloneProps(b), b }, b.toString = function () { return "[Bitmap (name=" + this.name + ")]" }, createjs.Bitmap = a } (), this.createjs = this.createjs || {}, function () { var a = function (a, b) { this.initialize(a, b) }, b = a.prototype = new createjs.DisplayObject; b.currentFrame = 0, b.currentAnimation = null, b.paused = !0, b.spriteSheet = null, b.snapToPixel = !0, b.offset = 0, b.currentAnimationFrame = 0, b.framerate = 0, b._advanceCount = 0, b._animation = null, b._currentFrame = null, b.DisplayObject_initialize = b.initialize, b.initialize = function (a, b) { this.DisplayObject_initialize(), this.spriteSheet = a, b && this.gotoAndPlay(b) }, b.isVisible = function () { var a = this.cacheCanvas || this.spriteSheet.complete; return !!(this.visible && this.alpha > 0 && 0 != this.scaleX && 0 != this.scaleY && a) }, b.DisplayObject_draw = b.draw, b.draw = function (a, b) { if (this.DisplayObject_draw(a, b)) return !0; this._normalizeFrame(); var c = this.spriteSheet.getFrame(0 | this._currentFrame); if (!c) return !1; var d = c.rect; return a.drawImage(c.image, d.x, d.y, d.width, d.height, -c.regX, -c.regY, d.width, d.height), !0 }, b.play = function () { this.paused = !1 }, b.stop = function () { this.paused = !0 }, b.gotoAndPlay = function (a) { this.paused = !1, this._goto(a) }, b.gotoAndStop = function (a) { this.paused = !0, this._goto(a) }, b.advance = function (a) { var b = this._animation && this._animation.speed || 1, c = this.framerate || this.spriteSheet.framerate, d = c && null != a ? a / (1e3 / c) : 1; this._animation ? this.currentAnimationFrame += d * b : this._currentFrame += d * b, this._normalizeFrame() }, b.DisplayObject_getBounds = b.getBounds, b.getBounds = function () { return this.DisplayObject_getBounds() || this.spriteSheet.getFrameBounds(this.currentFrame, this._rectangle) }, b.clone = function () { var b = new a(this.spriteSheet); return this.cloneProps(b), b }, b.toString = function () { return "[Sprite (name=" + this.name + ")]" }, b.DisplayObject__tick = b._tick, b._tick = function (a) { this.paused || this.advance(a && a[0] && a[0].delta), this.DisplayObject__tick(a) }, b._normalizeFrame = function () { var a, b = this._animation, c = this.paused, d = this._currentFrame, e = this.currentAnimationFrame; if (b) if (a = b.frames.length, (0 | e) >= a) { var f = b.next; if (this._dispatchAnimationEnd(b, d, c, f, a - 1)); else { if (f) return this._goto(f, e - a); this.paused = !0, e = this.currentAnimationFrame = b.frames.length - 1, this._currentFrame = b.frames[e] } } else this._currentFrame = b.frames[0 | e]; else if (a = this.spriteSheet.getNumFrames(), d >= a && !this._dispatchAnimationEnd(b, d, c, a - 1) && (this._currentFrame -= a) >= a) return this._normalizeFrame(); this.currentFrame = 0 | this._currentFrame }, b._dispatchAnimationEnd = function (a, b, c, d, e) { var f = a ? a.name : null; if (this.hasEventListener("animationend")) { var g = new createjs.Event("animationend"); g.name = f, g.next = d, this.dispatchEvent(g) } return !c && this.paused && (this.currentAnimationFrame = e), this.paused != c || this._animation != a || this._currentFrame != b }, b.DisplayObject_cloneProps = b.cloneProps, b.cloneProps = function (a) { this.DisplayObject_cloneProps(a), a.currentFrame = this.currentFrame, a._currentFrame = this._currentFrame, a.currentAnimation = this.currentAnimation, a.paused = this.paused, a._animation = this._animation, a.currentAnimationFrame = this.currentAnimationFrame, a.framerate = this.framerate }, b._goto = function (a, b) { if (isNaN(a)) { var c = this.spriteSheet.getAnimation(a); c && (this.currentAnimationFrame = b || 0, this._animation = c, this.currentAnimation = a, this._normalizeFrame()) } else this.currentAnimationFrame = 0, this.currentAnimation = this._animation = null, this._currentFrame = a, this._normalizeFrame() }, createjs.Sprite = a } (), this.createjs = this.createjs || {}, function () { var a = "BitmapAnimation is deprecated in favour of Sprite. See VERSIONS file for info on changes."; if (!createjs.Sprite) throw a; (createjs.BitmapAnimation = function (b) { console.log(a), this.initialize(b) }).prototype = new createjs.Sprite } (), this.createjs = this.createjs || {}, function () { var a = function (a) { this.initialize(a) }, b = a.prototype = new createjs.DisplayObject; b.graphics = null, b.DisplayObject_initialize = b.initialize, b.initialize = function (a) { this.DisplayObject_initialize(), this.graphics = a ? a : new createjs.Graphics }, b.isVisible = function () { var a = this.cacheCanvas || this.graphics && !this.graphics.isEmpty(); return !!(this.visible && this.alpha > 0 && 0 != this.scaleX && 0 != this.scaleY && a) }, b.DisplayObject_draw = b.draw, b.draw = function (a, b) { return !!this.DisplayObject_draw(a, b) || (this.graphics.draw(a), !0) }, b.clone = function (b) { var c = new a(b && this.graphics ? this.graphics.clone() : this.graphics); return this.cloneProps(c), c }, b.toString = function () { return "[Shape (name=" + this.name + ")]" }, createjs.Shape = a } (), this.createjs = this.createjs || {}, function () { var a = function (a, b, c) { this.initialize(a, b, c) }, b = a.prototype = new createjs.DisplayObject, c = createjs.createCanvas ? createjs.createCanvas() : document.createElement("canvas"); c.getContext && (a._workingContext = c.getContext("2d"), c.width = c.height = 1), a.H_OFFSETS = { start: 0, left: 0, center: - .5, end: -1, right: -1 }, a.V_OFFSETS = { top: 0, hanging: - .01, middle: - .4, alphabetic: - .8, ideographic: - .85, bottom: -1 }, b.text = "", b.font = null, b.color = null, b.textAlign = "left", b.textBaseline = "top", b.maxWidth = null, b.outline = 0, b.lineHeight = 0, b.lineWidth = null, b.DisplayObject_initialize = b.initialize, b.initialize = function (a, b, c) { this.DisplayObject_initialize(), this.text = a, this.font = b, this.color = c }, b.isVisible = function () { var a = this.cacheCanvas || null != this.text && "" !== this.text; return !!(this.visible && this.alpha > 0 && 0 != this.scaleX && 0 != this.scaleY && a) }, b.DisplayObject_draw = b.draw, b.draw = function (a, b) { if (this.DisplayObject_draw(a, b)) return !0; var c = this.color || "#000"; return this.outline ? (a.strokeStyle = c, a.lineWidth = 1 * this.outline) : a.fillStyle = c, this._drawText(this._prepContext(a)), !0 }, b.getMeasuredWidth = function () { return this._prepContext(a._workingContext).measureText(this.text).width }, b.getMeasuredLineHeight = function () { return 1.2 * this._prepContext(a._workingContext).measureText("M").width }, b.getMeasuredHeight = function () { return this._drawText(null, {}).height }, b.DisplayObject_getBounds = b.getBounds, b.getBounds = function () { var b = this.DisplayObject_getBounds(); if (b) return b; if (null == this.text || "" == this.text) return null; var c = this._drawText(null, {}), d = this.maxWidth && this.maxWidth < c.width ? this.maxWidth : c.width, e = d * a.H_OFFSETS[this.textAlign || "left"], f = this.lineHeight || this.getMeasuredLineHeight(), g = f * a.V_OFFSETS[this.textBaseline || "top"]; return this._rectangle.initialize(e, g, d, c.height) }, b.clone = function () { var b = new a(this.text, this.font, this.color); return this.cloneProps(b), b }, b.toString = function () { return "[Text (text=" + (this.text.length > 20 ? this.text.substr(0, 17) + "..." : this.text) + ")]" }, b.DisplayObject_cloneProps = b.cloneProps, b.cloneProps = function (a) { this.DisplayObject_cloneProps(a), a.textAlign = this.textAlign, a.textBaseline = this.textBaseline, a.maxWidth = this.maxWidth, a.outline = this.outline, a.lineHeight = this.lineHeight, a.lineWidth = this.lineWidth }, b._prepContext = function (a) { return a.font = this.font, a.textAlign = this.textAlign || "left", a.textBaseline = this.textBaseline || "top", a }, b._drawText = function (b, c) { var d = !!b; d || (b = this._prepContext(a._workingContext)); for (var e = this.lineHeight || this.getMeasuredLineHeight(), f = 0, g = 0, h = String(this.text).split(/(?:\r\n|\r|\n)/), i = 0, j = h.length; j > i; i++) { var k = h[i], l = null; if (null != this.lineWidth && (l = b.measureText(k).width) > this.lineWidth) { var m = k.split(/(\s)/); k = m[0], l = b.measureText(k).width; for (var n = 1, o = m.length; o > n; n += 2) { var p = b.measureText(m[n] + m[n + 1]).width; l + p > this.lineWidth ? (d && this._drawTextLine(b, k, g * e), l > f && (f = l), k = m[n + 1], l = b.measureText(k).width, g++) : (k += m[n] + m[n + 1], l += p) } } d && this._drawTextLine(b, k, g * e), c && null == l && (l = b.measureText(k).width), l > f && (f = l), g++ } return c && (c.count = g, c.width = f, c.height = g * e), c }, b._drawTextLine = function (a, b, c) { this.outline ? a.strokeText(b, 0, c, this.maxWidth || 65535) : a.fillText(b, 0, c, this.maxWidth || 65535) }, createjs.Text = a } (), this.createjs = this.createjs || {}, function () { function a(a, b) { this.initialize(a, b) } var b = a.prototype = new createjs.DisplayObject; b.text = "", b.spriteSheet = null, b.lineHeight = 0, b.letterSpacing = 0, b.spaceWidth = 0, b.DisplayObject_initialize = b.initialize, b.initialize = function (a, b) { this.DisplayObject_initialize(), this.text = a, this.spriteSheet = b }, b.DisplayObject_draw = b.draw, b.draw = function (a, b) { return !!this.DisplayObject_draw(a, b) || void this._drawText(a) }, b.isVisible = function () { var a = this.cacheCanvas || this.spriteSheet && this.spriteSheet.complete && this.text; return !!(this.visible && this.alpha > 0 && 0 != this.scaleX && 0 != this.scaleY && a) }, b.getBounds = function () { var a = this._rectangle; return this._drawText(null, a), a.width ? a : null }, b._getFrame = function (a, b) { var c, d = b.getAnimation(a); return d || (a != (c = a.toUpperCase()) || a != (c = a.toLowerCase()) || (c = null), c && (d = b.getAnimation(c))), d && b.getFrame(d.frames[0]) }, b._getLineHeight = function (a) { var b = this._getFrame("1", a) || this._getFrame("T", a) || this._getFrame("L", a) || a.getFrame(0); return b ? b.rect.height : 1 }, b._getSpaceWidth = function (a) { var b = this._getFrame("1", a) || this._getFrame("l", a) || this._getFrame("e", a) || this._getFrame("a", a) || a.getFrame(0); return b ? b.rect.width : 1 }, b._drawText = function (a, b) { var c, d, e, f = 0, g = 0, h = this.spaceWidth, i = this.lineHeight, j = this.spriteSheet, k = !!this._getFrame(" ", j); k || 0 != h || (h = this._getSpaceWidth(j)), 0 == i && (i = this._getLineHeight(j)); for (var l = 0, m = 0, n = this.text.length; n > m; m++) { var o = this.text.charAt(m); if (k || " " != o) if ("\n" != o && "\r" != o) { var p = this._getFrame(o, j); if (p) { var q = p.rect; e = p.regX, c = q.width, a && a.drawImage(p.image, q.x, q.y, c, d = q.height, f - e, g - p.regY, c, d), f += c + this.letterSpacing } } else "\r" == o && "\n" == this.text.charAt(m + 1) && m++, f - e > l && (l = f - e), f = 0, g += i; else f += h } f - e > l && (l = f - e), b && (b.width = l - this.letterSpacing, b.height = g + i) }, createjs.BitmapText = a } (), this.createjs = this.createjs || {}, function () { var a = function () { throw "SpriteSheetUtils cannot be instantiated" }, b = createjs.createCanvas ? createjs.createCanvas() : document.createElement("canvas"); b.getContext && (a._workingCanvas = b, a._workingContext = b.getContext("2d"), b.width = b.height = 1), a.addFlippedFrames = function (b, c, d, e) { if (c || d || e) { var f = 0; c && a._flip(b, ++f, !0, !1), d && a._flip(b, ++f, !1, !0), e && a._flip(b, ++f, !0, !0) } }, a.extractFrame = function (b, c) { isNaN(c) && (c = b.getAnimation(c).frames[0]); var d = b.getFrame(c); if (!d) return null; var e = d.rect, f = a._workingCanvas; f.width = e.width, f.height = e.height, a._workingContext.drawImage(d.image, e.x, e.y, e.width, e.height, 0, 0, e.width, e.height); var g = new Image; return g.src = f.toDataURL("image/png"), g }, a.mergeAlpha = function (a, b, c) { c || (c = createjs.createCanvas ? createjs.createCanvas() : document.createElement("canvas")), c.width = Math.max(b.width, a.width), c.height = Math.max(b.height, a.height); var d = c.getContext("2d"); return d.save(), d.drawImage(a, 0, 0), d.globalCompositeOperation = "destination-in", d.drawImage(b, 0, 0), d.restore(), c }, a._flip = function (b, c, d, e) { for (var f = b._images, g = a._workingCanvas, h = a._workingContext, i = f.length / c, j = 0; i > j; j++) { var k = f[j]; k.__tmp = j, h.setTransform(1, 0, 0, 1, 0, 0), h.clearRect(0, 0, g.width + 1, g.height + 1), g.width = k.width, g.height = k.height, h.setTransform(d ? -1 : 1, 0, 0, e ? -1 : 1, d ? k.width : 0, e ? k.height : 0), h.drawImage(k, 0, 0); var l = new Image; l.src = g.toDataURL("image/png"), l.width = k.width, l.height = k.height, f.push(l) } var m = b._frames, n = m.length / c; for (j = 0; n > j; j++) { k = m[j]; var o = k.rect.clone(); l = f[k.image.__tmp + i * c]; var p = { image: l, rect: o, regX: k.regX, regY: k.regY }; d && (o.x = l.width - o.x - o.width, p.regX = o.width - k.regX), e && (o.y = l.height - o.y - o.height, p.regY = o.height - k.regY), m.push(p) } var q = "_" + (d ? "h" : "") + (e ? "v" : ""), r = b._animations, s = b._data, t = r.length / c; for (j = 0; t > j; j++) { var u = r[j]; k = s[u]; var v = { name: u + q, frequency: k.frequency, next: k.next, frames: [] }; k.next && (v.next += q), m = k.frames; for (var w = 0, x = m.length; x > w; w++) v.frames.push(m[w] + n * c); s[v.name] = v, r.push(v.name) } }, createjs.SpriteSheetUtils = a } (), this.createjs = this.createjs || {}, function () { var a = function () { this.initialize() }, b = a.prototype = new createjs.EventDispatcher; a.ERR_DIMENSIONS = "frame dimensions exceed max spritesheet dimensions", a.ERR_RUNNING = "a build is already running", b.maxWidth = 2048, b.maxHeight = 2048, b.spriteSheet = null, b.scale = 1, b.padding = 1, b.timeSlice = .3, b.progress = -1, b._frames = null, b._animations = null, b._data = null, b._nextFrameIndex = 0, b._index = 0, b._timerID = null, b._scale = 1, b.initialize = function () { this._frames = [], this._animations = {} }, b.addFrame = function (b, c, d, e, f, g) { if (this._data) throw a.ERR_RUNNING; var h = c || b.bounds || b.nominalBounds; return !h && b.getBounds && (h = b.getBounds()), h ? (d = d || 1, this._frames.push({ source: b, sourceRect: h, scale: d, funct: e, params: f, scope: g, index: this._frames.length, height: h.height * d }) - 1) : null }, b.addAnimation = function (b, c, d, e) { if (this._data) throw a.ERR_RUNNING; this._animations[b] = { frames: c, next: d, frequency: e } }, b.addMovieClip = function (b, c, d) { if (this._data) throw a.ERR_RUNNING; var e = b.frameBounds, f = c || b.bounds || b.nominalBounds; if (!f && b.getBounds && (f = b.getBounds()), !f && !e) return null; for (var g = this._frames.length, h = b.timeline.duration, i = 0; h > i; i++) { var j = e && e[i] ? e[i] : f; this.addFrame(b, j, d, function (a) { var b = this.actionsEnabled; this.actionsEnabled = !1, this.gotoAndStop(a), this.actionsEnabled = b }, [i], b) } var k = b.timeline._labels, l = []; for (var m in k) l.push({ index: k[m], label: m }); if (l.length) { l.sort(function (a, b) { return a.index - b.index }); for (var i = 0, n = l.length; n > i; i++) { for (var o = l[i].label, p = g + l[i].index, q = g + (i == n - 1 ? h : l[i + 1].index), r = [], s = p; q > s; s++) r.push(s); this.addAnimation(o, r, !0) } } }, b.build = function () { if (this._data) throw a.ERR_RUNNING; for (this._startBuild(); this._drawNext(); ); return this._endBuild(), this.spriteSheet }, b.buildAsync = function (b) { if (this._data) throw a.ERR_RUNNING; this.timeSlice = b, this._startBuild(); var c = this; this._timerID = setTimeout(function () { c._run() }, 50 - 50 * Math.max(.01, Math.min(.99, this.timeSlice || .3))) }, b.stopAsync = function () { clearTimeout(this._timerID), this._data = null }, b.clone = function () { throw "SpriteSheetBuilder cannot be cloned." }, b.toString = function () { return "[SpriteSheetBuilder]" }, b._startBuild = function () { var b = this.padding || 0; this.progress = 0, this.spriteSheet = null, this._index = 0, this._scale = this.scale; var c = []; this._data = { images: [], frames: c, animations: this._animations }; var d = this._frames.slice(); if (d.sort(function (a, b) { return a.height <= b.height ? -1 : 1 }), d[d.length - 1].height + 2 * b > this.maxHeight) throw a.ERR_DIMENSIONS; for (var e = 0, f = 0, g = 0; d.length; ) { var h = this._fillRow(d, e, g, c, b); if (h.w > f && (f = h.w), e += h.h, !h.h || !d.length) { var i = createjs.createCanvas ? createjs.createCanvas() : document.createElement("canvas"); i.width = this._getSize(f, this.maxWidth), i.height = this._getSize(e, this.maxHeight), this._data.images[g] = i, h.h || (f = e = 0, g++) } } }, b._getSize = function (a, b) { for (var c = 4; Math.pow(2, ++c) < a; ); return Math.min(b, Math.pow(2, c)) }, b._fillRow = function (b, c, d, e, f) { var g = this.maxWidth, h = this.maxHeight; c += f; for (var i = h - c, j = f, k = 0, l = b.length - 1; l >= 0; l--) { var m = b[l], n = this._scale * m.scale, o = m.sourceRect, p = m.source, q = Math.floor(n * o.x - f), r = Math.floor(n * o.y - f), s = Math.ceil(n * o.height + 2 * f), t = Math.ceil(n * o.width + 2 * f); if (t > g) throw a.ERR_DIMENSIONS; s > i || j + t > g || (m.img = d, m.rect = new createjs.Rectangle(j, c, t, s), k = k || s, b.splice(l, 1), e[m.index] = [j, c, t, s, d, Math.round(-q + n * p.regX - f), Math.round(-r + n * p.regY - f)], j += t) } return { w: j, h: k } }, b._endBuild = function () { this.spriteSheet = new createjs.SpriteSheet(this._data), this._data = null, this.progress = 1, this.dispatchEvent("complete") }, b._run = function () { for (var a = 50 * Math.max(.01, Math.min(.99, this.timeSlice || .3)), b = (new Date).getTime() + a, c = !1; b > (new Date).getTime(); ) if (!this._drawNext()) { c = !0; break } if (c) this._endBuild(); else { var d = this; this._timerID = setTimeout(function () { d._run() }, 50 - a) } var e = this.progress = this._index / this._frames.length; if (this.hasEventListener("progress")) { var f = new createjs.Event("progress"); f.progress = e, this.dispatchEvent(f) } }, b._drawNext = function () { var a = this._frames[this._index], b = a.scale * this._scale, c = a.rect, d = a.sourceRect, e = this._data.images[a.img], f = e.getContext("2d"); return a.funct && a.funct.apply(a.scope, a.params), f.save(), f.beginPath(), f.rect(c.x, c.y, c.width, c.height), f.clip(), f.translate(Math.ceil(c.x - d.x * b), Math.ceil(c.y - d.y * b)), f.scale(b, b), a.source.draw(f), f.restore(), ++this._index < this._frames.length }, createjs.SpriteSheetBuilder = a } (), this.createjs = this.createjs || {}, function () { var a = function (a) { this.initialize(a) }, b = a.prototype = new createjs.DisplayObject; b.htmlElement = null, b._oldMtx = null, b._visible = !1, b.DisplayObject_initialize = b.initialize, b.initialize = function (a) { "string" == typeof a && (a = document.getElementById(a)), this.DisplayObject_initialize(), this.mouseEnabled = !1, this.htmlElement = a; var b = a.style; b.position = "absolute", b.transformOrigin = b.WebkitTransformOrigin = b.msTransformOrigin = b.MozTransformOrigin = b.OTransformOrigin = "0% 0%" }, b.isVisible = function () { return null != this.htmlElement }, b.draw = function () { return this.visible && (this._visible = !0), !0 }, b.cache = function () {}, b.uncache = function () {}, b.updateCache = function () {}, b.hitTest = function () {}, b.localToGlobal = function () {}, b.globalToLocal = function () {}, b.localToLocal = function () {}, b.clone = function () { throw "DOMElement cannot be cloned." }, b.toString = function () { return "[DOMElement (name=" + this.name + ")]" }, b.DisplayObject__tick = b._tick, b._tick = function (a) { var b = this.getStage(); this._visible = !1, b && b.on("drawend", this._handleDrawEnd, this, !0), this.DisplayObject__tick(a) }, b._handleDrawEnd = function () { var a = this.htmlElement; if (a) { var b = a.style, c = this._visible ? "visible" : "hidden"; if (c != b.visibility && (b.visibility = c), this._visible) { var d = this.getConcatenatedMatrix(this._matrix), e = this._oldMtx, f = 1e4; if (e && e.alpha == d.alpha || (b.opacity = "" + (0 | d.alpha * f) / f, e && (e.alpha = d.alpha)), !e || e.tx != d.tx || e.ty != d.ty || e.a != d.a || e.b != d.b || e.c != d.c || e.d != d.d) { var g = "matrix(" + (0 | d.a * f) / f + "," + (0 | d.b * f) / f + "," + (0 | d.c * f) / f + "," + (0 | d.d * f) / f + "," + (0 | d.tx + .5); b.transform = b.WebkitTransform = b.OTransform = b.msTransform = g + "," + (0 | d.ty + .5) + ")", b.MozTransform = g + "px," + (0 | d.ty + .5) + "px)", this._oldMtx = e ? e.copy(d) : d.clone() } } } }, createjs.DOMElement = a } (), this.createjs = this.createjs || {}, function () { var a = function () { this.initialize() }, b = a.prototype; b.initialize = function () {}, b.getBounds = function () { return null }, b.applyFilter = function () {}, b.toString = function () { return "[Filter]" }, b.clone = function () { return new a }, createjs.Filter = a } (), this.createjs = this.createjs || {}, function () { var a = function (a, b, c) { this.initialize(a, b, c) }, b = a.prototype = new createjs.Filter; b.initialize = function (a, b, c) { (isNaN(a) || 0 > a) && (a = 0), this.blurX = 0 | a, (isNaN(b) || 0 > b) && (b = 0), this.blurY = 0 | b, (isNaN(c) || 1 > c) && (c = 1), this.quality = 0 | c }, b.blurX = 0, b.blurY = 0, b.quality = 1, b.mul_table = [1, 171, 205, 293, 57, 373, 79, 137, 241, 27, 391, 357, 41, 19, 283, 265, 497, 469, 443, 421, 25, 191, 365, 349, 335, 161, 155, 149, 9, 278, 269, 261, 505, 245, 475, 231, 449, 437, 213, 415, 405, 395, 193, 377, 369, 361, 353, 345, 169, 331, 325, 319, 313, 307, 301, 37, 145, 285, 281, 69, 271, 267, 263, 259, 509, 501, 493, 243, 479, 118, 465, 459, 113, 446, 55, 435, 429, 423, 209, 413, 51, 403, 199, 393, 97, 3, 379, 375, 371, 367, 363, 359, 355, 351, 347, 43, 85, 337, 333, 165, 327, 323, 5, 317, 157, 311, 77, 305, 303, 75, 297, 294, 73, 289, 287, 71, 141, 279, 277, 275, 68, 135, 67, 133, 33, 262, 260, 129, 511, 507, 503, 499, 495, 491, 61, 121, 481, 477, 237, 235, 467, 232, 115, 457, 227, 451, 7, 445, 221, 439, 218, 433, 215, 427, 425, 211, 419, 417, 207, 411, 409, 203, 202, 401, 399, 396, 197, 49, 389, 387, 385, 383, 95, 189, 47, 187, 93, 185, 23, 183, 91, 181, 45, 179, 89, 177, 11, 175, 87, 173, 345, 343, 341, 339, 337, 21, 167, 83, 331, 329, 327, 163, 81, 323, 321, 319, 159, 79, 315, 313, 39, 155, 309, 307, 153, 305, 303, 151, 75, 299, 149, 37, 295, 147, 73, 291, 145, 289, 287, 143, 285, 71, 141, 281, 35, 279, 139, 69, 275, 137, 273, 17, 271, 135, 269, 267, 133, 265, 33, 263, 131, 261, 130, 259, 129, 257, 1], b.shg_table = [0, 9, 10, 11, 9, 12, 10, 11, 12, 9, 13, 13, 10, 9, 13, 13, 14, 14, 14, 14, 10, 13, 14, 14, 14, 13, 13, 13, 9, 14, 14, 14, 15, 14, 15, 14, 15, 15, 14, 15, 15, 15, 14, 15, 15, 15, 15, 15, 14, 15, 15, 15, 15, 15, 15, 12, 14, 15, 15, 13, 15, 15, 15, 15, 16, 16, 16, 15, 16, 14, 16, 16, 14, 16, 13, 16, 16, 16, 15, 16, 13, 16, 15, 16, 14, 9, 16, 16, 16, 16, 16, 16, 16, 16, 16, 13, 14, 16, 16, 15, 16, 16, 10, 16, 15, 16, 14, 16, 16, 14, 16, 16, 14, 16, 16, 14, 15, 16, 16, 16, 14, 15, 14, 15, 13, 16, 16, 15, 17, 17, 17, 17, 17, 17, 14, 15, 17, 17, 16, 16, 17, 16, 15, 17, 16, 17, 11, 17, 16, 17, 16, 17, 16, 17, 17, 16, 17, 17, 16, 17, 17, 16, 16, 17, 17, 17, 16, 14, 17, 17, 17, 17, 15, 16, 14, 16, 15, 16, 13, 16, 15, 16, 14, 16, 15, 16, 12, 16, 15, 16, 17, 17, 17, 17, 17, 13, 16, 15, 17, 17, 17, 16, 15, 17, 17, 17, 16, 15, 17, 17, 14, 16, 17, 17, 16, 17, 17, 16, 15, 17, 16, 14, 17, 16, 15, 17, 16, 17, 17, 16, 17, 15, 16, 17, 14, 17, 16, 15, 17, 16, 17, 13, 17, 16, 17, 17, 16, 17, 14, 17, 16, 17, 16, 17, 16, 17, 9], b.getBounds = function () { var a = .5 * Math.pow(this.quality, .6); return new createjs.Rectangle(-this.blurX * a, -this.blurY * a, 2 * this.blurX * a, 2 * this.blurY * a) }, b.applyFilter = function (a, b, c, d, e, f, g, h) { f = f || a, null == g && (g = b), null == h && (h = c); try { var i = a.getImageData(b, c, d, e) } catch (a) { return !1 } var j = this.blurX / 2; if (isNaN(j) || 0 > j) return !1; j |= 0; var k = this.blurY / 2; if (isNaN(k) || 0 > k) return !1; if (k |= 0, 0 == j && 0 == k) return !1; var l = this.quality; (isNaN(l) || 1 > l) && (l = 1), l |= 0, l > 3 && (l = 3), 1 > l && (l = 1); var b, c, m, n, o, p, q, r, s, t, u, v, w, x, y, z = i.data, A = j + j + 1, B = k + k + 1, C = d - 1, D = e - 1, E = j + 1, F = k + 1, G = { r: 0, b: 0, g: 0, a: 0, next: null }, H = G; for (m = 1; A > m; m++) H = H.next = { r: 0, b: 0, g: 0, a: 0, next: null }; H.next = G; var I = { r: 0, b: 0, g: 0, a: 0, next: null }, J = I; for (m = 1; B > m; m++) J = J.next = { r: 0, b: 0, g: 0, a: 0, next: null }; J.next = I; for (var K = null; l-- > 0; ) { q = p = 0; var L = this.mul_table[j], M = this.shg_table[j]; for (c = e; --c > -1; ) { for (r = E * (v = z[p]), s = E * (w = z[p + 1]), t = E * (x = z[p + 2]), u = E * (y = z[p + 3]), H = G, m = E; --m > -1; ) H.r = v, H.g = w, H.b = x, H.a = y, H = H.next; for (m = 1; E > m; m++) n = p + ((m > C ? C : m) << 2), r += H.r = z[n], s += H.g = z[n + 1], t += H.b = z[n + 2], u += H.a = z[n + 3], H = H.next; for (K = G, b = 0; d > b; b++) z[p++] = r * L >>> M, z[p++] = s * L >>> M, z[p++] = t * L >>> M, z[p++] = u * L >>> M, n = q + ((n = b + j + 1) < C ? n : C) << 2, r -= K.r - (K.r = z[n]), s -= K.g - (K.g = z[n + 1]), t -= K.b - (K.b = z[n + 2]), u -= K.a - (K.a = z[n + 3]), K = K.next; q += d } for (L = this.mul_table[k], M = this.shg_table[k], b = 0; d > b; b++) { for (p = b << 2, r = F * (v = z[p]), s = F * (w = z[p + 1]), t = F * (x = z[p + 2]), u = F * (y = z[p + 3]), J = I, m = 0; F > m; m++) J.r = v, J.g = w, J.b = x, J.a = y, J = J.next; for (o = d, m = 1; k >= m; m++) p = o + b << 2, r += J.r = z[p], s += J.g = z[p + 1], t += J.b = z[p + 2], u += J.a = z[p + 3], J = J.next, D > m && (o += d); if (p = b, K = I, l > 0) for (c = 0; e > c; c++) n = p << 2, z[n + 3] = y = u * L >>> M, y > 0 ? (z[n] = r * L >>> M, z[n + 1] = s * L >>> M, z[n + 2] = t * L >>> M) : z[n] = z[n + 1] = z[n + 2] = 0, n = b + ((n = c + F) < D ? n : D) * d << 2, r -= K.r - (K.r = z[n]), s -= K.g - (K.g = z[n + 1]), t -= K.b - (K.b = z[n + 2]), u -= K.a - (K.a = z[n + 3]), K = K.next, p += d; else for (c = 0; e > c; c++) n = p << 2, z[n + 3] = y = u * L >>> M, y > 0 ? (y = 255 / y, z[n] = (r * L >>> M) * y, z[n + 1] = (s * L >>> M) * y, z[n + 2] = (t * L >>> M) * y) : z[n] = z[n + 1] = z[n + 2] = 0, n = b + ((n = c + F) < D ? n : D) * d << 2, r -= K.r - (K.r = z[n]), s -= K.g - (K.g = z[n + 1]), t -= K.b - (K.b = z[n + 2]), u -= K.a - (K.a = z[n + 3]), K = K.next, p += d } } return f.putImageData(i, g, h), !0 }, b.clone = function () { return new a(this.blurX, this.blurY, this.quality) }, b.toString = function () { return "[BlurFilter]" }, createjs.BlurFilter = a } (), this.createjs = this.createjs || {}, function () { var a = function (a) { this.initialize(a) }, b = a.prototype = new createjs.Filter; b.initialize = function (a) { this.alphaMap = a }, b.alphaMap = null, b._alphaMap = null, b._mapData = null, b.applyFilter = function (a, b, c, d, e, f, g, h) { if (!this.alphaMap) return !0; if (!this._prepAlphaMap()) return !1; f = f || a, null == g && (g = b), null == h && (h = c); try { var i = a.getImageData(b, c, d, e) } catch (a) { return !1 } for (var j = i.data, k = this._mapData, l = j.length, m = 0; l > m; m += 4) j[m + 3] = k[m] || 0; return i.data = j, f.putImageData(i, g, h), !0 }, b.clone = function () { return new a(this.alphaMap) }, b.toString = function () { return "[AlphaMapFilter]" }, b._prepAlphaMap = function () { if (!this.alphaMap) return !1; if (this.alphaMap == this._alphaMap && this._mapData) return !0; this._mapData = null; var a, b = this._alphaMap = this.alphaMap, c = b; b instanceof HTMLCanvasElement ? a = c.getContext("2d") : (c = createjs.createCanvas ? createjs.createCanvas() : document.createElement("canvas"), c.width = b.width, c.height = b.height, a = c.getContext("2d"), a.drawImage(b, 0, 0)); try { var d = a.getImageData(0, 0, b.width, b.height) } catch (a) { return !1 } return this._mapData = d.data, !0 }, createjs.AlphaMapFilter = a } (), this.createjs = this.createjs || {}, function () { var a = function (a) { this.initialize(a) }, b = a.prototype = new createjs.Filter; b.initialize = function (a) { this.mask = a }, b.mask = null, b.applyFilter = function (a, b, c, d, e, f, g, h) { return !this.mask || (f = f || a, null == g && (g = b), null == h && (h = c), f.save(), f.globalCompositeOperation = "destination-in", f.drawImage(this.mask, g, h), f.restore(), !0) }, b.clone = function () { return new a(this.mask) }, b.toString = function () { return "[AlphaMaskFilter]" }, createjs.AlphaMaskFilter = a } (), this.createjs = this.createjs || {}, function () { var a = function (a, b, c, d, e, f, g, h) { this.initialize(a, b, c, d, e, f, g, h) }, b = a.prototype = new createjs.Filter; b.redMultiplier = 1, b.greenMultiplier = 1, b.blueMultiplier = 1, b.alphaMultiplier = 1, b.redOffset = 0, b.greenOffset = 0, b.blueOffset = 0, b.alphaOffset = 0, b.initialize = function (a, b, c, d, e, f, g, h) { this.redMultiplier = null != a ? a : 1, this.greenMultiplier = null != b ? b : 1, this.blueMultiplier = null != c ? c : 1, this.alphaMultiplier = null != d ? d : 1, this.redOffset = e || 0, this.greenOffset = f || 0, this.blueOffset = g || 0, this.alphaOffset = h || 0 }, b.applyFilter = function (a, b, c, d, e, f, g, h) { f = f || a, null == g && (g = b), null == h && (h = c); try { var i = a.getImageData(b, c, d, e) } catch (a) { return !1 } for (var j = i.data, k = j.length, l = 0; k > l; l += 4) j[l] = j[l] * this.redMultiplier + this.redOffset, j[l + 1] = j[l + 1] * this.greenMultiplier + this.greenOffset, j[l + 2] = j[l + 2] * this.blueMultiplier + this.blueOffset, j[l + 3] = j[l + 3] * this.alphaMultiplier + this.alphaOffset; return f.putImageData(i, g, h), !0 }, b.toString = function () { return "[ColorFilter]" }, b.clone = function () { return new a(this.redMultiplier, this.greenMultiplier, this.blueMultiplier, this.alphaMultiplier, this.redOffset, this.greenOffset, this.blueOffset, this.alphaOffset) }, createjs.ColorFilter = a } (), this.createjs = this.createjs || {}, function () { var a = function (a, b, c, d) { this.initialize(a, b, c, d) }, b = a.prototype = []; a.DELTA_INDEX = [0, .01, .02, .04, .05, .06, .07, .08, .1, .11, .12, .14, .15, .16, .17, .18, .2, .21, .22, .24, .25, .27, .28, .3, .32, .34, .36, .38, .4, .42, .44, .46, .48, .5, .53, .56, .59, .62, .65, .68, .71, .74, .77, .8, .83, .86, .89, .92, .95, .98, 1, 1.06, 1.12, 1.18, 1.24, 1.3, 1.36, 1.42, 1.48, 1.54, 1.6, 1.66, 1.72, 1.78, 1.84, 1.9, 1.96, 2, 2.12, 2.25, 2.37, 2.5, 2.62, 2.75, 2.87, 3, 3.2, 3.4, 3.6, 3.8, 4, 4.3, 4.7, 4.9, 5, 5.5, 6, 6.5, 6.8, 7, 7.3, 7.5, 7.8, 8, 8.4, 8.7, 9, 9.4, 9.6, 9.8, 10], a.IDENTITY_MATRIX = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1], a.LENGTH = a.IDENTITY_MATRIX.length, b.initialize = function (a, b, c, d) { return this.reset(), this.adjustColor(a, b, c, d), this }, b.reset = function () { return this.copyMatrix(a.IDENTITY_MATRIX) }, b.adjustColor = function (a, b, c, d) { return this.adjustHue(d), this.adjustContrast(b), this.adjustBrightness(a), this.adjustSaturation(c) }, b.adjustBrightness = function (a) { return 0 == a || isNaN(a) ? this : (a = this._cleanValue(a, 255), this._multiplyMatrix([1, 0, 0, 0, a, 0, 1, 0, 0, a, 0, 0, 1, 0, a, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1]), this) }, b.adjustContrast = function (b) { if (0 == b || isNaN(b)) return this; b = this._cleanValue(b, 100); var c; return 0 > b ? c = 127 + 127 * (b / 100) : (c = b % 1, c = 0 == c ? a.DELTA_INDEX[b] : a.DELTA_INDEX[b << 0] * (1 - c) + a.DELTA_INDEX[(b << 0) + 1] * c, c = 127 * c + 127), this._multiplyMatrix([c / 127, 0, 0, 0, .5 * (127 - c), 0, c / 127, 0, 0, .5 * (127 - c), 0, 0, c / 127, 0, .5 * (127 - c), 0, 0, 0, 1, 0, 0, 0, 0, 0, 1]), this }, b.adjustSaturation = function (a) { if (0 == a || isNaN(a)) return this; a = this._cleanValue(a, 100); var b = 1 + (a > 0 ? 3 * a / 100 : a / 100), c = .3086, d = .6094, e = .082; return this._multiplyMatrix([c * (1 - b) + b, d * (1 - b), e * (1 - b), 0, 0, c * (1 - b), d * (1 - b) + b, e * (1 - b), 0, 0, c * (1 - b), d * (1 - b), e * (1 - b) + b, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1]), this }, b.adjustHue = function (a) { if (0 == a || isNaN(a)) return this; a = this._cleanValue(a, 180) / 180 * Math.PI; var b = Math.cos(a), c = Math.sin(a), d = .213, e = .715, f = .072; return this._multiplyMatrix([d + b * (1 - d) + c * -d, e + b * -e + c * -e, f + b * -f + c * (1 - f), 0, 0, d + b * -d + .143 * c, e + b * (1 - e) + .14 * c, f + b * -f + c * - .283, 0, 0, d + b * -d + c * - (1 - d), e + b * -e + c * e, f + b * (1 - f) + c * f, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1]), this }, b.concat = function (b) { return b = this._fixMatrix(b), b.length != a.LENGTH ? this : (this._multiplyMatrix(b), this) }, b.clone = function () { return new a(this) }, b.toArray = function () { return this.slice(0, a.LENGTH) }, b.copyMatrix = function (b) { for (var c = a.LENGTH, d = 0; c > d; d++) this[d] = b[d]; return this }, b._multiplyMatrix = function (a) { for (var b = [], c = 0; 5 > c; c++) { for (var d = 0; 5 > d; d++) b[d] = this[d + 5 * c]; for (var d = 0; 5 > d; d++) { for (var e = 0, f = 0; 5 > f; f++) e += a[d + 5 * f] * b[f]; this[d + 5 * c] = e } } }, b._cleanValue = function (a, b) { return Math.min(b, Math.max(-b, a)) }, b._fixMatrix = function (b) { return b instanceof a && (b = b.slice(0)), b.length < a.LENGTH ? b = b.slice(0, b.length).concat(a.IDENTITY_MATRIX.slice(b.length, a.LENGTH)) : b.length > a.LENGTH && (b = b.slice(0, a.LENGTH)), b }, createjs.ColorMatrix = a } (), this.createjs = this.createjs || {}, function () { var a = function (a) { this.initialize(a) }, b = a.prototype = new createjs.Filter; b.matrix = null, b.initialize = function (a) { this.matrix = a }, b.applyFilter = function (a, b, c, d, e, f, g, h) { f = f || a, null == g && (g = b), null == h && (h = c); try { var i = a.getImageData(b, c, d, e) } catch (a) { return !1 } for (var j, k, l, m, n = i.data, o = n.length, p = this.matrix, q = p[0], r = p[1], s = p[2], t = p[3], u = p[4], v = p[5], w = p[6], x = p[7], y = p[8], z = p[9], A = p[10], B = p[11], C = p[12], D = p[13], E = p[14], F = p[15], G = p[16], H = p[17], I = p[18], J = p[19], K = 0; o > K; K += 4) j = n[K], k = n[K + 1], l = n[K + 2], m = n[K + 3], n[K] = j * q + k * r + l * s + m * t + u, n[K + 1] = j * v + k * w + l * x + m * y + z, n[K + 2] = j * A + k * B + l * C + m * D + E, n[K + 3] = j * F + k * G + l * H + m * I + J; return f.putImageData(i, g, h), !0 }, b.toString = function () { return "[ColorMatrixFilter]" }, b.clone = function () { return new a(this.matrix) }, createjs.ColorMatrixFilter = a } (), this.createjs = this.createjs || {}, function () { var a = function () { throw "Touch cannot be instantiated" }; a.isSupported = function () { return "ontouchstart" in window || window.navigator.msPointerEnabled && window.navigator.msMaxTouchPoints > 0 }, a.enable = function (b, c, d) { return !!(b && b.canvas && a.isSupported()) && (b.__touch = { pointers: {}, multitouch: !c, preventDefault: !d, count: 0 }, "ontouchstart" in window ? a._IOS_enable(b) : window.navigator.msPointerEnabled && a._IE_enable(b), !0) }, a.disable = function (b) { b && ("ontouchstart" in window ? a._IOS_disable(b) : window.navigator.msPointerEnabled && a._IE_disable(b)) }, a._IOS_enable = function (b) { var c = b.canvas, d = b.__touch.f = function (c) { a._IOS_handleEvent(b, c) }; c.addEventListener("touchstart", d, !1), c.addEventListener("touchmove", d, !1), c.addEventListener("touchend", d, !1), c.addEventListener("touchcancel", d, !1) }, a._IOS_disable = function (a) { var b = a.canvas; if (b) { var c = a.__touch.f; b.removeEventListener("touchstart", c, !1), b.removeEventListener("touchmove", c, !1), b.removeEventListener("touchend", c, !1), b.removeEventListener("touchcancel", c, !1) } }, a._IOS_handleEvent = function (a, b) { if (a) { a.__touch.preventDefault && b.preventDefault && b.preventDefault(); for (var c = b.changedTouches, d = b.type, e = 0, f = c.length; f > e; e++) { var g = c[e], h = g.identifier; g.target == a.canvas && ("touchstart" == d ? this._handleStart(a, h, b, g.pageX, g.pageY) : "touchmove" == d ? this._handleMove(a, h, b, g.pageX, g.pageY) : ("touchend" == d || "touchcancel" == d) && this._handleEnd(a, h, b)) } } }, a._IE_enable = function (b) { var c = b.canvas, d = b.__touch.f = function (c) { a._IE_handleEvent(b, c) }; c.addEventListener("MSPointerDown", d, !1), window.addEventListener("MSPointerMove", d, !1), window.addEventListener("MSPointerUp", d, !1), window.addEventListener("MSPointerCancel", d, !1), b.__touch.preventDefault && (c.style.msTouchAction = "none"), b.__touch.activeIDs = {} }, a._IE_disable = function (a) { var b = a.__touch.f; window.removeEventListener("MSPointerMove", b, !1), window.removeEventListener("MSPointerUp", b, !1), window.removeEventListener("MSPointerCancel", b, !1), a.canvas && a.canvas.removeEventListener("MSPointerDown", b, !1) }, a._IE_handleEvent = function (a, b) { if (a) { a.__touch.preventDefault && b.preventDefault && b.preventDefault(); var c = b.type, d = b.pointerId, e = a.__touch.activeIDs; if ("MSPointerDown" == c) { if (b.srcElement != a.canvas) return; e[d] = !0, this._handleStart(a, d, b, b.pageX, b.pageY) } else e[d] && ("MSPointerMove" == c ? this._handleMove(a, d, b, b.pageX, b.pageY) : ("MSPointerUp" == c || "MSPointerCancel" == c) && (delete e[d], this._handleEnd(a, d, b))) } }, a._handleStart = function (a, b, c, d, e) { var f = a.__touch; if (f.multitouch || !f.count) { var g = f.pointers; g[b] || (g[b] = !0, f.count++, a._handlePointerDown(b, c, d, e)) } }, a._handleMove = function (a, b, c, d, e) { a.__touch.pointers[b] && a._handlePointerMove(b, c, d, e) }, a._handleEnd = function (a, b, c) { var d = a.__touch, e = d.pointers; e[b] && (d.count--, a._handlePointerUp(b, c, !0), delete e[b]) }, createjs.Touch = a } (), this.createjs = this.createjs || {}, function () { var a = createjs.EaselJS = createjs.EaselJS || {}; a.version = "0.7.0", a.buildDate = "Tue, 01 Oct 2013 16:02:38 GMT" } (), function (a, b, c) { function d(c, d, e) { var f = b.createElement(c); return d && (f.id = X + d), e && (f.style.cssText = e), a(f) } function e(a) { var b = v.length, c = (N + a) % b; return 0 > c ? b + c : c } function f(a, b) { return Math.round((/%/.test(a) ? ("x" === b ? w.width() : w.height()) / 100 : 1) * parseInt(a, 10)) } function g(a) { return H.photo || /\.(gif|png|jpe?g|bmp|ico)((#|\?).*)?$/i.test(a) } function h() { var b; H = a.extend({}, a.data(M, W)); for (b in H) a.isFunction(H[b]) && "on" !== b.slice(0, 2) && (H[b] = H[b].call(M)); H.rel = H.rel || M.rel || "nofollow", H.href = H.href || a(M).attr("href"), H.title = H.title || M.title, "string" == typeof H.href && (H.href = a.trim(H.href)) } function i(b, c) { a.event.trigger(b), c && c.call(M) } function j() { var a, b, c, d = X + "Slideshow_", e = "click." + X; H.slideshow && v[1] ? (b = function () { C.text(H.slideshowStop).unbind(e).bind(_, function () { (H.loop || v[N + 1]) && (a = setTimeout(T.next, H.slideshowSpeed)) }).bind($, function () { clearTimeout(a) }).one(e + " " + aa, c), o.removeClass(d + "off").addClass(d + "on"), a = setTimeout(T.next, H.slideshowSpeed) }, c = function () { clearTimeout(a), C.text(H.slideshowStart).unbind([_, $, aa, e].join(" ")).one(e, function () { T.next(), b() }), o.removeClass(d + "on").addClass(d + "off") }, H.slideshowAuto ? b() : c()) : o.removeClass(d + "off " + d + "on") } function k(b) { R || (M = b, h(), v = a(M), N = 0, "nofollow" !== H.rel && (v = a("." + Y).filter(function () { var b = a.data(this, W).rel || this.rel; return b === H.rel }), N = v.index(M), -1 === N && (v = v.add(M), N = v.length - 1)), P || (P = Q = !0, o.show(), H.returnFocus && a(M).blur().one(ba, function () { a(this).focus() }), n.css({ opacity: +H.opacity, cursor: H.overlayClose ? "pointer" : "auto" }).show(), H.w = f(H.initialWidth, "x"), H.h = f(H.initialHeight, "y"), T.position(), ea && w.bind("resize." + fa + " scroll." + fa, function () { n.css({ width: w.width(), height: w.height(), top: w.scrollTop(), left: w.scrollLeft() }) }).trigger("resize." + fa), i(Z, H.onOpen), G.add(A).hide(), F.html(H.close).show()), T.load(!0)) } function l() { !o && b.body && (U = !1, w = a(c), o = d(ga).attr({ id: W, class: da ? X + (ea ? "IE6" : "IE") : "" }).hide(), n = d(ga, "Overlay", ea ? "position:absolute" : "").hide(), p = d(ga, "Wrapper"), q = d(ga, "Content").append(x = d(ga, "LoadedContent", "width:0; height:0; overflow:hidden"), z = d(ga, "LoadingOverlay").add(d(ga, "LoadingGraphic")), A = d(ga, "Title"), B = d(ga, "Current"), D = d(ga, "Next"), E = d(ga, "Previous"), C = d(ga, "Slideshow").bind(Z, j), F = d(ga, "Close")), p.append(d(ga).append(d(ga, "TopLeft"), r = d(ga, "TopCenter"), d(ga, "TopRight")), d(ga, !1, "clear:left").append(s = d(ga, "MiddleLeft"), q, t = d(ga, "MiddleRight")), d(ga, !1, "clear:left").append(d(ga, "BottomLeft"), u = d(ga, "BottomCenter"), d(ga, "BottomRight"))).find("div div").css({ float: "left" }), y = d(ga, !1, "position:absolute; width:9999px; visibility:hidden; display:none"), G = D.add(E).add(B).add(C), a(b.body).append(n, o.append(p, y))) } function m() { return !!o && (U || (U = !0, I = r.height() + u.height() + q.outerHeight(!0) - q.height(), J = s.width() + t.width() + q.outerWidth(!0) - q.width(), K = x.outerHeight(!0), L = x.outerWidth(!0), o.css({ "padding-bottom": I, "padding-right": J }), D.click(function () { T.next() }), E.click(function () { T.prev() }), F.click(function () { T.close() }), n.click(function () { H.overlayClose && T.close() }), a(b).bind("keydown." + X, function (a) { var b = a.keyCode; P && H.escKey && 27 === b && (a.preventDefault(), T.close()), P && H.arrowKey && v[1] && (37 === b ? (a.preventDefault(), E.click()) : 39 === b && (a.preventDefault(), D.click())) }), a("." + Y, b).live("click", function (a) { a.which > 1 || a.shiftKey || a.altKey || a.metaKey || (a.preventDefault(), k(this)) })), !0) } var n, o, p, q, r, s, t, u, v, w, x, y, z, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V = { transition: "elastic", speed: 300, width: !1, initialWidth: "600", innerWidth: !1, maxWidth: !1, height: !1, initialHeight: "450", innerHeight: !1, maxHeight: !1, scalePhotos: !0, scrolling: !0, inline: !1, html: !1, iframe: !1, fastIframe: !0, photo: !1, href: !1, title: !1, rel: !1, opacity: .9, preloading: !0, current: "image {current} of {total}", previous: "previous", next: "next", close: "close", open: !1, returnFocus: !0, reposition: !0, loop: !0, slideshow: !1, slideshowAuto: !0, slideshowSpeed: 2500, slideshowStart: "start slideshow", slideshowStop: "stop slideshow", onOpen: !1, onLoad: !1, onComplete: !1, onCleanup: !1, onClosed: !1, overlayClose: !0, escKey: !0, arrowKey: !0, top: !1, bottom: !1, left: !1, right: !1, fixed: !1, data: void 0 }, W = "AOScolorbox", X = "AOScbox", Y = X + "Element", Z = X + "_open", $ = X + "_load", _ = X + "_complete", aa = X + "_cleanup", ba = X + "_closed", ca = X + "_purge", da = !a.support.opacity && !a.support.style, ea = da && !c.XMLHttpRequest, fa = X + "_IE6", ga = "div"; a.AOScolorbox || (a(l), T = a.fn[W] = a[W] = function (b, c) { var d = this; if (b = b || {}, l(), m()) { if (!d[0]) { if (d.selector) return d; d = a(""), b.open = !0 } c && (b.onComplete = c), d.each(function () { a.data(this, W, a.extend({}, a.data(this, W) || V, b)) }).addClass(Y), (a.isFunction(b.open) && b.open.call(d) || b.open) && k(d[0]) } return d }, T.position = function (a, b) { function c(a) { r[0].style.width = u[0].style.width = q[0].style.width = a.style.width, q[0].style.height = s[0].style.height = t[0].style.height = a.style.height } var d = 0, e = 0, g = o.offset(), h = w.scrollTop(), i = w.scrollLeft(); w.unbind("resize." + X), o.css({ top: -9e4, left: -9e4 }), H.fixed && !ea ? (g.top -= h, g.left -= i, o.css({ position: "fixed" })) : (d = h, e = i, o.css({ position: "absolute" })), e += H.right !== !1 ? Math.max(w.width() - H.w - L - J - f(H.right, "x"), 0) : H.left !== !1 ? f(H.left, "x") : Math.round(Math.max(w.width() - H.w - L - J, 0) / 2), d += H.bottom !== !1 ? Math.max(w.height() - H.h - K - I - f(H.bottom, "y"), 0) : H.top !== !1 ? f(H.top, "y") : Math.round(Math.max(w.height() - H.h - K - I, 0) / 2), o.css({ top: g.top, left: g.left }), a = o.width() === H.w + L && o.height() === H.h + K ? 0 : a || 0, p[0].style.width = p[0].style.height = "9999px", o.dequeue().animate({ width: H.w + L, height: H.h + K, top: d, left: e }, { duration: a, complete: function () { c(this), Q = !1, p[0].style.width = H.w + L + J + "px", p[0].style.height = H.h + K + I + "px", H.reposition && setTimeout(function () { w.bind("resize." + X, T.position) }, 1), b && b() }, step: function () { c(this) } }) }, T.resize = function (a) { P && (a = a || {}, a.width && (H.w = f(a.width, "x") - L - J), a.innerWidth && (H.w = f(a.innerWidth, "x")), x.css({ width: H.w }), a.height && (H.h = f(a.height, "y") - K - I), a.innerHeight && (H.h = f(a.innerHeight, "y")), a.innerHeight || a.height || (x.css({ height: "auto" }), H.h = x.height()), x.css({ height: H.h }), T.position("none" === H.transition ? 0 : H.speed)) }, T.prep = function (b) { function c() { return H.w = H.w || x.width(), H.w = H.mw && H.mw < H.w ? H.mw : H.w, H.w } function f() { return H.h = H.h || x.height(), H.h = H.mh && H.mh < H.h ? H.mh : H.h, H.h } if (P) { var h, j = "none" === H.transition ? 0 : H.speed; x.remove(), x = d(ga, "LoadedContent").append(b), x.hide().appendTo(y.show()).css({ width: c(), overflow: H.scrolling ? "auto" : "hidden" }).css({ height: f() }).prependTo(q), y.hide(), a(O).css({ float: "none" }), ea && a("select").not(o.find("select")).filter(function () { return "hidden" !== this.style.visibility }).css({ visibility: "hidden" }).one(aa, function () { this.style.visibility = "inherit" }), h = function () { function b() { da && o[0].style.removeAttribute("filter") } var c, f, h, k, l, m, n = v.length, p = "frameBorder", q = "allowTransparency"; if (P) { if (k = function () { clearTimeout(S), z.hide(), i(_, H.onComplete) }, da && O && x.fadeIn(100), A.html(H.title).add(x).show(), n > 1) { if ("string" == typeof H.current && B.html(H.current.replace("{current}", N + 1).replace("{total}", n)).show(), D[H.loop || n - 1 > N ? "show" : "hide"]().html(H.next), E[H.loop || N ? "show" : "hide"]().html(H.previous), H.slideshow && C.show(), H.preloading) for (c = [e(-1), e(1)]; f = v[c.pop()]; ) l = a.data(f, W).href || f.href, a.isFunction(l) && (l = l.call(f)), g(l) && (m = new Image, m.src = l) } else G.hide(); H.iframe ? (h = d("iframe")[0], p in h && (h[p] = 0), q in h && (h[q] = "true"), h.name = X + +new Date, H.fastIframe ? k() : a(h).one("load", k), h.src = H.href, H.scrolling || (h.scrolling = "no"), a(h).addClass(X + "Iframe").appendTo(x).one(ca, function () { h.src = "//about:blank" })) : k(), "fade" === H.transition ? o.fadeTo(j, 1, b) : b() } }, "fade" === H.transition ? o.fadeTo(j, 0, function () { T.position(0, h) }) : T.position(j, h) } }, T.load = function (b) { var c, e, j = T.prep; Q = !0, O = !1, M = v[N], b || h(), i(ca), i($, H.onLoad), H.h = H.height ? f(H.height, "y") - K - I : H.innerHeight && f(H.innerHeight, "y"), H.w = H.width ? f(H.width, "x") - L - J : H.innerWidth && f(H.innerWidth, "x"), H.mw = H.w, H.mh = H.h, H.maxWidth && (H.mw = f(H.maxWidth, "x") - L - J, H.mw = H.w && H.w < H.mw ? H.w : H.mw), H.maxHeight && (H.mh = f(H.maxHeight, "y") - K - I, H.mh = H.h && H.h < H.mh ? H.h : H.mh), c = H.href, S = setTimeout(function () { z.show() }, 100), H.inline ? (d(ga).hide().insertBefore(a(c)[0]).one(ca, function () { a(this).replaceWith(x.children()) }), j(a(c))) : H.iframe ? j(" ") : H.html ? j(H.html) : g(c) ? (a(O = new Image).addClass(X + "Photo").error(function () { H.title = !1, j(d(ga, "Error").text("This image could not be loaded")) }).load(function () { var a; O.onload = null, H.scalePhotos && (e = function () { O.height -= O.height * a, O.width -= O.width * a }, H.mw && O.width > H.mw && (a = (O.width - H.mw) / O.width, e()), H.mh && O.height > H.mh && (a = (O.height - H.mh) / O.height, e())), H.h && (O.style.marginTop = Math.min(H.h - O.height, 0) / 2 + "px"), v[1] && (H.loop || v[N + 1]) && (O.style.cursor = "pointer", O.onclick = function () { T.next() }), da && (O.style.msInterpolationMode = "bicubic"), setTimeout(function () { j(O) }, 1) }), setTimeout(function () { O.src = c }, 1)) : c && y.load(c, H.data, function (b, c, e) { j("error" === c ? d(ga, "Error").text("Request unsuccessful: " + e.statusText) : a(this).contents()) }) }, T.next = function () { !Q && v[1] && (H.loop || v[N + 1]) && (N = e(1), T.load()) }, T.prev = function () { !Q && v[1] && (H.loop || N) && (N = e(-1), T.load()) }, T.close = function () { P && !R && (R = !0, P = !1, i(aa, H.onCleanup), w.unbind("." + X + " ." + fa), n.fadeTo(200, 0), o.stop().fadeTo(300, 0, function () { o.add(n).css({ opacity: 1, cursor: "auto" }).hide(), i(ca), x.remove(), setTimeout(function () { R = !1, i(ba, H.onClosed) }, 1) })) }, T.remove = function () { a([]).add(o).add(n).remove(), o = null, a("." + Y).removeData(W).removeClass(Y).die() }, T.element = function () { return a(M) }, T.settings = V) } (losjqisafe, document, this), function (a) { function b(b, e) { var f, g, h, i = this, j = b.add(i), k = a(window), l = a.tools.expose && (e.mask || e.expose), m = Math.random().toString().slice(10); l && ("string" == typeof l && (l = { color: l }), l.closeOnClick = l.closeOnEsc = !1); var n = e.target || b.attr("rel"); if (g = n ? a(n) : b, !g.length) throw "Could not find Overlay: " + n; b && -1 == b.index(g) && b.click(function (a) { return i.load(a), a.preventDefault() }), a.extend(i, { load: function (b) { if (i.isOpened()) return i; var f = d[e.effect]; if (!f) throw 'Overlay: cannot find effect : "' + e.effect + '"'; if (e.oneInstance && a.each(c, function () { this.close(b) }), b = b || a.Event(), b.type = "onBeforeLoad", j.trigger(b), b.isDefaultPrevented()) return i; h = !0, l && a(g).expose(l); var n = e.top, o = e.left, p = g.outerWidth({ margin: !0 }), q = g.outerHeight({ margin: !0 }); return "string" == typeof n && (n = "center" == n ? Math.max((k.height() - q) / 2, 0) : parseInt(n, 10) / 100 * k.height()), "center" == o && (o = Math.max((k.width() - p) / 2, 0)), f[0].call(i, { top: n, left: o }, function () { h && (b.type = "onLoad", j.trigger(b)) }), l && e.closeOnClick && a.mask.getMask().one("click", i.close), e.closeOnClick && a(document).bind("click." + m, function (b) { a(b.target).parents(g).length || i.close(b) }), e.closeOnEsc && a(document).bind("keydown." + m, function (a) { 27 == a.keyCode && i.close(a) }), i }, close: function (b) { return i.isOpened() ? (b = b || a.Event(), b.type = "onBeforeClose", j.trigger(b), b.isDefaultPrevented() ? void 0 : (h = !1, d[e.effect][1].call(i, function () { b.type = "onClose", j.trigger(b) }), a(document).unbind("click." + m).unbind("keydown." + m), l && a.mask.close(), i)) : i }, getOverlay: function () { return g }, getTrigger: function () { return b }, getClosers: function () { return f }, isOpened: function () { return h }, getConf: function () { return e } }), a.each("onBeforeLoad,onStart,onLoad,onBeforeClose,onClose".split(","), function (b, c) { a.isFunction(e[c]) && a(i).bind(c, e[c]), i[c] = function (b) { return b && a(i).bind(c, b), i } }), f = g.find(e.close || ".close"), !f.length && !e.close && (f = a(''), g.prepend(f)), f.click(function (a) { i.close(a) }), e.load && i.load() } a.tools = a.tools || { version: "1.2.6" }, a.tools.overlay = { addEffect: function (a, b, c) { d[a] = [b, c] }, conf: { close: null, closeOnClick: !0, closeOnEsc: !0, closeSpeed: "fast", effect: "default", fixed: !a.browser.msie || a.browser.version > 6, left: "center", load: !1, mask: null, oneInstance: !0, speed: "normal", target: null, top: "10%" } }; var c = [], d = {}; a.tools.overlay.addEffect("default", function (b, c) { var d = this.getConf(), e = a(window); d.fixed || (b.top += e.scrollTop(), b.left += e.scrollLeft()), b.position = d.fixed ? "fixed" : "absolute", this.getOverlay().css(b).fadeIn(d.speed, c) }, function (a) { this.getOverlay().fadeOut(this.getConf().closeSpeed, a) }), a.fn.overlay = function (d) { var e = this.data("overlay"); return e ? e : (a.isFunction(d) && (d = { onBeforeLoad: d }), d = a.extend(!0, {}, a.tools.overlay.conf, d), this.each(function () { e = new b(a(this), d), c.push(e), a(this).data("overlay", e) }), d.api ? e : this) } } (losjqisafe), function (a) { function b(b, c) { var d = a(c); return d.length < 2 ? d : b.parent().find(c) } function c(c, e) { var f = this, g = c.add(f), h = c.children(), i = 0, j = e.vertical; if (d || (d = f), h.length > 1 && (h = a(e.items, c)), e.size > 1 && (e.circular = !1), a.extend(f, { getConf: function () { return e }, getIndex: function () { return i }, getSize: function () { return f.getItems().size() }, getNaviButtons: function () { return n.add(o) }, getRoot: function () { return c }, getItemWrap: function () { return h }, getItems: function () { return h.find(e.item).not("." + e.clonedClass) }, move: function (a, b) { return f.seekTo(i + a, b) }, next: function (a) { return f.move(e.size, a) }, prev: function (a) { return f.move(-e.size, a) }, begin: function (a) { return f.seekTo(0, a) }, end: function (a) { return f.seekTo(f.getSize() - 1, a) }, focus: function () { return d = f, f }, addItem: function (b) { return b = a(b), e.circular ? (h.children().last().before(b), h.children().first().replaceWith(b.clone().addClass(e.clonedClass))) : (h.append(b), o.removeClass("disabled")), g.trigger("onAddItem", [b]), f }, seekTo: function (b, c, k) { if (b.jquery || (b *= 1), e.circular && 0 === b && -1 == i && 0 !== c) return f; if (!e.circular && 0 > b || b > f.getSize() || -1 > b) return f; var l = b; b.jquery ? b = f.getItems().index(b) : l = f.getItems().eq(b); var m = a.Event("onBeforeSeek"); if (!k && (g.trigger(m, [b, c]), m.isDefaultPrevented() || !l.length)) return f; var n = j ? { top: -l.position().top } : { left: -l.position().left }; return i = b, d = f, void 0 === c && (c = e.speed), h.animate(n, c, e.easing, k || function () { g.trigger("onSeek", [b]) }), f } }), a.each(["onBeforeSeek", "onSeek", "onAddItem"], function (b, c) { a.isFunction(e[c]) && a(f).bind(c, e[c]), f[c] = function (b) { return b && a(f).bind(c, b), f } }), e.circular) { var k = f.getItems().slice(-1).clone().prependTo(h), l = f.getItems().eq(1).clone().appendTo(h); k.add(l).addClass(e.clonedClass), f.onBeforeSeek(function (a, b, c) { return a.isDefaultPrevented() ? void 0 : -1 == b ? (f.seekTo(k, c, function () { f.end(0) }), a.preventDefault()) : void(b == f.getSize() && f.seekTo(l, c, function () { f.begin(0) })) }); var m = c.parents().add(c).filter(function () { return "none" === a(this).css("display") || void 0 }); m.length ? (m.show(), f.seekTo(0, 0, function () {}), m.hide()) : f.seekTo(0, 0, function () {}) } var n = b(c, e.prev).click(function (a) { a.stopPropagation(), f.prev() }), o = b(c, e.next).click(function (a) { a.stopPropagation(), f.next() }); if (e.circular || (f.onBeforeSeek(function (a, b) { setTimeout(function () { a.isDefaultPrevented() || (n.toggleClass(e.disabledClass, 0 >= b), o.toggleClass(e.disabledClass, b >= f.getSize() - 1)) }, 1) }), e.initialIndex || n.addClass(e.disabledClass)), f.getSize() < 2 && n.add(o).addClass(e.disabledClass), e.mousewheel && a.fn.mousewheel && c.mousewheel(function (a, b) { return e.mousewheel ? (f.move(0 > b ? 1 : -1, e.wheelSpeed || 50), !1) : void 0 }), e.touch) { var p = {}; h[0].ontouchstart = function (a) { var b = a.touches[0]; p.x = b.clientX, p.y = b.clientY }, h[0].ontouchmove = function (a) { if (1 == a.touches.length && !h.is(":animated")) { var b = a.touches[0], c = p.x - b.clientX, d = p.y - b.clientY; f[j && d > 0 || !j && c > 0 ? "next" : "prev"](), a.preventDefault() } } } e.keyboard && a(document).bind("keydown.scrollable", function (b) { if (!(!e.keyboard || b.altKey || b.ctrlKey || b.metaKey || a(b.target).is(":input") || "static" != e.keyboard && d != f)) { var c = b.keyCode; return !j || 38 != c && 40 != c ? j || 37 != c && 39 != c ? void 0 : (f.move(37 == c ? -1 : 1), b.preventDefault()) : (f.move(38 == c ? -1 : 1), b.preventDefault()) } }), e.initialIndex && f.seekTo(e.initialIndex, 0, function () {}) } a.tools = a.tools || { version: "1.2.6" }, a.tools.scrollable = { conf: { activeClass: "active", circular: !1, clonedClass: "cloned", disabledClass: "disabled", easing: "swing", initialIndex: 0, item: "> *", items: ".items", keyboard: !0, mousewheel: !1, next: ".next", prev: ".prev", size: 1, speed: 400, vertical: !1, touch: !0, wheelSpeed: 0 } }; var d; a.fn.AOSscrollable = function (b) { var d = this.data("scrollable"); return d ? d : (b = a.extend({}, a.tools.scrollable.conf, b), this.each(function () { d = new c(a(this), b), a(this).data("scrollable", d) }), b.api ? d : this) } } (losjqisafe), function (a) { function b(b, c, d) { var f, g = this, h = b.add(this), i = b.find(d.tabs), j = c.jquery ? c : b.children(c); i.length || (i = b.children()), j.length || (j = b.parent().find(c)), j.length || (j = a(c)), a.extend(this, { click: function (b, c) { var j = i.eq(b); if ("string" == typeof b && b.replace("#", "") && (j = i.filter("[href*=" + b.replace("#", "") + "]"), b = Math.max(i.index(j), 0)), d.rotate) { var k = i.length - 1; if (0 > b) return g.click(k, c); if (b > k) return g.click(0, c) } if (!j.length) { if (f >= 0) return g; b = d.initialIndex, j = i.eq(b) } return b === f ? g : (c = c || a.Event(), c.type = "onBeforeClick", h.trigger(c, [b]), c.isDefaultPrevented() ? void 0 : (e[d.effect].call(g, b, function () { f = b, c.type = "onClick", h.trigger(c, [b]) }), i.removeClass(d.current), j.addClass(d.current), g)) }, getConf: function () { return d }, getTabs: function () { return i }, getPanes: function () { return j }, getCurrentPane: function () { return j.eq(f) }, getCurrentTab: function () { return i.eq(f) }, getIndex: function () { return f }, next: function () { return g.click(f + 1) }, prev: function () { return g.click(f - 1) }, destroy: function () { return i.unbind(d.event).removeClass(d.current), j.find("a[href^=#]").unbind("click.T"), g } }), a.each("onBeforeClick,onClick".split(","), function (b, c) { a.isFunction(d[c]) && a(g).bind(c, d[c]), g[c] = function (b) { return b && a(g).bind(c, b), g } }), d.history && a.fn.history && (a.tools.history.init(i), d.event = "history"), i.each(function (b) { a(this).bind(d.event, function (a) { return g.click(b, a), a.preventDefault() }) }), j.find("a[href^=#]").bind("click.T", function (b) { g.click(a(this).attr("href"), b) }), location.hash && "a" == d.tabs && b.find("[href=" + location.hash + "]").length ? g.click(location.hash) : (0 === d.initialIndex || d.initialIndex > 0) && g.click(d.initialIndex) } a.tools = a.tools || { version: "1.2.6" }, a.tools.tabs = { conf: { tabs: "a", current: "current", onBeforeClick: null, onClick: null, effect: "default", initialIndex: 0, event: "click", rotate: !1, slideUpSpeed: 400, slideDownSpeed: 400, history: !1 }, addEffect: function (a, b) { e[a] = b } }; var c, d, e = { default: function (a, b) { this.getPanes().hide().eq(a).show(), b.call() }, fade: function (a, b) { var c = this.getConf(), d = c.fadeOutSpeed, e = this.getPanes(); d ? e.fadeOut(d) : e.hide(), e.eq(a).fadeIn(c.fadeInSpeed, b) }, slide: function (a, b) { var c = this.getConf(); this.getPanes().slideUp(c.slideUpSpeed), this.getPanes().eq(a).slideDown(c.slideDownSpeed, b) }, ajax: function (a, b) { this.getPanes().eq(0).load(this.getTabs().eq(a).attr("href"), b) } }; a.tools.tabs.addEffect("horizontal", function (b, e) { if (!c) { var f = this.getPanes().eq(b), g = this.getCurrentPane(); d || (d = this.getPanes().eq(0).width()), c = !0, f.show(), g.animate({ width: 0 }, { step: function (a) { f.css("width", d - a) }, complete: function () { a(this).hide(), e.call(), c = !1 } }), g.length || (e.call(), c = !1) } }), a.fn.AOStabs = function (c, d) { var e = this.data("tabs"); return e && (e.destroy(), this.removeData("tabs")), a.isFunction(d) && (d = { onBeforeClick: d }), d = a.extend({}, a.tools.tabs.conf, d), this.each(function () { e = new b(a(this), c, d), a(this).data("tabs", e) }), d.api ? e : this } } (losjqisafe), function (a) { function b(b, c, d) { var e = d.relative ? b.position().top : b.offset().top, f = d.relative ? b.position().left : b.offset().left, g = d.position[0]; e -= c.outerHeight() - d.offset[0], f += b.outerWidth() + d.offset[1], /iPad/i.test(navigator.userAgent) && (e -= a(window).scrollTop()); var h = c.outerHeight() + b.outerHeight(); "center" == g && (e += h / 2), "bottom" == g && (e += h), g = d.position[1]; var i = c.outerWidth() + b.outerWidth(); return "center" == g && (f -= i / 2), "left" == g && (f -= i), { top: e, left: f } } function c(c, e) { var f, g, h = this, i = c.add(h), j = 0, k = 0, l = c.attr("title"), m = c.attr("data-tooltip"), n = d[e.effect], o = c.is(":input"), p = o && c.is(":checkbox, :radio, select, :button, :submit"), q = c.attr("type"), r = e.events[q] || e.events[o ? p ? "widget" : "input" : "def"]; if (!n) throw 'Nonexistent effect "' + e.effect + '"'; if (r = r.split(/,\s*/), 2 != r.length) throw "Tooltip: bad events configuration for " + q; c.bind(r[0], function (a) { clearTimeout(j), e.predelay ? k = setTimeout(function () { h.show(a) }, e.predelay) : h.show(a) }).bind(r[1], function (a) { clearTimeout(k), e.delay ? j = setTimeout(function () { h.hide(a) }, e.delay) : h.hide(a) }), l && e.cancelDefault && (c.removeAttr("title"), c.data("title", l)), a.extend(h, { show: function (d) { if (!f && (m ? f = a(m) : e.tip ? f = a(e.tip).eq(0) : l ? f = a(e.layout).addClass(e.tipClass).appendTo(document.body).hide().append(l) : (f = c.next(), f.length || (f = c.parent().next())), !f.length)) throw "Cannot find tooltip for " + c; if (h.isShown()) return h; f.stop(!0, !0); var o = b(c, f, e); if (e.tip && f.html(c.data("title")), d = a.Event(), d.type = "onBeforeShow", i.trigger(d, [o]), d.isDefaultPrevented()) return h; o = b(c, f, e), f.css({ position: "absolute", top: o.top, left: o.left }), g = !0, n[0].call(h, function () { d.type = "onShow", g = "full", i.trigger(d) }); var p = e.events.tooltip.split(/,\s*/); return f.data("__set") || (f.unbind(p[0]).bind(p[0], function () { clearTimeout(j), clearTimeout(k) }), p[1] && !c.is("input:not(:checkbox, :radio), textarea") && f.unbind(p[1]).bind(p[1], function (a) { a.relatedTarget != c[0] && c.trigger(r[1].split(" ")[0]) }), e.tip || f.data("__set", !0)), h }, hide: function (b) { return f && h.isShown() ? (b = a.Event(), b.type = "onBeforeHide", i.trigger(b), b.isDefaultPrevented() ? void 0 : (g = !1, d[e.effect][1].call(h, function () { b.type = "onHide", i.trigger(b) }), h)) : h }, isShown: function (a) { return a ? "full" == g : g }, getConf: function () { return e }, getTip: function () { return f }, getTrigger: function () { return c } }), a.each("onHide,onBeforeShow,onShow,onBeforeHide".split(","), function (b, c) { a.isFunction(e[c]) && a(h).bind(c, e[c]), h[c] = function (b) { return b && a(h).bind(c, b), h } }) } a.tools = a.tools || { version: "1.2.6" }, a.tools.tooltip = { conf: { effect: "toggle", fadeOutSpeed: "fast", predelay: 0, delay: 30, opacity: 1, tip: 0, fadeIE: !1, position: ["top", "center"], offset: [0, 0], relative: !1, cancelDefault: !0, events: { def: "mouseenter,mouseleave", input: "focus,blur", widget: "focus mouseenter,blur mouseleave", tooltip: "mouseenter,mouseleave" }, layout: "
", tipClass: "tooltip" }, addEffect: function (a, b, c) { d[a] = [b, c] } }; var d = { toggle: [function (a) { var b = this.getConf(), c = this.getTip(), d = b.opacity; 1 > d && c.css({ opacity: d }), c.show(), a.call() }, function (a) { this.getTip().hide(), a.call() } ], fade: [function (b) { var c = this.getConf(); !a.browser.msie || c.fadeIE ? this.getTip().fadeTo(c.fadeInSpeed, c.opacity, b) : (this.getTip().show(), b()) }, function (b) { var c = this.getConf(); !a.browser.msie || c.fadeIE ? this.getTip().fadeOut(c.fadeOutSpeed, b) : (this.getTip().hide(), b()) } ] }; a.fn.tooltip = function (b) { var d = this.data("tooltip"); return d ? d : (b = a.extend(!0, {}, a.tools.tooltip.conf, b), "string" == typeof b.position && (b.position = b.position.split(/,?\s/)), this.each(function () { d = new c(a(this), b), a(this).data("tooltip", d) }), b.api ? d : this) } } (losjqisafe), this.createjs = this.createjs || {}, function () { var a = function () { throw "CSSPlugin cannot be instantiated." }; a.cssSuffixMap = { top: "px", left: "px", bottom: "px", right: "px", width: "px", height: "px", opacity: "" }, a.priority = -100, a.install = function () { var b = [], c = a.cssSuffixMap; for (var d in c) b.push(d); createjs.Tween.installPlugin(a, b) }, a.init = function (b, c, d) { var e, f, g, h = a.cssSuffixMap; if (null == (e = h[c]) || !(g = b.target.style)) return d; var i = g[c]; if (!i) return 0; var j = i.length - e.length; if ((f = i.substr(j)) != e) throw "CSSPlugin Error: Suffixes do not match. (" + e + ":" + f + ")"; return parseInt(i.substr(0, j)) }, a.step = function () {}, a.tween = function (b, c, d) { var e, f = a.cssSuffixMap; return null != f[c] && (e = b.target.style) ? (e[c] = d + f[c], createjs.Tween.IGNORE) : d }, createjs.CSSPlugin = a } (), document.createElement("video"), document.createElement("audio"), document.createElement("track"); var vjs = function (a, b, c) { var d; if ("string" == typeof a) { if (0 === a.indexOf("#") && (a = a.slice(1)), vjs.players[a]) return vjs.players[a]; d = vjs.el(a) } else d = a; if (!d || !d.nodeName) throw new TypeError("The element or ID supplied is not valid. (videojs)"); return d.player || new vjs.Player(d, b, c) }, videojs = vjs; window.videojs = window.vjs = vjs, vjs.CDN_VERSION = "4.3", vjs.ACCESS_PROTOCOL = "https:" == document.location.protocol ? "https://" : "http://", vjs.options = { techOrder: ["html5", "flash"], html5: {}, flash: {}, width: 300, height: 150, defaultVolume: 0, children: { mediaLoader: {}, posterImage: {}, textTrackDisplay: {}, loadingSpinner: {}, bigPlayButton: {}, controlBar: {} }, notSupportedMessage: 'Sorry, no compatible source and playback technology were found for this video. Try using another browser like Chrome or download the latest Adobe Flash Player.' }, "GENERATED_CDN_VSN" !== vjs.CDN_VERSION && (videojs.options.flash.swf = vjs.ACCESS_PROTOCOL + "vjs.zencdn.net/" + vjs.CDN_VERSION + "/video-js.swf"), vjs.players = {}, vjs.CoreObject = vjs.CoreObject = function () {}, vjs.CoreObject.extend = function (a) { var b, c; a = a || {}, b = a.init || a.init || this.prototype.init || this.prototype.init || function () {}, c = function () { b.apply(this, arguments) }, c.prototype = vjs.obj.create(this.prototype), c.prototype.constructor = c, c.extend = vjs.CoreObject.extend, c.create = vjs.CoreObject.create; for (var d in a) a.hasOwnProperty(d) && (c.prototype[d] = a[d]); return c }, vjs.CoreObject.create = function () { var a = vjs.obj.create(this.prototype); return this.apply(a, arguments), a }, vjs.on = function (a, b, c) { var d = vjs.getData(a); d.handlers || (d.handlers = {}), d.handlers[b] || (d.handlers[b] = []), c.guid || (c.guid = vjs.guid++), d.handlers[b].push(c), d.dispatcher || (d.disabled = !1, d.dispatcher = function (b) { if (!d.disabled) { b = vjs.fixEvent(b); var c = d.handlers[b.type]; if (c) for (var e = c.slice(0), f = 0, g = e.length; g > f && !b.isImmediatePropagationStopped(); f++) e[f].call(a, b) } }), 1 == d.handlers[b].length && (document.addEventListener ? a.addEventListener(b, d.dispatcher, !1) : document.attachEvent && a.attachEvent("on" + b, d.dispatcher)) }, vjs.off = function (a, b, c) { if (vjs.hasData(a)) { var d = vjs.getData(a); if (d.handlers) { var e = function (b) { d.handlers[b] = [], vjs.cleanUpEvents(a, b) }; if (b) { var f = d.handlers[b]; if (f) { if (!c) return void e(b); if (c.guid) for (var g = 0; g < f.length; g++) f[g].guid === c.guid && f.splice(g--, 1); vjs.cleanUpEvents(a, b) } } else for (var h in d.handlers) e(h) } } }, vjs.cleanUpEvents = function (a, b) { var c = vjs.getData(a); 0 === c.handlers[b].length && (delete c.handlers[b], document.removeEventListener ? a.removeEventListener(b, c.dispatcher, !1) : document.detachEvent && a.detachEvent("on" + b, c.dispatcher)), vjs.isEmpty(c.handlers) && (delete c.handlers, delete c.dispatcher, delete c.disabled), vjs.isEmpty(c) && vjs.removeData(a) }, vjs.fixEvent = function (a) { function b() { return !0 } function c() { return !1 } if (!a || !a.isPropagationStopped) { var d = a || window.event; a = {}; for (var e in d) "layerX" !== e && "layerY" !== e && (a[e] = d[e]); if (a.target || (a.target = a.srcElement || document), a.relatedTarget = a.fromElement === a.target ? a.toElement : a.fromElement, a.preventDefault = function () { d.preventDefault && d.preventDefault(), a.returnValue = !1, a.isDefaultPrevented = b }, a.isDefaultPrevented = c, a.stopPropagation = function () { d.stopPropagation && d.stopPropagation(), a.cancelBubble = !0, a.isPropagationStopped = b }, a.isPropagationStopped = c, a.stopImmediatePropagation = function () { d.stopImmediatePropagation && d.stopImmediatePropagation(), a.isImmediatePropagationStopped = b, a.stopPropagation() }, a.isImmediatePropagationStopped = c, null != a.clientX) { var f = document.documentElement, g = document.body; a.pageX = a.clientX + (f && f.scrollLeft || g && g.scrollLeft || 0) - (f && f.clientLeft || g && g.clientLeft || 0), a.pageY = a.clientY + (f && f.scrollTop || g && g.scrollTop || 0) - (f && f.clientTop || g && g.clientTop || 0) } a.which = a.charCode || a.keyCode, null != a.button && (a.button = 1 & a.button ? 0 : 4 & a.button ? 1 : 2 & a.button ? 2 : 0) } return a }, vjs.trigger = function (a, b) { var c = vjs.hasData(a) ? vjs.getData(a) : {}, d = a.parentNode || a.ownerDocument; if ("string" == typeof b && (b = { type: b, target: a }), b = vjs.fixEvent(b), c.dispatcher && c.dispatcher.call(a, b), d && !b.isPropagationStopped() && b.bubbles !== !1) vjs.trigger(d, b); else if (!d && !b.isDefaultPrevented()) { var e = vjs.getData(b.target); b.target[b.type] && (e.disabled = !0, "function" == typeof b.target[b.type] && b.target[b.type](), e.disabled = !1) } return !b.isDefaultPrevented() }, vjs.one = function (a, b, c) { var d = function () { vjs.off(a, b, d), c.apply(this, arguments) }; d.guid = c.guid = c.guid || vjs.guid++, vjs.on(a, b, d) }; var hasOwnProp = Object.prototype.hasOwnProperty; vjs.createEl = function (a, b) { var c, d; c = document.createElement(a || "div"); for (d in b) hasOwnProp.call(b, d) && (-1 !== d.indexOf("aria-") || "role" == d ? c.setAttribute(d, b[d]) : c[d] = b[d]); return c }, vjs.capitalize = function (a) { return a.charAt(0).toUpperCase() + a.slice(1) }, vjs.obj = {}, vjs.obj.create = Object.create || function (a) { function b() {} return b.prototype = a, new b }, vjs.obj.each = function (a, b, c) { for (var d in a) hasOwnProp.call(a, d) && b.call(c || this, d, a[d]) }, vjs.obj.merge = function (a, b) { if (!b) return a; for (var c in b) hasOwnProp.call(b, c) && (a[c] = b[c]); return a }, vjs.obj.deepMerge = function (a, b) { var c, d, e; a = vjs.obj.copy(a); for (c in b) hasOwnProp.call(b, c) && (d = a[c], e = b[c], vjs.obj.isPlain(d) && vjs.obj.isPlain(e) ? a[c] = vjs.obj.deepMerge(d, e) : a[c] = b[c]); return a }, vjs.obj.copy = function (a) { return vjs.obj.merge({}, a) }, vjs.obj.isPlain = function (a) { return !!a && "object" == typeof a && "[object Object]" === a.toString() && a.constructor === Object }, vjs.bind = function (a, b, c) { b.guid || (b.guid = vjs.guid++); var d = function () { return b.apply(a, arguments) }; return d.guid = c ? c + "_" + b.guid : b.guid, d }, vjs.cache = {}, vjs.guid = 1, vjs.expando = "vdata" + (new Date).getTime(), vjs.getData = function (a) { var b = a[vjs.expando]; return b || (b = a[vjs.expando] = vjs.guid++, vjs.cache[b] = {}), vjs.cache[b] }, vjs.hasData = function (a) { var b = a[vjs.expando]; return !(!b || vjs.isEmpty(vjs.cache[b])) }, vjs.removeData = function (a) { var b = a[vjs.expando]; if (b) { delete vjs.cache[b]; try { delete a[vjs.expando] } catch (b) { a.removeAttribute ? a.removeAttribute(vjs.expando) : a[vjs.expando] = null } } }, vjs.isEmpty = function (a) { for (var b in a) if (null !== a[b]) return !1; return !0 }, vjs.addClass = function (a, b) { -1 == (" " + a.className + " ").indexOf(" " + b + " ") && (a.className = "" === a.className ? b : a.className + " " + b) }, vjs.removeClass = function (a, b) { var c, d; if (-1 != a.className.indexOf(b)) { for (c = a.className.split(" "), d = c.length - 1; d >= 0; d--) c[d] === b && c.splice(d, 1); a.className = c.join(" ") } }, vjs.TEST_VID = vjs.createEl("video"), vjs.USER_AGENT = navigator.userAgent, vjs.IS_IPHONE = /iPhone/i.test(vjs.USER_AGENT), vjs.IS_IPAD = /iPad/i.test(vjs.USER_AGENT), vjs.IS_IPOD = /iPod/i.test(vjs.USER_AGENT), vjs.IS_IOS = vjs.IS_IPHONE || vjs.IS_IPAD || vjs.IS_IPOD, vjs.IOS_VERSION = function () { var a = vjs.USER_AGENT.match(/OS (\d+)_/i); return a && a[1] ? a[1] : void 0 } (), vjs.IS_ANDROID = /Android/i.test(vjs.USER_AGENT), vjs.ANDROID_VERSION = function () { var a, b, c = vjs.USER_AGENT.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i); return c ? (a = c[1] && parseFloat(c[1]), b = c[2] && parseFloat(c[2]), a && b ? parseFloat(c[1] + "." + c[2]) : a ? a : null) : null } (), vjs.IS_OLD_ANDROID = vjs.IS_ANDROID && /webkit/i.test(vjs.USER_AGENT) && vjs.ANDROID_VERSION < 2.3, vjs.IS_FIREFOX = /Firefox/i.test(vjs.USER_AGENT), vjs.IS_CHROME = /Chrome/i.test(vjs.USER_AGENT), vjs.TOUCH_ENABLED = !!("ontouchstart" in window || window.DocumentTouch && document instanceof window.DocumentTouch), vjs.getAttributeValues = function (a) { var b, c, d, e, f; if (b = {}, c = ",autoplay,controls,loop,muted,default,", a && a.attributes && a.attributes.length > 0) { d = a.attributes; for (var g = d.length - 1; g >= 0; g--) e = d[g].name, f = d[g].value, ("boolean" == typeof a[e] || -1 !== c.indexOf("," + e + ",")) && (f = null !== f), b[e] = f } return b }, vjs.getComputedDimension = function (a, b) { var c = ""; return document.defaultView && document.defaultView.getComputedStyle ? c = document.defaultView.getComputedStyle(a, "").getPropertyValue(b) : a.currentStyle && (c = a["client" + b.substr(0, 1).toUpperCase() + b.substr(1)] + "px"), c }, vjs.insertFirst = function (a, b) { b.firstChild ? b.insertBefore(a, b.firstChild) : b.appendChild(a) }, vjs.support = {}, vjs.el = function (a) { return 0 === a.indexOf("#") && (a = a.slice(1)), document.getElementById(a) }, vjs.formatTime = function (a, b) { b = b || a; var c = Math.floor(a % 60), d = Math.floor(a / 60 % 60), e = Math.floor(a / 3600), f = Math.floor(b / 60 % 60), g = Math.floor(b / 3600); return (isNaN(a) || a === 1 / 0) && (e = d = c = "-"), e = e > 0 || g > 0 ? e + ":" : "", d = ((e || f >= 10) && 10 > d ? "0" + d : d) + ":", c = 10 > c ? "0" + c : c, e + d + c }, vjs.blockTextSelection = function () { document.body.focus(), document.onselectstart = function () { return !1 } }, vjs.unblockTextSelection = function () { document.onselectstart = function () { return !0 } }, vjs.trim = function (a) { return (a + "").replace(/^\s+|\s+$/g, "") }, vjs.round = function (a, b) { return b || (b = 0), Math.round(a * Math.pow(10, b)) / Math.pow(10, b) }, vjs.createTimeRange = function (a, b) { return { length: 1, start: function () { return a }, end: function () { return b } } }, vjs.get = function (a, b, c) { var d, e; "undefined" == typeof XMLHttpRequest && (window.XMLHttpRequest = function () { try { return new window.ActiveXObject("Msxml2.XMLHTTP.6.0") } catch (a) {} try { return new window.ActiveXObject("Msxml2.XMLHTTP.3.0") } catch (a) {} try { return new window.ActiveXObject("Msxml2.XMLHTTP") } catch (a) {} throw new Error("This browser does not support XMLHttpRequest.") }), e = new XMLHttpRequest; try { e.open("GET", a) } catch (a) { c(a) } d = 0 === a.indexOf("file:") || 0 === window.location.href.indexOf("file:") && -1 === a.indexOf("http"), e.onreadystatechange = function () { 4 === e.readyState && (200 === e.status || d && 0 === e.status ? b(e.responseText) : c && c()) }; try { e.send() } catch (a) { c && c(a) } }, vjs.setLocalStorage = function (a, b) { try { var c = window.localStorage || !1; if (!c) return; c[a] = b } catch (a) { 22 == a.code || 1014 == a.code ? vjs.log("LocalStorage Full (VideoJS)", a) : 18 == a.code ? vjs.log("LocalStorage not allowed (VideoJS)", a) : vjs.log("LocalStorage Error (VideoJS)", a) } }, vjs.getAbsoluteURL = function (a) { return a.match(/^https?:\/\//) || (a = vjs.createEl("div", { innerHTML: 'x' }).firstChild.href), a }, vjs.log = function () { vjs.log.history = vjs.log.history || [], vjs.log.history.push(arguments) }, vjs.findPosition = function (a) { var b, c, d, e, f, g, h, i, j; return a.getBoundingClientRect && a.parentNode && (b = a.getBoundingClientRect()), b ? (c = document.documentElement, d = document.body, e = c.clientLeft || d.clientLeft || 0, f = window.pageXOffset || d.scrollLeft, g = b.left + f - e, h = c.clientTop || d.clientTop || 0, i = window.pageYOffset || d.scrollTop, j = b.top + i - h, { left: g, top: j }) : { left: 0, top: 0 } }, vjs.Component = vjs.CoreObject.extend({ init: function (a, b, c) { this.player_ = a, this.options_ = vjs.obj.copy(this.options_), b = this.options(b), this.id_ = b.id || (b.el && b.el.id ? b.el.id : a.id() + "_component_" + vjs.guid++), this.name_ = b.name || null, this.el_ = b.el || this.createEl(), this.children_ = [], this.childIndex_ = {}, this.childNameIndex_ = {}, this.initChildren(), this.ready(c) } }), vjs.Component.prototype.dispose = function () { if (this.trigger("dispose"), this.children_) for (var a = this.children_.length - 1; a >= 0; a--) this.children_[a].dispose && this.children_[a].dispose(); this.children_ = null, this.childIndex_ = null, this.childNameIndex_ = null, this.off(), this.el_.parentNode && this.el_.parentNode.removeChild(this.el_), vjs.removeData(this.el_), this.el_ = null }, vjs.Component.prototype.player_ = !0, vjs.Component.prototype.player = function () { return this.player_ }, vjs.Component.prototype.options_, vjs.Component.prototype.options = function (a) { return void 0 === a ? this.options_ : this.options_ = vjs.obj.deepMerge(this.options_, a) }, vjs.Component.prototype.el_, vjs.Component.prototype.createEl = function (a, b) { return vjs.createEl(a, b) }, vjs.Component.prototype.el = function () { return this.el_ }, vjs.Component.prototype.contentEl_, vjs.Component.prototype.contentEl = function () { return this.contentEl_ || this.el_ }, vjs.Component.prototype.id_, vjs.Component.prototype.id = function () { return this.id_ }, vjs.Component.prototype.name_, vjs.Component.prototype.name = function () { return this.name_ }, vjs.Component.prototype.children_, vjs.Component.prototype.children = function () { return this.children_ }, vjs.Component.prototype.childIndex_, vjs.Component.prototype.getChildById = function (a) { return this.childIndex_[a] }, vjs.Component.prototype.childNameIndex_, vjs.Component.prototype.getChild = function (a) { return this.childNameIndex_[a] }, vjs.Component.prototype.addChild = function (a, b) { var c, d, e; return "string" == typeof a ? (e = a, b = b || {}, d = b.componentClass || vjs.capitalize(e), b.name = e, c = new window.videojs[d](this.player_ || this, b)) : c = a, this.children_.push(c), "function" == typeof c.id && (this.childIndex_[c.id()] = c), e = e || c.name && c.name(), e && (this.childNameIndex_[e] = c), "function" == typeof c.el && c.el() && this.contentEl().appendChild(c.el()), c }, vjs.Component.prototype.removeChild = function (a) { if ("string" == typeof a && (a = this.getChild(a)), a && this.children_) { for (var b = !1, c = this.children_.length - 1; c >= 0; c--) if (this.children_[c] === a) { b = !0, this.children_.splice(c, 1); break } if (b) { this.childIndex_[a.id] = null, this.childNameIndex_[a.name] = null; var d = a.el(); d && d.parentNode === this.contentEl() && this.contentEl().removeChild(a.el()) } } }, vjs.Component.prototype.initChildren = function () { var a = this.options_; if (a && a.children) { var b = this; vjs.obj.each(a.children, function (a, c) { if (c !== !1) { var d = function () { b[a] = b.addChild(a, c) }; c.loadEvent || d() } }) } }, vjs.Component.prototype.buildCSSClass = function () { return "" }, vjs.Component.prototype.on = function (a, b) { return vjs.on(this.el_, a, vjs.bind(this, b)), this }, vjs.Component.prototype.off = function (a, b) { return vjs.off(this.el_, a, b), this }, vjs.Component.prototype.one = function (a, b) { return vjs.one(this.el_, a, vjs.bind(this, b)), this }, vjs.Component.prototype.trigger = function (a, b) { return vjs.trigger(this.el_, a, b), this }, vjs.Component.prototype.isReady_, vjs.Component.prototype.isReadyOnInitFinish_ = !0, vjs.Component.prototype.readyQueue_, vjs.Component.prototype.ready = function (a) { return a && (this.isReady_ ? a.call(this) : (void 0 === this.readyQueue_ && (this.readyQueue_ = []), this.readyQueue_.push(a))), this }, vjs.Component.prototype.triggerReady = function () { this.isReady_ = !0; var a = this.readyQueue_; if (a && a.length > 0) { for (var b = 0, c = a.length; c > b; b++) a[b].call(this); this.readyQueue_ = [], this.trigger("ready") } }, vjs.Component.prototype.addClass = function (a) { return vjs.addClass(this.el_, a), this }, vjs.Component.prototype.removeClass = function (a) { return vjs.removeClass(this.el_, a), this }, vjs.Component.prototype.show = function () { return this.el_.style.display = "block", this }, vjs.Component.prototype.hide = function () { return this.el_.style.display = "none", this }, vjs.Component.prototype.lockShowing = function () { return this.addClass("vjs-lock-showing"), this }, vjs.Component.prototype.unlockShowing = function () { return this.removeClass("vjs-lock-showing"), this }, vjs.Component.prototype.disable = function () { this.hide(), this.show = function () {} }, vjs.Component.prototype.width = function (a, b) { return this.dimension("width", a, b) }, vjs.Component.prototype.height = function (a, b) { return this.dimension("height", a, b) }, vjs.Component.prototype.dimensions = function (a, b) { return this.width(a, !0).height(b) }, vjs.Component.prototype.dimension = function (a, b, c) { if (void 0 !== b) return -1 !== ("" + b).indexOf("%") || -1 !== ("" + b).indexOf("px") ? this.el_.style[a] = b : "auto" === b ? this.el_.style[a] = "" : this.el_.style[a] = b + "px", c || this.trigger("resize"), this; if (!this.el_) return 0; var d = this.el_.style[a], e = d.indexOf("px"); return -1 !== e ? parseInt(d.slice(0, e), 10) : parseInt(this.el_["offset" + vjs.capitalize(a)], 10) }, vjs.Component.prototype.onResize, vjs.Component.prototype.emitTapEvents = function () { var a, b, c, d; a = 0, this.on("touchstart", function () { a = (new Date).getTime(), c = !0 }), d = function () { c = !1 }, this.on("touchmove", d), this.on("touchleave", d), this.on("touchcancel", d), this.on("touchend", function () { c === !0 && (b = (new Date).getTime() - a, 250 > b && this.trigger("tap")) }) }, vjs.Button = vjs.Component.extend({ init: function (a, b) { vjs.Component.call(this, a, b); var c = !1; this.on("touchstart", function (a) { a.preventDefault(), c = !0 }), this.on("touchmove", function () { c = !1 }); var d = this; this.on("touchend", function (a) { c && d.onClick(a), a.preventDefault() }), this.on("click", this.onClick), this.on("focus", this.onFocus), this.on("blur", this.onBlur) } }), vjs.Button.prototype.createEl = function (a, b) { return b = vjs.obj.merge({ className: this.buildCSSClass(), innerHTML: '
' + (this.buttonText || "Need Text") + "
", role: "button", "aria-live": "polite", tabIndex: 0 }, b), vjs.Component.prototype.createEl.call(this, a, b) }, vjs.Button.prototype.buildCSSClass = function () { return "vjs-control " + vjs.Component.prototype.buildCSSClass.call(this) }, vjs.Button.prototype.onClick = function () {}, vjs.Button.prototype.onFocus = function () { vjs.on(document, "keyup", vjs.bind(this, this.onKeyPress)) }, vjs.Button.prototype.onKeyPress = function (a) { (32 == a.which || 13 == a.which) && (a.preventDefault(), this.onClick()) }, vjs.Button.prototype.onBlur = function () { vjs.off(document, "keyup", vjs.bind(this, this.onKeyPress)) }, vjs.Slider = vjs.Component.extend({ init: function (a, b) { vjs.Component.call(this, a, b), this.bar = this.getChild(this.options_.barName), this.handle = this.getChild(this.options_.handleName), a.on(this.playerEvent, vjs.bind(this, this.update)), this.on("mousedown", this.onMouseDown), this.on("touchstart", this.onMouseDown), this.on("focus", this.onFocus), this.on("blur", this.onBlur), this.on("click", this.onClick), this.player_.on("controlsvisible", vjs.bind(this, this.update)), a.ready(vjs.bind(this, this.update)), this.boundEvents = {} } }), vjs.Slider.prototype.createEl = function (a, b) { return b = b || {}, b.className = b.className + " vjs-slider", b = vjs.obj.merge({ role: "slider", "aria-valuenow": 0, "aria-valuemin": 0, "aria-valuemax": 100, tabIndex: 0 }, b), vjs.Component.prototype.createEl.call(this, a, b) }, vjs.Slider.prototype.onMouseDown = function (a) { a.preventDefault(), vjs.blockTextSelection(), this.boundEvents.move = vjs.bind(this, this.onMouseMove), this.boundEvents.end = vjs.bind(this, this.onMouseUp), vjs.on(document, "mousemove", this.boundEvents.move), vjs.on(document, "mouseup", this.boundEvents.end), vjs.on(document, "touchmove", this.boundEvents.move), vjs.on(document, "touchend", this.boundEvents.end), this.onMouseMove(a) }, vjs.Slider.prototype.onMouseUp = function () { vjs.unblockTextSelection(), vjs.off(document, "mousemove", this.boundEvents.move, !1), vjs.off(document, "mouseup", this.boundEvents.end, !1), vjs.off(document, "touchmove", this.boundEvents.move, !1), vjs.off(document, "touchend", this.boundEvents.end, !1), this.update() }, vjs.Slider.prototype.update = function () { if (this.el_) { var a, b = this.getPercent(), c = this.handle, d = this.bar; if (isNaN(b) && (b = 0), a = b, c) { var e = this.el_, f = e.offsetWidth, g = c.el().offsetWidth, h = g ? g / f : 0, i = 1 - h, j = b * i; a = j + h / 2, c.el().style.left = vjs.round(100 * j, 2) + "%" } d.el().style.width = vjs.round(100 * a, 2) + "%" } }, vjs.Slider.prototype.calculateDistance = function (a) { var b, c, d, e, f, g, h, i, j; if (b = this.el_, c = vjs.findPosition(b), f = g = b.offsetWidth, h = this.handle, this.options_.vertical) { if (e = c.top, j = a.changedTouches ? a.changedTouches[0].pageY : a.pageY, h) { var k = h.el().offsetHeight; e += k / 2, g -= k } return Math.max(0, Math.min(1, (e - j + g) / g)) } if (d = c.left, i = a.changedTouches ? a.changedTouches[0].pageX : a.pageX, h) { var l = h.el().offsetWidth; d += l / 2, f -= l } return Math.max(0, Math.min(1, (i - d) / f)) }, vjs.Slider.prototype.onFocus = function () { vjs.on(document, "keyup", vjs.bind(this, this.onKeyPress)) }, vjs.Slider.prototype.onKeyPress = function (a) { 37 == a.which ? (a.preventDefault(), this.stepBack()) : 39 == a.which && (a.preventDefault(), this.stepForward()) }, vjs.Slider.prototype.onBlur = function () { vjs.off(document, "keyup", vjs.bind(this, this.onKeyPress)) }, vjs.Slider.prototype.onClick = function (a) { a.stopImmediatePropagation(), a.preventDefault() }, vjs.SliderHandle = vjs.Component.extend(), vjs.SliderHandle.prototype.defaultValue = 0, vjs.SliderHandle.prototype.createEl = function (a, b) { return b = b || {}, b.className = b.className + " vjs-slider-handle", b = vjs.obj.merge({ innerHTML: '' + this.defaultValue + "" }, b), vjs.Component.prototype.createEl.call(this, "div", b) }, vjs.Menu = vjs.Component.extend(), vjs.Menu.prototype.addItem = function (a) { this.addChild(a), a.on("click", vjs.bind(this, function () { this.unlockShowing() })) }, vjs.Menu.prototype.createEl = function () { var a = this.options().contentElType || "ul"; this.contentEl_ = vjs.createEl(a, { className: "vjs-menu-content" }); var b = vjs.Component.prototype.createEl.call(this, "div", { append: this.contentEl_, className: "vjs-menu" }); return b.appendChild(this.contentEl_), vjs.on(b, "click", function (a) { a.preventDefault(), a.stopImmediatePropagation() }), b }, vjs.MenuItem = vjs.Button.extend({ init: function (a, b) { vjs.Button.call(this, a, b), this.selected(b.selected) } }), vjs.MenuItem.prototype.createEl = function (a, b) { return vjs.Button.prototype.createEl.call(this, "li", vjs.obj.merge({ className: "vjs-menu-item", innerHTML: this.options_.label }, b)) }, vjs.MenuItem.prototype.onClick = function () { this.selected(!0) }, vjs.MenuItem.prototype.selected = function (a) { a ? (this.addClass("vjs-selected"), this.el_.setAttribute("aria-selected", !0)) : (this.removeClass("vjs-selected"), this.el_.setAttribute("aria-selected", !1)) }, vjs.MenuButton = vjs.Button.extend({ init: function (a, b) { vjs.Button.call(this, a, b), this.menu = this.createMenu(), this.addChild(this.menu), this.items && 0 === this.items.length && this.hide(), this.on("keyup", this.onKeyPress), this.el_.setAttribute("aria-haspopup", !0), this.el_.setAttribute("role", "button") } }), vjs.MenuButton.prototype.buttonPressed_ = !1, vjs.MenuButton.prototype.createMenu = function () { var a = new vjs.Menu(this.player_); if (this.options().title && a.el().appendChild(vjs.createEl("li", { className: "vjs-menu-title", innerHTML: vjs.capitalize(this.kind_), tabindex: -1 })), this.items = this.createItems(), this.items) for (var b = 0; b < this.items.length; b++) a.addItem(this.items[b]); return a }, vjs.MenuButton.prototype.createItems = function () {}, vjs.MenuButton.prototype.buildCSSClass = function () { return this.className + " vjs-menu-button " + vjs.Button.prototype.buildCSSClass.call(this) }, vjs.MenuButton.prototype.onFocus = function () {}, vjs.MenuButton.prototype.onBlur = function () {}, vjs.MenuButton.prototype.onClick = function () { this.one("mouseout", vjs.bind(this, function () { this.menu.unlockShowing(), this.el_.blur() })), this.buttonPressed_ ? this.unpressButton() : this.pressButton() }, vjs.MenuButton.prototype.onKeyPress = function (a) { a.preventDefault(), 32 == a.which || 13 == a.which ? this.buttonPressed_ ? this.unpressButton() : this.pressButton() : 27 == a.which && this.buttonPressed_ && this.unpressButton() }, vjs.MenuButton.prototype.pressButton = function () { this.buttonPressed_ = !0, this.menu.lockShowing(), this.el_.setAttribute("aria-pressed", !0), this.items && this.items.length > 0 && this.items[0].el().focus() }, vjs.MenuButton.prototype.unpressButton = function () { this.buttonPressed_ = !1, this.menu.unlockShowing(), this.el_.setAttribute("aria-pressed", !1) }, vjs.Player = vjs.Component.extend({ init: function (a, b, c) { this.tag = a, b = vjs.obj.merge(this.getTagSettings(a), b), this.cache_ = {}, this.poster_ = b.poster, this.controls_ = b.controls, a.controls = !1, vjs.Component.call(this, this, b, c), this.controls() ? this.addClass("vjs-controls-enabled") : this.addClass("vjs-controls-disabled"), this.one("play", function (a) { var b = { type: "firstplay", target: this.el_ }, c = vjs.trigger(this.el_, b); c || (a.preventDefault(), a.stopPropagation(), a.stopImmediatePropagation()) }), this.on("ended", this.onEnded), this.on("play", this.onPlay), this.on("firstplay", this.onFirstPlay), this.on("pause", this.onPause), this.on("progress", this.onProgress), this.on("durationchange", this.onDurationChange), this.on("error", this.onError), this.on("fullscreenchange", this.onFullscreenChange), vjs.players[this.id_] = this, b.plugins && vjs.obj.each(b.plugins, function (a, b) { this[a](b) }, this), this.listenForUserActivity() } }), vjs.Player.prototype.options_ = vjs.options, vjs.Player.prototype.dispose = function () { this.trigger("dispose"), this.off("dispose"), vjs.players[this.id_] = null, this.tag && this.tag.player && (this.tag.player = null), this.el_ && this.el_.player && (this.el_.player = null), this.stopTrackingProgress(), this.stopTrackingCurrentTime(), this.tech && this.tech.dispose(), vjs.Component.prototype.dispose.call(this) }, vjs.Player.prototype.getTagSettings = function (a) { var b = { sources: [], tracks: [] }; if (vjs.obj.merge(b, vjs.getAttributeValues(a)), a.hasChildNodes()) { var c, d, e, f, g; for (c = a.childNodes, f = 0, g = c.length; g > f; f++) d = c[f], e = d.nodeName.toLowerCase(), "source" === e ? b.sources.push(vjs.getAttributeValues(d)) : "track" === e && b.tracks.push(vjs.getAttributeValues(d)) } return b }, vjs.Player.prototype.createEl = function () { var a = this.el_ = vjs.Component.prototype.createEl.call(this, "div"), b = this.tag; if (b.removeAttribute("width"), b.removeAttribute("height"), b.hasChildNodes()) { var c, d, e, f, g, h; for (c = b.childNodes, d = c.length, h = []; d--; ) f = c[d], g = f.nodeName.toLowerCase(), "track" === g && h.push(f); for (e = 0; e < h.length; e++) b.removeChild(h[e]) } return b.id = b.id || "vjs_video_" + vjs.guid++, a.id = b.id, a.className = b.className, b.id += "_html5_api", b.className = "vjs-tech", b.player = a.player = this, this.addClass("vjs-paused"), this.width(this.options_.width, !0), this.height(this.options_.height, !0), b.parentNode && b.parentNode.insertBefore(a, b), vjs.insertFirst(b, a), a }, vjs.Player.prototype.loadTech = function (a, b) { this.tech ? this.unloadTech() : "Html5" !== a && this.tag && (vjs.Html5.disposeMediaElement(this.tag), this.tag = null), this.techName = a, this.isReady_ = !1; var c = function () { this.player_.triggerReady(), this.features.progressEvents || this.player_.manualProgressOn(), this.features.timeupdateEvents || this.player_.manualTimeUpdatesOn() }, d = vjs.obj.merge({ source: b, parentEl: this.el_ }, this.options_[a.toLowerCase()]); b && (b.src == this.cache_.src && this.cache_.currentTime > 0 && (d.startTime = this.cache_.currentTime), this.cache_.src = b.src), this.tech = new window.videojs[a](this, d), this.tech.ready(c) }, vjs.Player.prototype.unloadTech = function () { this.isReady_ = !1, this.tech.dispose(), this.manualProgress && this.manualProgressOff(), this.manualTimeUpdates && this.manualTimeUpdatesOff(), this.tech = !1 }, vjs.Player.prototype.manualProgressOn = function () { this.manualProgress = !0, this.trackProgress(), this.tech.one("progress", function () { this.features.progressEvents = !0, this.player_.manualProgressOff() }) }, vjs.Player.prototype.manualProgressOff = function () { this.manualProgress = !1, this.stopTrackingProgress() }, vjs.Player.prototype.trackProgress = function () { this.progressInterval = setInterval(vjs.bind(this, function () { this.cache_.bufferEnd < this.buffered().end(0) ? this.trigger("progress") : 1 == this.bufferedPercent() && (this.stopTrackingProgress(), this.trigger("progress")) }), 500) }, vjs.Player.prototype.stopTrackingProgress = function () { clearInterval(this.progressInterval) }, vjs.Player.prototype.manualTimeUpdatesOn = function () { this.manualTimeUpdates = !0, this.on("play", this.trackCurrentTime), this.on("pause", this.stopTrackingCurrentTime), this.tech.one("timeupdate", function () { this.features.timeupdateEvents = !0, this.player_.manualTimeUpdatesOff() }) }, vjs.Player.prototype.manualTimeUpdatesOff = function () { this.manualTimeUpdates = !1, this.stopTrackingCurrentTime(), this.off("play", this.trackCurrentTime), this.off("pause", this.stopTrackingCurrentTime) }, vjs.Player.prototype.trackCurrentTime = function () { this.currentTimeInterval && this.stopTrackingCurrentTime(), this.currentTimeInterval = setInterval(vjs.bind(this, function () { this.trigger("timeupdate") }), 250) }, vjs.Player.prototype.stopTrackingCurrentTime = function () { clearInterval(this.currentTimeInterval) }, vjs.Player.prototype.onLoadStart, vjs.Player.prototype.onLoadedMetaData, vjs.Player.prototype.onLoadedData, vjs.Player.prototype.onLoadedAllData, vjs.Player.prototype.onPlay = function () { vjs.removeClass(this.el_, "vjs-paused"), vjs.addClass(this.el_, "vjs-playing") }, vjs.Player.prototype.onFirstPlay = function () { this.options_.starttime && this.currentTime(this.options_.starttime), this.addClass("vjs-has-started") }, vjs.Player.prototype.onPause = function () { vjs.addClass(this.el_, "vjs-paused") }, vjs.Player.prototype.onTimeUpdate, vjs.Player.prototype.onProgress = function () { 1 == this.bufferedPercent() && this.trigger("loadedalldata") }, vjs.Player.prototype.onEnded = function () { this.options_.loop && (this.currentTime(0), this.play()) }, vjs.Player.prototype.onDurationChange = function () { this.duration(this.techGet("duration")) }, vjs.Player.prototype.onVolumeChange, vjs.Player.prototype.onFullscreenChange = function () { this.isFullScreen ? this.addClass("vjs-fullscreen") : this.removeClass("vjs-fullscreen") }, vjs.Player.prototype.onError = function (a) { vjs.log("Video Error", a) }, vjs.Player.prototype.cache_, vjs.Player.prototype.getCache = function () { return this.cache_ }, vjs.Player.prototype.techCall = function (a, b) { if (this.tech && !this.tech.isReady_) this.tech.ready(function () { this[a](b) }); else try { this.tech[a](b) } catch (a) { throw vjs.log(a), a } }, vjs.Player.prototype.techGet = function (a) { if (this.tech && this.tech.isReady_) try { return this.tech[a]() } catch (b) { throw void 0 === this.tech[a] ? vjs.log("Video.js: " + a + " method not defined for " + this.techName + " playback technology.", b) : "TypeError" == b.name ? (vjs.log("Video.js: " + a + " unavailable on " + this.techName + " playback technology element.", b), this.tech.isReady_ = !1) : vjs.log(b), b } }, vjs.Player.prototype.play = function () { return this.techCall("play"), this }, vjs.Player.prototype.pause = function () { return this.techCall("pause"), this }, vjs.Player.prototype.paused = function () { return this.techGet("paused") !== !1 }, vjs.Player.prototype.currentTime = function (a) { return void 0 !== a ? (this.cache_.lastSetCurrentTime = a, this.techCall("setCurrentTime", a), this.manualTimeUpdates && this.trigger("timeupdate"), this) : this.cache_.currentTime = this.techGet("currentTime") || 0 }, vjs.Player.prototype.duration = function (a) { return void 0 !== a ? (this.cache_.duration = parseFloat(a), this) : (void 0 === this.cache_.duration && this.onDurationChange(), this.cache_.duration) }, vjs.Player.prototype.remainingTime = function () { return this.duration() - this.currentTime() }, vjs.Player.prototype.buffered = function () { var a = this.techGet("buffered"), b = 0, c = a.length - 1, d = this.cache_.bufferEnd = this.cache_.bufferEnd || 0; return a && c >= 0 && a.end(c) !== d && (d = a.end(c), this.cache_.bufferEnd = d), vjs.createTimeRange(b, d) }, vjs.Player.prototype.bufferedPercent = function () { return this.duration() ? this.buffered().end(0) / this.duration() : 0 }, vjs.Player.prototype.volume = function (a) { var b; return void 0 !== a ? (b = Math.max(0, Math.min(1, parseFloat(a))), this.cache_.volume = b, this.techCall("setVolume", b), vjs.setLocalStorage("volume", b), this) : (b = parseFloat(this.techGet("volume")), isNaN(b) ? 1 : b) }, vjs.Player.prototype.muted = function (a) { return void 0 !== a ? (this.techCall("setMuted", a), this) : this.techGet("muted") || !1 }, vjs.Player.prototype.supportsFullScreen = function () { return this.techGet("supportsFullScreen") || !1 }, vjs.Player.prototype.requestFullScreen = function () { var a = vjs.support.requestFullScreen; return this.isFullScreen = !0, a ? (vjs.on(document, a.eventName, vjs.bind(this, function () { this.isFullScreen = document[a.isFullScreen], this.isFullScreen === !1 && vjs.off(document, a.eventName, arguments.callee), this.trigger("fullscreenchange") })), this.el_[a.requestFn]()) : this.tech.supportsFullScreen() ? this.techCall("enterFullScreen") : (this.enterFullWindow(), this.trigger("fullscreenchange")), this }, vjs.Player.prototype.cancelFullScreen = function () { var a = vjs.support.requestFullScreen; return this.isFullScreen = !1, a ? document[a.cancelFn]() : this.tech.supportsFullScreen() ? this.techCall("exitFullScreen") : (this.exitFullWindow(), this.trigger("fullscreenchange")), this }, vjs.Player.prototype.enterFullWindow = function () { this.isFullWindow = !0, this.docOrigOverflow = document.documentElement.style.overflow, vjs.on(document, "keydown", vjs.bind(this, this.fullWindowOnEscKey)), document.documentElement.style.overflow = "hidden", vjs.addClass(document.body, "vjs-full-window"), this.trigger("enterFullWindow") }, vjs.Player.prototype.fullWindowOnEscKey = function (a) { 27 === a.keyCode && (this.isFullScreen === !0 ? this.cancelFullScreen() : this.exitFullWindow()) }, vjs.Player.prototype.exitFullWindow = function () { this.isFullWindow = !1, vjs.off(document, "keydown", this.fullWindowOnEscKey), document.documentElement.style.overflow = this.docOrigOverflow, vjs.removeClass(document.body, "vjs-full-window"), this.trigger("exitFullWindow") }, vjs.Player.prototype.selectSource = function (a) { for (var b = 0, c = this.options_.techOrder; b < c.length; b++) { var d = vjs.capitalize(c[b]), e = window.videojs[d]; if (e.isSupported()) for (var f = 0, g = a; f < g.length; f++) { var h = g[f]; if (e.canPlaySource(h)) return { source: h, tech: d } } } return !1 }, vjs.Player.prototype.src = function (a) { if (a instanceof Array) { var b, c = this.selectSource(a); c ? (a = c.source, b = c.tech, b == this.techName ? this.src(a) : this.loadTech(b, a)) : this.el_.appendChild(vjs.createEl("p", { innerHTML: this.options().notSupportedMessage })) } else a instanceof Object ? window.videojs[this.techName].canPlaySource(a) ? this.src(a.src) : this.src([a]) : (this.cache_.src = a, this.isReady_ ? (this.techCall("src", a), "auto" == this.options_.preload && this.load(), this.options_.autoplay && this.play()) : this.ready(function () { this.src(a) })); return this }, vjs.Player.prototype.load = function () { return this.techCall("load"), this }, vjs.Player.prototype.currentSrc = function () { return this.techGet("currentSrc") || this.cache_.src || "" }, vjs.Player.prototype.preload = function (a) { return void 0 !== a ? (this.techCall("setPreload", a), this.options_.preload = a, this) : this.techGet("preload") }, vjs.Player.prototype.autoplay = function (a) { return void 0 !== a ? (this.techCall("setAutoplay", a), this.options_.autoplay = a, this) : this.techGet("autoplay", a) }, vjs.Player.prototype.loop = function (a) { return void 0 !== a ? (this.techCall("setLoop", a), this.options_.loop = a, this) : this.techGet("loop") }, vjs.Player.prototype.poster_, vjs.Player.prototype.poster = function (a) { return void 0 !== a ? (this.poster_ = a, this) : this.poster_ }, vjs.Player.prototype.controls_, vjs.Player.prototype.controls = function (a) { return void 0 !== a ? (a = !!a, this.controls_ !== a && (this.controls_ = a, a ? (this.removeClass("vjs-controls-disabled"), this.addClass("vjs-controls-enabled"), this.trigger("controlsenabled")) : (this.removeClass("vjs-controls-enabled"), this.addClass("vjs-controls-disabled"), this.trigger("controlsdisabled"))), this) : this.controls_ }, vjs.Player.prototype.usingNativeControls_, vjs.Player.prototype.usingNativeControls = function (a) { return void 0 !== a ? (a = !!a, this.usingNativeControls_ !== a && (this.usingNativeControls_ = a, a ? (this.addClass("vjs-using-native-controls"), this.trigger("usingnativecontrols")) : (this.removeClass("vjs-using-native-controls"), this.trigger("usingcustomcontrols"))), this) : this.usingNativeControls_ }, vjs.Player.prototype.error = function () { return this.techGet("error") }, vjs.Player.prototype.ended = function () { return this.techGet("ended") }, vjs.Player.prototype.seeking = function () { return this.techGet("seeking") }, vjs.Player.prototype.userActivity_ = !0, vjs.Player.prototype.reportUserActivity = function () { this.userActivity_ = !0 }, vjs.Player.prototype.userActive_ = !0, vjs.Player.prototype.userActive = function (a) { return void 0 !== a ? (a = !!a, a !== this.userActive_ && (this.userActive_ = a, a ? (this.userActivity_ = !0, this.removeClass("vjs-user-inactive"), this.addClass("vjs-user-active"), this.trigger("useractive")) : (this.userActivity_ = !1, this.tech.one("mousemove", function (a) { a.stopPropagation(), a.preventDefault() }), this.removeClass("vjs-user-active"), this.addClass("vjs-user-inactive"), this.trigger("userinactive"))), this) : this.userActive_ }, vjs.Player.prototype.listenForUserActivity = function () { var a, b, c, d, e, f; a = this.reportUserActivity, b = function () { a(), clearInterval(c), c = setInterval(vjs.bind(this, a), 250) }, d = function () { a(), clearInterval(c) }, this.on("mousedown", b), this.on("mousemove", a), this.on("mouseup", d), this.on("keydown", a), this.on("keyup", a), this.on("touchstart", b), this.on("touchmove", a), this.on("touchend", d), this.on("touchcancel", d), e = setInterval(vjs.bind(this, function () { this.userActivity_ && (this.userActivity_ = !1, this.userActive(!0), clearTimeout(f), f = setTimeout(vjs.bind(this, function () { this.userActivity_ || this.userActive(!1) }), 2e3)) }), 250), this.on("dispose", function () { clearInterval(e), clearTimeout(f) }) }, function () { var a, b, c; c = document.createElement("div"), b = {}, void 0 !== c.cancelFullscreen ? (b.requestFn = "requestFullscreen", b.cancelFn = "exitFullscreen", b.eventName = "fullscreenchange", b.isFullScreen = "fullScreen") : (document.mozCancelFullScreen ? (a = "moz", b.isFullScreen = a + "FullScreen") : document.msExitFullscreen ? (b.cancelFn = "msExitFullscreen", b.isFullScreen = "msFullscreenElement", b.requestFn = "msRequestFullscreen", b.eventName = "MSFullscreenChange") : (a = "webkit", b.isFullScreen = a + "IsFullScreen"), c[a + "RequestFullScreen"] && (b.requestFn = a + "RequestFullScreen", b.cancelFn = a + "CancelFullScreen"), b.eventName = a + "fullscreenchange"), document[b.cancelFn] && (vjs.support.requestFullScreen = b) } (), vjs.ControlBar = vjs.Component.extend(), vjs.ControlBar.prototype.options_ = { loadEvent: "play", children: { playToggle: {}, currentTimeDisplay: {}, timeDivider: {}, durationDisplay: {}, remainingTimeDisplay: {}, progressControl: {}, fullscreenToggle: {}, volumeControl: {}, muteToggle: {} } }, vjs.ControlBar.prototype.createEl = function () { return vjs.createEl("div", { className: "vjs-control-bar" }) }, vjs.PlayToggle = vjs.Button.extend({ init: function (a, b) { vjs.Button.call(this, a, b), a.on("play", vjs.bind(this, this.onPlay)), a.on("pause", vjs.bind(this, this.onPause)) } }), vjs.PlayToggle.prototype.buttonText = "Play", vjs.PlayToggle.prototype.buildCSSClass = function () { return "vjs-play-control " + vjs.Button.prototype.buildCSSClass.call(this) }, vjs.PlayToggle.prototype.onClick = function () { this.player_.paused() ? this.player_.play() : this.player_.pause() }, vjs.PlayToggle.prototype.onPlay = function () { vjs.removeClass(this.el_, "vjs-paused"), vjs.addClass(this.el_, "vjs-playing"), this.el_.children[0].children[0].innerHTML = "Pause" }, vjs.PlayToggle.prototype.onPause = function () { vjs.removeClass(this.el_, "vjs-playing"), vjs.addClass(this.el_, "vjs-paused"), this.el_.children[0].children[0].innerHTML = "Play" }, vjs.CurrentTimeDisplay = vjs.Component.extend({ init: function (a, b) { vjs.Component.call(this, a, b), a.on("timeupdate", vjs.bind(this, this.updateContent)) } }), vjs.CurrentTimeDisplay.prototype.createEl = function () { var a = vjs.Component.prototype.createEl.call(this, "div", { className: "vjs-current-time vjs-time-controls vjs-control" }); return this.content = vjs.createEl("div", { className: "vjs-current-time-display", innerHTML: 'Current Time 0:00', "aria-live": "off" }), a.appendChild(vjs.createEl("div").appendChild(this.content)), a }, vjs.CurrentTimeDisplay.prototype.updateContent = function () { var a = this.player_.scrubbing ? this.player_.getCache().currentTime : this.player_.currentTime(); this.content.innerHTML = 'Current Time ' + vjs.formatTime(a, this.player_.duration()) }, vjs.DurationDisplay = vjs.Component.extend({ init: function (a, b) { vjs.Component.call(this, a, b), a.on("timeupdate", vjs.bind(this, this.updateContent)) } }), vjs.DurationDisplay.prototype.createEl = function () { var a = vjs.Component.prototype.createEl.call(this, "div", { className: "vjs-duration vjs-time-controls vjs-control" }); return this.content = vjs.createEl("div", { className: "vjs-duration-display", innerHTML: 'Duration Time 0:00', "aria-live": "off" }), a.appendChild(vjs.createEl("div").appendChild(this.content)), a }, vjs.DurationDisplay.prototype.updateContent = function () { var a = this.player_.duration(); a && (this.content.innerHTML = 'Duration Time ' + vjs.formatTime(a)) }, vjs.TimeDivider = vjs.Component.extend({ init: function (a, b) { vjs.Component.call(this, a, b) } }), vjs.TimeDivider.prototype.createEl = function () { return vjs.Component.prototype.createEl.call(this, "div", { className: "vjs-time-divider", innerHTML: "
/
" }) }, vjs.RemainingTimeDisplay = vjs.Component.extend({ init: function (a, b) { vjs.Component.call(this, a, b), a.on("timeupdate", vjs.bind(this, this.updateContent)) } }), vjs.RemainingTimeDisplay.prototype.createEl = function () { var a = vjs.Component.prototype.createEl.call(this, "div", { className: "vjs-remaining-time vjs-time-controls vjs-control" }); return this.content = vjs.createEl("div", { className: "vjs-remaining-time-display", innerHTML: 'Remaining Time -0:00', "aria-live": "off" }), a.appendChild(vjs.createEl("div").appendChild(this.content)), a }, vjs.RemainingTimeDisplay.prototype.updateContent = function () { this.player_.duration() && (this.content.innerHTML = 'Remaining Time -' + vjs.formatTime(this.player_.remainingTime())) }, vjs.FullscreenToggle = vjs.Button.extend({ init: function (a, b) { vjs.Button.call(this, a, b) } }), vjs.FullscreenToggle.prototype.buttonText = "Fullscreen", vjs.FullscreenToggle.prototype.buildCSSClass = function () { return "vjs-fullscreen-control " + vjs.Button.prototype.buildCSSClass.call(this) }, vjs.FullscreenToggle.prototype.onClick = function () { this.player_.isFullScreen ? (this.player_.cancelFullScreen(), this.el_.children[0].children[0].innerHTML = "Fullscreen") : (this.player_.requestFullScreen(), this.el_.children[0].children[0].innerHTML = "Non-Fullscreen") }, vjs.ProgressControl = vjs.Component.extend({ init: function (a, b) { vjs.Component.call(this, a, b) } }), vjs.ProgressControl.prototype.options_ = { children: { seekBar: {} } }, vjs.ProgressControl.prototype.createEl = function () { return vjs.Component.prototype.createEl.call(this, "div", { className: "vjs-progress-control vjs-control" }) }, vjs.SeekBar = vjs.Slider.extend({ init: function (a, b) { vjs.Slider.call(this, a, b), a.on("timeupdate", vjs.bind(this, this.updateARIAAttributes)), a.ready(vjs.bind(this, this.updateARIAAttributes)) } }), vjs.SeekBar.prototype.options_ = { children: { loadProgressBar: {}, playProgressBar: {}, seekHandle: {} }, barName: "playProgressBar", handleName: "seekHandle" }, vjs.SeekBar.prototype.playerEvent = "timeupdate", vjs.SeekBar.prototype.createEl = function () { return vjs.Slider.prototype.createEl.call(this, "div", { className: "vjs-progress-holder", "aria-label": "video progress bar" }) }, vjs.SeekBar.prototype.updateARIAAttributes = function () { var a = this.player_.scrubbing ? this.player_.getCache().currentTime : this.player_.currentTime(); this.el_.setAttribute("aria-valuenow", vjs.round(100 * this.getPercent(), 2)), this.el_.setAttribute("aria-valuetext", vjs.formatTime(a, this.player_.duration())) }, vjs.SeekBar.prototype.getPercent = function () { var a; if ("Flash" === this.player_.techName && this.player_.seeking()) { var b = this.player_.getCache(); a = b.lastSetCurrentTime ? b.lastSetCurrentTime : this.player_.currentTime() } else a = this.player_.currentTime(); return a / this.player_.duration() }, vjs.SeekBar.prototype.onMouseDown = function (a) { vjs.Slider.prototype.onMouseDown.call(this, a), this.player_.scrubbing = !0, this.videoWasPlaying = !this.player_.paused(), this.player_.pause() }, vjs.SeekBar.prototype.onMouseMove = function (a) { var b = this.calculateDistance(a) * this.player_.duration(); b == this.player_.duration() && (b -= .1), this.player_.currentTime(b) }, vjs.SeekBar.prototype.onMouseUp = function (a) { vjs.Slider.prototype.onMouseUp.call(this, a), this.player_.scrubbing = !1, this.videoWasPlaying && this.player_.play() }, vjs.SeekBar.prototype.stepForward = function () { this.player_.currentTime(this.player_.currentTime() + 5) }, vjs.SeekBar.prototype.stepBack = function () { this.player_.currentTime(this.player_.currentTime() - 5) }, vjs.LoadProgressBar = vjs.Component.extend({ init: function (a, b) { vjs.Component.call(this, a, b), a.on("progress", vjs.bind(this, this.update)) } }), vjs.LoadProgressBar.prototype.createEl = function () { return vjs.Component.prototype.createEl.call(this, "div", { className: "vjs-load-progress", innerHTML: 'Loaded: 0%' }) }, vjs.LoadProgressBar.prototype.update = function () { this.el_.style && (this.el_.style.width = vjs.round(100 * this.player_.bufferedPercent(), 2) + "%") }, vjs.PlayProgressBar = vjs.Component.extend({ init: function (a, b) { vjs.Component.call(this, a, b) } }), vjs.PlayProgressBar.prototype.createEl = function () { return vjs.Component.prototype.createEl.call(this, "div", { className: "vjs-play-progress", innerHTML: 'Progress: 0%' }) }, vjs.SeekHandle = vjs.SliderHandle.extend(), vjs.SeekHandle.prototype.defaultValue = "00:00", vjs.SeekHandle.prototype.createEl = function () { return vjs.SliderHandle.prototype.createEl.call(this, "div", { className: "vjs-seek-handle" }) }, vjs.VolumeControl = vjs.Component.extend({ init: function (a, b) { vjs.Component.call(this, a, b), a.tech && a.tech.features && a.tech.features.volumeControl === !1 && this.addClass("vjs-hidden"), a.on("loadstart", vjs.bind(this, function () { a.tech.features && a.tech.features.volumeControl === !1 ? this.addClass("vjs-hidden") : this.removeClass("vjs-hidden") })) } }), vjs.VolumeControl.prototype.options_ = { children: { volumeBar: {} } }, vjs.VolumeControl.prototype.createEl = function () { return vjs.Component.prototype.createEl.call(this, "div", { className: "vjs-volume-control vjs-control" }) }, vjs.VolumeBar = vjs.Slider.extend({ init: function (a, b) { vjs.Slider.call(this, a, b), a.on("volumechange", vjs.bind(this, this.updateARIAAttributes)), a.ready(vjs.bind(this, this.updateARIAAttributes)), setTimeout(vjs.bind(this, this.update), 0) } }), vjs.VolumeBar.prototype.updateARIAAttributes = function () { this.el_.setAttribute("aria-valuenow", vjs.round(100 * this.player_.volume(), 2)), this.el_.setAttribute("aria-valuetext", vjs.round(100 * this.player_.volume(), 2) + "%") }, vjs.VolumeBar.prototype.options_ = { children: { volumeLevel: {}, volumeHandle: {} }, barName: "volumeLevel", handleName: "volumeHandle" }, vjs.VolumeBar.prototype.playerEvent = "volumechange", vjs.VolumeBar.prototype.createEl = function () { return vjs.Slider.prototype.createEl.call(this, "div", { className: "vjs-volume-bar", "aria-label": "volume level" }) }, vjs.VolumeBar.prototype.onMouseMove = function (a) { this.player_.muted() && this.player_.muted(!1), this.player_.volume(this.calculateDistance(a)) }, vjs.VolumeBar.prototype.getPercent = function () { return this.player_.muted() ? 0 : this.player_.volume() }, vjs.VolumeBar.prototype.stepForward = function () { this.player_.volume(this.player_.volume() + .1) }, vjs.VolumeBar.prototype.stepBack = function () { this.player_.volume(this.player_.volume() - .1) }, vjs.VolumeLevel = vjs.Component.extend({ init: function (a, b) { vjs.Component.call(this, a, b) } }), vjs.VolumeLevel.prototype.createEl = function () { return vjs.Component.prototype.createEl.call(this, "div", { className: "vjs-volume-level", innerHTML: '' }) }, vjs.VolumeHandle = vjs.SliderHandle.extend(), vjs.VolumeHandle.prototype.defaultValue = "00:00", vjs.VolumeHandle.prototype.createEl = function () { return vjs.SliderHandle.prototype.createEl.call(this, "div", { className: "vjs-volume-handle" }) }, vjs.MuteToggle = vjs.Button.extend({ init: function (a, b) { vjs.Button.call(this, a, b), a.on("volumechange", vjs.bind(this, this.update)), a.tech && a.tech.features && a.tech.features.volumeControl === !1 && this.addClass("vjs-hidden"), a.on("loadstart", vjs.bind(this, function () { a.tech.features && a.tech.features.volumeControl === !1 ? this.addClass("vjs-hidden") : this.removeClass("vjs-hidden") })) } }), vjs.MuteToggle.prototype.createEl = function () { return vjs.Button.prototype.createEl.call(this, "div", { className: "vjs-mute-control vjs-control", innerHTML: '
Mute
' }) }, vjs.MuteToggle.prototype.onClick = function () { this.player_.muted(!this.player_.muted()) }, vjs.MuteToggle.prototype.update = function () { var a = this.player_.volume(), b = 3; 0 === a || this.player_.muted() ? b = 0 : .33 > a ? b = 1 : .67 > a && (b = 2), this.player_.muted() ? "Unmute" != this.el_.children[0].children[0].innerHTML && (this.el_.children[0].children[0].innerHTML = "Unmute") : "Mute" != this.el_.children[0].children[0].innerHTML && (this.el_.children[0].children[0].innerHTML = "Mute"); for (var c = 0; 4 > c; c++) vjs.removeClass(this.el_, "vjs-vol-" + c); vjs.addClass(this.el_, "vjs-vol-" + b) }, vjs.VolumeMenuButton = vjs.MenuButton.extend({ init: function (a, b) { vjs.MenuButton.call(this, a, b), a.on("volumechange", vjs.bind(this, this.update)), a.tech && a.tech.features && a.tech.features.volumeControl === !1 && this.addClass("vjs-hidden"), a.on("loadstart", vjs.bind(this, function () { a.tech.features && a.tech.features.volumeControl === !1 ? this.addClass("vjs-hidden") : this.removeClass("vjs-hidden") })), this.addClass("vjs-menu-button") } }), vjs.VolumeMenuButton.prototype.createMenu = function () { var a = new vjs.Menu(this.player_, { contentElType: "div" }), b = new vjs.VolumeBar(this.player_, vjs.obj.merge({ vertical: !0 }, this.options_.volumeBar)); return a.addChild(b), a }, vjs.VolumeMenuButton.prototype.onClick = function () { vjs.MuteToggle.prototype.onClick.call(this), vjs.MenuButton.prototype.onClick.call(this) }, vjs.VolumeMenuButton.prototype.createEl = function () { return vjs.Button.prototype.createEl.call(this, "div", { className: "vjs-volume-menu-button vjs-menu-button vjs-control", innerHTML: '
Mute
' }) }, vjs.VolumeMenuButton.prototype.update = vjs.MuteToggle.prototype.update, vjs.PosterImage = vjs.Button.extend({ init: function (a, b) { vjs.Button.call(this, a, b), a.poster() && a.controls() || this.hide(), a.on("play", vjs.bind(this, this.hide)) } }), vjs.PosterImage.prototype.createEl = function () { var a = vjs.createEl("div", { className: "vjs-poster", tabIndex: -1 }), b = this.player_.poster(); return b && ("backgroundSize" in a.style ? a.style.backgroundImage = 'url("' + b + '")' : a.appendChild(vjs.createEl("img", { src: b }))), a }, vjs.PosterImage.prototype.onClick = function () { this.player().controls() && this.player_.play() }, vjs.LoadingSpinner = vjs.Component.extend({ init: function (a, b) { vjs.Component.call(this, a, b), a.on("canplay", vjs.bind(this, this.hide)), a.on("canplaythrough", vjs.bind(this, this.hide)), a.on("playing", vjs.bind(this, this.hide)), a.on("seeked", vjs.bind(this, this.hide)), a.on("seeking", vjs.bind(this, this.show)), a.on("seeked", vjs.bind(this, this.hide)), a.on("error", vjs.bind(this, this.show)), a.on("waiting", vjs.bind(this, this.show)) } }), vjs.LoadingSpinner.prototype.createEl = function () { return vjs.Component.prototype.createEl.call(this, "div", { className: "vjs-loading-spinner" }) }, vjs.BigPlayButton = vjs.Button.extend(), vjs.BigPlayButton.prototype.createEl = function () { return vjs.Button.prototype.createEl.call(this, "div", { className: "vjs-big-play-button", innerHTML: '', "aria-label": "play video" }) }, vjs.BigPlayButton.prototype.onClick = function () { this.player_.play() }, vjs.MediaTechController = vjs.Component.extend({ init: function (a, b, c) { vjs.Component.call(this, a, b, c), this.initControlsListeners() } }), vjs.MediaTechController.prototype.initControlsListeners = function () { var a, b, c, d; b = this, a = this.player(); var c = function () { a.controls() && !a.usingNativeControls() && b.addControlsListeners() }; d = vjs.bind(b, b.removeControlsListeners), this.ready(c), a.on("controlsenabled", c), a.on("controlsdisabled", d) }, vjs.MediaTechController.prototype.addControlsListeners = function () { var a, b; this.on("mousedown", this.onClick), this.on("touchstart", function (a) { a.preventDefault(), a.stopPropagation(), b = this.player_.userActive() }), a = function (a) { a.stopPropagation(), b && this.player_.reportUserActivity() }, this.on("touchmove", a), this.on("touchleave", a), this.on("touchcancel", a), this.on("touchend", a), this.emitTapEvents(), this.on("tap", this.onTap) }, vjs.MediaTechController.prototype.removeControlsListeners = function () { this.off("tap"), this.off("touchstart"), this.off("touchmove"), this.off("touchleave"), this.off("touchcancel"), this.off("touchend"), this.off("click"), this.off("mousedown") }, vjs.MediaTechController.prototype.onClick = function (a) { 0 === a.button && this.player().controls() && (this.player().paused() ? this.player().play() : this.player().pause()) }, vjs.MediaTechController.prototype.onTap = function () { this.player().userActive(!this.player().userActive()) }, vjs.MediaTechController.prototype.features = { volumeControl: !0, fullscreenResize: !1, progressEvents: !1, timeupdateEvents: !1 }, vjs.media = {}, vjs.media.ApiMethods = "play,pause,paused,currentTime,setCurrentTime,duration,buffered,volume,setVolume,muted,setMuted,width,height,supportsFullScreen,enterFullScreen,src,load,currentSrc,preload,setPreload,autoplay,setAutoplay,loop,setLoop,error,networkState,readyState,seeking,initialTime,startOffsetTime,played,seekable,ended,videoTracks,audioTracks,videoWidth,videoHeight,textTracks,defaultPlaybackRate,playbackRate,mediaGroup,controller,controls,defaultMuted".split(","); for (var i = vjs.media.ApiMethods.length - 1; i >= 0; i--) { var methodName = vjs.media.ApiMethods[i]; vjs.MediaTechController.prototype[vjs.media.ApiMethods[i]] = createMethod(methodName) } vjs.Html5 = vjs.MediaTechController.extend({ init: function (a, b, c) { this.features.volumeControl = vjs.Html5.canControlVolume(), this.features.movingMediaElementInDOM = !vjs.IS_IOS, this.features.fullscreenResize = !0, vjs.MediaTechController.call(this, a, b, c); var d = b.source; d && this.el_.currentSrc === d.src && this.el_.networkState > 0 ? a.trigger("loadstart") : d && (this.el_.src = d.src), vjs.TOUCH_ENABLED && a.options().nativeControlsForTouch !== !1 && this.useNativeControls(), a.ready(function () { this.tag && this.options_.autoplay && this.paused() && (delete this.tag.poster, this.play()) }), this.setupTriggers(), this.triggerReady() } }), vjs.Html5.prototype.dispose = function () { vjs.MediaTechController.prototype.dispose.call(this) }, vjs.Html5.prototype.createEl = function () { var a, b = this.player_, c = b.tag; c && this.features.movingMediaElementInDOM !== !1 || (c ? (a = c.cloneNode(!1), vjs.Html5.disposeMediaElement(c), c = a, b.tag = null) : c = vjs.createEl("video", { id: b.id() + "_html5_api", className: "vjs-tech" }), c.player = b, vjs.insertFirst(c, b.el())); for (var d = ["autoplay", "preload", "loop", "muted"], e = d.length - 1; e >= 0; e--) { var f = d[e]; null !== b.options_[f] && (c[f] = b.options_[f]) } return c }, vjs.Html5.prototype.setupTriggers = function () { for (var a = vjs.Html5.Events.length - 1; a >= 0; a--) vjs.on(this.el_, vjs.Html5.Events[a], vjs.bind(this.player_, this.eventHandler)) }, vjs.Html5.prototype.eventHandler = function (a) { this.trigger(a), a.stopPropagation() }, vjs.Html5.prototype.useNativeControls = function () { var a, b, c, d, e; a = this, b = this.player(), a.setControls(b.controls()), c = function () { a.setControls(!0) }, d = function () { a.setControls(!1) }, b.on("controlsenabled", c), b.on("controlsdisabled", d), e = function () { b.off("controlsenabled", c), b.off("controlsdisabled", d) }, a.on("dispose", e), b.on("usingcustomcontrols", e), b.usingNativeControls(!0) }, vjs.Html5.prototype.play = function () { this.el_.play() }, vjs.Html5.prototype.pause = function () { this.el_.pause() }, vjs.Html5.prototype.paused = function () { return this.el_.paused }, vjs.Html5.prototype.currentTime = function () { return this.el_.currentTime }, vjs.Html5.prototype.setCurrentTime = function (a) { try { this.el_.currentTime = a } catch (a) { vjs.log(a, "Video is not ready. (Video.js)") } }, vjs.Html5.prototype.duration = function () { return this.el_.duration || 0 }, vjs.Html5.prototype.buffered = function () { return this.el_.buffered }, vjs.Html5.prototype.volume = function () { return this.el_.volume }, vjs.Html5.prototype.setVolume = function (a) { this.el_.volume = a }, vjs.Html5.prototype.muted = function () { return this.el_.muted }, vjs.Html5.prototype.setMuted = function (a) { this.el_.muted = a }, vjs.Html5.prototype.width = function () { return this.el_.offsetWidth }, vjs.Html5.prototype.height = function () { return this.el_.offsetHeight }, vjs.Html5.prototype.supportsFullScreen = function () { return !("function" != typeof this.el_.webkitEnterFullScreen || !/Android/.test(vjs.USER_AGENT) && /Chrome|Mac OS X 10.5/.test(vjs.USER_AGENT)) }, vjs.Html5.prototype.enterFullScreen = function () { var a = this.el_; a.paused && a.networkState <= a.HAVE_METADATA ? (this.el_.play(), setTimeout(function () { a.pause(), a.webkitEnterFullScreen() }, 0)) : a.webkitEnterFullScreen() }, vjs.Html5.prototype.exitFullScreen = function () { this.el_.webkitExitFullScreen() }, vjs.Html5.prototype.src = function (a) { this.el_.src = a }, vjs.Html5.prototype.load = function () { this.el_.load() }, vjs.Html5.prototype.currentSrc = function () { return this.el_.currentSrc }, vjs.Html5.prototype.preload = function () { return this.el_.preload }, vjs.Html5.prototype.setPreload = function (a) { this.el_.preload = a }, vjs.Html5.prototype.autoplay = function () { return this.el_.autoplay }, vjs.Html5.prototype.setAutoplay = function (a) { this.el_.autoplay = a }, vjs.Html5.prototype.controls = function () { return this.el_.controls }, vjs.Html5.prototype.setControls = function (a) { this.el_.controls = !!a }, vjs.Html5.prototype.loop = function () { return this.el_.loop }, vjs.Html5.prototype.setLoop = function (a) { this.el_.loop = a }, vjs.Html5.prototype.error = function () { return this.el_.error }, vjs.Html5.prototype.seeking = function () { return this.el_.seeking }, vjs.Html5.prototype.ended = function () { return this.el_.ended }, vjs.Html5.prototype.defaultMuted = function () { return this.el_.defaultMuted }, vjs.Html5.isSupported = function () { return !!vjs.TEST_VID.canPlayType }, vjs.Html5.canPlaySource = function (a) { try { return !!vjs.TEST_VID.canPlayType(a.type) } catch (a) { return "" } }, vjs.Html5.canControlVolume = function () { var a = vjs.TEST_VID.volume; return vjs.TEST_VID.volume = a / 2 + .1, a !== vjs.TEST_VID.volume }, vjs.Html5.Events = "loadstart,suspend,abort,error,emptied,stalled,loadedmetadata,loadeddata,canplay,canplaythrough,playing,waiting,seeking,seeked,ended,durationchange,timeupdate,progress,play,pause,ratechange,volumechange".split(","), vjs.Html5.disposeMediaElement = function (a) { if (a) { for (a.player = null, a.parentNode && a.parentNode.removeChild(a); a.hasChildNodes(); ) a.removeChild(a.firstChild); a.removeAttribute("src"), "function" == typeof a.load && a.load() } }, vjs.IS_OLD_ANDROID && (document.createElement("video").constructor.prototype.canPlayType = function (a) { return a && -1 != a.toLowerCase().indexOf("video/mp4") ? "maybe" : "" }), vjs.Flash = vjs.MediaTechController.extend({ init: function (a, b, c) { vjs.MediaTechController.call(this, a, b, c); var d = b.source, e = b.parentEl, f = this.el_ = vjs.createEl("div", { id: a.id() + "_temp_flash" }), g = a.id() + "_flash_api", h = a.options_, i = vjs.obj.merge({ readyFunction: "videojs.Flash.onReady", eventProxyFunction: "videojs.Flash.onEvent", errorEventProxyFunction: "videojs.Flash.onError", autoplay: h.autoplay, preload: h.preload, loop: h.loop, muted: h.muted }, b.flashVars), j = vjs.obj.merge({ wmode: "opaque", bgcolor: "#000000" }, b.params), k = vjs.obj.merge({ id: g, name: g, class: "vjs-tech" }, b.attributes); if (d) if (d.type && vjs.Flash.isStreamingType(d.type)) { var l = vjs.Flash.streamToParts(d.src); i.rtmpConnection = encodeURIComponent(l.connection), i.rtmpStream = encodeURIComponent(l.stream) } else i.src = encodeURIComponent(vjs.getAbsoluteURL(d.src)); if (vjs.insertFirst(f, e), b.startTime && this.ready(function () { this.load(), this.play(), this.currentTime(b.startTime) }), b.iFrameMode !== !0 || vjs.IS_FIREFOX) vjs.Flash.embed(b.swf, f, i, j, k); else { var m = vjs.createEl("iframe", { id: g + "_iframe", name: g + "_iframe", className: "vjs-tech", scrolling: "no", marginWidth: 0, marginHeight: 0, frameBorder: 0 }); i.readyFunction = "ready", i.eventProxyFunction = "events", i.errorEventProxyFunction = "errors", vjs.on(m, "load", vjs.bind(this, function () { var a, c = m.contentWindow; a = m.contentDocument ? m.contentDocument : m.contentWindow.document, a.write(vjs.Flash.getEmbedCode(b.swf, i, j, k)), c.player = this.player_, c.ready = vjs.bind(this.player_, function (b) { var c = a.getElementById(b), d = this, e = d.tech; e.el_ = c, vjs.Flash.checkReady(e) }), c.events = vjs.bind(this.player_, function (a, b) { var c = this; c && "flash" === c.techName && c.trigger(b) }), c.errors = vjs.bind(this.player_, function (a, b) { vjs.log("Flash Error", b) }) })), f.parentNode.replaceChild(m, f) } } }), vjs.Flash.prototype.dispose = function () { vjs.MediaTechController.prototype.dispose.call(this) }, vjs.Flash.prototype.play = function () { this.el_.vjs_play() }, vjs.Flash.prototype.pause = function () { this.el_.vjs_pause() }, vjs.Flash.prototype.src = function (a) { if (vjs.Flash.isStreamingSrc(a) ? (a = vjs.Flash.streamToParts(a), this.setRtmpConnection(a.connection), this.setRtmpStream(a.stream)) : (a = vjs.getAbsoluteURL(a), this.el_.vjs_src(a)), this.player_.autoplay()) { var b = this; setTimeout(function () { b.play() }, 0) } }, vjs.Flash.prototype.currentSrc = function () { var a = this.el_.vjs_getProperty("currentSrc"); if (null == a) { var b = this.rtmpConnection(), c = this.rtmpStream(); b && c && (a = vjs.Flash.streamFromParts(b, c)) } return a }, vjs.Flash.prototype.load = function () { this.el_.vjs_load() }, vjs.Flash.prototype.poster = function () { this.el_.vjs_getProperty("poster") }, vjs.Flash.prototype.buffered = function () { return vjs.createTimeRange(0, this.el_.vjs_getProperty("buffered")) }, vjs.Flash.prototype.supportsFullScreen = function () { return !1 }, vjs.Flash.prototype.enterFullScreen = function () { return !1 }; var api = vjs.Flash.prototype, readWrite = "rtmpConnection,rtmpStream,preload,currentTime,defaultPlaybackRate,playbackRate,autoplay,loop,mediaGroup,controller,controls,volume,muted,defaultMuted".split(","), readOnly = "error,currentSrc,networkState,readyState,seeking,initialTime,duration,startOffsetTime,paused,played,seekable,ended,videoTracks,audioTracks,videoWidth,videoHeight,textTracks".split(","), createSetter = function (a) { var b = a.charAt(0).toUpperCase() + a.slice(1); api["set" + b] = function (b) { return this.el_.vjs_setProperty(a, b) } }, createGetter = function (a) { api[a] = function () { return this.el_.vjs_getProperty(a) } }; if (function () { var a; for (a = 0; a < readWrite.length; a++) createGetter(readWrite[a]) , createSetter(readWrite[a]); for (a = 0; a < readOnly.length; a++) createGetter(readOnly[a]) } (), vjs.Flash.isSupported = function () { return vjs.Flash.version()[0] >= 10 }, vjs.Flash.canPlaySource = function (a) { var b; return a.type ? (b = a.type.replace(/;.*/, "").toLowerCase(), b in vjs.Flash.formats || b in vjs.Flash.streamingFormats ? "maybe" : void 0) : "" }, vjs.Flash.formats = { "video/flv": "FLV", "video/x-flv": "FLV", "video/mp4": "MP4", "video/m4v": "MP4" }, vjs.Flash.streamingFormats = { "rtmp/mp4": "MP4", "rtmp/flv": "FLV" }, vjs.Flash.onReady = function (a) { var b = vjs.el(a), c = b.player || b.parentNode.player, d = c.tech; b.player = c, d.el_ = b, vjs.Flash.checkReady(d) }, vjs.Flash.checkReady = function (a) { a.el().vjs_getProperty ? a.triggerReady() : setTimeout(function () { vjs.Flash.checkReady(a) }, 50) }, vjs.Flash.onEvent = function (a, b) { var c = vjs.el(a).player; c.trigger(b) }, vjs.Flash.onError = function (a, b) { var c = vjs.el(a).player; c.trigger("error"), vjs.log("Flash Error", b, a) }, vjs.Flash.version = function () { var a = "0,0,0"; try { a = new window.ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version").replace(/\D+/g, ",").match(/^,?(.+),?$/)[1] } catch (b) { try { navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin && (a = (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]).description.replace(/\D+/g, ",").match(/^,?(.+),?$/)[1]) } catch (a) {} } return a.split(",") }, vjs.Flash.embed = function (a, b, c, d, e) { var f = vjs.Flash.getEmbedCode(a, c, d, e), g = vjs.createEl("div", { innerHTML: f }).childNodes[0], h = b.parentNode; b.parentNode.replaceChild(g, b); var i = h.childNodes[0]; return setTimeout(function () { i.style.display = "block" }, 1e3), g }, vjs.Flash.getEmbedCode = function (a, b, c, d) { var e = '' }), d = vjs.obj.merge({ data: a, width: "100%", height: "100%" }, d), vjs.obj.each(d, function (a, b) { h += a + '="' + b + '" ' }), e + h + ">" + g + "" }, vjs.Flash.streamFromParts = function (a, b) { return a + "&" + b }, vjs.Flash.streamToParts = function (a) { var b = { connection: "", stream: "" }; if (!a) return b; var c, d = a.indexOf("&"); return -1 !== d ? c = d + 1 : (d = c = a.lastIndexOf("/") + 1, 0 === d && (d = c = a.length)), b.connection = a.substring(0, d), b.stream = a.substring(c, a.length), b }, vjs.Flash.isStreamingType = function (a) { return a in vjs.Flash.streamingFormats }, vjs.Flash.RTMP_RE = /^rtmp[set]?:\/\//i, vjs.Flash.isStreamingSrc = function (a) { return vjs.Flash.RTMP_RE.test(a) }, vjs.MediaLoader = vjs.Component.extend({ init: function (a, b, c) { if (vjs.Component.call(this, a, b, c), a.options_.sources && 0 !== a.options_.sources.length) a.src(a.options_.sources); else for (var d = 0, e = a.options_.techOrder; d < e.length; d++) { var f = vjs.capitalize(e[d]), g = window.videojs[f]; if (g && g.isSupported()) { a.loadTech(f); break } } } }), vjs.Player.prototype.textTracks_, vjs.Player.prototype.textTracks = function () { return this.textTracks_ = this.textTracks_ || [], this.textTracks_ }, vjs.Player.prototype.addTextTrack = function (a, b, c, d) { var e = this.textTracks_ = this.textTracks_ || []; d = d || {}, d.kind = a, d.label = b, d.language = c; var f = vjs.capitalize(a || "subtitles"), g = new window.videojs[f + "Track"](this, d); return e.push(g), g }, vjs.Player.prototype.addTextTracks = function (a) { for (var b, c = 0; c < a.length; c++) b = a[c], this.addTextTrack(b.kind, b.label, b.language, b); return this }, vjs.Player.prototype.showTextTrack = function (a, b) { for (var c, d, e, f = this.textTracks_, g = 0, h = f.length; h > g; g++) c = f[g], c.id() === a ? (c.show(), d = c) : b && c.kind() == b && c.mode() > 0 && c.disable(); return e = d ? d.kind() : !!b && b, e && this.trigger(e + "trackchange"), this }, vjs.TextTrack = vjs.Component.extend({ init: function (a, b) { vjs.Component.call(this, a, b), this.id_ = b.id || "vjs_" + b.kind + "_" + b.language + "_" + vjs.guid++, this.src_ = b.src, this.dflt_ = b.default || b.dflt, this.title_ = b.title, this.language_ = b.srclang, this.label_ = b.label, this.cues_ = [], this.activeCues_ = [], this.readyState_ = 0, this.mode_ = 0, this.player_.on("fullscreenchange", vjs.bind(this, this.adjustFontSize)) } }), vjs.TextTrack.prototype.kind_, vjs.TextTrack.prototype.kind = function () { return this.kind_ }, vjs.TextTrack.prototype.src_, vjs.TextTrack.prototype.src = function () { return this.src_ }, vjs.TextTrack.prototype.dflt_, vjs.TextTrack.prototype.dflt = function () { return this.dflt_ }, vjs.TextTrack.prototype.title_, vjs.TextTrack.prototype.title = function () { return this.title_ }, vjs.TextTrack.prototype.language_, vjs.TextTrack.prototype.language = function () { return this.language_ }, vjs.TextTrack.prototype.label_, vjs.TextTrack.prototype.label = function () { return this.label_ }, vjs.TextTrack.prototype.cues_, vjs.TextTrack.prototype.cues = function () { return this.cues_ }, vjs.TextTrack.prototype.activeCues_, vjs.TextTrack.prototype.activeCues = function () { return this.activeCues_ }, vjs.TextTrack.prototype.readyState_, vjs.TextTrack.prototype.readyState = function () { return this.readyState_ }, vjs.TextTrack.prototype.mode_, vjs.TextTrack.prototype.mode = function () { return this.mode_ }, vjs.TextTrack.prototype.adjustFontSize = function () { this.player_.isFullScreen ? this.el_.style.fontSize = screen.width / this.player_.width() * 1.4 * 100 + "%" : this.el_.style.fontSize = "" }, vjs.TextTrack.prototype.createEl = function () { return vjs.Component.prototype.createEl.call(this, "div", { className: "vjs-" + this.kind_ + " vjs-text-track" }) }, vjs.TextTrack.prototype.show = function () { this.activate(), this.mode_ = 2, vjs.Component.prototype.show.call(this) }, vjs.TextTrack.prototype.hide = function () { this.activate(), this.mode_ = 1, vjs.Component.prototype.hide.call(this) }, vjs.TextTrack.prototype.disable = function () { 2 == this.mode_ && this.hide(), this.deactivate(), this.mode_ = 0 }, vjs.TextTrack.prototype.activate = function () { 0 === this.readyState_ && this.load(), 0 === this.mode_ && (this.player_.on("timeupdate", vjs.bind(this, this.update, this.id_)), this.player_.on("ended", vjs.bind(this, this.reset, this.id_)), ("captions" === this.kind_ || "subtitles" === this.kind_) && this.player_.getChild("textTrackDisplay").addChild(this)) }, vjs.TextTrack.prototype.deactivate = function () { this.player_.off("timeupdate", vjs.bind(this, this.update, this.id_)), this.player_.off("ended", vjs.bind(this, this.reset, this.id_)), this.reset(), this.player_.getChild("textTrackDisplay").removeChild(this) }, vjs.TextTrack.prototype.load = function () { 0 === this.readyState_ && (this.readyState_ = 1, vjs.get(this.src_, vjs.bind(this, this.parseCues), vjs.bind(this, this.onError))) }, vjs.TextTrack.prototype.onError = function (a) { this.error = a, this.readyState_ = 3, this.trigger("error") }, vjs.TextTrack.prototype.parseCues = function (a) { for (var b, c, d, e, f = a.split("\n"), g = "", h = 1, i = f.length; i > h; h++) if (g = vjs.trim(f[h])) { for (-1 == g.indexOf("-->") ? (e = g, g = vjs.trim(f[++h])) : e = this.cues_.length, b = { id: e, index: this.cues_.length }, c = g.split(" --> "), b.startTime = this.parseCueTime(c[0]), b.endTime = this.parseCueTime(c[1]), d = []; f[++h] && (g = vjs.trim(f[h])); ) d.push(g); b.text = d.join("
"), this.cues_.push(b) } this.readyState_ = 2, this.trigger("loaded") }, vjs.TextTrack.prototype.parseCueTime = function (a) { var b, c, d, e, f, g = a.split(":"), h = 0; return 3 == g.length ? (b = g[0], c = g[1], d = g[2]) : (b = 0, c = g[0], d = g[1]), d = d.split(/\s+/), e = d.splice(0, 1)[0], e = e.split(/\.|,/), f = parseFloat(e[1]), e = e[0], h += 3600 * parseFloat(b), h += 60 * parseFloat(c), h += parseFloat(e), f && (h += f / 1e3), h }, vjs.TextTrack.prototype.update = function () { if (this.cues_.length > 0) { var a = this.player_.currentTime(); if (void 0 === this.prevChange || a < this.prevChange || this.nextChange <= a) { var b, c, d, e, f = this.cues_, g = this.player_.duration(), h = 0, i = !1, j = []; for (a >= this.nextChange || void 0 === this.nextChange ? e = void 0 !== this.firstActiveIndex ? this.firstActiveIndex : 0 : (i = !0, e = void 0 !== this.lastActiveIndex ? this.lastActiveIndex : f.length - 1); ; ) { if (d = f[e], d.endTime <= a) h = Math.max(h, d.endTime), d.active && (d.active = !1); else if (a < d.startTime) { if (g = Math.min(g, d.startTime), d.active && (d.active = !1), !i) break } else i ? (j.splice(0, 0, d), void 0 === c && (c = e), b = e) : (j.push(d), void 0 === b && (b = e), c = e), g = Math.min(g, d.endTime), h = Math.max(h, d.startTime), d.active = !0; if (i) { if (0 === e) break; e-- } else { if (e === f.length - 1) break; e++ } } this.activeCues_ = j, this.nextChange = g, this.prevChange = h, this.firstActiveIndex = b, this.lastActiveIndex = c, this.updateDisplay(), this.trigger("cuechange") } } }, vjs.TextTrack.prototype.updateDisplay = function () { for (var a = this.activeCues_, b = "", c = 0, d = a.length; d > c; c++) b += '' + a[c].text + ""; this.el_.innerHTML = b }, vjs.TextTrack.prototype.reset = function () { this.nextChange = 0, this.prevChange = this.player_.duration(), this.firstActiveIndex = 0, this.lastActiveIndex = 0 }, vjs.CaptionsTrack = vjs.TextTrack.extend(), vjs.CaptionsTrack.prototype.kind_ = "captions", vjs.SubtitlesTrack = vjs.TextTrack.extend(), vjs.SubtitlesTrack.prototype.kind_ = "subtitles", vjs.ChaptersTrack = vjs.TextTrack.extend(), vjs.ChaptersTrack.prototype.kind_ = "chapters", vjs.TextTrackDisplay = vjs.Component.extend({ init: function (a, b, c) { vjs.Component.call(this, a, b, c), a.options_.tracks && a.options_.tracks.length > 0 && this.player_.addTextTracks(a.options_.tracks) } }), vjs.TextTrackDisplay.prototype.createEl = function () { return vjs.Component.prototype.createEl.call(this, "div", { className: "vjs-text-track-display" }) }, vjs.TextTrackMenuItem = vjs.MenuItem.extend({ init: function (a, b) { var c = this.track = b.track; b.label = c.label(), b.selected = c.dflt(), vjs.MenuItem.call(this, a, b), this.player_.on(c.kind() + "trackchange", vjs.bind(this, this.update)) } }), vjs.TextTrackMenuItem.prototype.onClick = function () { vjs.MenuItem.prototype.onClick.call(this), this.player_.showTextTrack(this.track.id_, this.track.kind()) }, vjs.TextTrackMenuItem.prototype.update = function () { this.selected(2 == this.track.mode()) }, vjs.OffTextTrackMenuItem = vjs.TextTrackMenuItem.extend({ init: function (a, b) { b.track = { kind: function () { return b.kind }, player: a, label: function () { return b.kind + " off" }, dflt: function () { return !1 }, mode: function () { return !1 } }, vjs.TextTrackMenuItem.call(this, a, b), this.selected(!0) } }), vjs.OffTextTrackMenuItem.prototype.onClick = function () { vjs.TextTrackMenuItem.prototype.onClick.call(this), this.player_.showTextTrack(this.track.id_, this.track.kind()) }, vjs.OffTextTrackMenuItem.prototype.update = function () { for (var a, b = this.player_.textTracks(), c = 0, d = b.length, e = !0; d > c; c++) a = b[c], a.kind() == this.track.kind() && 2 == a.mode() && (e = !1); this.selected(e) }, vjs.TextTrackButton = vjs.MenuButton.extend({ init: function (a, b) { vjs.MenuButton.call(this, a, b), this.items.length <= 1 && this.hide() } }), vjs.TextTrackButton.prototype.createItems = function () { var a, b = []; b.push(new vjs.OffTextTrackMenuItem(this.player_, { kind: this.kind_ })); for (var c = 0; c < this.player_.textTracks().length; c++) a = this.player_.textTracks()[c], a.kind() === this.kind_ && b.push(new vjs.TextTrackMenuItem(this.player_, { track: a })); return b }, vjs.CaptionsButton = vjs.TextTrackButton.extend({ init: function (a, b, c) { vjs.TextTrackButton.call(this, a, b, c), this.el_.setAttribute("aria-label", "Captions Menu") } }), vjs.CaptionsButton.prototype.kind_ = "captions", vjs.CaptionsButton.prototype.buttonText = "Captions", vjs.CaptionsButton.prototype.className = "vjs-captions-button", vjs.SubtitlesButton = vjs.TextTrackButton.extend({ init: function (a, b, c) { vjs.TextTrackButton.call(this, a, b, c), this.el_.setAttribute("aria-label", "Subtitles Menu") } }), vjs.SubtitlesButton.prototype.kind_ = "subtitles", vjs.SubtitlesButton.prototype.buttonText = "Subtitles", vjs.SubtitlesButton.prototype.className = "vjs-subtitles-button", vjs.ChaptersButton = vjs.TextTrackButton.extend({ init: function (a, b, c) { vjs.TextTrackButton.call(this, a, b, c), this.el_.setAttribute("aria-label", "Chapters Menu") } }), vjs.ChaptersButton.prototype.kind_ = "chapters", vjs.ChaptersButton.prototype.buttonText = "Chapters", vjs.ChaptersButton.prototype.className = "vjs-chapters-button", vjs.ChaptersButton.prototype.createItems = function () { for (var a, b = [], c = 0; c < this.player_.textTracks().length; c++) a = this.player_.textTracks()[c], a.kind() === this.kind_ && b.push(new vjs.TextTrackMenuItem(this.player_, { track: a })); return b }, vjs.ChaptersButton.prototype.createMenu = function () { for (var a, b, c = this.player_.textTracks(), d = 0, e = c.length, f = this.items = []; e > d; d++) if (a = c[d], a.kind() == this.kind_ && a.dflt()) { if (a.readyState() < 2) return this.chaptersTrack = a, void a.on("loaded", vjs.bind(this, this.createMenu)); b = a; break } var g = this.menu = new vjs.Menu(this.player_); if (g.el_.appendChild(vjs.createEl("li", { className: "vjs-menu-title", innerHTML: vjs.capitalize(this.kind_), tabindex: -1 })), b) { var h, i, j = b.cues_; for (d = 0, e = j.length; e > d; d++) h = j[d], i = new vjs.ChaptersTrackMenuItem(this.player_, { track: b, cue: h }), f.push(i), g.addChild(i) } return this.items.length > 0 && this.show(), g }, vjs.ChaptersTrackMenuItem = vjs.MenuItem.extend({ init: function (a, b) { var c = this.track = b.track, d = this.cue = b.cue, e = a.currentTime(); b.label = d.text, b.selected = d.startTime <= e && e < d.endTime, vjs.MenuItem.call(this, a, b), c.on("cuechange", vjs.bind(this, this.update)) } }), vjs.ChaptersTrackMenuItem.prototype.onClick = function () { vjs.MenuItem.prototype.onClick.call(this), this.player_.currentTime(this.cue.startTime), this.update(this.cue.startTime) }, vjs.ChaptersTrackMenuItem.prototype.update = function () { var a = this.cue, b = this.player_.currentTime(); this.selected(a.startTime <= b && b < a.endTime) }, vjs.obj.merge(vjs.ControlBar.prototype.options_.children, { subtitlesButton: {}, captionsButton: {}, chaptersButton: {} }), vjs.JSON, "undefined" != typeof window.JSON && "function" === window.JSON.parse)vjs.JSON = window.JSON; else { vjs.JSON = {}; var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g; vjs.JSON.parse = function (text, reviver) { function walk(a, b) { var c, d, e = a[b]; if (e && "object" == typeof e) for (c in e) Object.prototype.hasOwnProperty.call(e, c) && (d = walk(e, c), void 0 !== d ? e[c] = d : delete e[c]); return reviver.call(a, b, e) } var j; if (text = String(text), cx.lastIndex = 0, cx.test(text) && (text = text.replace(cx, function (a) { return "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4) })), /^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]").replace(/(?:^|:|,)(?:\s*\[)+/g, ""))) return j = eval("(" + text + ")"), "function" == typeof reviver ? walk({ "": j }, "") : j; throw new SyntaxError("JSON.parse(): invalid or malformed JSON data") } } vjs.autoSetup = function () { var a, b, c, d = document.getElementsByTagName("video"); if (d && d.length > 0) for (var e = 0, f = d.length; f > e; e++) { if (b = d[e], !b || !b.getAttribute) { vjs.autoSetupTimeout(1); break } void 0 === b.player && (a = b.getAttribute("data-setup"), null !== a && (a = vjs.JSON.parse(a || "{}"), c = videojs(b, a))) } else vjs.windowLoaded || vjs.autoSetupTimeout(1) }, vjs.autoSetupTimeout = function (a) { setTimeout(vjs.autoSetup, a) }, "complete" === document.readyState ? vjs.windowLoaded = !0 : vjs.one(window, "load", function () { vjs.windowLoaded = !0 }), vjs.autoSetupTimeout(1), vjs.plugin = function (a, b) { vjs.Player.prototype[a] = b }, function () { var a, b = { file: "", pos: "R", link: "" }, c = function () { var a, b, d, e, f; a = Array.prototype.slice.call(arguments), b = a.shift() || {}; for (d in a) { e = a[d]; for (f in e) e.hasOwnProperty(f) && ("object" == typeof e[f] ? b[f] = c(b[f], e[f]) : b[f] = e[f]) } return b }, d = function (b) { b || (b = 10), createjs.Tween.get(a).to({ bottom: b }, 300, createjs.Ease.quadOut) }, e = function () { createjs.Tween.get(a).to({ bottom: -100 }, 300, createjs.Ease.quadIn) }, f = function (f) { var g, h, i, j, k; h = c(b, f), createjs.Ticker.setFPS(30), createjs.CSSPlugin.install(), i = this.el(), g = this, j = document.createElement("div"), k = document.createElement("a"), a = document.createElement("img"), k.appendChild(a), j.appendChild(k), a.src = f.file, a.id = "AOSBranding", f.margin + "px", "R" === f.pos ? (a.style.bottom = "10px", a.style.right = "10px") : "L" === f.pos && (a.style.bottom = "10px", a.style.left = "10px"), j.style.opacity = f.opacity, a.style.position = "absolute", a.style.width = "auto", a.style.height = "auto", k.target = "_blank", k.href = f.link, i.appendChild(j), g.on("play", function () { e() }), g.on("ended", function () { d(videojs.IS_IOS ? 40 : 10) }), g.on("useractive", function () { if (!videojs.IS_IOS) { g.playOverlay.isPlayVisible() || d(40) } }), g.on("userinactive", function () { void 0 !== g.playOverlay.isReplayVisible && g.playOverlay.isReplayVisible() ? d(10) : void 0 === g.playOverlay.isPlayVisible || g.playOverlay.isPlayVisible() || e() }) }; videojs.plugin("branding", f) } (), function () { function a(a, b) { var c, d, e, f; if (c = document.createElement("table"), a instanceof Array) { "v" === b ? (c.style.height = "100%", c.style.width = "150px") : d = c.insertRow(); for (var g = 0; g < a.length; g++) "v" === b && (d = c.insertRow()), e = d.insertCell(), f = a[g].replace("/", " / "), e.innerHTML = "
  • " + f + "
" } else d = c.insertRow(), e = d.insertCell(), e.innerHTML = a; return c } function b() { console.log("showPrice: " + s), isNaN(s) || (f("£" + s, "TR", "T", 99999, 0, 1), t = !0) } function c() { t = !1, console.log("hidePrice"); var a = document.getElementById("AOSLCBGTR"), b = document.getElementById("AOSLCTxtTR"); createjs.Tween.get(b).to({ top: -100 }, 300, createjs.Ease.quadIn).call(h, [b]), createjs.Tween.get(a).to({ top: -100 }, 300, createjs.Ease.quadIn).call(h, [a]) } function d(a) { "L" !== a && "T" !== a && "TL" !== a || !m.watermark.hide || m.watermark.hide(), ("R" === a || "T" === a || "TR" === a) && (m.share.hide && m.share.hide(), t && c()) } function e(a, b) { d(a.position); var c = document.createElement("div"); c.id = "AOSLCBG" + a.position; c.style.zIndex = 99; var e = ("L" === a.position || "R" === a.position ? "v" : "h", document.createElement("img")); e.className = "AOSLCItemImg AOSLCItemImg" + a.position, e.src = a.src, e.style.cursor = "pointer", c.onclick = function () { "" != a.url && window.open(a.url, "_blank") }; var f = {}, g = {}, i = {}, j = {}; switch (f.position = "absolute", f.width = a.width, j.width = "100%", j.height = "auto", f.margin = a.margin + "px", a.position) { case "T": case "B": j.position = "relative", j.display = "table", j.width = a.width, j.maxWidth = "100%", j.margin = "0 auto " + a.margin + "px auto", f.width = "100%", f.margin = 0; break; case "L": case "R": f.top = "50%", f.marginTop = "-" + a.width / 2 + "px"; break; case "TL": f.maxWidth = "25%", f.left = "0px", f.top = "0px"; break; case "BL": f.maxWidth = "25%", f.left = "0px", f.bottom = "0px"; break; case "TR": f.maxWidth = "25%", f.right = "0px", f.top = "0px"; break; case "BR": f.maxWidth = "25%", f.right = "0px", f.bottom = "0px" } switch (a.direction) { case "T": f.top = "-" + a.height + "px", i.top = -a.height, g.top = 0; break; case "B": f.bottom = "-" + a.height + "px", i.bottom = -a.height, g.bottom = 0; break; case "L": f.left = "-" + a.width + "px", i.left = -a.width, g.left = 0; break; case "R": f.right = "-" + a.width + "px", i.right = -a.width, g.right = 0 } p.appendChild(c), c.appendChild(e); for (var k in j) e.style[k] = j[k]; for (var k in f) c.style[k] = f[k]; if (a.pause && (q++, m.pause(), console.log("pause: " + q)), b) createjs.Tween.get(c).to(g, 300, createjs.Ease.quadOut).wait(1e3 * a.duration + 2 * u).to(i, 300, createjs.Ease.quadIn).call(h, [e]); else { for (var k in g) e.style[k] = g[k]; createjs.Tween.get(c).wait(1e3 * a.duration + 2 * u).to(i, 300, createjs.Ease.quadIn).call(h, [e]) } m.userActive(!1) } function f(b, c, e, f, i, j) { d(c); var k = "L" === c || "R" === c ? "v" : "h", l = document.createElement("div"); l.id = "AOSLCBG" + c, l.className = "AOSLCItemBG AOSLCItemBG" + c; var n = document.createElement("div"); n.id = "AOSLCTxt" + c, n.className = "AOSLCTxt"; var o = {}, r = {}, s = {}; switch (c) { case "T": case "B": o.width = "auto", o.left = "0px", o.right = "0px"; break; case "L": case "R": o.height = "auto", o.top = "0px", o.bottom = "0px"; break; case "TL": case "BL": o.left = "0px"; break; case "TR": case "BR": o.right = "0px" } switch (e) { case "T": o.top = "-150px", s.top = -150, r.top = 0; break; case "B": o.bottom = "-150px", s.bottom = -150, r.bottom = 0; break; case "L": o.left = "-250px", s.left = -250, r.left = 0; break; case "R": o.right = "-250px", s.right = -250, r.right = 0 } l.appendChild(a(b, k)), n.appendChild(a(b, k)), p.appendChild(l), p.appendChild(n); for (var t in o) n.style[t] = o[t], l.style[t] = o[t]; if (i && (q++, m.pause(), console.log("pause: " + q)), j) createjs.Tween.get(n).wait(u).to(r, 300, createjs.Ease.quadOut).wait(1e3 * f).call(g, [i, c]).to(s, 300, createjs.Ease.quadIn).call(h, [n]), createjs.Tween.get(l).to(r, 300, createjs.Ease.quadOut).wait(1e3 * f + 2 * u).to(s, 300, createjs.Ease.quadIn).call(h, [l]); else { for (var t in r) n.style[t] = r[t], l.style[t] = r[t]; createjs.Tween.get(n).wait(1e3 * f).call(g, [i, c]).to(s, 300, createjs.Ease.quadIn).call(h, [n]), createjs.Tween.get(l).wait(1e3 * f + 2 * u).to(s, 300, createjs.Ease.quadIn).call(h, [l]) } m.userActive(!1) } function g(a, c) { a && (q--, 0 === q && m.play()), console.log("afterLCShown: " + q), !m.watermark.show || "L" !== c && "T" !== c && "TL" !== c || m.watermark.show(), ("R" === c || "T" === c || "TR" === c) && (m.share.show && m.share.show(), t || b()) } function h(a) { document.contains(a) && a.parentNode.removeChild(a) } function j(a) { var b = p.childElementCount; for (i = b - 1; i >= 0; i--) (!t || "AOSLCBGTR" !== p.childNodes[i].id && "AOSLCTxtTR" !== p.childNodes[i].id || a) && h(p.childNodes[i]) } function k() { for (var a = o.length, b = 0; a > b; b++) o[b].shown = !1 } function l() { var a = Math.floor(m.currentTime()); if (!m.paused() && r != a && v) { r = a; for (var b, c, d, g, h = o.length, i = 0; h > i; i++) if (b = o[i], !b.shown && b.time <= a && b.time + b.duration > a) { if (b.shown = !0, g = a - b.time, c = b.duration - g - 1, d = 0 === g, b.pause && 0 !== g) continue; "image" == b.type ? e(b, d) : f(b.text, b.position, b.direction, b.duration, b.pause, d) } } } var m, n, o, p, q, r, s, t, u = 200, v = !0, w = { data: "" }, x = function () { var a, b, c, d, e; a = Array.prototype.slice.call(arguments), b = a.shift() || {}; for (c in a) { d = a[c]; for (e in d) d.hasOwnProperty(e) && ("object" == typeof d[e] ? b[e] = x(b[e], d[e]) : b[e] = d[e]) } return b }, y = function (a) { v = a }, z = function (a) { var c; c = x(w, a), m = this, n = this.el(), p = document.createElement("div"), p.id = "liveContentContainer", n.insertBefore(p, n.firstChild), o = a.data, s = a.price, createjs.Ticker.setFPS(30), createjs.CSSPlugin.install(), m.on("timeupdate", function () { l() }), m.on("useractive", function () { var a = document.getElementById("liveContentContainer"); createjs.Tween.get(a).to({ bottom: 39 }, 300, createjs.Ease.quadIn) }), m.on("userinactive", function () { var a = document.getElementById("liveContentContainer"); createjs.Tween.get(a).to({ bottom: 0 }, 300, createjs.Ease.quadIn) }), m.on("play", function () { q = 0, m.userActive(!1); var a = document.getElementById("videoClickPanel"); if (!a) { var a = document.createElement("div"); a.id = "videoClickPanel", p.insertBefore(a, p.firstChild), a.onclick = function () { this.onClickFunc && this.onClickFunc() } } m.pl.currentVideo.link && "" != m.pl.currentVideo.link ? (a.style.cursor = "pointer", a.onClickFunc = function () { window.open(m.pl.currentVideo.link, "_blank") }) : (a.style.cursor = "arrow", a.onClickFunc = function () { m.paused() ? m.play() : m.pause() }) }), m.on("seeked", function () { j(), k() }), m.on("ended", function () { j(), k() }), m.onPause = function () {}, b(), m.share.setIconTop && !isNaN(s) && m.share.setIconTop(60), m.liveContent = { price: s, setEnabled: y } }; videojs.plugin("liveContent", z) } (), function (a) { a.fn.AOSImageOverlay = function (b) { var c = null, d = null, e = "BL", f = "", g = "", h = {}, i = 255; return initOverlay = function (b) { d = document.createElement("div"), c = a(""), c.attr("src", f), c[0].complete ? applyConfig(b) : c[0].onload = function () { applyConfig(b) } }, applyConfig = function (a) { var b = c[0].width || c[0].offsetWidth; switch (c.css({ position: "absolute", cursor: "pointer", zIndex: 9999, width: "inherit" }), c[0].height || c[0].offsetHeight, e) { case "T": c.css({ left: "50%", top: "0px", marginLeft: "-" + b / 2 + "px" }); case "B": c.css({ left: "50%", bottom: "0px", marginLeft: "-" + b / 2 + "px" }); break; case "L": c.css({ top: "50%", left: "0px", marginTop: "-" + b / 2 + "px" }); case "R": c.css({ top: "50%", right: "0px", marginTop: "-" + b / 2 + "px" }); break; case "TL": c.css({ maxWidth: "25%", left: "0px", top: "0px" }); case "BL": c.css({ maxWidth: "25%", left: "0px", bottom: "0px" }); break; case "TR": c.css({ maxWidth: "25%", right: "0px", top: "0px" }); case "BR": c.css({ maxWidth: "25%", right: "0px", bottom: "0px" }) } c.css(h), c.css({ height: "auto" }), a.prepend(d), d.prepend(c[0]), c.click(function () { "" != g && window.open(g, "_blank") }) }, configure = function (a) { a && (a.position && (e = a.position), a.src && (f = a.src), a.url && (g = a.url), a.style && (h = a.style), a.opacity && (i = 255 / (100 / a.opacity))) }, configure(b), this.each(function () { initOverlay(a(this)) }) } } (losjqisafe), function () { var a = { l: "" }, b = function () { var a, c, d, e, f; a = Array.prototype.slice.call(arguments), c = a.shift() || {}; for (d in a) { e = a[d]; for (f in e) e.hasOwnProperty(f) && ("object" == typeof e[f] ? c[f] = b(c[f], e[f]) : c[f] = e[f]) } return c }, c = function (c) { var d = b(a, c); player.on("play", function () { var a = Math.floor(player.currentTime()); 0 === a && losjqisafe.ajax({ url: logScript, data: { p: "html5standalone", t: "view", u: window.location.href, l: d.l }, success: function () {} }) }) }; videojs.plugin("logging", c) } (), videojs.Player.prototype.next = function () { return this.pl._nextPrev("next"), this }, videojs.Player.prototype.prev = function () { return this.pl._nextPrev("prev"), this }, videojs.Player.prototype.resume = function () { return this.pl._resumeVideo(), this }, videojs.plugin("playList", playList), function () { var a, b, pinit = function () { createjs.Ticker.setFPS(30), createjs.CSSPlugin.install(), a = this.el(), b = document.createElement("div"), b.style.position = "absolute", b.style.width = "100%", b.style.height = "100%", b.style.display = "none", b.style.backgroundPosition = "center center", b.style.backgroundRepeat = "no-repeat", b.style.cursor = "pointer", player.on("play", function () { h() }), player.on("ended", function () { player.pl.current == player.pl.videos.length - 1 && 0 != player.currentTime() && g() }), a.appendChild(b), f(), player.playOverlay = { isPlayVisible: d, isReplayVisible: e, showPlay: f, showReplay: g, hide: h } }, d = function () { return 1 == b.style.opacity && "AOSPlayIcon" == b.id }, e = function () { return 1 == b.style.opacity && "AOSReplayIcon" == b.id }, f = function () { b.id = "AOSPlayIcon", b.style.opacity = 0, b.style.display = "inline", b.style.top = "0px", b.style.left = "0px", b.style.backgroundImage = "url(//control.lifeonshow.tv/images/playIcon.png)", b.onclick = function () { player.play() }, createjs.Tween.get(b).to({ opacity: 1 }, 500) }, g = function () { b.id = "AOSReplayIcon", b.style.opacity = 0, b.style.display = "inline", b.style.backgroundImage = "url(//control.lifeonshow.tv/images/replayIcon.png)", b.onclick = function () { player.pl._setVideo(0), player.play() }, createjs.Tween.get(b).to({ opacity: 1 }, 500) }, h = function () { createjs.Tween.get(b).to({ opacity: 0 }, 500).call(i, [b]) }, i = function (a) { null != a && (a.style.display = "none") }; videojs.plugin("playOverlay", pinit) } (), function () { var hasRated; var pinit = function (config) { config.onRated = function () { hasRated = true; }; player.on("ended", function () { if (player.pl.current == player.pl.videos.length - 1 && 0 != player.currentTime() && !hasRated) { var rateForm = new AOSVideoRateForm(config); rateForm.open(); } }); }; videojs.plugin("rate", pinit); } (), function () { var a, b, c, d = [{ name: "Twitter", image: "//control.lifeonshow.tv/images/twitterIcon.jpg", link: "http://twitter.com?status=Check this out: {TITLE} - {URL}" }, { name: "Facebook", image: "//control.lifeonshow.tv/images/facebookIcon.jpg", link: "http://www.facebook.com/share.php?u={URL}" }, { name: "Google +", image: "//control.lifeonshow.tv/images/googlePlusIcon.jpg", link: "https://plus.google.com/share?url={URL}" } ], e = { title: "" }, f = function () { var a, b, c, d, e; a = Array.prototype.slice.call(arguments), b = a.shift() || {}; for (c in a) { d = a[c]; for (e in d) d.hasOwnProperty(e) && ("object" == typeof d[e] ? b[e] = f(b[e], d[e]) : b[e] = d[e]) } return b }, g = function () { a = document.createElement("img"), a.id = "AOSShareIcon", a.onclick = k, a.src = "//control.lifeonshow.tv/images/shareIcon.png", a.style.top = "-25px", video.appendChild(a) }, h = function () { var a = document.createElement("div"); a.id = "AOSSharePanel"; var c = document.createElement("div"); c.id = "AOSSharePanelBG"; var e, f, g, h; e = document.createElement("table"), f = e.insertRow(); for (var i = d.length, k = i - 1; k >= 0; k--) g = f.insertCell(), h = document.createElement("img"), h.src = d[k].image, g.appendChild(h), g.innerHTML += "
" + d[k].name, g.id = "AOSShareItem", g.setAttribute("link", d[k].link.replace("{TITLE}", b.title).replace("{URL}", window.location.href)), g.onclick = function () { j(this.getAttribute("link")) }; a.appendChild(c), a.appendChild(e), video.appendChild(a) }, i = function () { var a = document.createElement("img"); a.id = "AOSCloseIcon", a.onclick = l, a.src = "//control.lifeonshow.tv/images/closeIcon.png"; var b = document.getElementById("AOSSharePanel"); b.appendChild(a) }, j = function (a) { "" != a && window.open(a, "_blank") }, k = function () { var a = document.getElementById("AOSSharePanel"); a.style.display = "block" }, l = function () { var a = document.getElementById("AOSSharePanel"); a.style.display = "none" }, m = function () { createjs.Tween.get(a).to({ top: c }, 300, createjs.Ease.quadOut) }, n = function () { createjs.Tween.get(a).to({ top: -25 }, 300, createjs.Ease.quadIn) }, o = function (b) { c = b, createjs.Tween.get(a, { override: !0 }).to({ top: c }, 300, createjs.Ease.quadOut) }, p = function (a) { b = f(e, a), createjs.Ticker.setFPS(30), createjs.CSSPlugin.install(), video = this.el(), c = isNaN(player.liveContent.price) || null === player.liveContent.price ? 10 : 60, g(), h(), i(), l(), m(), player.share = { show: m, hide: n, setIconTop: o } }; videojs.plugin("share", p) } (), function () { var a = { file: "", pos: "TL", margin: 10, opacity: 100 }, b = function () { var a, c, d, e, f; a = Array.prototype.slice.call(arguments), c = a.shift() || {}; for (d in a) { e = a[d]; for (f in e) e.hasOwnProperty(f) && ("object" == typeof e[f] ? c[f] = b(c[f], e[f]) : c[f] = e[f]) } return c }, c = function (c) { createjs.Ticker.setFPS(30), createjs.CSSPlugin.install(); var d, e, f; d = b(a, c), e = this.el(), f = document.createElement("img"), f.src = c.file; var g = "10px"; for ("TL" === c.pos ? (f.style.top = g, f.style.left = g) : "TR" === c.pos ? (f.style.top = g, f.style.right = g) : "BR" === c.pos ? (f.style.bottom = g, f.style.right = g) : "BL" === c.pos ? (f.style.bottom = g, f.style.left = g) : "C" === c.pos && (f.style.top = this.width() / 2 + "px", f.style.left = this.height() / 2 + "px"), f.style.position = "absolute", i = 0; i < e.childElementCount; i++) if ("vjs-control-bar" === e.childNodes[i].className) { e.insertBefore(f, e.childNodes[i]); break } player.watermark = { show: function () { createjs.Tween.get(f).to({ top: 10 }, 300, createjs.Ease.quadIn) }, hide: function () { createjs.Tween.get(f).to({ top: -50 }, 300, createjs.Ease.quadOut) } } }; videojs.plugin("watermark", c) } (), this.createjs = this.createjs || {}, function () { var a = function () { throw "Ease cannot be instantiated." }; a.linear = function (a) { return a }, a.none = a.linear, a.get = function (a) { return -1 > a && (a = -1), a > 1 && (a = 1), function (b) { return 0 == a ? b : 0 > a ? b * (b * -a + 1 + a) : b * ((2 - b) * a + (1 - a)) } }, a.getPowIn = function (a) { return function (b) { return Math.pow(b, a) } }, a.getPowOut = function (a) { return function (b) { return 1 - Math.pow(1 - b, a) } }, a.getPowInOut = function (a) { return function (b) { return (b *= 2) < 1 ? .5 * Math.pow(b, a) : 1 - .5 * Math.abs(Math.pow(2 - b, a)) } }, 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 (a) { return 1 - Math.cos(a * Math.PI / 2) }, a.sineOut = function (a) { return Math.sin(a * Math.PI / 2) }, a.sineInOut = function (a) { return - .5 * (Math.cos(Math.PI * a) - 1) }, a.getBackIn = function (a) { return function (b) { return b * b * ((a + 1) * b - a) } }, a.backIn = a.getBackIn(1.7), a.getBackOut = function (a) { return function (b) { return --b * b * ((a + 1) * b + a) + 1 } }, a.backOut = a.getBackOut(1.7), a.getBackInOut = function (a) { return a *= 1.525, function (b) { return (b *= 2) < 1 ? .5 * b * b * ((a + 1) * b - a) : .5 * ((b -= 2) * b * ((a + 1) * b + a) + 2) } }, a.backInOut = a.getBackInOut(1.7), a.circIn = function (a) { return - (Math.sqrt(1 - a * a) - 1) }, a.circOut = function (a) { return Math.sqrt(1 - --a * a) }, a.circInOut = function (a) { return (a *= 2) < 1 ? - .5 * (Math.sqrt(1 - a * a) - 1) : .5 * (Math.sqrt(1 - (a -= 2) * a) + 1) }, a.bounceIn = function (b) { return 1 - a.bounceOut(1 - b) }, a.bounceOut = function (a) { return 1 / 2.75 > a ? 7.5625 * a * a : 2 / 2.75 > a ? 7.5625 * (a -= 1.5 / 2.75) * a + .75 : 2.5 / 2.75 > a ? 7.5625 * (a -= 2.25 / 2.75) * a + .9375 : 7.5625 * (a -= 2.625 / 2.75) * a + .984375 }, a.bounceInOut = function (b) { return .5 > b ? .5 * a.bounceIn(2 * b) : .5 * a.bounceOut(2 * b - 1) + .5 }, a.getElasticIn = function (a, b) { var c = 2 * Math.PI; return function (d) { if (0 == d || 1 == d) return d; var e = b / c * Math.asin(1 / a); return - (a * Math.pow(2, 10 * (d -= 1)) * Math.sin((d - e) * c / b)) } }, a.elasticIn = a.getElasticIn(1, .3), a.getElasticOut = function (a, b) { var c = 2 * Math.PI; return function (d) { if (0 == d || 1 == d) return d; var e = b / c * Math.asin(1 / a); return a * Math.pow(2, -10 * d) * Math.sin((d - e) * c / b) + 1 } }, a.elasticOut = a.getElasticOut(1, .3), a.getElasticInOut = function (a, b) { var c = 2 * Math.PI; return function (d) { var e = b / c * Math.asin(1 / a); return (d *= 2) < 1 ? - .5 * a * Math.pow(2, 10 * (d -= 1)) * Math.sin((d - e) * c / b) : a * Math.pow(2, -10 * (d -= 1)) * Math.sin((d - e) * c / b) * .5 + 1 } }, a.elasticInOut = a.getElasticInOut(1, .3 * 1.5), createjs.Ease = a } (), this.createjs = this.createjs || {}, function () { var a = function (a, b, c) { this.initialize(a, b, c) }, b = a.prototype = new createjs.EventDispatcher; a.NONE = 0, a.LOOP = 1, a.REVERSE = 2, a.IGNORE = {}, a._tweens = [], a._plugins = {}, a.get = function (b, c, d, e) { return e && a.removeTweens(b), new a(b, c, d) }, a.tick = function (b, c) { for (var d = a._tweens.slice(), e = d.length - 1; e >= 0; e--) { var f = d[e]; c && !f.ignoreGlobalPause || f._paused || f.tick(f._useTicks ? 1 : b) } }, a.handleEvent = function (a) { "tick" == a.type && this.tick(a.delta, a.paused) }, a.removeTweens = function (b) { if (b.tweenjs_count) { for (var c = a._tweens, d = c.length - 1; d >= 0; d--) c[d]._target == b && (c[d]._paused = !0, c.splice(d, 1)); b.tweenjs_count = 0 } }, a.removeAllTweens = function () { for (var b = a._tweens, c = 0, d = b.length; d > c; c++) { var e = b[c]; e.paused = !0, e.target.tweenjs_count = 0 } b.length = 0 }, a.hasActiveTweens = function (b) { return b ? b.tweenjs_count : a._tweens && !!a._tweens.length }, a.installPlugin = function (b, c) { var d = b.priority; null == d && (b.priority = d = 0); for (var e = 0, f = c.length, g = a._plugins; f > e; e++) { var h = c[e]; if (g[h]) { for (var i = g[h], j = 0, k = i.length; k > j && !(d < i[j].priority); j++); g[h].splice(j, 0, b) } else g[h] = [b] } }, a._register = function (b, c) { var d = b._target, e = a._tweens; if (c) d && (d.tweenjs_count = d.tweenjs_count ? d.tweenjs_count + 1 : 1), e.push(b), !a._inited && createjs.Ticker && (createjs.Ticker.addEventListener("tick", a), a._inited = !0); else { d && d.tweenjs_count--; for (var f = e.length; f--; ) if (e[f] == b) return void e.splice(f, 1) } }, b.ignoreGlobalPause = !1, b.loop = !1, b.duration = 0, b.pluginData = null, b.target = null, b.position = null, b.passive = !1, b._paused = !1, b._curQueueProps = null, b._initQueueProps = null, b._steps = null, b._actions = null, b._prevPosition = 0, b._stepPosition = 0, b._prevPos = -1, b._target = null, b._useTicks = !1, b._inited = !1, b.initialize = function (b, c, d) { this.target = this._target = b, c && (this._useTicks = c.useTicks, this.ignoreGlobalPause = c.ignoreGlobalPause, this.loop = c.loop, c.onChange && this.addEventListener("change", c.onChange), c.override && a.removeTweens(b)), this.pluginData = d || {}, this._curQueueProps = {}, this._initQueueProps = {}, this._steps = [], this._actions = [], c && c.paused ? this._paused = !0 : a._register(this, !0), c && null != c.position && this.setPosition(c.position, a.NONE) }, b.wait = function (a, b) { if (null == a || 0 >= a) return this; var c = this._cloneProps(this._curQueueProps); return this._addStep({ d: a, p0: c, e: this._linearEase, p1: c, v: b }) }, b.to = function (a, b, c) { return (isNaN(b) || 0 > b) && (b = 0), this._addStep({ d: b || 0, p0: this._cloneProps(this._curQueueProps), e: c, p1: this._cloneProps(this._appendQueueProps(a)) }) }, b.call = function (a, b, c) { return this._addAction({ f: a, p: b ? b : [this], o: c ? c : this._target }) }, b.set = function (a, b) { return this._addAction({ f: this._set, o: this, p: [a, b ? b : this._target] }) }, b.play = function (a) { return a || (a = this), this.call(a.setPaused, [!1], a) }, b.pause = function (a) { return a || (a = this), this.call(a.setPaused, [!0], a) }, b.setPosition = function (a, b) { 0 > a && (a = 0), null == b && (b = 1); var c = a, d = !1; if (c >= this.duration && (this.loop ? c %= this.duration : (c = this.duration, d = !0)), c == this._prevPos) return d; var e = this._prevPos; if (this.position = this._prevPos = c, this._prevPosition = a, this._target) if (d) this._updateTargetProps(null, 1); else if (this._steps.length > 0) { for (var f = 0, g = this._steps.length; g > f && !(this._steps[f].t > c); f++); var h = this._steps[f - 1]; this._updateTargetProps(h, (this._stepPosition = c - h.t) / h.d) } return 0 != b && this._actions.length > 0 && (this._useTicks ? this._runActions(c, c) : 1 == b && e > c ? (e != this.duration && this._runActions(e, this.duration), this._runActions(0, c, !0)) : this._runActions(e, c)), d && this.setPaused(!0), this.dispatchEvent("change"), d }, b.tick = function (a) { this._paused || this.setPosition(this._prevPosition + a) }, b.setPaused = function (b) { return this._paused = !!b, a._register(this, !b), this }, b.w = b.wait, b.t = b.to, b.c = b.call, b.s = b.set, b.toString = function () { return "[Tween]" }, b.clone = function () { throw "Tween can not be cloned." }, b._updateTargetProps = function (b, c) { var d, e, f, g, h, i; if (b || 1 != c) { if (this.passive = !!b.v, this.passive) return; b.e && (c = b.e(c, 0, 1, 1)), d = b.p0, e = b.p1 } else this.passive = !1, d = e = this._curQueueProps; for (var j in this._initQueueProps) { null == (g = d[j]) && (d[j] = g = this._initQueueProps[j]), null == (h = e[j]) && (e[j] = h = g), f = g == h || 0 == c || 1 == c || "number" != typeof g ? 1 == c ? h : g : g + (h - g) * c; var k = !1; if (i = a._plugins[j]) for (var l = 0, m = i.length; m > l; l++) { var n = i[l].tween(this, j, f, d, e, c, !!b && d == e, !b); n == a.IGNORE ? k = !0 : f = n } k || (this._target[j] = f) } }, b._runActions = function (a, b, c) { var d = a, e = b, f = -1, g = this._actions.length, h = 1; for (a > b && (d = b, e = a, f = g, g = h = -1); (f += h) != g; ) { var i = this._actions[f], j = i.t; (j == e || j > d && e > j || c && j == a) && i.f.apply(i.o, i.p) } }, b._appendQueueProps = function (b) { var c, d, e, f, g; for (var h in b) if (void 0 === this._initQueueProps[h]) { if (d = this._target[h], c = a._plugins[h]) for (e = 0, f = c.length; f > e; e++) d = c[e].init(this, h, d); this._initQueueProps[h] = this._curQueueProps[h] = void 0 === d ? null : d } else d = this._curQueueProps[h]; for (var h in b) { if (d = this._curQueueProps[h], c = a._plugins[h]) for (g = g || {}, e = 0, f = c.length; f > e; e++) c[e].step && c[e].step(this, h, d, b[h], g); this._curQueueProps[h] = b[h] } return g && this._appendQueueProps(g), this._curQueueProps }, b._cloneProps = function (a) { var b = {}; for (var c in a) b[c] = a[c]; return b }, b._addStep = function (a) { return a.d > 0 && (this._steps.push(a), a.t = this.duration, this.duration += a.d), this }, b._addAction = function (a) { return a.t = this.duration, this._actions.push(a), this }, b._set = function (a, b) { for (var c in a) b[c] = a[c] }, createjs.Tween = a } (); function launchAutoDIRECTForm(t) { losjqisafe("#LOSPersonalWrapper_" + t).fadeIn("fast"), losjqisafe("#AOSliveoverlay").css("visibility", "visible"), losjqisafe("#modalBG_autoDirect").fadeIn("fast"), losjqisafe("#LOSVideo2 video").hide(); } function AOSMediaStore() { var t = {}; (this.init = function (e) { t[e] = {}; }), (this.setImageObject = function (e, i) { t[e].imageObject = i; }), (this.getImageObject = function (e) { return t[e].imageObject; }), (this.setInternalImageAsset = function (e, i) { t[e].internalImageAsset = i; }), (this.getInternalImageAsset = function (e) { return t[e].internalImageAsset; }), (this.setExplodedImages = function (e, i, s) { console.log(e + " " + i + " " + s), (t[e].explodedImages = {}), (t[e].explodedImages.numImages = i), (t[e].explodedImages.prefix = s); }), (this.getExplodedImages = function (e) { return console.log(t[e].explodedImages), t[e].explodedImages; }), (this.setImageTagConfig = function (e, i) { t[e].imageTagConfig = i; }), (this.getImageTagConfig = function (e) { return t[e].imageTagConfig; }), (this.setAssetFolder = function (e, i) { t[e].assetFolder = i; }), (this.getAssetFolder = function (e) { return t[e].assetFolder; }), (this.setLcData = function (e, i) { t[e].LcData = i; }), (this.getLcData = function (e) { return t[e].LcData; }); } function AOSMediaInterface() { (this.showExternal360Gallery = function (t) { var e = losjqisafe.AOSExternal360Gallery({ images: window.AOSMediaStore.getImageObject(t).images360 }); e && (e.show(), enableAnalytics && window.AOSAnalytics.action(t, "openGallery", "360")); }), (this.setInternal360Button = function (t) { losjqisafe(t).AOSInteriorButton({ videoId: this.apiId, x: window.AOSMediaStore.getInternalImageAsset(this.apiId) }), enableAnalytics && losjqisafe(t).click(function () { window.AOSAnalytics.action(this.apiId, "openGallery", "interior"); }); }), (this.setMain360Button = function (t) { console.log(" EXPLODED 360 BUTTON " + this.apiId); var e = window.AOSMediaStore.getExplodedImages(this.apiId), i = window.AOSAnalytics.enabled; losjqisafe(t).AOS360MainZoomButton({ numImages: e.numImages, prefix: e.prefix }), i && losjqisafe(t).click(function () { window.AOSAnalytics.action(this.apiId, "openGallery", "exploded"); }); }), (this.setExploded360Button = function (t) { console.log(" EXPLODED 360 BUTTON " + this.apiId); var e = window.AOSMediaStore.getExplodedImages(this.apiId), i = window.AOSAnalytics.enabled; losjqisafe(t).AOS360ZoomButton({ numImages: e.numImages, prefix: e.prefix }), i && losjqisafe(t).click(function () { window.AOSAnalytics.action(this.apiId, "openGallery", "exploded"); }); }), (this.setZoomGalleryButton = function (t) { for ( var e = window.AOSMediaStore.getImageObject(this.apiId), i = (window.AOSMediaStore.getImageTagConfig(this.apiId), window.AOSMediaStore.getAssetFolder(this.apiId)), s = window.AOSMediaStore.getLcData(this.apiId), o = window.AOSAnalytics.enabled, n = [], r = e.images.length, a = 0; a < r; a++ ) n.push({ smallImage: { src: e.thumbs[a], w: 160, h: 90 }, mediumImage: { src: e.images[a], w: 978, h: 550 }, largeImage: { src: e.imagesZoom[a], w: 1920, h: 1080 } }); if (imageTags) var c = new TagManager(i, imageTags); if ( (losjqisafe(t).AOSZoomButton({ videoId: self.apiId, items: n, index: n, onOpen: function () { o && losjqisafe(".pswpaos .touchcarousel-item").mouseup(function () { var t = losjqisafe("img", this).attr("src"), e = t.substring(t.lastIndexOf("/") + 1); // window.AOSAnalytics.imageClick(self.apiId, e, "zoomGallery"); }); }, onClose: function () { //o && window.AOSAnalytics.action(self.apiId, "closeGallery", "zoom"); }, afterChange: function (t) { if (o) { var e = t.largeImage.src.substring(t.largeImage.src.lastIndexOf("/") + 1); } tagConfig && c.loadTagsForImage(t.largeImage.src, document.getElementsByClassName("pswp__aosc")[0]); }, onZoom: function (t) { tagConfig && (t < 1 ? c.showTags() : c.hideTags()); }, onZoomGestureStarted: function (t) { c.hideTags(); }, onZoomGestureEnded: function (t) { t.getZoomLevel(); }, }), s.imageOverlays && s.imageOverlays.length > 0) ) for (imageOverlay in s.imageOverlays) losjqisafe(".pswp__aosc").AOSImageOverlay(imageOverlay); }); } !(function ($) { function sc_setScroll(t, e) { return { anims: [], duration: t, orgDuration: t, easing: e, startTime: getTime() }; } function sc_startScroll(t) { "object" == typeof t.pre && sc_startScroll(t.pre); for (var e = 0, i = t.anims.length; i > e; e++) { var s = t.anims[e]; s && (s[3] && s[0].stop(), s[0].animate(s[1], { complete: s[2], duration: t.duration, easing: t.easing })); } "object" == typeof t.post && sc_startScroll(t.post); } function sc_stopScroll(t, e) { "boolean" != typeof e && (e = !0), "object" == typeof t.pre && sc_stopScroll(t.pre, e); for (var i = 0, s = t.anims.length; s > i; i++) { var o = t.anims[i]; o[0].stop(!0), e && (o[0].css(o[1]), "function" == typeof o[2] && o[2]()); } "object" == typeof t.post && sc_stopScroll(t.post, e); } function sc_clearTimers(t) { return t.auto && clearTimeout(t.auto), t; } function sc_callCallbacks(t, e, i) { if (t.length) for (var s = 0, o = t.length; o > s; s++) t[s].apply(e, i); return []; } function fx_fade(t, e, i, s, o) { var n = { duration: s, easing: t.easing }; "function" == typeof o && (n.complete = o), e.animate({ opacity: i }, n); } function fx_cover(t, e, i, s, o) { var n = ms_getSizes(gi_getOldItemsNext(e.children(), s), s, !0)[0], r = ms_getSizes(i.children(), s, !0)[0], a = o ? -r : n, c = {}, l = {}; return ( (c[s.d.width] = r), (c[s.d.left] = a), (l[s.d.left] = 0), t.pre.anims.push([e, { opacity: 1 }]), t.post.anims.push([ i, l, function () { $(this).remove(); }, ]), i.css(c), t ); } function fx_uncover(t, e, i, s, o, n) { var r = ms_getSizes(gi_getNewItemsNext(e.children(), s, n), s, !0)[0], a = ms_getSizes(i.children(), s, !0)[0], c = o ? -a : r, l = {}, p = {}; return ( (l[s.d.width] = a), (l[s.d.left] = 0), (p[s.d.left] = c), t.post.anims.push([ i, p, function () { $(this).remove(); }, ]), i.css(l), t ); } function nv_showNavi(t, e, i) { if ("show" == e || "hide" == e) var s = e; else if (t.items.minimum >= e) { debug(i, "Not enough items: hiding navigation (" + e + " items, " + t.items.minimum + " needed)."); s = "hide"; } else s = "show"; var o = "show" == s ? "removeClass" : "addClass", n = cf_c("hidden", i); t.auto.button && t.auto.button[s]()[o](n), t.prev.button && t.prev.button[s]()[o](n), t.next.button && t.next.button[s]()[o](n), t.pagination.container && t.pagination.container[s]()[o](n); } function nv_enableNavi(t, e, i) { if (!t.circular && !t.infinite) { var s = ("removeClass" == e || "addClass" == e) && e, o = cf_c("disabled", i); if ((t.auto.button && s && t.auto.button[s](o), t.prev.button)) { var n = s || 0 == e ? "addClass" : "removeClass"; t.prev.button[n](o); } if (t.next.button) { n = s || e == t.items.visible ? "addClass" : "removeClass"; t.next.button[n](o); } } } function go_getObject(t, e) { return "function" == typeof e && (e = e.call(t)), void 0 === e && (e = {}), e; } function go_getNaviObject(t, e, i) { if (("string" != typeof i && (i = ""), "string" == typeof (e = go_getObject(t, e)))) { var s = cf_getKeyCode(e); e = -1 == s ? $(e) : s; } return ( "pagination" == i ? ("boolean" == typeof e && (e = { keys: e }), void 0 !== e.jquery && (e = { container: e }), "function" == typeof e.container && (e.container = e.container.call(t)), "string" == typeof e.container && (e.container = $(e.container)), "number" != typeof e.items && (e.items = !1)) : "auto" == i ? (void 0 !== e.jquery && (e = { button: e }), "boolean" == typeof e && (e = { play: e }), "number" == typeof e && (e = { pauseDuration: e }), "function" == typeof e.button && (e.button = e.button.call(t)), "string" == typeof e.button && (e.button = $(e.button))) : (void 0 !== e.jquery && (e = { button: e }), "number" == typeof e && (e = { key: e }), "function" == typeof e.button && (e.button = e.button.call(t)), "string" == typeof e.button && (e.button = $(e.button)), "string" == typeof e.key && (e.key = cf_getKeyCode(e.key))), e ); } function gn_getItemIndex(t, e, i, s, o) { if ( ("string" == typeof t && (t = isNaN(t) ? $(t) : parseInt(t)), "object" == typeof t ? (void 0 === t.jquery && (t = $(t)), -1 == (t = o.children().index(t)) && (t = 0), "boolean" != typeof i && (i = !1)) : "boolean" != typeof i && (i = !0), (t = isNaN(t) ? 0 : parseInt(t)), (e = isNaN(e) ? 0 : parseInt(e)), i && (t += s.first), (t += e), s.total > 0) ) { for (; t >= s.total;) t -= s.total; for (; 0 > t;) t += s.total; } return t; } function gn_getVisibleItemsPrev(t, e, i) { for (var s = 0, o = 0, n = i; n >= 0; n--) { var r = t.eq(n); if ((s += r.is(":visible") ? r[e.d.outerWidth](!0) : 0) > e.maxDimention) return o; 0 == n && (n = t.length), o++; } } function gn_getVisibleItemsPrevFilter(t, e, i) { return gn_getItemsPrevFilter(t, e.items.filter, e.items.visibleConf.org, i); } function gn_getScrollItemsPrevFilter(t, e, i, s) { return gn_getItemsPrevFilter(t, e.items.filter, s, i); } function gn_getItemsPrevFilter(t, e, i, s) { for (var o = 0, n = 0, r = s, a = t.length - 1; r >= 0; r--) { if (++n == a) return n; if (t.eq(r).is(e) && ++o == i) return n; 0 == r && (r = t.length); } } function gn_getVisibleOrg(t, e) { return e.items.visibleConf.org || t.children().slice(0, e.items.visible).filter(e.items.filter).length; } function gn_getVisibleItemsNext(t, e, i) { for (var s = 0, o = 0, n = i, r = t.length - 1; r >= n; n++) { var a = t.eq(n); if ((s += a.is(":visible") ? a[e.d.outerWidth](!0) : 0) > e.maxDimention) return o; if (++o == r) return o; n == r && (n = -1); } } function gn_getVisibleItemsNextTestCircular(t, e, i, s) { var o = gn_getVisibleItemsNext(t, e, i); return e.circular || (i + o > s && (o = s - i)), o; } function gn_getVisibleItemsNextFilter(t, e, i) { return gn_getItemsNextFilter(t, e.items.filter, e.items.visibleConf.org, i, e.circular); } function gn_getScrollItemsNextFilter(t, e, i, s) { return gn_getItemsNextFilter(t, e.items.filter, s + 1, i, e.circular) - 1; } function gn_getItemsNextFilter(t, e, i, s, o) { for (var n = 0, r = 0, a = s, c = t.length - 1; c >= a; a++) { if (++r == c) return r; if (t.eq(a).is(e) && ++n == i) return r; a == c && (a = -1); } } function gi_getCurrentItems(t, e) { return t.slice(0, e.items.visible); } function gi_getOldItemsPrev(t, e, i) { return t.slice(i, e.items.visibleConf.old + i); } function gi_getNewItemsPrev(t, e) { return t.slice(0, e.items.visible); } function gi_getOldItemsNext(t, e) { return t.slice(0, e.items.visibleConf.old); } function gi_getNewItemsNext(t, e, i) { return t.slice(i, e.items.visible + i); } function sz_resetMargin(t, e, i) { var s = "boolean" == typeof i && i; "number" != typeof i && (i = 0), t.each(function () { var t = $(this), o = parseInt(t.css(e.d.marginRight)); isNaN(o) && (o = 0), t.data("cfs_tempCssMargin", o), t.css(e.d.marginRight, s ? t.data("cfs_tempCssMargin") : i + t.data("cfs_origCssMargin")); }); } function sz_setSizes(t, e, i) { var s = t.parent(), o = t.children(), n = gi_getCurrentItems(o, e), r = cf_mapWrapperSizes(ms_getSizes(n, e, !0), e, i); if ((s.css(r), e.usePadding)) { var a = (i = e.padding)[e.d[1]]; e.align && 0 > a && (a = 0); var c = n.last(); c.css(e.d.marginRight, c.data("cfs_origCssMargin") + a), t.css(e.d.top, i[e.d[0]]), t.css(e.d.left, i[e.d[3]]); } return t.css(e.d.width, r[e.d.width] + 2 * ms_getTotalSize(o, e, "width")), t.css(e.d.height, ms_getLargestSize(o, e, "height")), r; } function ms_getSizes(t, e, i) { return [ms_getTotalSize(t, e, "width", i), ms_getLargestSize(t, e, "height", i)]; } function ms_getLargestSize(t, e, i, s) { return ( "boolean" != typeof s && (s = !1), "number" == typeof e[e.d[i]] && s ? e[e.d[i]] : "number" == typeof e.items[e.d[i]] ? e.items[e.d[i]] : ms_getTrueLargestSize(t, e, i.toLowerCase().indexOf("width") > -1 ? "outerWidth" : "outerHeight") ); } function ms_getTrueLargestSize(t, e, i) { for (var s = 0, o = 0, n = t.length; n > o; o++) { var r = t.eq(o), a = r.is(":visible") ? r[e.d[i]](!0) : 0; a > s && (s = a); } return s; } function ms_getTrueInnerSize(t, e, i) { if (!t.is(":visible")) return 0; for (var s = t[e.d[i]](), o = e.d[i].toLowerCase().indexOf("width") > -1 ? ["paddingLeft", "paddingRight"] : ["paddingTop", "paddingBottom"], n = 0, r = o.length; r > n; n++) { var a = parseInt(t.css(o[n])); s -= isNaN(a) ? 0 : a; } return s; } function ms_getTotalSize(t, e, i, s) { if (("boolean" != typeof s && (s = !1), "number" == typeof e[e.d[i]] && s)) return e[e.d[i]]; if ("number" == typeof e.items[e.d[i]]) return e.items[e.d[i]] * t.length; for (var o = i.toLowerCase().indexOf("width") > -1 ? "outerWidth" : "outerHeight", n = 0, r = 0, a = t.length; a > r; r++) { var c = t.eq(r); n += c.is(":visible") ? c[e.d[o]](!0) : 0; } return n; } function ms_hasVariableSizes(t, e, i) { for (var s = !1, o = !1, n = 0, r = t.length; r > n; n++) { var a = t.eq(n), c = a.is(":visible") ? a[e.d[i]](!0) : 0; !1 === s ? (s = c) : s != c && (o = !0), 0 == s && (o = !0); } return o; } function ms_getPaddingBorderMargin(t, e, i) { return t[e.d["outer" + i]](!0) - ms_getTrueInnerSize(t, e, "inner" + i); } function ms_isPercentage(t) { return "string" == typeof t && "%" == t.slice(-1); } function ms_getPercentage(t, e) { if (ms_isPercentage(e)) { if (((e = e.slice(0, -1)), isNaN(e))) return t; t *= e / 100; } return t; } function cf_e(t, e, i, s, o) { return "boolean" != typeof i && (i = !0), "boolean" != typeof s && (s = !0), "boolean" != typeof o && (o = !1), i && (t = e.events.prefix + t), s && (t = t + "." + e.events.namespace), s && o && (t += e.serialNumber), t; } function cf_c(t, e) { return "string" == typeof e.classnames[t] ? e.classnames[t] : t; } function cf_mapWrapperSizes(t, e, i) { "boolean" != typeof i && (i = !0); var s = e.usePadding && i ? e.padding : [0, 0, 0, 0], o = {}; return (o[e.d.width] = t[0] + s[1] + s[3]), (o[e.d.height] = t[1] + s[0] + s[2]), o; } function cf_sortParams(t, e) { for (var i = [], s = 0, o = t.length; o > s; s++) for (var n = 0, r = e.length; r > n; n++) if (e[n].indexOf(typeof t[s]) > -1 && void 0 === i[n]) { i[n] = t[s]; break; } return i; } function cf_getPadding(t) { if (void 0 === t) return [0, 0, 0, 0]; if ("number" == typeof t) return [t, t, t, t]; if (("string" == typeof t && (t = t.split("px").join("").split("em").join("").split(" ")), !is_array(t))) return [0, 0, 0, 0]; for (var e = 0; 4 > e; e++) t[e] = parseInt(t[e]); switch (t.length) { case 0: return [0, 0, 0, 0]; case 1: return [t[0], t[0], t[0], t[0]]; case 2: return [t[0], t[1], t[0], t[1]]; case 3: return [t[0], t[1], t[2], t[1]]; default: return [t[0], t[1], t[2], t[3]]; } } function cf_getAlignPadding(t, e) { var i = "number" == typeof e[e.d.width] ? Math.ceil(e[e.d.width] - ms_getTotalSize(t, e, "width")) : 0; switch (e.align) { case "left": return [0, i]; case "right": return [i, 0]; case "center": default: return [Math.ceil(i / 2), Math.floor(i / 2)]; } } function cf_getAdjust(t, e, i, s) { var o = t; if ("function" == typeof i) o = i.call(s, o); else if ("string" == typeof i) { var n = i.split("+"), r = i.split("-"); if (r.length > n.length) var a = !0, c = r[0], l = r[1]; else (a = !1), (c = n[0]), (l = n[1]); switch (c) { case "even": o = t % 2 == 1 ? t - 1 : t; break; case "odd": o = t % 2 == 0 ? t - 1 : t; break; default: o = t; } (l = parseInt(l)), isNaN(l) || (a && (l = -l), (o += l)); } return "number" != typeof o && (o = 1), 1 > o && (o = 1), o; } function cf_getItemsAdjust(t, e, i, s) { return cf_getItemAdjustMinMax(cf_getAdjust(t, e, i, s), e.items.visibleConf); } function cf_getItemAdjustMinMax(t, e) { return "number" == typeof e.min && t < e.min && (t = e.min), "number" == typeof e.max && t > e.max && (t = e.max), 1 > t && (t = 1), t; } function cf_getSynchArr(t) { is_array(t) || (t = [[t]]), is_array(t[0]) || (t = [t]); for (var e = 0, i = t.length; i > e; e++) "string" == typeof t[e][0] && (t[e][0] = $(t[e][0])), "boolean" != typeof t[e][1] && (t[e][1] = !0), "boolean" != typeof t[e][2] && (t[e][2] = !0), "number" != typeof t[e][3] && (t[e][3] = 0); return t; } function cf_getKeyCode(t) { return "right" == t ? 39 : "left" == t ? 37 : "up" == t ? 38 : "down" == t ? 40 : -1; } function cf_setCookie(t, e) { t && (document.cookie = t + "=" + e + "; path=/"); } function cf_readCookie(t) { t += "="; for (var e = document.cookie.split(";"), i = 0, s = e.length; s > i; i++) { for (var o = e[i]; " " == o.charAt(0);) o = o.slice(1); if (0 == o.indexOf(t)) return o.slice(t.length); } return 0; } function bt_pauseOnHoverConfig(t) { if (t && "string" == typeof t) var e = t.indexOf("immediate") > -1, i = t.indexOf("resume") > -1; else e = i = !1; return [e, i]; } function bt_mousesheelNumber(t) { return "number" == typeof t ? t : null; } function is_array(t) { return "object" == typeof t && t instanceof Array; } function getTime() { return new Date().getTime(); } function debug(t, e) { if ("object" == typeof t) { var i = " (" + t.selector + ")"; t = t.debug; } else i = ""; return !!t && ((e = "string" == typeof e ? "carouFredSel" + i + ": " + e : ["carouFredSel" + i + ":", e]), !1); } $.fn.carouFredSel || (($.fn.carouFredSel = function (options, configs) { if (0 == this.length) return debug(!0, 'No element found for "' + this.selector + '".'), this; if (this.length > 1) return this.each(function () { $(this).carouFredSel(options, configs); }); $(this).show(); var $cfs = this, $tt0 = this[0]; if ($cfs.data("cfs_isCarousel")) { var starting_position = $cfs.triggerHandler("_cfs_currentPosition"); $cfs.trigger("_cfs_destroy", !0); } else var starting_position = !1; ($cfs._cfs_init = function (t, e, i) { (t = go_getObject($tt0, t)).debug && ((conf.debug = t.debug), debug(conf, 'The "debug" option should be moved to the second configuration-object.')); for (var s = ["items", "scroll", "auto", "prev", "next", "pagination"], o = 0, n = s.length; n > o; o++) t[s[o]] = go_getObject($tt0, t[s[o]]); "number" == typeof t.scroll ? (t.scroll <= 50 ? (t.scroll = { items: t.scroll }) : (t.scroll = { duration: t.scroll })) : "string" == typeof t.scroll && (t.scroll = { easing: t.scroll }), "number" == typeof t.items ? (t.items = { visible: t.items }) : "variable" == t.items && (t.items = { visible: t.items, width: t.items, height: t.items }), "object" != typeof t.items && (t.items = {}), e && (opts_orig = $.extend(!0, {}, $.fn.carouFredSel.defaults, t)), "object" != typeof (opts = $.extend(!0, {}, $.fn.carouFredSel.defaults, t)).items.visibleConf && (opts.items.visibleConf = {}), 0 == opts.items.start && "number" == typeof i && (opts.items.start = i), (crsl.upDateOnWindowResize = opts.responsive), (crsl.direction = "up" == opts.direction || "left" == opts.direction ? "next" : "prev"); var r = [ ["width", "innerWidth", "outerWidth", "height", "innerHeight", "outerHeight", "left", "top", "marginRight", 0, 1, 2, 3], ["height", "innerHeight", "outerHeight", "width", "innerWidth", "outerWidth", "top", "left", "marginBottom", 3, 2, 1, 0], ], a = r[0].length, c = "right" == opts.direction || "left" == opts.direction ? 0 : 1; opts.d = {}; for (var l = 0; a > l; l++) opts.d[r[0][l]] = r[c][l]; var p = $cfs.children(); switch (typeof opts.items.visible) { case "object": (opts.items.visibleConf.min = opts.items.visible.min), (opts.items.visibleConf.max = opts.items.visible.max), (opts.items.visible = !1); break; case "string": "variable" == opts.items.visible ? (opts.items.visibleConf.variable = !0) : (opts.items.visibleConf.adjust = opts.items.visible), (opts.items.visible = !1); break; case "function": (opts.items.visibleConf.adjust = opts.items.visible), (opts.items.visible = !1); } if ( (void 0 === opts.items.filter && (opts.items.filter = p.filter(":hidden").length > 0 ? ":visible" : "*"), "auto" == opts[opts.d.width] && (opts[opts.d.width] = ms_getTrueLargestSize(p, opts, "outerWidth")), ms_isPercentage(opts[opts.d.width]) && !opts.responsive && ((opts[opts.d.width] = ms_getPercentage(ms_getTrueInnerSize($wrp.parent(), opts, "innerWidth"), opts[opts.d.width])), (crsl.upDateOnWindowResize = !0)), "auto" == opts[opts.d.height] && (opts[opts.d.height] = ms_getTrueLargestSize(p, opts, "outerHeight")), opts.items[opts.d.width] || (opts.responsive ? (debug(!0, "Set a " + opts.d.width + " for the items!"), (opts.items[opts.d.width] = ms_getTrueLargestSize(p, opts, "outerWidth"))) : (opts.items[opts.d.width] = ms_hasVariableSizes(p, opts, "outerWidth") ? "variable" : p[opts.d.outerWidth](!0))), opts.items[opts.d.height] || (opts.items[opts.d.height] = ms_hasVariableSizes(p, opts, "outerHeight") ? "variable" : p[opts.d.outerHeight](!0)), opts[opts.d.height] || (opts[opts.d.height] = opts.items[opts.d.height]), !opts.items.visible && !opts.responsive && ("variable" == opts.items[opts.d.width] && (opts.items.visibleConf.variable = !0), !opts.items.visibleConf.variable)) ) { if ("number" == typeof opts[opts.d.width]) opts.items.visible = Math.floor(opts[opts.d.width] / opts.items[opts.d.width]); else { var d = ms_getTrueInnerSize($wrp.parent(), opts, "innerWidth"); (opts.items.visible = Math.floor(d / opts.items[opts.d.width])), (opts[opts.d.width] = opts.items.visible * opts.items[opts.d.width]), opts.items.visibleConf.adjust || (opts.align = !1); } ("Infinity" == opts.items.visible || opts.items.visible < 1) && (debug(!0, 'Not a valid number of visible items: Set to "variable".'), (opts.items.visibleConf.variable = !0)); } if ( (opts[opts.d.width] || ((opts[opts.d.width] = "variable"), opts.responsive || "*" != opts.items.filter || opts.items.visibleConf.variable || "variable" == opts.items[opts.d.width] || ((opts[opts.d.width] = opts.items.visible * opts.items[opts.d.width]), (opts.align = !1))), opts.items.visibleConf.variable ? ((opts.maxDimention = "variable" == opts[opts.d.width] ? ms_getTrueInnerSize($wrp.parent(), opts, "innerWidth") : opts[opts.d.width]), !1 === opts.align && (opts[opts.d.width] = "variable"), (opts.items.visible = gn_getVisibleItemsNext(p, opts, 0))) : "*" != opts.items.filter && ((opts.items.visibleConf.org = opts.items.visible), (opts.items.visible = gn_getVisibleItemsNextFilter(p, opts, 0))), void 0 === opts.align && (opts.align = "variable" != opts[opts.d.width] && "center"), (opts.items.visible = cf_getItemsAdjust(opts.items.visible, opts, opts.items.visibleConf.adjust, $tt0)), (opts.items.visibleConf.old = opts.items.visible), (opts.usePadding = !1), opts.responsive) ) { opts.items.visibleConf.min || (opts.items.visibleConf.min = opts.items.visible), opts.items.visibleConf.max || (opts.items.visibleConf.max = opts.items.visible), (opts.align = !1), (opts.padding = [0, 0, 0, 0]); var f = $wrp.is(":visible"); f && $wrp.hide(); var u = ms_getPercentage(ms_getTrueInnerSize($wrp.parent(), opts, "innerWidth"), opts[opts.d.width]); "number" == typeof opts[opts.d.width] && u < opts[opts.d.width] && (u = opts[opts.d.width]), f && $wrp.show(); var m = cf_getItemAdjustMinMax(Math.ceil(u / opts.items[opts.d.width]), opts.items.visibleConf); m > p.length && (m = p.length); var g = Math.floor(u / m), h = opts[opts.d.height], v = ms_isPercentage(h); p.each(function () { var t = $(this), e = g - ms_getPaddingBorderMargin(t, opts, "Width"); t[opts.d.width](e), v && t[opts.d.height](ms_getPercentage(e, h)); }), (opts.items.visible = m), (opts.items[opts.d.width] = g), (opts[opts.d.width] = m * g); } else switch (((opts.padding = cf_getPadding(opts.padding)), "top" == opts.align && (opts.align = "left"), "bottom" == opts.align && (opts.align = "right"), opts.align)) { case "center": case "left": case "right": if ("variable" != opts[opts.d.width]) { var b = cf_getAlignPadding(gi_getCurrentItems(p, opts), opts); (opts.usePadding = !0), (opts.padding[opts.d[1]] = b[1]), (opts.padding[opts.d[3]] = b[0]); } break; default: (opts.align = !1), (opts.usePadding = 0 != opts.padding[0] || 0 != opts.padding[1] || 0 != opts.padding[2] || 0 != opts.padding[3]); } "boolean" == typeof opts.cookie && opts.cookie && (opts.cookie = "caroufredsel_cookie_" + $cfs.attr("id")), "number" != typeof opts.items.minimum && (opts.items.minimum = opts.items.visible), "number" != typeof opts.scroll.duration && (opts.scroll.duration = 500), void 0 === opts.scroll.items && (opts.scroll.items = opts.items.visibleConf.variable || "*" != opts.items.filter ? "visible" : opts.items.visible), (opts.auto = go_getNaviObject($tt0, opts.auto, "auto")), (opts.prev = go_getNaviObject($tt0, opts.prev)), (opts.next = go_getNaviObject($tt0, opts.next)), (opts.pagination = go_getNaviObject($tt0, opts.pagination, "pagination")), (opts.auto = $.extend(!0, {}, opts.scroll, opts.auto)), (opts.prev = $.extend(!0, {}, opts.scroll, opts.prev)), (opts.next = $.extend(!0, {}, opts.scroll, opts.next)), (opts.pagination = $.extend(!0, {}, opts.scroll, opts.pagination)), "boolean" != typeof opts.pagination.keys && (opts.pagination.keys = !1), "function" != typeof opts.pagination.anchorBuilder && !1 !== opts.pagination.anchorBuilder && (opts.pagination.anchorBuilder = $.fn.carouFredSel.pageAnchorBuilder), "boolean" != typeof opts.auto.play && (opts.auto.play = !0), "number" != typeof opts.auto.delay && (opts.auto.delay = 0), void 0 === opts.auto.pauseOnEvent && (opts.auto.pauseOnEvent = !0), "boolean" != typeof opts.auto.pauseOnResize && (opts.auto.pauseOnResize = !0), "number" != typeof opts.auto.pauseDuration && (opts.auto.pauseDuration = opts.auto.duration < 10 ? 2500 : 5 * opts.auto.duration), opts.synchronise && (opts.synchronise = cf_getSynchArr(opts.synchronise)), conf.debug && (debug(conf, "Carousel width: " + opts.width), debug(conf, "Carousel height: " + opts.height), opts.maxDimention && debug(conf, "Available " + opts.d.width + ": " + opts.maxDimention), debug(conf, "Item widths: " + opts.items.width), debug(conf, "Item heights: " + opts.items.height), debug(conf, "Number of items visible: " + opts.items.visible), opts.auto.play && debug(conf, "Number of items scrolled automatically: " + opts.auto.items), opts.prev.button && debug(conf, "Number of items scrolled backward: " + opts.prev.items), opts.next.button && debug(conf, "Number of items scrolled forward: " + opts.next.items)); }), ($cfs._cfs_build = function () { $cfs.data("cfs_isCarousel", !0); var t = { textAlign: $cfs.css("textAlign"), float: $cfs.css("float"), position: $cfs.css("position"), top: $cfs.css("top"), right: $cfs.css("right"), bottom: $cfs.css("bottom"), left: $cfs.css("left"), width: $cfs.css("width"), height: $cfs.css("height"), marginTop: $cfs.css("marginTop"), marginRight: $cfs.css("marginRight"), marginBottom: $cfs.css("marginBottom"), marginLeft: $cfs.css("marginLeft"), }; switch (t.position) { case "absolute": var e = "absolute"; break; case "fixed": e = "fixed"; break; default: e = "relative"; } $wrp.css(t).css({ overflow: "hidden", position: e }), $cfs.data("cfs_origCss", t).css({ textAlign: "left", float: "none", position: "absolute", top: 0, left: 0, marginTop: 0, marginRight: 0, marginBottom: 0, marginLeft: 0 }), opts.usePadding && $cfs.children().each(function () { var t = parseInt($(this).css(opts.d.marginRight)); isNaN(t) && (t = 0), $(this).data("cfs_origCssMargin", t); }); }), ($cfs._cfs_bind_events = function () { $cfs._cfs_unbind_events(), $cfs.bind(cf_e("stop", conf), function (t, e) { return ( t.stopPropagation(), crsl.isStopped || (opts.auto.button && opts.auto.button.addClass(cf_c("stopped", conf))), (crsl.isStopped = !0), opts.auto.play && ((opts.auto.play = !1), $cfs.trigger(cf_e("pause", conf), e)), !0 ); }), $cfs.bind(cf_e("finish", conf), function (t) { return t.stopPropagation(), crsl.isScrolling && sc_stopScroll(scrl), !0; }), $cfs.bind(cf_e("pause", conf), function (t, e, i) { if ((t.stopPropagation(), (tmrs = sc_clearTimers(tmrs)), e && crsl.isScrolling)) { scrl.isStopped = !0; var s = getTime() - scrl.startTime; (scrl.duration -= s), scrl.pre && (scrl.pre.duration -= s), scrl.post && (scrl.post.duration -= s), sc_stopScroll(scrl, !1); } if ( (crsl.isPaused || crsl.isScrolling || (i && (tmrs.timePassed += getTime() - tmrs.startTime)), crsl.isPaused || (opts.auto.button && opts.auto.button.addClass(cf_c("paused", conf))), (crsl.isPaused = !0), opts.auto.onPausePause) ) { var o = opts.auto.pauseDuration - tmrs.timePassed, n = 100 - Math.ceil((100 * o) / opts.auto.pauseDuration); opts.auto.onPausePause.call($tt0, n, o); } return !0; }), $cfs.bind(cf_e("play", conf), function (t, e, i, s) { t.stopPropagation(), (tmrs = sc_clearTimers(tmrs)); var o = cf_sortParams([e, i, s], ["string", "number", "boolean"]); (e = o[0]), (i = o[1]), (s = o[2]); if (("prev" != e && "next" != e && (e = crsl.direction), "number" != typeof i && (i = 0), "boolean" != typeof s && (s = !1), s && ((crsl.isStopped = !1), (opts.auto.play = !0)), !opts.auto.play)) return t.stopImmediatePropagation(), debug(conf, "Carousel stopped: Not scrolling."); crsl.isPaused && opts.auto.button && (opts.auto.button.removeClass(cf_c("stopped", conf)), opts.auto.button.removeClass(cf_c("paused", conf))), (crsl.isPaused = !1), (tmrs.startTime = getTime()); var n = opts.auto.pauseDuration + i; return ( (dur2 = n - tmrs.timePassed), (perc = 100 - Math.ceil((100 * dur2) / n)), (tmrs.auto = setTimeout(function () { opts.auto.onPauseEnd && opts.auto.onPauseEnd.call($tt0, perc, dur2), crsl.isScrolling ? $cfs.trigger(cf_e("play", conf), e) : $cfs.trigger(cf_e(e, conf), opts.auto); }, dur2)), opts.auto.onPauseStart && opts.auto.onPauseStart.call($tt0, perc, dur2), !0 ); }), $cfs.bind(cf_e("resume", conf), function (t) { return t.stopPropagation(), scrl.isStopped ? ((scrl.isStopped = !1), (crsl.isPaused = !1), (crsl.isScrolling = !0), (scrl.startTime = getTime()), sc_startScroll(scrl)) : $cfs.trigger(cf_e("play", conf)), !0; }), $cfs.bind(cf_e("prev", conf) + " " + cf_e("next", conf), function (t, e, i, s) { if ((t.stopPropagation(), crsl.isStopped || $cfs.is(":hidden"))) return t.stopImmediatePropagation(), debug(conf, "Carousel stopped or hidden: Not scrolling."); if (opts.items.minimum >= itms.total) return t.stopImmediatePropagation(), debug(conf, "Not enough items (" + itms.total + ", " + opts.items.minimum + " needed): Not scrolling."); (e = (r = cf_sortParams([e, i, s], ["object", "number/string", "function"]))[0]), (i = r[1]), (s = r[2]); var o = t.type.slice(conf.events.prefix.length); if ((("object" != typeof e || null == e) && (e = opts[o]), "function" == typeof s && (e.onAfter = s), "number" != typeof i)) { if ("*" != opts.items.filter) i = "visible"; else for (var n = [i, e.items, opts[o].items], r = 0, a = n.length; a > r; r++) if ("number" == typeof n[r] || "page" == n[r] || "visible" == n[r]) { i = n[r]; break; } switch (i) { case "page": return t.stopImmediatePropagation(), $cfs.triggerHandler(o + "Page", [e, s]); case "visible": opts.items.visibleConf.variable || "*" != opts.items.filter || (i = opts.items.visible); } } if (scrl.isStopped) return $cfs.trigger(cf_e("resume", conf)), $cfs.trigger(cf_e("queue", conf), [o, [e, i, s]]), t.stopImmediatePropagation(), debug(conf, "Carousel resumed scrolling."); if (e.duration > 0 && crsl.isScrolling) return e.queue && $cfs.trigger(cf_e("queue", conf), [o, [e, i, s]]), t.stopImmediatePropagation(), debug(conf, "Carousel currently scrolling."); if (e.conditions && !e.conditions.call($tt0)) return t.stopImmediatePropagation(), debug(conf, 'Callback "conditions" returned false.'); if (((tmrs.timePassed = 0), $cfs.trigger("_cfs_slide_" + o, [e, i]), opts.synchronise)) { var c = opts.synchronise, l = [e, i], p = 0; for (a = c.length; a > p; p++) { var d = o; c[p][1] || (l[0] = c[p][0].triggerHandler("_cfs_configuration", o)), c[p][2] || (d = "prev" == d ? "next" : "prev"), (l[1] = i + c[p][3]), c[p][0].trigger("_cfs_slide_" + d, l); } } return !0; }), $cfs.bind(cf_e("_cfs_slide_prev", conf, !1), function (t, e, i) { t.stopPropagation(); var s = $cfs.children(); if (!opts.circular && 0 == itms.first) return opts.infinite && $cfs.trigger(cf_e("next", conf), itms.total - 1), t.stopImmediatePropagation(); if ((opts.usePadding && sz_resetMargin(s, opts), "number" != typeof i)) { if (opts.items.visibleConf.variable) i = gn_getVisibleItemsPrev(s, opts, itms.total - 1); else if ("*" != opts.items.filter) { var o = "number" == typeof e.items ? e.items : gn_getVisibleOrg($cfs, opts); i = gn_getScrollItemsPrevFilter(s, opts, itms.total - 1, o); } else i = opts.items.visible; i = cf_getAdjust(i, opts, e.items, $tt0); } if ((opts.circular || (itms.total - i < itms.first && (i = itms.total - itms.first)), (opts.items.visibleConf.old = opts.items.visible), opts.items.visibleConf.variable)) { var n = gn_getVisibleItemsNext(s, opts, itms.total - i); opts.items.visible + i <= n && i < itms.total && (i++, (n = gn_getVisibleItemsNext(s, opts, itms.total - i))), (opts.items.visible = cf_getItemsAdjust(n, opts, opts.items.visibleConf.adjust, $tt0)); } else if ("*" != opts.items.filter) { n = gn_getVisibleItemsNextFilter(s, opts, itms.total - i); opts.items.visible = cf_getItemsAdjust(n, opts, opts.items.visibleConf.adjust, $tt0); } if ((opts.usePadding && sz_resetMargin(s, opts, !0), 0 == i)) return t.stopImmediatePropagation(), debug(conf, "0 items to scroll: Not scrolling."); for (debug(conf, "Scrolling " + i + " items backward."), itms.first += i; itms.first >= itms.total;) itms.first -= itms.total; opts.circular || (0 == itms.first && e.onEnd && e.onEnd.call($tt0), opts.infinite || nv_enableNavi(opts, itms.first, conf)), $cfs .children() .slice(itms.total - i, itms.total) .prependTo($cfs), itms.total < opts.items.visible + i && $cfs .children() .slice(0, opts.items.visible + i - itms.total) .clone(!0) .appendTo($cfs); var r = gi_getOldItemsPrev((s = $cfs.children()), opts, i), a = gi_getNewItemsPrev(s, opts), c = s.eq(i - 1), l = r.last(), p = a.last(); if ((opts.usePadding && sz_resetMargin(s, opts), opts.align)) var d = cf_getAlignPadding(a, opts), f = d[0], u = d[1]; else (f = 0), (u = 0); var m = 0 > f ? opts.padding[opts.d[3]] : 0; if ("directscroll" == e.fx && opts.items.visible < i) { var g = s.slice(opts.items.visibleConf.old, i), h = opts.items[opts.d.width]; g.each(function () { var t = $(this); t.data("isHidden", t.is(":hidden")).hide(); }), (opts.items[opts.d.width] = "variable"); } else g = !1; var v = ms_getTotalSize(s.slice(0, i), opts, "width"), b = cf_mapWrapperSizes(ms_getSizes(a, opts, !0), opts, !opts.usePadding); g && (opts.items[opts.d.width] = h), opts.usePadding && (sz_resetMargin(s, opts, !0), u >= 0 && sz_resetMargin(l, opts, opts.padding[opts.d[1]]), sz_resetMargin(c, opts, opts.padding[opts.d[3]])), opts.align && ((opts.padding[opts.d[1]] = u), (opts.padding[opts.d[3]] = f)); var _ = {}, w = e.duration; if ( ("none" == e.fx ? (w = 0) : "auto" == w ? (w = (opts.scroll.duration / opts.scroll.items) * i) : 0 >= w ? (w = 0) : 10 > w && (w = v / w), (scrl = sc_setScroll(w, e.easing)), ("variable" == opts[opts.d.width] || "variable" == opts[opts.d.height]) && scrl.anims.push([$wrp, b]), opts.usePadding) ) { var y = opts.padding[opts.d[3]]; if (p.not(c).length) { var x = {}; (x[opts.d.marginRight] = c.data("cfs_origCssMargin")), 0 > f ? c.css(x) : scrl.anims.push([c, x]); } if (p.not(l).length) { var S = {}; (S[opts.d.marginRight] = l.data("cfs_origCssMargin")), scrl.anims.push([l, S]); } if (u >= 0) { var I = {}; (I[opts.d.marginRight] = p.data("cfs_origCssMargin") + opts.padding[opts.d[1]]), scrl.anims.push([p, I]); } } else y = 0; _[opts.d.left] = y; var O = [r, a, b, w]; switch ((e.onBefore && e.onBefore.apply($tt0, O), (clbk.onBefore = sc_callCallbacks(clbk.onBefore, $tt0, O)), e.fx)) { case "fade": case "crossfade": case "cover": case "uncover": (scrl.pre = sc_setScroll(scrl.duration, scrl.easing)), (scrl.post = sc_setScroll(scrl.duration, scrl.easing)), (scrl.duration = 0); } switch (e.fx) { case "crossfade": case "cover": case "uncover": var C = $cfs.clone().appendTo($wrp); } switch (e.fx) { case "uncover": C.children().slice(0, i).remove(); case "crossfade": case "cover": C.children().slice(opts.items.visible).remove(); } switch (e.fx) { case "fade": scrl.pre.anims.push([$cfs, { opacity: 0 }]); break; case "crossfade": C.css({ opacity: 0 }), scrl.pre.anims.push([ $cfs, { width: "+=0" }, function () { C.remove(); }, ]), scrl.post.anims.push([C, { opacity: 1 }]); break; case "cover": scrl = fx_cover(scrl, $cfs, C, opts, !0); break; case "uncover": scrl = fx_uncover(scrl, $cfs, C, opts, !0, i); } return ( scrl.anims.push([ $cfs, _, function () { var t = opts.items.visible + i - itms.total; if ( (t > 0 && ($cfs.children().slice(itms.total).remove(), (r = $( $cfs .children() .slice(itms.total - (opts.items.visible - t)) .get() .concat($cfs.children().slice(0, t).get()) ))), g && g.each(function () { var t = $(this); t.data("isHidden") || t.show(); }), opts.usePadding) ) { var s = $cfs.children().eq(opts.items.visible + i - 1); s.css(opts.d.marginRight, s.data("cfs_origCssMargin")); } (scrl.anims = []), scrl.pre && (scrl.pre = sc_setScroll(scrl.orgDuration, scrl.easing)); var o = function () { switch (e.fx) { case "fade": case "crossfade": $cfs.css("filter", ""); } (scrl.post = sc_setScroll(0, null)), (crsl.isScrolling = !1); var t = [r, a, b]; e.onAfter && e.onAfter.apply($tt0, t), (clbk.onAfter = sc_callCallbacks(clbk.onAfter, $tt0, t)), queu.length && ($cfs.trigger(cf_e(queu[0][0], conf), queu[0][1]), queu.shift()), crsl.isPaused || $cfs.trigger(cf_e("play", conf)); }; switch (e.fx) { case "fade": scrl.pre.anims.push([$cfs, { opacity: 1 }, o]), sc_startScroll(scrl.pre); break; case "uncover": scrl.pre.anims.push([$cfs, { width: "+=0" }, o]), sc_startScroll(scrl.pre); break; default: o(); } }, ]), (crsl.isScrolling = !0), $cfs.css(opts.d.left, -(v - m)), (tmrs = sc_clearTimers(tmrs)), sc_startScroll(scrl), cf_setCookie(opts.cookie, $cfs.triggerHandler(cf_e("currentPosition", conf))), $cfs.trigger(cf_e("updatePageStatus", conf), [!1, b]), !0 ); }), $cfs.bind(cf_e("_cfs_slide_next", conf, !1), function (t, e, i) { t.stopPropagation(); var s = $cfs.children(); if (!opts.circular && itms.first == opts.items.visible) return opts.infinite && $cfs.trigger(cf_e("prev", conf), itms.total - 1), t.stopImmediatePropagation(); if ((opts.usePadding && sz_resetMargin(s, opts), "number" != typeof i)) { if ("*" != opts.items.filter) { var o = "number" == typeof e.items ? e.items : gn_getVisibleOrg($cfs, opts); i = gn_getScrollItemsNextFilter(s, opts, 0, o); } else i = opts.items.visible; i = cf_getAdjust(i, opts, e.items, $tt0); } var n = 0 == itms.first ? itms.total : itms.first; if (!opts.circular) { if (opts.items.visibleConf.variable) { var r = gn_getVisibleItemsNext(s, opts, i); o = gn_getVisibleItemsPrev(s, opts, n - 1); } else (r = opts.items.visible), (o = opts.items.visible); i + r > n && (i = n - o); } if (((opts.items.visibleConf.old = opts.items.visible), opts.items.visibleConf.variable)) { for (r = gn_getVisibleItemsNextTestCircular(s, opts, i, n); opts.items.visible - i >= r && i < itms.total;) r = gn_getVisibleItemsNextTestCircular(s, opts, ++i, n); opts.items.visible = cf_getItemsAdjust(r, opts, opts.items.visibleConf.adjust, $tt0); } else if ("*" != opts.items.filter) { r = gn_getVisibleItemsNextFilter(s, opts, i); opts.items.visible = cf_getItemsAdjust(r, opts, opts.items.visibleConf.adjust, $tt0); } if ((opts.usePadding && sz_resetMargin(s, opts, !0), 0 == i)) return t.stopImmediatePropagation(), debug(conf, "0 items to scroll: Not scrolling."); for (debug(conf, "Scrolling " + i + " items forward."), itms.first -= i; itms.first < 0;) itms.first += itms.total; opts.circular || (itms.first == opts.items.visible && e.onEnd && e.onEnd.call($tt0), opts.infinite || nv_enableNavi(opts, itms.first, conf)), itms.total < opts.items.visible + i && $cfs .children() .slice(0, opts.items.visible + i - itms.total) .clone(!0) .appendTo($cfs); var a = gi_getOldItemsNext((s = $cfs.children()), opts), c = gi_getNewItemsNext(s, opts, i), l = s.eq(i - 1), p = a.last(), d = c.last(); if ((opts.usePadding && sz_resetMargin(s, opts), opts.align)) var f = cf_getAlignPadding(c, opts), u = f[0], m = f[1]; else (u = 0), (m = 0); if ("directscroll" == e.fx && opts.items.visibleConf.old < i) { var g = s.slice(opts.items.visibleConf.old, i), h = opts.items[opts.d.width]; g.each(function () { var t = $(this); t.data("isHidden", t.is(":hidden")).hide(); }), (opts.items[opts.d.width] = "variable"); } else g = !1; var v = ms_getTotalSize(s.slice(0, i), opts, "width"), b = cf_mapWrapperSizes(ms_getSizes(c, opts, !0), opts, !opts.usePadding); g && (opts.items[opts.d.width] = h), opts.align && opts.padding[opts.d[1]] < 0 && (opts.padding[opts.d[1]] = 0), opts.usePadding && (sz_resetMargin(s, opts, !0), sz_resetMargin(p, opts, opts.padding[opts.d[1]])), opts.align && ((opts.padding[opts.d[1]] = m), (opts.padding[opts.d[3]] = u)); var _ = {}, w = e.duration; if ( ("none" == e.fx ? (w = 0) : "auto" == w ? (w = (opts.scroll.duration / opts.scroll.items) * i) : 0 >= w ? (w = 0) : 10 > w && (w = v / w), (scrl = sc_setScroll(w, e.easing)), ("variable" == opts[opts.d.width] || "variable" == opts[opts.d.height]) && scrl.anims.push([$wrp, b]), opts.usePadding) ) { var y = d.data("cfs_origCssMargin"); if ((m >= 0 && (y += opts.padding[opts.d[1]]), d.css(opts.d.marginRight, y), l.not(p).length)) { var x = {}; (x[opts.d.marginRight] = p.data("cfs_origCssMargin")), scrl.anims.push([p, x]); } var S = l.data("cfs_origCssMargin"); u >= 0 && (S += opts.padding[opts.d[3]]); var I = {}; (I[opts.d.marginRight] = S), scrl.anims.push([l, I]); } (_[opts.d.left] = -v), 0 > u && (_[opts.d.left] += u); var O = [a, c, b, w]; switch ((e.onBefore && e.onBefore.apply($tt0, O), (clbk.onBefore = sc_callCallbacks(clbk.onBefore, $tt0, O)), e.fx)) { case "fade": case "crossfade": case "cover": case "uncover": (scrl.pre = sc_setScroll(scrl.duration, scrl.easing)), (scrl.post = sc_setScroll(scrl.duration, scrl.easing)), (scrl.duration = 0); } switch (e.fx) { case "crossfade": case "cover": case "uncover": var C = $cfs.clone().appendTo($wrp); } switch (e.fx) { case "uncover": C.children().slice(opts.items.visibleConf.old).remove(); break; case "crossfade": case "cover": C.children().slice(0, i).remove(), C.children().slice(opts.items.visible).remove(); } switch (e.fx) { case "fade": scrl.pre.anims.push([$cfs, { opacity: 0 }]); break; case "crossfade": C.css({ opacity: 0 }), scrl.pre.anims.push([ $cfs, { width: "+=0" }, function () { C.remove(); }, ]), scrl.post.anims.push([C, { opacity: 1 }]); break; case "cover": scrl = fx_cover(scrl, $cfs, C, opts, !1); break; case "uncover": scrl = fx_uncover(scrl, $cfs, C, opts, !1, i); } return ( scrl.anims.push([ $cfs, _, function () { var t = opts.items.visible + i - itms.total, o = opts.usePadding ? opts.padding[opts.d[3]] : 0; $cfs.css(opts.d.left, o), t > 0 && $cfs.children().slice(itms.total).remove(); var n = $cfs.children().slice(0, i).appendTo($cfs).last(); if ( (t > 0 && (c = gi_getCurrentItems(s, opts)), g && g.each(function () { var t = $(this); t.data("isHidden") || t.show(); }), opts.usePadding) ) { if (itms.total < opts.items.visible + i) { var r = $cfs.children().eq(opts.items.visible - 1); r.css(opts.d.marginRight, r.data("cfs_origCssMargin") + opts.padding[opts.d[3]]); } n.css(opts.d.marginRight, n.data("cfs_origCssMargin")); } (scrl.anims = []), scrl.pre && (scrl.pre = sc_setScroll(scrl.orgDuration, scrl.easing)); var l = function () { switch (e.fx) { case "fade": case "crossfade": $cfs.css("filter", ""); } (scrl.post = sc_setScroll(0, null)), (crsl.isScrolling = !1); var t = [a, c, b]; e.onAfter && e.onAfter.apply($tt0, t), (clbk.onAfter = sc_callCallbacks(clbk.onAfter, $tt0, t)), queu.length && ($cfs.trigger(cf_e(queu[0][0], conf), queu[0][1]), queu.shift()), crsl.isPaused || $cfs.trigger(cf_e("play", conf)); }; switch (e.fx) { case "fade": scrl.pre.anims.push([$cfs, { opacity: 1 }, l]), sc_startScroll(scrl.pre); break; case "uncover": scrl.pre.anims.push([$cfs, { width: "+=0" }, l]), sc_startScroll(scrl.pre); break; default: l(); } }, ]), (crsl.isScrolling = !0), (tmrs = sc_clearTimers(tmrs)), sc_startScroll(scrl), cf_setCookie(opts.cookie, $cfs.triggerHandler(cf_e("currentPosition", conf))), $cfs.trigger(cf_e("updatePageStatus", conf), [!1, b]), !0 ); }), $cfs.bind(cf_e("slideTo", conf), function (t, e, i, s, o, n, r) { t.stopPropagation(); var a = cf_sortParams([e, i, s, o, n, r], ["string/number/object", "number", "boolean", "object", "string", "function"]); (o = a[3]), (n = a[4]), (r = a[5]); return 0 != (e = gn_getItemIndex(a[0], a[1], a[2], itms, $cfs)) ? ("object" != typeof o && (o = !1), !( (crsl.isScrolling && ("object" != typeof o || o.duration > 0)) || ("prev" != n && "next" != n && (n = opts.circular ? (e <= itms.total / 2 ? "next" : "prev") : 0 == itms.first || itms.first > e ? "next" : "prev"), "prev" == n && (e = itms.total - e), $cfs.trigger(cf_e(n, conf), [o, e, r]), 0) )) : void 0; }), $cfs.bind(cf_e("prevPage", conf), function (t, e, i) { t.stopPropagation(); var s = $cfs.triggerHandler(cf_e("currentPage", conf)); return $cfs.triggerHandler(cf_e("slideToPage", conf), [s - 1, e, "prev", i]); }), $cfs.bind(cf_e("nextPage", conf), function (t, e, i) { t.stopPropagation(); var s = $cfs.triggerHandler(cf_e("currentPage", conf)); return $cfs.triggerHandler(cf_e("slideToPage", conf), [s + 1, e, "next", i]); }), $cfs.bind(cf_e("slideToPage", conf), function (t, e, i, s, o) { t.stopPropagation(), "number" != typeof e && (e = $cfs.triggerHandler(cf_e("currentPage", conf))); var n = opts.pagination.items || opts.items.visible, r = Math.ceil(itms.total / n) - 1; return 0 > e && (e = r), e > r && (e = 0), $cfs.triggerHandler(cf_e("slideTo", conf), [e * n, 0, !0, i, s, o]); }), $cfs.bind(cf_e("jumpToStart", conf), function (t, e) { if ((t.stopPropagation(), (e = e ? gn_getItemIndex(e, 0, !0, itms, $cfs) : 0), 0 != (e += itms.first))) { for (; e > itms.total;) e -= itms.total; $cfs.prepend($cfs.children().slice(e, itms.total)); } return !0; }), $cfs.bind(cf_e("synchronise", conf), function (t, e) { if ((t.stopPropagation(), e)) e = cf_getSynchArr(e); else { if (!opts.synchronise) return debug(conf, "No carousel to synchronise."); e = opts.synchronise; } for (var i = $cfs.triggerHandler(cf_e("currentPosition", conf)), s = !0, o = 0, n = e.length; n > o; o++) e[o][0].triggerHandler(cf_e("slideTo", conf), [i, e[o][3], !0]) || (s = !1); return s; }), $cfs.bind(cf_e("queue", conf), function (t, e, i) { return t.stopPropagation(), "function" == typeof e ? e.call($tt0, queu) : is_array(e) ? (queu = e) : void 0 !== e && queu.push([e, i]), queu; }), $cfs.bind(cf_e("insertItem", conf), function (t, e, i, s, o) { t.stopPropagation(); var n = cf_sortParams([e, i, s, o], ["string/object", "string/number/object", "boolean", "number"]); (e = n[0]), (i = n[1]), (s = n[2]), (o = n[3]); if (("object" == typeof e && void 0 === e.jquery && (e = $(e)), "string" == typeof e && (e = $(e)), "object" != typeof e || void 0 === e.jquery || 0 == e.length)) return debug(conf, "Not a valid object."); void 0 === i && (i = "end"), opts.usePadding && e.each(function () { var t = parseInt($(this).css(opts.d.marginRight)); isNaN(t) && (t = 0), $(this).data("cfs_origCssMargin", t); }); var r = i, a = "before"; "end" == i ? s ? (0 == itms.first ? ((i = itms.total - 1), (a = "after")) : ((i = itms.first), (itms.first += e.length)), 0 > i && (i = 0)) : ((i = itms.total - 1), (a = "after")) : (i = gn_getItemIndex(i, o, s, itms, $cfs)), "end" == r || s || (i < itms.first && (itms.first += e.length)), itms.first >= itms.total && (itms.first -= itms.total); var c = $cfs.children().eq(i); c.length ? c[a](e) : $cfs.append(e), (itms.total = $cfs.children().length); var l = $cfs.triggerHandler("updateSizes"); return nv_showNavi(opts, itms.total, conf), nv_enableNavi(opts, itms.first, conf), $cfs.trigger(cf_e("linkAnchors", conf)), $cfs.trigger(cf_e("updatePageStatus", conf), [!0, l]), !0; }), $cfs.bind(cf_e("removeItem", conf), function (t, e, i, s) { t.stopPropagation(); var o = cf_sortParams([e, i, s], ["string/number/object", "boolean", "number"]); (e = o[0]), (i = o[1]), (s = o[2]); if (void 0 === e || "end" == e) $cfs.children().last().remove(); else { e = gn_getItemIndex(e, s, i, itms, $cfs); var n = $cfs.children().eq(e); n.length && (e < itms.first && (itms.first -= n.length), n.remove()); } itms.total = $cfs.children().length; var r = $cfs.triggerHandler("updateSizes"); return nv_showNavi(opts, itms.total, conf), nv_enableNavi(opts, itms.first, conf), $cfs.trigger(cf_e("updatePageStatus", conf), [!0, r]), !0; }), $cfs.bind(cf_e("onBefore", conf) + " " + cf_e("onAfter", conf), function (t, e) { t.stopPropagation(); var i = t.type.slice(conf.events.prefix.length); return is_array(e) && (clbk[i] = e), "function" == typeof e && clbk[i].push(e), clbk[i]; }), $cfs.bind(cf_e("_cfs_currentPosition", conf, !1), function (t, e) { return t.stopPropagation(), $cfs.triggerHandler(cf_e("currentPosition", conf), e); }), $cfs.bind(cf_e("currentPosition", conf), function (t, e) { if ((t.stopPropagation(), 0 == itms.first)) var i = 0; else i = itms.total - itms.first; return "function" == typeof e && e.call($tt0, i), i; }), $cfs.bind(cf_e("currentPage", conf), function (t, e) { t.stopPropagation(); var i = opts.pagination.items || opts.items.visible, s = Math.ceil(itms.total / i - 1); if (0 == itms.first) var o = 0; else if (itms.first < itms.total % i) o = 0; else if (itms.first != i || opts.circular) o = Math.round((itms.total - itms.first) / i); else o = s; return 0 > o && (o = 0), o > s && (o = s), "function" == typeof e && e.call($tt0, o), o; }), $cfs.bind(cf_e("currentVisible", conf), function (t, e) { return t.stopPropagation(), ($i = gi_getCurrentItems($cfs.children(), opts)), "function" == typeof e && e.call($tt0, $i), $i; }), $cfs.bind(cf_e("slice", conf), function (t, e, i, s) { t.stopPropagation(); var o = cf_sortParams([e, i, s], ["number", "number", "function"]); for (e = "number" == typeof o[0] ? o[0] : 0, i = "number" == typeof o[1] ? o[1] : itms.total, s = o[2], e += itms.first, i += itms.first; e > itms.total;) e -= itms.total; for (; i > itms.total;) i -= itms.total; for (; 0 > e;) e += itms.total; for (; 0 > i;) i += itms.total; var n = $cfs.children(); if (i > e) var r = n.slice(e, i); else r = $(n.slice(e, itms.total).get().concat(n.slice(0, i).get())); return "function" == typeof s && s.call($tt0, r), r; }), $cfs.bind(cf_e("isPaused", conf) + " " + cf_e("isStopped", conf) + " " + cf_e("isScrolling", conf), function (t, e) { t.stopPropagation(); var i = t.type.slice(conf.events.prefix.length); return "function" == typeof e && e.call($tt0, crsl[i]), crsl[i]; }), $cfs.bind(cf_e("_cfs_configuration", conf, !1), function (t, e, i, s) { return t.stopPropagation(), $cfs.triggerHandler(cf_e("configuration", conf), [e, i, s]); }), $cfs.bind(cf_e("configuration", conf), function (e, a, b, c) { e.stopPropagation(); var reInit = !1; if ("function" == typeof a) a.call($tt0, opts); else if ("object" == typeof a) (opts_orig = $.extend(!0, {}, opts_orig, a)), !1 !== b ? (reInit = !0) : (opts = $.extend(!0, {}, opts, a)); else if (void 0 !== a) if ("function" == typeof b) { var val = eval("opts." + a); void 0 === val && (val = ""), b.call($tt0, val); } else { if (void 0 === b) return eval("opts." + a); "boolean" != typeof c && (c = !0), eval("opts_orig." + a + " = b"), !1 !== c ? (reInit = !0) : eval("opts." + a + " = b"); } if (reInit) { sz_resetMargin($cfs.children(), opts), $cfs._cfs_init(opts_orig), $cfs._cfs_bind_buttons(); var siz = sz_setSizes($cfs, opts, !1); $cfs.trigger(cf_e("updatePageStatus", conf), [!0, siz]); } return opts; }), $cfs.bind(cf_e("linkAnchors", conf), function (t, e, i) { return ( t.stopPropagation(), void 0 === e || 0 == e.length ? (e = $("body")) : "string" == typeof e && (e = $(e)), "object" != typeof e ? debug(conf, "Not a valid object.") : (("string" != typeof i || 0 == i.length) && (i = "a.caroufredsel"), e.find(i).each(function () { var t = this.hash || ""; t.length > 0 && -1 != $cfs.children().index($(t)) && $(this) .unbind("click") .click(function (e) { e.preventDefault(), $cfs.trigger(cf_e("slideTo", conf), t); }); }), !0) ); }), $cfs.bind(cf_e("updatePageStatus", conf), function (t, e, i) { if ((t.stopPropagation(), opts.pagination.container)) { if (e) { var s = opts.pagination.items || opts.items.visible, o = Math.ceil(itms.total / s); opts.pagination.anchorBuilder && (opts.pagination.container.children().remove(), opts.pagination.container.each(function () { for (var t = 0; o > t; t++) { var e = $cfs.children().eq(gn_getItemIndex(t * s, 0, !0, itms, $cfs)); $(this).append(opts.pagination.anchorBuilder(t + 1, e)); } })), opts.pagination.container.each(function () { $(this) .children() .unbind(opts.pagination.event) .each(function (t) { $(this).bind(opts.pagination.event, function (e) { e.preventDefault(), $cfs.trigger(cf_e("slideTo", conf), [t * s, 0, !0, opts.pagination]); }); }); }); } return ( opts.pagination.container.each(function () { $(this) .children() .removeClass(cf_c("selected", conf)) .eq($cfs.triggerHandler(cf_e("currentPage", conf))) .addClass(cf_c("selected", conf)); }), !0 ); } }), $cfs.bind(cf_e("updateSizes", conf), function (t) { var e = $cfs.children(), i = opts.items.visible; if ( (opts.items.visibleConf.variable ? (i = gn_getVisibleItemsNext(e, opts, 0)) : "*" != opts.items.filter && (i = gn_getVisibleItemsNextFilter(e, opts, 0)), !opts.circular && 0 != itms.first && i > itms.first) ) { if (opts.items.visibleConf.variable) var s = gn_getVisibleItemsPrev(e, opts, itms.first) - itms.first; else if ("*" != opts.items.filter) s = gn_getVisibleItemsPrevFilter(e, opts, itms.first) - itms.first; else s = opts.items.visible - itms.first; debug(conf, "Preventing non-circular: sliding " + s + " items backward."), $cfs.trigger("prev", s); } return (opts.items.visible = cf_getItemsAdjust(i, opts, opts.items.visibleConf.adjust, $tt0)), sz_setSizes($cfs, opts); }), $cfs.bind(cf_e("_cfs_destroy", conf, !1), function (t, e) { return t.stopPropagation(), $cfs.trigger(cf_e("destroy", conf), e), !0; }), $cfs.bind(cf_e("destroy", conf), function (t, e) { return ( t.stopPropagation(), (tmrs = sc_clearTimers(tmrs)), $cfs.data("cfs_isCarousel", !1), $cfs.trigger(cf_e("finish", conf)), e && $cfs.trigger(cf_e("jumpToStart", conf)), opts.usePadding && sz_resetMargin($cfs.children(), opts), $cfs.css($cfs.data("cfs_origCss")), $cfs._cfs_unbind_events(), $cfs._cfs_unbind_buttons(), $wrp.replaceWith($cfs), !0 ); }); }), ($cfs._cfs_unbind_events = function () { $cfs.unbind(cf_e("", conf)), $cfs.unbind(cf_e("", conf, !1)); }), ($cfs._cfs_bind_buttons = function () { if (($cfs._cfs_unbind_buttons(), nv_showNavi(opts, itms.total, conf), nv_enableNavi(opts, itms.first, conf), opts.auto.pauseOnHover)) { var t = bt_pauseOnHoverConfig(opts.auto.pauseOnHover); $wrp.bind(cf_e("mouseenter", conf, !1), function () { $cfs.trigger(cf_e("pause", conf), t); }).bind(cf_e("mouseleave", conf, !1), function () { $cfs.trigger(cf_e("resume", conf)); }); } if ( (opts.auto.button && opts.auto.button.bind(cf_e(opts.auto.event, conf, !1), function (t) { t.preventDefault(); var e = !1, i = null; crsl.isPaused ? (e = "play") : opts.auto.pauseOnEvent && ((e = "pause"), (i = bt_pauseOnHoverConfig(opts.auto.pauseOnEvent))), e && $cfs.trigger(cf_e(e, conf), i); }), opts.prev.button && (opts.prev.button.bind(cf_e(opts.prev.event, conf, !1), function (t) { t.preventDefault(), $cfs.trigger(cf_e("prev", conf)); }), opts.prev.pauseOnHover)) ) { t = bt_pauseOnHoverConfig(opts.prev.pauseOnHover); opts.prev.button .bind(cf_e("mouseenter", conf, !1), function () { $cfs.trigger(cf_e("pause", conf), t); }) .bind(cf_e("mouseleave", conf, !1), function () { $cfs.trigger(cf_e("resume", conf)); }); } if ( opts.next.button && (opts.next.button.bind(cf_e(opts.next.event, conf, !1), function (t) { t.preventDefault(), $cfs.trigger(cf_e("next", conf)); }), opts.next.pauseOnHover) ) { t = bt_pauseOnHoverConfig(opts.next.pauseOnHover); opts.next.button .bind(cf_e("mouseenter", conf, !1), function () { $cfs.trigger(cf_e("pause", conf), t); }) .bind(cf_e("mouseleave", conf, !1), function () { $cfs.trigger(cf_e("resume", conf)); }); } if ( ($.fn.mousewheel && (opts.prev.mousewheel && (crsl.mousewheelPrev || ((crsl.mousewheelPrev = !0), $wrp.mousewheel(function (t, e) { if (e > 0) { t.preventDefault(); var i = bt_mousesheelNumber(opts.prev.mousewheel); $cfs.trigger(cf_e("prev", conf), i); } }))), opts.next.mousewheel && (crsl.mousewheelNext || ((crsl.mousewheelNext = !0), $wrp.mousewheel(function (t, e) { if (0 > e) { t.preventDefault(); var i = bt_mousesheelNumber(opts.next.mousewheel); $cfs.trigger(cf_e("next", conf), i); } })))), $.fn.touchwipe) ) { var e = opts.prev.wipe ? function () { $cfs.trigger(cf_e("prev", conf)); } : null, i = opts.next.wipe ? function () { $cfs.trigger(cf_e("next", conf)); } : null; if ((i || i) && !crsl.touchwipe) { crsl.touchwipe = !0; var s = { min_move_x: 30, min_move_y: 30, preventDefaultEvents: !0 }; switch (opts.direction) { case "up": case "down": (s.wipeUp = e), (s.wipeDown = i); break; default: (s.wipeLeft = i), (s.wipeRight = e); } $wrp.touchwipe(s); } } if (opts.pagination.container && opts.pagination.pauseOnHover) { t = bt_pauseOnHoverConfig(opts.pagination.pauseOnHover); opts.pagination.container .bind(cf_e("mouseenter", conf, !1), function () { $cfs.trigger(cf_e("pause", conf), t); }) .bind(cf_e("mouseleave", conf, !1), function () { $cfs.trigger(cf_e("resume", conf)); }); } (opts.prev.key || opts.next.key) && $(document).bind(cf_e("keyup", conf, !1, !0, !0), function (t) { var e = t.keyCode; e == opts.next.key && (t.preventDefault(), $cfs.trigger(cf_e("next", conf))), e == opts.prev.key && (t.preventDefault(), $cfs.trigger(cf_e("prev", conf))); }), opts.pagination.keys && $(document).bind(cf_e("keyup", conf, !1, !0, !0), function (t) { var e = t.keyCode; e >= 49 && 58 > e && (e = (e - 49) * opts.items.visible) <= itms.total && (t.preventDefault(), $cfs.trigger(cf_e("slideTo", conf), [e, 0, !0, opts.pagination])); }), opts.auto.play && $cfs.trigger(cf_e("play", conf), opts.auto.delay), crsl.upDateOnWindowResize && $(window).bind(cf_e("resize", conf, !1, !0, !0), function (t) { $cfs.trigger(cf_e("finish", conf)), opts.auto.pauseOnResize && !crsl.isPaused && $cfs.trigger(cf_e("play", conf)), sz_resetMargin($cfs.children(), opts), $cfs._cfs_init(opts_orig); var e = sz_setSizes($cfs, opts, !1); $cfs.trigger(cf_e("updatePageStatus", conf), [!0, e]); }); }), ($cfs._cfs_unbind_buttons = function () { var t = (cf_e("", conf), cf_e("", conf, !1)); (ns3 = cf_e("", conf, !1, !0, !0)), $(document).unbind(ns3), $(window).unbind(ns3), $wrp.unbind(t), opts.auto.button && opts.auto.button.unbind(t), opts.prev.button && opts.prev.button.unbind(t), opts.next.button && opts.next.button.unbind(t), opts.pagination.container && (opts.pagination.container.unbind(t), opts.pagination.anchorBuilder && opts.pagination.container.children().remove()), nv_showNavi(opts, "hide", conf), nv_enableNavi(opts, "removeClass", conf); }); var crsl = { direction: "next", isPaused: !0, isScrolling: !1, isStopped: !1, mousewheelNext: !1, mousewheelPrev: !1, touchwipe: !1 }, itms = { total: $cfs.children().length, first: 0 }, tmrs = { timer: null, auto: null, queue: null, startTime: getTime(), timePassed: 0 }, scrl = { isStopped: !1, duration: 0, startTime: 0, easing: "", anims: [] }, clbk = { onBefore: [], onAfter: [] }, queu = [], conf = $.extend(!0, {}, $.fn.carouFredSel.configs, configs), opts = {}, opts_orig = options, $wrp = $cfs.wrap("<" + conf.wrapper.element + ' class="' + conf.wrapper.classname + '" />').parent(); if ( ((conf.selector = $cfs.selector), (conf.serialNumber = $.fn.carouFredSel.serialNumber++), $cfs._cfs_init(opts_orig, !0, starting_position), $cfs._cfs_build(), $cfs._cfs_bind_events(), $cfs._cfs_bind_buttons(), is_array(opts.items.start)) ) var start_arr = opts.items.start; else { var start_arr = []; 0 != opts.items.start && start_arr.push(opts.items.start); } if ((opts.cookie && start_arr.unshift(cf_readCookie(opts.cookie)), start_arr.length > 0)) for (var a = 0, l = start_arr.length; l > a; a++) { var s = start_arr[a]; if (0 != s) { if (!0 === s) { if (((s = window.location.hash), s.length < 1)) continue; } else "random" === s && (s = Math.floor(Math.random() * itms.total)); if ($cfs.triggerHandler(cf_e("slideTo", conf), [s, 0, !0, { fx: "none" }])) break; } } var siz = sz_setSizes($cfs, opts, !1), itm = gi_getCurrentItems($cfs.children(), opts); return opts.onCreate && opts.onCreate.call($tt0, itm, siz), $cfs.trigger(cf_e("updatePageStatus", conf), [!0, siz]), $cfs.trigger(cf_e("linkAnchors", conf)), $cfs; }), ($.fn.carouFredSel.serialNumber = 1), ($.fn.carouFredSel.defaults = { synchronise: !1, infinite: !0, circular: !0, responsive: !1, direction: "left", items: { start: 0 }, scroll: { easing: "swing", duration: 500, pauseOnHover: !1, mousewheel: !1, wipe: !1, event: "click", queue: !1 }, }), ($.fn.carouFredSel.configs = { debug: !1, events: { prefix: "", namespace: "cfs" }, wrapper: { element: "div", classname: "caroufredsel_wrapper" }, classnames: {} }), ($.fn.carouFredSel.pageAnchorBuilder = function (t, e) { return '' + t + ""; }), ($.fn.caroufredsel = function (t, e) { return this.carouFredSel(t, e); }), $.extend($.easing, { quadratic: function (t) { var e = t * t; return t * (-e * t + 4 * e - 6 * t + 4); }, cubic: function (t) { return t * (4 * t * t - 9 * t + 6); }, elastic: function (t) { var e = t * t; return t * (33 * e * e - 106 * e * t + 126 * e - 67 * t + 15); }, })); })(losjqisafe), (function ($) { function format(t) { for (var e = 1; e < arguments.length; e++) t = t.replace("%" + (e - 1), arguments[e]); return t; } function CloudZoom(t, e) { var i, s, o, n, r, a, c, l, p = $("img", t), d = null, f = null, u = null, m = null, g = null, h = null, v = 0, b = 0, _ = 0, w = 0, y = 0, x = 0, S = this; setTimeout(function () { if (null === f) { var e = t.width(); t.parent() .append(format('
Loading...
', e / 3, e / 2 - e / 6)) .find(":last") .css("opacity", 0.5); } }, 200); (this.removeBits = function () { u && (u.remove(), (u = null)), m && (m.remove(), (m = null)), g && (g.remove(), (g = null)), null !== h && (h.remove(), (h = null)), $(".cloud-zoom-loading", t.parent()).remove(); }), (this.destroy = function () { t.data("zoom", null), f && ($(".mousetrap").unbind(), $(".mousetrap").remove(), (f = null)), d && (d.remove(), (d = null)), this.removeBits(); }), (this.fadedOut = function () { d && (d.remove(), (d = null)), this.removeBits(); }), (this.controlLoop = function () { if (u) { var t = (a - p.offset().left - 0.5 * n) >> 0, i = (c - p.offset().top - 0.5 * r) >> 0; 0 > t ? (t = 0) : t > p.outerWidth() - n && (t = p.outerWidth() - n), 0 > i ? (i = 0) : i > p.outerHeight() - r && (i = p.outerHeight() - r), u.css({ left: t, top: i }), u.css("background-position", -t + "px " + -i + "px"), (b = ((t / p.outerWidth()) * o.width) >> 0), (_ = ((i / p.outerHeight()) * o.height) >> 0), (y += (b - y) / e.smoothMove), (w += (_ - w) / e.smoothMove), d.css("background-position", -(y >> 0) + "px " + -(w >> 0) + "px"); } v = setTimeout(function () { S.controlLoop(); }, 30); }), (this.init2 = function (t, e) { 1 === e && (o = t), 2 === ++x && this.init(); }), (this.init = function () { $(".cloud-zoom-loading", t.parent()).remove(), (f = t .parent() .append(format("
", p.outerWidth(), p.outerHeight(), 0, 0)) .find(":last")); var i = "ontouchstart" in document.documentElement; f.bind("touchmove mousemove", this, function (t) { (a = void 0 !== t.originalEvent.touches ? t.originalEvent.touches[0].pageX : t.pageX), (c = void 0 !== t.originalEvent.touches ? t.originalEvent.touches[0].pageY : t.pageY); }), f.bind("touchend mouseleave", this, function (t) { return ( clearTimeout(v), u && u.fadeOut(299), m && m.fadeOut(299), g && g.fadeOut(299), d.fadeOut(300, function () { S.fadedOut(), null != f && f.css("z-index", "auto"); }), $(p).trigger("zoomOut"), !1 ); }), f.bind("touchstart mouseenter", this, function (s) { f.css("z-index", "999"), i && s.preventDefault(), (a = void 0 !== s.originalEvent.touches ? s.originalEvent.touches[0].pageX : s.pageX), (c = void 0 !== s.originalEvent.touches ? s.originalEvent.touches[0].pageY : s.pageY), (l = s.data), d && (d.stop(!0, !1), d.remove()); var v = e.adjustX, b = e.adjustY, _ = p.outerWidth(), w = p.outerHeight(), y = e.zoomWidth, x = e.zoomHeight; "auto" == e.zoomWidth && (y = _), "auto" == e.zoomHeight && (x = w); var S = t.parent(); switch (e.position) { case "top": b -= x; break; case "right": v += _; break; case "bottom": b += w; break; case "left": v -= y; break; case "inside": (y = _), (x = w); break; default: (S = $("#" + e.position)).length ? ((y = S.innerWidth()), (x = S.innerHeight())) : ((S = t), (v += _), (b += w)); } (d = S.append( format('', v, b, y, x, o.src) ).find(":last")), p.attr("title") && e.showTitle && d .append(format('
%0
', p.attr("title"))) .find(":last") .css("opacity", e.titleOpacity), $.browser.msie && $.browser.version < 7 && (h = $('').css({ position: "absolute", left: v, top: b, zIndex: 99, width: y, height: x }).insertBefore(d)), d.fadeIn(500), u && (u.remove(), (u = null)), (n = (p.outerWidth() / o.width) * d.width()), (r = (p.outerHeight() / o.height) * d.height()), (u = t.append(format("", n, r)).find(":last")), f.css("cursor", u.css("cursor")); var I = !1; e.tint && (u.css("background", 'url("' + p.attr("src") + '")'), (m = t.append(format('
', p.outerWidth(), p.outerHeight(), e.tint)).find(":last")).css( "opacity", e.tintOpacity ), (I = !0), m.fadeIn(500)), e.softFocus && (u.css("background", 'url("' + p.attr("src") + '")'), (g = t.append(format('
', p.outerWidth() - 2, p.outerHeight() - 2, e.tint)).find(":last")).css( "background", 'url("' + p.attr("src") + '")' ), g.css("opacity", 0.5), (I = !0), g.fadeIn(500)), I || u.css("opacity", e.lensOpacity), "inside" !== e.position && u.fadeIn(500), l.controlLoop(), $(p).trigger("zoomIn"); }); }), (i = new Image()), $(i).load(function () { S.init2(this, 0); }), (i.src = p.attr("src")), (s = new Image()), $(s).load(function () { S.init2(this, 1); }), (s.src = t.attr("href")); } ($.fn.CloudZoom = function (options) { try { document.execCommand("BackgroundImageCache", !1, !0); } catch (t) { } return ( this.each(function () { var relOpts, opts; if ((eval("var a = {" + $(this).attr("rel") + "}"), (relOpts = a), $(this).is(".cloud-zoom"))) $(this).css({ position: "relative", display: "block" }), $("img", $(this)).css({ display: "block" }), "wrap" != $(this).parent().attr("id") && $(this).wrap('
'), (opts = $.extend({}, $.fn.CloudZoom.defaults, options)), (opts = $.extend({}, opts, relOpts)), $(this).data("zoom", new CloudZoom($(this), opts)); else if ($(this).is(".cloud-zoom-gallery")) { (opts = $.extend({}, relOpts, options)), $(this).data("relOpts", opts); var m_click = "touchstart click"; $(this).bind(m_click, $(this), function (t) { var e = t.data.data("relOpts"); return ( $("#" + e.useZoom) .data("zoom") .destroy(), $("#" + e.useZoom).attr("href", t.data.attr("href")), $("#" + e.useZoom + " img").attr("src", t.data.data("relOpts").smallImage), $("#" + t.data.data("relOpts").useZoom).CloudZoom(), !1 ); }); } }), this ); }), ($.fn.CloudZoom.defaults = { zoomWidth: "auto", zoomHeight: "auto", position: "right", tint: !1, tintOpacity: 0.5, lensOpacity: 0.5, softFocus: !1, smoothMove: 3, showTitle: !0, titleOpacity: 0.5, adjustX: 0, adjustY: 0 }); })(losjqisafe), "function" != typeof Object.create && (Object.create = function (t) { function e() { } return (e.prototype = t), new e(); }), (function (t, e, i, s) { var o = { init: function (e, i) { var s = this; (s.elem = i), (s.$elem = t(i)), (s.videoId = "string" == typeof e ? e : e.videoId), (s.options = t.extend({}, t.fn.AutoLIVEButton.options, e)), t.getCSS(liveViewCSS, {}, function () { }), s.appendFormHTML(), s.addFormListeners(), s.$elem.css({ cursor: "pointer" }), s.$elem.click(function () { s.show(); }); }, show: function () { t("#LOSLiveWrapper_" + this.options.videoId).fadeIn("fast"), t("#modalBG_autoLive").show(); }, hide: function () { t("#LOSLiveWrapper_" + this.options.videoId).fadeOut("fast"), t("#modalBG_autoLive").hide(); }, submit: function () { var e = this, s = e.options.videoId, o = t("#code_" + s).val(), n = t("#name_" + s).val(), r = t("#email_" + s).val(), a = t("#tel_" + s).val(), c = i.URL, l = "apiKey=" + krte + "&code=" + o + "&name=" + n + "&email=" + r + "&tel=" + a + "&ref=" + s + "&URL=" + c; t.ajax({ type: "POST", url: pageProtocol + "://" + playerDomain + "/submitLiveViewForm.php?callback=?", dataType: "JSONP", data: l, success: function (i, o, n) { "codesuccess" == i.result ? (t("#AOSPlayer_" + s).html(i.message), e.hide()) : "success" == i.result ? (t("#liveSubmitButt_" + s).hide(), t("#LVRequiredText_" + s).hide(), t("#liveViewRequestForm_" + s) .html(t("#LVMessage_" + s).html()) .hide() .fadeIn("slow")) : alert(i.message); }, error: function (t, e, i) { }, }); }, appendFormHTML: function () { var e = this, i = e.options.videoId, s = e.options.html, o = e.options.message, n = ' "; t("body").append(n); }, addFormListeners: function () { var e = this; t("#liveCancelButt_" + e.options.videoId).click(function () { e.options.onClose && e.options.onClose(), e.hide(); }), t("#liveSubmitButt_" + e.options.videoId).click(function () { e.options.onSubmit && e.options.onSubmit(), e.submit(); }); }, }; (t.fn.AutoLIVEButton = function (t) { return this.each(function () { Object.create(o).init(t, this); }); }), (t.fn.AutoLIVEButton.options = { videoId: "test", html: '
What is live view?
Live view lets you see the vehicle in real time. This email will notify one of the sales team who will then contact you, so as they can walk you through your vehicle from the comfort of your own home.
', message: ' Thank you for your request.
Someone will be in touch shortly.
', }); })(losjqisafe, window, document), (function (t, e, i, s) { var o = { init: function (e, i) { var s = this; (s.elem = i), (s.$elem = t(i)), (s.videoId = "string" == typeof e ? e : e.videoId), (s.items = "string" == typeof e ? e : e.items), (s.index = "string" == typeof e ? e : e.index), (s.options = t.extend({}, t.fn.AOSZoomButton.options, e)), s.appendFormHTML(), s.addFormListeners(), s.$elem.css({ cursor: "pointer" }), s.$elem.click(function () { s.show(); }); }, show: function () { function e() { var e = o.index; n.listen("beforeChange", function () { var i = Math.abs(n.getCurrentIndex() - e) < 2; t(".pswp__container").toggleClass("pswp__container_transition", i), (e = n.getCurrentIndex()); }); } var i = this, s = t(".pswpaos")[0], o = { index: losjqisafe(".AOSGalleryImage.selected").attr("data-index-thumb") - 1, bgOpacity: 0.98, showHideOpacity: !0 }, n = new PhotoSwipeAOS(s, PhotoSwipeUI_Default, this.items, o); console.log("this index" + JSON.stringify(this)); if ( (n.listen("afterChange", function () { i.options.afterChange && i.options.afterChange(n.currItem); }), n.listen("afterInit", function () { i.options.afterInit && i.options.afterInit(); }), n.listen("zoomTo", function (t) { i.options.onZoom && i.options.onZoom(t); }), n.listen("zoomGestureStarted", function () { i.options.onZoomGestureStarted && i.options.onZoomGestureStarted(n); }), n.listen("zoomGestureEnded", function () { i.options.onZoomGestureEnded && i.options.onZoomGestureEnded(n); }), n.listen("gettingData", function (t, e) { (e.src = e.largeImage.src), (e.w = e.largeImage.w), (e.h = e.largeImage.h), i.options.onSetContent && i.options.onSetContent(t, e); }), !n.likelyTouchDevice) ) { var r = !1; t("body") .on("mousedown", ".pswp__scroll-wrap", function (e) { t(this).children(".pswp__container_transition").removeClass("pswp__container_transition"); }) .on("mousedown", ".pswp__button--arrow--left, .pswp__button--arrow--right", function (t) { t.stopPropagation(); }) .on("mousemove.detect", function (e) { (r = !0), t("body").off("mousemove.detect"); }), r ? e() : n.listen("mouseUsed", function () { (r = !0), e(); }); } n.init(), i.options.onOpen && i.options.onOpen(); }, hide: function () { th.options.onClose && th.options.onClose(); }, appendFormHTML: function () { var e = (this.options.videoId, ''); t("body").append(e); }, addFormListeners: function () { var e = this; t("#infoCloseButt").click(function () { e.hide(); }); }, }; (t.fn.AOSZoomButton = function (t) { return this.each(function () { Object.create(o).init(t, this); }); }), (t.fn.AOSZoomButton.options = { videoId: "", images: [], index: "", onOpen: null, onClose: null, onSetContent: null, afterChange: null, afterInit: null }); })(losjqisafe, window, document), (function (t, e, i) { var s = { loaded: !1, init: function (e, i) { var s = this; console.log(" OPTIONS " + JSON.stringify(e)); (s.elem = i), (s.$elem = t(i)), (s.videoId = "string" == typeof e ? e : e.videoId), (s.options = t.extend({}, t.fn.AOS360Button.options, e)), s.appendFormHTML(), s.addListeners(), s.$elem.css({ cursor: "pointer" }), s.$elem.click(function () { s.show(s.options); }); }, show: function (e) { var i = pageProtocol + "://" + playerDomain + "/360Viewer/external360.php?x=" + this.options.x; t("#LOSExteriorIframe_" + this.options.videoId).attr("src") != i && t("#LOSExteriorIframe_" + this.options.videoId).attr("src", i), t("#LOSExteriorWrapper_" + this.options.videoId).fadeIn("fast"), t("#modalBG_exterior").show(), t("#LOSExteriorWrapper_" + this.options.videoId).fadeIn("fast"), t("#modalBG_exterior").show(); }, hide: function () { t("#LOSExteriorWrapper_" + this.options.videoId).fadeOut("fast"), t("#modalBG_exterior").hide(); }, appendFormHTML: function () { var e = (this.options.x, this.options.videoId), i = ''; t("body").append(i); }, addListeners: function () { var e = this; t("#LOSExteriorWrapper_" + e.options.videoId + " #AOScboxCloseExterior").on("click touchstart", function () { e.hide(); }), window.addEventListener( "resize", function () { e.updateIFrame(); }, !1 ), e.updateIFrame(); }, calculateAspectRatioFit: function (t, e, i, s) { var o = Math.min(i / t, s / e); return { width: Math.min(t * o, t), height: Math.min(e * o, e) }; }, updateIFrame: function (t) { var e = document.getElementById("LOSExteriorWrapper_" + this.options.videoId), i = ((t = document.getElementById("LOSExteriorIframe_" + this.options.videoId)), this.calculateAspectRatioFit(978, 550, window.innerWidth, window.innerHeight)); (e.style.width = i.width + "px"), (e.style.height = i.height + "px"), (e.style.top = (window.innerHeight - i.height) / 2 + "px"), (e.style.left = (window.innerWidth - i.width) / 2 + "px"), (t.width = i.width), (t.height = i.height); }, }; (t.fn.AOS360Button = function (t) { return this.each(function () { Object.create(s).init(t, this); }); }), (t.fn.AOS360Button.options = { x: "" }); })(losjqisafe, window, document), (window.AOSMediaStore = new AOSMediaStore()), (window.AOSMediaInterface = new AOSMediaInterface()), (function (t) { function e(t) { var e = t.originalEvent.changedTouches[0], i = ""; switch (t.type) { case "touchmove": i = "mousemove"; break; case "touchend": i = "mouseup"; break; default: return; } var s = document.createEvent("MouseEvent"); s.initMouseEvent(i, !0, !0, window, 1, e.screenX, e.screenY, e.clientX, e.clientY, !1, !1, !1, !1, 0, null), e.target.dispatchEvent(s), t.preventDefault(); } (t.rateit = { aria: { resetLabel: "reset rating", ratingLabel: "rating" } }), (t.fn.rateit = function (i, s) { var o = 1, n = {}, r = "init", a = function (t) { return t.charAt(0).toUpperCase() + t.substr(1); }; if (0 === this.length) return this; var c = t.type(i); if ("object" == c || null == i) n = t.extend({}, t.fn.rateit.defaults, i); else { if ("string" == c && "reset" !== i && void 0 === s) return this.data("rateit" + a(i)); "string" == c && (r = "setvalue"); } return this.each(function () { var c = t(this), l = function (t, e) { if (null != e) { var i = "aria-value" + ("value" == t ? "now" : t), s = c.find(".rateit-range"); null != s.attr(i) && s.attr(i, e); } return (arguments[0] = "rateit" + a(t)), c.data.apply(c, arguments); }; if ("reset" == i) { var p = l("init"); for (var d in p) c.data(d, p[d]); l("backingfld") && ("SELECT" == (u = t(l("backingfld")))[0].nodeName && "index" === u[0].getAttribute("data-rateit-valuesrc") ? u.prop("selectedIndex", l("value")) : u.val(l("value")), u.trigger("change"), u[0].min && (u[0].min = l("min")), u[0].max && (u[0].max = l("max")), u[0].step && (u[0].step = l("step"))), c.trigger("reset"); } c.hasClass("rateit") || c.addClass("rateit"); var f = "rtl" != c.css("direction"); if ("setvalue" == r) { if (!l("init")) throw "Can't set value before init"; "readonly" != i || 1 != s || l("readonly") || (c.find(".rateit-range").unbind(), l("wired", !1)), "value" == i && (s = null == s ? l("min") : Math.max(l("min"), Math.min(l("max"), s))), l("backingfld") && ("SELECT" == (u = t(l("backingfld")))[0].nodeName && "index" === u[0].getAttribute("data-rateit-valuesrc") ? "value" == i && u.prop("selectedIndex", s) : "value" == i && u.val(s), "min" == i && u[0].min && (u[0].min = s), "max" == i && u[0].max && (u[0].max = s), "step" == i && u[0].step && (u[0].step = s)), l(i, s); } if (!l("init")) { if ( (l("mode", l("mode") || n.mode), l("icon", l("icon") || n.icon), l("min", isNaN(l("min")) ? n.min : l("min")), l("max", isNaN(l("max")) ? n.max : l("max")), l("step", l("step") || n.step), l("readonly", void 0 !== l("readonly") ? l("readonly") : n.readonly), l("resetable", void 0 !== l("resetable") ? l("resetable") : n.resetable), l("backingfld", l("backingfld") || n.backingfld), l("starwidth", l("starwidth") || n.starwidth), l("starheight", l("starheight") || n.starheight), l("value", Math.max(l("min"), Math.min(l("max"), isNaN(l("value")) ? (isNaN(n.value) ? n.min : n.value) : l("value")))), l("ispreset", void 0 !== l("ispreset") ? l("ispreset") : n.ispreset), l("backingfld")) ) { var u = t(l("backingfld")).hide(); if ( ((u.attr("disabled") || u.attr("readonly")) && l("readonly", !0), "INPUT" == u[0].nodeName && (("range" != u[0].type && "text" != u[0].type) || (l("min", parseInt(u.attr("min")) || l("min")), l("max", parseInt(u.attr("max")) || l("max")), l("step", parseInt(u.attr("step")) || l("step")))), "SELECT" == u[0].nodeName && u[0].options.length > 1) ) { "index" === u[0].getAttribute("data-rateit-valuesrc") ? (l("min", isNaN(l("min")) ? Number(u[0].options[0].index) : l("min")), l("max", Number(u[0].options[u[0].length - 1].index)), l("step", Number(u[0].options[1].index) - Number(u[0].options[0].index))) : (l("min", isNaN(l("min")) ? Number(u[0].options[0].value) : l("min")), l("max", Number(u[0].options[u[0].length - 1].value)), l("step", Number(u[0].options[1].value) - Number(u[0].options[0].value))); var m = u.find("option[selected]"); 1 == m.length && ("index" === u[0].getAttribute("data-rateit-valuesrc") ? l("value", m[0].index) : l("value", m.val())); } else l("value", u.val()); } var g = "DIV" == c[0].nodeName ? "div" : "span"; o++; var h = '<{{element}} id="rateit-range-{{index}}" class="rateit-range" tabindex="0" role="slider" aria-label="' + t.rateit.aria.ratingLabel + '" aria-owns="rateit-reset-{{index}}" aria-valuemin="' + l("min") + '" aria-valuemax="' + l("max") + '" aria-valuenow="' + l("value") + '"><{{element}} class="rateit-empty"><{{element}} class="rateit-selected"><{{element}} class="rateit-hover">'; c.append(h.replace(/{{index}}/gi, o).replace(/{{element}}/gi, g)), f || (c.find(".rateit-reset").css("float", "right"), c.find(".rateit-selected").addClass("rateit-selected-rtl"), c.find(".rateit-hover").addClass("rateit-hover-rtl")), "font" == l("mode") ? c.addClass("rateit-font").removeClass("rateit-bg") : c.addClass("rateit-bg").removeClass("rateit-font"), l("init", JSON.parse(JSON.stringify(c.data()))); } var v = "font" == l("mode"); v || c.find(".rateit-selected, .rateit-hover").height(l("starheight")); var b = c.find(".rateit-range"); if (v) { for (var _ = l("icon"), w = l("max") - l("min"), y = "", x = 0; x < w; x++) y += _; b.find("> *").text(y), l("starwidth", b.width() / (l("max") - l("min"))); } else b.width(l("starwidth") * (l("max") - l("min"))).height(l("starheight")); var $ = "rateit-preset" + (f ? "" : "-rtl"); if ((l("ispreset") ? c.find(".rateit-selected").addClass($) : c.find(".rateit-selected").removeClass($), null != l("value"))) { var S = (l("value") - l("min")) * l("starwidth"); c.find(".rateit-selected").width(S); } var I = c.find(".rateit-reset"); !0 !== I.data("wired") && I.bind("click", function (e) { e.preventDefault(), I.blur(); var i = t.Event("beforereset"); if ((c.trigger(i), i.isDefaultPrevented())) return !1; c.rateit("value", null), c.trigger("reset"); }).data("wired", !0); var O = function (e, i) { var s = (i.changedTouches ? i.changedTouches[0].pageX : i.pageX) - t(e).offset().left; return ( f || (s = b.width() - s), s > b.width() && (s = b.width()), s < 0 && (s = 0), 0 == l("starwidth") && l("starwidth", b.width() / (l("max") - l("min"))), (S = Math.ceil((s / l("starwidth")) * (1 / l("step")))) ); }, C = function (e) { var i = t.Event("beforerated"); return ( c.trigger(i, [e]), !i.isDefaultPrevented() && (l("value", e), l("backingfld") && ("SELECT" == u[0].nodeName && "index" === u[0].getAttribute("data-rateit-valuesrc") ? t(l("backingfld")).prop("selectedIndex", e).trigger("change") : t(l("backingfld")).val(e).trigger("change")), l("ispreset") && (b.find(".rateit-selected").removeClass($), l("ispreset", !1)), b.find(".rateit-hover").hide(), b .find(".rateit-selected") .width(e * l("starwidth") - l("min") * l("starwidth")) .show(), c.trigger("hover", [null]).trigger("over", [null]).trigger("rated", [e]), !0) ); }; l("readonly") ? I.hide() : (l("resetable") || I.hide(), l("wired") || (b.bind("touchmove touchend", e), b.mousemove(function (t) { !(function (t) { var e = t * l("starwidth") * l("step"), i = b.find(".rateit-hover"); if (i.data("width") != e) { b.find(".rateit-selected").hide(), i.width(e).show().data("width", e); var s = [t * l("step") + l("min")]; c.trigger("hover", s).trigger("over", s); } })(O(this, t)); }), b.mouseleave(function (t) { b.find(".rateit-hover").hide().width(0).data("width", ""), c.trigger("hover", [null]).trigger("over", [null]), b.find(".rateit-selected").show(); }), b.mouseup(function (t) { var e = O(this, t) * l("step") + l("min"); C(e), b.blur(); }), b.keyup(function (t) { (38 != t.which && t.which != (f ? 39 : 37)) || C(Math.min(l("value") + l("step"), l("max"))), (40 != t.which && t.which != (f ? 37 : 39)) || C(Math.max(l("value") - l("step"), l("min"))); }), l("wired", !0)), l("resetable") && I.show()), b.attr("aria-readonly", l("readonly")); }); }), (t.fn.rateit.defaults = { min: 0, max: 5, step: 0.5, mode: "bg", icon: "★", starwidth: 16, starheight: 16, readonly: !1, resetable: !0, ispreset: !1 }), t(function () { t("div.rateit, span.rateit").rateit(); }); })(losjqisafe); var AOSVideoRateForm = function (t) { var e = this; (t.apiId && t.assetId) || alert("error"), (this.apiId = t.apiId), (this.assetId = t.assetId), (this.title = t.title ? t.title : "Rate this video"), (this.thankYouMessage = t.thankYouMessage ? t.thankYouMessage : "Thank you for taking the time to rate this video"), (this.key = this.apiId + "_" + this.assetId), (this.open = function () { var t = '"; losjqisafe("body").append("" + t), losjqisafe("#rateCloseButt_" + this.key).click(function () { e.close(); }), losjqisafe("#rateSubmitButt_" + this.key).click(function () { e.submit(); }), losjqisafe(".AOSRateStars").rateit({ resetable: !1, mode: "font" }), losjqisafe("#LOSRateWrapper_" + this.key).fadeIn("fast"), losjqisafe("#modalBG_rate").fadeIn("fast"); }), (this.close = function () { losjqisafe("#LOSRateWrapper_" + this.key).fadeOut("fast", function () { this.remove(); }), losjqisafe("#modalBG_rate").fadeOut("fast", function () { this.remove(); }); }), (this.submit = function () { var i = losjqisafe("#rateStars_" + this.key).rateit("value"), s = losjqisafe("#comments_" + this.key).val(), o = window.location.href, n = "apiKey=" + krte + "&key=" + this.key + "&rating=" + i + "&comments=" + s + "&URL=" + o; losjqisafe.ajax({ type: "POST", url: pageProtocol + "://" + playerDomain + "/rateVideo.php?callback=?", dataType: "JSONP", data: n, success: function (i, s, o) { "success" == i.result ? (losjqisafe("#rateSubmitButt_" + e.key).hide(), losjqisafe("#commentsContainer_" + e.key).html("
" + e.thankYouMessage + "
"), t.onRated && t.onRated()) : alert(i.message); }, error: function (t, e, i) { }, }); }); }; function allImagesLoadedHandler() { let temp = this.props_obj.divHolderId; losjqisafe('#' + temp + ' div:first').append('
'); losjqisafe('#' + temp + ' [id^=toolTipWindow]').click(function (e) { e.preventDefault(); let tagInfo = losjqisafe("ul").find("li[data-marker-id='" + losjqisafe(this).attr("id") + "']").html(); let viewerClose = "
"; let tagWindowAOS = losjqisafe('.tagWindowAOS'); tagWindowAOS.html(tagInfo); tagWindowAOS.css('display', 'inline-block'); let firstDiv = losjqisafe('.tagWindowAOS div:first'); firstDiv.css('position', 'relative'); firstDiv.append(viewerClose); }); losjqisafe('#' + temp + ' [id^=toolTipWindow]').on('touchstart', function (e) { e.preventDefault(); let tagInfo = losjqisafe("ul").find("li[data-marker-id='" + losjqisafe(this).attr("id") + "']").html(); let viewerClose = "
"; let tagWindowAOS = losjqisafe('.tagWindowAOS'); tagWindowAOS.html(tagInfo); tagWindowAOS.css('display', 'inline-block'); let firstDiv = losjqisafe('.tagWindowAOS div:first'); firstDiv.css('position', 'relative'); firstDiv.append(viewerClose); }); tagWindowAOS = losjqisafe('.tagWindowAOS'); tagWindowAOS.click(function () { tagWindowAOS.html(""); tagWindowAOS.css("display", "none"); }); losjqisafe('#' + temp + ' div:first').append('
'); buttonDiv = losjqisafe('.aos_viewer_btn_container'); buttonDiv.html('
'); } //####################################// /* Add button events to call API methods*/ //####################################// function addButtonsEvents() { if (!FWDUtils.isMobile || FWDUtils.hasPointerEvent) { losjqisafe(document).on('click', '#AOSZoomIn', function (e) { viewerDefault.zoomIn(); }); losjqisafe(document).on('click', '#AOSZoomOut', function (e) { viewerDefault.zoomOut(); }); losjqisafe(document).on('click', '#AOSFullScreen', function (e) { losjqisafe('#AOSFullScreen').hide(); losjqisafe('#AOSNormalScreen').show(); viewerDefault.fullScreen(); }); losjqisafe(document).on('click', '#AOSNormalScreen', function (e) { viewerDefault.normalScreen(); }); } else { losjqisafe(document).on('touchstart', '#AOSZoomIn', function (e) { viewerDefault.zoomIn(); }); losjqisafe(document).on('touchstart', '#AOSZoomOut', function (e) { viewerDefault.zoomOut(); }); losjqisafe(document).on('touchend', '#AOSFullScreen', function (e) { losjqisafe('#AOSFullScreen').hide(); losjqisafe('#AOSNormalScreen').show(); viewerDefault.fullScreen(); }); losjqisafe(document).on('touchend', '#AOSNormalScreen', function (e) { viewerDefault.normalScreen(); }); } document.addEventListener("360PlayerNormalScreenDone", function (e) { losjqisafe('#AOSNormalScreen').hide(); losjqisafe('#AOSFullScreen').show(); }); } //API// function playToImage(e) { if (e.preventDefault) e.preventDefault(); viewer.playToImage(20, "callBackPlayToImageFunction"); } function callBackPlayToImageFunction() { alert("playToImage callback"); } function pan(e) { if (e.preventDefault) e.preventDefault(); viewer.pan(); } function rotate(e) { if (e.preventDefault) e.preventDefault(); viewer.rotate(); } function rotateLeft(e) { if (e.preventDefault) e.preventDefault(); viewer.rotateLeft(); } function rotateRight(e) { if (e.preventDefault) e.preventDefault(); viewer.rotateRight(); } function zoomOutExploded(e) { if (e.preventDefault) e.preventDefault(); viewerExploded.zoomOut(); } function fullScreenExploded(e) { if (e.preventDefault) e.preventDefault(); viewerExploded.fullScreen(); } function zoomInExploded(e) { if (e.preventDefault) e.preventDefault(); viewerExploded.zoomIn(); } function fullScreen(e) { if (e.preventDefault) e.preventDefault(); viewerDefault.fullScreen(); } function zoomOut(e) { if (e.preventDefault) e.preventDefault(); viewerDefault.zoomOut(); } function zoomIn(e) { if (e.preventDefault) e.preventDefault(); viewerDefault.zoomIn(); } function play(e) { if (e.preventDefault) e.preventDefault(); viewer.play(); } function pause(e) { if (e.preventDefault) e.preventDefault(); viewer.pause(); } function info(e) { if (e.preventDefault) e.preventDefault(); viewer.info(); } function normalScreen(e) { if (e.preventDefault) e.preventDefault(); viewer.normalScreen(); } if ( ((function (e) { var r = function () { }; function t() { for (var e, t, o = ["transform", "msTransform", "WebkitTransform", "MozTransform", "OTransform", "KhtmlTransform"]; (e = o.shift());) if ( void 0 !== r.dumy.style[e] && ((r.dumy.style.position = "absolute"), (t = r.dumy.getBoundingClientRect().left), (r.dumy.style[e] = "translate3d(500px, 0px, 0px)"), 100 < (t = Math.abs(r.dumy.getBoundingClientRect().left - t)) && t < 900) ) { try { document.documentElement.removeChild(r.dumy); } catch (e) { } return !0; } try { document.documentElement.removeChild(r.dumy); } catch (e) { } return !1; } function o() { for (var e, t = ["transform", "msTransform", "WebkitTransform", "MozTransform", "OTransform", "KhtmlTransform"]; (e = t.shift());) if (void 0 !== r.dumy.style[e]) return !0; try { document.documentElement.removeChild(r.dumy); } catch (e) { } return !1; } (r.dumy = document.createElement("div")), (r.trim = function (e) { return e.replace(/\s/gi, ""); }), (r.trimAndFormatUrl = function (e) { return (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = e.toLocaleLowerCase()).replace(/ /g, "-")).replace(/ä/g, "a")).replace(/â/g, "a")).replace(/â/g, "a")).replace( /à/g, "a" )).replace(/è/g, "e")).replace(/é/g, "e")).replace(/ë/g, "e")).replace(/ï/g, "i")).replace(/î/g, "i")).replace(/ù/g, "u")).replace(/ô/g, "o")).replace(/ù/g, "u")).replace(/û/g, "u")).replace(/ÿ/g, "y")).replace( /ç/g, "c" )).replace(/œ/g, "ce")); }), (r.splitAndTrim = function (e, t, o) { for (var n = e.split(","), i = n.length, s = 0; s < i; s++) t && (n[s] = r.trim(n[s])), o && (n[s] = n[s].toLowerCase()); return n; }), (r.indexOfArray = function (e, t) { for (var o = e.length, n = 0; n < o; n++) if (e[n] === t) return n; return -1; }), (r.randomizeArray = function (e) { for (var t = [], o = e.concat(), n = o.length, i = 0; i < n; i++) { var s = Math.floor(Math.random() * o.length); t.push(o[s]), o.splice(s, 1); } return t; }), (r.parent = function (e, t) { for (void 0 === t && (t = 1); t-- && e;) e = e.parentNode; return e && 1 === e.nodeType ? e : null; }), (r.sibling = function (e, t) { for (; e && 0 !== t;) if (0 < t) { if (e.nextElementSibling) e = e.nextElementSibling; else for (e = e.nextSibling; e && 1 !== e.nodeType; e = e.nextSibling); t--; } else { if (e.previousElementSibling) e = e.previousElementSibling; else for (e = e.previousSibling; e && 1 !== e.nodeType; e = e.previousSibling); t++; } return e; }), (r.getChildAt = function (e, t) { var o = r.getChildren(e); return t < 0 && (t += o.length), t < 0 ? null : o[t]; }), (r.getChildById = function (e) { return document.getElementById(e) || void 0; }), (r.getChildren = function (e, t) { for (var o = [], n = e.firstChild; null != n; n = n.nextSibling) t ? o.push(n) : 1 === n.nodeType && o.push(n); return o; }), (r.getChildrenFromAttribute = function (e, t, o) { for (var n = [], i = e.firstChild; null != i; i = i.nextSibling) o && r.hasAttribute(i, t) ? n.push(i) : 1 === i.nodeType && r.hasAttribute(i, t) && n.push(i); return 0 == n.length ? void 0 : n; }), (r.getChildFromNodeListFromAttribute = function (e, t, o) { for (var n = e.firstChild; null != n; n = n.nextSibling) { if (o && r.hasAttribute(n, t)) return n; if (1 === n.nodeType && r.hasAttribute(n, t)) return n; } }), (r.getAttributeValue = function (e, t) { if (r.hasAttribute(e, t)) return e.getAttribute(t); }), (r.hasAttribute = function (e, t) { return e.hasAttribute ? e.hasAttribute(t) : !!e.attributes[t]; }), (r.insertNodeAt = function (e, t, o) { var n = r.children(e); if (o < 0 || o > n.length) throw new Error("invalid index!"); e.insertBefore(t, n[o]); }), (r.hasCanvas = function () { return Boolean(document.createElement("canvas")); }), (r.hitTest = function (e, t, o) { if (!e) throw Error("Hit test target is null!"); var n = e.getBoundingClientRect(); return t >= n.left && t <= n.left + (n.right - n.left) && o >= n.top && o <= n.top + (n.bottom - n.top); }), (r.getScrollOffsets = function () { return null != e.pageXOffset ? { x: e.pageXOffset, y: e.pageYOffset } : "CSS1Compat" == document.compatMode ? { x: document.documentElement.scrollLeft, y: document.documentElement.scrollTop } : void 0; }), (r.getViewportSize = function () { return r.hasPointerEvent && 1 < navigator.msMaxTouchPoints ? { w: document.documentElement.clientWidth || e.innerWidth, h: document.documentElement.clientHeight || e.innerHeight } : r.isMobile ? { w: e.innerWidth, h: e.innerHeight } : { w: document.documentElement.clientWidth || e.innerWidth, h: document.documentElement.clientHeight || e.innerHeight }; }), (r.getViewportMouseCoordinates = function (e) { var t = r.getScrollOffsets(); return e.touches ? { screenX: null == e.touches[0] ? e.touches.pageX - t.x : e.touches[0].pageX - t.x, screenY: null == e.touches[0] ? e.touches.pageY - t.y : e.touches[0].pageY - t.y } : { screenX: null == e.clientX ? e.pageX - t.x : e.clientX, screenY: null == e.clientY ? e.pageY - t.y : e.clientY }; }), (r.hasPointerEvent = Boolean(e.navigator.msPointerEnabled)), (r.isMobile = (function () { if (r.hasPointerEvent && 1 < navigator.msMaxTouchPoints) return !0; var e = ["android", "webos", "iphone", "ipad", "blackberry"]; for (i in e) if (-1 != navigator.userAgent.toLowerCase().indexOf(e[i].toLowerCase())) return !0; return !1; })()), (r.isAndroid = -1 != navigator.userAgent.toLowerCase().indexOf("android".toLowerCase())), (r.isChrome = -1 != navigator.userAgent.toLowerCase().indexOf("chrome")), (r.isSafari = -1 != navigator.userAgent.toLowerCase().indexOf("safari") && -1 == navigator.userAgent.toLowerCase().indexOf("chrome")), (r.isOpera = -1 != navigator.userAgent.toLowerCase().indexOf("opera") && -1 == navigator.userAgent.toLowerCase().indexOf("chrome")), (r.isFirefox = -1 != navigator.userAgent.toLowerCase().indexOf("firefox")), (r.isIE = -1 != navigator.userAgent.toLowerCase().indexOf("msie")), (r.isIEAndLessThen9 = -1 != navigator.userAgent.toLowerCase().indexOf("msie 7") || -1 != navigator.userAgent.toLowerCase().indexOf("msie 8")), (r.isApple = -1 != navigator.appVersion.toLowerCase().indexOf("mac")), (r.hasFullScreen = r.dumy.requestFullScreen || r.dumy.mozRequestFullScreen || r.dumy.webkitRequestFullScreen || r.dumy.msieRequestFullScreen), (r.checkIfHasTransofrms = function () { document.documentElement.appendChild(r.dumy), (r.hasTransform3d = t()), (r.hasTransform2d = o()), (r.isReadyMethodCalled_bl = !0); }), (r.onReady = function (e) { document.addEventListener ? document.addEventListener("DOMContentLoaded", function () { document.documentElement.appendChild(r.dumy), (r.hasTransform3d = t()), (r.hasTransform2d = o()), e(); }) : (document.onreadystatechange = function () { document.documentElement.appendChild(r.dumy), (r.hasTransform3d = t()), (r.hasTransform2d = o()), "complete" == document.readyState && e(); }); }), (r.disableElementSelection = function (e) { try { e.style.userSelect = "none"; } catch (e) { } try { e.style.MozUserSelect = "none"; } catch (e) { } try { e.style.webkitUserSelect = "none"; } catch (e) { } try { e.style.khtmlUserSelect = "none"; } catch (e) { } try { e.style.oUserSelect = "none"; } catch (e) { } try { e.style.msUserSelect = "none"; } catch (e) { } try { e.msUserSelect = "none"; } catch (e) { } e.onselectstart = function () { return !1; }; }), (r.getUrlArgs = function (e) { for (var t = {}, o = (e.substr(e.indexOf("?") + 1) || location.search.substring(1)).split("&"), n = 0; n < o.length; n++) { var i = o[n].indexOf("="), s = o[n].substring(0, i), r = o[n].substring(i + 1); (r = decodeURIComponent(r)), (t[s] = r); } return t; }), (r.validateEmail = function (e) { return !!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(e); }), (r.resizeDoWithLimit = function (e, t, o, n, i, s, r, l, a, d, u, h, c) { var _ = (t = t - s) / n, f = (o = o - r) / i, m = 0; _ <= f ? (m = _) : f <= _ && (m = f); var p = Math.round(n * m), g = Math.round(i * m), v = Math.floor((t - n * m) / 2 + l), b = Math.floor((o - i * m) / 2 + a); d ? FWDAnimation.to(e, u, { x: v, y: b, w: p, h: g, delay: h, ease: c }) : ((e.x = v), (e.y = b), (e.w = p), (e.h = g)); }), (r.isReadyMethodCalled_bl = !1), (e.FWDUtils = r); })(window), !window.FWDAnimation) ) { var _fwd_gsScope = "undefined" != typeof fwd_module && fwd_module.exports && "undefined" != typeof fwd_global ? fwd_global : this || window; (_fwd_gsScope._fwd_gsQueue || (_fwd_gsScope._fwd_gsQueue = [])).push(function () { "use strict"; var S, w, y, O, g, o, v, B, b, T, _, f, p, e, t, a, n; _fwd_gsScope.FWDFWD_gsDefine( "FWDAnimation", ["core.FWDAnim", "core.FWDSimpleTimeline", "FWDTweenLite"], function (n, u, p) { var g = function (e) { var t, o = [], n = e.length; for (t = 0; t !== n; o.push(e[t++])); return o; }, v = function (e, t, o) { var n, i, s = e.cycle; for (n in s) (i = s[n]), (e[n] = "function" == typeof i ? i(o, t[o]) : i[o % i.length]); delete e.cycle; }, b = function (e, t, o) { p.call(this, e, t, o), (this._cycle = 0), (this._yoyo = !0 === this.vars.yoyo), (this._repeat = this.vars.repeat || 0), (this._repeatDelay = this.vars.repeatDelay || 0), (this._dirty = !0), (this.render = b.prototype.render); }, T = 1e-10, w = p._internals, y = w.isSelector, S = w.isArray, e = (b.prototype = p.to({}, 0.1, {})), O = []; (b.version = "1.19.0"), (e.constructor = b), (e.kill()._gc = !1), (b.killTweensOf = b.killDelayedCallsTo = p.killTweensOf), (b.getTweensOf = p.getTweensOf), (b.lagSmoothing = p.lagSmoothing), (b.ticker = p.ticker), (b.render = p.render), (e.invalidate = function () { return (this._yoyo = !0 === this.vars.yoyo), (this._repeat = this.vars.repeat || 0), (this._repeatDelay = this.vars.repeatDelay || 0), this._uncache(!0), p.prototype.invalidate.call(this); }), (e.updateTo = function (e, t) { var o, n = this.ratio, i = this.vars.immediateRender || e.immediateRender; for (o in (t && this._startTime < this._timeline._time && ((this._startTime = this._timeline._time), this._uncache(!1), this._gc ? this._enabled(!0, !1) : this._timeline.insert(this, this._startTime - this._delay)), e)) this.vars[o] = e[o]; if (this._initted || i) if (t) (this._initted = !1), i && this.render(0, !0, !0); else if ((this._gc && this._enabled(!0, !1), this._notifyPluginsOfEnabled && this._firstPT && p._onPluginEvent("_onDisable", this), 0.998 < this._time / this._duration)) { var s = this._totalTime; this.render(0, !0, !1), (this._initted = !1), this.render(s, !0, !1); } else if (((this._initted = !1), this._init(), 0 < this._time || i)) for (var r, l = 1 / (1 - n), a = this._firstPT; a;) (r = a.s + a.c), (a.c *= l), (a.s = r - a.c), (a = a._next); return this; }), (e.render = function (e, t, o) { this._initted || (0 === this._duration && this.vars.repeat && this.invalidate()); var n, i, s, r, l, a, d, u, h = this._dirty ? this.totalDuration() : this._totalDuration, c = this._time, _ = this._totalTime, f = this._cycle, m = this._duration, p = this._rawPrevTime; if ( (h - 1e-7 <= e ? ((this._totalTime = h), (this._cycle = this._repeat), this._yoyo && 0 != (1 & this._cycle) ? ((this._time = 0), (this.ratio = this._ease._calcEnd ? this._ease.getRatio(0) : 0)) : ((this._time = m), (this.ratio = this._ease._calcEnd ? this._ease.getRatio(1) : 1)), this._reversed || ((n = !0), (i = "onComplete"), (o = o || this._timeline.autoRemoveChildren)), 0 === m && (this._initted || !this.vars.lazy || o) && (this._startTime === this._timeline._duration && (e = 0), (p < 0 || (e <= 0 && -1e-7 <= e) || (p === T && "isPause" !== this.data)) && p !== e && ((o = !0), T < p && (i = "onReverseComplete")), (this._rawPrevTime = u = !t || e || p === e ? e : T))) : e < 1e-7 ? ((this._totalTime = this._time = this._cycle = 0), (this.ratio = this._ease._calcEnd ? this._ease.getRatio(0) : 0), (0 !== _ || (0 === m && 0 < p)) && ((i = "onReverseComplete"), (n = this._reversed)), e < 0 && ((this._active = !1), 0 === m && (this._initted || !this.vars.lazy || o) && (0 <= p && (o = !0), (this._rawPrevTime = u = !t || e || p === e ? e : T))), this._initted || (o = !0)) : ((this._totalTime = this._time = e), 0 !== this._repeat && ((r = m + this._repeatDelay), (this._cycle = (this._totalTime / r) >> 0), 0 !== this._cycle && this._cycle === this._totalTime / r && _ <= e && this._cycle--, (this._time = this._totalTime - this._cycle * r), this._yoyo && 0 != (1 & this._cycle) && (this._time = m - this._time), this._time > m ? (this._time = m) : this._time < 0 && (this._time = 0)), this._easeType ? ((l = this._time / m), (1 === (a = this._easeType) || (3 === a && 0.5 <= l)) && (l = 1 - l), 3 === a && (l *= 2), 1 === (d = this._easePower) ? (l *= l) : 2 === d ? (l *= l * l) : 3 === d ? (l *= l * l * l) : 4 === d && (l *= l * l * l * l), 1 === a ? (this.ratio = 1 - l) : 2 === a ? (this.ratio = l) : this._time / m < 0.5 ? (this.ratio = l / 2) : (this.ratio = 1 - l / 2)) : (this.ratio = this._ease.getRatio(this._time / m))), c !== this._time || o || f !== this._cycle) ) { if (!this._initted) { if ((this._init(), !this._initted || this._gc)) return; if (!o && this._firstPT && ((!1 !== this.vars.lazy && this._duration) || (this.vars.lazy && !this._duration))) return (this._time = c), (this._totalTime = _), (this._rawPrevTime = p), (this._cycle = f), w.lazyTweens.push(this), void (this._lazy = [e, t]); this._time && !n ? (this.ratio = this._ease.getRatio(this._time / m)) : n && this._ease._calcEnd && (this.ratio = this._ease.getRatio(0 === this._time ? 0 : 1)); } for ( !1 !== this._lazy && (this._lazy = !1), this._active || (!this._paused && this._time !== c && 0 <= e && (this._active = !0)), 0 === _ && (2 === this._initted && 0 < e && this._init(), this._startAt && (0 <= e ? this._startAt.render(e, t, o) : i || (i = "_dummyGS")), this.vars.onStart && ((0 === this._totalTime && 0 !== m) || t || this._callback("onStart"))), s = this._firstPT; s; ) { if (s.f) s.t[s.p](s.c * this.ratio + s.s); else { var g = s.c * this.ratio + s.s; "x" == s.p ? s.t.setX(g) : "y" == s.p ? s.t.setY(g) : "z" == s.p ? s.t.setZ(g) : "angleX" == s.p ? s.t.setAngleX(g) : "angleY" == s.p ? s.t.setAngleY(g) : "angleZ" == s.p ? s.t.setAngleZ(g) : "w" == s.p ? s.t.setWidth(g) : "h" == s.p ? s.t.setHeight(g) : "alpha" == s.p ? s.t.setAlpha(g) : "scale" == s.p ? s.t.setScale2(g) : (s.t[s.p] = g); } s = s._next; } this._onUpdate && (e < 0 && this._startAt && this._startTime && this._startAt.render(e, t, o), t || ((this._totalTime !== _ || i) && this._callback("onUpdate"))), this._cycle !== f && (t || this._gc || (this.vars.onRepeat && this._callback("onRepeat"))), i && ((this._gc && !o) || (e < 0 && this._startAt && !this._onUpdate && this._startTime && this._startAt.render(e, t, o), n && (this._timeline.autoRemoveChildren && this._enabled(!1, !1), (this._active = !1)), !t && this.vars[i] && this._callback(i), 0 === m && this._rawPrevTime === T && u !== T && (this._rawPrevTime = 0))); } else _ !== this._totalTime && this._onUpdate && (t || this._callback("onUpdate")); }), (b.to = function (e, t, o) { return new b(e, t, o); }), (b.from = function (e, t, o) { return (o.runBackwards = !0), (o.immediateRender = 0 != o.immediateRender), new b(e, t, o); }), (b.fromTo = function (e, t, o, n) { return (n.startAt = o), (n.immediateRender = 0 != n.immediateRender && 0 != o.immediateRender), new b(e, t, n); }), (b.staggerTo = b.allTo = function (e, t, o, n, i, s, r) { n = n || 0; var l, a, d, u, h = 0, c = [], _ = function () { o.onComplete && o.onComplete.apply(o.onCompleteScope || this, arguments), i.apply(r || o.callbackScope || this, s || O); }, f = o.cycle, m = o.startAt && o.startAt.cycle; for (S(e) || ("string" == typeof e && (e = p.selector(e) || e), y(e) && (e = g(e))), e = e || [], n < 0 && ((e = g(e)).reverse(), (n *= -1)), l = e.length - 1, d = 0; d <= l; d++) { for (u in ((a = {}), o)) a[u] = o[u]; if ((f && (v(a, e, d), null != a.duration && ((t = a.duration), delete a.duration)), m)) { for (u in ((m = a.startAt = {}), o.startAt)) m[u] = o.startAt[u]; v(a.startAt, e, d); } (a.delay = h + (a.delay || 0)), d === l && i && (a.onComplete = _), (c[d] = new b(e[d], t, a)), (h += n); } return c; }), (b.staggerFrom = b.allFrom = function (e, t, o, n, i, s, r) { return (o.runBackwards = !0), (o.immediateRender = 0 != o.immediateRender), b.staggerTo(e, t, o, n, i, s, r); }), (b.staggerFromTo = b.allFromTo = function (e, t, o, n, i, s, r, l) { return (n.startAt = o), (n.immediateRender = 0 != n.immediateRender && 0 != o.immediateRender), b.staggerTo(e, t, n, i, s, r, l); }), (b.delayedCall = function (e, t, o, n, i) { return new b(t, 0, { delay: e, onComplete: t, onCompleteParams: o, callbackScope: n, onReverseComplete: t, onReverseCompleteParams: o, immediateRender: !1, useFrames: i, overwrite: 0 }); }), (b.set = function (e, t) { return new b(e, 0, t); }), (b.isTweening = function (e) { return 0 < p.getTweensOf(e, !0).length; }); var s = function (e, t) { for (var o = [], n = 0, i = e._first; i;) i instanceof p ? (o[n++] = i) : (t && (o[n++] = i), (n = (o = o.concat(s(i, t))).length)), (i = i._next); return o; }, h = (b.getAllTweens = function (e) { return s(n._rootTimeline, e).concat(s(n._rootFramesTimeline, e)); }); (b.killAll = function (e, t, o, n) { null == t && (t = !0), null == o && (o = !0); var i, s, r, l = h(0 != n), a = l.length, d = t && o && n; for (r = 0; r < a; r++) (s = l[r]), (d || s instanceof u || ((i = s.target === s.vars.onComplete) && o) || (t && !i)) && (e ? s.totalTime(s._reversed ? 0 : s.totalDuration()) : s._enabled(!1, !1)); }), (b.killChildTweensOf = function (e, t) { if (null != e) { var o, n, i, s, r, l = w.tweenLookup; if (("string" == typeof e && (e = p.selector(e) || e), y(e) && (e = g(e)), S(e))) for (s = e.length; -1 < --s;) b.killChildTweensOf(e[s], t); else { for (i in ((o = []), l)) for (n = l[i].target.parentNode; n;) n === e && (o = o.concat(l[i].tweens)), (n = n.parentNode); for (r = o.length, s = 0; s < r; s++) t && o[s].totalTime(o[s].totalDuration()), o[s]._enabled(!1, !1); } } }); var i = function (e, t, o, n) { (t = !1 !== t), (o = !1 !== o); for (var i, s, r = h((n = !1 !== n)), l = t && o && n, a = r.length; -1 < --a;) (s = r[a]), (l || s instanceof u || ((i = s.target === s.vars.onComplete) && o) || (t && !i)) && s.paused(e); }; return ( (b.pauseAll = function (e, t, o) { i(!0, e, t, o); }), (b.resumeAll = function (e, t, o) { i(!1, e, t, o); }), (b.globalTimeScale = function (e) { var t = n._rootTimeline, o = p.ticker.time; return arguments.length ? ((e = e || T), (t._startTime = o - ((o - t._startTime) * t._timeScale) / e), (t = n._rootFramesTimeline), (o = p.ticker.frame), (t._startTime = o - ((o - t._startTime) * t._timeScale) / e), (t._timeScale = n._rootTimeline._timeScale = e), e) : t._timeScale; }), (e.progress = function (e, t) { return arguments.length ? this.totalTime(this.duration() * (this._yoyo && 0 != (1 & this._cycle) ? 1 - e : e) + this._cycle * (this._duration + this._repeatDelay), t) : this._time / this.duration(); }), (e.totalProgress = function (e, t) { return arguments.length ? this.totalTime(this.totalDuration() * e, t) : this._totalTime / this.totalDuration(); }), (e.time = function (e, t) { return arguments.length ? (this._dirty && this.totalDuration(), e > this._duration && (e = this._duration), this._yoyo && 0 != (1 & this._cycle) ? (e = this._duration - e + this._cycle * (this._duration + this._repeatDelay)) : 0 !== this._repeat && (e += this._cycle * (this._duration + this._repeatDelay)), this.totalTime(e, t)) : this._time; }), (e.duration = function (e) { return arguments.length ? n.prototype.duration.call(this, e) : this._duration; }), (e.totalDuration = function (e) { return arguments.length ? -1 === this._repeat ? this : this.duration((e - this._repeat * this._repeatDelay) / (this._repeat + 1)) : (this._dirty && ((this._totalDuration = -1 === this._repeat ? 999999999999 : this._duration * (this._repeat + 1) + this._repeatDelay * this._repeat), (this._dirty = !1)), this._totalDuration); }), (e.repeat = function (e) { return arguments.length ? ((this._repeat = e), this._uncache(!0)) : this._repeat; }), (e.repeatDelay = function (e) { return arguments.length ? ((this._repeatDelay = e), this._uncache(!0)) : this._repeatDelay; }), (e.yoyo = function (e) { return arguments.length ? ((this._yoyo = e), this) : this._yoyo; }), b ); }, !0 ), _fwd_gsScope.FWDFWD_gsDefine( "FWDTimelineLite", ["core.FWDAnim", "core.FWDSimpleTimeline", "FWDTweenLite"], function (u, h, c) { var _ = function (e) { h.call(this, e), (this._labels = {}), (this.autoRemoveChildren = !0 === this.vars.autoRemoveChildren), (this.smoothChildTiming = !0 === this.vars.smoothChildTiming), (this._sortChildren = !0), (this._onUpdate = this.vars.onUpdate); var t, o, n = this.vars; for (o in n) (t = n[o]), p(t) && -1 !== t.join("").indexOf("{self}") && (n[o] = this._swapSelfInParams(t)); p(n.tweens) && this.add(n.tweens, 0, n.align, n.stagger); }, m = 1e-10, e = c._internals, t = (_._internals = {}), f = e.isSelector, p = e.isArray, g = e.lazyTweens, v = e.lazyRender, r = _fwd_gsScope.FWDFWD_gsDefine.globals, b = function (e) { var t, o = {}; for (t in e) o[t] = e[t]; return o; }, T = function (e, t, o) { var n, i, s = e.cycle; for (n in s) (i = s[n]), (e[n] = "function" == typeof i ? i.call(t[o], o) : i[o % i.length]); delete e.cycle; }, s = (t.pauseCallback = function () { }), w = function (e) { var t, o = [], n = e.length; for (t = 0; t !== n; o.push(e[t++])); return o; }, o = (_.prototype = new h()); return ( (_.version = "1.19.0"), (o.constructor = _), (o.kill()._gc = o._forcingPlayhead = o._hasPause = !1), (o.to = function (e, t, o, n) { var i = (o.repeat && r.FWDAnimation) || c; return t ? this.add(new i(e, t, o), n) : this.set(e, o, n); }), (o.from = function (e, t, o, n) { return this.add(((o.repeat && r.FWDAnimation) || c).from(e, t, o), n); }), (o.fromTo = function (e, t, o, n, i) { var s = (n.repeat && r.FWDAnimation) || c; return t ? this.add(s.fromTo(e, t, o, n), i) : this.set(e, n, i); }), (o.staggerTo = function (e, t, o, n, i, s, r, l) { var a, d, u = new _({ onComplete: s, onCompleteParams: r, callbackScope: l, smoothChildTiming: this.smoothChildTiming }), h = o.cycle; for ("string" == typeof e && (e = c.selector(e) || e), f((e = e || [])) && (e = w(e)), (n = n || 0) < 0 && ((e = w(e)).reverse(), (n *= -1)), d = 0; d < e.length; d++) (a = b(o)).startAt && ((a.startAt = b(a.startAt)), a.startAt.cycle && T(a.startAt, e, d)), h && (T(a, e, d), null != a.duration && ((t = a.duration), delete a.duration)), u.to(e[d], t, a, d * n); return this.add(u, i); }), (o.staggerFrom = function (e, t, o, n, i, s, r, l) { return (o.immediateRender = 0 != o.immediateRender), (o.runBackwards = !0), this.staggerTo(e, t, o, n, i, s, r, l); }), (o.staggerFromTo = function (e, t, o, n, i, s, r, l, a) { return (n.startAt = o), (n.immediateRender = 0 != n.immediateRender && 0 != o.immediateRender), this.staggerTo(e, t, n, i, s, r, l, a); }), (o.call = function (e, t, o, n) { return this.add(c.delayedCall(0, e, t, o), n); }), (o.set = function (e, t, o) { return (o = this._parseTimeOrLabel(o, 0, !0)), null == t.immediateRender && (t.immediateRender = o === this._time && !this._paused), this.add(new c(e, 0, t), o); }), (_.exportRoot = function (e, t) { null == (e = e || {}).smoothChildTiming && (e.smoothChildTiming = !0); var o, n, i = new _(e), s = i._timeline; for (null == t && (t = !0), s._remove(i, !0), i._startTime = 0, i._rawPrevTime = i._time = i._totalTime = s._time, o = s._first; o;) (n = o._next), (t && o instanceof c && o.target === o.vars.onComplete) || i.add(o, o._startTime - o._delay), (o = n); return s.add(i, 0), i; }), (o.add = function (e, t, o, n) { var i, s, r, l, a, d; if (("number" != typeof t && (t = this._parseTimeOrLabel(t, 0, !0, e)), !(e instanceof u))) { if (e instanceof Array || (e && e.push && p(e))) { for (o = o || "normal", n = n || 0, i = t, s = e.length, r = 0; r < s; r++) p((l = e[r])) && (l = new _({ tweens: l })), this.add(l, i), "string" != typeof l && "function" != typeof l && ("sequence" === o ? (i = l._startTime + l.totalDuration() / l._timeScale) : "start" === o && (l._startTime -= l.delay())), (i += n); return this._uncache(!0); } if ("string" == typeof e) return this.addLabel(e, t); if ("function" != typeof e) throw "Cannot add " + e + " into the timeline; it is not a tween, timeline, function, or string."; e = c.delayedCall(0, e); } if ((h.prototype.add.call(this, e, t), (this._gc || this._time === this._duration) && !this._paused && this._duration < this.duration())) for (d = (a = this).rawTime() > e._startTime; a._timeline;) d && a._timeline.smoothChildTiming ? a.totalTime(a._totalTime, !0) : a._gc && a._enabled(!0, !1), (a = a._timeline); return this; }), (o.remove = function (e) { if (e instanceof u) { this._remove(e, !1); var t = (e._timeline = e.vars.useFrames ? u._rootFramesTimeline : u._rootTimeline); return (e._startTime = (e._paused ? e._pauseTime : t._time) - (e._reversed ? e.totalDuration() - e._totalTime : e._totalTime) / e._timeScale), this; } if (e instanceof Array || (e && e.push && p(e))) { for (var o = e.length; -1 < --o;) this.remove(e[o]); return this; } return "string" == typeof e ? this.removeLabel(e) : this.kill(null, e); }), (o._remove = function (e, t) { h.prototype._remove.call(this, e, t); var o = this._last; return ( o ? this._time > o._startTime + o._totalDuration / o._timeScale && ((this._time = this.duration()), (this._totalTime = this._totalDuration)) : (this._time = this._totalTime = this._duration = this._totalDuration = 0), this ); }), (o.append = function (e, t) { return this.add(e, this._parseTimeOrLabel(null, t, !0, e)); }), (o.insert = o.insertMultiple = function (e, t, o, n) { return this.add(e, t || 0, o, n); }), (o.appendMultiple = function (e, t, o, n) { return this.add(e, this._parseTimeOrLabel(null, t, !0, e), o, n); }), (o.addLabel = function (e, t) { return (this._labels[e] = this._parseTimeOrLabel(t)), this; }), (o.addPause = function (e, t, o, n) { var i = c.delayedCall(0, s, o, n || this); return (i.vars.onComplete = i.vars.onReverseComplete = t), (i.data = "isPause"), (this._hasPause = !0), this.add(i, e); }), (o.removeLabel = function (e) { return delete this._labels[e], this; }), (o.getLabelTime = function (e) { return null != this._labels[e] ? this._labels[e] : -1; }), (o._parseTimeOrLabel = function (e, t, o, n) { var i; if (n instanceof u && n.timeline === this) this.remove(n); else if (n && (n instanceof Array || (n.push && p(n)))) for (i = n.length; -1 < --i;) n[i] instanceof u && n[i].timeline === this && this.remove(n[i]); if ("string" == typeof t) return this._parseTimeOrLabel(t, o && "number" == typeof e && null == this._labels[t] ? e - this.duration() : 0, o); if (((t = t || 0), "string" != typeof e || (!isNaN(e) && null == this._labels[e]))) null == e && (e = this.duration()); else { if (-1 === (i = e.indexOf("="))) return null == this._labels[e] ? (o ? (this._labels[e] = this.duration() + t) : t) : this._labels[e] + t; (t = parseInt(e.charAt(i - 1) + "1", 10) * Number(e.substr(i + 1))), (e = 1 < i ? this._parseTimeOrLabel(e.substr(0, i - 1), 0, o) : this.duration()); } return Number(e) + t; }), (o.seek = function (e, t) { return this.totalTime("number" == typeof e ? e : this._parseTimeOrLabel(e), !1 !== t); }), (o.stop = function () { return this.paused(!0); }), (o.gotoAndPlay = function (e, t) { return this.play(e, t); }), (o.gotoAndStop = function (e, t) { return this.pause(e, t); }), (o.render = function (e, t, o) { this._gc && this._enabled(!0, !1); var n, i, s, r, l, a, d, u = this._dirty ? this.totalDuration() : this._totalDuration, h = this._time, c = this._startTime, _ = this._timeScale, f = this._paused; if (u - 1e-7 <= e) (this._totalTime = this._time = u), this._reversed || this._hasPausedChild() || ((i = !0), (r = "onComplete"), (l = !!this._timeline.autoRemoveChildren), 0 === this._duration && ((e <= 0 && -1e-7 <= e) || this._rawPrevTime < 0 || this._rawPrevTime === m) && this._rawPrevTime !== e && this._first && ((l = !0), this._rawPrevTime > m && (r = "onReverseComplete"))), (this._rawPrevTime = this._duration || !t || e || this._rawPrevTime === e ? e : m), (e = u + 1e-4); else if (e < 1e-7) if ( ((this._totalTime = this._time = 0), (0 !== h || (0 === this._duration && this._rawPrevTime !== m && (0 < this._rawPrevTime || (e < 0 && 0 <= this._rawPrevTime)))) && ((r = "onReverseComplete"), (i = this._reversed)), e < 0) ) (this._active = !1), this._timeline.autoRemoveChildren && this._reversed ? ((l = i = !0), (r = "onReverseComplete")) : 0 <= this._rawPrevTime && this._first && (l = !0), (this._rawPrevTime = e); else { if (((this._rawPrevTime = this._duration || !t || e || this._rawPrevTime === e ? e : m), 0 === e && i)) for (n = this._first; n && 0 === n._startTime;) n._duration || (i = !1), (n = n._next); (e = 0), this._initted || (l = !0); } else { if (this._hasPause && !this._forcingPlayhead && !t) { if (h <= e) for (n = this._first; n && n._startTime <= e && !a;) n._duration || "isPause" !== n.data || n.ratio || (0 === n._startTime && 0 === this._rawPrevTime) || (a = n), (n = n._next); else for (n = this._last; n && n._startTime >= e && !a;) n._duration || ("isPause" === n.data && 0 < n._rawPrevTime && (a = n)), (n = n._prev); a && ((this._time = e = a._startTime), (this._totalTime = e + this._cycle * (this._totalDuration + this._repeatDelay))); } this._totalTime = this._time = this._rawPrevTime = e; } if ((this._time !== h && this._first) || o || l || a) { if ( (this._initted || (this._initted = !0), this._active || (!this._paused && this._time !== h && 0 < e && (this._active = !0)), 0 === h && this.vars.onStart && ((0 === this._time && this._duration) || t || this._callback("onStart")), h <= (d = this._time)) ) for (n = this._first; n && ((s = n._next), d === this._time && (!this._paused || f));) (n._active || (n._startTime <= d && !n._paused && !n._gc)) && (a === n && this.pause(), n._reversed ? n.render((n._dirty ? n.totalDuration() : n._totalDuration) - (e - n._startTime) * n._timeScale, t, o) : n.render((e - n._startTime) * n._timeScale, t, o)), (n = s); else for (n = this._last; n && ((s = n._prev), d === this._time && (!this._paused || f));) { if (n._active || (n._startTime <= h && !n._paused && !n._gc)) { if (a === n) { for (a = n._prev; a && a.endTime() > this._time;) a.render(a._reversed ? a.totalDuration() - (e - a._startTime) * a._timeScale : (e - a._startTime) * a._timeScale, t, o), (a = a._prev); (a = null), this.pause(); } n._reversed ? n.render((n._dirty ? n.totalDuration() : n._totalDuration) - (e - n._startTime) * n._timeScale, t, o) : n.render((e - n._startTime) * n._timeScale, t, o); } n = s; } this._onUpdate && (t || (g.length && v(), this._callback("onUpdate"))), r && (this._gc || (c !== this._startTime && _ === this._timeScale) || ((0 === this._time || u >= this.totalDuration()) && (i && (g.length && v(), this._timeline.autoRemoveChildren && this._enabled(!1, !1), (this._active = !1)), !t && this.vars[r] && this._callback(r)))); } }), (o._hasPausedChild = function () { for (var e = this._first; e;) { if (e._paused || (e instanceof _ && e._hasPausedChild())) return !0; e = e._next; } return !1; }), (o.getChildren = function (e, t, o, n) { n = n || -9999999999; for (var i = [], s = this._first, r = 0; s;) s._startTime < n || (s instanceof c ? !1 !== t && (i[r++] = s) : (!1 !== o && (i[r++] = s), !1 !== e && (r = (i = i.concat(s.getChildren(!0, t, o))).length))), (s = s._next); return i; }), (o.getTweensOf = function (e, t) { var o, n, i = this._gc, s = [], r = 0; for (i && this._enabled(!0, !0), n = (o = c.getTweensOf(e)).length; -1 < --n;) (o[n].timeline === this || (t && this._contains(o[n]))) && (s[r++] = o[n]); return i && this._enabled(!1, !0), s; }), (o.recent = function () { return this._recent; }), (o._contains = function (e) { for (var t = e.timeline; t;) { if (t === this) return !0; t = t.timeline; } return !1; }), (o.shiftChildren = function (e, t, o) { o = o || 0; for (var n, i = this._first, s = this._labels; i;) i._startTime >= o && (i._startTime += e), (i = i._next); if (t) for (n in s) s[n] >= o && (s[n] += e); return this._uncache(!0); }), (o._kill = function (e, t) { if (!e && !t) return this._enabled(!1, !1); for (var o = t ? this.getTweensOf(t) : this.getChildren(!0, !0, !1), n = o.length, i = !1; -1 < --n;) o[n]._kill(e, t) && (i = !0); return i; }), (o.clear = function (e) { var t = this.getChildren(!1, !0, !0), o = t.length; for (this._time = this._totalTime = 0; -1 < --o;) t[o]._enabled(!1, !1); return !1 !== e && (this._labels = {}), this._uncache(!0); }), (o.invalidate = function () { for (var e = this._first; e;) e.invalidate(), (e = e._next); return u.prototype.invalidate.call(this); }), (o._enabled = function (e, t) { if (e === this._gc) for (var o = this._first; o;) o._enabled(e, !0), (o = o._next); return h.prototype._enabled.call(this, e, t); }), (o.totalTime = function (e, t, o) { this._forcingPlayhead = !0; var n = u.prototype.totalTime.apply(this, arguments); return (this._forcingPlayhead = !1), n; }), (o.duration = function (e) { return arguments.length ? (0 !== this.duration() && 0 !== e && this.timeScale(this._duration / e), this) : (this._dirty && this.totalDuration(), this._duration); }), (o.totalDuration = function (e) { if (!arguments.length) { if (this._dirty) { for (var t, o, n = 0, i = this._last, s = 999999999999; i;) (t = i._prev), i._dirty && i.totalDuration(), i._startTime > s && this._sortChildren && !i._paused ? this.add(i, i._startTime - i._delay) : (s = i._startTime), i._startTime < 0 && !i._paused && ((n -= i._startTime), this._timeline.smoothChildTiming && (this._startTime += i._startTime / this._timeScale), this.shiftChildren(-i._startTime, !1, -9999999999), (s = 0)), n < (o = i._startTime + i._totalDuration / i._timeScale) && (n = o), (i = t); (this._duration = this._totalDuration = n), (this._dirty = !1); } return this._totalDuration; } return e && this.totalDuration() ? this.timeScale(this._totalDuration / e) : this; }), (o.paused = function (e) { if (!e) for (var t = this._first, o = this._time; t;) t._startTime === o && "isPause" === t.data && (t._rawPrevTime = 0), (t = t._next); return u.prototype.paused.apply(this, arguments); }), (o.usesFrames = function () { for (var e = this._timeline; e._timeline;) e = e._timeline; return e === u._rootFramesTimeline; }), (o.rawTime = function () { return this._paused ? this._totalTime : (this._timeline.rawTime() - this._startTime) * this._timeScale; }), _ ); }, !0 ), _fwd_gsScope.FWDFWD_gsDefine( "TimelineMax", ["FWDTimelineLite", "FWDTweenLite", "easing.Ease"], function (t, l, e) { var o = function (e) { t.call(this, e), (this._repeat = this.vars.repeat || 0), (this._repeatDelay = this.vars.repeatDelay || 0), (this._cycle = 0), (this._yoyo = !0 === this.vars.yoyo), (this._dirty = !0); }, D = 1e-10, n = l._internals, W = n.lazyTweens, H = n.lazyRender, a = _fwd_gsScope.FWDFWD_gsDefine.globals, d = new e(null, null, 1, 0), i = (o.prototype = new t()); return ( (i.constructor = o), (i.kill()._gc = !1), (o.version = "1.19.0"), (i.invalidate = function () { return (this._yoyo = !0 === this.vars.yoyo), (this._repeat = this.vars.repeat || 0), (this._repeatDelay = this.vars.repeatDelay || 0), this._uncache(!0), t.prototype.invalidate.call(this); }), (i.addCallback = function (e, t, o, n) { return this.add(l.delayedCall(0, e, o, n), t); }), (i.removeCallback = function (e, t) { if (e) if (null == t) this._kill(null, e); else for (var o = this.getTweensOf(e, !1), n = o.length, i = this._parseTimeOrLabel(t); -1 < --n;) o[n]._startTime === i && o[n]._enabled(!1, !1); return this; }), (i.removePause = function (e) { return this.removeCallback(t._internals.pauseCallback, e); }), (i.tweenTo = function (e, t) { t = t || {}; var o, n, i, s = { ease: d, useFrames: this.usesFrames(), immediateRender: !1 }, r = (t.repeat && a.FWDAnimation) || l; for (n in t) s[n] = t[n]; return ( (s.time = this._parseTimeOrLabel(e)), (o = Math.abs(Number(s.time) - this._time) / this._timeScale || 0.001), (i = new r(this, o, s)), (s.onStart = function () { i.target.paused(!0), i.vars.time !== i.target.time() && o === i.duration() && i.duration(Math.abs(i.vars.time - i.target.time()) / i.target._timeScale), t.onStart && i._callback("onStart"); }), i ); }), (i.tweenFromTo = function (e, t, o) { (o = o || {}), (e = this._parseTimeOrLabel(e)), (o.startAt = { onComplete: this.seek, onCompleteParams: [e], callbackScope: this }), (o.immediateRender = !1 !== o.immediateRender); var n = this.tweenTo(t, o); return n.duration(Math.abs(n.vars.time - e) / this._timeScale || 0.001); }), (i.render = function (e, t, o) { this._gc && this._enabled(!0, !1); var n, i, s, r, l, a, d, u, h = this._dirty ? this.totalDuration() : this._totalDuration, c = this._duration, _ = this._time, f = this._totalTime, m = this._startTime, p = this._timeScale, g = this._rawPrevTime, v = this._paused, b = this._cycle; if (h - 1e-7 <= e) this._locked || ((this._totalTime = h), (this._cycle = this._repeat)), this._reversed || this._hasPausedChild() || ((i = !0), (r = "onComplete"), (l = !!this._timeline.autoRemoveChildren), 0 === this._duration && ((e <= 0 && -1e-7 <= e) || g < 0 || g === D) && g !== e && this._first && ((l = !0), D < g && (r = "onReverseComplete"))), (this._rawPrevTime = this._duration || !t || e || this._rawPrevTime === e ? e : D), this._yoyo && 0 != (1 & this._cycle) ? (this._time = e = 0) : (e = (this._time = c) + 1e-4); else if (e < 1e-7) if ( (this._locked || (this._totalTime = this._cycle = 0), ((this._time = 0) !== _ || (0 === c && g !== D && (0 < g || (e < 0 && 0 <= g)) && !this._locked)) && ((r = "onReverseComplete"), (i = this._reversed)), e < 0) ) (this._active = !1), this._timeline.autoRemoveChildren && this._reversed ? ((l = i = !0), (r = "onReverseComplete")) : 0 <= g && this._first && (l = !0), (this._rawPrevTime = e); else { if (((this._rawPrevTime = c || !t || e || this._rawPrevTime === e ? e : D), 0 === e && i)) for (n = this._first; n && 0 === n._startTime;) n._duration || (i = !1), (n = n._next); (e = 0), this._initted || (l = !0); } else if ( (0 === c && g < 0 && (l = !0), (this._time = this._rawPrevTime = e), this._locked || ((this._totalTime = e), 0 !== this._repeat && ((a = c + this._repeatDelay), (this._cycle = (this._totalTime / a) >> 0), 0 !== this._cycle && this._cycle === this._totalTime / a && f <= e && this._cycle--, (this._time = this._totalTime - this._cycle * a), this._yoyo && 0 != (1 & this._cycle) && (this._time = c - this._time), this._time > c ? (e = (this._time = c) + 1e-4) : this._time < 0 ? (this._time = e = 0) : (e = this._time))), this._hasPause && !this._forcingPlayhead && !t) ) { if (_ <= (e = this._time)) for (n = this._first; n && n._startTime <= e && !d;) n._duration || "isPause" !== n.data || n.ratio || (0 === n._startTime && 0 === this._rawPrevTime) || (d = n), (n = n._next); else for (n = this._last; n && n._startTime >= e && !d;) n._duration || ("isPause" === n.data && 0 < n._rawPrevTime && (d = n)), (n = n._prev); d && ((this._time = e = d._startTime), (this._totalTime = e + this._cycle * (this._totalDuration + this._repeatDelay))); } if (this._cycle !== b && !this._locked) { var T = this._yoyo && 0 != (1 & b), w = T === (this._yoyo && 0 != (1 & this._cycle)), y = this._totalTime, S = this._cycle, O = this._rawPrevTime, B = this._time; if ( ((this._totalTime = b * c), this._cycle < b ? (T = !T) : (this._totalTime += c), (this._time = _), (this._rawPrevTime = 0 === c ? g - 1e-4 : g), (this._cycle = b), (this._locked = !0), (_ = T ? 0 : c), this.render(_, t, 0 === c), t || this._gc || (this.vars.onRepeat && this._callback("onRepeat")), _ !== this._time) ) return; if ((w && ((_ = T ? c + 1e-4 : -1e-4), this.render(_, !0, !1)), (this._locked = !1), this._paused && !v)) return; (this._time = B), (this._totalTime = y), (this._cycle = S), (this._rawPrevTime = O); } if ((this._time !== _ && this._first) || o || l || d) { if ( (this._initted || (this._initted = !0), this._active || (!this._paused && this._totalTime !== f && 0 < e && (this._active = !0)), 0 === f && this.vars.onStart && ((0 === this._totalTime && this._totalDuration) || t || this._callback("onStart")), _ <= (u = this._time)) ) for (n = this._first; n && ((s = n._next), u === this._time && (!this._paused || v));) (n._active || (n._startTime <= this._time && !n._paused && !n._gc)) && (d === n && this.pause(), n._reversed ? n.render((n._dirty ? n.totalDuration() : n._totalDuration) - (e - n._startTime) * n._timeScale, t, o) : n.render((e - n._startTime) * n._timeScale, t, o)), (n = s); else for (n = this._last; n && ((s = n._prev), u === this._time && (!this._paused || v));) { if (n._active || (n._startTime <= _ && !n._paused && !n._gc)) { if (d === n) { for (d = n._prev; d && d.endTime() > this._time;) d.render(d._reversed ? d.totalDuration() - (e - d._startTime) * d._timeScale : (e - d._startTime) * d._timeScale, t, o), (d = d._prev); (d = null), this.pause(); } n._reversed ? n.render((n._dirty ? n.totalDuration() : n._totalDuration) - (e - n._startTime) * n._timeScale, t, o) : n.render((e - n._startTime) * n._timeScale, t, o); } n = s; } this._onUpdate && (t || (W.length && H(), this._callback("onUpdate"))), r && (this._locked || this._gc || (m !== this._startTime && p === this._timeScale) || ((0 === this._time || h >= this.totalDuration()) && (i && (W.length && H(), this._timeline.autoRemoveChildren && this._enabled(!1, !1), (this._active = !1)), !t && this.vars[r] && this._callback(r)))); } else f !== this._totalTime && this._onUpdate && (t || this._callback("onUpdate")); }), (i.getActive = function (e, t, o) { null == e && (e = !0), null == t && (t = !0), null == o && (o = !1); var n, i, s = [], r = this.getChildren(e, t, o), l = 0, a = r.length; for (n = 0; n < a; n++) (i = r[n]).isActive() && (s[l++] = i); return s; }), (i.getLabelAfter = function (e) { e || (0 !== e && (e = this._time)); var t, o = this.getLabelsArray(), n = o.length; for (t = 0; t < n; t++) if (o[t].time > e) return o[t].name; return null; }), (i.getLabelBefore = function (e) { null == e && (e = this._time); for (var t = this.getLabelsArray(), o = t.length; -1 < --o;) if (t[o].time < e) return t[o].name; return null; }), (i.getLabelsArray = function () { var e, t = [], o = 0; for (e in this._labels) t[o++] = { time: this._labels[e], name: e }; return ( t.sort(function (e, t) { return e.time - t.time; }), t ); }), (i.progress = function (e, t) { return arguments.length ? this.totalTime(this.duration() * (this._yoyo && 0 != (1 & this._cycle) ? 1 - e : e) + this._cycle * (this._duration + this._repeatDelay), t) : this._time / this.duration(); }), (i.totalProgress = function (e, t) { return arguments.length ? this.totalTime(this.totalDuration() * e, t) : this._totalTime / this.totalDuration(); }), (i.totalDuration = function (e) { return arguments.length ? -1 !== this._repeat && e ? this.timeScale(this.totalDuration() / e) : this : (this._dirty && (t.prototype.totalDuration.call(this), (this._totalDuration = -1 === this._repeat ? 999999999999 : this._duration * (this._repeat + 1) + this._repeatDelay * this._repeat)), this._totalDuration); }), (i.time = function (e, t) { return arguments.length ? (this._dirty && this.totalDuration(), e > this._duration && (e = this._duration), this._yoyo && 0 != (1 & this._cycle) ? (e = this._duration - e + this._cycle * (this._duration + this._repeatDelay)) : 0 !== this._repeat && (e += this._cycle * (this._duration + this._repeatDelay)), this.totalTime(e, t)) : this._time; }), (i.repeat = function (e) { return arguments.length ? ((this._repeat = e), this._uncache(!0)) : this._repeat; }), (i.repeatDelay = function (e) { return arguments.length ? ((this._repeatDelay = e), this._uncache(!0)) : this._repeatDelay; }), (i.yoyo = function (e) { return arguments.length ? ((this._yoyo = e), this) : this._yoyo; }), (i.currentLabel = function (e) { return arguments.length ? this.seek(e, !0) : this.getLabelBefore(this._time + 1e-8); }), o ); }, !0 ), (S = 180 / Math.PI), (w = []), (y = []), (O = []), (g = {}), (o = _fwd_gsScope.FWDFWD_gsDefine.globals), (v = function (e, t, o, n) { o === n && (o = n - (n - t) / 1e6), e === t && (t = e + (o - e) / 1e6), (this.a = e), (this.b = t), (this.c = o), (this.d = n), (this.da = n - e), (this.ca = o - e), (this.ba = t - e); }), (B = function (e, t, o, n) { var i = { a: e }, s = {}, r = {}, l = { c: n }, a = (e + t) / 2, d = (t + o) / 2, u = (o + n) / 2, h = (a + d) / 2, c = (d + u) / 2, _ = (c - h) / 8; return (i.b = a + (e - a) / 4), (s.b = h + _), (i.c = s.a = (i.b + s.b) / 2), (s.c = r.a = (h + c) / 2), (r.b = c - _), (l.b = u + (n - u) / 4), (r.c = l.a = (r.b + l.b) / 2), [i, s, r, l]; }), (b = function (e, t, o, n, i) { var s, r, l, a, d, u, h, c, _, f, m, p, g, v = e.length - 1, b = 0, T = e[0].a; for (s = 0; s < v; s++) (r = (d = e[b]).a), (l = d.d), (a = e[b + 1].d), i ? ((m = w[s]), (g = (((p = y[s]) + m) * t * 0.25) / (n ? 0.5 : O[s] || 0.5)), (c = l - ((u = l - (l - r) * (n ? 0.5 * t : 0 !== m ? g / m : 0)) + ((((h = l + (a - l) * (n ? 0.5 * t : 0 !== p ? g / p : 0)) - u) * ((3 * m) / (m + p) + 0.5)) / 4 || 0)))) : (c = l - ((u = l - (l - r) * t * 0.5) + (h = l + (a - l) * t * 0.5)) / 2), (u += c), (h += c), (d.c = _ = u), (d.b = 0 !== s ? T : (T = d.a + 0.6 * (d.c - d.a))), (d.da = l - r), (d.ca = _ - r), (d.ba = T - r), o ? ((f = B(r, T, _, l)), e.splice(b, 1, f[0], f[1], f[2], f[3]), (b += 4)) : b++, (T = h); ((d = e[b]).b = T), (d.c = T + 0.4 * (d.d - T)), (d.da = d.d - d.a), (d.ca = d.c - d.a), (d.ba = T - d.a), o && ((f = B(d.a, T, d.c, d.d)), e.splice(b, 1, f[0], f[1], f[2], f[3])); }), (T = function (e, t, o, n) { var i, s, r, l, a, d, u = []; if (n) for (s = (e = [n].concat(e)).length; -1 < --s;) "string" == typeof (d = e[s][t]) && "=" === d.charAt(1) && (e[s][t] = n[t] + Number(d.charAt(0) + d.substr(2))); if ((i = e.length - 2) < 0) return (u[0] = new v(e[0][t], 0, 0, e[i < -1 ? 0 : 1][t])), u; for (s = 0; s < i; s++) (r = e[s][t]), (l = e[s + 1][t]), (u[s] = new v(r, 0, 0, l)), o && ((a = e[s + 2][t]), (w[s] = (w[s] || 0) + (l - r) * (l - r)), (y[s] = (y[s] || 0) + (a - l) * (a - l))); return (u[s] = new v(e[s][t], 0, 0, e[s + 1][t])), u; }), (_ = function (e, t, o, n, i, s) { var r, l, a, d, u, h, c, _, f = {}, m = [], p = s || e[0]; for (l in ((i = "string" == typeof i ? "," + i + "," : ",x,y,z,left,top,right,bottom,marginTop,marginLeft,marginRight,marginBottom,paddingLeft,paddingTop,paddingRight,paddingBottom,backgroundPosition,backgroundPosition_y,"), null == t && (t = 1), e[0])) m.push(l); if (1 < e.length) { for (_ = e[e.length - 1], c = !0, r = m.length; -1 < --r;) if (((l = m[r]), 0.05 < Math.abs(p[l] - _[l]))) { c = !1; break; } c && ((e = e.concat()), s && e.unshift(s), e.push(e[1]), (s = e[e.length - 3])); } for (w.length = y.length = O.length = 0, r = m.length; -1 < --r;) (l = m[r]), (g[l] = -1 !== i.indexOf("," + l + ",")), (f[l] = T(e, l, g[l], s)); for (r = w.length; -1 < --r;) (w[r] = Math.sqrt(w[r])), (y[r] = Math.sqrt(y[r])); if (!n) { for (r = m.length; -1 < --r;) if (g[l]) for (h = (a = f[m[r]]).length - 1, d = 0; d < h; d++) (u = a[d + 1].da / y[d] + a[d].da / w[d] || 0), (O[d] = (O[d] || 0) + u * u); for (r = O.length; -1 < --r;) O[r] = Math.sqrt(O[r]); } for (r = m.length, d = o ? 4 : 1; -1 < --r;) (a = f[(l = m[r])]), b(a, t, o, n, g[l]), c && (a.splice(0, d), a.splice(a.length - d, d)); return f; }), (f = function (e, t, o) { for (var n, i, s, r, l, a, d, u, h, c, _, f = 1 / o, m = e.length; -1 < --m;) for (s = (c = e[m]).a, r = c.d - s, l = c.c - s, a = c.b - s, n = i = 0, u = 1; u <= o; u++) (n = i - (i = ((d = f * u) * d * r + 3 * (h = 1 - d) * (d * l + h * a)) * d)), (t[(_ = m * o + u - 1)] = (t[_] || 0) + n * n); }), (p = _fwd_gsScope.FWDFWD_gsDefine.plugin({ propName: "bezier", priority: -1, version: "1.3.7", API: 2, fwd_global: !0, init: function (e, t, o) { (this._target = e), t instanceof Array && (t = { values: t }), (this._func = {}), (this._mod = {}), (this._props = []), (this._timeRes = null == t.timeResolution ? 6 : parseInt(t.timeResolution, 10)); var n, i, s, r, l, a = t.values || [], d = {}, u = a[0], h = t.autoRotate || o.vars.orientToBezier; for (n in ((this._autoRotate = h ? (h instanceof Array ? h : [["x", "y", "rotation", !0 === h ? 0 : Number(h) || 0]]) : null), u)) this._props.push(n); for (s = this._props.length; -1 < --s;) (n = this._props[s]), this._overwriteProps.push(n), (i = this._func[n] = "function" == typeof e[n]), (d[n] = i ? e[n.indexOf("set") || "function" != typeof e["get" + n.substr(3)] ? n : "get" + n.substr(3)]() : parseFloat(e[n])), l || (d[n] !== a[0][n] && (l = d)); if ( ((this._beziers = "cubic" !== t.type && "quadratic" !== t.type && "soft" !== t.type ? _(a, isNaN(t.curviness) ? 1 : t.curviness, !1, "thruBasic" === t.type, t.correlate, l) : (function (e, t, o) { var n, i, s, r, l, a, d, u, h, c, _, f = {}, m = "cubic" === (t = t || "soft") ? 3 : 2, p = "soft" === t, g = []; if ((p && o && (e = [o].concat(e)), null == e || e.length < m + 1)) throw "invalid Bezier data"; for (h in e[0]) g.push(h); for (a = g.length; -1 < --a;) { for (f[(h = g[a])] = l = [], c = 0, u = e.length, d = 0; d < u; d++) (n = null == o ? e[d][h] : "string" == typeof (_ = e[d][h]) && "=" === _.charAt(1) ? o[h] + Number(_.charAt(0) + _.substr(2)) : Number(_)), p && 1 < d && d < u - 1 && (l[c++] = (n + l[c - 2]) / 2), (l[c++] = n); for (u = c - m + 1, d = c = 0; d < u; d += m) (n = l[d]), (i = l[d + 1]), (s = l[d + 2]), (r = 2 === m ? 0 : l[d + 3]), (l[c++] = _ = 3 === m ? new v(n, i, s, r) : new v(n, (2 * i + n) / 3, (2 * i + s) / 3, s)); l.length = c; } return f; })(a, t.type, d)), (this._segCount = this._beziers[n].length), this._timeRes) ) { var c = (function (e, t) { var o, n, i, s, r = [], l = [], a = 0, d = 0, u = (t = t >> 0 || 6) - 1, h = [], c = []; for (o in e) f(e[o], r, t); for (i = r.length, n = 0; n < i; n++) (a += Math.sqrt(r[n])), (c[(s = n % t)] = a), s === u && ((d += a), (h[(s = (n / t) >> 0)] = c), (l[s] = d), (a = 0), (c = [])); return { length: d, lengths: l, segments: h }; })(this._beziers, this._timeRes); (this._length = c.length), (this._lengths = c.lengths), (this._segments = c.segments), (this._l1 = this._li = this._s1 = this._si = 0), (this._l2 = this._lengths[0]), (this._curSeg = this._segments[0]), (this._s2 = this._curSeg[0]), (this._prec = 1 / this._curSeg.length); } if ((h = this._autoRotate)) for (this._initialRotations = [], h[0] instanceof Array || (this._autoRotate = h = [h]), s = h.length; -1 < --s;) { for (r = 0; r < 3; r++) (n = h[s][r]), (this._func[n] = "function" == typeof e[n] && e[n.indexOf("set") || "function" != typeof e["get" + n.substr(3)] ? n : "get" + n.substr(3)]); (n = h[s][2]), (this._initialRotations[s] = (this._func[n] ? this._func[n].call(this._target) : this._target[n]) || 0), this._overwriteProps.push(n); } return (this._startRatio = o.vars.runBackwards ? 1 : 0), !0; }, set: function (e) { var t, o, n, i, s, r, l, a, d, u, h = this._segCount, c = this._func, _ = this._target, f = e !== this._startRatio; if (this._timeRes) { if (((d = this._lengths), (u = this._curSeg), (e *= this._length), (n = this._li), e > this._l2 && n < h - 1)) { for (a = h - 1; n < a && (this._l2 = d[++n]) <= e;); (this._l1 = d[n - 1]), (this._li = n), (this._curSeg = u = this._segments[n]), (this._s2 = u[(this._s1 = this._si = 0)]); } else if (e < this._l1 && 0 < n) { for (; 0 < n && (this._l1 = d[--n]) >= e;); 0 === n && e < this._l1 ? (this._l1 = 0) : n++, (this._l2 = d[n]), (this._li = n), (this._curSeg = u = this._segments[n]), (this._s1 = u[(this._si = u.length - 1) - 1] || 0), (this._s2 = u[this._si]); } if (((t = n), (e -= this._l1), (n = this._si), e > this._s2 && n < u.length - 1)) { for (a = u.length - 1; n < a && (this._s2 = u[++n]) <= e;); (this._s1 = u[n - 1]), (this._si = n); } else if (e < this._s1 && 0 < n) { for (; 0 < n && (this._s1 = u[--n]) >= e;); 0 === n && e < this._s1 ? (this._s1 = 0) : n++, (this._s2 = u[n]), (this._si = n); } r = (n + (e - this._s1) / (this._s2 - this._s1)) * this._prec || 0; } else r = (e - (t = e < 0 ? 0 : 1 <= e ? h - 1 : (h * e) >> 0) * (1 / h)) * h; for (o = 1 - r, n = this._props.length; -1 < --n;) (i = this._props[n]), (l = (r * r * (s = this._beziers[i][t]).da + 3 * o * (r * s.ca + o * s.ba)) * r + s.a), this._mod[i] && (l = this._mod[i](l, _)), c[i] ? _[i](l) : "x" == i ? _.setX(l) : "y" == i ? _.setY(l) : "z" == i ? _.setZ(l) : "angleX" == i ? _.setAngleX(l) : "angleY" == i ? _.setAngleY(l) : "angleZ" == i ? _.setAngleZ(l) : "w" == i ? _.setWidth(l) : "h" == i ? _.setHeight(l) : "alpha" == i ? _.setAlpha(l) : "scale" == i ? _.setScale2(l) : (_[i] = l); if (this._autoRotate) { var m, p, g, v, b, T, w, y = this._autoRotate; for (n = y.length; -1 < --n;) (i = y[n][2]), (T = y[n][3] || 0), (w = !0 === y[n][4] ? 1 : S), (s = this._beziers[y[n][0]]), (m = this._beziers[y[n][1]]), s && m && ((s = s[t]), (m = m[t]), (p = s.a + (s.b - s.a) * r), (p += ((v = s.b + (s.c - s.b) * r) - p) * r), (v += (s.c + (s.d - s.c) * r - v) * r), (g = m.a + (m.b - m.a) * r), (g += ((b = m.b + (m.c - m.b) * r) - g) * r), (b += (m.c + (m.d - m.c) * r - b) * r), (l = f ? Math.atan2(b - g, v - p) * w + T : this._initialRotations[n]), this._mod[i] && (l = this._mod[i](l, _)), c[i] ? _[i](l) : (_[i] = l)); } }, })), (e = p.prototype), (p.bezierThrough = _), (p.cubicToQuadratic = B), (p._autoCSS = !0), (p.quadraticToCubic = function (e, t, o) { return new v(e, (2 * t + e) / 3, (2 * t + o) / 3, o); }), (p._cssRegister = function () { var e = o.CSSPlugin; if (e) { var t = e._internals, _ = t._parseToProxy, f = t._setPluginRatio, m = t.CSSPropTween; t._registerComplexSpecialProp("bezier", { parser: function (e, t, o, n, i, s) { t instanceof Array && (t = { values: t }), (s = new p()); var r, l, a, d = t.values, u = d.length - 1, h = [], c = {}; if (u < 0) return i; for (r = 0; r <= u; r++) (a = _(e, d[r], n, i, s, u !== r)), (h[r] = a.end); for (l in t) c[l] = t[l]; return ( (c.values = h), ((i = new m(e, "bezier", 0, 0, a.pt, 2)).data = a), (i.plugin = s), (i.setRatio = f), 0 === c.autoRotate && (c.autoRotate = !0), !c.autoRotate || c.autoRotate instanceof Array || ((r = !0 === c.autoRotate ? 0 : Number(c.autoRotate)), (c.autoRotate = null != a.end.left ? [["left", "top", "rotation", r, !1]] : null != a.end.x && [["x", "y", "rotation", r, !1]])), c.autoRotate && (n._transform || n._enableTransforms(!1), (a.autoRotate = n._target._gsTransform), (a.proxy.rotation = a.autoRotate.rotation || 0), n._overwriteProps.push("rotation")), s._onInitTween(a.proxy, c, n._tween), i ); }, }); } }), (e._mod = function (e) { for (var t, o = this._overwriteProps, n = o.length; -1 < --n;) (t = e[o[n]]) && "function" == typeof t && (this._mod[o[n]] = t); }), (e._kill = function (e) { var t, o, n = this._props; for (t in this._beziers) if (t in e) for (delete this._beziers[t], delete this._func[t], o = n.length; -1 < --o;) n[o] === t && n.splice(o, 1); if ((n = this._autoRotate)) for (o = n.length; -1 < --o;) e[n[o][2]] && n.splice(o, 1); return this._super._kill.call(this, e); }), _fwd_gsScope.FWDFWD_gsDefine( "plugins.CSSPlugin", ["plugins.TweenPlugin", "FWDTweenLite"], function (s, N) { var f, O, B, m, z = function () { s.call(this, "css"), (this._overwriteProps.length = 0), (this.setRatio = z.prototype.setRatio); }, d = _fwd_gsScope.FWDFWD_gsDefine.globals, p = {}, e = (z.prototype = new s("css")); ((e.constructor = z).version = "1.19.0"), (z.API = 2), (z.defaultTransformPerspective = 0), (z.defaultSkewType = "compensated"), (z.defaultSmoothOrigin = !0), (e = "px"), (z.suffixMap = { top: e, right: e, bottom: e, left: e, width: e, height: e, fontSize: e, padding: e, margin: e, perspective: e, lineHeight: "" }); var W, g, v, A, b, D, H, M, t, o, E = /(?:\-|\.|\b)(\d|\.|e\-)+/g, P = /(?:\d|\-\d|\.\d|\-\.\d|\+=\d|\-=\d|\+=.\d|\-=\.\d)+/g, T = /(?:\+=|\-=|\-|\b)[\d\-\.]+[a-zA-Z0-9]*(?:%|\b)/gi, u = /(?![+-]?\d*\.?\d+|[+-]|e[+-]\d+)[^0-9]/g, x = /(?:\d|\-|\+|=|#|\.)*/g, I = /opacity *= *([^)]*)/i, w = /opacity:([^;]*)/i, r = /alpha\(opacity *=.+?\)/i, y = /^(rgb|hsl)/, l = /([A-Z])/g, a = /-([a-z])/gi, S = /(^(?:url\(\"|url\())|(?:(\"\))$|\)$)/gi, h = function (e, t) { return t.toUpperCase(); }, _ = /(?:Left|Right|Width)/i, c = /(M11|M12|M21|M22)=[\d\-\.e]+/gi, F = /progid\:DXImageTransform\.Microsoft\.Matrix\(.+?\)/i, C = /,(?=[^\)]*(?:\(|$))/gi, L = /[\s,\(]/i, R = Math.PI / 180, U = 180 / Math.PI, k = {}, Y = document, n = function (e) { return Y.createElementNS ? Y.createElementNS("http://www.w3.org/1999/xhtml", e) : Y.createElement(e); }, X = n("div"), V = n("img"), i = (z._internals = { _specialProps: p }), j = navigator.userAgent, G = ((t = j.indexOf("Android")), (o = n("a")), (v = -1 !== j.indexOf("Safari") && -1 === j.indexOf("Chrome") && (-1 === t || 3 < Number(j.substr(t + 8, 1)))), (b = v && Number(j.substr(j.indexOf("Version/") + 8, 1)) < 6), (A = -1 !== j.indexOf("Firefox")), (/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(j) || /Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(j)) && (D = parseFloat(RegExp.$1)), !!o && ((o.style.cssText = "top:1px;opacity:.55;"), /^0.55/.test(o.style.opacity))), Z = function (e) { return I.test("string" == typeof e ? e : (e.currentStyle ? e.currentStyle.filter : e.style.filter) || "") ? parseFloat(RegExp.$1) / 100 : 1; }, K = function (e) { window.console && console.log(e); }, q = "", Q = "", $ = function (e, t) { var o, n, i = (t = t || X).style; if (void 0 !== i[e]) return e; for (e = e.charAt(0).toUpperCase() + e.substr(1), o = ["O", "Moz", "ms", "Ms", "Webkit"], n = 5; -1 < --n && void 0 === i[o[n] + e];); return 0 <= n ? ((q = "-" + (Q = 3 === n ? "ms" : o[n]).toLowerCase() + "-"), Q + e) : null; }, J = Y.defaultView ? Y.defaultView.getComputedStyle : function () { }, ee = (z.getStyle = function (e, t, o, n, i) { var s; return G || "opacity" !== t ? (!n && e.style[t] ? (s = e.style[t]) : (o = o || J(e)) ? (s = o[t] || o.getPropertyValue(t) || o.getPropertyValue(t.replace(l, "-$1").toLowerCase())) : e.currentStyle && (s = e.currentStyle[t]), null == i || (s && "none" !== s && "auto" !== s && "auto auto" !== s) ? s : i) : Z(e); }), te = (i.convertToPixels = function (e, t, o, n, i) { if ("px" === n || !n) return o; if ("auto" === n || !o) return 0; var s, r, l, a = _.test(t), d = e, u = X.style, h = o < 0, c = 1 === o; if ((h && (o = -o), c && (o *= 100), "%" === n && -1 !== t.indexOf("border"))) s = (o / 100) * (a ? e.clientWidth : e.clientHeight); else { if (((u.cssText = "border:0 solid red;position:" + ee(e, "position") + ";line-height:0;"), "%" !== n && d.appendChild && "v" !== n.charAt(0) && "rem" !== n)) u[a ? "borderLeftWidth" : "borderTopWidth"] = o + n; else { if (((r = (d = e.parentNode || Y.body)._gsCache), (l = N.ticker.frame), r && a && r.time === l)) return (r.width * o) / 100; u[a ? "width" : "height"] = o + n; } d.appendChild(X), (s = parseFloat(X[a ? "offsetWidth" : "offsetHeight"])), d.removeChild(X), a && "%" === n && !1 !== z.cacheWidths && (((r = d._gsCache = d._gsCache || {}).time = l), (r.width = (s / o) * 100)), 0 !== s || i || (s = te(e, t, o, n, !0)); } return c && (s /= 100), h ? -s : s; }), oe = (i.calculateOffset = function (e, t, o) { if ("absolute" !== ee(e, "position", o)) return 0; var n = "left" === t ? "Left" : "Top", i = ee(e, "margin" + n, o); return e["offset" + n] - (te(e, t, parseFloat(i), i.replace(x, "")) || 0); }), ne = function (e, t) { var o, n, i, s = {}; if ((t = t || J(e, null))) if ((o = t.length)) for (; -1 < --o;) (-1 !== (i = t[o]).indexOf("-transform") && Fe !== i) || (s[i.replace(a, h)] = t.getPropertyValue(i)); else for (o in t) (-1 !== o.indexOf("Transform") && Ie !== o) || (s[o] = t[o]); else if ((t = e.currentStyle || e.style)) for (o in t) "string" == typeof o && void 0 === s[o] && (s[o.replace(a, h)] = t[o]); return ( G || (s.opacity = Z(e)), (n = je(e, t, !1)), (s.rotation = n.rotation), (s.skewX = n.skewX), (s.scaleX = n.scaleX), (s.scaleY = n.scaleY), (s.x = n.x), (s.y = n.y), Le && ((s.z = n.z), (s.rotationX = n.rotationX), (s.rotationY = n.rotationY), (s.scaleZ = n.scaleZ)), s.filters && delete s.filters, s ); }, ie = function (e, t, o, n, i) { var s, r, l, a = {}, d = e.style; for (r in o) "cssText" !== r && "length" !== r && isNaN(r) && (t[r] !== (s = o[r]) || (i && i[r])) && -1 === r.indexOf("Origin") && (("number" != typeof s && "string" != typeof s) || ((a[r] = "auto" !== s || ("left" !== r && "top" !== r) ? (("" !== s && "auto" !== s && "none" !== s) || "string" != typeof t[r] || "" === t[r].replace(u, "") ? s : 0) : oe(e, r)), void 0 !== d[r] && (l = new be(d, r, d[r], l)))); if (n) for (r in n) "className" !== r && (a[r] = n[r]); return { difs: a, firstMPT: l }; }, se = { width: ["Left", "Right"], height: ["Top", "Bottom"] }, re = ["marginLeft", "marginRight", "marginTop", "marginBottom"], le = function (e, t, o) { if ("svg" === (e.nodeName + "").toLowerCase()) return (o || J(e))[t] || 0; if (e.getBBox && Ye(e)) return e.getBBox()[t] || 0; var n = parseFloat("width" === t ? e.offsetWidth : e.offsetHeight), i = se[t], s = i.length; for (o = o || J(e, null); -1 < --s;) (n -= parseFloat(ee(e, "padding" + i[s], o, !0)) || 0), (n -= parseFloat(ee(e, "border" + i[s] + "Width", o, !0)) || 0); return n; }, ae = function (e, t) { if ("contain" === e || "auto" === e || "auto auto" === e) return e + " "; (null != e && "" !== e) || (e = "0 0"); var o, n = e.split(" "), i = -1 !== e.indexOf("left") ? "0%" : -1 !== e.indexOf("right") ? "100%" : n[0], s = -1 !== e.indexOf("top") ? "0%" : -1 !== e.indexOf("bottom") ? "100%" : n[1]; if (3 < n.length && !t) { for (n = e.split(", ").join(",").split(","), e = [], o = 0; o < n.length; o++) e.push(ae(n[o])); return e.join(","); } return ( null == s ? (s = "center" === i ? "50%" : "0") : "center" === s && (s = "50%"), ("center" === i || (isNaN(parseFloat(i)) && -1 === (i + "").indexOf("="))) && (i = "50%"), (e = i + " " + s + (2 < n.length ? " " + n[2] : "")), t && ((t.oxp = -1 !== i.indexOf("%")), (t.oyp = -1 !== s.indexOf("%")), (t.oxr = "=" === i.charAt(1)), (t.oyr = "=" === s.charAt(1)), (t.ox = parseFloat(i.replace(u, ""))), (t.oy = parseFloat(s.replace(u, ""))), (t.v = e)), t || e ); }, de = function (e, t) { return "function" == typeof e && (e = e(M, H)), "string" == typeof e && "=" === e.charAt(1) ? parseInt(e.charAt(0) + "1", 10) * parseFloat(e.substr(2)) : parseFloat(e) - parseFloat(t) || 0; }, ue = function (e, t) { return "function" == typeof e && (e = e(M, H)), null == e ? t : "string" == typeof e && "=" === e.charAt(1) ? parseInt(e.charAt(0) + "1", 10) * parseFloat(e.substr(2)) + t : parseFloat(e) || 0; }, he = function (e, t, o, n) { var i, s, r, l, a; return ( "function" == typeof e && (e = e(M, H)), null == e ? (l = t) : "number" == typeof e ? (l = e) : ((i = 360), (s = e.split("_")), (r = ((a = "=" === e.charAt(1)) ? parseInt(e.charAt(0) + "1", 10) * parseFloat(s[0].substr(2)) : parseFloat(s[0])) * (-1 === e.indexOf("rad") ? 1 : U) - (a ? 0 : t)), s.length && (n && (n[o] = t + r), -1 !== e.indexOf("short") && (r %= i) !== r % 180 && (r = r < 0 ? r + i : r - i), -1 !== e.indexOf("_cw") && r < 0 ? (r = ((r + 3599999999640) % i) - ((r / i) | 0) * i) : -1 !== e.indexOf("ccw") && 0 < r && (r = ((r - 3599999999640) % i) - ((r / i) | 0) * i)), (l = t + r)), l < 1e-6 && -1e-6 < l && (l = 0), l ); }, ce = { aqua: [0, 255, 255], lime: [0, 255, 0], silver: [192, 192, 192], black: [0, 0, 0], maroon: [128, 0, 0], teal: [0, 128, 128], blue: [0, 0, 255], navy: [0, 0, 128], white: [255, 255, 255], fuchsia: [255, 0, 255], olive: [128, 128, 0], yellow: [255, 255, 0], orange: [255, 165, 0], gray: [128, 128, 128], purple: [128, 0, 128], green: [0, 128, 0], red: [255, 0, 0], pink: [255, 192, 203], cyan: [0, 255, 255], transparent: [255, 255, 255, 0], }, _e = function (e, t, o) { return (255 * (6 * (e = e < 0 ? e + 1 : 1 < e ? e - 1 : e) < 1 ? t + (o - t) * e * 6 : e < 0.5 ? o : 3 * e < 2 ? t + (o - t) * (2 / 3 - e) * 6 : t) + 0.5) | 0; }, fe = (z.parseColor = function (e, t) { var o, n, i, s, r, l, a, d, u, h, c; if (e) if ("number" == typeof e) o = [e >> 16, (e >> 8) & 255, 255 & e]; else { if (("," === e.charAt(e.length - 1) && (e = e.substr(0, e.length - 1)), ce[e])) o = ce[e]; else if ("#" === e.charAt(0)) 4 === e.length && (e = "#" + (n = e.charAt(1)) + n + (i = e.charAt(2)) + i + (s = e.charAt(3)) + s), (o = [(e = parseInt(e.substr(1), 16)) >> 16, (e >> 8) & 255, 255 & e]); else if ("hsl" === e.substr(0, 3)) if (((o = c = e.match(E)), t)) { if (-1 !== e.indexOf("=")) return e.match(P); } else (r = (Number(o[0]) % 360) / 360), (l = Number(o[1]) / 100), (n = 2 * (a = Number(o[2]) / 100) - (i = a <= 0.5 ? a * (l + 1) : a + l - a * l)), 3 < o.length && (o[3] = Number(e[3])), (o[0] = _e(r + 1 / 3, n, i)), (o[1] = _e(r, n, i)), (o[2] = _e(r - 1 / 3, n, i)); else o = e.match(E) || ce.transparent; (o[0] = Number(o[0])), (o[1] = Number(o[1])), (o[2] = Number(o[2])), 3 < o.length && (o[3] = Number(o[3])); } else o = ce.black; return ( t && !c && ((n = o[0] / 255), (i = o[1] / 255), (s = o[2] / 255), (a = ((d = Math.max(n, i, s)) + (u = Math.min(n, i, s))) / 2), d === u ? (r = l = 0) : ((h = d - u), (l = 0.5 < a ? h / (2 - d - u) : h / (d + u)), (r = d === n ? (i - s) / h + (i < s ? 6 : 0) : d === i ? (s - n) / h + 2 : (n - i) / h + 4), (r *= 60)), (o[0] = (r + 0.5) | 0), (o[1] = (100 * l + 0.5) | 0), (o[2] = (100 * a + 0.5) | 0)), o ); }), me = function (e, t) { var o, n, i, s = e.match(pe) || [], r = 0, l = s.length ? "" : e; for (o = 0; o < s.length; o++) (n = s[o]), (r += (i = e.substr(r, e.indexOf(n, r) - r)).length + n.length), 3 === (n = fe(n, t)).length && n.push(1), (l += i + (t ? "hsla(" + n[0] + "," + n[1] + "%," + n[2] + "%," + n[3] : "rgba(" + n.join(",")) + ")"); return l + e.substr(r); }, pe = "(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3}){1,2}\\b"; for (e in ce) pe += "|" + e + "\\b"; (pe = new RegExp(pe + ")", "gi")), (z.colorStringFilter = function (e) { var t, o = e[0] + e[1]; pe.test(o) && ((t = -1 !== o.indexOf("hsl(") || -1 !== o.indexOf("hsla(")), (e[0] = me(e[0], t)), (e[1] = me(e[1], t))), (pe.lastIndex = 0); }), N.defaultStringFilter || (N.defaultStringFilter = z.colorStringFilter); var ge = function (e, t, s, r) { if (null == e) return function (e) { return e; }; var l, a = t ? (e.match(pe) || [""])[0] : "", d = e.split(a).join("").match(T) || [], u = e.substr(0, e.indexOf(d[0])), h = ")" === e.charAt(e.length - 1) ? ")" : "", c = -1 !== e.indexOf(" ") ? " " : ",", _ = d.length, f = 0 < _ ? d[0].replace(E, "") : ""; return _ ? (l = t ? function (e) { var t, o, n, i; if ("number" == typeof e) e += f; else if (r && C.test(e)) { for (i = e.replace(C, "|").split("|"), n = 0; n < i.length; n++) i[n] = l(i[n]); return i.join(","); } if (((t = (e.match(pe) || [a])[0]), (n = (o = e.split(t).join("").match(T) || []).length), _ > n--)) for (; ++n < _;) o[n] = s ? o[((n - 1) / 2) | 0] : d[n]; return u + o.join(c) + c + t + h + (-1 !== e.indexOf("inset") ? " inset" : ""); } : function (e) { var t, o, n; if ("number" == typeof e) e += f; else if (r && C.test(e)) { for (o = e.replace(C, "|").split("|"), n = 0; n < o.length; n++) o[n] = l(o[n]); return o.join(","); } if (((n = (t = e.match(T) || []).length), _ > n--)) for (; ++n < _;) t[n] = s ? t[((n - 1) / 2) | 0] : d[n]; return u + t.join(c) + h; }) : function (e) { return e; }; }, ve = function (d) { return ( (d = d.split(",")), function (e, t, o, n, i, s, r) { var l, a = (t + "").split(" "); for (r = {}, l = 0; l < 4; l++) r[d[l]] = a[l] = a[l] || a[((l - 1) / 2) >> 0]; return n.parse(e, r, i, s); } ); }, be = ((i._setPluginRatio = function (e) { this.plugin.setRatio(e); for (var t, o, n, i, s, r = this.data, l = r.proxy, a = r.firstMPT; a;) (t = l[a.v]), a.r ? (t = Math.round(t)) : t < 1e-6 && -1e-6 < t && (t = 0), (a.t[a.p] = t), (a = a._next); if ((r.autoRotate && (r.autoRotate.rotation = r.mod ? r.mod(l.rotation, this.t) : l.rotation), 1 === e || 0 === e)) for (a = r.firstMPT, s = 1 === e ? "e" : "b"; a;) { if ((o = a.t).type) { if (1 === o.type) { for (i = o.xs0 + o.s + o.xs1, n = 1; n < o.l; n++) i += o["xn" + n] + o["xs" + (n + 1)]; o[s] = i; } } else o[s] = o.s + o.xs0; a = a._next; } }), function (e, t, o, n, i) { (this.t = e), (this.p = t), (this.v = o), (this.r = i), n && ((n._prev = this)._next = n); }), Te = ((i._parseToProxy = function (e, t, o, n, i, s) { var r, l, a, d, u, h = n, c = {}, _ = {}, f = o._transform, m = k; for (o._transform = null, k = t, n = u = o.parse(e, t, n, i), k = m, s && ((o._transform = f), h && ((h._prev = null), h._prev && (h._prev._next = null))); n && n !== h;) { if (n.type <= 1 && ((_[(l = n.p)] = n.s + n.c), (c[l] = n.s), s || ((d = new be(n, "s", l, d, n.r)), (n.c = 0)), 1 === n.type)) for (r = n.l; 0 < --r;) (a = "xn" + r), (_[(l = n.p + "_" + a)] = n.data[a]), (c[l] = n[a]), s || (d = new be(n, a, l, d, n.rxp[a])); n = n._next; } return { proxy: c, end: _, firstMPT: d, pt: u }; }), (i.CSSPropTween = function (e, t, o, n, i, s, r, l, a, d, u) { (this.t = e), (this.p = t), (this.s = o), (this.c = n), (this.n = r || t), e instanceof Te || m.push(this.n), (this.r = l), (this.type = s || 0), a && ((this.pr = a), (f = !0)), (this.b = void 0 === d ? o : d), (this.e = void 0 === u ? o + n : u), i && ((this._next = i)._prev = this); })), we = function (e, t, o, n, i, s) { var r = new Te(e, t, o, n - o, i, -1, s); return (r.b = o), (r.e = r.xs0 = n), r; }, ye = (z.parseComplex = function (e, t, o, n, i, s, r, l, a, d) { (o = o || s || ""), "function" == typeof n && (n = n(M, H)), (r = new Te(e, t, 0, 0, r, d ? 2 : 1, null, !1, l, o, n)), (n += ""), i && pe.test(n + o) && ((n = [o, n]), z.colorStringFilter(n), (o = n[0]), (n = n[1])); var u, h, c, _, f, m, p, g, v, b, T, w, y, S = o.split(", ").join(",").split(" "), O = n.split(", ").join(",").split(" "), B = S.length, D = !1 !== W; for ( (-1 === n.indexOf(",") && -1 === o.indexOf(",")) || ((S = S.join(" ").replace(C, ", ").split(" ")), (O = O.join(" ").replace(C, ", ").split(" ")), (B = S.length)), B !== O.length && (B = (S = (s || "").split(" ")).length), r.plugin = a, r.setRatio = d, u = pe.lastIndex = 0; u < B; u++ ) if (((_ = S[u]), (f = O[u]), (g = parseFloat(_)) || 0 === g)) r.appendXtra("", g, de(f, g), f.replace(P, ""), D && -1 !== f.indexOf("px"), !0); else if (i && pe.test(_)) (w = ")" + ((w = f.indexOf(")") + 1) ? f.substr(w) : "")), (y = -1 !== f.indexOf("hsl") && G), (_ = fe(_, y)), (f = fe(f, y)), (v = 6 < _.length + f.length) && !G && 0 === f[3] ? ((r["xs" + r.l] += r.l ? " transparent" : "transparent"), (r.e = r.e.split(O[u]).join("transparent"))) : (G || (v = !1), y ? r .appendXtra(v ? "hsla(" : "hsl(", _[0], de(f[0], _[0]), ",", !1, !0) .appendXtra("", _[1], de(f[1], _[1]), "%,", !1) .appendXtra("", _[2], de(f[2], _[2]), v ? "%," : "%" + w, !1) : r .appendXtra(v ? "rgba(" : "rgb(", _[0], f[0] - _[0], ",", !0, !0) .appendXtra("", _[1], f[1] - _[1], ",", !0) .appendXtra("", _[2], f[2] - _[2], v ? "," : w, !0), v && ((_ = _.length < 4 ? 1 : _[3]), r.appendXtra("", _, (f.length < 4 ? 1 : f[3]) - _, w, !1))), (pe.lastIndex = 0); else if ((m = _.match(E))) { if (!(p = f.match(P)) || p.length !== m.length) return r; for (h = c = 0; h < m.length; h++) (T = m[h]), (b = _.indexOf(T, c)), r.appendXtra(_.substr(c, b - c), Number(T), de(p[h], T), "", D && "px" === _.substr(b + T.length, 2), 0 === h), (c = b + T.length); r["xs" + r.l] += _.substr(c); } else r["xs" + r.l] += r.l || r["xs" + r.l] ? " " + f : f; if (-1 !== n.indexOf("=") && r.data) { for (w = r.xs0 + r.data.s, u = 1; u < r.l; u++) w += r["xs" + u] + r.data["xn" + u]; r.e = w + r["xs" + u]; } return r.l || ((r.type = -1), (r.xs0 = r.e)), r.xfirst || r; }), Se = 9; for ((e = Te.prototype).l = e.pr = 0; 0 < --Se;) (e["xn" + Se] = 0), (e["xs" + Se] = ""); (e.xs0 = ""), (e._next = e._prev = e.xfirst = e.data = e.plugin = e.setRatio = e.rxp = null), (e.appendXtra = function (e, t, o, n, i, s) { var r = this, l = r.l; return ( (r["xs" + l] += s && (l || r["xs" + l]) ? " " + e : e || ""), o || 0 === l || r.plugin ? (r.l++, (r.type = r.setRatio ? 2 : 1), (r["xs" + r.l] = n || ""), 0 < l ? ((r.data["xn" + l] = t + o), (r.rxp["xn" + l] = i), (r["xn" + l] = t), r.plugin || ((r.xfirst = new Te(r, "xn" + l, t, o, r.xfirst || r, 0, r.n, i, r.pr)), (r.xfirst.xs0 = 0))) : ((r.data = { s: t + o }), (r.rxp = {}), (r.s = t), (r.c = o), (r.r = i)), r) : ((r["xs" + l] += t + (n || "")), r) ); }); var Oe = function (e, t) { (t = t || {}), (this.p = (t.prefix && $(e)) || e), (p[e] = p[this.p] = this), (this.format = t.formatter || ge(t.defaultValue, t.color, t.collapsible, t.multi)), t.parser && (this.parse = t.parser), (this.clrs = t.color), (this.multi = t.multi), (this.keyword = t.keyword), (this.dflt = t.defaultValue), (this.pr = t.priority || 0); }, Be = (i._registerComplexSpecialProp = function (e, t, o) { "object" != typeof t && (t = { parser: o }); var n, i = e.split(","), s = t.defaultValue; for (o = o || [s], n = 0; n < i.length; n++) (t.prefix = 0 === n && t.prefix), (t.defaultValue = o[n] || s), new Oe(i[n], t); }), De = (i._registerPluginProp = function (e) { if (!p[e]) { var a = e.charAt(0).toUpperCase() + e.substr(1) + "Plugin"; Be(e, { parser: function (e, t, o, n, i, s, r) { var l = d.com.greensock.plugins[a]; return l ? (l._cssRegister(), p[o].parse(e, t, o, n, i, s, r)) : (K("Error: " + a + " js file not loaded."), i); }, }); } }); ((e = Oe.prototype).parseComplex = function (e, t, o, n, i, s) { var r, l, a, d, u, h, c = this.keyword; if ((this.multi && (C.test(o) || C.test(t) ? ((l = t.replace(C, "|").split("|")), (a = o.replace(C, "|").split("|"))) : c && ((l = [t]), (a = [o]))), a)) { for (d = a.length > l.length ? a.length : l.length, r = 0; r < d; r++) (t = l[r] = l[r] || this.dflt), (o = a[r] = a[r] || this.dflt), c && (u = t.indexOf(c)) !== (h = o.indexOf(c)) && (-1 === h ? (l[r] = l[r].split(c).join("")) : -1 === u && (l[r] += " " + c)); (t = l.join(", ")), (o = a.join(", ")); } return ye(e, this.p, t, o, this.clrs, this.dflt, n, this.pr, i, s); }), (e.parse = function (e, t, o, n, i, s, r) { return this.parseComplex(e.style, this.format(ee(e, this.p, B, !1, this.dflt)), this.format(t), i, s); }), (z.registerSpecialProp = function (e, a, d) { Be(e, { parser: function (e, t, o, n, i, s, r) { var l = new Te(e, o, 0, 0, i, 2, o, !1, d); return (l.plugin = s), (l.setRatio = a(e, t, n._tween, o)), l; }, priority: d, }); }), (z.useSVGTransformAttr = v || A); var We, He, Me, Ee, Pe, xe = "scaleX,scaleY,scaleZ,x,y,z,skewX,skewY,rotation,rotationX,rotationY,perspective,xPercent,yPercent".split(","), Ie = $("transform"), Fe = q + "transform", Ce = $("transformOrigin"), Le = null !== $("perspective"), ke = (i.Transform = function () { (this.perspective = parseFloat(z.defaultTransformPerspective) || 0), (this.force3D = !(!1 === z.defaultForce3D || !Le) && (z.defaultForce3D || "auto")); }), Ae = window.SVGElement, Re = function (e, t, o) { var n, i = Y.createElementNS("http://www.w3.org/2000/svg", e), s = /([a-z])([A-Z])/g; for (n in o) i.setAttributeNS(null, n.replace(s, "$1-$2").toLowerCase(), o[n]); return t.appendChild(i), i; }, Ne = Y.documentElement, ze = ((Pe = D || (/Android/i.test(j) && !window.chrome)), Y.createElementNS && !Pe && ((He = Re("svg", Ne)), (Ee = (Me = Re("rect", He, { width: 100, height: 50, x: 100 })).getBoundingClientRect().width), (Me.style[Ce] = "50% 50%"), (Me.style[Ie] = "scaleX(0.5)"), (Pe = Ee === Me.getBoundingClientRect().width && !(A && Le)), Ne.removeChild(He)), Pe), Ue = function (e, t, o, n, i, s) { var r, l, a, d, u, h, c, _, f, m, p, g, v, b, T = e._gsTransform, w = Ve(e, !0); T && ((v = T.xOrigin), (b = T.yOrigin)), (!n || (r = n.split(" ")).length < 2) && ((c = e.getBBox()), (r = [ (-1 !== (t = ae(t).split(" "))[0].indexOf("%") ? (parseFloat(t[0]) / 100) * c.width : parseFloat(t[0])) + c.x, (-1 !== t[1].indexOf("%") ? (parseFloat(t[1]) / 100) * c.height : parseFloat(t[1])) + c.y, ])), (o.xOrigin = d = parseFloat(r[0])), (o.yOrigin = u = parseFloat(r[1])), n && w !== Xe && ((h = w[0]), (c = w[1]), (_ = w[2]), (f = w[3]), (m = w[4]), (l = d * (f / (g = h * f - c * _)) + u * (-_ / g) + (_ * (p = w[5]) - f * m) / g), (a = d * (-c / g) + u * (h / g) - (h * p - c * m) / g), (d = o.xOrigin = r[0] = l), (u = o.yOrigin = r[1] = a)), T && (s && ((o.xOffset = T.xOffset), (o.yOffset = T.yOffset), (T = o)), i || (!1 !== i && !1 !== z.defaultSmoothOrigin) ? ((l = d - v), (a = u - b), (T.xOffset += l * w[0] + a * w[2] - l), (T.yOffset += l * w[1] + a * w[3] - a)) : (T.xOffset = T.yOffset = 0)), s || e.setAttribute("data-svg-origin", r.join(" ")); }, Ye = function (e) { return !!( Ae && e.getBBox && e.getCTM && (function (e) { try { return e.getBBox(); } catch (e) { } })(e) && (!e.parentNode || (e.parentNode.getBBox && e.parentNode.getCTM)) ); }, Xe = [1, 0, 0, 1, 0, 0], Ve = function (e, t) { var o, n, i, s, r, l, a = e._gsTransform || new ke(), d = e.style; if ( (Ie ? (n = ee(e, Fe, null, !0)) : e.currentStyle && (n = (n = e.currentStyle.filter.match(c)) && 4 === n.length ? [n[0].substr(4), Number(n[2].substr(4)), Number(n[1].substr(4)), n[3].substr(4), a.x || 0, a.y || 0].join(",") : ""), (o = !n || "none" === n || "matrix(1, 0, 0, 1, 0, 0)" === n) && Ie && ((l = "none" === J(e).display) || !e.parentNode) && (l && ((s = d.display), (d.display = "block")), e.parentNode || ((r = 1), Ne.appendChild(e)), (o = !(n = ee(e, Fe, null, !0)) || "none" === n || "matrix(1, 0, 0, 1, 0, 0)" === n), s ? (d.display = s) : l && qe(d, "display"), r && Ne.removeChild(e)), (a.svg || (e.getBBox && Ye(e))) && (o && -1 !== (d[Ie] + "").indexOf("matrix") && ((n = d[Ie]), (o = 0)), (i = e.getAttribute("transform")), o && i && (-1 !== i.indexOf("matrix") ? ((n = i), (o = 0)) : -1 !== i.indexOf("translate") && ((n = "matrix(1,0,0,1," + i.match(/(?:\-|\b)[\d\-\.e]+\b/gi).join(",") + ")"), (o = 0)))), o) ) return Xe; for (i = (n || "").match(E) || [], Se = i.length; -1 < --Se;) (s = Number(i[Se])), (i[Se] = (r = s - (s |= 0)) ? ((1e5 * r + (r < 0 ? -0.5 : 0.5)) | 0) / 1e5 + s : s); return t && 6 < i.length ? [i[0], i[1], i[4], i[5], i[12], i[13]] : i; }, je = (i.getTransform = function (e, t, o, n) { if (e._gsTransform && o && !n) return e._gsTransform; var i, s, r, l, a, d, u = (o && e._gsTransform) || new ke(), h = u.scaleX < 0, c = (Le && (parseFloat(ee(e, Ce, t, !1, "0 0 0").split(" ")[2]) || u.zOrigin)) || 0, _ = parseFloat(z.defaultTransformPerspective) || 0; if (((u.svg = !(!e.getBBox || !Ye(e))), u.svg && (Ue(e, ee(e, Ce, t, !1, "50% 50%") + "", u, e.getAttribute("data-svg-origin")), (We = z.useSVGTransformAttr || ze)), (i = Ve(e)) !== Xe)) { if (16 === i.length) { var f, m, p, g, v, b = i[0], T = i[1], w = i[2], y = i[3], S = i[4], O = i[5], B = i[6], D = i[7], W = i[8], H = i[9], M = i[10], E = i[12], P = i[13], x = i[14], I = i[11], F = Math.atan2(B, M); u.zOrigin && ((E = W * (x = -u.zOrigin) - i[12]), (P = H * x - i[13]), (x = M * x + u.zOrigin - i[14])), (u.rotationX = F * U), F && ((f = S * (g = Math.cos(-F)) + W * (v = Math.sin(-F))), (m = O * g + H * v), (p = B * g + M * v), (W = S * -v + W * g), (H = O * -v + H * g), (M = B * -v + M * g), (I = D * -v + I * g), (S = f), (O = m), (B = p)), (F = Math.atan2(-w, M)), (u.rotationY = F * U), F && ((m = T * (g = Math.cos(-F)) - H * (v = Math.sin(-F))), (p = w * g - M * v), (H = T * v + H * g), (M = w * v + M * g), (I = y * v + I * g), (b = f = b * g - W * v), (T = m), (w = p)), (F = Math.atan2(T, b)), (u.rotation = F * U), F && ((b = b * (g = Math.cos(-F)) + S * (v = Math.sin(-F))), (m = T * g + O * v), (O = T * -v + O * g), (B = w * -v + B * g), (T = m)), u.rotationX && 359.9 < Math.abs(u.rotationX) + Math.abs(u.rotation) && ((u.rotationX = u.rotation = 0), (u.rotationY = 180 - u.rotationY)), (u.scaleX = ((1e5 * Math.sqrt(b * b + T * T) + 0.5) | 0) / 1e5), (u.scaleY = ((1e5 * Math.sqrt(O * O + H * H) + 0.5) | 0) / 1e5), (u.scaleZ = ((1e5 * Math.sqrt(B * B + M * M) + 0.5) | 0) / 1e5), u.rotationX || u.rotationY ? (u.skewX = 0) : ((u.skewX = S || O ? Math.atan2(S, O) * U + u.rotation : u.skewX || 0), 90 < Math.abs(u.skewX) && Math.abs(u.skewX) < 270 && (h ? ((u.scaleX *= -1), (u.skewX += u.rotation <= 0 ? 180 : -180), (u.rotation += u.rotation <= 0 ? 180 : -180)) : ((u.scaleY *= -1), (u.skewX += u.skewX <= 0 ? 180 : -180)))), (u.perspective = I ? 1 / (I < 0 ? -I : I) : 0), (u.x = E), (u.y = P), (u.z = x), u.svg && ((u.x -= u.xOrigin - (u.xOrigin * b - u.yOrigin * S)), (u.y -= u.yOrigin - (u.yOrigin * T - u.xOrigin * O))); } else if (!Le || n || !i.length || u.x !== i[4] || u.y !== i[5] || (!u.rotationX && !u.rotationY)) { var C = 6 <= i.length, L = C ? i[0] : 1, k = i[1] || 0, A = i[2] || 0, R = C ? i[3] : 1; (u.x = i[4] || 0), (u.y = i[5] || 0), (r = Math.sqrt(L * L + k * k)), (l = Math.sqrt(R * R + A * A)), (a = L || k ? Math.atan2(k, L) * U : u.rotation || 0), (d = A || R ? Math.atan2(A, R) * U + a : u.skewX || 0), 90 < Math.abs(d) && Math.abs(d) < 270 && (h ? ((r *= -1), (d += a <= 0 ? 180 : -180), (a += a <= 0 ? 180 : -180)) : ((l *= -1), (d += d <= 0 ? 180 : -180))), (u.scaleX = r), (u.scaleY = l), (u.rotation = a), (u.skewX = d), Le && ((u.rotationX = u.rotationY = u.z = 0), (u.perspective = _), (u.scaleZ = 1)), u.svg && ((u.x -= u.xOrigin - (u.xOrigin * L + u.yOrigin * A)), (u.y -= u.yOrigin - (u.xOrigin * k + u.yOrigin * R))); } for (s in ((u.zOrigin = c), u)) u[s] < 2e-5 && -2e-5 < u[s] && (u[s] = 0); } return ( o && (e._gsTransform = u).svg && (We && e.style[Ie] ? N.delayedCall(0.001, function () { qe(e.style, Ie); }) : !We && e.getAttribute("transform") && N.delayedCall(0.001, function () { e.removeAttribute("transform"); })), u ); }), Ge = function (e) { var t, o, n = this.data, i = -n.rotation * R, s = i + n.skewX * R, r = 1e5, l = ((Math.cos(i) * n.scaleX * r) | 0) / r, a = ((Math.sin(i) * n.scaleX * r) | 0) / r, d = ((Math.sin(s) * -n.scaleY * r) | 0) / r, u = ((Math.cos(s) * n.scaleY * r) | 0) / r, h = this.t.style, c = this.t.currentStyle; if (c) { (o = a), (a = -d), (d = -o), (t = c.filter), (h.filter = ""); var _, f, m = this.t.offsetWidth, p = this.t.offsetHeight, g = "absolute" !== c.position, v = "progid:DXImageTransform.Microsoft.Matrix(M11=" + l + ", M12=" + a + ", M21=" + d + ", M22=" + u, b = n.x + (m * n.xPercent) / 100, T = n.y + (p * n.yPercent) / 100; if ( (null != n.ox && ((b += (_ = (n.oxp ? m * n.ox * 0.01 : n.ox) - m / 2) - (_ * l + (f = (n.oyp ? p * n.oy * 0.01 : n.oy) - p / 2) * a)), (T += f - (_ * d + f * u))), (v += g ? ", Dx=" + ((_ = m / 2) - (_ * l + (f = p / 2) * a) + b) + ", Dy=" + (f - (_ * d + f * u) + T) + ")" : ", sizingMethod='auto expand')"), -1 !== t.indexOf("DXImageTransform.Microsoft.Matrix(") ? (h.filter = t.replace(F, v)) : (h.filter = v + " " + t), (0 !== e && 1 !== e) || (1 === l && 0 === a && 0 === d && 1 === u && ((g && -1 === v.indexOf("Dx=0, Dy=0")) || (I.test(t) && 100 !== parseFloat(RegExp.$1)) || (-1 === t.indexOf(t.indexOf("Alpha")) && h.removeAttribute("filter")))), !g) ) { var w, y, S, O = D < 8 ? 1 : -1; for ( _ = n.ieOffsetX || 0, f = n.ieOffsetY || 0, n.ieOffsetX = Math.round((m - ((l < 0 ? -l : l) * m + (a < 0 ? -a : a) * p)) / 2 + b), n.ieOffsetY = Math.round((p - ((u < 0 ? -u : u) * p + (d < 0 ? -d : d) * m)) / 2 + T), Se = 0; Se < 4; Se++ ) (S = (o = -1 !== (w = c[(y = re[Se])]).indexOf("px") ? parseFloat(w) : te(this.t, y, parseFloat(w), w.replace(x, "")) || 0) !== n[y] ? Se < 2 ? -n.ieOffsetX : -n.ieOffsetY : Se < 2 ? _ - n.ieOffsetX : f - n.ieOffsetY), (h[y] = (n[y] = Math.round(o - S * (0 === Se || 2 === Se ? 1 : O))) + "px"); } } }, Ze = (i.set3DTransformRatio = i.setTransformRatio = function (e) { var t, o, n, i, s, r, l, a, d, u, h, c, _, f, m, p, g, v, b, T, w, y, S, O = this.data, B = this.t.style, D = O.rotation, W = O.rotationX, H = O.rotationY, M = O.scaleX, E = O.scaleY, P = O.scaleZ, x = O.x, I = O.y, F = O.z, C = O.svg, L = O.perspective, k = O.force3D; if (!((((1 !== e && 0 !== e) || "auto" !== k || (this.tween._totalTime !== this.tween._totalDuration && this.tween._totalTime)) && k) || F || L || H || W || 1 !== P) || (We && C) || !Le) D || O.skewX || C ? ((D *= R), (y = O.skewX * R), (S = 1e5), (t = Math.cos(D) * M), (i = Math.sin(D) * M), (o = Math.sin(D - y) * -E), (s = Math.cos(D - y) * E), y && "simple" === O.skewType && ((g = Math.tan(y - O.skewY * R)), (o *= g = Math.sqrt(1 + g * g)), (s *= g), O.skewY && ((g = Math.tan(O.skewY * R)), (t *= g = Math.sqrt(1 + g * g)), (i *= g))), C && ((x += O.xOrigin - (O.xOrigin * t + O.yOrigin * o) + O.xOffset), (I += O.yOrigin - (O.xOrigin * i + O.yOrigin * s) + O.yOffset), We && (O.xPercent || O.yPercent) && ((f = this.t.getBBox()), (x += 0.01 * O.xPercent * f.width), (I += 0.01 * O.yPercent * f.height)), x < (f = 1e-6) && -f < x && (x = 0), I < f && -f < I && (I = 0)), (b = ((t * S) | 0) / S + "," + ((i * S) | 0) / S + "," + ((o * S) | 0) / S + "," + ((s * S) | 0) / S + "," + x + "," + I + ")"), C && We ? this.t.setAttribute("transform", "matrix(" + b) : (B[Ie] = (O.xPercent || O.yPercent ? "translate(" + O.xPercent + "%," + O.yPercent + "%) matrix(" : "matrix(") + b)) : (B[Ie] = (O.xPercent || O.yPercent ? "translate(" + O.xPercent + "%," + O.yPercent + "%) matrix(" : "matrix(") + M + ",0,0," + E + "," + x + "," + I + ")"); else { if ((A && (M < (f = 1e-4) && -f < M && (M = P = 2e-5), E < f && -f < E && (E = P = 2e-5), !L || O.z || O.rotationX || O.rotationY || (L = 0)), D || O.skewX)) (D *= R), (m = t = Math.cos(D)), (p = i = Math.sin(D)), O.skewX && ((D -= O.skewX * R), (m = Math.cos(D)), (p = Math.sin(D)), "simple" === O.skewType && ((g = Math.tan((O.skewX - O.skewY) * R)), (m *= g = Math.sqrt(1 + g * g)), (p *= g), O.skewY && ((g = Math.tan(O.skewY * R)), (t *= g = Math.sqrt(1 + g * g)), (i *= g)))), (o = -p), (s = m); else { if (!(H || W || 1 !== P || L || C)) return void (B[Ie] = (O.xPercent || O.yPercent ? "translate(" + O.xPercent + "%," + O.yPercent + "%) translate3d(" : "translate3d(") + x + "px," + I + "px," + F + "px)" + (1 !== M || 1 !== E ? " scale(" + M + "," + E + ")" : "")); (t = s = 1), (o = i = 0); } (d = 1), (n = r = l = a = u = h = 0), (c = L ? -1 / L : 0), (_ = O.zOrigin), (f = 1e-6), (T = ","), (w = "0"), (D = H * R) && ((m = Math.cos(D)), (u = c * (l = -(p = Math.sin(D)))), (n = t * p), (r = i * p), (c *= d = m), (t *= m), (i *= m)), (D = W * R) && ((g = o * (m = Math.cos(D)) + n * (p = Math.sin(D))), (v = s * m + r * p), (a = d * p), (h = c * p), (n = o * -p + n * m), (r = s * -p + r * m), (d *= m), (c *= m), (o = g), (s = v)), 1 !== P && ((n *= P), (r *= P), (d *= P), (c *= P)), 1 !== E && ((o *= E), (s *= E), (a *= E), (h *= E)), 1 !== M && ((t *= M), (i *= M), (l *= M), (u *= M)), (_ || C) && (_ && ((x += n * -_), (I += r * -_), (F += d * -_ + _)), C && ((x += O.xOrigin - (O.xOrigin * t + O.yOrigin * o) + O.xOffset), (I += O.yOrigin - (O.xOrigin * i + O.yOrigin * s) + O.yOffset)), x < f && -f < x && (x = w), I < f && -f < I && (I = w), F < f && -f < F && (F = 0)), (b = O.xPercent || O.yPercent ? "translate(" + O.xPercent + "%," + O.yPercent + "%) matrix3d(" : "matrix3d("), (b += (t < f && -f < t ? w : t) + T + (i < f && -f < i ? w : i) + T + (l < f && -f < l ? w : l)), (b += T + (u < f && -f < u ? w : u) + T + (o < f && -f < o ? w : o) + T + (s < f && -f < s ? w : s)), W || H || 1 !== P ? ((b += T + (a < f && -f < a ? w : a) + T + (h < f && -f < h ? w : h) + T + (n < f && -f < n ? w : n)), (b += T + (r < f && -f < r ? w : r) + T + (d < f && -f < d ? w : d) + T + (c < f && -f < c ? w : c) + T)) : (b += ",0,0,0,0,1,0,"), (b += x + T + I + T + F + T + (L ? 1 + -F / L : 1) + ")"), (B[Ie] = b); } }); ((e = ke.prototype).x = e.y = e.z = e.skewX = e.skewY = e.rotation = e.rotationX = e.rotationY = e.zOrigin = e.xPercent = e.yPercent = e.xOffset = e.yOffset = 0), (e.scaleX = e.scaleY = e.scaleZ = 1), Be( "transform,scale,scaleX,scaleY,scaleZ,x,y,z,rotation,rotationX,rotationY,rotationZ,skewX,skewY,shortRotation,shortRotationX,shortRotationY,shortRotationZ,transformOrigin,svgOrigin,transformPerspective,directionalRotation,parseTransform,force3D,skewType,xPercent,yPercent,smoothOrigin", { parser: function (e, t, o, n, i, s, r) { if (n._lastParsedTransform === r) return i; var l; "function" == typeof (n._lastParsedTransform = r)[o] && ((l = r[o]), (r[o] = t)); var a, d, u, h, c, _, f, m, p, g = e._gsTransform, v = e.style, b = xe.length, T = r, w = {}, y = "transformOrigin", S = je(e, B, !0, T.parseTransform), O = T.transform && ("function" == typeof T.transform ? T.transform(M, H) : T.transform); if (((n._transform = S), O && "string" == typeof O && Ie)) ((d = X.style)[Ie] = O), (d.display = "block"), (d.position = "absolute"), Y.body.appendChild(X), (a = je(X, null, !1)), S.svg && ((_ = S.xOrigin), (f = S.yOrigin), (a.x -= S.xOffset), (a.y -= S.yOffset), (T.transformOrigin || T.svgOrigin) && ((O = {}), Ue(e, ae(T.transformOrigin), O, T.svgOrigin, T.smoothOrigin, !0), (_ = O.xOrigin), (f = O.yOrigin), (a.x -= O.xOffset - S.xOffset), (a.y -= O.yOffset - S.yOffset)), (_ || f) && ((m = Ve(X, !0)), (a.x -= _ - (_ * m[0] + f * m[2])), (a.y -= f - (_ * m[1] + f * m[3])))), Y.body.removeChild(X), a.perspective || (a.perspective = S.perspective), null != T.xPercent && (a.xPercent = ue(T.xPercent, S.xPercent)), null != T.yPercent && (a.yPercent = ue(T.yPercent, S.yPercent)); else if ("object" == typeof T) { if ( ((a = { scaleX: ue(null != T.scaleX ? T.scaleX : T.scale, S.scaleX), scaleY: ue(null != T.scaleY ? T.scaleY : T.scale, S.scaleY), scaleZ: ue(T.scaleZ, S.scaleZ), x: ue(T.x, S.x), y: ue(T.y, S.y), z: ue(T.z, S.z), xPercent: ue(T.xPercent, S.xPercent), yPercent: ue(T.yPercent, S.yPercent), perspective: ue(T.transformPerspective, S.perspective), }), null != (c = T.directionalRotation)) ) if ("object" == typeof c) for (d in c) T[d] = c[d]; else T.rotation = c; "string" == typeof T.x && -1 !== T.x.indexOf("%") && ((a.x = 0), (a.xPercent = ue(T.x, S.xPercent))), "string" == typeof T.y && -1 !== T.y.indexOf("%") && ((a.y = 0), (a.yPercent = ue(T.y, S.yPercent))), (a.rotation = he("rotation" in T ? T.rotation : "shortRotation" in T ? T.shortRotation + "_short" : "rotationZ" in T ? T.rotationZ : S.rotation - S.skewY, S.rotation - S.skewY, "rotation", w)), Le && ((a.rotationX = he("rotationX" in T ? T.rotationX : "shortRotationX" in T ? T.shortRotationX + "_short" : S.rotationX || 0, S.rotationX, "rotationX", w)), (a.rotationY = he("rotationY" in T ? T.rotationY : "shortRotationY" in T ? T.shortRotationY + "_short" : S.rotationY || 0, S.rotationY, "rotationY", w))), (a.skewX = he(T.skewX, S.skewX - S.skewY)), (a.skewY = he(T.skewY, S.skewY)) && ((a.skewX += a.skewY), (a.rotation += a.skewY)); } for ( Le && null != T.force3D && ((S.force3D = T.force3D), (h = !0)), S.skewType = T.skewType || S.skewType || z.defaultSkewType, (u = S.force3D || S.z || S.rotationX || S.rotationY || a.z || a.rotationX || a.rotationY || a.perspective) || null == T.scale || (a.scaleZ = 1); -1 < --b; ) (1e-6 < (O = a[(p = xe[b])] - S[p]) || O < -1e-6 || null != T[p] || null != k[p]) && ((h = !0), (i = new Te(S, p, S[p], O, i)), p in w && (i.e = w[p]), (i.xs0 = 0), (i.plugin = s), n._overwriteProps.push(i.n)); return ( (O = T.transformOrigin), S.svg && (O || T.svgOrigin) && ((_ = S.xOffset), (f = S.yOffset), Ue(e, ae(O), a, T.svgOrigin, T.smoothOrigin), (i = we(S, "xOrigin", (g ? S : a).xOrigin, a.xOrigin, i, y)), (i = we(S, "yOrigin", (g ? S : a).yOrigin, a.yOrigin, i, y)), (_ === S.xOffset && f === S.yOffset) || ((i = we(S, "xOffset", g ? _ : S.xOffset, S.xOffset, i, y)), (i = we(S, "yOffset", g ? f : S.yOffset, S.yOffset, i, y))), (O = We ? null : "0px 0px")), (O || (Le && u && S.zOrigin)) && (Ie ? ((h = !0), (p = Ce), (O = (O || ee(e, p, B, !1, "50% 50%")) + ""), ((i = new Te(v, p, 0, 0, i, -1, y)).b = v[p]), (i.plugin = s), Le ? ((d = S.zOrigin), (O = O.split(" ")), (S.zOrigin = (2 < O.length && (0 === d || "0px" !== O[2]) ? parseFloat(O[2]) : d) || 0), (i.xs0 = i.e = O[0] + " " + (O[1] || "50%") + " 0px"), ((i = new Te(S, "zOrigin", 0, 0, i, -1, i.n)).b = d), (i.xs0 = i.e = S.zOrigin)) : (i.xs0 = i.e = O)) : ae(O + "", S)), h && (n._transformType = (S.svg && We) || (!u && 3 !== this._transformType) ? 2 : 3), l && (r[o] = l), i ); }, prefix: !0, } ), Be("boxShadow", { defaultValue: "0px 0px 0px 0px #999", prefix: !0, color: !0, multi: !0, keyword: "inset" }), Be("borderRadius", { defaultValue: "0px", parser: function (e, t, o, n, i, s) { t = this.format(t); var r, l, a, d, u, h, c, _, f, m, p, g, v, b, T, w, y = ["borderTopLeftRadius", "borderTopRightRadius", "borderBottomRightRadius", "borderBottomLeftRadius"], S = e.style; for (f = parseFloat(e.offsetWidth), m = parseFloat(e.offsetHeight), r = t.split(" "), l = 0; l < y.length; l++) this.p.indexOf("border") && (y[l] = $(y[l])), -1 !== (u = d = ee(e, y[l], B, !1, "0px")).indexOf(" ") && ((u = (d = u.split(" "))[0]), (d = d[1])), (h = a = r[l]), (c = parseFloat(u)), (g = u.substr((c + "").length)), (v = "=" === h.charAt(1)) ? ((_ = parseInt(h.charAt(0) + "1", 10)), (h = h.substr(2)), (_ *= parseFloat(h)), (p = h.substr((_ + "").length - (_ < 0 ? 1 : 0)) || "")) : ((_ = parseFloat(h)), (p = h.substr((_ + "").length))), "" === p && (p = O[o] || g), p !== g && ((b = te(e, "borderLeft", c, g)), (T = te(e, "borderTop", c, g)), "%" === p ? ((u = (b / f) * 100 + "%"), (d = (T / m) * 100 + "%")) : "em" === p ? ((u = b / (w = te(e, "borderLeft", 1, "em")) + "em"), (d = T / w + "em")) : ((u = b + "px"), (d = T + "px")), v && ((h = parseFloat(u) + _ + p), (a = parseFloat(d) + _ + p))), (i = ye(S, y[l], u + " " + d, h + " " + a, !1, "0px", i)); return i; }, prefix: !0, formatter: ge("0px 0px 0px 0px", !1, !0), }), Be("borderBottomLeftRadius,borderBottomRightRadius,borderTopLeftRadius,borderTopRightRadius", { defaultValue: "0px", parser: function (e, t, o, n, i, s) { return ye(e.style, o, this.format(ee(e, o, B, !1, "0px 0px")), this.format(t), !1, "0px", i); }, prefix: !0, formatter: ge("0px 0px", !1, !0), }), Be("backgroundPosition", { defaultValue: "0 0", parser: function (e, t, o, n, i, s) { var r, l, a, d, u, h, c = "background-position", _ = B || J(e, null), f = this.format( (_ ? (D ? _.getPropertyValue(c + "-x") + " " + _.getPropertyValue(c + "-y") : _.getPropertyValue(c)) : e.currentStyle.backgroundPositionX + " " + e.currentStyle.backgroundPositionY) || "0 0" ), m = this.format(t); if ((-1 !== f.indexOf("%")) != (-1 !== m.indexOf("%")) && m.split(",").length < 2 && (h = ee(e, "backgroundImage").replace(S, "")) && "none" !== h) { for (r = f.split(" "), l = m.split(" "), V.setAttribute("src", h), a = 2; -1 < --a;) (d = -1 !== (f = r[a]).indexOf("%")) !== (-1 !== l[a].indexOf("%")) && ((u = 0 === a ? e.offsetWidth - V.width : e.offsetHeight - V.height), (r[a] = d ? (parseFloat(f) / 100) * u + "px" : (parseFloat(f) / u) * 100 + "%")); f = r.join(" "); } return this.parseComplex(e.style, f, m, i, s); }, formatter: ae, }), Be("backgroundSize", { defaultValue: "0 0", formatter: function (e) { return ae(-1 === (e += "").indexOf(" ") ? e + " " + e : e); }, }), Be("perspective", { defaultValue: "0px", prefix: !0 }), Be("perspectiveOrigin", { defaultValue: "50% 50%", prefix: !0 }), Be("transformStyle", { prefix: !0 }), Be("backfaceVisibility", { prefix: !0 }), Be("userSelect", { prefix: !0 }), Be("margin", { parser: ve("marginTop,marginRight,marginBottom,marginLeft") }), Be("padding", { parser: ve("paddingTop,paddingRight,paddingBottom,paddingLeft") }), Be("clip", { defaultValue: "rect(0px,0px,0px,0px)", parser: function (e, t, o, n, i, s) { var r, l, a; return ( D < 9 ? ((l = e.currentStyle), (a = D < 8 ? " " : ","), (r = "rect(" + l.clipTop + a + l.clipRight + a + l.clipBottom + a + l.clipLeft + ")"), (t = this.format(t).split(",").join(a))) : ((r = this.format(ee(e, this.p, B, !1, this.dflt))), (t = this.format(t))), this.parseComplex(e.style, r, t, i, s) ); }, }), Be("textShadow", { defaultValue: "0px 0px 0px #999", color: !0, multi: !0 }), Be("autoRound,strictUnits", { parser: function (e, t, o, n, i) { return i; }, }), Be("border", { defaultValue: "0px solid #000", parser: function (e, t, o, n, i, s) { var r = ee(e, "borderTopWidth", B, !1, "0px"), l = this.format(t).split(" "), a = l[0].replace(x, ""); return ( "px" !== a && (r = parseFloat(r) / te(e, "borderTopWidth", 1, a) + a), this.parseComplex(e.style, this.format(r + " " + ee(e, "borderTopStyle", B, !1, "solid") + " " + ee(e, "borderTopColor", B, !1, "#000")), l.join(" "), i, s) ); }, color: !0, formatter: function (e) { var t = e.split(" "); return t[0] + " " + (t[1] || "solid") + " " + (e.match(pe) || ["#000"])[0]; }, }), Be("borderWidth", { parser: ve("borderTopWidth,borderRightWidth,borderBottomWidth,borderLeftWidth") }), Be("float,cssFloat,styleFloat", { parser: function (e, t, o, n, i, s) { var r = e.style, l = "cssFloat" in r ? "cssFloat" : "styleFloat"; return new Te(r, l, 0, 0, i, -1, o, !1, 0, r[l], t); }, }); var Ke = function (e) { var t, o = this.t, n = o.filter || ee(this.data, "filter") || "", i = (this.s + this.c * e) | 0; 100 === i && (-1 === n.indexOf("atrix(") && -1 === n.indexOf("radient(") && -1 === n.indexOf("oader(") ? (o.removeAttribute("filter"), (t = !ee(this.data, "filter"))) : ((o.filter = n.replace(r, "")), (t = !0))), t || (this.xn1 && (o.filter = n = n || "alpha(opacity=" + i + ")"), -1 === n.indexOf("pacity") ? (0 === i && this.xn1) || (o.filter = n + " alpha(opacity=" + i + ")") : (o.filter = n.replace(I, "opacity=" + i))); }; Be("opacity,alpha,autoAlpha", { defaultValue: "1", parser: function (e, t, o, n, i, s) { var r = parseFloat(ee(e, "opacity", B, !1, "1")), l = e.style, a = "autoAlpha" === o; return ( "string" == typeof t && "=" === t.charAt(1) && (t = ("-" === t.charAt(0) ? -1 : 1) * parseFloat(t.substr(2)) + r), a && 1 === r && "hidden" === ee(e, "visibility", B) && 0 !== t && (r = 0), G ? (i = new Te(l, "opacity", r, t - r, i)) : (((i = new Te(l, "opacity", 100 * r, 100 * (t - r), i)).xn1 = a ? 1 : 0), (l.zoom = 1), (i.type = 2), (i.b = "alpha(opacity=" + i.s + ")"), (i.e = "alpha(opacity=" + (i.s + i.c) + ")"), (i.data = e), (i.plugin = s), (i.setRatio = Ke)), a && (((i = new Te(l, "visibility", 0, 0, i, -1, null, !1, 0, 0 !== r ? "inherit" : "hidden", 0 === t ? "hidden" : "inherit")).xs0 = "inherit"), n._overwriteProps.push(i.n), n._overwriteProps.push(o)), i ); }, }); var qe = function (e, t) { t && (e.removeProperty ? (("ms" !== t.substr(0, 2) && "webkit" !== t.substr(0, 6)) || (t = "-" + t), e.removeProperty(t.replace(l, "-$1").toLowerCase())) : e.removeAttribute(t)); }, Qe = function (e) { if (((this.t._gsClassPT = this), 1 === e || 0 === e)) { this.t.setAttribute("class", 0 === e ? this.b : this.e); for (var t = this.data, o = this.t.style; t;) t.v ? (o[t.p] = t.v) : qe(o, t.p), (t = t._next); 1 === e && this.t._gsClassPT === this && (this.t._gsClassPT = null); } else this.t.getAttribute("class") !== this.e && this.t.setAttribute("class", this.e); }; Be("className", { parser: function (e, t, o, n, i, s, r) { var l, a, d, u, h, c = e.getAttribute("class") || "", _ = e.style.cssText; if ((((i = n._classNamePT = new Te(e, o, 0, 0, i, 2)).setRatio = Qe), (i.pr = -11), (f = !0), (i.b = c), (a = ne(e, B)), (d = e._gsClassPT))) { for (u = {}, h = d.data; h;) (u[h.p] = 1), (h = h._next); d.setRatio(1); } return ( ((e._gsClassPT = i).e = "=" !== t.charAt(1) ? t : c.replace(new RegExp("(?:\\s|^)" + t.substr(2) + "(?![\\w-])"), "") + ("+" === t.charAt(0) ? " " + t.substr(2) : "")), e.setAttribute("class", i.e), (l = ie(e, a, ne(e), r, u)), e.setAttribute("class", c), (i.data = l.firstMPT), (e.style.cssText = _), (i = i.xfirst = n.parse(e, l.difs, i, s)) ); }, }); var $e = function (e) { if ((1 === e || 0 === e) && this.data._totalTime === this.data._totalDuration && "isFromStart" !== this.data.data) { var t, o, n, i, s, r = this.t.style, l = p.transform.parse; if ("all" === this.e) i = !(r.cssText = ""); else for (n = (t = this.e.split(" ").join("").split(",")).length; -1 < --n;) (o = t[n]), p[o] && (p[o].parse === l ? (i = !0) : (o = "transformOrigin" === o ? Ce : p[o].p)), qe(r, o); i && (qe(r, Ie), (s = this.t._gsTransform) && (s.svg && (this.t.removeAttribute("data-svg-origin"), this.t.removeAttribute("transform")), delete this.t._gsTransform)); } }; for ( Be("clearProps", { parser: function (e, t, o, n, i) { return ((i = new Te(e, o, 0, 0, i, 2)).setRatio = $e), (i.e = t), (i.pr = -10), (i.data = n._tween), (f = !0), i; }, }), e = "bezier,throwProps,physicsProps,physics2D".split(","), Se = e.length; Se--; ) De(e[Se]); ((e = z.prototype)._firstPT = e._lastParsedTransform = e._transform = null), (e._onInitTween = function (e, t, o, n) { if (!e.nodeType) return !1; (this._target = H = e), (this._tween = o), (this._vars = t), (M = n), (W = t.autoRound), (f = !1), (O = t.suffixMap || z.suffixMap), (B = J(e, "")), (m = this._overwriteProps); var i, s, r, l, a, d, u, h, c, _ = e.style; if ( (g && "" === _.zIndex && (("auto" !== (i = ee(e, "zIndex", B)) && "" !== i) || this._addLazySet(_, "zIndex", 0)), "string" == typeof t && ((l = _.cssText), (i = ne(e, B)), (_.cssText = l + ";" + t), (i = ie(e, i, ne(e)).difs), !G && w.test(t) && (i.opacity = parseFloat(RegExp.$1)), (t = i), (_.cssText = l)), t.className ? (this._firstPT = s = p.className.parse(e, t.className, "className", this, null, null, t)) : (this._firstPT = s = this.parse(e, t, null)), this._transformType) ) { for ( c = 3 === this._transformType, Ie ? v && ((g = !0), "" === _.zIndex && (("auto" !== (u = ee(e, "zIndex", B)) && "" !== u) || this._addLazySet(_, "zIndex", 0)), b && this._addLazySet(_, "WebkitBackfaceVisibility", this._vars.WebkitBackfaceVisibility || (c ? "visible" : "hidden"))) : (_.zoom = 1), r = s; r && r._next; ) r = r._next; (h = new Te(e, "transform", 0, 0, null, 2)), this._linkCSSP(h, null, r), (h.setRatio = Ie ? Ze : Ge), (h.data = this._transform || je(e, B, !0)), (h.tween = o), (h.pr = -1), m.pop(); } if (f) { for (; s;) { for (d = s._next, r = l; r && r.pr > s.pr;) r = r._next; (s._prev = r ? r._prev : a) ? (s._prev._next = s) : (l = s), (s._next = r) ? (r._prev = s) : (a = s), (s = d); } this._firstPT = l; } return !0; }), (e.parse = function (e, t, o, n) { var i, s, r, l, a, d, u, h, c, _, f = e.style; for (i in t) "function" == typeof (d = t[i]) && (d = d(M, H)), (s = p[i]) ? (o = s.parse(e, d, i, this, o, n, t)) : ((a = ee(e, i, B) + ""), (c = "string" == typeof d), "color" === i || "fill" === i || "stroke" === i || -1 !== i.indexOf("Color") || (c && y.test(d)) ? (c || (d = (3 < (d = fe(d)).length ? "rgba(" : "rgb(") + d.join(",") + ")"), (o = ye(f, i, a, d, !0, "transparent", o, 0, n))) : c && L.test(d) ? (o = ye(f, i, a, d, !0, null, o, 0, n)) : ((u = (r = parseFloat(a)) || 0 === r ? a.substr((r + "").length) : ""), ("" !== a && "auto" !== a) || ("width" === i || "height" === i ? ((r = le(e, i, B)), (u = "px")) : "left" === i || "top" === i ? ((r = oe(e, i, B)), (u = "px")) : ((r = "opacity" !== i ? 0 : 1), (u = ""))), (_ = c && "=" === d.charAt(1)) ? ((l = parseInt(d.charAt(0) + "1", 10)), (d = d.substr(2)), (l *= parseFloat(d)), (h = d.replace(x, ""))) : ((l = parseFloat(d)), (h = c ? d.replace(x, "") : "")), "" === h && (h = i in O ? O[i] : u), (d = l || 0 === l ? (_ ? l + r : l) + h : t[i]), u !== h && "" !== h && (l || 0 === l) && r && ((r = te(e, i, r, u)), "%" === h ? ((r /= te(e, i, 100, "%") / 100), !0 !== t.strictUnits && (a = r + "%")) : "em" === h || "rem" === h || "vw" === h || "vh" === h ? (r /= te(e, i, 1, h)) : "px" !== h && ((l = te(e, i, l, h)), (h = "px")), _ && (l || 0 === l) && (d = l + r + h)), _ && (l += r), (!r && 0 !== r) || (!l && 0 !== l) ? void 0 !== f[i] && (d || (d + "" != "NaN" && null != d)) ? ((o = new Te(f, i, l || r || 0, 0, o, -1, i, !1, 0, a, d)).xs0 = "none" !== d || ("display" !== i && -1 === i.indexOf("Style")) ? d : a) : K("invalid " + i + " tween value: " + t[i]) : ((o = new Te(f, i, r, l - r, o, 0, i, !1 !== W && ("px" === h || "zIndex" === i), 0, a, d)).xs0 = h))), n && o && !o.plugin && (o.plugin = n); return o; }), (e.setRatio = function (e) { var t, o, n, i = this._firstPT; if (1 !== e || (this._tween._time !== this._tween._duration && 0 !== this._tween._time)) if (e || (this._tween._time !== this._tween._duration && 0 !== this._tween._time) || -1e-6 === this._tween._rawPrevTime) for (; i;) { if (((t = i.c * e + i.s), i.r ? (t = Math.round(t)) : t < 1e-6 && -1e-6 < t && (t = 0), i.type)) if (1 === i.type) if (2 === (n = i.l)) i.t[i.p] = i.xs0 + t + i.xs1 + i.xn1 + i.xs2; else if (3 === n) i.t[i.p] = i.xs0 + t + i.xs1 + i.xn1 + i.xs2 + i.xn2 + i.xs3; else if (4 === n) i.t[i.p] = i.xs0 + t + i.xs1 + i.xn1 + i.xs2 + i.xn2 + i.xs3 + i.xn3 + i.xs4; else if (5 === n) i.t[i.p] = i.xs0 + t + i.xs1 + i.xn1 + i.xs2 + i.xn2 + i.xs3 + i.xn3 + i.xs4 + i.xn4 + i.xs5; else { for (o = i.xs0 + t + i.xs1, n = 1; n < i.l; n++) o += i["xn" + n] + i["xs" + (n + 1)]; i.t[i.p] = o; } else -1 === i.type ? (i.t[i.p] = i.xs0) : i.setRatio && i.setRatio(e); else i.t[i.p] = t + i.xs0; i = i._next; } else for (; i;) 2 !== i.type ? (i.t[i.p] = i.b) : i.setRatio(e), (i = i._next); else for (; i;) { if (2 !== i.type) if (i.r && -1 !== i.type) if (((t = Math.round(i.s + i.c)), i.type)) { if (1 === i.type) { for (n = i.l, o = i.xs0 + t + i.xs1, n = 1; n < i.l; n++) o += i["xn" + n] + i["xs" + (n + 1)]; i.t[i.p] = o; } } else i.t[i.p] = t + i.xs0; else i.t[i.p] = i.e; else i.setRatio(e); i = i._next; } }), (e._enableTransforms = function (e) { (this._transform = this._transform || je(this._target, B, !0)), (this._transformType = (this._transform.svg && We) || (!e && 3 !== this._transformType) ? 2 : 3); }); var Je = function (e) { (this.t[this.p] = this.e), this.data._linkCSSP(this, this._next, null, !0); }; (e._addLazySet = function (e, t, o) { var n = (this._firstPT = new Te(e, t, 0, 0, this._firstPT, 2)); (n.e = o), (n.setRatio = Je), (n.data = this); }), (e._linkCSSP = function (e, t, o, n) { return ( e && (t && (t._prev = e), e._next && (e._next._prev = e._prev), e._prev ? (e._prev._next = e._next) : this._firstPT === e && ((this._firstPT = e._next), (n = !0)), o ? (o._next = e) : n || null !== this._firstPT || (this._firstPT = e), (e._next = t), (e._prev = o)), e ); }), (e._mod = function (e) { for (var t = this._firstPT; t;) "function" == typeof e[t.p] && e[t.p] === Math.round && (t.r = 1), (t = t._next); }), (e._kill = function (e) { var t, o, n, i = e; if (e.autoAlpha || e.alpha) { for (o in ((i = {}), e)) i[o] = e[o]; (i.opacity = 1), i.autoAlpha && (i.visibility = 1); } for ( e.className && (t = this._classNamePT) && ((n = t.xfirst) && n._prev ? this._linkCSSP(n._prev, t._next, n._prev._prev) : n === this._firstPT && (this._firstPT = t._next), t._next && this._linkCSSP(t._next, t._next._next, n._prev), (this._classNamePT = null)), t = this._firstPT; t; ) t.plugin && t.plugin !== o && t.plugin._kill && (t.plugin._kill(e), (o = t.plugin)), (t = t._next); return s.prototype._kill.call(this, i); }); var et = function (e, t, o) { var n, i, s, r; if (e.slice) for (i = e.length; -1 < --i;) et(e[i], t, o); else for (i = (n = e.childNodes).length; -1 < --i;) (r = (s = n[i]).type), s.style && (t.push(ne(s)), o && o.push(s)), (1 !== r && 9 !== r && 11 !== r) || !s.childNodes.length || et(s, t, o); }; return ( (z.cascadeTo = function (e, t, o) { var n, i, s, r, l = N.to(e, t, o), a = [l], d = [], u = [], h = [], c = N._internals.reservedProps; for (e = l._targets || l.target, et(e, d, h), l.render(t, !0, !0), et(e, u), l.render(0, !0, !0), l._enabled(!0), n = h.length; -1 < --n;) if ((i = ie(h[n], d[n], u[n])).firstMPT) { for (s in ((i = i.difs), o)) c[s] && (i[s] = o[s]); for (s in ((r = {}), i)) r[s] = d[n][s]; a.push(N.fromTo(h[n], t, r, i)); } return a; }), s.activate([z]), z ); }, !0 ), (t = _fwd_gsScope.FWDFWD_gsDefine.plugin({ propName: "roundProps", version: "1.6.0", priority: -1, API: 2, init: function (e, t, o) { return (this._tween = o), !0; }, })), (a = function (e) { for (; e;) e.f || e.blob || (e.m = Math.round), (e = e._next); }), ((n = t.prototype)._onInitAllProps = function () { for (var e, t, o, n = this._tween, i = n.vars.roundProps.join ? n.vars.roundProps : n.vars.roundProps.split(","), s = i.length, r = {}, l = n._propLookup.roundProps; -1 < --s;) r[i[s]] = Math.round; for (s = i.length; -1 < --s;) for (e = i[s], t = n._firstPT; t;) (o = t._next), t.pg ? t.t._mod(r) : t.n === e && (2 === t.f && t.t ? a(t.t._firstPT) : (this._add(t.t, e, t.s, t.c), o && (o._prev = t._prev), t._prev ? (t._prev._next = o) : n._firstPT === t && (n._firstPT = o), (t._next = t._prev = null), (n._propLookup[e] = l))), (t = o); return !1; }), (n._add = function (e, t, o, n) { this._addTween(e, t, o, o + n, t, Math.round), this._overwriteProps.push(t); }), _fwd_gsScope.FWDFWD_gsDefine.plugin({ propName: "attr", API: 2, version: "0.6.0", init: function (e, t, o, n) { var i, s; if ("function" != typeof e.setAttribute) return !1; for (i in t) "function" == typeof (s = t[i]) && (s = s(n, e)), this._addTween(e, "setAttribute", e.getAttribute(i) + "", s + "", i, !1, i), this._overwriteProps.push(i); return !0; }, }), (_fwd_gsScope.FWDFWD_gsDefine.plugin({ propName: "directionalRotation", version: "0.3.0", API: 2, init: function (e, t, o, n) { "object" != typeof t && (t = { rotation: t }), (this.finals = {}); var i, s, r, l, a, d, u = !0 === t.useRadians ? 2 * Math.PI : 360; for (i in t) "useRadians" !== i && ("function" == typeof (l = t[i]) && (l = l(n, e)), (s = (d = (l + "").split("_"))[0]), (r = parseFloat("function" != typeof e[i] ? e[i] : e[i.indexOf("set") || "function" != typeof e["get" + i.substr(3)] ? i : "get" + i.substr(3)]())), (a = (l = this.finals[i] = "string" == typeof s && "=" === s.charAt(1) ? r + parseInt(s.charAt(0) + "1", 10) * Number(s.substr(2)) : Number(s) || 0) - r), d.length && (-1 !== (s = d.join("_")).indexOf("short") && (a %= u) !== a % (u / 2) && (a = a < 0 ? a + u : a - u), -1 !== s.indexOf("_cw") && a < 0 ? (a = ((a + 9999999999 * u) % u) - ((a / u) | 0) * u) : -1 !== s.indexOf("ccw") && 0 < a && (a = ((a - 9999999999 * u) % u) - ((a / u) | 0) * u)), (1e-6 < a || a < -1e-6) && (this._addTween(e, i, r, r + a, i), this._overwriteProps.push(i))); return !0; }, set: function (e) { var t; if (1 !== e) this._super.setRatio.call(this, e); else for (t = this._firstPT; t;) t.f ? t.t[t.p](this.finals[t.p]) : (t.t[t.p] = this.finals[t.p]), (t = t._next); }, })._autoCSS = !0), _fwd_gsScope.FWDFWD_gsDefine( "easing.Back", ["easing.Ease"], function (p) { var t, o, e, n = _fwd_gsScope.FWDGreenSockGlobals || _fwd_gsScope, i = n.com.greensock, s = 2 * Math.PI, r = Math.PI / 2, l = i._class, a = function (e, t) { var o = l("easing." + e, function () { }, !0), n = (o.prototype = new p()); return (n.constructor = o), (n.getRatio = t), o; }, d = p.register || function () { }, u = function (e, t, o, n, i) { var s = l("easing." + e, { easeOut: new t(), easeIn: new o(), easeInOut: new n() }, !0); return d(s, e), s; }, g = function (e, t, o) { (this.t = e), (this.v = t), o && ((((this.next = o).prev = this).c = o.v - t), (this.gap = o.t - e)); }, h = function (e, t) { var o = l( "easing." + e, function (e) { (this._p1 = e || 0 === e ? e : 1.70158), (this._p2 = 1.525 * this._p1); }, !0 ), n = (o.prototype = new p()); return ( (n.constructor = o), (n.getRatio = t), (n.config = function (e) { return new o(e); }), o ); }, c = u( "Back", h("BackOut", function (e) { return (e -= 1) * e * ((this._p1 + 1) * e + this._p1) + 1; }), h("BackIn", function (e) { return e * e * ((this._p1 + 1) * e - this._p1); }), h("BackInOut", function (e) { return (e *= 2) < 1 ? 0.5 * e * e * ((this._p2 + 1) * e - this._p2) : 0.5 * ((e -= 2) * e * ((this._p2 + 1) * e + this._p2) + 2); }) ), _ = l( "easing.SlowMo", function (e, t, o) { (t = t || 0 === t ? t : 0.7), null == e ? (e = 0.7) : 1 < e && (e = 1), (this._p = 1 !== e ? t : 0), (this._p1 = (1 - e) / 2), (this._p2 = e), (this._p3 = this._p1 + this._p2), (this._calcEnd = !0 === o); }, !0 ), f = (_.prototype = new p()); return ( (f.constructor = _), (f.getRatio = function (e) { var t = e + (0.5 - e) * this._p; return e < this._p1 ? this._calcEnd ? 1 - (e = 1 - e / this._p1) * e : t - (e = 1 - e / this._p1) * e * e * e * t : e > this._p3 ? this._calcEnd ? 1 - (e = (e - this._p3) / this._p1) * e : t + (e - t) * (e = (e - this._p3) / this._p1) * e * e * e : this._calcEnd ? 1 : t; }), (_.ease = new _(0.7, 0.7)), (f.config = _.config = function (e, t, o) { return new _(e, t, o); }), ((f = (t = l( "easing.SteppedEase", function (e) { (e = e || 1), (this._p1 = 1 / e), (this._p2 = e + 1); }, !0 )).prototype = new p()).constructor = t), (f.getRatio = function (e) { return e < 0 ? (e = 0) : 1 <= e && (e = 0.999999999), ((this._p2 * e) >> 0) * this._p1; }), (f.config = t.config = function (e) { return new t(e); }), ((f = (o = l( "easing.RoughEase", function (e) { for ( var t, o, n, i, s, r, l = (e = e || {}).taper || "none", a = [], d = 0, u = 0 | (e.points || 20), h = u, c = !1 !== e.randomize, _ = !0 === e.clamp, f = e.template instanceof p ? e.template : null, m = "number" == typeof e.strength ? 0.4 * e.strength : 0.4; -1 < --h; ) (t = c ? Math.random() : (1 / u) * h), (o = f ? f.getRatio(t) : t), (n = "none" === l ? m : "out" === l ? (i = 1 - t) * i * m : "in" === l ? t * t * m : t < 0.5 ? (i = 2 * t) * i * 0.5 * m : (i = 2 * (1 - t)) * i * 0.5 * m), c ? (o += Math.random() * n - 0.5 * n) : h % 2 ? (o += 0.5 * n) : (o -= 0.5 * n), _ && (1 < o ? (o = 1) : o < 0 && (o = 0)), (a[d++] = { x: t, y: o }); for ( a.sort(function (e, t) { return e.x - t.x; }), r = new g(1, 1, null), h = u; -1 < --h; ) (s = a[h]), (r = new g(s.x, s.y, r)); this._prev = new g(0, 0, 0 !== r.t ? r : r.next); }, !0 )).prototype = new p()).constructor = o), (f.getRatio = function (e) { var t = this._prev; if (e > t.t) { for (; t.next && e >= t.t;) t = t.next; t = t.prev; } else for (; t.prev && e <= t.t;) t = t.prev; return (this._prev = t).v + ((e - t.t) / t.gap) * t.c; }), (f.config = function (e) { return new o(e); }), (o.ease = new o()), u( "Bounce", 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 + 0.75 : e < 2.5 / 2.75 ? 7.5625 * (e -= 2.25 / 2.75) * e + 0.9375 : 7.5625 * (e -= 2.625 / 2.75) * e + 0.984375; }), a("BounceIn", function (e) { return (e = 1 - e) < 1 / 2.75 ? 1 - 7.5625 * e * e : e < 2 / 2.75 ? 1 - (7.5625 * (e -= 1.5 / 2.75) * e + 0.75) : e < 2.5 / 2.75 ? 1 - (7.5625 * (e -= 2.25 / 2.75) * e + 0.9375) : 1 - (7.5625 * (e -= 2.625 / 2.75) * e + 0.984375); }), a("BounceInOut", function (e) { var t = e < 0.5; return ( (e = t ? 1 - 2 * e : 2 * e - 1) < 1 / 2.75 ? (e *= 7.5625 * e) : (e = e < 2 / 2.75 ? 7.5625 * (e -= 1.5 / 2.75) * e + 0.75 : e < 2.5 / 2.75 ? 7.5625 * (e -= 2.25 / 2.75) * e + 0.9375 : 7.5625 * (e -= 2.625 / 2.75) * e + 0.984375), t ? 0.5 * (1 - e) : 0.5 * e + 0.5 ); }) ), u( "Circ", a("CircOut", function (e) { return Math.sqrt(1 - (e -= 1) * e); }), a("CircIn", function (e) { return -(Math.sqrt(1 - e * e) - 1); }), a("CircInOut", function (e) { return (e *= 2) < 1 ? -0.5 * (Math.sqrt(1 - e * e) - 1) : 0.5 * (Math.sqrt(1 - (e -= 2) * e) + 1); }) ), u( "Elastic", (e = function (e, t, o) { var n = l( "easing." + e, function (e, t) { (this._p1 = 1 <= e ? e : 1), (this._p2 = (t || o) / (e < 1 ? e : 1)), (this._p3 = (this._p2 / s) * (Math.asin(1 / this._p1) || 0)), (this._p2 = s / this._p2); }, !0 ), i = (n.prototype = new p()); return ( (i.constructor = n), (i.getRatio = t), (i.config = function (e, t) { return new n(e, t); }), n ); })( "ElasticOut", function (e) { return this._p1 * Math.pow(2, -10 * e) * Math.sin((e - this._p3) * this._p2) + 1; }, 0.3 ), e( "ElasticIn", function (e) { return -this._p1 * Math.pow(2, 10 * (e -= 1)) * Math.sin((e - this._p3) * this._p2); }, 0.3 ), e( "ElasticInOut", function (e) { return (e *= 2) < 1 ? this._p1 * Math.pow(2, 10 * (e -= 1)) * Math.sin((e - this._p3) * this._p2) * -0.5 : this._p1 * Math.pow(2, -10 * (e -= 1)) * Math.sin((e - this._p3) * this._p2) * 0.5 + 1; }, 0.45 ) ), u( "Expo", a("ExpoOut", function (e) { return 1 - Math.pow(2, -10 * e); }), a("ExpoIn", function (e) { return Math.pow(2, 10 * (e - 1)) - 0.001; }), a("ExpoInOut", function (e) { return (e *= 2) < 1 ? 0.5 * Math.pow(2, 10 * (e - 1)) : 0.5 * (2 - Math.pow(2, -10 * (e - 1))); }) ), u( "Sine", a("SineOut", function (e) { return Math.sin(e * r); }), a("SineIn", function (e) { return 1 - Math.cos(e * r); }), a("SineInOut", function (e) { return -0.5 * (Math.cos(Math.PI * e) - 1); }) ), l( "easing.EaseLookup", { find: function (e) { return p.map[e]; }, }, !0 ), d(n.SlowMo, "SlowMo", "ease,"), d(o, "RoughEase", "ease,"), d(t, "SteppedEase", "ease,"), c ); }, !0 ); }), _fwd_gsScope.FWDFWD_gsDefine && _fwd_gsScope._fwd_gsQueue.pop()(), (function (_, f) { "use strict"; var m = {}, p = (_.FWDGreenSockGlobals = _.FWDGreenSockGlobals || _); if (!p.FWDTweenLite) { var e, t, o, g, v, n, i, b = function (e) { var t, o = e.split("."), n = p; for (t = 0; t < o.length; t++) n[o[t]] = n = n[o[t]] || {}; return n; }, h = b("com.greensock"), T = 1e-10, a = function (e) { var t, o = [], n = e.length; for (t = 0; t !== n; o.push(e[t++])); return o; }, w = function () { }, y = ((n = Object.prototype.toString), (i = n.call([])), function (e) { return null != e && (e instanceof Array || ("object" == typeof e && !!e.push && n.call(e) === i)); }), S = {}, O = function (a, d, u, h) { (this.sc = S[a] ? S[a].sc : []), ((S[a] = this).gsClass = null), (this.func = u); var c = []; (this.check = function (e) { for (var t, o, n, i, s, r = d.length, l = r; -1 < --r;) (t = S[d[r]] || new O(d[r], [])).gsClass ? ((c[r] = t.gsClass), l--) : e && t.sc.push(this); if (0 === l && u) { if (((n = (o = ("com.greensock." + a).split(".")).pop()), (i = b(o.join("."))[n] = this.gsClass = u.apply(u, c)), h)) if (((p[n] = m[n] = i), !(s = "undefined" != typeof fwd_module && fwd_module.exports) && "function" == typeof define && define.amd)) define((_.FWDGreenSockAMDPath ? _.FWDGreenSockAMDPath + "/" : "") + a.split(".").pop(), [], function () { return i; }); else if (s) if (a === f) for (r in ((fwd_module.exports = m[f] = i), m)) i[r] = m[r]; else m[f] && (m[f][n] = i); for (r = 0; r < this.sc.length; r++) this.sc[r].check(); } }), this.check(!0); }, s = (_.FWDFWD_gsDefine = function (e, t, o, n) { return new O(e, t, o, n); }), c = (h._class = function (e, t, o) { return ( (t = t || function () { }), s( e, [], function () { return t; }, o ), t ); }); s.globals = p; var r = [0, 0, 1, 1], B = c( "easing.Ease", function (e, t, o, n) { (this._func = e), (this._type = o || 0), (this._power = n || 0), (this._params = t ? r.concat(t) : r); }, !0 ), D = (B.map = {}), l = (B.register = function (e, t, o, n) { for (var i, s, r, l, a = t.split(","), d = a.length, u = (o || "easeIn,easeOut,easeInOut").split(","); -1 < --d;) for (s = a[d], i = n ? c("easing." + s, null, !0) : h.easing[s] || {}, r = u.length; -1 < --r;) (l = u[r]), (D[s + "." + l] = D[l + s] = i[l] = e.getRatio ? e : e[l] || new e()); }); for ( (o = B.prototype)._calcEnd = !1, o.getRatio = function (e) { if (this._func) return (this._params[0] = e), this._func.apply(null, this._params); var t = this._type, o = this._power, n = 1 === t ? 1 - e : 2 === t ? e : e < 0.5 ? 2 * e : 2 * (1 - e); return 1 === o ? (n *= n) : 2 === o ? (n *= n * n) : 3 === o ? (n *= n * n * n) : 4 === o && (n *= n * n * n * n), 1 === t ? 1 - n : 2 === t ? n : e < 0.5 ? n / 2 : 1 - n / 2; }, t = (e = ["Linear", "Quad", "Cubic", "Quart", "Quint,Strong"]).length; -1 < --t; ) (o = e[t] + ",Power" + t), l(new B(null, null, 1, t), o, "easeOut", !0), l(new B(null, null, 2, t), o, "easeIn" + (0 === t ? ",easeNone" : "")), l(new B(null, null, 3, t), o, "easeInOut"); (D.linear = h.easing.Linear.easeIn), (D.swing = h.easing.Quad.easeInOut); var W = c("events.EventDispatcher", function (e) { (this._listeners = {}), (this._eventTarget = e || this); }); ((o = W.prototype).addEventListener = function (e, t, o, n, i) { i = i || 0; var s, r, l = this._listeners[e], a = 0; for (this !== g || v || g.wake(), null == l && (this._listeners[e] = l = []), r = l.length; -1 < --r;) (s = l[r]).c === t && s.s === o ? l.splice(r, 1) : 0 === a && s.pr < i && (a = r + 1); l.splice(a, 0, { c: t, s: o, up: n, pr: i }); }), (o.removeEventListener = function (e, t) { var o, n = this._listeners[e]; if (n) for (o = n.length; -1 < --o;) if (n[o].c === t) return void n.splice(o, 1); }), (o.dispatchEvent = function (e) { var t, o, n, i = this._listeners[e]; if (i) for (1 < (t = i.length) && (i = i.slice(0)), o = this._eventTarget; -1 < --t;) (n = i[t]) && (n.up ? n.c.call(n.s || o, { type: e, target: o }) : n.c.call(n.s || o)); }); var H = _.requestAnimationFrame, M = _.cancelAnimationFrame, E = Date.now || function () { return new Date().getTime(); }, P = E(); for (t = (e = ["ms", "moz", "webkit", "o"]).length; -1 < --t && !H;) (H = _[e[t] + "RequestAnimationFrame"]), (M = _[e[t] + "CancelAnimationFrame"] || _[e[t] + "CancelRequestAnimationFrame"]); c("Ticker", function (e, t) { var i, s, r, l, a, d = this, u = E(), o = !(!1 === t || !H) && "auto", h = 500, c = 33, _ = function (e) { var t, o, n = E() - P; h < n && (u += n - c), (P += n), (d.time = (P - u) / 1e3), (t = d.time - a), (!i || 0 < t || !0 === e) && (d.frame++, (a += t + (l <= t ? 0.004 : l - t)), (o = !0)), !0 !== e && (r = s(_)), o && d.dispatchEvent("tick"); }; W.call(d), (d.time = d.frame = 0), (d.tick = function () { _(!0); }), (d.lagSmoothing = function (e, t) { (h = e || 1e10), (c = Math.min(t, h, 0)); }), (d.sleep = function () { null != r && (o && M ? M(r) : clearTimeout(r), (s = w), (r = null), d === g && (v = !1)); }), (d.wake = function (e) { null !== r ? d.sleep() : e ? (u += -P + (P = E())) : 10 < d.frame && (P = E() - h + 5), (s = 0 === i ? w : o && H ? H : function (e) { return setTimeout(e, (1e3 * (a - d.time) + 1) | 0); }), d === g && (v = !0), _(2); }), (d.fps = function (e) { if (!arguments.length) return i; (l = 1 / ((i = e) || 60)), (a = this.time + l), d.wake(); }), (d.useRAF = function (e) { if (!arguments.length) return o; d.sleep(), (o = e), d.fps(i); }), d.fps(e), setTimeout(function () { "auto" === o && d.frame < 5 && "hidden" !== document.visibilityState && d.useRAF(!1); }, 1500); }), ((o = h.Ticker.prototype = new h.events.EventDispatcher()).constructor = h.Ticker); var d = c("core.FWDAnim", function (e, t) { if ( ((this.vars = t = t || {}), (this._duration = this._totalDuration = e || 0), (this._delay = Number(t.delay) || 0), (this._timeScale = 1), (this._active = !0 === t.immediateRender), (this.data = t.data), (this._reversed = !0 === t.reversed), Z) ) { v || g.wake(); var o = this.vars.useFrames ? G : Z; o.add(this, o._time), this.vars.paused && this.paused(!0); } }); (g = d.ticker = new h.Ticker()), ((o = d.prototype)._dirty = o._gc = o._initted = o._paused = !1), (o._totalTime = o._time = 0), (o._rawPrevTime = -1), (o._next = o._last = o._onUpdate = o._timeline = o.timeline = null), (o._paused = !1); var u = function () { v && 2e3 < E() - P && g.wake(), setTimeout(u, 2e3); }; u(), (o.play = function (e, t) { return null != e && this.seek(e, t), this.reversed(!1).paused(!1); }), (o.pause = function (e, t) { return null != e && this.seek(e, t), this.paused(!0); }), (o.resume = function (e, t) { return null != e && this.seek(e, t), this.paused(!1); }), (o.seek = function (e, t) { return this.totalTime(Number(e), !1 !== t); }), (o.restart = function (e, t) { return this.reversed(!1) .paused(!1) .totalTime(e ? -this._delay : 0, !1 !== t, !0); }), (o.reverse = function (e, t) { return null != e && this.seek(e || this.totalDuration(), t), this.reversed(!0).paused(!1); }), (o.render = function (e, t, o) { }), (o.invalidate = function () { return (this._time = this._totalTime = 0), (this._initted = this._gc = !1), (this._rawPrevTime = -1), (!this._gc && this.timeline) || this._enabled(!0), this; }), (o.isActive = function () { var e, t = this._timeline, o = this._startTime; return !t || (!this._gc && !this._paused && t.isActive() && (e = t.rawTime()) >= o && e < o + this.totalDuration() / this._timeScale); }), (o._enabled = function (e, t) { return ( v || g.wake(), (this._gc = !e), (this._active = this.isActive()), !0 !== t && (e && !this.timeline ? this._timeline.add(this, this._startTime - this._delay) : !e && this.timeline && this._timeline._remove(this, !0)), !1 ); }), (o._kill = function (e, t) { return this._enabled(!1, !1); }), (o.kill = function (e, t) { return this._kill(e, t), this; }), (o._uncache = function (e) { for (var t = e ? this : this.timeline; t;) (t._dirty = !0), (t = t.timeline); return this; }), (o._swapSelfInParams = function (e) { for (var t = e.length, o = e.concat(); -1 < --t;) "{self}" === e[t] && (o[t] = this); return o; }), (o._callback = function (e) { var t = this.vars, o = t[e], n = t[e + "Params"], i = t[e + "Scope"] || t.callbackScope || this; switch (n ? n.length : 0) { case 0: o.call(i); break; case 1: o.call(i, n[0]); break; case 2: o.call(i, n[0], n[1]); break; default: o.apply(i, n); } }), (o.eventCallback = function (e, t, o, n) { if ("on" === (e || "").substr(0, 2)) { var i = this.vars; if (1 === arguments.length) return i[e]; null == t ? delete i[e] : ((i[e] = t), (i[e + "Params"] = y(o) && -1 !== o.join("").indexOf("{self}") ? this._swapSelfInParams(o) : o), (i[e + "Scope"] = n)), "onUpdate" === e && (this._onUpdate = t); } return this; }), (o.delay = function (e) { return arguments.length ? (this._timeline.smoothChildTiming && this.startTime(this._startTime + e - this._delay), (this._delay = e), this) : this._delay; }), (o.duration = function (e) { return arguments.length ? ((this._duration = this._totalDuration = e), this._uncache(!0), this._timeline.smoothChildTiming && 0 < this._time && this._time < this._duration && 0 !== e && this.totalTime(this._totalTime * (e / this._duration), !0), this) : ((this._dirty = !1), this._duration); }), (o.totalDuration = function (e) { return (this._dirty = !1), arguments.length ? this.duration(e) : this._totalDuration; }), (o.time = function (e, t) { return arguments.length ? (this._dirty && this.totalDuration(), this.totalTime(e > this._duration ? this._duration : e, t)) : this._time; }), (o.totalTime = function (e, t, o) { if ((v || g.wake(), !arguments.length)) return this._totalTime; if (this._timeline) { if ((e < 0 && !o && (e += this.totalDuration()), this._timeline.smoothChildTiming)) { this._dirty && this.totalDuration(); var n = this._totalDuration, i = this._timeline; if ((n < e && !o && (e = n), (this._startTime = (this._paused ? this._pauseTime : i._time) - (this._reversed ? n - e : e) / this._timeScale), i._dirty || this._uncache(!1), i._timeline)) for (; i._timeline;) i._timeline._time !== (i._startTime + i._totalTime) / i._timeScale && i.totalTime(i._totalTime, !0), (i = i._timeline); } this._gc && this._enabled(!0, !1), (this._totalTime === e && 0 !== this._duration) || (C.length && q(), this.render(e, t, !1), C.length && q()); } return this; }), (o.progress = o.totalProgress = function (e, t) { var o = this.duration(); return arguments.length ? this.totalTime(o * e, t) : o ? this._time / o : this.ratio; }), (o.startTime = function (e) { return arguments.length ? (e !== this._startTime && ((this._startTime = e), this.timeline && this.timeline._sortChildren && this.timeline.add(this, e - this._delay)), this) : this._startTime; }), (o.endTime = function (e) { return this._startTime + (0 != e ? this.totalDuration() : this.duration()) / this._timeScale; }), (o.timeScale = function (e) { if (!arguments.length) return this._timeScale; if (((e = e || T), this._timeline && this._timeline.smoothChildTiming)) { var t = this._pauseTime, o = t || 0 === t ? t : this._timeline.totalTime(); this._startTime = o - ((o - this._startTime) * this._timeScale) / e; } return (this._timeScale = e), this._uncache(!1); }), (o.reversed = function (e) { return arguments.length ? (e != this._reversed && ((this._reversed = e), this.totalTime(this._timeline && !this._timeline.smoothChildTiming ? this.totalDuration() - this._totalTime : this._totalTime, !0)), this) : this._reversed; }), (o.paused = function (e) { if (!arguments.length) return this._paused; var t, o, n = this._timeline; return ( e != this._paused && n && (v || e || g.wake(), (o = (t = n.rawTime()) - this._pauseTime), !e && n.smoothChildTiming && ((this._startTime += o), this._uncache(!1)), (this._pauseTime = e ? t : null), (this._paused = e), (this._active = this.isActive()), !e && 0 !== o && this._initted && this.duration() && ((t = n.smoothChildTiming ? this._totalTime : (t - this._startTime) / this._timeScale), this.render(t, t === this._totalTime, !0))), this._gc && !e && this._enabled(!0, !1), this ); }); var x = c("core.FWDSimpleTimeline", function (e) { d.call(this, 0, e), (this.autoRemoveChildren = this.smoothChildTiming = !0); }); ((o = x.prototype = new d()).constructor = x), (o.kill()._gc = !1), (o._first = o._last = o._recent = null), (o._sortChildren = !1), (o.add = o.insert = function (e, t, o, n) { var i, s; if ( ((e._startTime = Number(t || 0) + e._delay), e._paused && this !== e._timeline && (e._pauseTime = e._startTime + (this.rawTime() - e._startTime) / e._timeScale), e.timeline && e.timeline._remove(e, !0), (e.timeline = e._timeline = this), e._gc && e._enabled(!0, !0), (i = this._last), this._sortChildren) ) for (s = e._startTime; i && i._startTime > s;) i = i._prev; return ( i ? ((e._next = i._next), (i._next = e)) : ((e._next = this._first), (this._first = e)), e._next ? (e._next._prev = e) : (this._last = e), (e._prev = i), (this._recent = e), this._timeline && this._uncache(!0), this ); }), (o._remove = function (e, t) { return ( e.timeline === this && (t || e._enabled(!1, !0), e._prev ? (e._prev._next = e._next) : this._first === e && (this._first = e._next), e._next ? (e._next._prev = e._prev) : this._last === e && (this._last = e._prev), (e._next = e._prev = e.timeline = null), e === this._recent && (this._recent = this._last), this._timeline && this._uncache(!0)), this ); }), (o.render = function (e, t, o) { var n, i = this._first; for (this._totalTime = this._time = this._rawPrevTime = e; i;) (n = i._next), (i._active || (e >= i._startTime && !i._paused)) && (i._reversed ? i.render((i._dirty ? i.totalDuration() : i._totalDuration) - (e - i._startTime) * i._timeScale, t, o) : i.render((e - i._startTime) * i._timeScale, t, o)), (i = n); }), (o.rawTime = function () { return v || g.wake(), this._totalTime; }); var I = c( "FWDTweenLite", function (e, t, o) { if ((d.call(this, t, o), (this.render = I.prototype.render), null == e)) throw "Cannot tween a null target."; this.target = e = "string" != typeof e ? e : I.selector(e) || e; var n, i, s, r = e.jquery || (e.length && e !== _ && e[0] && (e[0] === _ || (e[0].nodeType && e[0].style && !e.nodeType))), l = this.vars.overwrite; if (((this._overwrite = l = null == l ? j[I.defaultOverwrite] : "number" == typeof l ? l >> 0 : j[l]), (r || e instanceof Array || (e.push && y(e))) && "number" != typeof e[0])) for (this._targets = s = a(e), this._propLookup = [], this._siblings = [], n = 0; n < s.length; n++) (i = s[n]) ? "string" != typeof i ? i.length && i !== _ && i[0] && (i[0] === _ || (i[0].nodeType && i[0].style && !i.nodeType)) ? (s.splice(n--, 1), (this._targets = s = s.concat(a(i)))) : ((this._siblings[n] = Q(i, this, !1)), 1 === l && 1 < this._siblings[n].length && J(i, this, null, 1, this._siblings[n])) : "string" == typeof (i = s[n--] = I.selector(i)) && s.splice(n + 1, 1) : s.splice(n--, 1); else (this._propLookup = {}), (this._siblings = Q(e, this, !1)), 1 === l && 1 < this._siblings.length && J(e, this, null, 1, this._siblings); (this.vars.immediateRender || (0 === t && 0 === this._delay && !1 !== this.vars.immediateRender)) && ((this._time = -T), this.render(Math.min(0, -this._delay))); }, !0 ), F = function (e) { return e && e.length && e !== _ && e[0] && (e[0] === _ || (e[0].nodeType && e[0].style && !e.nodeType)); }; ((o = I.prototype = new d()).constructor = I), (o.kill()._gc = !1), (o.ratio = 0), (o._firstPT = o._targets = o._overwrittenProps = o._startAt = null), (o._notifyPluginsOfEnabled = o._lazy = !1), (I.version = "1.19.0"), (I.defaultEase = o._ease = new B(null, null, 1, 1)), (I.defaultOverwrite = "auto"), (I.ticker = g), (I.autoSleep = 120), (I.lagSmoothing = function (e, t) { g.lagSmoothing(e, t); }), (I.selector = _.$ || _.jQuery || function (e) { var t = _.$ || _.jQuery; return t ? (I.selector = t)(e) : "undefined" == typeof document ? e : document.querySelectorAll ? document.querySelectorAll(e) : document.getElementById("#" === e.charAt(0) ? e.substr(1) : e); }); var C = [], L = {}, k = /(?:(-|-=|\+=)?\d*\.?\d*(?:e[\-+]?\d+)?)[0-9]/gi, A = function (e) { for (var t, o = this._firstPT; o;) (t = o.blob ? (e ? this.join("") : this.start) : o.c * e + o.s), o.m ? (t = o.m(t, this._target || o.t)) : t < 1e-6 && -1e-6 < t && (t = 0), o.f ? (o.fp ? o.t[o.p](o.fp, t) : o.t[o.p](t)) : (o.t[o.p] = t), (o = o._next); }, R = function (e, t, o, n) { var i, s, r, l, a, d, u, h = [e, t], c = 0, _ = "", f = 0; for (h.start = e, o && (o(h), (e = h[0]), (t = h[1])), h.length = 0, i = e.match(k) || [], s = t.match(k) || [], n && ((n._next = null), (n.blob = 1), (h._firstPT = h._applyPT = n)), a = s.length, l = 0; l < a; l++) (u = s[l]), (_ += (d = t.substr(c, t.indexOf(u, c) - c)) || !l ? d : ","), (c += d.length), f ? (f = (f + 1) % 5) : "rgba(" === d.substr(-5) && (f = 1), u === i[l] || i.length <= l ? (_ += u) : (_ && (h.push(_), (_ = "")), (r = parseFloat(i[l])), h.push(r), (h._firstPT = { _next: h._firstPT, t: h, p: h.length - 1, s: r, c: ("=" === u.charAt(1) ? parseInt(u.charAt(0) + "1", 10) * parseFloat(u.substr(2)) : parseFloat(u) - r) || 0, f: 0, m: f && f < 4 ? Math.round : 0, })), (c += u.length); return (_ += t.substr(c)) && h.push(_), (h.setRatio = A), h; }, N = function (e, t, o, n, i, s, r, l, a) { "function" == typeof n && (n = n(a || 0, e)); var d, u = "get" === o ? e[t] : o, h = typeof e[t], c = "string" == typeof n && "=" === n.charAt(1), _ = { t: e, p: t, s: u, f: "function" === h, pg: 0, n: i || t, m: s ? ("function" == typeof s ? s : Math.round) : 0, pr: 0, c: c ? parseInt(n.charAt(0) + "1", 10) * parseFloat(n.substr(2)) : parseFloat(n) - u || 0, }; if ( ("number" !== h && ("function" === h && "get" === o && ((d = t.indexOf("set") || "function" != typeof e["get" + t.substr(3)] ? t : "get" + t.substr(3)), (_.s = u = r ? e[d](r) : e[d]())), "string" == typeof u && (r || isNaN(u)) ? ((_.fp = r), (_ = { t: R(u, n, l || I.defaultStringFilter, _), p: "setRatio", s: 0, c: 1, f: 2, pg: 0, n: i || t, pr: 0, m: 0 })) : c || ((_.s = parseFloat(u)), (_.c = parseFloat(n) - _.s || 0))), _.c) ) return (_._next = this._firstPT) && (_._next._prev = _), (this._firstPT = _); }, z = (I._internals = { isArray: y, isSelector: F, lazyTweens: C, blobDif: R }), U = (I._plugins = {}), Y = (z.tweenLookup = {}), X = 0, V = (z.reservedProps = { ease: 1, delay: 1, overwrite: 1, onComplete: 1, onCompleteParams: 1, onCompleteScope: 1, useFrames: 1, runBackwards: 1, startAt: 1, onUpdate: 1, onUpdateParams: 1, onUpdateScope: 1, onStart: 1, onStartParams: 1, onStartScope: 1, onReverseComplete: 1, onReverseCompleteParams: 1, onReverseCompleteScope: 1, onRepeat: 1, onRepeatParams: 1, onRepeatScope: 1, easeParams: 1, yoyo: 1, immediateRender: 1, repeat: 1, repeatDelay: 1, data: 1, paused: 1, reversed: 1, autoCSS: 1, lazy: 1, onOverwrite: 1, callbackScope: 1, stringFilter: 1, id: 1, }), j = { none: 0, all: 1, auto: 2, concurrent: 3, allOnStart: 4, preexisting: 5, true: 1, false: 0 }, G = (d._rootFramesTimeline = new x()), Z = (d._rootTimeline = new x()), K = 30, q = (z.lazyRender = function () { var e, t = C.length; for (L = {}; -1 < --t;) (e = C[t]) && !1 !== e._lazy && (e.render(e._lazy[0], e._lazy[1], !0), (e._lazy = !1)); C.length = 0; }); (Z._startTime = g.time), (G._startTime = g.frame), (Z._active = G._active = !0), setTimeout(q, 1), (d._updateRoot = I.render = function () { var e, t, o; if ((C.length && q(), Z.render((g.time - Z._startTime) * Z._timeScale, !1, !1), G.render((g.frame - G._startTime) * G._timeScale, !1, !1), C.length && q(), g.frame >= K)) { for (o in ((K = g.frame + (parseInt(I.autoSleep, 10) || 120)), Y)) { for (e = (t = Y[o].tweens).length; -1 < --e;) t[e]._gc && t.splice(e, 1); 0 === t.length && delete Y[o]; } if ((!(o = Z._first) || o._paused) && I.autoSleep && !G._first && 1 === g._listeners.tick.length) { for (; o && o._paused;) o = o._next; o || g.sleep(); } } }), g.addEventListener("tick", d._updateRoot); var Q = function (e, t, o) { var n, i, s = e._gsTweenID; if ((Y[s || (e._gsTweenID = s = "t" + X++)] || (Y[s] = { target: e, tweens: [] }), t && (((n = Y[s].tweens)[(i = n.length)] = t), o))) for (; -1 < --i;) n[i] === t && n.splice(i, 1); return Y[s].tweens; }, $ = function (e, t, o, n) { var i, s, r = e.vars.onOverwrite; return r && (i = r(e, t, o, n)), (r = I.onOverwrite) && (s = r(e, t, o, n)), !1 !== i && !1 !== s; }, J = function (e, t, o, n, i) { var s, r, l, a; if (1 === n || 4 <= n) { for (a = i.length, s = 0; s < a; s++) if ((l = i[s]) !== t) l._gc || (l._kill(null, e, t) && (r = !0)); else if (5 === n) break; return r; } var d, u = t._startTime + T, h = [], c = 0, _ = 0 === t._duration; for (s = i.length; -1 < --s;) (l = i[s]) === t || l._gc || l._paused || (l._timeline !== t._timeline ? ((d = d || ee(t, 0, _)), 0 === ee(l, d, _) && (h[c++] = l)) : l._startTime <= u && l._startTime + l.totalDuration() / l._timeScale > u && (((_ || !l._initted) && u - l._startTime <= 2e-10) || (h[c++] = l))); for (s = c; -1 < --s;) if (((l = h[s]), 2 === n && l._kill(o, e, t) && (r = !0), 2 !== n || (!l._firstPT && l._initted))) { if (2 !== n && !$(l, t)) continue; l._enabled(!1, !1) && (r = !0); } return r; }, ee = function (e, t, o) { for (var n = e._timeline, i = n._timeScale, s = e._startTime; n._timeline;) { if (((s += n._startTime), (i *= n._timeScale), n._paused)) return -100; n = n._timeline; } return t < (s /= i) ? s - t : (o && s === t) || (!e._initted && s - t < 2 * T) ? T : (s += e.totalDuration() / e._timeScale / i) > t + T ? 0 : s - t - T; }; (o._init = function () { var e, t, o, n, i, s, r = this.vars, l = this._overwrittenProps, a = this._duration, d = !!r.immediateRender, u = r.ease; if (r.startAt) { for (n in (this._startAt && (this._startAt.render(-1, !0), this._startAt.kill()), (i = {}), r.startAt)) i[n] = r.startAt[n]; if (((i.overwrite = !1), (i.immediateRender = !0), (i.lazy = d && !1 !== r.lazy), (i.startAt = i.delay = null), (this._startAt = I.to(this.target, 0, i)), d)) if (0 < this._time) this._startAt = null; else if (0 !== a) return; } else if (r.runBackwards && 0 !== a) if (this._startAt) this._startAt.render(-1, !0), this._startAt.kill(), (this._startAt = null); else { for (n in (0 !== this._time && (d = !1), (o = {}), r)) (V[n] && "autoCSS" !== n) || (o[n] = r[n]); if (((o.overwrite = 0), (o.data = "isFromStart"), (o.lazy = d && !1 !== r.lazy), (o.immediateRender = d), (this._startAt = I.to(this.target, 0, o)), d)) { if (0 === this._time) return; } else this._startAt._init(), this._startAt._enabled(!1), this.vars.immediateRender && (this._startAt = null); } if ( ((this._ease = u = u ? (u instanceof B ? u : "function" == typeof u ? new B(u, r.easeParams) : D[u] || I.defaultEase) : I.defaultEase), r.easeParams instanceof Array && u.config && (this._ease = u.config.apply(u, r.easeParams)), (this._easeType = this._ease._type), (this._easePower = this._ease._power), (this._firstPT = null), this._targets) ) for (s = this._targets.length, e = 0; e < s; e++) this._initProps(this._targets[e], (this._propLookup[e] = {}), this._siblings[e], l ? l[e] : null, e) && (t = !0); else t = this._initProps(this.target, this._propLookup, this._siblings, l, 0); if ((t && I._onPluginEvent("_onInitAllProps", this), l && (this._firstPT || ("function" != typeof this.target && this._enabled(!1, !1))), r.runBackwards)) for (o = this._firstPT; o;) (o.s += o.c), (o.c = -o.c), (o = o._next); (this._onUpdate = r.onUpdate), (this._initted = !0); }), (o._initProps = function (e, t, o, n, i) { var s, r, l, a, d, u; if (null == e) return !1; for (s in (L[e._gsTweenID] && q(), this.vars.css || (e.style && e !== _ && e.nodeType && U.css && !1 !== this.vars.autoCSS && (function (e, t) { var o, n = {}; for (o in e) V[o] || (o in t && "transform" !== o && "x" !== o && "y" !== o && "width" !== o && "height" !== o && "className" !== o && "border" !== o) || !(!U[o] || (U[o] && U[o]._autoCSS)) || ((n[o] = e[o]), delete e[o]); e.css = n; })(this.vars, e)), this.vars)) if (((u = this.vars[s]), V[s])) u && (u instanceof Array || (u.push && y(u))) && -1 !== u.join("").indexOf("{self}") && (this.vars[s] = u = this._swapSelfInParams(u, this)); else if (U[s] && (a = new U[s]())._onInitTween(e, this.vars[s], this, i)) { for (this._firstPT = d = { _next: this._firstPT, t: a, p: "setRatio", s: 0, c: 1, f: 1, n: s, pg: 1, pr: a._priority, m: 0 }, r = a._overwriteProps.length; -1 < --r;) t[a._overwriteProps[r]] = this._firstPT; (a._priority || a._onInitAllProps) && (l = !0), (a._onDisable || a._onEnable) && (this._notifyPluginsOfEnabled = !0), d._next && (d._next._prev = d); } else t[s] = N.call(this, e, s, "get", u, s, 0, null, this.vars.stringFilter, i); return n && this._kill(n, e) ? this._initProps(e, t, o, n, i) : 1 < this._overwrite && this._firstPT && 1 < o.length && J(e, this, t, this._overwrite, o) ? (this._kill(t, e), this._initProps(e, t, o, n, i)) : (this._firstPT && ((!1 !== this.vars.lazy && this._duration) || (this.vars.lazy && !this._duration)) && (L[e._gsTweenID] = !0), l); }), (o.render = function (e, t, o) { var n, i, s, r, l = this._time, a = this._duration, d = this._rawPrevTime; if (a - 1e-7 <= e) (this._totalTime = this._time = a), (this.ratio = this._ease._calcEnd ? this._ease.getRatio(1) : 1), this._reversed || ((n = !0), (i = "onComplete"), (o = o || this._timeline.autoRemoveChildren)), 0 === a && (this._initted || !this.vars.lazy || o) && (this._startTime === this._timeline._duration && (e = 0), (d < 0 || (e <= 0 && -1e-7 <= e) || (d === T && "isPause" !== this.data)) && d !== e && ((o = !0), T < d && (i = "onReverseComplete")), (this._rawPrevTime = r = !t || e || d === e ? e : T)); else if (e < 1e-7) (this._totalTime = this._time = 0), (this.ratio = this._ease._calcEnd ? this._ease.getRatio(0) : 0), (0 !== l || (0 === a && 0 < d)) && ((i = "onReverseComplete"), (n = this._reversed)), e < 0 && ((this._active = !1), 0 === a && (this._initted || !this.vars.lazy || o) && (0 <= d && (d !== T || "isPause" !== this.data) && (o = !0), (this._rawPrevTime = r = !t || e || d === e ? e : T))), this._initted || (o = !0); else if (((this._totalTime = this._time = e), this._easeType)) { var u = e / a, h = this._easeType, c = this._easePower; (1 === h || (3 === h && 0.5 <= u)) && (u = 1 - u), 3 === h && (u *= 2), 1 === c ? (u *= u) : 2 === c ? (u *= u * u) : 3 === c ? (u *= u * u * u) : 4 === c && (u *= u * u * u * u), (this.ratio = 1 === h ? 1 - u : 2 === h ? u : e / a < 0.5 ? u / 2 : 1 - u / 2); } else this.ratio = this._ease.getRatio(e / a); if (this._time !== l || o) { if (!this._initted) { if ((this._init(), !this._initted || this._gc)) return; if (!o && this._firstPT && ((!1 !== this.vars.lazy && this._duration) || (this.vars.lazy && !this._duration))) return (this._time = this._totalTime = l), (this._rawPrevTime = d), C.push(this), void (this._lazy = [e, t]); this._time && !n ? (this.ratio = this._ease.getRatio(this._time / a)) : n && this._ease._calcEnd && (this.ratio = this._ease.getRatio(0 === this._time ? 0 : 1)); } for ( !1 !== this._lazy && (this._lazy = !1), this._active || (!this._paused && this._time !== l && 0 <= e && (this._active = !0)), 0 === l && (this._startAt && (0 <= e ? this._startAt.render(e, t, o) : i || (i = "_dummyGS")), this.vars.onStart && ((0 === this._time && 0 !== a) || t || this._callback("onStart"))), s = this._firstPT; s; ) s.f ? s.t[s.p](s.c * this.ratio + s.s) : (s.t[s.p] = s.c * this.ratio + s.s), (s = s._next); this._onUpdate && (e < 0 && this._startAt && -1e-4 !== e && this._startAt.render(e, t, o), t || ((this._time !== l || n || o) && this._callback("onUpdate"))), i && ((this._gc && !o) || (e < 0 && this._startAt && !this._onUpdate && -1e-4 !== e && this._startAt.render(e, t, o), n && (this._timeline.autoRemoveChildren && this._enabled(!1, !1), (this._active = !1)), !t && this.vars[i] && this._callback(i), 0 === a && this._rawPrevTime === T && r !== T && (this._rawPrevTime = 0))); } }), (o._kill = function (e, t, o) { if (("all" === e && (e = null), null == e && (null == t || t === this.target))) return (this._lazy = !1), this._enabled(!1, !1); t = "string" != typeof t ? t || this._targets || this.target : I.selector(t) || t; var n, i, s, r, l, a, d, u, h, c = o && this._time && o._startTime === this._startTime && this._timeline === o._timeline; if ((y(t) || F(t)) && "number" != typeof t[0]) for (n = t.length; -1 < --n;) this._kill(e, t[n], o) && (a = !0); else { if (this._targets) { for (n = this._targets.length; -1 < --n;) if (t === this._targets[n]) { (l = this._propLookup[n] || {}), (this._overwrittenProps = this._overwrittenProps || []), (i = this._overwrittenProps[n] = e ? this._overwrittenProps[n] || {} : "all"); break; } } else { if (t !== this.target) return !1; (l = this._propLookup), (i = this._overwrittenProps = e ? this._overwrittenProps || {} : "all"); } if (l) { if (((d = e || l), (u = e !== i && "all" !== i && e !== l && ("object" != typeof e || !e._tempKill)), o && (I.onOverwrite || this.vars.onOverwrite))) { for (s in d) l[s] && (h || (h = []), h.push(s)); if ((h || !e) && !$(this, o, t, h)) return !1; } for (s in d) (r = l[s]) && (c && (r.f ? r.t[r.p](r.s) : (r.t[r.p] = r.s), (a = !0)), r.pg && r.t._kill(d) && (a = !0), (r.pg && 0 !== r.t._overwriteProps.length) || (r._prev ? (r._prev._next = r._next) : r === this._firstPT && (this._firstPT = r._next), r._next && (r._next._prev = r._prev), (r._next = r._prev = null)), delete l[s]), u && (i[s] = 1); !this._firstPT && this._initted && this._enabled(!1, !1); } } return a; }), (o.invalidate = function () { return ( this._notifyPluginsOfEnabled && I._onPluginEvent("_onDisable", this), (this._firstPT = this._overwrittenProps = this._startAt = this._onUpdate = null), (this._notifyPluginsOfEnabled = this._active = this._lazy = !1), (this._propLookup = this._targets ? {} : []), d.prototype.invalidate.call(this), this.vars.immediateRender && ((this._time = -T), this.render(Math.min(0, -this._delay))), this ); }), (o._enabled = function (e, t) { if ((v || g.wake(), e && this._gc)) { var o, n = this._targets; if (n) for (o = n.length; -1 < --o;) this._siblings[o] = Q(n[o], this, !0); else this._siblings = Q(this.target, this, !0); } return d.prototype._enabled.call(this, e, t), !(!this._notifyPluginsOfEnabled || !this._firstPT) && I._onPluginEvent(e ? "_onEnable" : "_onDisable", this); }), (I.to = function (e, t, o) { return new I(e, t, o); }), (I.from = function (e, t, o) { return (o.runBackwards = !0), (o.immediateRender = 0 != o.immediateRender), new I(e, t, o); }), (I.fromTo = function (e, t, o, n) { return (n.startAt = o), (n.immediateRender = 0 != n.immediateRender && 0 != o.immediateRender), new I(e, t, n); }), (I.delayedCall = function (e, t, o, n, i) { return new I(t, 0, { delay: e, onComplete: t, onCompleteParams: o, callbackScope: n, onReverseComplete: t, onReverseCompleteParams: o, immediateRender: !1, lazy: !1, useFrames: i, overwrite: 0 }); }), (I.set = function (e, t) { return new I(e, 0, t); }), (I.getTweensOf = function (e, t) { if (null == e) return []; var o, n, i, s; if (((e = "string" != typeof e ? e : I.selector(e) || e), (y(e) || F(e)) && "number" != typeof e[0])) { for (o = e.length, n = []; -1 < --o;) n = n.concat(I.getTweensOf(e[o], t)); for (o = n.length; -1 < --o;) for (s = n[o], i = o; -1 < --i;) s === n[i] && n.splice(o, 1); } else for (o = (n = Q(e).concat()).length; -1 < --o;) (n[o]._gc || (t && !n[o].isActive())) && n.splice(o, 1); return n; }), (I.killTweensOf = I.killDelayedCallsTo = function (e, t, o) { "object" == typeof t && ((o = t), (t = !1)); for (var n = I.getTweensOf(e, t), i = n.length; -1 < --i;) n[i]._kill(o, e); }); var te = c( "plugins.TweenPlugin", function (e, t) { (this._overwriteProps = (e || "").split(",")), (this._propName = this._overwriteProps[0]), (this._priority = t || 0), (this._super = te.prototype); }, !0 ); if ( ((o = te.prototype), (te.version = "1.19.0"), (te.API = 2), (o._firstPT = null), (o._addTween = N), (o.setRatio = A), (o._kill = function (e) { var t, o = this._overwriteProps, n = this._firstPT; if (null != e[this._propName]) this._overwriteProps = []; else for (t = o.length; -1 < --t;) null != e[o[t]] && o.splice(t, 1); for (; n;) null != e[n.n] && (n._next && (n._next._prev = n._prev), n._prev ? ((n._prev._next = n._next), (n._prev = null)) : this._firstPT === n && (this._firstPT = n._next)), (n = n._next); return !1; }), (o._mod = o._roundProps = function (e) { for (var t, o = this._firstPT; o;) (t = e[this._propName] || (null != o.n && e[o.n.split(this._propName + "_").join("")])) && "function" == typeof t && (2 === o.f ? (o.t._applyPT.m = t) : (o.m = t)), (o = o._next); }), (I._onPluginEvent = function (e, t) { var o, n, i, s, r, l = t._firstPT; if ("_onInitAllProps" === e) { for (; l;) { for (r = l._next, n = i; n && n.pr > l.pr;) n = n._next; (l._prev = n ? n._prev : s) ? (l._prev._next = l) : (i = l), (l._next = n) ? (n._prev = l) : (s = l), (l = r); } l = t._firstPT = i; } for (; l;) l.pg && "function" == typeof l.t[e] && l.t[e]() && (o = !0), (l = l._next); return o; }), (te.activate = function (e) { for (var t = e.length; -1 < --t;) e[t].API === te.API && (U[new e[t]()._propName] = e[t]); return !0; }), (s.plugin = function (e) { if (!(e && e.propName && e.init && e.API)) throw "illegal plugin definition."; var t, o = e.propName, n = e.priority || 0, i = e.overwriteProps, s = { init: "_onInitTween", set: "setRatio", kill: "_kill", round: "_mod", mod: "_mod", initAll: "_onInitAllProps" }, r = c( "plugins." + o.charAt(0).toUpperCase() + o.substr(1) + "Plugin", function () { te.call(this, o, n), (this._overwriteProps = i || []); }, !0 === e.fwd_global ), l = (r.prototype = new te(o)); for (t in (((l.constructor = r).API = e.API), s)) "function" == typeof e[t] && (l[s[t]] = e[t]); return (r.version = e.version), te.activate([r]), r; }), (e = _._fwd_gsQueue)) ) { for (t = 0; t < e.length; t++) e[t](); for (o in S) S[o].func || _.console.log("GSAP encountered missing dependency: " + o); } v = !1; } })("undefined" != typeof fwd_module && fwd_module.exports && "undefined" != typeof fwd_global ? fwd_global : this || window, "FWDAnimation"); } !(function (e) { var _ = function (e, t, o, n, i, s, r, l, a, d, u) { var h = this, c = _.prototype; h.pointer_img, (h.left_sdo = null), (h.middle_sdo = null), (h.right_sdo = null), (h.text_sdo = null), (h.pointer_sdo = null), (h.leftImagePath_str = i), (h.middleImagePath_str = s), (h.rightImagePath_str = r), (h.fontColor_str = l), (h.bottomPointer_str = u), (h.topPointer_str = d), (h.pointerPosition_str = a), (h.toolTipLabel_str = o), (h.toolTipLabel2_str = n), (h.marginWidth = e.width), (h.totalHeight = e.height), (h.pointerWidth = t.width), (h.pointerHeight = t.height), h.totalWidth, h.hideWithDelayId_do, (h.isMobile_bl = FWDUtils.isMobile), (h.isShowed_bl = !0), (h.init = function () { h.setOverflow("visible"), h.setWidth(200), h.setupMainContainers(), h.setLabel(h.toolTipLabel_str), h.hide(); }), (h.setupMainContainers = function () { var e; (h.left_sdo = new FWDSimpleDisplayObject("img")), ((e = new Image()).src = h.leftImagePath_str), h.left_sdo.setScreen(e), h.left_sdo.setWidth(h.marginWidth), h.left_sdo.setHeight(h.totalHeight), h.addChild(h.left_sdo), (h.middle_sdo = new FWDSimpleDisplayObject("img")), ((e = new Image()).src = h.middleImagePath_str), h.middle_sdo.setScreen(e), h.middle_sdo.setX(h.marginWidth), h.middle_sdo.setWidth(h.marginWidth), h.middle_sdo.setHeight(h.totalHeight), h.middle_sdo.setBkColor("#FFFFFF"), h.addChild(h.middle_sdo), (h.right_sdo = new FWDSimpleDisplayObject("img")), ((e = new Image()).src = h.rightImagePath_str), h.right_sdo.setScreen(e), h.right_sdo.setWidth(h.marginWidth), h.right_sdo.setHeight(h.totalHeight), h.addChild(h.right_sdo), (h.text_sdo = new FWDSimpleDisplayObject("div")), h.text_sdo.setBackfaceVisibility(), h.text_sdo.setDisplay("inline-block"), (h.text_sdo.getStyle().fontFamily = "Arial"), (h.text_sdo.getStyle().fontSize = "12px"), h.text_sdo.setHeight(20), (h.text_sdo.getStyle().color = h.fontColor_str), (h.text_sdo.getStyle().fontSmoothing = "antialiased"), (h.text_sdo.getStyle().webkitFontSmoothing = "antialiased"), (h.text_sdo.getStyle().textRendering = "optimizeLegibility"), h.text_sdo.setX(h.marginWidth), FWDUtils.isIEAndLessThen9 || FWDUtils.isSafari ? h.text_sdo.setY(parseInt((h.totalHeight - 8) / 2) - 2) : h.text_sdo.setY(parseInt((h.totalHeight - 8) / 2) - 1), h.addChild(h.text_sdo), (h.pointer_img = new Image()), h.pointerPosition_str == FWDController.POSITION_BOTTOM ? (h.pointer_img.src = h.bottomPointer_str) : (h.pointer_img.src = h.topPointer_str), (h.pointer_sdo = new FWDSimpleDisplayObject("img")), h.pointer_sdo.setScreen(h.pointer_img), h.pointer_sdo.setWidth(h.pointerWidth), h.pointer_sdo.setHeight(h.pointerHeight), h.addChild(h.pointer_sdo); }), (h.setLabel = function (e) { null != h && h.middle_sdo && (h.text_sdo.setInnerHTML(e), setTimeout(function () { null != h && (h.middle_sdo.setWidth(h.text_sdo.screen.offsetWidth), h.right_sdo.setX(h.text_sdo.screen.offsetWidth + h.marginWidth), (h.totalWidth = 2 * h.marginWidth + h.text_sdo.screen.offsetWidth), h.positionPointer(0)); }, 50)); }), (h.positionPointer = function (e) { var t, o; e || (e = 0), (t = parseInt((h.totalWidth - h.pointerWidth) / 2) + e), (o = h.pointerPosition_str == FWDController.POSITION_BOTTOM ? h.totalHeight - 1 : 1 - h.pointerHeight), h.pointer_sdo.setX(t), h.pointer_sdo.setY(o); }), (h.show = function () { h.isShowed_bl || (clearInterval(h.hideWithDelayId_do), h.positionPointer(), FWDAnimation.killTweensOf(h), FWDAnimation.to(h, 0.4, { alpha: 1, delay: 0.1, ease: Quart.easeOut }), (h.isShowed_bl = !0)); }), (h.hide = function () { h.isShowed_bl && (FWDAnimation.killTweensOf(h), h.setX(-5e3), h.setAlpha(0), (h.isShowed_bl = !1)); }), (h.destroy = function () { FWDAnimation.killTweensOf(h), (h.pointer_img = null), h.left_sdo.destroy(), h.middle_sdo.destroy(), h.right_sdo.destroy(), h.text_sdo.destroy(), h.pointer_sdo.destroy(), (h.leftImagePath_str = null), (h.middleImagePath_str = null), (h.rightImagePath_str = null), (h.fontColor_str = null), (h.bottomPointer_str = null), (h.topPointer_str = null), (h.pointerPosition_str = null), (h.toolTipLabel_str = null), (h.toolTipLabel2_str = null), (h.left_sdo = null), (h.middle_sdo = null), (h.right_sdo = null), (h.text_sdo = null), (h.pointer_sdo = null), (u = d = a = l = r = s = i = n = o = t = e = null), h.setInnerHTML(""), c.destroy(), (c = h = null), (_.prototype = null); }), h.init(); }; (_.setPrototype = function () { (_.prototype = null), (_.prototype = new FWDDisplayObject("div")); }), (_.CLICK = "onClick"), (_.MOUSE_DOWN = "onMouseDown"), (_.prototype = null), (e.FWDButtonToolTip = _); })(window), (function () { var l = function (e, t, o, n, i) { var s = this, r = l.prototype; (this.n1Img = e), (this.s1Img = t), (this.n2Img = o), (this.s2Img = n), this.firstButton_do, this.n1_do, this.s1_do, this.secondButton_do, this.n2_do, this.s2_do, (this.buttonWidth = s.n1Img.width), (this.buttonHeight = s.n1Img.height), (this.currentState = 1), (this.isDisabled_bl = !1), (this.isMaximized_bl = !1), (this.disptachMainEvent_bl = i), (this.isMobile_bl = FWDUtils.isMobile), (this.hasPointerEvent_bl = FWDUtils.hasPointerEvent), (s.init = function () { s.setButtonMode(!0), s.setWidth(s.buttonWidth), s.setHeight(s.buttonHeight), s.setupMainContainers(), s.secondButton_do.setVisible(!1); }), (s.setupMainContainers = function () { (s.firstButton_do = new FWDDisplayObject("div")), s.addChild(s.firstButton_do), (s.n1_do = new FWDSimpleDisplayObject("img")), s.n1_do.setScreen(s.n1Img), (s.s1_do = new FWDSimpleDisplayObject("img")), s.s1_do.setScreen(s.s1Img), s.s1_do.setAlpha(0), s.firstButton_do.addChild(s.n1_do), s.firstButton_do.addChild(s.s1_do), s.firstButton_do.setWidth(s.n1Img.width), s.firstButton_do.setHeight(s.n1Img.height), (s.secondButton_do = new FWDDisplayObject("div")), s.addChild(s.secondButton_do), (s.n2_do = new FWDSimpleDisplayObject("img")), s.n2_do.setScreen(s.n2Img), (s.s2_do = new FWDSimpleDisplayObject("img")), s.s2_do.setScreen(s.s2Img), s.s2_do.setAlpha(0), s.secondButton_do.addChild(s.n2_do), s.secondButton_do.addChild(s.s2_do), s.secondButton_do.setWidth(s.n2Img.width), s.secondButton_do.setHeight(s.n2Img.height), s.addChild(s.secondButton_do), s.addChild(s.firstButton_do), s.isMobile_bl ? s.hasPointerEvent_bl ? (s.screen.addEventListener("MSPointerDown", s.onMouseDown), s.screen.addEventListener("MSPointerUp", s.onClick), s.screen.addEventListener("MSPointerOver", s.onMouseOver), s.screen.addEventListener("MSPointerOut", s.onMouseOut)) : s.screen.addEventListener("touchstart", s.onMouseDown) : s.screen.addEventListener ? (s.screen.addEventListener("mouseover", s.onMouseOver), s.screen.addEventListener("mouseout", s.onMouseOut), s.screen.addEventListener("mousedown", s.onMouseDown), s.screen.addEventListener("click", s.onClick)) : s.screen.attachEvent && (s.screen.attachEvent("onmouseover", s.onMouseOver), s.screen.attachEvent("onmouseout", s.onMouseOut), s.screen.attachEvent("onmousedown", s.onMouseDown), s.screen.attachEvent("onclick", s.onClick)); }), (s.onMouseOver = function (e, t) { (e.pointerType && e.pointerType != e.MSPOINTER_TYPE_MOUSE) || (s.dispatchEvent(l.MOUSE_OVER, { e: e }), FWDAnimation.killTweensOf(s.s1_do), FWDAnimation.killTweensOf(s.s2_do), FWDAnimation.to(s.s1_do, 0.5, { alpha: 1, delay: 0.1, ease: Expo.easeOut }), FWDAnimation.to(s.s2_do, 0.5, { alpha: 1, delay: 0.1, ease: Expo.easeOut })); }), (s.onMouseOut = function (e) { (e.pointerType && e.pointerType != e.MSPOINTER_TYPE_MOUSE) || (FWDAnimation.killTweensOf(s.s1_do), FWDAnimation.killTweensOf(s.s2_do), FWDAnimation.to(s.s1_do, 0.5, { alpha: 0, ease: Expo.easeOut }), FWDAnimation.to(s.s2_do, 0.5, { alpha: 0, ease: Expo.easeOut }), s.dispatchEvent(l.MOUSE_OUT)); }), (s.onClick = function (e) { s.isDisabled_bl || (e.preventDefault && e.preventDefault(), s.disptachMainEvent_bl && s.dispatchEvent(l.CLICK)); }), (s.onMouseDown = function (e) { s.isDisabled_bl || (e.preventDefault && e.preventDefault(), s.isMobile_bl || s.onMouseOver(e, !1), s.disptachMainEvent_bl && s.dispatchEvent(l.MOUSE_DOWN, { e: e })); }), (s.toggleButton = function () { 1 == s.currentState ? (s.firstButton_do.setVisible(!1), s.secondButton_do.setVisible(!0), (s.currentState = 0), s.dispatchEvent(l.FIRST_BUTTON_CLICK)) : (s.firstButton_do.setVisible(!0), s.secondButton_do.setVisible(!1), (s.currentState = 1), s.dispatchEvent(l.SECOND_BUTTON_CLICK)); }), (s.setButtonState = function (e) { 1 == e ? (s.firstButton_do.setVisible(!0), s.secondButton_do.setVisible(!1), (s.currentState = 1)) : (s.firstButton_do.setVisible(!1), s.secondButton_do.setVisible(!0), (s.currentState = 0)); }), (s.destroy = function () { s.isMobile_bl ? s.hasPointerEvent_bl ? (s.screen.removeEventListener("MSPointerDown", s.onMouseDown), s.screen.removeEventListener("MSPointerUp", s.onClick), s.screen.removeEventListener("MSPointerOver", s.onMouseOver), s.screen.removeEventListener("MSPointerOut", s.onMouseOut)) : s.screen.removeEventListener("touchstart", s.onMouseDown) : s.screen.removeEventListener ? (s.screen.removeEventListener("mouseover", s.onMouseOver), s.screen.removeEventListener("mouseout", s.onMouseOut), s.screen.removeEventListener("mousedown", s.onMouseDown), s.screen.removeEventListener("click", s.onClick)) : s.screen.detachEvent && (s.screen.detachEvent("onmouseover", s.onMouseOver), s.screen.detachEvent("onmouseout", s.onMouseOut), s.screen.detachEvent("onmousedown", s.onMouseDown), s.screen.detachEvent("onclick", s.onClick)), FWDAnimation.killTweensOf(s.s1_do), FWDAnimation.killTweensOf(s.s2_do), s.firstButton_do.destroy(), s.n1_do.destroy(), s.s1_do.destroy(), s.secondButton_do.destroy(), s.n2_do.destroy(), s.s2_do.destroy(), (s.firstButton_do = null), (s.n1_do = null), (s.s1_do = null), (s.secondButton_do = null), (s.n2_do = null), (s.s2_do = null), (s.n1Img = null), (s.s1Img = null), (s.n2Img = null), (s.s2Img = null), (n = o = t = e = null), (s.init = null), (s.setupMainContainers = null), (s.onMouseOver = null), (s.onMouseOut = null), (s.onClick = null), (s.onMouseDown = null), (s.toggleButton = null), (s.setButtonState = null), (s.destroy = null), s.setInnerHTML(""), r.destroy(), (r = s = null), (l.prototype = null); }), s.init(); }; (l.setPrototype = function () { l.prototype = new FWDDisplayObject("div"); }), (l.FIRST_BUTTON_CLICK = "onFirstClick"), (l.SECOND_BUTTON_CLICK = "secondButtonOnClick"), (l.MOUSE_OVER = "onMouseOver"), (l.MOUSE_OUT = "onMouseOut"), (l.MOUSE_DOWN = "onMouseDown"), (l.CLICK = "onClick"), (l.prototype = null), (window.FWDComplexButton = l); })(window), (function (e) { var t = function () { var i = this; t.prototype; (this.main_do = null), (this.init = function () { this.setupScreen(), (e.onerror = this.showError), (this.screen.style.zIndex = 100000009), setTimeout(this.addConsoleToDom, 100), setInterval(this.position, 100); }), (this.position = function () { var e = FWDUtils.getScrollOffsets(); i.setX(e.x), i.setY(e.y); }), (this.addConsoleToDom = function () { -1 != navigator.userAgent.toLowerCase().indexOf("msie 7") ? document.getElementsByTagName("body")[0].appendChild(i.screen) : document.documentElement.appendChild(i.screen); }), (this.setupScreen = function () { (this.main_do = new FWDDisplayObject("div", "absolute")), this.main_do.setOverflow("auto"), this.main_do.setWidth(200), this.main_do.setHeight(300), this.setWidth(200), this.setHeight(300), this.main_do.setBkColor("#FFFFFF"), this.addChild(this.main_do); }), (this.showError = function (e, t, o) { var n = i.main_do.getInnerHTML() + "
JavaScript error: " + e + " on line " + o + " for " + t; i.main_do.setInnerHTML(n), (i.main_do.screen.scrollTop = i.main_do.screen.scrollHeight); }), (this.log = function (e) { var t = i.main_do.getInnerHTML() + "
" + e; i.main_do.setInnerHTML(t), (i.main_do.getScreen().scrollTop = 1e4); }), this.init(); }; (t.setPrototype = function () { t.prototype = new FWDDisplayObject("div", "absolute"); }), (t.prototype = null), (e.FWDConsole = t); })(window), (function () { var i = function (r, o) { var a = this, n = i.prototype; (a.parent = r), (a.buttonsTest_ar = o.buttons_ar), (a.itemsLabels_ar = o.contextMenuLabels_ar), (a.items_ar = []), (a.spacers_ar = []), (a.panButton_do = null), (a.rotateButton_do = null), (a.nextButton_do = null), (a.prevButton_do = null), (a.slideShowButton_do = null), (a.infoButton_do = null), (a.linkButton_do = null), (a.fullScreenButton_do = null), (a.zoomInButton_do = null), (a.zoomOutButton_do = null), (a.slideShowButton_do = null), (a.linkButton_do = null), (a.infoButton_do = null), (a.fullScreenButton_do = null), (a.backgroundColor_str = o.contextMenuBackgroundColor_str), (a.borderColor_str = o.contextMenuBorderColor_str), (a.spacerColor_str = o.contextMenuSpacerColor_str), (a.itemNormalColor_str = o.contextMenuItemNormalColor_str), (a.itemSelectedColor_str = o.contextMenuItemSelectedColor_str), (a.itemDisabledColor_str = o.contextMenuItemDisabledColor_str), (a.draggingMode_str = o.startDraggingMode_str), (a.link_str = o.link_str), (a.borderRadius = 6), a.biggestWidth, (a.totalWidth = 400), (a.totalHeight = 400), (a.sapaceBetweenButtons = 7), (a.padding = 6), a.getMaxWidthResizeAndPositionId_to, (a.inverseNextAndPrevRotation_bl = o.inverseNextAndPrevRotation_bl), (a.showScriptDeveloper_bl = o.showScriptDeveloper_bl), (a.show_bl = !1), (a.isActive_bl = !1), (a.init = function () { (a.itemsLabels_ar || a.showScriptDeveloper_bl) && ((a.show_bl = !0), a.setWidth(a.totalWidth), a.setHeight(a.totalHeight), a.setBkColor(a.backgroundColor_str), (a.getStyle().borderColor = a.borderColor_str), (a.getStyle().borderStyle = "solid"), (a.getStyle().borderRadius = a.borderRadius + "px"), (a.getStyle().borderWidth = "1px"), a.setVisible(!1), a.setY(-2e3), a.parent.main_do.addChild(a), a.setupLabels(), a.setupDeveloperButton(), a.setupSpacers(), (a.getMaxWidthResizeAndPositionId_to = setTimeout(a.getMaxWidthResizeAndPosition, 200))), a.addContextEvent(); }), (a.setupLabels = function () { var e, t = a.buttonsTest_ar.length, o = "", n = ""; if (a.itemsLabels_ar) for (var i = 0; i < t; i++) if ("pan" == (e = a.buttonsTest_ar[i])) (o = a.itemsLabels_ar[i] || "Contextmenu item is not defined!"), FWDContextMenuButton.setPrototype(), (a.panButton_do = new FWDContextMenuButton(o, void 0, a.itemNormalColor_str, a.itemSelectedColor_str, a.itemDisabledColor_str)), a.items_ar.push(a.panButton_do), a.draggingMode_str == FWDController.PAN && a.panButton_do.disable(), a.panButton_do.addListener(FWDContextMenuButton.MOUSE_DOWN, a.panRotateStartHandler), a.addChild(a.panButton_do); else if ("rotate" == e) (o = a.itemsLabels_ar[i] || "Contextmenu item is not defined!"), FWDContextMenuButton.setPrototype(), (a.rotateButton_do = new FWDContextMenuButton(o, void 0, a.itemNormalColor_str, a.itemSelectedColor_str, a.itemDisabledColor_str)), a.items_ar.push(a.rotateButton_do), a.draggingMode_str == FWDController.ROTATE && a.rotateButton_do.disable(), a.rotateButton_do.addListener(FWDContextMenuButton.MOUSE_DOWN, a.panButtonStartHandler), a.addChild(a.rotateButton_do); else if ("rotateright" == e) (o = a.itemsLabels_ar[i] || "Contextmenu item is not defined!"), FWDContextMenuButton.setPrototype(), (a.nextButton_do = new FWDContextMenuButton(o, void 0, a.itemNormalColor_str, a.itemSelectedColor_str, a.itemDisabledColor_str)), a.items_ar.push(a.nextButton_do), a.nextButton_do.addListener(FWDContextMenuButton.MOUSE_DOWN, a.nextButtonStartHandler), a.addChild(a.nextButton_do); else if ("roteteleft" == e) (o = a.itemsLabels_ar[i] || "Contextmenu item is not defined!"), FWDContextMenuButton.setPrototype(), (a.prevButton_do = new FWDContextMenuButton(o, void 0, a.itemNormalColor_str, a.itemSelectedColor_str, a.itemDisabledColor_str)), a.items_ar.push(a.prevButton_do), a.prevButton_do.addListener(FWDContextMenuButton.MOUSE_DOWN, a.prevButtonStartHandler), a.addChild(a.prevButton_do); else if ("scrollbar" == e) { (s = a.itemsLabels_ar[i]) ? -1 == s.indexOf("/") ? (n = o = "Contextmenu item is not defined!") : ((o = s.substr(0, s.indexOf("/"))), (n = s.substr(s.indexOf("/") + 1))) : (n = o = "Contextmenu item is not defined!"), FWDContextMenuButton.setPrototype(), (a.zoomInButton_do = new FWDContextMenuButton(o, void 0, a.itemNormalColor_str, a.itemSelectedColor_str, a.itemDisabledColor_str)), a.items_ar.push(a.zoomInButton_do), a.zoomInButton_do.addListener(FWDContextMenuButton.MOUSE_DOWN, a.zoomInButtonStartHandler), a.addChild(a.zoomInButton_do), FWDContextMenuButton.setPrototype(), (a.zoomOutButton_do = new FWDContextMenuButton(n, void 0, a.itemNormalColor_str, a.itemSelectedColor_str, a.itemDisabledColor_str)), a.items_ar.push(a.zoomOutButton_do), a.zoomOutButton_do.addListener(FWDContextMenuButton.MOUSE_DOWN, a.zoomOutButtonStartHandler), a.addChild(a.zoomOutButton_do); } else if ("play" == e) { var s; (s = a.itemsLabels_ar[i]) ? -1 == s.indexOf("/") ? (n = o = "Contextmenu item is not defined!") : ((o = s.substr(0, s.indexOf("/"))), (n = s.substr(s.indexOf("/") + 1))) : (n = o = "Contextmenu item is not defined!"), FWDContextMenuButton.setPrototype(), (a.slideShowButton_do = new FWDContextMenuButton(o, n, a.itemNormalColor_str, a.itemSelectedColor_str, a.itemDisabledColor_str)), a.items_ar.push(a.slideShowButton_do), a.slideShowButton_do.addListener(FWDContextMenuButton.MOUSE_DOWN, a.startSlideShowHandler), a.addChild(a.slideShowButton_do); } else "info" == e ? ((o = a.itemsLabels_ar[i] || "Contextmenu item is not defined!"), FWDContextMenuButton.setPrototype(), (a.infoButton_do = new FWDContextMenuButton(o, n, a.itemNormalColor_str, a.itemSelectedColor_str, a.itemDisabledColor_str)), a.items_ar.push(a.infoButton_do), a.infoButton_do.addListener(FWDContextMenuButton.MOUSE_DOWN, a.infoButtonStart), a.addChild(a.infoButton_do)) : "link" == e ? ((o = a.itemsLabels_ar[i] || "Contextmenu item is not defined!"), FWDContextMenuButton.setPrototype(), (a.linkButton_do = new FWDContextMenuButton(o, n, a.itemNormalColor_str, a.itemSelectedColor_str, a.itemDisabledColor_str)), a.items_ar.push(a.linkButton_do), a.linkButton_do.addListener(FWDContextMenuButton.CLICK, a.startLinkHandler), a.addChild(a.linkButton_do)) : "fullscreen" == e && (r.displayType != FWDViewer.FULL_SCREEN || FWDUtils.hasFullScreen) && ((s = a.itemsLabels_ar[i]) ? -1 == s.indexOf("/") ? (n = o = "Contextmenu item is not defined!") : ((o = s.substr(0, s.indexOf("/"))), (n = s.substr(s.indexOf("/") + 1))) : (n = o = "Contextmenu item is not defined!"), FWDContextMenuButton.setPrototype(), (a.fullScreenButton_do = new FWDContextMenuButton(o, n, a.itemNormalColor_str, a.itemSelectedColor_str, a.itemDisabledColor_str)), a.items_ar.push(a.fullScreenButton_do), a.fullScreenButton_do.addListener(FWDContextMenuButton.MOUSE_DOWN, a.fullScreenStartHandler), a.addChild(a.fullScreenButton_do)); }), (a.setupDeveloperButton = function () { a.showScriptDeveloper_bl && (a.itemsLabels_ar || (a.itemsLabels_ar = []), a.itemsLabels_ar.push("© made by FWD"), (label1_str = "© made by FWD"), FWDContextMenuButton.setPrototype(), (a.developerButton_do = new FWDContextMenuButton(label1_str, void 0, a.itemSelectedColor_str, a.itemNormalColor_str, a.itemDisabledColor_str)), (a.developerButton_do.isDeveleper_bl = !0), a.items_ar.push(a.developerButton_do), a.addChild(a.developerButton_do)); }), (a.panButtonStartHandler = function (e) { a.dispatchEvent(FWDController.ROTATE), a.removeFromDOM(); }), (a.enablePanButton = function () { a.panButton_do && a.panButton_do.enable(), a.rotateButton_do && a.rotateButton_do.disable(), (a.draggingMode_str = FWDController.ROTATE); }), (a.panRotateStartHandler = function (e) { a.dispatchEvent(FWDController.PAN), a.removeFromDOM(); }), (a.enableRotateButton = function () { a.rotateButton_do && a.rotateButton_do.enable(), a.panButton_do && a.panButton_do.disable(), (a.draggingMode_str = FWDController.PAN); }), (a.nextButtonStartHandler = function (e) { a.dispatchEvent(FWDController.GOTO_NEXT_IMAGE, { e: e }); }), (a.prevButtonStartHandler = function (e) { a.dispatchEvent(FWDController.GOTO_PREV_IMAGE, { e: e }); }), (a.zoomInButtonStartHandler = function (e) { a.dispatchEvent(FWDController.ZOOM_IN, { e: e }); }), (a.zoomOutButtonStartHandler = function (e) { a.dispatchEvent(FWDController.ZOOM_OUT, { e: e }); }), (a.startSlideShowHandler = function (e) { 0 == a.slideShowButton_do.currentState ? a.dispatchEvent(FWDController.START_SLIDE_SHOW, { e: e }) : a.dispatchEvent(FWDController.STOP_SLIDE_SHOW, { e: e }); }), (a.updateSlideShowButton = function (e) { a.slideShowButton_do && (0 == e ? a.slideShowButton_do.setButtonState(0) : a.slideShowButton_do.setButtonState(1)); }), (a.infoButtonStart = function (e) { a.removeFromDOM(), a.dispatchEvent(FWDController.SHOW_INFO); }), (a.fullScreenStartHandler = function (e) { 0 == a.fullScreenButton_do.currentState ? a.dispatchEvent(FWDController.GO_FULL_SCREEN) : 1 == a.fullScreenButton_do.currentState && a.dispatchEvent(FWDController.GO_NORMAL_SCREEN), a.fullScreenButton_do.onMouseOut(); }), (a.updateFullScreenButton = function (e) { a.fullScreenButton_do && (0 == e ? a.fullScreenButton_do.setButtonState(0) : a.fullScreenButton_do.setButtonState(1), a.removeFromDOM()); }), (a.startLinkHandler = function (e) { window.open(a.link_str, "_blank"); }), (a.setupSpacers = function () { for (var e, t = a.items_ar.length - 1, o = 0; o < t; o++) (e = new FWDSimpleDisplayObject("div")), (a.spacers_ar[o] = e).setHeight(1), e.setBkColor(a.spacerColor_str), a.addChild(e); }), (a.getMaxWidthResizeAndPosition = function () { var e, t, o = a.items_ar.length; a.totalWidth = 0; for (var n = (a.totalHeight = 0); n < o; n++) (e = a.items_ar[n]).getMaxTextWidth() > a.totalWidth && (a.totalWidth = e.getMaxTextWidth()); for (n = 0; n < o; n++) (t = a.spacers_ar[n - 1]), (e = a.items_ar[n]).setX(a.padding), e.setY(10 + n * (e.totalHeight + a.sapaceBetweenButtons) - a.padding), t && (t.setWidth(a.totalWidth + 2), t.setX(a.padding), t.setY(parseInt(e.getY() - a.sapaceBetweenButtons / 2) - 1)), e.setWidth(a.totalWidth + 2), e.centerText(); (a.totalHeight = e.getY() + e.totalHeight + 2), a.setWidth(a.totalWidth + 2 * a.padding + 4), a.setHeight(a.totalHeight), a.setVisible(!0), a.removeFromDOM(); }), (a.addContextEvent = function () { a.parent.main_do.screen.addEventListener ? a.parent.main_do.screen.addEventListener("contextmenu", a.contextMenuHandler) : a.parent.main_do.screen.attachEvent("oncontextmenu", a.contextMenuHandler); }), (a.contextMenuHandler = function (e) { return ( a.show_bl && a.isActive_bl && (a.parent.main_do.addChild(a), a.positionButtons(e), a.setAlpha(0), FWDAnimation.to(a, 0.4, { alpha: 1, ease: Quart.easeOut }), window.addEventListener ? (window.addEventListener("mousedown", a.contextMenuWindowOnMouseDownHandler), window.addEventListener("mouseup", a.contextMenuWindowOnMouseDownHandler)) : (document.documentElement.attachEvent("onmousedown", a.contextMenuWindowOnMouseDownHandler), document.documentElement.attachEvent("onmouseup", a.contextMenuWindowOnMouseDownHandler))), !!e.preventDefault && void e.preventDefault() ); }), (a.contextMenuWindowOnMouseDownHandler = function (e) { var t = FWDUtils.getViewportMouseCoordinates(e), o = t.screenX, n = t.screenY; FWDUtils.hitTest(a.screen, o, n) || (window.removeEventListener ? (window.removeEventListener("mousedown", a.contextMenuWindowOnMouseDownHandler), window.removeEventListener("mouseup", a.contextMenuWindowOnMouseDownHandler)) : (document.documentElement.detachEvent("onmousedown", a.contextMenuWindowOnMouseDownHandler), document.documentElement.detachEvent("onmouseup", a.contextMenuWindowOnMouseDownHandler)), a.removeFromDOM()); }), (a.positionButtons = function (e) { var t = FWDUtils.getViewportMouseCoordinates(e), o = a.parent.main_do.getWidth(), n = a.parent.main_do.getHeight(), i = t.screenX - a.parent.main_do.getGlobalX(), s = t.screenY - a.parent.main_do.getGlobalY(), r = i - 2, l = s - 2; (a.totalWidth = a.getWidth()), (a.totalHeight = a.getHeight()), r + a.totalWidth > o - 2 && (r = i - a.totalWidth), r < 0 && (r = parseInt((o - a.totalWidth) / 2)), r < 0 && (r = 0), l + a.totalHeight > n - 2 && (l = s - a.totalHeight), l < 0 && (l = parseInt((n - a.totalHeight) / 2)), l < 0 && (l = 0), a.setX(r), a.setY(l); }), (a.disable = function () { a.panButton_do && a.panButton_do.disable(), a.rotateButton_do && a.rotateButton_do.disable(), a.nextButton_do && a.nextButton_do.disable(), a.prevButton_do && a.prevButton_do.disable(), a.slideShowButton_do && a.slideShowButton_do.disable(), a.infoButton_do && a.infoButton_do.disable(), a.zoomInButton_do && a.zoomInButton_do.disable(), a.zoomOutButton_do && a.zoomOutButton_do.disable(), a.slideShowButton_do && a.slideShowButton_do.disable(); }), (a.enable = function () { a.panButton_do && a.draggingMode_str == FWDController.ROTATE && a.panButton_do.enable(), a.rotateButton_do && a.draggingMode_str == FWDController.PAN && a.rotateButton_do.enable(), a.nextButton_do && a.nextButton_do.enable(), a.prevButton_do && a.prevButton_do.enable(), a.slideShowButton_do && a.slideShowButton_do.enable(), a.infoButton_do && a.infoButton_do.enable(), a.zoomInButton_do && a.zoomInButton_do.enable(), a.zoomOutButton_do && a.zoomOutButton_do.enable(), a.slideShowButton_do && a.slideShowButton_do.enable(); }), (a.removeFromDOM = function () { a.setX(-5e3); }), (a.destroy = function () { var e; clearTimeout(a.getMaxWidthResizeAndPositionId_to), FWDAnimation.killTweensOf(a), window.removeEventListener ? (window.removeEventListener("mousedown", a.contextMenuWindowOnMouseDownHandler), window.removeEventListener("mouseup", a.contextMenuWindowOnMouseDownHandler), a.parent.main_do.screen.removeEventListener("contextmenu", a.contextMenuHandler)) : (document.documentElement.detachEvent("onmousedown", a.contextMenuWindowOnMouseDownHandler), document.documentElement.detachEvent("onmouseup", a.contextMenuWindowOnMouseDownHandler), a.parent.main_do.screen.detachEvent("oncontextmenu", a.contextMenuHandler)), (e = a.items_ar.length); for (var t = 0; t < e; t++) a.items_ar[t].destroy(); e = a.spacers_ar.length; for (t = 0; t < e; t++) a.spacers_ar[t].destroy(); (a.buttonsTest_ar = null), (a.itemsLabels_ar = null), (a.items_ar = null), (a.spacers_ar = null), (a.panButton_do = null), (a.rotateButton_do = null), (a.nextButton_do = null), (a.prevButton_do = null), (a.slideShowButton_do = null), (a.infoButton_do = null), (a.linkButton_do = null), (a.fullScreenButton_do = null), (a.zoomInButton_do = null), (a.zoomOutButton_do = null), (a.slideShowButton_do = null), (a.linkButton_do = null), (a.infoButton_do = null), (a.fullScreenButton_do = null), (a.backgroundColor_str = null), (a.borderColor_str = null), (a.spacerColor_str = null), (a.itemNormalColor_str = null), (a.itemSelectedColor_str = null), (a.itemDisabledColor_str = null), (a.draggingMode_str = null), (a.link_str = null), (a.init = null), (a.setupLabels = null), (a.setupDeveloperButton = null), (a.panButtonStartHandler = null), (a.enablePanButton = null), (a.panRotateStartHandler = null), (a.nextButtonStartHandler = null), (a.prevButtonStartHandler = null), (a.zoomInButtonStartHandler = null), (a.zoomOutButtonStartHandler = null), (a.startSlideShowHandler = null), (a.updateSlideShowButton = null), (a.fullScreenStartHandler = null), (a.updateFullScreenButton = null), (a.setupSpacers = null), (a.getMaxWidthResizeAndPosition = null), (a.addContextEvent = null), (a.contextMenuHandler = null), (a.contextMenuWindowOnMouseDownHandler = null), (a.positionButtons = null), (a.removeFromDOM = null), (a.destroy = null), (o = r = null), a.setInnerHTML(""), n.destroy(), (a = n = null), (i.prototype = null); }), a.init(); }; (i.setPrototype = function () { i.prototype = new FWDDisplayObject("div"); }), (i.prototype = null), (window.FWDContextMenu = i); })(window), (function () { var a = function (e, t, o, n, i, s) { var r = this, l = a.prototype; (r.label1_str = e), (r.label2_str = t), (r.normalColor_str = o), (r.selectedColor_str = n), (r.disabledColor_str = i), (r.totalWidth = 400), (r.totalHeight = 20), r.padding, (r.text1_sdo = null), (r.text2_sdo = null), (r.dumy_sdo = null), (r.isMobile_bl = FWDUtils.isMobile), (r.currentState = 1), (r.isDisabled_bl = !1), (r.isMaximized_bl = !1), (r.showSecondButton_bl = null != t), (r.isDeveleper_bl = !1), (r.init = function () { r.setBackfaceVisibility(), r.setButtonMode(!0), r.setupMainContainers(), r.setWidth(r.totalWidth), r.setHeight(r.totalHeight), r.setButtonState(0); }), (r.setupMainContainers = function () { (r.text1_sdo = new FWDSimpleDisplayObject("div")), r.text1_sdo.setBackfaceVisibility(), r.text1_sdo.setDisplay("inline-block"), (r.text1_sdo.getStyle().fontFamily = "Arial"), (r.text1_sdo.getStyle().fontSize = "12px"), (r.text1_sdo.getStyle().color = r.normalColor_str), (r.text1_sdo.getStyle().fontSmoothing = "antialiased"), (r.text1_sdo.getStyle().webkitFontSmoothing = "antialiased"), (r.text1_sdo.getStyle().textRendering = "optimizeLegibility"), r.text1_sdo.setInnerHTML(r.label1_str), r.addChild(r.text1_sdo), r.showSecondButton_bl && ((r.text2_sdo = new FWDSimpleDisplayObject("div")), r.text2_sdo.setBackfaceVisibility(), r.text2_sdo.setDisplay("inline-block"), (r.text2_sdo.getStyle().fontFamily = "Arial"), (r.text2_sdo.getStyle().fontSize = "12px"), (r.text2_sdo.getStyle().color = r.normalColor_str), (r.text2_sdo.getStyle().fontSmoothing = "antialiased"), (r.text2_sdo.getStyle().webkitFontSmoothing = "antialiased"), (r.text2_sdo.getStyle().textRendering = "optimizeLegibility"), r.text2_sdo.setInnerHTML(r.label2_str), r.addChild(r.text2_sdo)), (r.dumy_sdo = new FWDSimpleDisplayObject("div")), FWDUtils.isIE && (r.dumy_sdo.setBkColor("#FF0000"), r.dumy_sdo.setAlpha(0)), r.addChild(r.dumy_sdo), r.isMobile_bl ? r.screen.addEventListener("touchstart", r.onMouseDown) : r.screen.addEventListener ? (r.screen.addEventListener("mouseover", r.onMouseOver), r.screen.addEventListener("mouseout", r.onMouseOut), r.screen.addEventListener("mousedown", r.onMouseDown), r.screen.addEventListener("click", r.onClick)) : r.screen.attachEvent && (r.screen.attachEvent("onmouseover", r.onMouseOver), r.screen.attachEvent("onmouseout", r.onMouseOut), r.screen.attachEvent("onmousedown", r.onMouseDown), r.screen.attachEvent("onclick", r.onClick)); }), (r.onMouseOver = function (e) { r.isDisabled_bl || (FWDAnimation.killTweensOf(r.text1_sdo), e ? (FWDAnimation.to(r.text1_sdo.screen, 0.5, { css: { color: r.selectedColor_str }, ease: Expo.easeOut }), r.showSecondButton_bl && FWDAnimation.to(r.text2_sdo.screen, 0.5, { css: { color: r.selectedColor_str }, ease: Expo.easeOut })) : ((r.text1_sdo.getStyle().color = r.selectedColor_str), r.showSecondButton_bl && (FWDAnimation.killTweensOf(r.text2_sdo), (r.text2_sdo.getStyle().color = r.selectedColor_str))), r.dispatchEvent(a.MOUSE_OVER)); }), (r.onMouseOut = function (e) { r.isDisabled_bl || (FWDAnimation.killTweensOf(r.text1_sdo), FWDAnimation.to(r.text1_sdo.screen, 0.5, { css: { color: r.normalColor_str }, ease: Expo.easeOut }), r.showSecondButton_bl && (FWDAnimation.killTweensOf(r.text2_sdo), FWDAnimation.to(r.text2_sdo.screen, 0.5, { css: { color: r.normalColor_str }, ease: Expo.easeOut })), r.dispatchEvent(a.MOUSE_OUT)); }), (r.onClick = function (e) { r.isDeveleper_bl ? window.open("http://www.webdesign-flash.ro", "_blank") : r.isDisabled_bl || (e.preventDefault && e.preventDefault(), r.dispatchEvent(a.CLICK)); }), (r.onMouseDown = function (e) { r.isDisabled_bl || (e.preventDefault && e.preventDefault(), r.dispatchEvent(a.MOUSE_DOWN, { e: e })); }), (r.toggleButton = function () { r.showSecondButton_bl && (1 == r.currentState ? (r.text1_sdo.setVisible(!0), r.text2_sdo.setVisible(!1), (r.currentState = 0), r.dispatchEvent(a.FIRST_BUTTON_CLICK)) : (r.text1_sdo.setVisible(!1), r.text2_sdo.setVisible(!0), (r.currentState = 1), r.dispatchEvent(a.SECOND_BUTTON_CLICK))); }), (r.setButtonState = function (e) { 0 == e ? (r.text1_sdo.setVisible(!0), r.showSecondButton_bl && r.text2_sdo.setVisible(!1), (r.currentState = 0)) : 1 == e && (r.text1_sdo.setVisible(!1), r.showSecondButton_bl && r.text2_sdo.setVisible(!0), (r.currentState = 1)); }), (r.centerText = function () { r.dumy_sdo.setWidth(r.totalWidth), r.dumy_sdo.setHeight(r.totalHeight), FWDUtils.isIEAndLessThen9 ? (r.text1_sdo.setY(Math.round((r.totalHeight - r.text1_sdo.getHeight()) / 2) - 1), r.showSecondButton_bl && r.text2_sdo.setY(Math.round((r.totalHeight - r.text2_sdo.getHeight()) / 2) - 1)) : (r.text1_sdo.setY(Math.round((r.totalHeight - r.text1_sdo.getHeight()) / 2)), r.showSecondButton_bl && r.text2_sdo.setY(Math.round((r.totalHeight - r.text2_sdo.getHeight()) / 2))), r.text1_sdo.setHeight(r.totalHeight + 2), r.showSecondButton_bl && r.text2_sdo.setHeight(r.totalHeight + 2); }), (r.getMaxTextWidth = function () { var e = r.text1_sdo.getWidth(), t = 0; return r.showSecondButton_bl && (t = r.text2_sdo.getWidth()), Math.max(e, t); }), (r.disable = function () { (r.isDisabled_bl = !0), FWDAnimation.killTweensOf(r.text1_sdo), FWDAnimation.to(r.text1_sdo.screen, 0.5, { css: { color: r.disabledColor_str }, ease: Expo.easeOut }), r.setButtonMode(!1); }), (r.enable = function () { (r.isDisabled_bl = !1), FWDAnimation.killTweensOf(r.text1_sdo), FWDAnimation.to(r.text1_sdo.screen, 0.5, { css: { color: r.normalColor_str }, ease: Expo.easeOut }), r.setButtonMode(!0); }), (r.destroy = function () { r.isMobile_bl ? r.screen.removeEventListener("touchstart", r.onMouseDown) : r.screen.removeEventListener ? (r.screen.removeEventListener("mouseover", r.onMouseOver), r.screen.removeEventListener("mouseout", r.onMouseOut), r.screen.removeEventListener("mousedown", r.onMouseDown), r.screen.removeEventListener("click", r.onClick)) : r.screen.detachEvent && (r.screen.detachEvent("onmouseover", r.onMouseOver), r.screen.detachEvent("onmouseout", r.onMouseOut), r.screen.detachEvent("onmousedown", r.onMouseDown), r.screen.detachEvent("onclick", r.onClick)), FWDAnimation.killTweensOf(r.text1_sdo), r.text1_sdo.destroy(), r.text2_sdo && (FWDAnimation.killTweensOf(r.text2_sdo), r.text2_sdo.destroy()), r.dumy_sdo.destroy(), (r.text1_sdo = null), (r.text2_sdo = null), (r.dumy_sdo = null), (r.label1_str = null), (r.label2_str = null), (r.normalColor_str = null), (r.selectedColor_str = null), (r.disabledColor_str = null), (i = n = o = t = e = null), r.setInnerHTML(""), l.destroy(), (l = r = null), (a.prototype = null); }), r.init(); }; (a.setPrototype = function () { a.prototype = new FWDDisplayObject("div"); }), (a.FIRST_BUTTON_CLICK = "onFirstClick"), (a.SECOND_BUTTON_CLICK = "secondButtonOnClick"), (a.MOUSE_OVER = "onMouseOver"), (a.MOUSE_OUT = "onMouseOut"), (a.MOUSE_DOWN = "onMouseDown"), (a.CLICK = "onClick"), (a.prototype = null), (window.FWDContextMenuButton = a); })(window), (function () { var FWDController = function (data, parent) { var self = this, prototype = FWDController.prototype; (this.buttonsTest_ar = data.buttons_ar), (this.buttonsLabels_ar = data.buttonsLabels_ar), (this.buttons_ar = []), (this.backgroundLeft_img = data.controllerBackgroundLeft_img), (this.backgroundRight_img = data.controllerBackgroundRight_img), (this.panN_img = data.controllerPanN_img), (this.panS_img = data.controllerPanS_img), (this.rotateN_img = data.controllerRotateN_img), (this.rotateS_img = data.controllerRotateS_img), (this.nextN_img = data.controllerNextN_img), (this.nextS_img = data.controllerNextS_img), (this.prevN_img = data.controllerPrevN_img), (this.prevS_img = data.controllerPrevS_img), (this.playN_img = data.controllerPlayN_img), (this.playS_img = data.controllerPlayS_img), (this.pauseN_img = data.controllerPauseN_img), (this.pauseS_img = data.controllerPauseS_img), (this.infoN_img = data.controllerInfoN_img), (this.infoS_img = data.controllerInfoS_img), (this.linkN_img = data.controllerLinkN_img), (this.linkS_img = data.controllerLinkS_img), (this.fullScreenNormalN_img = data.controllerFullScreenNormalN_img), (this.fullScreenNormalS_img = data.controllerFullScreenNormalS_img), (this.fullScreenFullN_img = data.controllerFullScreenFullN_img), (this.fullScreenFullS_img = data.controllerFullScreenFullS_img), (this.zoomInN_img = data.zoomInN_img), (this.zoomInS_img = data.zoomInS_img), (this.zoomOutN_img = data.zoomOutN_img), (this.zoomOutS_img = data.zoomOutS_img), (this.scrollBarHandlerN_img = data.scrollBarHandlerN_img), (this.scrollBarHandlerS_img = data.scrollBarHandlerS_img), (this.scrollBarLeft_img = data.scrollBarLeft_img), (this.scrollBarRight_img = data.scrollBarRight_img), (this.toolTipLeft_img = data.toolTipLeft_img), (this.toolTipPointer_img = data.toolTipPointer_img), (this.hider = null), (this.mainHolder_do = null), (this.backgroundLeft_sdo = null), (this.backgroundMiddle_sdo = null), (this.backgroundRight_sdo = null), (this.panButton_do = null), (this.rotateButton_do = null), (this.nextButton_do = null), (this.prevButton_do = null), (this.slideShowButton_do = null), (this.infoButton_do = null), (this.linkButton_do = null), (this.fullScreenButton_do = null), (this.zoomIn_do = null), (this.zoomOut_do = null), (this.scrollBar_do = null), (this.scrollBarLeft_sdo = null), (this.scrollBarRight_sdo = null), (this.scrollBarMiddle_sdo = null), (this.scrollBarHandler_do = null), (this.scrollBarHandlerN_sdo = null), (this.scrollBarHandlerS_sdo = null), (this.panButtonTooTipLabel_do = null), (this.scrollBarHandlerToolTip_do = null), (this.rotateButtonToolTip_do = null), (this.nextButtonToolTip_do = null), (this.prevButtonToolTip_do = null), (this.slideShowToolTip_do = null), (this.infoToolTip_do = null), (this.linkToolTip_do = null), (this.fullscreenToolTip_do = null), (this.backgroundMiddlePath_str = data.controllerBackgroundMiddlePath_str), (this.scrollBarMiddlePath_str = data.scrollBarMiddlePath_str), (this.draggingMode_str = data.startDraggingMode_str), (this.controllerVerticalPosition_str = data.controllerVerticalPosition_str), (this.buttonToolTipLeft_str = data.buttonToolTipLeft_str), (this.buttonToolTipMiddle_str = data.buttonToolTipMiddle_str), (this.buttonToolTipRight_str = data.buttonToolTipRight_str), (this.link_str = data.link_str), (this.buttonToolTipFontColor_str = data.buttonToolTipFontColor_str), (this.buttonToolTipBottomPointer_str = data.buttonToolTipBottomPointer_str), (this.buttonToolTipTopPointer_str = data.buttonToolTipTopPointer_str), (this.scrollBarPosition = FWDUtils.indexOfArray(self.buttonsTest_ar, "scrollbar")), (this.controllerBackgroundOpacity = data.controllerBackgroundOpacity), (this.rotationSpeed = data.buttonsRotationSpeed), (this.slideShowDelay = data.slideShowDelay), this.stageWidth, this.setHeight, (this.controllerOffsetY = data.controllerOffsetY), (this.controllerOffsetX = data.controllerOffsetX), (this.scrollBarOffsetX = data.scrollBarOffsetX), (this.startSpaceBetweenButtons = data.startSpaceBetweenButtons), (this.spaceBetweenButtons = data.spaceBetweenButtons), (this.curHeight = self.backgroundLeft_img.height), this.finalHandlerX, (this.startSpaceForScrollBarButtons = data.startSpaceForScrollBarButtons), (this.smallSpaceForScrollBar = data.startSpaceForScrollBar), this.totalLargeButtons, this.curWidth, (this.maxWidth = data.controllerMaxWidth), this.minWidth, (this.controllerHorizontalPosition_str = data.controllerHorizontalPosition_str), this.scrollBarTotalWidth, this.scrollBarHandlerXPositionOnPress, this.lastPresedX, (this.scrollBarHandlerToolTipOffsetY = data.scrollBarHandlerToolTipOffsetY), (this.zoomInAndOutToolTipOffsetY = data.zoomInAndOutToolTipOffsetY), (this.buttonsToolTipOffsetY = data.buttonsToolTipOffsetY), (this.totalImages = data.totalImages), this.gotoImageId_int, this.zoomWithButtonsId_int, this.slideShowId_int, this.gotoImageId_to, this.zoomWithButtonsId_to; for (var i = 0; i < data.buttons_ar.length; i++) "rotate" == data.buttons_ar[i] && ((this.buttonWidth = data.controllerRotateN_img.width), (this.buttonHeight = data.controllerRotateN_img.height)), "pan" == data.buttons_ar[i] && ((this.buttonWidth = data.controllerPanN_img.width), (this.buttonHeight = data.controllerPanN_img.height)), "roteteleft" == data.buttons_ar[i] && ((this.buttonWidth = data.controllerPrevN_img.width), (this.buttonHeight = data.controllerPrevN_img.height)), "rotateright" == data.buttons_ar[i] && ((this.buttonWidth = data.controllerNextN_img.width), (this.buttonHeight = data.controllerNextN_img.height)), "play" == data.buttons_ar[i] && ((this.buttonWidth = data.controllerPlayN_img.width), (this.buttonHeight = data.controllerPlayN_img.height)), "scrollbar" == data.buttons_ar[i] && ((this.scrollBarRightPartWidth = self.scrollBarRight_img.width), (this.scrollBarHeight = self.scrollBarLeft_img.height), (this.scrollBarHandlerWidth = self.scrollBarHandlerN_img.width), (this.scrollBarHandlerHeight = self.scrollBarHandlerN_img.height), (this.zoomButtonWidth = self.zoomOutN_img.width), (this.zoomButtonHeight = self.zoomOutN_img.height)), "info" == data.buttons_ar[i] && ((this.buttonWidth = data.controllerInfoN_img.width), (this.buttonHeight = data.controllerInfoN_img.height)), "link" == data.buttons_ar[i] && ((this.buttonWidth = data.controllerLinkN_img.width), (this.buttonHeight = data.controllerLinkN_img.height)), "fullscreen" == data.buttons_ar[i] && ((this.buttonWidth = data.controllerFullScreenNormalN_img.width), (this.buttonHeight = data.controllerFullScreenNormalN_img.height)); (this.showScrollBar_bl = !1), -1 != FWDUtils.indexOfArray(self.buttonsTest_ar, "scrollbar") && (self.showScrollBar_bl = !0), (this.isMobile_bl = data.isMobile_bl), (this.inverseNextAndPrevRotation_bl = data.inverseNextAndPrevRotation_bl), (this.isScrollBarActive_bl = !1), (this.isZoomInOrOutPressed_bl = !1), (this.isKeyPressed_bl = !1), (this.stopRotationAtEnds_bl = data.stopRotationAtEnds_bl), (this.addKeyboardSupport_bl = data.addKeyboardSupport_bl), (this.showButtonsLabels_bl = Boolean(self.buttonsLabels_ar)), (this.hasPointerEvent_bl = FWDUtils.hasPointerEvent), (self.init = function () { self.setOverflow("visible"), self.setSelectable(!1), self.setupMainHolder(), self.setupBackground(), self.addKeyboardSupport_bl && self.addKeyboardSupport(), self.setupButtons(), (self.totalLargeButtons = self.buttons_ar.lenght), self.showScrollBar_bl && self.setupScrollBar(), 0 != self.buttonsTest_ar.length || self.showScrollBar_bl || self.setVisible(!1), self.hide(), self.show(), (self.screen.onmousedown = function () { self.dispatchEvent(FWDController.MOUSE_DOWN); }); }), (self.resizeAndPosition = function () { (parent.stageWidth == self.stageWidth && parent.stageHeight == self.stageHeight) || ((self.stageWidth = parent.stageWidth), (self.stageHeight = parent.stageHeight), self.setWidth(self.stageWidth), self.setHeight(self.stageHeight), self.positionButtons()); }), (self.setupMainHolder = function () { (self.mainHolder_do = new FWDDisplayObject("div")), self.mainHolder_do.setOverflow("visible"), self.addChild(self.mainHolder_do); }), (self.setupHider = function (e) { (self.hider = e), self.hider.addListener(FWDHider.SHOW, self.onHiderShow), self.hider.addListener(FWDHider.HIDE, self.onHiderHide); }), (self.onHiderShow = function () { self.show(); }), (self.onHiderHide = function () { FWDUtils.hitTest(self.mainHolder_do.screen, self.hider.globalX, self.hider.globalY) ? self.hider.reset() : self.hide(!0); }), (this.addKeyboardSupport = function () { document.addEventListener ? (window.addEventListener("keydown", self.onKeyDownHandler), window.addEventListener("keyup", self.onKeyUpHandler)) : document.attachEvent && (document.attachEvent("onkeydown", self.onKeyDownHandler), document.attachEvent("onkeyup", self.onKeyUpHandler)); }), (this.onKeyDownHandler = function (e) { if (!parent.hibernate_bl && !self.isKeyPressed_bl) if (38 == e.keyCode) { if ( ((self.isKeyPressed_bl = !0), self.slideShowButton_do && self.stopSlideShow(), self.goToTopImage(), clearInterval(self.gotoImageId_int), clearTimeout(self.gotoImageId_to), (self.gotoImageId_to = setTimeout(self.goToTopImageWithDelay, 400)), self.dispatchEvent(FWDController.GOTO_NEXT_OR_PREV_IMAGE_COMPLETE), !e.preventDefault) ) return !1; e.preventDefault(); } else if (40 == e.keyCode) { if ( ((self.isKeyPressed_bl = !0), self.slideShowButton_do && self.stopSlideShow(), self.goToBottomImage(), clearInterval(self.gotoImageId_int), clearTimeout(self.gotoImageId_to), (self.gotoImageId_to = setTimeout(self.goToBottomImageWithDelay, 400)), self.dispatchEvent(FWDController.GOTO_NEXT_OR_PREV_IMAGE_COMPLETE), !e.preventDefault) ) return !1; e.preventDefault(); } else if (39 == e.keyCode) { if ( ((self.isKeyPressed_bl = !0), self.slideShowButton_do && self.stopSlideShow(), self.gotoNextImage(), clearInterval(self.gotoImageId_int), clearTimeout(self.gotoImageId_to), (self.gotoImageId_to = setTimeout(self.goToNextImageInWithDelay, 400)), self.dispatchEvent(FWDController.GOTO_NEXT_OR_PREV_IMAGE_COMPLETE), !e.preventDefault) ) return !1; e.preventDefault(); } else if (37 == e.keyCode) { if ( ((self.isKeyPressed_bl = !0), self.slideShowButton_do && self.stopSlideShow(), self.gotoPrevImage(), clearInterval(self.gotoImageId_int), clearTimeout(self.gotoImageId_to), (self.gotoImageId_to = setTimeout(self.goToPrevImageInWithDelay, 400)), self.dispatchEvent(FWDController.GOTO_NEXT_OR_PREV_IMAGE_COMPLETE), !e.preventDefault) ) return !1; e.preventDefault(); } }), (this.onKeyUpHandler = function (e) { (self.isKeyPressed_bl = !1), clearInterval(self.gotoImageId_int), clearTimeout(self.gotoImageId_to), window.addEventListener ? window.addEventListener("keydown", self.onKeyDownHandler) : document.attachEvent && document.attachEvent("onkeydown", self.onKeyDownHandler), self.dispatchEvent(FWDController.GOTO_NEXT_OR_PREV_IMAGE_COMPLETE); }), (self.setupButtons = function () { for (var e, t = self.buttonsTest_ar.length, o = "", n = "", i = 0; i < t; i++) if ("pan" == (e = self.buttonsTest_ar[i])) self.showButtonsLabels_bl && (o = self.buttonsLabels_ar[i] || "tooltip is not defined!"), self.setupPanButton(o), self.buttons_ar.push(self.panButton_do); else if ("rotate" == e) self.showButtonsLabels_bl && (o = self.buttonsLabels_ar[i] || "tooltip is not defined!"), self.setupRotateButton(o), self.buttons_ar.push(self.rotateButton_do); else if ("rotateright" == e) self.showButtonsLabels_bl && (o = self.buttonsLabels_ar[i] || "tooltip is not defined!"), self.setupNextButton(o), self.buttons_ar.push(self.nextButton_do); else if ("roteteleft" == e) self.showButtonsLabels_bl && (o = self.buttonsLabels_ar[i] || "tooltip is not defined!"), self.setupPrevButton(o), self.buttons_ar.push(self.prevButton_do); else if ("play" == e) { if (self.showButtonsLabels_bl) (s = self.buttonsLabels_ar[i]) ? (-1 == s.indexOf("/") ? (n = o = "tooltip is not defined!") : ((o = s.substr(0, s.indexOf("/"))), (n = s.substr(s.indexOf("/") + 1)))) : (n = o = "tooltip is not defined!"); self.setupSlideshowButton(o, n), self.buttons_ar.push(self.slideShowButton_do); } else if ("info" == e) self.showButtonsLabels_bl && (o = self.buttonsLabels_ar[i] || "tooltip is not defined!"), self.setupInfoButton(o), self.buttons_ar.push(self.infoButton_do); else if ("link" == e) self.showButtonsLabels_bl && (o = self.buttonsLabels_ar[i] || "tooltip is not defined!"), self.setupLinkButton(o), self.buttons_ar.push(self.linkButton_do); else if ("fullscreen" == e && (parent.displayType != FWDViewer.FULL_SCREEN || FWDUtils.hasFullScreen)) { var s; if (self.showButtonsLabels_bl) (s = self.buttonsLabels_ar[i]) ? (-1 == s.indexOf("/") ? (n = o = "tooltip is not defined!") : ((o = s.substr(0, s.indexOf("/"))), (n = s.substr(s.indexOf("/") + 1)))) : (n = o = "tooltip is not defined!"); self.setupFullScreenButton(o, n), self.buttons_ar.push(self.fullScreenButton_do); } }), (self.positionButtons = function () { var e, t, o, n, i, s, r = self.buttons_ar.length, l = self.spaceBetweenButtons; if ( (self.showScrollBar_bl && ((self.isScrollBarActive_bl = !0), (self.curWidth = self.stageWidth), -1 != (s = FWDUtils.indexOfArray(self.buttons_ar, self.zoomIn_do)) && (self.buttons_ar.splice(s, 1), r--), -1 != (s = FWDUtils.indexOfArray(self.buttons_ar, self.zoomOut_do)) && (self.buttons_ar.splice(s, 1), r--), self.scrollBarPosition > r && (self.scrollBarPosition = r), self.scrollBarPosition < 0 && (self.scrollBarPosition = 0), self.curWidth > self.maxWidth && (self.curWidth = self.maxWidth), 0 == r ? (self.scrollBarTotalWidth = 2 * self.startSpaceBetweenButtons + 2 * self.startSpaceForScrollBarButtons + 2 * self.smallSpaceForScrollBar + 2 * self.zoomButtonWidth) : 1 < r && 0 != self.scrollBarPosition && self.scrollBarPosition != r ? (self.scrollBarTotalWidth = 2 * self.startSpaceBetweenButtons + r * self.buttonWidth + self.spaceBetweenButtons * (r - 2) + 2 * self.startSpaceForScrollBarButtons + 2 * self.smallSpaceForScrollBar + 2 * self.zoomButtonWidth) : 1 < r && (0 == self.scrollBarPosition || self.scrollBarPosition == r) ? (self.scrollBarTotalWidth = 3 * self.startSpaceBetweenButtons + r * self.buttonWidth + self.spaceBetweenButtons * (r - 1) + 2 * self.startSpaceForScrollBarButtons + 2 * self.smallSpaceForScrollBar + 2 * self.zoomButtonWidth) : (self.scrollBarTotalWidth = 2 * self.startSpaceBetweenButtons + r * self.buttonWidth + 2 * self.startSpaceForScrollBarButtons + 2 * self.smallSpaceForScrollBar + 2 * self.zoomButtonWidth), (self.scrollBarTotalWidth = self.curWidth - self.scrollBarTotalWidth), self.scrollBarTotalWidth < 100 && (self.isScrollBarActive_bl = !1)), self.isScrollBarActive_bl) ) { self.scrollBar_do.setVisible(!0); for (var a = 0; a < self.scrollBarPosition; a++) (i = self.buttons_ar[a]) && ((i = self.buttons_ar[a]), (o = self.startSpaceBetweenButtons + a * (l + self.buttonWidth)), (o = self.startSpaceBetweenButtons + a * (l + self.buttonWidth)), (n = parseInt((self.curHeight - self.buttonHeight) / 2)), i.setX(o), i.setY(n)); for (a = r + 1; a >= self.scrollBarPosition; a--) (i = self.buttons_ar[a]) && ((i = self.buttons_ar[a]), (o = self.curWidth - self.startSpaceBetweenButtons - self.buttonWidth - Math.abs(a - r + 1) * (l + self.buttonWidth)), (n = parseInt((self.curHeight - self.buttonHeight) / 2)), i.setX(o), i.setY(n)); 0 == r ? (t = self.startSpaceForScrollBarButtons + self.startSpaceBetweenButtons) : 1 < r && 0 != self.scrollBarPosition && self.scrollBarPosition != r ? (t = self.buttons_ar[self.scrollBarPosition - 1].getX() + self.buttonWidth + self.startSpaceForScrollBarButtons) : 1 < r && 0 == self.scrollBarPosition ? (t = self.startSpaceBetweenButtons + self.startSpaceForScrollBarButtons) : 1 < r && self.scrollBarPosition == r ? (t = self.buttons_ar[self.scrollBarPosition - 1].getX() + self.buttonWidth + self.startSpaceForScrollBarButtons + self.startSpaceBetweenButtons) : 1 == r && 0 < self.scrollBarPosition ? (t = self.startSpaceBetweenButtons + self.buttonWidth + self.startSpaceForScrollBarButtons) : 1 == r && 0 == self.scrollBarPosition && (t = self.startSpaceForScrollBarButtons + self.startSpaceBetweenButtons), (t += self.scrollBarOffsetX), self.zoomOut_do.setX(t), self.zoomOut_do.setY(parseInt((self.curHeight - self.zoomButtonHeight) / 2)), self.zoomIn_do.setX(self.zoomOut_do.getX() + self.zoomButtonWidth + 2 * self.smallSpaceForScrollBar + self.scrollBarTotalWidth), self.zoomIn_do.setY(parseInt((self.curHeight - self.zoomButtonHeight) / 2)), self.scrollBar_do.setX(self.zoomOut_do.getX() + self.smallSpaceForScrollBar + self.zoomButtonWidth), self.scrollBar_do.setY(parseInt((self.curHeight - self.scrollBarHeight) / 2) + 1), self.scrollBar_do.setWidth(self.scrollBarTotalWidth), self.scrollBarMiddle_do.setX(self.scrollBarRightPartWidth - 1), self.scrollBarMiddle_do.setWidth(self.scrollBarTotalWidth - 2 * self.scrollBarRightPartWidth + 2), self.scrollBarRight_do.setX(self.scrollBarTotalWidth - self.scrollBarRightPartWidth); } else { self.showScrollBar_bl && (self.scrollBar_do.setVisible(!1), -1 == FWDUtils.indexOfArray(self.buttons_ar, self.zoomIn_do) && ((s = self.scrollBarPosition), self.buttons_ar.splice(s, 0, self.zoomIn_do), self.buttons_ar.splice(s, 0, self.zoomOut_do)), (r = self.buttons_ar.length)), (self.minWidth = r * self.buttonWidth + 2 * self.startSpaceBetweenButtons + self.spaceBetweenButtons * r - self.spaceBetweenButtons), self.minWidth > self.stageWidth && ((self.minWidth = self.stageWidth), self.minWidth < 320 && (self.minWidth = 320), (e = self.buttonWidth * r), (l = (self.minWidth - 2 * self.startSpaceBetweenButtons - e) / (r - 1))), (self.curWidth = self.minWidth); for (a = 0; a < r + 2; a++) (i = self.buttons_ar[a]) && ((o = self.startSpaceBetweenButtons + a * (l + self.buttonWidth)), (n = parseInt((self.curHeight - self.buttonHeight) / 2)), i == self.zoomIn_do ? ((o = o + parseInt((self.buttonWidth - self.zoomButtonWidth) / 2) - 2), (n = parseInt((self.curHeight - self.zoomButtonHeight) / 2))) : i == self.zoomOut_do && ((o = o + parseInt((self.buttonWidth - self.zoomButtonWidth) / 2) + 2), (n = parseInt((self.curHeight - self.zoomButtonHeight) / 2))), i.setX(o), i.setY(n)); } self.backgroundRight_sdo.setX(self.curWidth - self.backgroundRight_sdo.getWidth()), self.backgroundMiddle_sdo.setX(self.backgroundLeft_sdo.getWidth()), self.backgroundMiddle_sdo.setWidth(self.curWidth - 2 * self.backgroundLeft_sdo.getWidth()), self.backgroundMiddle_sdo.setHeight(self.curHeight), self.mainHolder_do.setWidth(self.curWidth), self.mainHolder_do.setHeight(self.curHeight), self.setWidth(self.curWidth), self.setHeight(self.curHeight), "center" == self.controllerHorizontalPosition_str ? self.mainHolder_do.setX(Math.round((self.stageWidth - self.curWidth) / 2)) : "left" == self.controllerHorizontalPosition_str ? self.mainHolder_do.setX(self.controllerOffsetX) : "right" == self.controllerHorizontalPosition_str && self.mainHolder_do.setX(Math.round(self.stageWidth - self.curWidth) - self.controllerOffsetX), self.controllerVerticalPosition_str == FWDController.POSITION_TOP ? self.setY(self.controllerOffsetY) : self.setY(self.stageHeight - self.curHeight - self.controllerOffsetY); }), (self.setupBackground = function () { (self.backgroundLeft_sdo = new FWDSimpleDisplayObject("img")), self.backgroundLeft_sdo.setScreen(self.backgroundLeft_img), 1 != self.controllerBackgroundOpacity && self.backgroundLeft_sdo.setAlpha(self.controllerBackgroundOpacity), (self.backgroundMiddle_sdo = new FWDSimpleDisplayObject("div")), (self.backgroundMiddle_sdo.getStyle().background = "url('" + self.backgroundMiddlePath_str + "')"), (self.backgroundMiddle_sdo.getStyle().backgroundRepeat = "repeat-x"), 1 != self.controllerBackgroundOpacity && self.backgroundMiddle_sdo.setAlpha(self.controllerBackgroundOpacity), (self.backgroundRight_sdo = new FWDSimpleDisplayObject("img")), self.backgroundRight_sdo.setScreen(self.backgroundRight_img), 1 != self.controllerBackgroundOpacity && self.backgroundRight_sdo.setAlpha(self.controllerBackgroundOpacity), self.mainHolder_do.addChild(self.backgroundLeft_sdo), self.mainHolder_do.addChild(self.backgroundRight_sdo), self.mainHolder_do.addChild(self.backgroundMiddle_sdo); }), (self.setupPanButton = function (e) { FWDSimpleButton.setPrototype(), (self.panButton_do = new FWDSimpleButton(self.panN_img, self.panS_img, self.isMobile_bl)), self.panButton_do.addListener(FWDSimpleButton.MOUSE_OVER, self.panButtonOnMouseOverHandler), self.panButton_do.addListener(FWDSimpleButton.MOUSE_OUT, self.panButtonOnMouseOutHandler), self.panButton_do.addListener(FWDSimpleButton.MOUSE_DOWN, self.panButtonOnMouseDownHandler), self.mainHolder_do.addChild(self.panButton_do), self.draggingMode_str == FWDController.PAN && self.disablePanButton(), self.showButtonsLabels_bl && (FWDButtonToolTip.setPrototype(), (self.panButtonTooTipLabel_do = new FWDButtonToolTip( self.toolTipLeft_img, self.toolTipPointer_img, e, "", self.buttonToolTipLeft_str, self.buttonToolTipMiddle_str, self.buttonToolTipRight_str, self.buttonToolTipFontColor_str, self.controllerVerticalPosition_str, self.buttonToolTipTopPointer_str, self.buttonToolTipBottomPointer_str )), self.mainHolder_do.addChild(self.panButtonTooTipLabel_do)); }), (self.panButtonOnMouseOverHandler = function (e) { self.panButton_do.isSelectedFinal_bl || self.showToolTipButton(self.panButton_do, self.panButtonTooTipLabel_do, self.buttonsToolTipOffsetY); }), (self.panButtonOnMouseOutHandler = function (e) { self.showButtonsLabels_bl && self.panButtonTooTipLabel_do.hide(); }), (self.panButtonOnMouseDownHandler = function (e) { self.pan(); }), (self.disablePanButton = function () { self.panButton_do.setSelctedFinal(), self.rotateButton_do && self.rotateButton_do.setUnselctedFinal(); }), (this.pan = function () { self.slideShowButton_do && self.stopSlideShow(), clearInterval(self.gotoImageId_int), self.panButton_do && (self.showButtonsLabels_bl && self.panButtonTooTipLabel_do.hide(), self.disablePanButton()), self.dispatchEvent(FWDController.CHANGE_NAVIGATION_STYLE, { draggingMode: FWDController.PAN }); }), (self.setupRotateButton = function (e) { FWDSimpleButton.setPrototype(), (self.rotateButton_do = new FWDSimpleButton(self.rotateN_img, self.rotateS_img, self.isMobile_bl)), self.rotateButton_do.addListener(FWDSimpleButton.MOUSE_OVER, self.rotateButtonOnMouseOverHandler), self.rotateButton_do.addListener(FWDSimpleButton.MOUSE_OUT, self.rotateButtonOnMouseOutHandler), self.rotateButton_do.addListener(FWDSimpleButton.MOUSE_DOWN, self.rotateButtonOnMouseDownHandler), self.mainHolder_do.addChild(self.rotateButton_do), self.draggingMode_str == FWDController.ROTATE && self.disableRotateButton(), self.showButtonsLabels_bl && (FWDButtonToolTip.setPrototype(), (self.rotateButtonToolTip_do = new FWDButtonToolTip( self.toolTipLeft_img, self.toolTipPointer_img, e, "", self.buttonToolTipLeft_str, self.buttonToolTipMiddle_str, self.buttonToolTipRight_str, self.buttonToolTipFontColor_str, self.controllerVerticalPosition_str, self.buttonToolTipTopPointer_str, self.buttonToolTipBottomPointer_str )), self.mainHolder_do.addChild(self.rotateButtonToolTip_do)); }), (self.rotateButtonOnMouseOverHandler = function (e) { self.rotateButton_do.isSelectedFinal_bl || self.showToolTipButton(self.rotateButton_do, self.rotateButtonToolTip_do, self.buttonsToolTipOffsetY); }), (self.rotateButtonOnMouseOutHandler = function (e) { self.showButtonsLabels_bl && self.rotateButtonToolTip_do.hide(); }), (self.rotateButtonOnMouseDownHandler = function (e) { self.rotate(); }), (self.disableRotateButton = function () { self.rotateButton_do.setSelctedFinal(), self.panButton_do && self.panButton_do.setUnselctedFinal(); }), (this.rotate = function () { self.slideShowButton_do && self.stopSlideShow(), clearInterval(self.gotoImageId_int), self.rotateButton_do && (self.showButtonsLabels_bl && self.rotateButtonToolTip_do.hide(), self.disableRotateButton()), self.dispatchEvent(FWDController.CHANGE_NAVIGATION_STYLE, { draggingMode: FWDController.ROTATE }); }), (self.setupNextButton = function (e) { FWDSimpleButton.setPrototype(), (self.nextButton_do = new FWDSimpleButton(self.nextN_img, self.nextS_img, self.isMobile_bl)), self.nextButton_do.addListener(FWDSimpleButton.MOUSE_OVER, self.nextButtonOnMouseOverHandler), self.nextButton_do.addListener(FWDSimpleButton.MOUSE_OUT, self.nextButtonOnMouseOutHandler), self.nextButton_do.addListener(FWDSimpleButton.MOUSE_DOWN, self.nextButtonStartHandler), self.mainHolder_do.addChild(self.nextButton_do), self.showButtonsLabels_bl && (FWDButtonToolTip.setPrototype(), (self.nextButtonToolTip_do = new FWDButtonToolTip( self.toolTipLeft_img, self.toolTipPointer_img, e, "", self.buttonToolTipLeft_str, self.buttonToolTipMiddle_str, self.buttonToolTipRight_str, self.buttonToolTipFontColor_str, self.controllerVerticalPosition_str, self.buttonToolTipTopPointer_str, self.buttonToolTipBottomPointer_str )), self.mainHolder_do.addChild(self.nextButtonToolTip_do)); }), (self.nextButtonOnMouseOverHandler = function (e) { self.showButtonsLabels_bl && self.showToolTipButton(self.nextButton_do, self.nextButtonToolTip_do, self.buttonsToolTipOffsetY); }), (self.nextButtonOnMouseOutHandler = function (e) { self.showButtonsLabels_bl && self.nextButtonToolTip_do.hide(); }), (self.nextButtonStartHandler = function (e) { e && (e = e.e).touches && self.scrollBarHandler_do && (self.zoomInWithButtonsEndHandler(e), self.zoomOutWithButtonsEndHandler(e), self.handlerDragEndHandler(e)); self.gotoNextImage(), self.slideShowButton_do && self.stopSlideShow(), clearInterval(self.gotoImageId_int), clearTimeout(self.gotoImageId_to), (self.gotoImageId_to = setTimeout(self.goToNextImageInWithDelay, 400)), self.dispatchEvent(FWDController.DISABLE_PAN_OR_MOVE), self.isMobile_bl ? self.hasPointerEvent_bl ? window.addEventListener("MSPointerUp", self.gotoImageEndHandler) : window.addEventListener("touchend", self.gotoImageEndHandler) : window.addEventListener ? window.addEventListener("mouseup", self.gotoImageEndHandler) : document.attachEvent && document.attachEvent("onmouseup", self.gotoImageEndHandler); }), (self.goToNextImageInWithDelay = function () { self.gotoImageId_int = setInterval(self.gotoNextImage, self.rotationSpeed); }), (self.goToTopImage = function () { var e = 1; self.inverseNextAndPrevRotation_bl && (e = -1), self.dispatchEvent(FWDController.GOTO_TOP_OR_BOTTOM_IMAGE, { dir: e }); }), (self.goToTopImageWithDelay = function () { self.gotoImageId_int = setInterval(self.goToTopImage, self.rotationSpeed); }), (self.goToBottomImage = function () { var e = -1; self.inverseNextAndPrevRotation_bl && (e = 1), self.dispatchEvent(FWDController.GOTO_TOP_OR_BOTTOM_IMAGE, { dir: e }); }), (self.goToBottomImageWithDelay = function () { self.gotoImageId_int = setInterval(self.goToBottomImage, self.rotationSpeed); }), (self.gotoImageEndHandler = function (e) { clearInterval(self.gotoImageId_int), clearTimeout(self.gotoImageId_to), self.dispatchEvent(FWDController.ENABLE_PAN_OR_MOVE), self.isMobile_bl ? self.hasPointerEvent_bl ? window.removeEventListener("MSPointerUp", self.gotoImageEndHandler) : window.removeEventListener("touchend", self.gotoImageEndHandler) : window.removeEventListener ? window.removeEventListener("mouseup", self.gotoImageEndHandler) : document.detachEvent && document.detachEvent("onmouseup", self.gotoImageEndHandler), self.dispatchEvent(FWDController.GOTO_NEXT_OR_PREV_IMAGE_COMPLETE); }), (self.gotoNextImage = function () { var e = 1; self.inverseNextAndPrevRotation_bl && (e = -1), self.dispatchEvent(FWDController.GOTO_NEXT_OR_PREV_IMAGE, { dir: e }); }), (self.setupPrevButton = function (e) { FWDSimpleButton.setPrototype(), (self.prevButton_do = new FWDSimpleButton(self.prevN_img, self.prevS_img, self.isMobile_bl)), self.prevButton_do.addListener(FWDComplexButton.MOUSE_OVER, self.prevButtonOnMouseOverHandler), self.prevButton_do.addListener(FWDComplexButton.MOUSE_OUT, self.prevShowButtonOnMouseOutHandler), self.prevButton_do.addListener(FWDSimpleButton.MOUSE_DOWN, self.prevButtonStartHandler), self.mainHolder_do.addChild(self.prevButton_do), self.showButtonsLabels_bl && (FWDButtonToolTip.setPrototype(), (self.prevButtonToolTip_do = new FWDButtonToolTip( self.toolTipLeft_img, self.toolTipPointer_img, e, "", self.buttonToolTipLeft_str, self.buttonToolTipMiddle_str, self.buttonToolTipRight_str, self.buttonToolTipFontColor_str, self.controllerVerticalPosition_str, self.buttonToolTipTopPointer_str, self.buttonToolTipBottomPointer_str )), self.mainHolder_do.addChild(self.prevButtonToolTip_do)); }), (self.prevButtonOnMouseOverHandler = function (e) { self.showButtonsLabels_bl && self.showToolTipButton(self.prevButton_do, self.prevButtonToolTip_do, self.buttonsToolTipOffsetY); }), (self.prevShowButtonOnMouseOutHandler = function (e) { self.showButtonsLabels_bl && self.prevButtonToolTip_do.hide(); }), (self.prevButtonStartHandler = function (e) { e && (e = e.e).touches && self.scrollBarHandler_do && (self.zoomInWithButtonsEndHandler(e), self.zoomOutWithButtonsEndHandler(e), self.handlerDragEndHandler(e)); self.slideShowButton_do && self.stopSlideShow(), self.gotoPrevImage(), clearInterval(self.gotoImageId_int), clearTimeout(self.gotoImageId_to), (self.gotoImageId_to = setTimeout(self.goToPrevImageInWithDelay, 400)), self.dispatchEvent(FWDController.DISABLE_PAN_OR_MOVE), self.isMobile_bl ? (self.hasPointerEvent_bl ? window.addEventListener("MSPointerUp", self.gotoImageEndHandler) : window.addEventListener("touchend", self.gotoImageEndHandler), window.addEventListener("mouseup", self.gotoImageEndHandler)) : window.addEventListener ? window.addEventListener("mouseup", self.gotoImageEndHandler) : document.attachEvent && document.attachEvent("onmouseup", self.gotoImageEndHandler); }), (self.goToPrevImageInWithDelay = function () { self.gotoImageId_int = setInterval(self.gotoPrevImage, self.rotationSpeed); }), (self.gotoPrevImage = function () { var e = -1; self.inverseNextAndPrevRotation_bl && (e = 1), self.dispatchEvent(FWDController.GOTO_NEXT_OR_PREV_IMAGE, { dir: e }); }), (self.setupSlideshowButton = function (e, t) { FWDComplexButton.setPrototype(), (self.slideShowButton_do = new FWDComplexButton(self.playN_img, self.playS_img, self.pauseN_img, self.pauseS_img, !0)), self.slideShowButton_do.addListener(FWDComplexButton.MOUSE_OVER, self.slideSwhoButtonOnMouseOverHandler), self.slideShowButton_do.addListener(FWDComplexButton.MOUSE_OUT, self.slideShowButtonOnMouseOutHandler), self.slideShowButton_do.addListener(FWDComplexButton.MOUSE_DOWN, self.slideShowButtonStartHandler), self.mainHolder_do.addChild(self.slideShowButton_do), self.showButtonsLabels_bl && (FWDButtonToolTip.setPrototype(), (self.slideShowToolTip_do = new FWDButtonToolTip( self.toolTipLeft_img, self.toolTipPointer_img, e, t, self.buttonToolTipLeft_str, self.buttonToolTipMiddle_str, self.buttonToolTipRight_str, self.buttonToolTipFontColor_str, self.controllerVerticalPosition_str, self.buttonToolTipTopPointer_str, self.buttonToolTipBottomPointer_str )), self.mainHolder_do.addChild(self.slideShowToolTip_do)); }), (self.slideSwhoButtonOnMouseOverHandler = function (e) { self.showButtonsLabels_bl && self.showToolTipButton(self.slideShowButton_do, self.slideShowToolTip_do, self.buttonsToolTipOffsetY); }), (self.slideShowButtonOnMouseOutHandler = function (e) { self.showButtonsLabels_bl && self.slideShowToolTip_do.hide(); }), (self.slideShowButtonStartHandler = function (e) { self.showButtonsLabels_bl && self.slideShowToolTip_do.hide(), 1 == self.slideShowButton_do.currentState ? (self.startSlideshow(), self.slideShowButton_do.setButtonState(0), self.showButtonsLabels_bl && self.slideShowToolTip_do.setLabel(self.slideShowToolTip_do.toolTipLabel2_str)) : (self.stopSlideShow(), self.slideShowButton_do.setButtonState(1), self.showButtonsLabels_bl && self.slideShowToolTip_do.setLabel(self.slideShowToolTip_do.toolTipLabel_str)); }), (self.startSlideshow = function () { self.slideShowButton_do && self.slideShowButton_do.setButtonState(0), clearInterval(self.slideShowId_int), (self.slideShowId_int = setInterval(self.slideShowComplete, self.slideShowDelay)), self.dispatchEvent(FWDController.START_SLIDE_SHOW); }), (self.stopSlideShow = function () { (self.enablePlayToImage_bl = !1), (self.dir = 1), self.slideShowButton_do && self.slideShowButton_do.setButtonState(1), clearInterval(self.slideShowId_int), self.dispatchEvent(FWDController.STOP_SLIDE_SHOW); }), (self.slideShowComplete = function () { self.dispatchEvent(FWDController.GOTO_NEXT_OR_PREV_IMAGE, { dir: self.dir }), self.dispatchEvent(FWDController.GOTO_NEXT_OR_PREV_IMAGE_COMPLETE), self.enablePlayToImage_bl && parent.imageManager_do.curId == self.idToStop && (self.stopSlideShow(), eval(self.callBackFunction_str + "()")); }), this.idToStop, (this.enablePlayToImage_bl = !1), (this.dir = 1), this.callBackFunction_str, (this.playToImage = function (e, t) { if (e != parent.imageManager_do.curId) { if ( ((self.enablePlayToImage_bl = !0), (self.idToStop = e), (self.callBackFunction_str = t), 0 == e ? (e = 0) : e > self.totalImages - 1 && (e = self.totalImages - 1), (self.idToStop = e), self.stopRotationAtEnds_bl) ) parent.imageManager_do.curId > self.idToStop ? (self.dir = -1) : (self.dir = 1); else { var o = Math.abs(parent.imageManager_do.curId - self.idToStop); Math.abs(parent.imageManager_do.curId - (self.idToStop + self.totalImages)) < o ? self.idToStop < parent.imageManager_do.curId ? (self.dir = 1) : (self.dir = -1) : self.idToStop > parent.imageManager_do.curId ? (self.dir = 1) : (self.dir = -1); } self.startSlideshow(); } }), (self.setupInfoButton = function (e) { FWDSimpleButton.setPrototype(), (self.infoButton_do = new FWDSimpleButton(self.infoN_img, self.infoS_img, self.isMobile_bl)), self.infoButton_do.addListener(FWDComplexButton.MOUSE_OVER, self.infoButtonOnMouseOverHandler), self.infoButton_do.addListener(FWDComplexButton.MOUSE_OUT, self.infoButtonOnMouseOutHandler), self.infoButton_do.addListener(FWDComplexButton.MOUSE_DOWN, self.infoButtonStartHandler), self.mainHolder_do.addChild(self.infoButton_do), self.showButtonsLabels_bl && (FWDButtonToolTip.setPrototype(), (self.infoToolTip_do = new FWDButtonToolTip( self.toolTipLeft_img, self.toolTipPointer_img, e, "", self.buttonToolTipLeft_str, self.buttonToolTipMiddle_str, self.buttonToolTipRight_str, self.buttonToolTipFontColor_str, self.controllerVerticalPosition_str, self.buttonToolTipTopPointer_str, self.buttonToolTipBottomPointer_str )), self.mainHolder_do.addChild(self.infoToolTip_do)); }), (self.infoButtonOnMouseOverHandler = function (e) { self.showButtonsLabels_bl && self.showToolTipButton(self.infoButton_do, self.infoToolTip_do, self.buttonsToolTipOffsetY); }), (self.infoButtonOnMouseOutHandler = function (e) { self.showButtonsLabels_bl && self.infoToolTip_do.hide(); }), (self.infoButtonStartHandler = function (e) { self.dispatchEvent(FWDController.SHOW_INFO); }), (self.setupLinkButton = function (e) { FWDSimpleButton.setPrototype(), (self.linkButton_do = new FWDSimpleButton(self.linkN_img, self.linkS_img, self.isMobile_bl)), self.linkButton_do.addListener(FWDComplexButton.MOUSE_OVER, self.linkButtonOnMouseOverHandler), self.linkButton_do.addListener(FWDComplexButton.MOUSE_OUT, self.linkButtonOnMouseOutHandler), self.linkButton_do.addListener(FWDComplexButton.MOUSE_DOWN, self.linkButtonOnMouseClickHandler), self.mainHolder_do.addChild(self.linkButton_do), self.showButtonsLabels_bl && (FWDButtonToolTip.setPrototype(), (self.linkToolTip_do = new FWDButtonToolTip( self.toolTipLeft_img, self.toolTipPointer_img, e, "", self.buttonToolTipLeft_str, self.buttonToolTipMiddle_str, self.buttonToolTipRight_str, self.buttonToolTipFontColor_str, self.controllerVerticalPosition_str, self.buttonToolTipTopPointer_str, self.buttonToolTipBottomPointer_str )), self.mainHolder_do.addChild(self.linkToolTip_do)); }), (self.linkButtonOnMouseOverHandler = function (e) { self.showButtonsLabels_bl && self.showToolTipButton(self.linkButton_do, self.linkToolTip_do, self.buttonsToolTipOffsetY); }), (self.linkButtonOnMouseOutHandler = function (e) { self.showButtonsLabels_bl && self.linkToolTip_do.hide(); }), (self.linkButtonOnMouseClickHandler = function (e) { logger.log("click"), window.open(self.link_str, "_blank"); }), (self.setupFullScreenButton = function (e, t) { FWDComplexButton.setPrototype(), (self.fullScreenButton_do = new FWDComplexButton(self.fullScreenFullN_img, self.fullScreenFullS_img, self.fullScreenNormalN_img, self.fullScreenNormalS_img, !0)), self.fullScreenButton_do.addListener(FWDComplexButton.MOUSE_OVER, self.fullscreenButtonOnMouseOverHandler), self.fullScreenButton_do.addListener(FWDComplexButton.MOUSE_OUT, self.fullscreenButtonOnMouseOutHandler), self.fullScreenButton_do.addListener(FWDComplexButton.MOUSE_DOWN, self.fullScreenButtonStartHandler), self.mainHolder_do.addChild(self.fullScreenButton_do), self.showButtonsLabels_bl && (FWDButtonToolTip.setPrototype(), (self.fullscreenToolTip_do = new FWDButtonToolTip( self.toolTipLeft_img, self.toolTipPointer_img, e, t, self.buttonToolTipLeft_str, self.buttonToolTipMiddle_str, self.buttonToolTipRight_str, self.buttonToolTipFontColor_str, self.controllerVerticalPosition_str, self.buttonToolTipTopPointer_str, self.buttonToolTipBottomPointer_str )), self.mainHolder_do.addChild(self.fullscreenToolTip_do)); }), (self.fullscreenButtonOnMouseOverHandler = function (e) { self.showButtonsLabels_bl && self.showToolTipButton(self.fullScreenButton_do, self.fullscreenToolTip_do, self.buttonsToolTipOffsetY); }), (self.fullscreenButtonOnMouseOutHandler = function (e) { self.showButtonsLabels_bl && self.fullscreenToolTip_do.hide(); }), (self.fullScreenButtonStartHandler = function (e) { 1 == self.fullScreenButton_do.currentState ? (self.showButtonsLabels_bl && self.fullscreenToolTip_do.setLabel(self.fullscreenToolTip_do.toolTipLabel2_str), self.fullScreenButton_do.setButtonState(0), self.dispatchEvent(FWDController.GO_FULL_SCREEN)) : 0 == self.fullScreenButton_do.currentState && (self.showButtonsLabels_bl && self.fullscreenToolTip_do.setLabel(self.fullscreenToolTip_do.toolTipLabel_str), self.fullScreenButton_do.setButtonState(1), self.dispatchEvent(FWDController.GO_NORMAL_SCREEN)), setTimeout(function () { null != self && self.fullScreenButton_do.onMouseOut(e); }, 50); }), (self.setFullScreenButtonState = function (e) { 0 == e ? (self.fullScreenButton_do.setButtonState(0), self.showButtonsLabels_bl && self.fullscreenToolTip_do.setLabel(self.fullscreenToolTip_do.toolTipLabel2_str)) : 1 == e && (self.fullScreenButton_do.setButtonState(1), self.showButtonsLabels_bl && self.fullscreenToolTip_do.setLabel(self.fullscreenToolTip_do.toolTipLabel_str)); }), (this.onFullScreenChange = function (e) { parent.hibernate_bl || (document.fullScreen || document.mozFullScreen || document.webkitIsFullScreen || document.msieFullScreen ? (self.showButtonsLabels_bl && self.fullscreenToolTip_do.setLabel(self.fullscreenToolTip_do.toolTipLabel2_str), self.fullScreenButton_do.setButtonState(0), self.dispatchEvent(FWDController.GO_FULL_SCREEN)) : (self.showButtonsLabels_bl && self.fullscreenToolTip_do.setLabel(self.fullscreenToolTip_do.toolTipLabel_str), self.fullScreenButton_do.setButtonState(1), self.dispatchEvent(FWDController.GO_NORMAL_SCREEN))); }), (self.setupScrollBar = function () { var e; FWDSimpleButton.setPrototype(), (self.zoomIn_do = new FWDSimpleButton(self.zoomInN_img, self.zoomInS_img)), self.zoomIn_do.addListener(FWDSimpleButton.MOUSE_OVER, self.zoomInMouseOverHandler), self.zoomIn_do.addListener(FWDSimpleButton.MOUSE_OUT, self.zoomInOrOutMouseOutHandler), self.zoomIn_do.addListener(FWDSimpleButton.MOUSE_DOWN, self.zoomInStartHandler), self.mainHolder_do.addChild(self.zoomIn_do), FWDSimpleButton.setPrototype(), (self.zoomOut_do = new FWDSimpleButton(self.zoomOutN_img, self.zoomOutS_img)), self.zoomOut_do.addListener(FWDSimpleButton.MOUSE_OVER, self.zoomOutMouseOverHandler), self.zoomOut_do.addListener(FWDSimpleButton.MOUSE_OUT, self.zoomInOrOutMouseOutHandler), self.zoomOut_do.addListener(FWDSimpleButton.MOUSE_DOWN, self.zoomOutStartHandler), self.mainHolder_do.addChild(self.zoomOut_do), (self.scrollBar_do = new FWDDisplayObject("div")), self.scrollBar_do.setOverflow("visible"), self.scrollBar_do.setHeight(self.scrollBarHeight), self.mainHolder_do.addChild(self.scrollBar_do), (self.scrollBarLeft_do = new FWDSimpleDisplayObject("img")), self.scrollBarLeft_do.setScreen(data.scrollBarLeft_img), self.scrollBar_do.addChild(self.scrollBarLeft_do), (self.scrollBarMiddle_do = new FWDSimpleDisplayObject("div")), self.scrollBarMiddle_do.setHeight(self.scrollBarHeight), (self.scrollBarMiddle_do.getStyle().background = "url('" + self.scrollBarMiddlePath_str + "')"), (self.scrollBarMiddle_do.getStyle().backgroundRepeat = "repeat-x"), self.scrollBar_do.addChild(self.scrollBarMiddle_do), (self.scrollBarRight_do = new FWDSimpleDisplayObject("img")), self.scrollBarRight_do.setScreen(self.scrollBarRight_img), self.scrollBar_do.addChild(self.scrollBarRight_do), FWDSimpleButton.setPrototype(), (self.scrollBarHandler_do = new FWDSimpleButton(self.scrollBarHandlerN_img, self.scrollBarHandlerS_img, self.isMobile_bl)), self.scrollBarHandler_do.setY(parseInt((self.scrollBarHeight - self.scrollBarHandlerHeight) / 2) - 1), self.scrollBarHandler_do.addListener(FWDSimpleButton.MOUSE_OVER, self.handlerOnMouseOver), self.scrollBarHandler_do.addListener(FWDSimpleButton.MOUSE_OUT, self.handlerOnMouseOut), self.scrollBarHandler_do.addListener(FWDSimpleButton.MOUSE_DOWN, self.handlerDragStartHandler), self.scrollBar_do.addChild(self.scrollBarHandler_do), self.showButtonsLabels_bl && ((e = self.buttonsLabels_ar[self.scrollBarPosition] || "tooltip is not defined!"), FWDButtonToolTip.setPrototype(), (self.scrollBarHandlerToolTip_do = new FWDButtonToolTip( self.toolTipLeft_img, self.toolTipPointer_img, e, "", self.buttonToolTipLeft_str, self.buttonToolTipMiddle_str, self.buttonToolTipRight_str, self.buttonToolTipFontColor_str, self.controllerVerticalPosition_str, self.buttonToolTipTopPointer_str, self.buttonToolTipBottomPointer_str )), self.mainHolder_do.addChild(self.scrollBarHandlerToolTip_do)); }), (self.zoomInMouseOverHandler = function (e) { self.showButtonsLabels_bl && (self.scrollBarHandlerToolTip_do.show(), self.isScrollBarActive_bl ? self.positionAndSetLabelScrollBarHandler() : !self.isScrollBarActive_bl && self.showButtonsLabels_bl && setTimeout(function () { if (null != self) { var e = self.finalHandlerX / (self.scrollBarTotalWidth - self.scrollBarHandlerWidth); self.scrollBarHandlerToolTip_do.setLabel(self.scrollBarHandlerToolTip_do.toolTipLabel_str + Math.round(100 * e) + "%"), self.showZoomInOrOutToolTipButton(self.zoomIn_do, self.scrollBarHandlerToolTip_do, self.zoomInAndOutToolTipOffsetY); } }, 50)); }), (self.zoomInOrOutMouseOutHandler = function (e) { self.showButtonsLabels_bl && self.scrollBarHandlerToolTip_do.hide(); }), (self.zoomInStartHandler = function (e) { e && (e = e.e).touches && self.handlerDragEndHandler(e), clearInterval(self.zoomWithButtonsId_int), clearTimeout(self.zoomWithButtonsId_to), (self.zoomWithButtonsId_to = setTimeout(self.startZoomInWithDelay, 400)), self.dispatchEvent(FWDController.DISABLE_PAN_OR_MOVE), self.zoomInWithButtonsDispatchEvent(!0), self.slideShowButton_do && self.stopSlideShow(), self.zoomIn_do && (self.zoomIn_do.isSelectedFinal_bl = !0), (self.isZoomInOrOutPressed_bl = !0), self.isMobile_bl ? self.hasPointerEvent_bl ? window.addEventListener("MSPointerUp", self.zoomInWithButtonsEndHandler) : window.addEventListener("touchend", self.zoomInWithButtonsEndHandler) : window.addEventListener ? window.addEventListener("mouseup", self.zoomInWithButtonsEndHandler) : document.attachEvent && document.attachEvent("onmouseup", self.zoomInWithButtonsEndHandler); }), (self.startZoomInWithDelay = function () { self.zoomWithButtonsId_int = setInterval(self.zoomInWithButtonsDispatchEvent, 16); }), (self.zoomInWithButtonsDispatchEvent = function (e) { e ? self.dispatchEvent(FWDController.ZOOM_WITH_BUTTONS, { dir: 1, withPause: !0 }) : self.dispatchEvent(FWDController.ZOOM_WITH_BUTTONS, { dir: 1, withPause: !1 }), !self.isScrollBarActive_bl && self.showButtonsLabels_bl && setTimeout(function () { if (null != self) { var e = self.finalHandlerX / (self.scrollBarTotalWidth - self.scrollBarHandlerWidth); self.scrollBarHandlerToolTip_do && self.scrollBarHandlerToolTip_do.setLabel(self.scrollBarHandlerToolTip_do.toolTipLabel_str + Math.round(100 * e) + "%"), self.showZoomInOrOutToolTipButton && self.showZoomInOrOutToolTipButton(self.zoomIn_do, self.scrollBarHandlerToolTip_do, self.zoomInAndOutToolTipOffsetY); } }, 50); }), (self.zoomInWithButtonsEndHandler = function (e) { var t; clearInterval(self.zoomWithButtonsId_int), clearTimeout(self.zoomWithButtonsId_to), (self.isZoomInOrOutPressed_bl = !1), self.zoomIn_do && ((self.zoomIn_do.isSelectedFinal_bl = !1), (t = FWDUtils.getViewportMouseCoordinates(e)), FWDUtils.hitTest(self.zoomIn_do.screen, t.screenX, t.screenY) || self.zoomIn_do.onMouseOut(e)), self.dispatchEvent(FWDController.ENABLE_PAN_OR_MOVE), self.isMobile_bl ? self.hasPointerEvent_bl ? window.removeEventListener("MSPointerUp", self.zoomInWithButtonsEndHandler) : window.removeEventListener("touchend", self.zoomInWithButtonsEndHandler) : window.removeEventListener ? window.removeEventListener("mouseup", self.zoomInWithButtonsEndHandler) : document.detachEvent && document.detachEvent("onmouseup", self.zoomInWithButtonsEndHandler); }), (self.zoomOutMouseOverHandler = function (e) { self.showButtonsLabels_bl && (self.scrollBarHandlerToolTip_do.show(), self.isScrollBarActive_bl ? self.positionAndSetLabelScrollBarHandler() : !self.isScrollBarActive_bl && self.showButtonsLabels_bl && setTimeout(function () { if (null != self) { var e = self.finalHandlerX / (self.scrollBarTotalWidth - self.scrollBarHandlerWidth); self.scrollBarHandlerToolTip_do.setLabel(self.scrollBarHandlerToolTip_do.toolTipLabel_str + Math.round(100 * e) + "%"), self.showZoomInOrOutToolTipButton(self.zoomOut_do, self.scrollBarHandlerToolTip_do, self.zoomInAndOutToolTipOffsetY); } }, 50)); }), (self.zoomOutStartHandler = function (e) { e && (e = e.e).touches && self.handlerDragEndHandler(e), clearInterval(self.zoomWithButtonsId_int), clearTimeout(self.zoomWithButtonsId_to), (self.zoomWithButtonsId_to = setTimeout(self.startZoomOutWithDelay, 400)), self.dispatchEvent(FWDController.DISABLE_PAN_OR_MOVE), self.zoomOutWithButtonsDispatchEvent(!0), self.slideShowButton_do && self.stopSlideShow(), self.zoomOut_do && (self.zoomOut_do.isSelectedFinal_bl = !0), (self.isZoomInOrOutPressed_bl = !0), self.isMobile_bl ? self.hasPointerEvent_bl ? window.addEventListener("MSPointerUp", self.zoomOutWithButtonsEndHandler) : window.addEventListener("touchend", self.zoomOutWithButtonsEndHandler) : window.addEventListener ? window.addEventListener("mouseup", self.zoomOutWithButtonsEndHandler) : document.attachEvent && document.attachEvent("onmouseup", self.zoomOutWithButtonsEndHandler); }), (self.startZoomOutWithDelay = function () { self.zoomWithButtonsId_int = setInterval(self.zoomOutWithButtonsDispatchEvent, 16); }), (self.zoomOutWithButtonsDispatchEvent = function (e) { !self.isScrollBarActive_bl && self.showButtonsLabels_bl && setTimeout(function () { if (null != self) { var e = self.finalHandlerX / (self.scrollBarTotalWidth - self.scrollBarHandlerWidth); self.scrollBarHandlerToolTip_do && self.scrollBarHandlerToolTip_do.setLabel(self.scrollBarHandlerToolTip_do.toolTipLabel_str + Math.round(100 * e) + "%"), self.showZoomInOrOutToolTipButton && self.showZoomInOrOutToolTipButton(self.zoomOut_do, self.scrollBarHandlerToolTip_do, self.zoomInAndOutToolTipOffsetY); } }, 50), e ? self.dispatchEvent(FWDController.ZOOM_WITH_BUTTONS, { dir: -1, withPause: !0 }) : self.dispatchEvent(FWDController.ZOOM_WITH_BUTTONS, { dir: -1, withPause: !1 }); }), (self.zoomOutWithButtonsEndHandler = function (e) { var t; clearInterval(self.zoomWithButtonsId_int), clearTimeout(self.zoomWithButtonsId_to), (self.isZoomInOrOutPressed_bl = !1), self.zoomOut_do && ((self.zoomOut_do.isSelectedFinal_bl = !1), (t = FWDUtils.getViewportMouseCoordinates(e)), FWDUtils.hitTest(self.zoomOut_do.screen, t.screenX, t.screenY) || self.zoomOut_do.onMouseOut(e)), self.dispatchEvent(FWDController.ENABLE_PAN_OR_MOVE), self.isMobile_bl ? self.hasPointerEvent_bl ? window.removeEventListener("MSPointerUp", self.zoomOutWithButtonsEndHandler) : window.removeEventListener("touchend", self.zoomOutWithButtonsEndHandler) : window.removeEventListener ? window.removeEventListener("mouseup", self.zoomOutWithButtonsEndHandler) : document.detachEvent && document.detachEvent("onmouseup", self.zoomOutWithButtonsEndHandler); }), (self.handlerOnMouseOver = function (e) { self.showButtonsLabels_bl && (self.positionAndSetLabelScrollBarHandler(), self.scrollBarHandlerToolTip_do.show()); }), (self.handlerOnMouseOut = function (e) { self.showButtonsLabels_bl && !self.isHandlerClicked_bl && self.scrollBarHandlerToolTip_do.hide(); }), (self.handlerDragStartHandler = function (e) { (e = e.e), self.isMobile_bl && (self.handlerDragEndHandler(e), (self.prevButton_do || self.prevButton_do) && self.gotoImageEndHandler(e)), self.slideShowButton_do && self.stopSlideShow(); var t = FWDUtils.getViewportMouseCoordinates(e); (self.lastPresedX = t.screenX), (self.scrollBarHandlerXPositionOnPress = self.scrollBarHandler_do.getX()), (self.scrollBarHandler_do.isSelectedFinal_bl = !0), self.dispatchEvent(FWDController.DISABLE_PAN_OR_MOVE), self.isMobile_bl ? self.hasPointerEvent_bl ? (window.addEventListener("MSPointerMove", self.handlerDragMoveHandler), window.addEventListener("MSPointerUp", self.handlerDragEndHandler)) : (window.addEventListener("touchmove", self.handlerDragMoveHandler), window.addEventListener("touchend", self.handlerDragEndHandler)) : ((self.scrollBarHandler_do.isSelectedFinal_bl = !0), window.addEventListener ? (window.addEventListener("mousemove", self.handlerDragMoveHandler), window.addEventListener("mouseup", self.handlerDragEndHandler)) : document.attachEvent && (document.attachEvent("onmousemove", self.handlerDragMoveHandler), document.attachEvent("onmouseup", self.handlerDragEndHandler))); }), (self.handlerDragMoveHandler = function (e) { e.preventDefault && e.preventDefault(), (self.isHandlerClicked_bl = !0); var t = FWDUtils.getViewportMouseCoordinates(e); (self.finalHandlerX = Math.round(self.scrollBarHandlerXPositionOnPress + t.screenX - self.lastPresedX)), self.finalHandlerX <= 0 ? (self.finalHandlerX = 0) : self.finalHandlerX >= self.scrollBarTotalWidth - self.scrollBarHandlerWidth && (self.finalHandlerX = self.scrollBarTotalWidth - self.scrollBarHandlerWidth); var o = self.finalHandlerX / (self.scrollBarTotalWidth - self.scrollBarHandlerWidth); self.dispatchEvent(FWDController.SCROLL_BAR_UPDATE, { percent: o }), self.scrollBarHandler_do.setX(self.finalHandlerX), self.positionAndSetLabelScrollBarHandler(); }), (self.handlerDragEndHandler = function (e) { var t; (self.isHandlerClicked_bl = !1), self.dispatchEvent(FWDController.ENABLE_PAN_OR_MOVE), (t = FWDUtils.getViewportMouseCoordinates(e)), FWDUtils.hitTest(self.scrollBarHandler_do.screen, t.screenX, t.screenY) || (self.scrollBarHandler_do.onMouseOut(e), self.showButtonsLabels_bl && self.scrollBarHandlerToolTip_do.hide(), self.scrollBarHandler_do.setUnselctedFinal()), (self.scrollBarHandler_do.isSelectedFinal_bl = !1), self.isMobile_bl ? self.hasPointerEvent_bl ? (window.removeEventListener("MSPointerMove", self.handlerDragMoveHandler), window.removeEventListener("MSPointerUp", self.handlerDragEndHandler)) : (window.removeEventListener("touchmove", self.handlerDragMoveHandler), window.removeEventListener("touchend", self.handlerDragEndHandler)) : window.removeEventListener ? (window.removeEventListener("mousemove", self.handlerDragMoveHandler), window.removeEventListener("mouseup", self.handlerDragEndHandler)) : document.detachEvent && (document.detachEvent("onmousemove", self.handlerDragMoveHandler), document.detachEvent("onmouseup", self.handlerDragEndHandler)); }), (self.updateScrollBar = function (e, t) { self.scrollBarHandler_do && ((self.finalHandlerX = Math.round(e * (self.scrollBarTotalWidth - self.scrollBarHandlerWidth))), self.isScrollBarActive_bl && (self.finalHandlerX <= 0 ? (self.finalHandlerX = 0) : self.finalHandlerX >= self.scrollBarTotalWidth - self.scrollBarHandlerWidth && (self.finalHandlerX = self.scrollBarTotalWidth - self.scrollBarHandlerWidth), FWDAnimation.killTweensOf(self.scrollBarHandler_do), t ? FWDAnimation.to(self.scrollBarHandler_do, 0.2, { x: self.finalHandlerX, onUpdate: self.positionAndSetLabelScrollBarHandler, onComplete: self.positionAndSetLabelScrollBarHandler }) : (FWDAnimation.killTweensOf(self.scrollBarHandler_do), self.scrollBarHandler_do.setX(self.finalHandlerX)))); }), (self.positionAndSetLabelScrollBarHandler = function () { if (self.showButtonsLabels_bl && self.isScrollBarActive_bl) { var e = 0, t = 0, o = self.finalHandlerX / (self.scrollBarTotalWidth - self.scrollBarHandlerWidth), n = self.getGlobalX(); self.scrollBarHandlerToolTip_do.setLabel(self.scrollBarHandlerToolTip_do.toolTipLabel_str + Math.round(100 * o) + "%"), setTimeout(function () { null != self && self.scrollBarHandlerToolTip_do.isShowed_bl && ((e = parseInt(self.scrollBarHandler_do.getX() + self.scrollBar_do.getX() + (self.scrollBarHandlerWidth - self.scrollBarHandlerToolTip_do.totalWidth) / 2)), (t = self.controllerVerticalPosition_str == FWDController.POSITION_BOTTOM ? -self.scrollBarHandlerToolTip_do.totalHeight - self.scrollBarHandlerToolTipOffsetY : self.curHeight + self.scrollBarHandlerToolTipOffsetY), n + e < 0 && (e = 0), self.scrollBarHandlerToolTip_do.setX(e), self.scrollBarHandlerToolTip_do.setY(t)); }, 51); } }), (self.hide = function (e) { self.controllerVerticalPosition_str == FWDController.POSITION_BOTTOM ? e ? FWDAnimation.to(self.mainHolder_do, 1, { y: self.curHeight + self.controllerOffsetY, ease: Expo.easeInOut }) : self.mainHolder_do.setY(self.curHeight + self.controllerOffsetY) : self.controllerVerticalPosition_str == FWDController.POSITION_TOP && (e ? FWDAnimation.to(self.mainHolder_do, 1, { y: -self.curHeight - self.controllerOffsetY, ease: Expo.easeInOut }) : self.mainHolder_do.setY(-self.curHeight - self.controllerOffsetY)); }), (self.show = function () { FWDAnimation.to(self.mainHolder_do, 1, { y: 0, ease: Expo.easeInOut }); }), (self.showToolTipButton = function (e, t, o) { if (self.showButtonsLabels_bl) { var n, i, s = self.mainHolder_do.getX(), r = 0; self.showButtonsLabels_bl && t.show(), setTimeout(function () { null != self && t.isShowed_bl && ((n = parseInt(e.getX() + (self.buttonWidth - t.totalWidth) / 2)), (i = self.controllerVerticalPosition_str == FWDController.POSITION_BOTTOM ? -t.totalHeight - o : self.curHeight + o), s + n < 0 ? ((r = s + n), (n += Math.abs(s + n))) : s + self.curWidth - n - t.totalWidth < 0 && ((r = -(s + self.curWidth - n - t.totalWidth)), (n = n + s + self.curWidth - n - t.totalWidth)), t.setX(n), t.setY(i), t.positionPointer(r)); }, 51); } }), (self.showZoomInOrOutToolTipButton = function (e, t, o) { if (self.showButtonsLabels_bl && t) { var n, i, s = self.mainHolder_do.getX(), r = 0; setTimeout(function () { null != self && t.isShowed_bl && ((n = parseInt(e.getX() + (self.zoomButtonHeight - t.totalWidth) / 2)), (i = self.controllerVerticalPosition_str == FWDController.POSITION_BOTTOM ? -t.totalHeight - o : self.curHeight + o), s + n < 0 ? ((r = s + n), (n += Math.abs(s + n))) : s + self.curWidth - n - t.totalWidth < 0 && ((r = -(s + self.curWidth - n - t.totalWidth)), (n = n + s + self.curWidth - n - t.totalWidth)), t.setX(n), t.setY(i), t.positionPointer(r)); }, 51); } }), (self.cleanMainEvents = function () { clearInterval(self.gotoImageId_int), clearInterval(self.zoomWithButtonsId_int), clearInterval(self.slideShowId_int), clearTimeout(self.gotoImageId_to), clearTimeout(self.zoomWithButtonsId_to), self.hider && (self.hider.removeListener(FWDHider.SHOW, self.onHiderShow), self.hider.removeListener(FWDHider.HIDE, self.onHiderHide)), (self.screen.onmousedown = null), self.isMobile_bl ? (window.removeEventListener("touchend", self.gotoImageEndHandler), window.removeEventListener("MSPointerUp", self.gotoImageEndHandler), window.removeEventListener("touchend", self.zoomInWithButtonsEndHandler), window.removeEventListener("MSPointerUp", self.zoomInWithButtonsEndHandler), window.removeEventListener("touchend", self.zoomOutWithButtonsEndHandler), window.removeEventListener("MSPointerUp", self.zoomOutWithButtonsEndHandler), window.removeEventListener("touchmove", self.handlerDragMoveHandler), window.removeEventListener("touchend", self.handlerDragEndHandler), window.removeEventListener("MSPointerMove", self.handlerDragMoveHandler), window.removeEventListener("MSPointerUp", self.handlerDragEndHandler)) : window.removeEventListener ? (window.removeEventListener("mouseup", self.gotoImageEndHandler), window.removeEventListener("mouseup", self.zoomInWithButtonsEndHandler), window.removeEventListener("mouseup", self.zoomOutWithButtonsEndHandler), window.removeEventListener("mousemove", self.handlerDragMoveHandler), window.removeEventListener("mouseup", self.handlerDragEndHandler), window.removeEventListener("keydown", self.onKeyDownHandler), window.removeEventListener("keyup", self.onKeyUpHandler)) : document.detachEvent && (document.detachEvent("onmouseup", self.gotoImageEndHandler), document.detachEvent("onmouseup", self.zoomInWithButtonsEndHandler), document.detachEvent("onmouseup", self.zoomOutWithButtonsEndHandler), document.detachEvent("onmousemove", self.handlerDragMoveHandler), document.detachEvent("onmouseup", self.handlerDragEndHandler), document.detachEvent("onkeydown", self.onKeyDownHandler), document.detachEvent("onkeyup", self.onKeyUpHandler)); }), (this.destroy = function () { self.cleanMainEvents(), FWDAnimation.killTweensOf(self.mainHolder_do), self.mainHolder_do.destroy(), self.backgroundLeft_sdo.destroy(), self.backgroundMiddle_sdo.destroy(), self.backgroundRight_sdo.destroy(), self.panButton_do && self.panButton_do.destroy(), self.rotateButton_do && self.rotateButton_do.destroy(), self.nextButton_do && self.nextButton_do.destroy(), self.prevButton_do && self.prevButton_do.destroy(), self.slideShowButton_do && self.slideShowButton_do.destroy(), self.infoButton_do && self.infoButton_do.destroy(), self.linkButton_do && self.linkButton_do.destroy(), self.fullScreenButton_do && self.fullScreenButton_do.destroy(), self.zoomIn_do && self.zoomIn_do.destroy(), self.zoomOut_do && self.zoomOut_do.destroy(), self.scrollBar_do && self.scrollBar_do.destroy(), self.scrollBarLeft_sdo && self.scrollBarLeft_sdo.destroy(), self.scrollBarRight_sdo && self.scrollBarRight_sdo.destroy(), self.scrollBarMiddle_sdo && self.scrollBarMiddle_sdo.destroy(), self.scrollBarHandler_do && (FWDAnimation.killTweensOf(self.mainHolder_do), self.scrollBarHandler_do.destroy()), self.scrollBarHandlerN_sdo && self.scrollBarHandlerN_sdo.destroy(), self.scrollBarHandlerS_sdo && self.scrollBarHandlerS_sdo.destroy(), self.panButtonTooTipLabel_do && self.panButtonTooTipLabel_do.destroy(), self.scrollBarHandlerToolTip_do && self.scrollBarHandlerToolTip_do.destroy(), self.rotateButtonToolTip_do && self.rotateButtonToolTip_do.destroy(), self.nextButtonToolTip_do && self.nextButtonToolTip_do.destroy(), self.prevButtonToolTip_do && self.prevButtonToolTip_do.destroy(), self.slideShowToolTip_do && self.slideShowToolTip_do.destroy(), self.infoToolTip_do && self.infoToolTip_do.destroy(), self.linkToolTip_do && self.linkToolTip_do.destroy(), self.fullscreenToolTip_do && self.fullscreenToolTip_do.destroy(), (self.buttonsTest_ar = null), (self.buttons_ar = null), (self.hider = null), (self.mainHolder_do = null), (self.backgroundLeft_sdo = null), (self.backgroundMiddle_sdo = null), (self.backgroundRight_sdo = null), (self.panButton_do = null), (self.rotateButton_do = null), (self.nextButton_do = null), (self.prevButton_do = null), (self.slideShowButton_do = null), (self.infoButton_do = null), (self.linkButton_do = null), (self.fullScreenButton_do = null), (self.zoomIn_do = null), (self.zoomOut_do = null), (self.scrollBar_do = null), (self.scrollBarLeft_sdo = null), (self.scrollBarRight_sdo = null), (self.scrollBarMiddle_sdo = null), (self.scrollBarHandler_do = null), (self.scrollBarHandlerN_sdo = null), (self.scrollBarHandlerS_sdo = null), (self.panButtonTooTipLabel_do = null), (self.scrollBarHandlerToolTip_do = null), (self.rotateButtonToolTip_do = null), (self.nextButtonToolTip_do = null), (self.prevButtonToolTip_do = null), (self.slideShowToolTip_do = null), (self.infoToolTip_do = null), (self.linkToolTip_do = null), (self.fullscreenToolTip_do = null), (self.backgroundLeft_img = null), (self.backgroundRight_img = null), (self.panN_img = null), (self.panS_img = null), (self.rotateN_img = null), (self.rotateS_img = null), (self.nextN_img = null), (self.nextS_img = null), (self.prevN_img = null), (self.prevS_img = null), (self.playN_img = null), (self.playS_img = null), (self.pauseN_img = null), (self.pauseS_img = null), (self.infoN_img = null), (self.infoS_img = null), (self.linkN_img = null), (self.linkS_img = null), (self.fullScreenNormalN_img = null), (self.fullScreenNormalS_img = null), (self.fullScreenFullN_img = null), (self.fullScreenFullS_img = null), (self.zoomInN_img = null), (self.zoomInS_img = null), (self.zoomOutN_img = null), (self.zoomOutS_img = null), (self.scrollBarHandlerN_img = null), (self.scrollBarHandlerS_img = null), (self.scrollBarLeft_img = null), (self.scrollBarRight_img = null), (self.toolTipLeft_img = null), (self.toolTipPointer_img = null), (self.backgroundMiddlePath_str = null), (self.scrollBarMiddlePath_str = null), (self.draggingMode_str = null), (self.controllerVerticalPosition_str = null), (self.buttonToolTipLeft_str = null), (self.buttonToolTipMiddle_str = null), (self.buttonToolTipRight_str = null), (self.link_str = null), (parent = data = null), self.setInnerHTML(""), prototype.destroy(), (prototype = self = null), (FWDController.prototype = null); }), this.init(); }; (FWDController.setPrototype = function () { FWDController.prototype = new FWDDisplayObject("div"); }), (FWDController.GOTO_TOP_OR_BOTTOM_IMAGE = "goToTopImage"), (FWDController.SHOW_INFO = "showInfo"), (FWDController.POSITION_TOP = "top"), (FWDController.POSITION_BOTTOM = "bottom"), (FWDController.CHANGE_NAVIGATION_STYLE = "changeNavigationStyle"), (FWDController.GOTO_NEXT_IMAGE = "gotoNextImage"), (FWDController.GOTO_PREV_IMAGE = "gotoPrevImage"), (FWDController.GOTO_NEXT_OR_PREV_IMAGE = "gotoNextOrPrevImage"), (FWDController.GOTO_NEXT_OR_PREV_IMAGE_COMPLETE = "gotoNextOrPrevImageComplete"), (FWDController.DISABLE_PAN_OR_MOVE = "disablePanOrMove"), (FWDController.ENABLE_PAN_OR_MOVE = "enablePanOrMove"), (FWDController.SCROLL_BAR_UPDATE = "scrollBarUpdate"), (FWDController.ZOOM_WITH_BUTTONS = "zoomWithButtons"), (FWDController.ZOOM_IN = "zoomIn"), (FWDController.ZOOM_OUT = "zoomOut"), (FWDController.PAN = "pan"), (FWDController.ROTATE = "rotate"), (FWDController.START_SLIDE_SHOW = "startSlideShow"), (FWDController.STOP_SLIDE_SHOW = "stopSlideShow"), (FWDController.GO_FULL_SCREEN = "goFullScreen"), (FWDController.GO_NORMAL_SCREEN = "goNormalScreen"), (FWDController.MOUSE_DOWN = "controllerOnMouseDown"), (FWDController.prototype = null), (window.FWDController = FWDController); })(), (function (o) { var te = function (e) { var ee = this, n = te.prototype; this.navigatorImage_img, (this.mainPreloader_img = null), (this.mainLightboxCloseButtonN_img = null), (this.mainLightboxCloseButtonS_img = null), (this.controllerBackgroundLeft_img = null), (this.controllerBackgroundRight_img = null), (this.controllerPanN_img = null), (this.controllerPanS_img = null), (this.controllerRotateN_img = null), (this.controllerRotateS_img = null), (this.controllerNextN_img = null), (this.controllerNextS_img = null), (this.controllerPrevN_img = null), (this.controllerPrevS_img = null), (this.controllerPlayN_img = null), (this.controllerPlayS_img = null), (this.controllerPauseN_img = null), (this.controllerPauseS_img = null), (this.controllerInfoN_img = null), (this.controllerInfoS_img = null), (this.controllerLinkN_img = null), (this.controllerLinkS_img = null), (this.controllerFullScreenNormalN_img = null), (this.controllerFullScreenNormalS_img = null), (this.controllerFullScreenFullN_img = null), (this.controllerFullScreenFullS_img = null), (this.zoomInN_img = null), (this.zoomInS_img = null), (this.zoomOutN_img = null), (this.zoomOutS_img = null), (this.scrollBarHandlerN_img = null), (this.scrollBarHandlerS_img = null), (this.scrollBarLeft_img = null), (this.scrollBarRight_img = null), (this.toolTipLeft_img = null), (this.toolTipPointer_img = null), (this.infoWindowCloseNormal_img = null), (this.infoWindowCloseSelected_img = null), (this.props_obj = e), (this.rootElement_el = null), (this.skinPaths_ar = []), (this.playListData_ar = []), (this.imagesPaths_ar = []), (this.largeImagesPaths_ar = []), (this.navigatorImagesPaths_ar = []), (this.images_ar = []), (this.navigatorImages_ar = []), (this.markersList_ar = []), (this.markersPosition_ar = []), (this.buttons_ar = null), (this.buttonsLabels_ar = null), (this.contextMenuLabels_ar = null), (this.backgroundColor_str = null), (this.handMovePath_str = null), (this.handGrabRotatePath_str = null), (this.handGrabPath_str = null), (this.handGrabRotatePath_str = null), (this.controllerBackgroundMiddlePath_str = null), (this.scrollBarMiddlePath_str = null), (this.startDraggingMode_str = null), (this.controllerVerticalPosition_str = null), (this.preloaderFontColor_str = null), (this.preloaderBackgroundColor_str = null), (this.preloaderText_str = null), (this.buttonToolTipLeft_str = null), (this.buttonToolTipMiddle_str = null), (this.buttonToolTipRight_str = null), (this.buttonToolTipBottomPointer_str = null), (this.buttonToolTipTopPointer_str = null), (this.buttonToolTipFontColor_str = null), (this.link_str = null), (this.contextMenuBackgroundColor_str = null), (this.contextMenuBorderColor_str = null), (this.contextMenuSpacerColor_str = null), (this.contextMenuItemNormalColor_str = null), (this.contextMenuItemSelectedColor_str = null), (this.contextMenuItemSelectedColor_str = null), (this.contextMenuItemDisabledColor_str = null), (this.navigatorPosition_str = null), (this.navigatorHandlerColor_str = null), (this.navigatorBorderColor_str = null), (this.infoText_str = null), (this.infoWindowBackgroundColor_str = null), (this.infoWindowScrollBarColor_str = null), this.dragAndSpinSpeed, this.dragRotationSpeed, this.buttonsRotationSpeed, this.controllerHeight, this.startAtImage, this.imageWidth, this.imageHeight, this.spaceBetweenButtons, this.startSpaceBetweenButtons, this.scrollBarOffsetX, this.zoomFactor, this.controllerOffsetY, this.hideControllerDelay, this.controllerBackgroundOpacity, this.controllerMaxWidth, (this.countLoadedSkinImages = 0), (this.countLoadedImages = 0), this.scrollBarHandlerToolTipOffsetY, this.zoomInAndOutToolTipOffsetY, this.buttonsToolTipOffsetY, this.scrollBarPosition, this.startSpaceForScrollBarButtons, this.totalGraphics, this.slideShowDelay, this.totalImages, this.navigatorWidth, this.navigatorHeight, this.navigatorOffsetX, this.navigatorOffsetY, this.infoWindowBackgroundOpacity, this.markerToolTipOffsetY, this.toolTipWindowMaxWidth, this.lightBoxBackgroundOpacity, this.parseDelayId_to, this.loadImageId_to, this.showContextMenu_bl, this.showLargeImageVersionOnZoom_bl, this.showNavigator_bl, this.addCorrectionForWebKit_bl, this.inverseNextAndPrevRotation_bl, this.useEntireScreenFor3dObject_bl, this.hideController_bl, this.showScriptDeveloper_bl, this.showMarkers_bl, (this.hasNavigatorError_bl = !1), (this.showMarkersInfo_bl = !1), (this.addKeyboardSupport_bl = !1), (this.addDragAndSpinSupport_bl = !1), (this.stopRotationHorizontalAtEnds_bl = !1), (this.slideShowAutoPlay_bl = !1), (this.isMobile_bl = FWDUtils.isMobile), (this.hasPointerEvent_bl = FWDUtils.hasPointerEvent), (this.areAllImagesLoaded_bl = !1), (this.isLigthboxCloseButtonLoaded_bl = !1), (ee.init = function (e) { ee.parseDelayId_to = setTimeout(ee.parseProperties, 100); }), (ee.parseProperties = function () { var e, t, o, n, i, s, r; if (((ee.skinPath_str = ee.props_obj.skinPath), ee.skinPath_str)) { if ((ee.skinPath_str.lastIndexOf("/") + 1 != ee.skinPath_str.length && (ee.skinPath_str += "/"), !ee.props_obj.playListId)) return (n = "playListId property which represents the viewer playlist id is not defined in FWDViewer constructor function!"), void ee.dispatchEvent(te.LOAD_ERROR, { text: n }); if (((ee.rootElement_el = FWDUtils.getChildById(ee.props_obj.playListId)), !ee.rootElement_el)) return (n = "Make sure that the a div with the id - " + ee.props_obj.playListId + " exists, self represents the data playlist."), void ee.dispatchEvent(te.LOAD_ERROR, { text: n }); if ( ((ee.rootElement_el.style.display = "none"), (e = FWDUtils.getChildFromNodeListFromAttribute(ee.rootElement_el, "data-markers")), !(t = FWDUtils.getChildFromNodeListFromAttribute(ee.rootElement_el, "data-paylist"))) ) return ( (n = "Make sure that the an ul tag with the data type attribute - data-paylist is defined, this tag is used for creating the playlist."), void ee.dispatchEvent(te.LOAD_ERROR, { text: n }) ); if ((e && (ee.showMarkers_bl = !0), ee.showMarkers_bl)) { o = FWDUtils.getChildren(e); for (var l = 0; l < o.length; l++) { if (((i = {}), (r = o[l]), !1, "", !FWDUtils.hasAttribute(r, "data-marker-type", l))) return void ee.showMarkerError("data-marker-type", l); if (!FWDUtils.hasAttribute(r, "data-marker-id", l)) return void ee.showMarkerError("data-marker-id", l); if (!FWDUtils.hasAttribute(r, "data-marker-normal-state-path", l)) return void ee.showMarkerError("data-marker-normal-state-path", l); if (!FWDUtils.hasAttribute(r, "data-marker-selected-state-path", l)) return void ee.showMarkerError("data-marker-selected-state-path", l); if (!FWDUtils.hasAttribute(r, "data-marker-width", l)) return void ee.showMarkerError("data-marker-width", l); if (!FWDUtils.hasAttribute(r, "data-marker-height", l)) return void ee.showMarkerError("data-marker-height", l); if (((i.type = FWDUtils.getAttributeValue(r, "data-marker-type")), !(f = "link" == i.type || "tooltip" == i.type || "infowindow" == i.type))) return void ee.showMarkerTypeError(i.type, l); (i.markerId = FWDUtils.trim(FWDUtils.getAttributeValue(r, "data-marker-id"))), (i.normalStatePath_str = FWDUtils.trim(FWDUtils.getAttributeValue(r, "data-marker-normal-state-path"))), (i.selectedStatePath_str = FWDUtils.trim(FWDUtils.getAttributeValue(r, "data-marker-selected-state-path"))), (i.toolTipLabel = FWDUtils.getAttributeValue(r, "data-tool-tip-label") || void 0), (i.markerWidth = parseInt(FWDUtils.getAttributeValue(r, "data-marker-width"))), isNaN(i.markerWidth) && (i.markerWidth = 5), (i.markerHeight = parseInt(FWDUtils.getAttributeValue(r, "data-marker-height"))), isNaN(i.markerHeight) && (i.markerHeight = 5), "link" == i.type ? ((i.link = FWDUtils.getAttributeValue(r, "data-marker-url") || "http://www.link-is-not-defined.com"), (i.target = FWDUtils.getAttributeValue(r, "data-marker-target") || "_blank")) : (i.innerHTML = r.innerHTML), (f = (f = "center" === (f = FWDUtils.getAttributeValue(r, "data-reg-point")) || "centertop" === f || "centerbottom" === f) ? FWDUtils.trim(FWDUtils.getAttributeValue(r, "data-reg-point")).toLowerCase() : "center"), (i.regPoint = f), (i.maxWidth = parseInt(FWDUtils.getAttributeValue(r, "data-marker-window-width"))), isNaN(i.maxWidth) && (i.maxWidth = 200), ee.markersList_ar.push(i); } } if (!FWDUtils.getChildAt(t, 0)) return (n = "The playlist dose not have any chidren
    element."), void ee.dispatchEvent(te.LOAD_ERROR, { text: n }); (ee.showLargeImageVersionOnZoom_bl = ee.props_obj.showLargeImageVersionOnZoom), (ee.showLargeImageVersionOnZoom_bl = "yes" == ee.showLargeImageVersionOnZoom_bl), (ee.dragVertical_bl = "yes" == ee.props_obj.dragVertical), (ee.disableMouseWheelZoom_bl = "yes" == ee.props_obj.disableMouseWheelZoom), (ee.showNavigator_bl = ee.props_obj.showNavigator), (ee.showNavigator_bl = "yes" == ee.showNavigator_bl), (ee.showMarkersInfo_bl = "yes" == ee.props_obj.showMarkersInfo), (ee.addKeyboardSupport_bl = "no" != ee.props_obj.addKeyboardSupport), (ee.stopRotationHorizontalAtEnds_bl = "yes" == ee.props_obj.stopRotationHorizontalAtEnds), (ee.stopRotationVerticalAtEnds_bl = "yes" == ee.props_obj.stopRotationVerticalAtEnds), (ee.addDragAndSpinSupport_bl = "yes" == ee.props_obj.addDragAndSpinSupport), (ee.zoomSpeed = ee.props_obj.zoomSpeed || 0.1), (ee.navigatorWidth = ee.props_obj.navigatorWidth || 120), ee.stopRotationHorizontalAtEnds_bl && (ee.addDragAndSpinSupport_bl = !1), (ee.slideShowAutoPlay_bl = "yes" == ee.props_obj.slideShowAutoPlay), ee.isMobile_bl && (ee.showMarkersInfo_bl = !1); var a = FWDUtils.getChildren(t); (ee.totalMainPlaylists = a.length), (ee.playListData_ar = []); for (var d = 0; d < ee.totalMainPlaylists; d++) { var u = [], h = FWDUtils.getChildren(a[d]), c = h.length; for (l = 0; l < c; l++) { playlistChild = FWDUtils.getChildren(h[l]); for (var _ = 0; _ < playlistChild.length; _++) { (r = playlistChild[_]), 0 == _ && (i = { markersPosition_ar: [] }); for (var f, m = d + 1, p = l + 1, g = 0; g < playlistChild.length; g++) if ((f = FWDUtils.getAttributeValue(playlistChild[g], "data-small-image-path"))) { i.smallImagePath = FWDUtils.trim(FWDUtils.getAttributeValue(playlistChild[g], "data-small-image-path")); break; } if (!f) return void ee.dispatchEvent(te.LOAD_ERROR, { text: "Element with attribute data-small-image-path is not defined in playlist " + m + " at positon " + p + "", }); for (g = 0; g < playlistChild.length; g++) if (ee.showLargeImageVersionOnZoom_bl && (f = FWDUtils.getAttributeValue(playlistChild[g], "data-large-image-path"))) { i.largeImagePath = FWDUtils.trim(FWDUtils.getAttributeValue(playlistChild[g], "data-large-image-path")); break; } if (!f) return void ee.dispatchEvent(te.LOAD_ERROR, { text: "Element with attribute data-large-image-path is not defined in playlist " + m + " at positon " + p + "", }); 0 == _ && (!1, (s = void 0)), FWDUtils.getAttributeValue(playlistChild[_], "data-marker-id") && (!0, ((s = {}).markerId = FWDUtils.trim(FWDUtils.getAttributeValue(playlistChild[_], "data-marker-id"))), (s.x = FWDUtils.getAttributeValue(playlistChild[_], "data-marker-x") || 0), (s.y = FWDUtils.getAttributeValue(playlistChild[_], "data-marker-y") || 0), i.markersPosition_ar.push(s)); } u.push(i); } ee.playListData_ar[d] = u; } if ( ((ee.backgroundColor_str = ee.props_obj.backgroundColor || "transparent"), (ee.preloaderFontColor_str = ee.props_obj.preloaderFontColor || "#000000"), (ee.preloaderBackgroundColor_str = ee.props_obj.preloaderBackgroundColor || "transparent"), (ee.preloaderText_str = ee.props_obj.preloaderText || "Loading:"), (ee.startDraggingMode_str = ee.props_obj.startDraggingMode || "rotate"), "rotate" != ee.startDraggingMode_str && "pan" != ee.startDraggingMode_str && (ee.startDraggingMode_str = "rotate"), (ee.controllerVerticalPosition_str = ee.props_obj.controllerVerticalPosition || "bottom"), "top" != ee.controllerVerticalPosition_str && "bottom" != ee.controllerVerticalPosition_str && (ee.startDraggingMode_str = "top"), (ee.controllerHorizontalPosition_str = ee.props_obj.controllerHorizontalPosition || "center"), void 0 === ee.props_obj.buttons) ) return (n = "The buttons is not defined in the contructor, this is necessary to setup the main buttons."), ee.dispatchEvent(te.LOAD_ERROR, { text: n }), void console.log(n); if ( (0 < ee.props_obj.buttons.length ? (ee.buttons_ar = FWDUtils.splitAndTrim(ee.props_obj.buttons, !0)) : (ee.buttons_ar = []), ee.isMobile_bl && !ee.hasPointerEvent_bl ? ((ee.buttonsLabels_ar = null), (ee.contextMenuLabels_ar = null)) : (ee.props_obj.buttonsToolTips && (ee.buttonsLabels_ar = FWDUtils.splitAndTrim(ee.props_obj.buttonsToolTips, !1)), ee.props_obj.contextMenuLabels && (ee.contextMenuLabels_ar = FWDUtils.splitAndTrim(ee.props_obj.contextMenuLabels, !1))), (ee.showScriptDeveloper_bl = ee.props_obj.showScriptDeveloper), (ee.showScriptDeveloper_bl = "no" != ee.showScriptDeveloper_bl), (ee.dragRotationSpeed = ee.props_obj.dragRotationSpeed || 0.5), isNaN(ee.dragRotationSpeed) && (ee.dragRotationSpeed = 0.5), ee.dragRotationSpeed < 0 ? (ee.dragRotationSpeed = 0) : 1 < ee.dragRotationSpeed && (ee.dragRotationSpeed = 1), (ee.dragAndSpinSpeed = ee.props_obj.dragAndSpinSpeed || 0.4), isNaN(ee.dragAndSpinSpeed) && (ee.dragAndSpinSpeed = 0.4), ee.dragRotationSpeed < 0.1 ? (ee.dragRotationSpeed = 0.1) : 1 < ee.dragRotationSpeed && (ee.dragRotationSpeed = 1), (ee.buttonsRotationSpeed = ee.props_obj.buttonsRotationSpeed || 500), isNaN(ee.buttonsRotationSpeed) && (ee.buttonsRotationSpeed = 500), ee.buttonsRotationSpeed < 200 ? (ee.buttonsRotationSpeed = 200) : 2e3 < ee.buttonsRotationSpeed && (ee.buttonsRotationSpeed = 2e3), (ee.imageWidth = ee.props_obj.imageWidth), ee.imageWidth) ) if (((ee.imageHeight = ee.props_obj.imageHeight), ee.imageHeight)) if (((ee.zoomFactor = ee.props_obj.zoomFactor), ee.zoomFactor)) { ee.zoomFactor < 1 ? (ee.zoomFactor = 1) : 4 < ee.zoomFactor && (ee.zoomFactor = 4), (ee.navigatorOffsetX = ee.props_obj.navigatorOffsetX || 0), isNaN(ee.navigatorOffsetX) && (ee.navigatorOffsetX = 0), (ee.navigatorOffsetY = ee.props_obj.navigatorOffsetY || 0), isNaN(ee.navigatorOffsetY) && (ee.navigatorOffsetY = 0), (ee.controllerBackgroundOpacity = ee.props_obj.controllerBackgroundOpacity), null == ee.controllerBackgroundOpacity && (ee.controllerBackgroundOpacity = 1), isNaN(ee.controllerBackgroundOpacity) && (ee.controllerBackgroundOpacity = 1), ee.controllerBackgroundOpacity <= 0 ? (ee.controllerBackgroundOpacity = 0) : 1 < ee.controllerBackgroundOpacity && (ee.controllerBackgroundOpacity = 1), (ee.controllerMaxWidth = ee.props_obj.controllerMaxWidth), ee.controllerMaxWidth || (ee.controllerMaxWidth = 900), isNaN(ee.controllerMaxWidth) && (ee.controllerMaxWidth = 900), ee.controllerMaxWidth < 200 && (ee.controllerMaxWidth = 200), (ee.hideControllerDelay = ee.props_obj.hideControllerDelay), ee.hideControllerDelay && ((ee.hideController_bl = !0), isNaN(ee.hideControllerDelay) ? (ee.hideControllerDelay = 4e3) : ee.hideControllerDelay < 0 ? (ee.hideControllerDelay = 4e3) : (ee.hideControllerDelay *= 1e3)), (ee.spaceBetweenButtons = ee.props_obj.spaceBetweenButtons || 0), (ee.scrollBarPosition = ee.props_obj.scrollBarPosition || 0), (ee.startSpaceForScrollBarButtons = ee.props_obj.startSpaceForScrollBarButtons || 0), (ee.startSpaceBetweenButtons = ee.props_obj.startSpaceBetweenButtons || 0), (ee.startSpaceForScrollBar = ee.props_obj.startSpaceForScrollBar || 0), (ee.scrollBarOffsetX = ee.props_obj.scrollBarOffsetX || 0), (ee.controllerOffsetY = ee.props_obj.controllerOffsetY || 0), (ee.controllerOffsetX = ee.props_obj.controllerOffsetX || 0), (ee.scrollBarHandlerToolTipOffsetY = ee.props_obj.scrollBarHandlerToolTipOffsetY || 0), (ee.zoomInAndOutToolTipOffsetY = ee.props_obj.zoomInAndOutToolTipOffsetY || 0), (ee.buttonsToolTipOffsetY = ee.props_obj.buttonsToolTipOffsetY || 0), (ee.infoWindowBackgroundOpacity = ee.props_obj.infoWindowBackgroundOpacity || 1), (ee.markerToolTipOffsetY = ee.props_obj.markerToolTipOffsetY || 1), (ee.toolTipWindowMaxWidth = ee.props_obj.toolTipWindowMaxWidth || 300), (ee.buttonToolTipFontColor_str = ee.props_obj.buttonToolTipFontColor || "#000000"), (ee.link_str = ee.props_obj.link || "http://www.link-is-not-defined.com!"), (ee.contextMenuBackgroundColor_str = ee.props_obj.contextMenuBackgroundColor || "#000000"), (ee.contextMenuBorderColor_str = ee.props_obj.contextMenuBorderColor || "#FF0000"), (ee.contextMenuSpacerColor_str = ee.props_obj.contextMenuSpacerColor || "#FF0000"), (ee.contextMenuItemNormalColor_str = ee.props_obj.contextMenuItemNormalColor || "#FF0000"), (ee.contextMenuItemSelectedColor_str = ee.props_obj.contextMenuItemSelectedColor || "#FF0000"), (ee.contextMenuItemDisabledColor_str = ee.props_obj.contextMenuItemDisabledColor || "#FF0000"), (ee.infoWindowBackgroundColor_str = ee.props_obj.infoWindowBackgroundColor || "#FF0000"), (ee.infoWindowScrollBarColor_str = ee.props_obj.infoWindowScrollBarColor || "#FF0000"), (ee.navigatorPosition_str = ee.props_obj.navigatorPosition || "topleft"), (ee.navigatorPosition_str = String(ee.navigatorPosition_str).toLowerCase()), (f = "topleft" == ee.navigatorPosition_str || "topright" == ee.navigatorPosition_str || "bottomleft" == ee.navigatorPosition_str || "bottomright" == ee.navigatorPosition_str) || (ee.navigatorPosition_str = "topleft"), (ee.navigatorHandlerColor_str = ee.props_obj.navigatorHandlerColor || "#FF0000"), (ee.navigatorBorderColor_str = ee.props_obj.navigatorBorderColor || "#FF0000"), (ee.slideShowDelay = ee.props_obj.slideShowDelay || 100), ee.slideShowDelay < 100 && (ee.slideShowDelay = 100), (ee.showContextMenu_bl = ee.props_obj.showContextMenu), (ee.showContextMenu_bl = "no" != ee.showContextMenu_bl), (ee.inverseNextAndPrevRotation_bl = ee.props_obj.inverseNextAndPrevRotation), (ee.inverseNextAndPrevRotation_bl = "yes" == ee.inverseNextAndPrevRotation_bl), (ee.addCorrectionForWebKit_bl = ee.props_obj.addCorrectionForWebKit), (ee.addCorrectionForWebKit_bl = "yes" == ee.addCorrectionForWebKit_bl), (FWDUtils.isChrome && !ee.hasTouch_bl) || (ee.addCorrectionForWebKit_bl = !1), (ee.useEntireScreenFor3dObject_bl = ee.props_obj.useEntireScreenFor3dObject), (ee.useEntireScreenFor3dObject_bl = "yes" == ee.useEntireScreenFor3dObject_bl), (ee.infoText_str = FWDUtils.getChildFromNodeListFromAttribute(ee.rootElement_el, "data-info")), ee.infoText_str ? (ee.infoText_str = ee.infoText_str.innerHTML) : (ee.infoText_str = "not defined make sure that an ul element with the attribute data-info is defined!"), (ee.handMovePath_str = ee.skinPath_str + "skin/handmove.cur"), (ee.handGrabRotatePath_str = ee.skinPath_str + "skin/handrotate.cur"), (ee.handGrabRotateVerticalPath_str = ee.skinPath_str + "skin/handrotatetop.cur"), (ee.handGrabPath_str = ee.skinPath_str + "skin/handgrab.cur"); var v = ee.skinPath_str + "skin/preloader.png", b = ee.skinPath_str + "skin/close-icon.png", T = ee.skinPath_str + "skin/close-icon-rollover.png", w = ee.skinPath_str + "skin/bg-bar-left.png", y = ee.skinPath_str + "skin/bg-bar-right.png", S = ee.skinPath_str + "skin/move-icon.png", O = ee.skinPath_str + "skin/move-icon-rollover.png", B = ee.skinPath_str + "skin/rotate-icon.png", D = ee.skinPath_str + "skin/rotate-icon-rollover.png", W = ee.skinPath_str + "skin/right-icon.png", H = ee.skinPath_str + "skin/right-icon-rollover.png", M = ee.skinPath_str + "skin/left-icon.png", E = ee.skinPath_str + "skin/left-icon-rollover.png", P = ee.skinPath_str + "skin/play-icon.png", x = ee.skinPath_str + "skin/play-icon-rollover.png", I = ee.skinPath_str + "skin/pause-icon.png", F = ee.skinPath_str + "skin/pause-icon-rollover.png", C = ee.skinPath_str + "skin/info-icon.png", L = ee.skinPath_str + "skin/info-icon-rollover.png", k = ee.skinPath_str + "skin/link-icon.png", A = ee.skinPath_str + "skin/link-icon-rollover.png", R = ee.skinPath_str + "skin/fullscr-normal-icon.png", N = ee.skinPath_str + "skin/fullscr-normal-icon-rollover.png", z = ee.skinPath_str + "skin/fullscr-full-icon.png", U = ee.skinPath_str + "skin/fullscr-full-icon-rollover.png", Y = ee.skinPath_str + "skin/zoomin.png", X = ee.skinPath_str + "skin/zoomin-rollover.png", V = ee.skinPath_str + "skin/zoomout.png", j = ee.skinPath_str + "skin/zoomout-rollover.png", G = ee.skinPath_str + "skin/handler.png", Z = ee.skinPath_str + "skin/handler-rollover.png", K = ee.skinPath_str + "skin/scrool-left.png", q = ee.skinPath_str + "skin/scrool-right.png"; (ee.scrollBarMiddlePath_str = ee.skinPath_str + "skin/scrool-middle.png"), (ee.controllerBackgroundMiddlePath_str = ee.skinPath_str + "skin/bg-bar-middle.png"), (ee.buttonToolTipLeft_str = ee.skinPath_str + "skin/button-tool-tip-left.png"), (ee.buttonToolTipMiddle_str = ee.skinPath_str + "skin/button-tool-tip-middle.png"), (ee.buttonToolTipRight_str = ee.skinPath_str + "skin/button-tool-tip-right.png"), (ee.buttonToolTipBottomPointer_str = ee.skinPath_str + "skin/button-tool-tip-down-pointer.png"), (ee.buttonToolTipTopPointer_str = ee.skinPath_str + "skin/button-tool-tip-top-pointer.png"); var Q = ee.skinPath_str + "skin/close-icon.png", $ = ee.skinPath_str + "skin/close-icon-rollover.png"; (ee.mainPreloader_img = new Image()), (ee.mainPreloader_img.onerror = ee.onSkinLoadErrorHandler), (ee.mainPreloader_img.onload = ee.onPreloaderLoadHandler), (ee.mainPreloader_img.src = v), (ee.skinPaths_ar = [ { img: (ee.mainLightboxCloseButtonN_img = new Image()), src: b }, { img: (ee.mainLightboxCloseButtonS_img = new Image()), src: T }, { img: (ee.controllerBackgroundLeft_img = new Image()), src: w }, { img: (ee.controllerBackgroundRight_img = new Image()), src: y }, { img: (ee.toolTipPointer_img = new Image()), src: ee.buttonToolTipTopPointer_str }, { img: (ee.toolTipLeft_img = new Image()), src: ee.buttonToolTipLeft_str }, ]); for (l = 0; l < ee.buttons_ar.length; l++) "rotate" == ee.buttons_ar[l] && (ee.skinPaths_ar.push({ img: (ee.controllerRotateN_img = new Image()), src: B }), ee.skinPaths_ar.push({ img: (ee.controllerRotateS_img = new Image()), src: D })), "pan" == ee.buttons_ar[l] && (ee.skinPaths_ar.push({ img: (ee.controllerPanN_img = new Image()), src: S }), ee.skinPaths_ar.push({ img: (ee.controllerPanS_img = new Image()), src: O })), "roteteleft" == ee.buttons_ar[l] && (ee.skinPaths_ar.push({ img: (ee.controllerPrevN_img = new Image()), src: M }), ee.skinPaths_ar.push({ img: (ee.controllerPrevS_img = new Image()), src: E })), "rotateright" == ee.buttons_ar[l] && (ee.skinPaths_ar.push({ img: (ee.controllerNextN_img = new Image()), src: W }), ee.skinPaths_ar.push({ img: (ee.controllerNextS_img = new Image()), src: H })), "scrollbar" == ee.buttons_ar[l] && (ee.skinPaths_ar.push({ img: (ee.scrollBarHandlerN_img = new Image()), src: G }), ee.skinPaths_ar.push({ img: (ee.scrollBarHandlerS_img = new Image()), src: Z }), ee.skinPaths_ar.push({ img: (ee.scrollBarLeft_img = new Image()), src: K }), ee.skinPaths_ar.push({ img: (ee.scrollBarRight_img = new Image()), src: q }), ee.skinPaths_ar.push({ img: (ee.zoomInN_img = new Image()), src: Y }), ee.skinPaths_ar.push({ img: (ee.zoomInS_img = new Image()), src: X }), ee.skinPaths_ar.push({ img: (ee.zoomOutN_img = new Image()), src: V }), ee.skinPaths_ar.push({ img: (ee.zoomOutS_img = new Image()), src: j })), "play" == ee.buttons_ar[l] && (ee.skinPaths_ar.push({ img: (ee.controllerPlayN_img = new Image()), src: P }), ee.skinPaths_ar.push({ img: (ee.controllerPlayS_img = new Image()), src: x }), ee.skinPaths_ar.push({ img: (ee.controllerPauseN_img = new Image()), src: I }), ee.skinPaths_ar.push({ img: (ee.controllerPauseS_img = new Image()), src: F })), "info" == ee.buttons_ar[l] && (ee.skinPaths_ar.push({ img: (ee.controllerInfoN_img = new Image()), src: C }), ee.skinPaths_ar.push({ img: (ee.controllerInfoS_img = new Image()), src: L }), ee.skinPaths_ar.push({ img: (ee.infoWindowCloseNormal_img = new Image()), src: Q }), ee.skinPaths_ar.push({ img: (ee.infoWindowCloseSelected_img = new Image()), src: $ })), "link" == ee.buttons_ar[l] && (ee.skinPaths_ar.push({ img: (ee.controllerLinkN_img = new Image()), src: k }), ee.skinPaths_ar.push({ img: (ee.controllerLinkS_img = new Image()), src: A })), "fullscreen" == ee.buttons_ar[l] && (ee.skinPaths_ar.push({ img: (ee.controllerFullScreenNormalN_img = new Image()), src: R }), ee.skinPaths_ar.push({ img: (ee.controllerFullScreenNormalS_img = new Image()), src: N }), ee.skinPaths_ar.push({ img: (ee.controllerFullScreenFullN_img = new Image()), src: z }), ee.skinPaths_ar.push({ img: (ee.controllerFullScreenFullS_img = new Image()), src: U })); ee.totalGraphics = ee.skinPaths_ar.length; for (l = 0; l < ee.playListData_ar.length; l++) for (var J = 0; J < ee.playListData_ar[l].length; J++) ee.imagesPaths_ar.push(ee.playListData_ar[l][J].smallImagePath); (ee.totalImages = ee.imagesPaths_ar.length), (ee.startAtImage = ee.props_obj.startAtImage || 0), ee.startAtImage < 0 ? (ee.staetAtImage = 0) : ee.startAtImage > ee.playListData_ar[0].length - 1 && (ee.startAtImage = ee.playListData_ar[0].length - 1), (ee.startAtSet = ee.props_obj.startAtSet || 0), ee.startAtSet < 0 ? (ee.startAtSet = 0) : ee.startAtSet > ee.playListData_ar.length - 1 && (ee.startAtSet = ee.playListData_ar.length - 1), 1 < ee.playListData_ar.length && (ee.dragInAllDirection_bl = !0); } else ee.showPropertyError("zoomFactor"); else ee.showPropertyError("imageHeight"); else ee.showPropertyError("imageWidth"); } else setTimeout(function () { null != ee && ((n = "The skinPath property is not defined in the constructor function!"), ee.dispatchEvent(te.LOAD_ERROR, { text: n })); }, 50); }), (this.onPreloaderLoadHandler = function () { setTimeout(function () { null != ee && (ee.dispatchEvent(te.PRELOADER_LOAD_DONE), ee.loadSkin()); }, 50); }), (ee.loadSkin = function () { for (var e, t, o = 0; o < ee.totalGraphics; o++) (e = ee.skinPaths_ar[o].img), (t = ee.skinPaths_ar[o].src), (e.onload = ee.onSkinLoadHandler), (e.onerror = ee.onSkinLoadErrorHandler), (e.src = t); }), (this.onSkinLoadHandler = function (e) { ee.mainLightboxCloseButtonS_img && !ee.isLigthboxCloseButtonLoaded_bl && (ee.dispatchEvent(te.LIGHBOX_CLOSE_BUTTON_LOADED), (ee.isLigthboxCloseButtonLoaded_bl = !0)), ee.controllerBackgroundLeft_img && !ee.controllerHeight && (ee.controllerHeight = ee.controllerBackgroundLeft_img.height), ee.countLoadedSkinImages++, ee.countLoadedSkinImages == ee.totalGraphics && setTimeout(function () { null != ee && (ee.dispatchEvent(te.LOAD_DONE), ee.loadImages()); }, 50), ee.dispatchEvent(te.SKIN_PROGRESS, { percent: ee.countLoadedSkinImages / ee.totalGraphics }); }), (ee.onSkinLoadErrorHandler = function (e) { if (null != ee) { FWDUtils.isIEAndLessThen9 ? (message = "Graphics image not found!") : (message = "The skin icon with label " + e.target.src + " can't be loaded, check path!"), o.console && console.log(e); var t = { text: message }; setTimeout(function () { ee.dispatchEvent(te.LOAD_ERROR, t); }, 50); } }), (ee.stopToLoad = function () { clearTimeout(ee.loadImageId_to); for (var e = 0; e < ee.totalGraphics; e++) (img = ee.skinPaths_ar[e].img), (img.onload = null), (img.onerror = null), (img = null); (ee.skinPaths_ar = null), ee.image_img && ((ee.image_img.onload = null), (ee.image_img.onerror = null), (ee.image_img.src = "")); }), (ee.loadImages = function () { ee.image_img && ((ee.image_img.onload = null), (ee.image_img.onerror = null)); var e = ee.imagesPaths_ar[ee.countLoadedImages]; (ee.image_img = new Image()), (ee.image_img.onload = ee.onImageLoadHandler), (ee.image_img.onerror = ee.onImageLoadErrorHandler), (ee.image_img.src = e); }), (ee.onImageLoadHandler = function (e) { 0 == ee.countLoadedImages && ee.dispatchEvent(te.FIRST_IMAGE_LOAD_COMPLETE), ee.images_ar.push(ee.image_img), ee.dispatchEvent(te.IMAGE_LOADED, { id: ee.countLoadedImages }), ee.dispatchEvent(te.IMAGES_PROGRESS, { percent: ee.countLoadedImages / ee.totalImages }), ee.countLoadedImages++, ee.countLoadedImages < ee.totalImages ? ee.loadImages() : ((ee.areAllImagesLoaded_bl = !0), ee.dispatchEvent(te.IMAGES_PROGRESS, { percent: ee.countLoadedImages / ee.totalImages }), ee.dispatchEvent(te.IMAGES_LOAD_COMPLETE)); }), (ee.onLastNavigatorImageLoadHandler = function (e) { null != ee && ((ee.areAllImagesLoaded_bl = !0), ee.dispatchEvent(te.IMAGES_PROGRESS, { percent: ee.countLoadedImages / ee.totalImages }), ee.dispatchEvent(te.IMAGES_LOAD_COMPLETE)); }), (ee.onNavigatorImageLoadErrorHandler = function (e) { var t = "The navigator image with the label " + ee.navigatorImagesPaths_ar[ee.countLoadedImages] + " can't be loaded, make sure that the image exists and the path is correct!"; ee.hasNavigatorError_bl = !0; var o = { text: t }; ee.dispatchEvent(te.LOAD_ERROR, o), console.log(e); }), (ee.onImageLoadErrorHandler = function (e) { var t = "The image with the label " + ee.imagesPaths_ar[ee.countLoadedImages] + " can't be loaded, make sure that the image exists and the path is correct!"; console.log(e); var o = { text: t }; ee.dispatchEvent(te.LOAD_ERROR, o); }), (ee.checkForAttribute = function (e, t, o) { var n = FWDUtils.getChildFromNodeListFromAttribute(e, t); if ((n = n ? FWDUtils.trim(FWDUtils.getAttributeValue(n, t)) : void 0)) return n; null != o ? ee.dispatchEvent(te.LOAD_ERROR, { text: "Element with attribute " + t + " is not defined at positon " + (o + 1) + "" }) : ee.dispatchEvent(te.LOAD_ERROR, { text: "Element with attribute " + t + " is not defined." }); }), (ee.showPropertyError = function (e) { ee.dispatchEvent(te.LOAD_ERROR, { text: "The property called " + e + " is not defined." }); }), (ee.showMarkerError = function (e, t) { ee.dispatchEvent(te.LOAD_ERROR, { text: "The marker at position " + t + " dose not have defined an attribute " + e + "." }); }), (ee.showMarkerTypeError = function (e, t) { ee.dispatchEvent(te.LOAD_ERROR, { text: "Marker type is incorrect " + e + " at position " + t + ". Accepted types are link, tooltip, infowindow.", }); }), (ee.destroy = function () { var e, t; clearTimeout(ee.parseDelayId_to), clearTimeout(ee.loadImageId_to), ee.image_img && ((ee.image_img.onload = null), (ee.image_img.onerror = null), (ee.image_img.src = "")), ee.navigatorImage_img && ((ee.navigatorImage_img.onload = null), (ee.navigatorImage_img.onerror = null), (ee.navigatorImage_img.src = "")), (e = ee.images_ar.length); for (var o = 0; o < e; o++) ((t = ee.images_ar[o]).onerror = null), (t.onload = null), (t.src = ""), (t = null); e = ee.navigatorImages_ar.length; for (o = 0; o < e; o++) ((t = ee.navigatorImages_ar[o]).onerror = null), (t.onload = null), (t.src = ""), (t = null); ee.mainPreloader_img && (ee.mainPreloader_img.src = ""), ee.mainLightboxCloseButtonN_img && (ee.mainLightboxCloseButtonN_img.src = ""), ee.mainLightboxCloseButtonS_img && (ee.mainLightboxCloseButtonS_img.src = ""), ee.controllerBackgroundLeft_img && (ee.controllerBackgroundLeft_img.src = ""), ee.controllerBackgroundRight_img && (ee.controllerBackgroundRight_img.src = ""), ee.controllerPanN_img && (ee.controllerPanN_img.src = ""), ee.controllerPanS_img && (ee.controllerPanS_img.src = ""), ee.controllerRotateN_img && (ee.controllerRotateN_img.src = ""), ee.controllerRotateS_img && (ee.controllerRotateS_img.src = ""), ee.controllerNextN_img && (ee.controllerNextN_img.src = ""), ee.controllerNextS_img && (ee.controllerNextS_img.src = ""), ee.controllerPrevN_img && (ee.controllerPrevN_img.src = ""), ee.controllerPrevS_img && (ee.controllerPrevS_img.src = ""), ee.controllerPlayN_img && (ee.controllerPlayN_img.src = ""), ee.controllerPlayS_img && (ee.controllerPlayS_img.src = ""), ee.controllerPauseN_img && (ee.controllerPauseN_img.src = ""), ee.controllerPauseS_img && (ee.controllerPauseS_img.src = ""), ee.controllerInfoN_img && (ee.controllerInfoN_img.src = ""), ee.controllerLinkN_img && (ee.controllerLinkN_img.src = ""), ee.controllerLinkS_img && (ee.controllerLinkS_img.src = ""), ee.controllerFullScreenNormalN_img && (ee.controllerFullScreenNormalN_img.src = ""), ee.controllerFullScreenNormalS_img && (ee.controllerFullScreenNormalS_img.src = ""), ee.controllerFullScreenFullN_img && (ee.controllerFullScreenFullN_img.src = ""), ee.controllerFullScreenFullS_img && (ee.controllerFullScreenFullS_img.src = ""), ee.zoomInN_img && (ee.zoomInN_img.src = ""), ee.zoomInS_img && (ee.zoomInS_img.src = ""), ee.zoomOutN_img && (ee.zoomOutN_img.src = ""), ee.zoomOutS_img && (ee.zoomOutS_img.src = ""), ee.scrollBarHandlerN_img && (ee.scrollBarHandlerN_img.src = ""), ee.scrollBarHandlerN_img && (ee.scrollBarHandlerN_img.src = ""), ee.scrollBarHandlerS_img && (ee.scrollBarHandlerS_img.src = ""), ee.scrollBarLeft_img && (ee.scrollBarLeft_img.src = ""), ee.scrollBarLeft_img && (ee.scrollBarLeft_img.src = ""), ee.scrollBarRight_img && (ee.scrollBarRight_img.src = ""), ee.toolTipLeft_img && (ee.toolTipLeft_img.src = ""), ee.toolTipPointer_img && (ee.toolTipPointer_img.src = ""), ee.infoWindowCloseNormal_img && (ee.infoWindowCloseNormal_img.src = ""), ee.infoWindowCloseSelected_img && (ee.infoWindowCloseSelected_img.src = ""), (ee.mainPreloader_img = null), (ee.mainLightboxCloseButtonN_img = null), (ee.mainLightboxCloseButtonS_img = null), (ee.controllerBackgroundLeft_img = null), (ee.controllerBackgroundRight_img = null), (ee.controllerPanN_img = null), (ee.controllerPanS_img = null), (ee.controllerRotateN_img = null), (ee.controllerRotateS_img = null), (ee.controllerNextN_img = null), (ee.controllerNextS_img = null), (ee.controllerPrevN_img = null), (ee.controllerPrevS_img = null), (ee.controllerPlayN_img = null), (ee.controllerPlayS_img = null), (ee.controllerPauseN_img = null), (ee.controllerPauseS_img = null), (ee.controllerInfoN_img = null), (ee.controllerInfoS_img = null), (ee.controllerLinkN_img = null), (ee.controllerLinkS_img = null), (ee.controllerFullScreenNormalN_img = null), (ee.controllerFullScreenNormalS_img = null), (ee.controllerFullScreenFullN_img = null), (ee.controllerFullScreenFullS_img = null), (ee.zoomInN_img = null), (ee.zoomInS_img = null), (ee.zoomOutN_img = null), (ee.zoomOutS_img = null), (ee.scrollBarHandlerN_img = null), (ee.scrollBarHandlerS_img = null), (ee.scrollBarLeft_img = null), (ee.scrollBarRight_img = null), (ee.toolTipLeft_img = null), (ee.toolTipPointer_img = null), (ee.infoWindowCloseNormal_img = null), (ee.infoWindowCloseSelected_img = null), (this.props_obj = null), (this.rootElement_el = null), (this.skinPaths_ar = null), (this.playListData_ar = null), (this.imagesPaths_ar = null), (this.largeImagesPaths_ar = null), (this.navigatorImagesPaths_ar = null), (this.images_ar = null), (this.navigatorImages_ar = null), (this.markersList_ar = null), (this.markersPosition_ar = null), (this.buttons_ar = null), (this.buttonsLabels_ar = null), (this.contextMenuLabels_ar = null), (this.backgroundColor_str = null), (this.handMovePath_str = null), (this.handGrabRotatePath_str = null), (this.controllerBackgroundMiddlePath_str = null), (this.scrollBarMiddlePath_str = null), (this.startDraggingMode_str = null), (this.controllerVerticalPosition_str = null), (this.preloaderFontColor_str = null), (this.preloaderBackgroundColor_str = null), (this.preloaderText_str = null), (this.buttonToolTipLeft_str = null), (this.buttonToolTipMiddle_str = null), (this.buttonToolTipRight_str = null), (this.buttonToolTipBottomPointer_str = null), (this.buttonToolTipTopPointer_str = null), (this.buttonToolTipFontColor_str = null), (this.link_str = null), (this.contextMenuBackgroundColor_str = null), (this.contextMenuBorderColor_str = null), (this.contextMenuSpacerColor_str = null), (this.contextMenuItemNormalColor_str = null), (this.contextMenuItemSelectedColor_str = null), (this.contextMenuItemSelectedColor_str = null), (this.contextMenuItemDisabledColor_str = null), (this.navigatorPosition_str = null), (this.navigatorHandlerColor_str = null), (this.navigatorBorderColor_str = null), (this.infoText_str = null), (this.infoWindowBackgroundColor_str = null), (this.infoWindowScrollBarColor_str = null), n.destroy(), (n = ee = null), (te.prototype = null); }), ee.init(); }; (te.setPrototype = function () { te.prototype = new FWDEventDispatcher(); }), (te.prototype = null), (te.PRELOADER_LOAD_DONE = "onPreloaderLoadDone"), (te.LOAD_DONE = "onLoadDone"), (te.LOAD_ERROR = "onLoadError"), (te.LIGHBOX_CLOSE_BUTTON_LOADED = "onLightBoxCloseButtonLoadDone"), (te.IMAGE_LOADED = "onImageLoaded"), (te.FIRST_IMAGE_LOAD_COMPLETE = "onFirstImageLoadComplete"), (te.IMAGES_LOAD_COMPLETE = "onImagesLoadComplete"), (te.SKIN_PROGRESS = "onSkinProgress"), (te.IMAGES_PROGRESS = "onImagesPogress"), (te.hasTouch_bl = !1), (o.FWDData = te); })(window), (function (i) { var s = function (e, t) { var n = this, o = s.prototype; (this.infoWindowCloseNormal_img = t.infoWindowCloseNormal_img), (this.infoWindowCloseSelected_img = t.infoWindowCloseSelected_img), n.infoWindowCloseNormal_img && ((this.close_do = null), (this.background_sdo = null), (this.mainContentHolder_do = null), (this.dumyHolder_do = null), (this.contentHolder_sdo = null), (this.scrollBar_do = null), (this.scrollBarTrack_sdo = null), (this.scrollBarHandler_sdo = null), (this.mainBackgroundColor_str = t.infoWindowBackgroundColor_str), (this.scrollBarHandlerColor = t.infoWindowScrollBarColor_str), (this.scrollBarTrackColor = t.infoWindowScrollBarColor_str), (this.scrollBarTrackOpacity = 0.6), (this.toolTipWindowId = "none"), (this.backgroundOpacity = t.infoWindowBackgroundOpacity), this.mainContentHolderWidth, this.mainContentHolderHeight, this.contentHolderHeight, this.scrollBarHandlerFinalY, (this.mainContentFinalX = 0), (this.mainContentFinalY = 0), (this.contentFinalX = 0), (this.contentFinalY = 0), (this.headerFinalY = 0), this.contentHeight, (this.maxWidth = 800), (this.offestWidth = 20), (this.offsetHeight = 20), this.stageWidth, this.stageHeight, (this.scrollBarHeight = 0), (this.scrollBarWidth = 4), this.scrollBarHandlerHeight, (this.scrollBarBorderRadius = 15), this.yPositionOnPress, this.lastPresedY, (this.closeButtonWidth = n.infoWindowCloseNormal_img.width), (this.closeButtonHeight = n.infoWindowCloseNormal_img.height), (this.vy = 0), (this.vy2 = 0), (this.friction = 0.9), this.hideWithDelayId_do, this.showOrHideWithDelayId_to, this.hideCompleteId_to, this.updateMobileScrollBarId_int, (this.isShowed_bl = !0), (this.isDragging_bl = !1), (this.allowToScroll_bl = !0), (this.isMobile_bl = FWDUtils.isMobile), (this.hasPointerEvent_bl = FWDUtils.hasPointerEvent), (n.init = function () { n.setOverflow("visible"), n.setBackfaceVisibility(), n.setupMainContainers(), n.isMobile_bl ? n.setupMobileScrollbar() : (n.setupPCScrollBar(), n.addMouseWheelSupport()), n.setupCloseButton(), n.hide(!1); }), (n.resizeAndPosition = function () { (n.stageWidth == e.stageWidth && n.stageHeight == e.stageHeight) || ((n.stageWidth = e.stageWidth), (n.stageHeight = e.stageHeight), n.background_sdo.setWidth(n.stageWidth), n.background_sdo.setHeight(n.stageHeight), n.updateSize()); }), (n.setupMainContainers = function () { (n.background_sdo = new FWDSimpleDisplayObject("div")), n.background_sdo.setBkColor(n.mainBackgroundColor_str), n.addChild(n.background_sdo), (n.mainContentHolder_do = new FWDDisplayObject("div")), n.mainContentHolder_do.setBackfaceVisibility(), (n.dumyHolder_do = new FWDDisplayObject("div")), n.dumyHolder_do.setBackfaceVisibility(), n.addChild(n.dumyHolder_do), n.dumyHolder_do.addChild(n.mainContentHolder_do), (n.contentHolder_sdo = new FWDSimpleDisplayObject("div")), (n.contentHolder_sdo.getStyle().fontSmoothing = "antialiased"), (n.contentHolder_sdo.getStyle().webkitFontSmoothing = "antialiased"), (n.contentHolder_sdo.getStyle().textRendering = "optimizeLegibility"), FWDUtils.isMobile || ((n.contentHolder_sdo.hasTransform3d_bl = !1), (n.contentHolder_sdo.hasTransform2d_bl = !1)), n.contentHolder_sdo.setBackfaceVisibility(), n.mainContentHolder_do.addChild(n.contentHolder_sdo); }), (n.setupCloseButton = function () { FWDSimpleButton.setPrototype(), (n.close_do = new FWDSimpleButton(n.infoWindowCloseNormal_img, n.infoWindowCloseSelected_img)), n.close_do.addListener(FWDSimpleButton.MOUSE_DOWN, n.closeButtonStartHandler), n.mainContentHolder_do.addChild(n.close_do); }), (n.closeButtonStartHandler = function (e) { n.isShowed_bl && n.hide(!0); }), (n.updateSize = function () { (n.mainContentHolderWidth = n.stageWidth - n.offestWidth), n.mainContentHolderWidth > n.maxWidth && (n.mainContentHolderWidth = n.maxWidth), n.mainContentHolder_do.setWidth(n.mainContentHolderWidth), n.dumyHolder_do.setWidth(n.stageWidth), n.dumyHolder_do.setHeight(n.stageHeight), n.close_do.setX(n.mainContentHolderWidth - n.closeButtonWidth), n.isMobile_bl ? setTimeout(function () { null != n && (FWDAnimation.killTweensOf(n.mainContentHolder_do), (n.contentHolderHeight = n.contentHolder_sdo.getHeight()), (n.mainContentHolderHeight = Math.min(n.stageHeight, n.contentHolderHeight)), (n.mainContentFinalX = Math.round((n.stageWidth - n.mainContentHolderWidth) / 2)), n.stageHeight > n.contentHolderHeight ? ((n.mainContentFinalY = Math.round((n.stageHeight - n.contentHolderHeight) / 2)), (n.allowToScroll_bl = !1)) : ((n.mainContentFinalY = 0), (n.allowToScroll_bl = !0)), n.updateMobileScrollBarWithoutAnimation(), FWDAnimation.killTweensOf(n.mainContentHolder_do), n.mainContentHolder_do.setX(n.mainContentFinalX), n.mainContentHolder_do.setY(n.mainContentFinalY), n.mainContentHolder_do.setHeight(n.mainContentHolderHeight)); }, 50) : setTimeout(function () { null != n && (FWDAnimation.killTweensOf(n.mainContentHolder_do), (n.contentHolderHeight = n.contentHolder_sdo.getHeight()), (n.mainContentHolderHeight = n.stageHeight), (n.mainContentFinalX = Math.round((n.stageWidth - n.mainContentHolderWidth) / 2)), (n.scrollBarHeight = Math.min(n.contentHolderHeight - 20 - n.closeButtonHeight, n.stageHeight - 20 - n.closeButtonHeight)), n.stageHeight > n.contentHolderHeight ? (n.scrollBar_do.setOverflow("hidden"), (n.mainContentHolderHeight = n.contentHolderHeight), n.scrollBarHandler_sdo.setY(0), (n.mainContentFinalY = Math.round((n.stageHeight - n.contentHolderHeight) / 2)), (n.allowToScroll_bl = !1)) : ((n.mainContentFinalY = 0), n.scrollBar_do.setOverflow("visible"), n.scrollBar_do.setY(5 + n.closeButtonHeight), (n.allowToScroll_bl = !0)), n.stageHeight < 120 && (n.mainContentFinalY = 0), (n.scrollBarHandlerHeight = Math.min(n.scrollBarHeight - 20, (n.stageHeight / n.contentHolderHeight) * (n.scrollBarHeight - 20))), 500 < n.scrollBarHandlerHeight && (n.scrollBarHandlerHeight = 500), n.scrollBar_do.setX(n.mainContentHolderWidth - n.scrollBarWidth - 2), n.scrollBarTrack_sdo.setHeight(Math.max(n.scrollBarHeight, n.scrollBarHandlerHeight)), n.scrollBarHandler_sdo.setHeight(n.scrollBarHandlerHeight), FWDAnimation.killTweensOf(n.mainContentHolder_do), n.mainContentHolder_do.setX(n.mainContentFinalX), n.mainContentHolder_do.setY(n.mainContentFinalY), n.mainContentHolder_do.setHeight(n.mainContentHolderHeight), n.updatePCHandler(!1)); }, 50); }), (n.setText = function (e) { null != n && (n.updateSize(), n.contentHolder_sdo.setInnerHTML(e), setTimeout(n.updateSize, 120)); }), (n.setupPCScrollBar = function () { (n.scrollBar_do = new FWDDisplayObject("div")), n.scrollBar_do.setOverflow("visible"), n.mainContentHolder_do.addChild(n.scrollBar_do), (n.scrollBarTrack_sdo = new FWDSimpleDisplayObject("div")), n.scrollBarTrack_sdo.setWidth(n.scrollBarWidth), n.scrollBarTrack_sdo.setBkColor(n.scrollBarTrackColor), n.scrollBarTrack_sdo.setAlpha(0), (n.scrollBarTrack_sdo.getStyle().borderRadius = n.scrollBarBorderRadius + "px"), n.scrollBar_do.addChild(n.scrollBarTrack_sdo), (n.scrollBarHandler_sdo = new FWDSimpleDisplayObject("div")), n.scrollBarHandler_sdo.setButtonMode(!0), n.scrollBarHandler_sdo.setWidth(n.scrollBarWidth), (n.scrollBarHandler_sdo.getStyle().borderRadius = n.scrollBarBorderRadius + "px"), n.scrollBarHandler_sdo.setBkColor(n.scrollBarHandlerColor), n.scrollBarHandler_sdo.setAlpha(0.5), n.scrollBarHandler_sdo.screen.addEventListener ? (n.scrollBarHandler_sdo.screen.addEventListener("mouseover", n.scrollBarHandlerOnMouseOver), n.scrollBarHandler_sdo.screen.addEventListener("mouseout", n.scrollBarHandlerOnMouseOut), n.scrollBarHandler_sdo.screen.addEventListener("mousedown", n.scrollBarHandlerOnMouseDown)) : n.screen.attachEvent && (n.scrollBarHandler_sdo.screen.attachEvent("onmouseover", n.scrollBarHandlerOnMouseOver), n.scrollBarHandler_sdo.screen.attachEvent("onmouseout", n.scrollBarHandlerOnMouseOut), n.scrollBarHandler_sdo.screen.attachEvent("onmousedown", n.scrollBarHandlerOnMouseDown)), n.scrollBar_do.addChild(n.scrollBarHandler_sdo); }), (n.scrollBarHandlerOnMouseOver = function () { FWDAnimation.to(n.scrollBarHandler_sdo, 0.2, { alpha: 1, w: 10 }), FWDAnimation.to(n.scrollBarTrack_sdo, 0.2, { alpha: 0.4, w: 10 }), FWDAnimation.to(n.scrollBar_do, 0.2, { x: n.mainContentHolderWidth - n.scrollBarWidth - 6 }); }), (n.scrollBarHandlerOnMouseOut = function () { n.isDragging_bl || (FWDAnimation.to(n.scrollBarHandler_sdo, 0.3, { alpha: 0.5, w: n.scrollBarWidth }), FWDAnimation.to(n.scrollBarTrack_sdo, 0.3, { alpha: 0, w: n.scrollBarWidth }), FWDAnimation.to(n.scrollBar_do, 0.3, { x: n.mainContentHolderWidth - n.scrollBarWidth - 2 })); }), (n.scrollBarHandlerOnMouseDown = function (e) { if (n.allowToScroll_bl) { var t = FWDUtils.getViewportMouseCoordinates(e); (n.isDragging_bl = !0), (n.yPositionOnPress = n.scrollBarHandler_sdo.getY()), (n.lastPresedY = t.screenY), i.addEventListener ? (i.addEventListener("mousemove", n.scrollBarHandlerMoveHandler), i.addEventListener("mouseup", n.scrollBarHandlerEndHandler)) : document.attachEvent && (document.attachEvent("onmousemove", n.scrollBarHandlerMoveHandler), document.attachEvent("onmouseup", n.scrollBarHandlerEndHandler)); } }), (n.scrollBarHandlerMoveHandler = function (e) { e.preventDefault && e.preventDefault(); var t = FWDUtils.getViewportMouseCoordinates(e); (n.scrollBarHandlerFinalY = Math.round(n.yPositionOnPress + t.screenY - n.lastPresedY)), n.scrollBarHandlerFinalY >= n.scrollBarHeight - n.scrollBarHandlerHeight && (n.scrollBarHandlerFinalY = n.scrollBarHeight - n.scrollBarHandlerHeight), n.scrollBarHandlerFinalY <= 0 && (n.scrollBarHandlerFinalY = 0), n.scrollBarHandler_sdo.setY(n.scrollBarHandlerFinalY), n.updatePCHandler(!0); }), (n.scrollBarHandlerEndHandler = function (e) { var t = FWDUtils.getViewportMouseCoordinates(e); (n.isDragging_bl = !1), FWDUtils.hitTest(n.scrollBarHandler_sdo.screen, t.screenX, t.screenY) || n.scrollBarHandlerOnMouseOut(), i.removeEventListener ? (i.removeEventListener("mousemove", n.scrollBarHandlerMoveHandler), i.removeEventListener("mouseup", n.scrollBarHandlerEndHandler)) : document.detachEvent && (document.detachEvent("onmousemove", n.scrollBarHandlerMoveHandler), document.detachEvent("onmouseup", n.scrollBarHandlerEndHandler)); }), (n.updatePCHandler = function (e) { var t, o; "Infinity" == (o = n.scrollBarHandlerFinalY / (n.scrollBarHeight - n.scrollBarHandlerHeight)) && (o = 0), 1 <= o && (o = 1), n.isDragging_bl ? (n.contentFinalY = parseInt(o * (n.stageHeight - n.contentHolderHeight))) : (n.scrollBarHandler_sdo.getY() < 0 ? n.scrollBarHandler_sdo.setY(0) : n.scrollBarHandler_sdo.getY() > n.scrollBarHeight - n.scrollBarHandlerHeight && n.scrollBarHandler_sdo.setY(n.scrollBarHeight - n.scrollBarHandlerHeight), (t = n.scrollBarHandler_sdo.getY() / (n.scrollBarHeight - n.scrollBarHandlerHeight)), isNaN(t) && (t = 0), n.stageHeight > n.contentHolderHeight ? (n.contentFinalY = 0) : ((n.contentFinalY = Math.round(t * (n.scrollBarHeight - n.scrollBarHandlerHeight))), (n.contentFinalY = Math.round(t * (n.stageHeight - n.contentHolderHeight))))), e ? FWDAnimation.to(n.contentHolder_sdo, 0.3, { y: Math.round(n.contentFinalY) }) : n.contentHolder_sdo.setY(Math.round(n.contentFinalY)); }), (n.addMouseWheelSupport = function () { i.addEventListener ? (n.screen.addEventListener("mousewheel", n.mouseWheelHandler), n.screen.addEventListener("DOMMouseScroll", n.mouseWheelHandler)) : document.attachEvent && n.screen.attachEvent("onmousewheel", n.mouseWheelHandler); }), (this.mouseWheelHandler = function (e) { if (n.isShowed_bl && !(n.isDragging_bl || n.stageHeight > n.contentHolderHeight)) { var t = n.stageHeight / n.contentHolderHeight, o = e.detail || e.wheelDelta; if ( (e.wheelDelta && (o *= -1), FWDUtils.isOpera && (o *= -1), 0 < o ? n.scrollBarHandler_sdo.setY(n.scrollBarHandler_sdo.getY() + 45 * t) : o < 0 && n.scrollBarHandler_sdo.setY(n.scrollBarHandler_sdo.getY() - 45 * t), n.updatePCHandler(!0), !e.preventDefault) ) return !1; e.preventDefault(); } }), (n.setupMobileScrollbar = function () { n.hasPointerEvent_bl ? n.screen.addEventListener("MSPointerDown", n.scrollBarTouchStartHandler) : n.screen.addEventListener("touchstart", n.scrollBarTouchStartHandler); }), (n.scrollBarTouchStartHandler = function (e) { if (n.allowToScroll_bl) { var t = FWDUtils.getViewportMouseCoordinates(e); (n.isDragging_bl = !0), (n.lastPresedY = t.screenY), n.hasPointerEvent_bl ? (i.addEventListener("MSPointerUp", n.scrollBarTouchEndHandler), i.addEventListener("MSPointerMove", n.scrollBarTouchMoveHandler)) : (i.addEventListener("touchend", n.scrollBarTouchEndHandler), i.addEventListener("touchmove", n.scrollBarTouchMoveHandler)); } }), (n.scrollBarTouchMoveHandler = function (e) { e.preventDefault && e.preventDefault(); var t = FWDUtils.getViewportMouseCoordinates(e), o = t.screenY - n.lastPresedY; (n.contentFinalY += o), (n.contentFinalY = Math.round(n.contentFinalY)), n.contentHolder_sdo.setY(n.contentFinalY), (n.lastPresedY = t.screenY), (n.vy = 2 * o); }), (n.scrollBarTouchEndHandler = function (e) { (n.isDragging_bl = !1), n.hasPointerEvent_bl ? (i.removeEventListener("MSPointerUp", n.scrollBarTouchEndHandler), i.removeEventListener("MSPointerMove", n.scrollBarTouchMoveHandler)) : (i.removeEventListener("touchend", n.scrollBarTouchEndHandler), i.removeEventListener("touchmove", n.scrollBarTouchMoveHandler)); }), (n.updateMobileScrollBar = function (e) { n.isDragging_bl || ((n.vy *= n.friction), (n.contentFinalY += n.vy), 0 < n.contentFinalY ? ((n.vy2 = 0.3 * (0 - n.contentFinalY)), (n.vy *= n.friction), (n.contentFinalY += n.vy2)) : n.contentFinalY < n.mainContentHolderHeight - n.contentHolderHeight && ((n.vy2 = 0.3 * (n.mainContentHolderHeight - n.contentHolderHeight - n.contentFinalY)), (n.vy *= n.friction), (n.contentFinalY += n.vy2)), n.contentHolder_sdo.setY(Math.round(n.contentFinalY))); }), (n.updateMobileScrollBarWithoutAnimation = function () { 0 < n.contentFinalY ? (n.contentFinalY = 0) : n.contentFinalY < n.mainContentHolderHeight - n.contentHolderHeight && (n.contentFinalY = n.mainContentHolderHeight - n.contentHolderHeight), n.contentHolder_sdo.setY(Math.round(n.contentFinalY)); }), (n.activateScrollBar = function () { n.isMobile_bl && (n.updateMobileScrollBarId_int = setInterval(n.updateMobileScrollBar, 16)); }), (n.show = function (e) { n.isShowed_bl || ((n.isShowed_bl = !0), n.resizeAndPosition(), n.setText(e), n.activateScrollBar(), FWDUtils.isMobile ? (FWDAnimation.to(n.background_sdo, 0.8, { alpha: n.backgroundOpacity, delay: 0.2 }), (n.showOrHideWithDelayId_to = setTimeout(n.showWithDelay, 1800))) : (FWDAnimation.to(n.background_sdo, 0.6, { alpha: n.backgroundOpacity }), (n.showOrHideWithDelayId_to = setTimeout(n.showWithDelay, 600))), n.dispatchEvent(s.SHOW_START)); }), (n.showWithDelay = function () { n.dumyHolder_do.setX(0), n.scrollBarHandler_sdo && n.scrollBarHandler_sdo.setVisible(!0), n.mainContentHolder_do.setY(-n.mainContentHolderHeight), FWDAnimation.to(n.mainContentHolder_do, 0.8, { y: n.mainContentFinalY, ease: Expo.easeInOut }); }), (n.hide = function (e, t) { (n.isShowed_bl || t) && (FWDAnimation.killTweensOf(n.background_sdo), e ? (FWDAnimation.to(n.mainContentHolder_do, 0.8, { y: n.stageHeight, ease: Expo.easeInOut }), (n.showOrHideWithDelayId_to = setTimeout(n.hideWithDelay, 800))) : (n.dumyHolder_do.setX(-3e3), n.scrollBarHandler_sdo && n.scrollBarHandler_sdo.setVisible(!1), n.background_sdo.setAlpha(0)), clearInterval(n.updateMobileScrollBarId_int), (n.isShowed_bl = !1)); }), (n.hideWithDelay = function () { n.contentHolder_sdo.setInnerHTML(""), FWDAnimation.to(n.background_sdo, 0.6, { alpha: 0 }), (n.hideCompleteId_to = setTimeout(n.hideWithDelayComplete, 600)); }), (n.hideWithDelayComplete = function () { (n.contentFinalY = 0), n.scrollBarHandler_sdo && n.scrollBarHandler_sdo.setY(0), n.dispatchEvent(s.HIDE_COMPLETE); }), (n.cleanMainEvents = function () { n.screen.removeEventListener ? (n.scrollBarHandler_sdo && (n.scrollBarHandler_sdo.screen.removeEventListener("mouseover", n.scrollBarHandlerOnMouseOver), n.scrollBarHandler_sdo.screen.removeEventListener("mouseout", n.scrollBarHandlerOnMouseOut), n.scrollBarHandler_sdo.screen.removeEventListener("mousedown", n.scrollBarHandlerOnMouseDown)), i.removeEventListener("mousemove", n.scrollBarHandlerMoveHandler), i.removeEventListener("mouseup", n.scrollBarHandlerEndHandler), n.screen.removeEventListener("mousewheel", n.mouseWheelHandler), n.screen.removeEventListener("DOMMouseScroll", n.mouseWheelHandler), n.screen.addEventListener("MSPointerDown", n.scrollBarTouchStartHandler), n.screen.addEventListener("touchstart", n.scrollBarTouchStartHandler), i.removeEventListener("MSPointerUp", n.scrollBarTouchEndHandler), i.removeEventListener("MSPointerMove", n.scrollBarTouchMoveHandler), i.removeEventListener("touchend", n.scrollBarTouchEndHandler), i.removeEventListener("touchmove", n.scrollBarTouchMoveHandler)) : n.screen.detachEvent && (n.scrollBarHandler_sdo.screen.detachEvent("onmouseover", n.scrollBarHandlerOnMouseOver), n.scrollBarHandler_sdo.screen.detachEvent("onmouseout", n.scrollBarHandlerOnMouseOut), n.scrollBarHandler_sdo.screen.detachEvent("onmousedown", n.scrollBarHandlerOnMouseDown), document.detachEvent("onmousemove", n.scrollBarHandlerMoveHandler), document.detachEvent("onmouseup", n.scrollBarHandlerEndHandler), n.screen.detachEvent("onmousewheel", n.mouseWheelHandler)), clearTimeout(n.hideWithDelayId_do), clearTimeout(n.showOrHideWithDelayId_to), clearTimeout(n.hideCompleteId_to), clearInterval(n.updateMobileScrollBarId_int); }), (n.destroy = function () { n.cleanMainEvents(), n.scrollBar_do && (FWDAnimation.killTweensOf(n.scrollBar_do), FWDAnimation.killTweensOf(n.scrollBarHandler_sdo), FWDAnimation.killTweensOf(n.scrollBarTrack_sdo), n.scrollBar_do.destroy(), n.scrollBarHandler_sdo.destroy(), n.scrollBarTrack_sdo.destroy()), FWDAnimation.killTweensOf(n.contentHolder_sdo), n.contentHolder_sdo.destroy(), FWDAnimation.killTweensOf(n.background_sdo), n.background_sdo.destroy(), FWDAnimation.killTweensOf(n.mainContentHolder_do), n.mainContentHolder_do.destroy(), n.close_do.destroy(), (n.infoWindowCloseNormal_img = null), (n.infoWindowCloseSelected_img = null), (n.close_do = null), (n.background_sdo = null), (n.mainContentHolder_do = null), (n.contentHolder_sdo = null), (n.scrollBar_do = null), (n.scrollBarTrack_sdo = null), (n.scrollBarHandler_sdo = null), (n.mainBackgroundColor_str = null), (n.scrollBarHandlerColor = null), (n.scrollBarTrackColor = null), (n.scrollBarTrackOpacity = null), (t = e = null), n.setInnerHTML(""), o.destroy(), (o = n = null), (s.prototype = null); }), n.init()); }; (s.setPrototype = function () { s.prototype = new FWDDisplayObject("div"); }), (s.HIDE_COMPLETE = "hideComplete"), (s.SHOW_START = "showStart"), (s.prototype = null), (i.FWDDescriptionWindow = s); })(window), (window.FWDDisplayObject = function (e, t, o, n) { var i = this; if (((i.listeners = { events_ar: [] }), "div" != e && "img" != e && "canvas" != e)) throw Error("Type is not valid! " + e); (i.type = e), (this.children_ar = []), this.style, this.screen, this.transform, (this.position = t || "absolute"), (this.overflow = o || "hidden"), (this.display = n || "inline-block"), (this.visible = !0), this.buttonMode, (this.x = 0), (this.y = 0), (this.w = 0), (this.h = 0), this.rect, (this.alpha = 1), (this.innerHTML = ""), (this.opacityType = ""), (this.isHtml5_bl = !1), (this.hasTransform3d_bl = FWDUtils.hasTransform3d), (this.hasTransform2d_bl = FWDUtils.hasTransform2d), (FWDUtils.isIE || FWDUtils.isFirefox) && (i.hasTransform3d_bl = !1), (this.hasBeenSetSelectable_bl = !1), (i.init = function () { i.setScreen(); }), (i.getTransform = function () { for (var e, t = ["transform", "msTransform", "WebkitTransform", "MozTransform", "OTransform"]; (e = t.shift());) if (void 0 !== i.screen.style[e]) return e; return !1; }), (i.getOpacityType = function () { return void 0 !== i.screen.style.opacity ? "opacity" : "filter"; }), (i.setScreen = function (e) { "img" == i.type && e ? (i.screen = e) : (i.screen = document.createElement(i.type)), i.setMainProperties(); }), (i.setMainProperties = function () { (i.transform = i.getTransform()), i.setPosition(i.position), i.setDisplay(i.display), i.setOverflow(i.overflow), (i.opacityType = i.getOpacityType()), "opacity" == i.opacityType && (i.isHtml5_bl = !0), "filter" == i.opacityType && (i.screen.style.filter = "inherit"), (i.screen.style.left = "0px"), (i.screen.style.top = "0px"), (i.screen.style.margin = "0px"), (i.screen.style.padding = "0px"), (i.screen.style.maxWidth = "none"), (i.screen.style.maxHeight = "none"), (i.screen.style.border = "none"), (i.screen.style.lineHeight = "1"), (i.screen.style.backgroundColor = "transparent"), (i.screen.style.backfaceVisibility = "hidden"), (i.screen.style.webkitBackfaceVisibility = "hidden"), (i.screen.style.MozBackfaceVisibility = "hidden"), "img" == e && (i.setWidth(i.screen.width), i.setHeight(i.screen.height)); }), (i.setBackfaceVisibility = function () { (i.screen.style.backfaceVisibility = "visible"), (i.screen.style.webkitBackfaceVisibility = "visible"), (i.screen.style.MozBackfaceVisibility = "visible"); }), (i.setSelectable = function (e) { e || ((i.screen.style.userSelect = "none"), (i.screen.style.MozUserSelect = "none"), (i.screen.style.webkitUserSelect = "none"), (i.screen.style.khtmlUserSelect = "none"), (i.screen.style.oUserSelect = "none"), (i.screen.style.msUserSelect = "none"), (i.screen.msUserSelect = "none"), (i.screen.ondragstart = function (e) { return !1; }), (i.screen.onselectstart = function () { return !1; }), (i.screen.ontouchstart = function () { return !1; }), (i.screen.style.webkitTouchCallout = "none"), (i.hasBeenSetSelectable_bl = !0)); }), (i.getScreen = function () { return i.screen; }), (i.setVisible = function (e) { (i.visible = e), 1 == i.visible ? (i.screen.style.visibility = "visible") : (i.screen.style.visibility = "hidden"); }), (i.getVisible = function () { return i.visible; }), (i.setResizableSizeAfterParent = function () { (i.screen.style.width = "100%"), (i.screen.style.height = "100%"); }), (i.getStyle = function () { return i.screen.style; }), (i.setOverflow = function (e) { (i.overflow = e), (i.screen.style.overflow = i.overflow); }), (i.setPosition = function (e) { (i.position = e), (i.screen.style.position = i.position); }), (i.setDisplay = function (e) { (i.display = e), (i.screen.style.display = i.display); }), (i.setButtonMode = function (e) { (i.buttonMode = e), 1 == i.buttonMode ? (i.screen.style.cursor = "pointer") : (i.screen.style.cursor = "default"); }), (i.setBkColor = function (e) { i.screen.style.backgroundColor = e; }), (i.setInnerHTML = function (e) { (i.innerHTML = e), (i.screen.innerHTML = i.innerHTML); }), (i.getInnerHTML = function () { return i.innerHTML; }), (i.getRect = function () { return i.screen.getBoundingClientRect(); }), (i.setAlpha = function (e) { (i.alpha = e), "opacity" == i.opacityType ? (i.screen.style.opacity = i.alpha) : "filter" == i.opacityType && ((i.screen.style.filter = "alpha(opacity=" + 100 * i.alpha + ")"), (i.screen.style.filter = "progid:DXImageTransform.Microsoft.Alpha(Opacity=" + Math.round(100 * i.alpha) + ")")); }), (i.getAlpha = function () { return i.alpha; }), (i.getRect = function () { return i.screen.getBoundingClientRect(); }), (i.getGlobalX = function () { return i.getRect().left; }), (i.getGlobalY = function () { return i.getRect().top; }), (i.setX = function (e) { (i.x = e), i.hasTransform3d_bl ? (i.screen.style[i.transform] = "translate3d(" + i.x + "px," + i.y + "px,0)") : i.hasTransform2d_bl ? (i.screen.style[i.transform] = "translate(" + i.x + "px," + i.y + "px)") : (i.screen.style.left = i.x + "px"); }), (i.getX = function () { return i.x; }), (i.setY = function (e) { (i.y = e), i.hasTransform3d_bl ? (i.screen.style[i.transform] = "translate3d(" + i.x + "px," + i.y + "px,0)") : i.hasTransform2d_bl ? (i.screen.style[i.transform] = "translate(" + i.x + "px," + i.y + "px)") : (i.screen.style.top = i.y + "px"); }), (i.getY = function () { return i.y; }), (i.setWidth = function (e) { (i.w = e), "img" == i.type && (i.screen.width = i.w), (i.screen.style.width = i.w + "px"); }), (i.getWidth = function () { return "div" == i.type ? 0 != i.screen.offsetWidth ? i.screen.offsetWidth : i.w : "img" == i.type ? 0 != i.screen.offsetWidth ? i.screen.offsetWidth : 0 != i.screen.width ? i.screen.width : i._w : "canvas" == i.type ? 0 != i.screen.offsetWidth ? i.screen.offsetWidth : i.w : void 0; }), (i.setHeight = function (e) { (i.h = e), "img" == i.type && (i.screen.height = i.h), (i.screen.style.height = i.h + "px"); }), (i.getHeight = function () { return "div" == i.type ? 0 != i.screen.offsetHeight ? i.screen.offsetHeight : i.h : "img" == i.type ? 0 != i.screen.offsetHeight ? i.screen.offsetHeight : 0 != i.screen.height ? i.screen.height : i.h : "canvas" == i.type ? 0 != i.screen.offsetHeight ? i.screen.offsetHeight : i.h : void 0; }), (i.addChild = function (e) { i.contains(e) && i.children_ar.splice(FWDUtils.indexOfArray(i.children_ar, e), 1), i.children_ar.push(e), i.screen.appendChild(e.screen); }), (i.removeChild = function (e) { if (!i.contains(e)) throw Error("##removeChild()## Child dose't exist, it can't be removed!"); i.children_ar.splice(FWDUtils.indexOfArray(i.children_ar, e), 1), i.screen.removeChild(e.screen); }), (i.contains = function (e) { return -1 != FWDUtils.indexOfArray(i.children_ar, e); }), (i.addChildAt = function (e, t) { if (0 == i.getNumChildren()) i.children_ar.push(e), i.screen.appendChild(e.screen); else if (1 == t) i.screen.insertBefore(e.screen, i.children_ar[0].screen), i.screen.insertBefore(i.children_ar[0].screen, e.screen), i.contains(e) ? i.children_ar.splice(FWDUtils.indexOfArray(i.children_ar, e), 1, e) : i.children_ar.splice(FWDUtils.indexOfArray(i.children_ar, e), 0, e); else { if (t < 0 || t > i.getNumChildren() - 1) throw Error("##getChildAt()## Index out of bounds!"); i.screen.insertBefore(e.screen, i.children_ar[t].screen), i.contains(e) ? i.children_ar.splice(FWDUtils.indexOfArray(i.children_ar, e), 1, e) : i.children_ar.splice(FWDUtils.indexOfArray(i.children_ar, e), 0, e); } }), (i.getChildAt = function (e) { if (e < 0 || e > i.getNumChildren() - 1) throw Error("##getChildAt()## Index out of bounds!"); if (0 == i.getNumChildren()) throw Errror("##getChildAt## Child dose not exist!"); return i.children_ar[e]; }), (i.removeChildAtZero = function () { i.screen.removeChild(i.children_ar[0].screen), i.children_ar.shift(); }), (i.getNumChildren = function () { return i.children_ar.length; }), (i.addListener = function (e, t) { if (null == e) throw Error("type is required."); if ("object" == typeof e) throw Error("type must be of type String."); if ("function" != typeof t) throw Error("listener must be of type Function."); var o = {}; (o.type = e), (o.listener = t), (o.target = this).listeners.events_ar.push(o); }), (i.dispatchEvent = function (e, t) { if (null != this.listeners) { if (null == e) throw Error("type is required."); if ("object" == typeof e) throw Error("type must be of type String."); for (var o = 0, n = this.listeners.events_ar.length; o < n; o++) if (this.listeners.events_ar[o].target === this && this.listeners.events_ar[o].type === e) { if (t) for (var i in t) this.listeners.events_ar[o][i] = t[i]; this.listeners.events_ar[o].listener.call(this, this.listeners.events_ar[o]); } } }), (i.removeListener = function (e, t) { if (null == e) throw Error("type is required."); if ("object" == typeof e) throw Error("type must be of type String."); if ("function" != typeof t) throw Error("listener must be of type Function." + e); for (var o = 0, n = this.listeners.events_ar.length; o < n; o++) if (this.listeners.events_ar[o].target === this && this.listeners.events_ar[o].type === e && this.listeners.events_ar[o].listener === t) { this.listeners.events_ar.splice(o, 1); break; } }), (i.disposeImage = function () { "img" == i.type && (i.screen.src = null); }), (i.destroy = function () { i.hasBeenSetSelectable_bl && ((i.screen.ondragstart = null), (i.screen.onselectstart = null), (i.screen.ontouchstart = null)), (i.listeners = []), (i.listeners = null), (i.children_ar = []), (i.children_ar = null), (i.style = null), (i.screen = null), (i.transform = null), (i.position = null), (i.overflow = null), (i.display = null), (i.visible = null), (i.buttonMode = null), (i.x = null), (i.y = null), (i.w = null), (i.h = null), (i.rect = null), (i.alpha = null), (i.innerHTML = null), (i.opacityType = null), (i.isHtml5_bl = null), (i.hasTransform3d_bl = null), (i.hasTransform2d_bl = null), (i = null); }), i.init(); }), window, (window.FWDEventDispatcher = function () { (this.listeners = { events_ar: [] }), (this.addListener = function (e, t) { if (null == e) throw Error("type is required."); if ("object" == typeof e) throw Error("type must be of type String."); if ("function" != typeof t) throw Error("listener must be of type Function."); var o = {}; (o.type = e), (o.listener = t), (o.target = this).listeners.events_ar.push(o); }), (this.dispatchEvent = function (e, t) { if (null != this.listeners) { if (null == e) throw Error("type is required."); if ("object" == typeof e) throw Error("type must be of type String."); for (var o = 0, n = this.listeners.events_ar.length; o < n; o++) if (this.listeners.events_ar[o].target === this && this.listeners.events_ar[o].type === e) { if (t) for (var i in t) this.listeners.events_ar[o][i] = t[i]; this.listeners.events_ar[o].listener.call(this, this.listeners.events_ar[o]); } } }), (this.removeListener = function (e, t) { if (null == e) throw Error("type is required."); if ("object" == typeof e) throw Error("type must be of type String."); if ("function" != typeof t) throw Error("listener must be of type Function." + e); for (var o = 0, n = this.listeners.events_ar.length; o < n; o++) if (this.listeners.events_ar[o].target === this && this.listeners.events_ar[o].type === e && this.listeners.events_ar[o].listener === t) { this.listeners.events_ar.splice(o, 1); break; } }), (this.destroy = function () { (this.listeners = null), (this.addListener = null), (this.dispatchEvent = null), (this.removeListener = null); }); }), (function (e) { var s = function (e, t, o) { var n = this, i = s.prototype; (this.screenToTest = t), (this.hideDelay = o), (this.globalX = 0), (this.globalY = 0), this.currentTime, this.checkIntervalId_int, (this.dispatchOnceShow_bl = !0), (this.dispatchOnceHide_bl = !1), (this.isMobile_bl = e), (this.isStopped_bl = !0), (this.hasPointerEvent_bl = FWDUtils.hasPointerEvent), (n.init = function () { }), (n.start = function () { (n.currentTime = new Date().getTime()), (n.checkIntervalId_int = setInterval(n.update, 100)), n.addMouseOrTouchCheck(), (n.isStopped_bl = !1); }), (n.stop = function () { clearInterval(n.checkIntervalId_int), (n.isStopped_bl = !0), n.removeMouseOrTouchCheck(); }), (n.addMouseOrTouchCheck = function () { n.isMobile_bl ? n.hasPointerEvent_bl ? (n.screenToTest.screen.addEventListener("MSPointerDown", n.onMouseOrTouchUpdate), n.screenToTest.screen.addEventListener("MSPointerMove", n.onMouseOrTouchUpdate)) : n.screenToTest.screen.addEventListener("touchstart", n.onMouseOrTouchUpdate) : n.screenToTest.screen.addEventListener ? n.screenToTest.screen.addEventListener("mousemove", n.onMouseOrTouchUpdate) : n.screenToTest.screen.attachEvent && n.screenToTest.screen.attachEvent("onmousemove", n.onMouseOrTouchUpdate); }), (n.removeMouseOrTouchCheck = function () { n.isMobile_bl ? n.hasPointerEvent_bl ? (n.screenToTest.screen.removeEventListener("MSPointerDown", n.onMouseOrTouchUpdate), n.screenToTest.screen.removeEventListener("MSPointerMove", n.onMouseOrTouchUpdate)) : n.screenToTest.screen.removeEventListener("touchstart", n.onMouseOrTouchUpdate) : n.screenToTest.screen.removeEventListener ? n.screenToTest.screen.removeEventListener("mousemove", n.onMouseOrTouchUpdate) : n.screenToTest.screen.detachEvent && n.screenToTest.screen.detachEvent("onmousemove", n.onMouseOrTouchUpdate); }), (n.onMouseOrTouchUpdate = function (e) { var t = FWDUtils.getViewportMouseCoordinates(e); (n.globalX == t.screenX && n.globalY == t.screenY) || ((n.currentTime = new Date().getTime()), (n.globalX = t.screenX), (n.globalY = t.screenY)); }), (n.update = function (e) { new Date().getTime() > n.currentTime + n.hideDelay ? n.dispatchOnceShow_bl && (n.dispatchEvent(s.HIDE), (n.dispatchOnceHide_bl = !0), (n.dispatchOnceShow_bl = !1)) : n.dispatchOnceHide_bl && (n.dispatchEvent(s.SHOW), (n.dispatchOnceHide_bl = !1), (n.dispatchOnceShow_bl = !0)); }), (n.reset = function () { (n.currentTime = new Date().getTime()), n.dispatchEvent(s.SHOW); }), (n.destroy = function () { n.removeMouseOrTouchCheck(), clearInterval(n.checkIntervalId_int), (n.screenToTest = null), (t = null), (n.init = null), (n.start = null), (n.stop = null), (n.addMouseOrTouchCheck = null), (n.removeMouseOrTouchCheck = null), (n.onMouseOrTouchUpdate = null), (n.update = null), (n.reset = null), (n.destroy = null), i.destroy(), (n = i = null), (s.prototype = null); }), n.init(); }; (s.HIDE = "hide"), (s.SHOW = "show"), (s.setPrototype = function () { s.prototype = new FWDEventDispatcher(); }), (e.FWDHider = s); })(window), (function () { var s = function (n, u) { var c = this, i = s.prototype; (this.toolTipLeft_img = n.toolTipLeft_img), (this.toolTipPointer_img = n.toolTipPointer_img), (this.playListData_ar = n.playListData_ar), (this.images_ar = n.images_ar), (this.smallDos_ar = []), (this.markers_ar = []), (this.markersList_ar = n.markersList_ar), (this.markersPosition_ar = n.markersPosition_ar), (this.largeImagesPaths_ar = n.largeImagesPaths_ar), this.curMarker_do, this.markersToolTip_do, this.markersToolTipWindow_do, this.hider, this.prevSmall_sdo, this.largeImage_img, this.dumy_sdo, this.mainImagesHolder_do, this.smallImage_sdo, this.largeImage_sdo, this.left_sdo, this.top_sdo, this.right_sdo, this.bottom_sdo, this.markersPositionInfo_sdo, (this.handMovePath_str = n.handMovePath_str), (this.backgroundColor_str = u.backgroundColor_str), (this.draggingMode_str = n.startDraggingMode_str), (this.controllerVerticalPosition_str = n.controllerVerticalPosition_str), (this.buttonToolTipLeft_str = n.buttonToolTipLeft_str), (this.buttonToolTipMiddle_str = n.buttonToolTipMiddle_str), (this.buttonToolTipRight_str = n.buttonToolTipRight_str), (this.buttonToolTipFontColor_str = n.buttonToolTipFontColor_str), (this.buttonToolTipBottomPointer_str = n.buttonToolTipBottomPointer_str), (this.buttonToolTipTopPointer_str = n.buttonToolTipTopPointer_str), this.lastMarkerId_str, this.swipeDirection_str, (this.curId = n.startAtImage), (this.prevId = 1e3), (this.curLargeImageId = 1e3), (this.totalImages = n.totalImages), this.stageWidth, this.stageHeight, this.smallestPossibleScale, (this.currentScale = 1), (this.prevScale = 0), (this.percentZoomed = 0.1), (this.imageWidth = n.imageWidth), (this.imageHeight = n.imageHeight), (this.zoomFactor = n.zoomFactor), (this.zoomSpeed = n.zoomSpeed), (this.finalX = 0), (this.finalY = 0), this.xPositionOnPress, this.yPositionOnPress, (this.lastPresedX = 0), (this.lastPresedY = 0), (this.lastPresedX2 = 0), (this.lastPresedY2 = 0), (this.mouseX = 0), (this.mouseY = 0), (this.controllerHeight = n.controllerHeight), (this.rotationSpeed = Math.abs(-1.1 + n.dragRotationSpeed)), this.startScaleForMobileZoom, this.totalMarkers, this.globalX, this.globalY, (this.markerToolTipOffsetY = n.markerToolTipOffsetY), (this.toolTipWindowMaxWidth = n.toolTipWindowMaxWidth), (this.swipeDragDistX = 0), (this.currentDistX = 0), (this.spinDist = 10), (this.dragAndSpinSpeed = n.dragAndSpinSpeed), this.tweenDone_to, this.removeSmallSDOId_to, this.setAlphaWithDelayId_to, this.hideToolTipWindowId_to, this.addHideToolTipWindowTestWithDelayId_to, this.showToolTipWindoId_to, this.showMarkerToolTipId_to, this.dragAndSpinId_int, (this.disableMouseWheelZoom_bl = n.disableMouseWheelZoom_bl), (this.allImagesAreLoaded_bl = !1), (this.allowToDragHoriz_bl = !1), (this.allowToDragVert_bl = !1), (this.isTweening_bl = !1), (this.isDragging_bl = !1), (this.isRotatingFirstTime_bl = !0), (this.addCorrectionForWebKit_bl = n.addCorrectionForWebKit_bl), (this.disablePanOrRotate_bl = !1), (this.useEntireScreenFor3dObject_bl = n.useEntireScreenFor3dObject_bl), (this.stopRotationHorizontalAtEnds_bl = n.stopRotationHorizontalAtEnds_bl), (this.stopRotationVerticalAtEnds_bl = n.stopRotationVerticalAtEnds_bl), (this.isMobile_bl = n.isMobile_bl), (this.isLargeImageLoaded_bl = !1), (this.showNavigator_bl = n.showNavigator_bl), (this.showMarkers_bl = n.showMarkers_bl), (this.isNavigatorShowed_bl = !1), (this.addImageFirstTimeOnActivate_bl = !0), (this.showMarkersInfo_bl = n.showMarkersInfo_bl), (this.addDragAndSpinSupport_bl = n.addDragAndSpinSupport_bl), (this.isMobile_bl = n.isMobile_bl), (this.firstInteractionOccured_bl = !1), (this.dragVertical_bl = n.dragVertical_bl), (this.isSwiping_bl = !1), (this.showLargeImageVersionOnZoom_bl = n.showLargeImageVersionOnZoom_bl), (this.hasPointerEvent_bl = FWDUtils.hasPointerEvent), (c.init = function () { c.controllerVerticalPosition_str != FWDController.POSITION_TOP || c.useEntireScreenFor3dObject_bl || c.setY(c.controllerHeight), c.setupMainContiners(), c.setupDumy(), c.initImages(), c.showMarkers_bl && (c.setupMarkers(), (c.isMobile_bl && !c.hasPointerEvent_bl) || c.setupMarkersToolTip(), c.setupMarkersToolTipWindow()); }), (c.setupHider = function (e) { c.hider = e; }), (c.setupMainContiners = function () { c.setOverflow("visible"), c.setBkColor(c.backgroundColor_str), (c.largeImage_img = new Image()), (c.mainImagesHolder_do = new FWDDisplayObject("div", "absolute", "visible")), (c.smallImage_sdo = new FWDSimpleDisplayObject("img")), (c.largeImage_sdo = new FWDSimpleDisplayObject("img")), c.addChild(c.mainImagesHolder_do), c.addCorrectionForWebKit_bl && c.setupCorrectionLinesForChrome(); }), (c.setupCorrectionLinesForChrome = function () { (c.left_sdo = new FWDSimpleDisplayObject("div")), (c.top_sdo = new FWDSimpleDisplayObject("div")), (c.right_sdo = new FWDSimpleDisplayObject("div")), (c.bottom_sdo = new FWDSimpleDisplayObject("div")), c.left_sdo.setBkColor(c.backgroundColor_str), c.top_sdo.setBkColor(c.backgroundColor_str), c.right_sdo.setBkColor(c.backgroundColor_str), c.bottom_sdo.setBkColor(c.backgroundColor_str), c.left_sdo.setWidth(1), c.top_sdo.setHeight(1), c.right_sdo.setWidth(2), c.bottom_sdo.setHeight(2), c.addChild(c.left_sdo), c.addChild(c.top_sdo), c.addChild(c.right_sdo), c.addChild(c.bottom_sdo); }), (c.resizeAndPositionCorrectionLines = function (e) { FWDAnimation.killTweensOf(c.left_sdo), FWDAnimation.killTweensOf(c.top_sdo), FWDAnimation.killTweensOf(c.right_sdo), FWDAnimation.killTweensOf(c.bottom_sdo), e ? (FWDAnimation.to(c.left_sdo, 0.2, { x: c.finalX, y: c.finalY, h: c.finalHeight }), FWDAnimation.to(c.top_sdo, 0.2, { x: c.finalX, y: c.finalY, w: c.finalWidth }), FWDAnimation.to(c.right_sdo, 0.2, { x: c.finalX + c.finalWidth - 2, y: c.finalY, h: c.finalHeight }), FWDAnimation.to(c.bottom_sdo, 0.2, { x: c.finalX, y: c.finalY + c.finalHeight - 2, w: c.finalWidth })) : (c.left_sdo.setX(c.finalX - 1), c.left_sdo.setY(c.finalY), c.left_sdo.setHeight(c.finalHeight), c.top_sdo.setX(c.finalX), c.top_sdo.setY(c.finalY - 1), c.top_sdo.setWidth(c.finalWidth), c.right_sdo.setX(c.finalX + c.finalWidth - 2), c.right_sdo.setY(c.finalY), c.right_sdo.setHeight(c.finalHeight), c.bottom_sdo.setX(c.finalX), c.bottom_sdo.setY(c.finalY + c.finalHeight - 2), c.bottom_sdo.setWidth(c.finalWidth)); }), (c.resizeAndPosition = function (e) { (c.stageWidth == u.stageWidth && c.stageHeight == u.stageHeight - c.controllerHeight) || ((c.stageWidth = u.stageWidth), c.useEntireScreenFor3dObject_bl ? (c.stageHeight = u.stageHeight) : (c.stageHeight = u.stageHeight - c.controllerHeight), c.setWidth(c.stageWidth), c.setHeight(c.stageHeight), c.allImagesAreLoaded_bl ? (c.resizeAndPositionAfterAllLoad(), e && c.centerImage(), c.showNavigator_bl && (c.hideOrShowNavigator(), c.updateNavigator(!1)), c.positionMarkers()) : c.resiezeAndPositionIfNotAllImagesAreLoaded()); }), (c.resiezeAndPositionIfNotAllImagesAreLoaded = function () { var e, t = c.stageWidth / c.imageWidth, o = c.stageHeight / c.imageHeight; 1 < (e = t < o ? t : o) && (e = 1), (c.currentScale = c.prevScale = c.smallestPossibleScale = e), (c.finalWidth = Math.round(c.currentScale * c.imageWidth)), (c.finalHeight = Math.round(c.currentScale * c.imageHeight)), (c.finalX = Math.round((c.stageWidth - c.finalWidth) / 2)), (c.finalY = Math.round((c.stageHeight - c.finalHeight) / 2)), c.resizeAndPositionSmallImage(!1); }), (this.initImages = function () { (c.playListData_ar = n.playListData_ar), (c.totalSets = c.playListData_ar.length), (c.totalImages = c.playListData_ar[0].length), (c.curSet = n.startAtSet), (c.image_ar = []); for (var e = 0; e < c.totalSets; e++) c.image_ar[e] = []; 1 < c.playListData_ar && (c.dragVertical_bl = !1); }), (c.showLoadedImage = function (e) { (c.smallImage_sdo = new FWDSimpleDisplayObject("img")), c.smallImage_sdo.setScreen(c.images_ar[e]), FWDUtils.isAndroid && c.smallImage_sdo.setBackfaceVisibility(), (c.smallDos_ar[e] = c.smallImage_sdo), c.mainImagesHolder_do.addChild(c.smallImage_sdo), (c.removeSmallSDOId_to = setTimeout(function () { null != c && 0 < e && c.smallDos_ar[e - 1].setVisible(!1); }, 40)), c.resizeAndPosition(), c.resiezeAndPositionIfNotAllImagesAreLoaded(); }), (c.activate = function () { (c.allImagesAreLoaded_bl = !0), c.addSmallImage(), c.addLargeImage(), c.resizeAndPositionAfterAllLoad(), c.addPannSupport(), c.addPinchAndZoom(), c.addRotationSupport(), c.disableMouseWheelZoom_bl || c.addMouseWheelSupport(), c.showOrHideMarkers(), c.positionMarkers(!1), c.showMarkersInfo_bl && c.setupMarkersInfo(); }), (c.setupDumy = function () { (c.dumy_sdo = new FWDSimpleDisplayObject("div")), FWDUtils.isIE && (c.dumy_sdo.getStyle().background = "url('dumy')"), c.showMarkersInfo_bl || (c.dumy_sdo.getStyle().cursor = "url(" + c.handMovePath_str + "), default"), c.addChild(c.dumy_sdo); }), (c.addSmallImage = function () { (c.curId == c.prevId && c.curSet == c.prevSet) || ((c.prevId = c.curId), (c.prevSet = c.curSet), (c.curLargeImageId = 1e3), c.addImageFirstTimeOnActivate_bl && (c.removeSmallSDOId_to = setTimeout(function () { null != c && (c.smallImage_sdo.setVisible(!1), (c.smallImage_sdo = c.smallDos_ar[c.curSet * c.totalImages + c.curId]), c.smallImage_sdo.setVisible(!0), c.resizeAndPositionAfterAllLoad()); }, 40)), clearTimeout(c.setAlphaWithDelayId_to), c.largeImage_img && ((c.largeImage_img.onload = null), (c.largeImage_img.onerror = null), FWDUtils.isIEAndLessThen9 || (c.largeImage_img.src = "")), c.mainImagesHolder_do.contains(c.largeImage_sdo) && c.mainImagesHolder_do.removeChild(c.largeImage_sdo), c.addImageFirstTimeOnActivate_bl || (c.smallImage_sdo.setVisible(!1), (c.smallImage_sdo = c.smallDos_ar[c.curSet * c.totalImages + c.curId]), c.smallImage_sdo.setVisible(!0)), (c.addImageFirstTimeOnActivate_bl = !1)); }), (c.removeWithDelay = function () { for (; 1 < c.mainImagesHolder_do.getNumChildren();) c.mainImagesHolder_do.removeChildAtZero(0); }), (c.addLargeImage = function () { c.playListData_ar[c.curSet][c.curId].largeImagePath && c.showLargeImageVersionOnZoom_bl && (c.currentScale <= 1 ? c.largeImage_sdo.setVisible(!1) : (c.largeImage_sdo.setVisible(!0), c.curLargeImageId != c.curId && ((c.isLargeImageLoaded_bl = !1), (c.curLargeImageId = c.curId), clearTimeout(c.setAlphaWithDelayId_to), c.mainImagesHolder_do.contains(c.largeImage_sdo) && c.mainImagesHolder_do.removeChild(c.largeImage_sdo), c.largeImage_img && ((c.largeImage_img.onload = null), (c.largeImage_img.src = "")), (c.largeImage_img.src = c.playListData_ar[c.curSet][c.curId].largeImagePath), (c.largeImage_img.onload = c.largeImageLoadHandler), c.largeImage_sdo.setScreen(c.largeImage_img), c.largeImage_sdo.setAlpha(0), c.mainImagesHolder_do.addChild(c.largeImage_sdo)))); }), (c.largeImageErrorHandler = function () { var e = "The large image labeled " + c.largeImagesPaths_ar[c.curId] + " can't be loaded, make sure that the image exists and the path is correct!"; c.dispatchEvent(s.LARGE_IMAGE_LOAD_ERROR, { error: e }); }), (c.largeImageLoadHandler = function () { (c.isLargeImageLoaded_bl = !0), (c.setAlphaWithDelayId_to = setTimeout(function () { c.largeImage_sdo.setAlpha(1); }, 100)), c.largeImage_sdo.setWidth(c.finalWidth), c.largeImage_sdo.setHeight(c.finalHeight); }), (c.gotoImage = function () { c.stopRotationHorizontalAtEnds_bl ? c.curId < 0 ? (c.curId = 0) : c.curId > c.totalImages - 1 && (c.curId = c.totalImages - 1) : c.curId > c.totalImages - 1 ? (c.curId = 0) : c.curId < 0 && (c.curId = c.totalImages - 1), c.stopRotationVerticalAtEnds_bl ? c.curSet < 0 ? (c.curSet = 0) : c.curSet > c.playListData_ar.length - 1 && (c.curSet = c.playListData_ar.length - 1) : c.curSet > c.playListData_ar.length - 1 ? (c.curSet = 0) : c.curSet < 0 && (c.curSet = c.playListData_ar.length - 1), c.addSmallImage(), c.resizeAndPositionAfterAllLoad(), c.isSwiping_bl || (c.showOrHideMarkers(), c.positionMarkers()), c.dispatchEvent(s.ROTATE_UPDATE, { image: c.images_ar[c.curSet * c.totalImages + c.curId] }); }), (c.resizeAndPositionAfterAllLoad = function () { var e, t = c.stageWidth / c.imageWidth, o = c.stageHeight / c.imageHeight; (e = t < o ? t : o), 1 <= (c.smallestPossibleScale = e) && (c.smallestPossibleScale = 1), (c.finalWidth = Math.round(c.currentScale * c.imageWidth)), (c.finalHeight = Math.round(c.currentScale * c.imageHeight)), c.setWidth(c.stageWidth), c.dumy_sdo.setWidth(c.stageWidth), c.useEntireScreenFor3dObject_bl ? (c.setHeight(c.stageHeight), c.dumy_sdo.setHeight(c.stageHeight)) : (c.setHeight(c.stageHeight + c.controllerHeight), c.dumy_sdo.setHeight(c.stageHeight + c.controllerHeight)), c.checkXAndYBouds(), c.resizeAndPositionSmallImage(!1), c.resizeAndPositionLargeImage(!1), c.addCorrectionForWebKit_bl && c.resizeAndPositionCorrectionLines(!1), c.dispatchScrollBarUpdate(!1), c.positionMarkers(); }), (c.resizeAndPositionSmallImage = function (e) { (c.isTweening_bl = !0), FWDAnimation.killTweensOf(c.mainImagesHolder_do), FWDAnimation.killTweensOf(c.smallImage_sdo), clearTimeout(c.tweenDone_to), e ? (FWDAnimation.to(c.mainImagesHolder_do, 0.2, { x: c.finalX, y: c.finalY }), FWDAnimation.to(c.smallImage_sdo, 0.2, { w: c.finalWidth, h: c.finalHeight }), (c.tweenDone_to = setTimeout(c.tweenDoneHandler, 200))) : (c.mainImagesHolder_do.setX(c.finalX), c.mainImagesHolder_do.setY(c.finalY), c.smallImage_sdo.setWidth(c.finalWidth), c.smallImage_sdo.setHeight(c.finalHeight), (c.isTweening_bl = !1), c.dispatchEvent(s.IMAGE_ZOOM_COMPLETE)); }), (c.resizeAndPositionLargeImage = function (e) { c.showLargeImageVersionOnZoom_bl && c.isLargeImageLoaded_bl && (FWDAnimation.killTweensOf(c.largeImage_sdo), e ? FWDAnimation.to(c.largeImage_sdo, 0.2, { w: c.finalWidth, h: c.finalHeight }) : (console.log("setting width" + c.finalWidth), c.largeImage_sdo.setWidth(c.finalWidth), c.largeImage_sdo.setHeight(c.finalHeight))); }), (c.tweenDoneHandler = function () { (c.isTweening_bl = !1), c.addLargeImage(), c.resizeAndPositionLargeImage(), c.dispatchEvent(s.IMAGE_ZOOM_COMPLETE); }), (c.checkXAndYBouds = function () { c.finalWidth <= c.stageWidth ? (c.finalX = Math.round((c.stageWidth - c.finalWidth) / 2)) : c.finalWidth > c.stageWidth + 1 ? ((c.allowToDragHoriz_bl = !0), 0 < c.finalX ? (c.finalX = 0) : c.finalX <= c.stageWidth - c.finalWidth + 1 && (c.finalX = c.stageWidth - c.finalWidth + 1)) : (c.allowToDragHoriz_bl = !1), c.finalHeight <= c.stageHeight ? (c.finalY = Math.round((c.stageHeight - c.finalHeight) / 2)) : c.finalHeight > c.stageHeight + 1 ? ((c.allowToDragVert_bl = !0), 0 < c.finalY ? (c.finalY = 0) : c.finalY <= c.stageHeight - c.finalHeight && (c.finalY = c.stageHeight - c.finalHeight)) : (c.allowToDragVert_bl = !1); }), (c.zoomImage = function (e) { e && ((c.finalWidth = Math.round(c.currentScale * c.imageWidth)), (c.finalHeight = Math.round(c.currentScale * c.imageHeight)), (c.finalX -= Math.round(((c.mouseX - c.finalX) * (c.currentScale - c.prevScale)) / c.prevScale)), (c.finalY -= Math.round(((c.mouseY - c.finalY) * (c.currentScale - c.prevScale)) / c.prevScale))), c.dispatchScrollBarUpdate(!0), c.checkXAndYBouds(), c.resizeAndPositionSmallImage(!0), c.resizeAndPositionLargeImage(!0), c.addCorrectionForWebKit_bl && c.resizeAndPositionCorrectionLines(!0), c.showNavigator_bl && (c.hideOrShowNavigator(), c.updateNavigator(!0)), c.positionMarkers(!0), (c.prevScale = c.currentScale); }), (this.addPinchAndZoom = function () { c.hasPointerEvent_bl ? this.screen.addEventListener("MSPointerDown", this.onPinchTouchStart) : this.screen.addEventListener("touchstart", this.onPinchTouchStart); }), (this.removeZoomDragAndSwipeForMobile = function () { c.hasPointerEvent_bl ? (this.screen.removeEventListener("MSPointerDown", this.onPinchTouchStart), window.removeEventListener("MSPointerUp", c.windowOnTouchEnd), window.removeEventListener("MSPointerMove", c.windowOnTouchMove)) : (this.screen.removeEventListener("touchstart", this.onPinchTouchStart), window.removeEventListener("touchend", c.windowOnTouchEnd), window.removeEventListener("touchmove", c.windowOnTouchMove)); }), (this.onPinchTouchStart = function (e) { if (e.touches) { if ( (e.preventDefault && e.preventDefault(), (c.vx = 0), (c.vy = 0), (c.lastMouseX = c.firstTouchMouseX = e.touches[0].pageX - u.main_do.getGlobalX() - u.scrollOffsets.x), (c.lastMouseY = c.firstTouchMouseY = e.touches[0].pageY - u.main_do.getGlobalY() - u.scrollOffsets.y), e.touches && 2 == e.touches.length) ) (c.disableOnDragOrSwipe_bl = !0), (c.lastMouseX2 = e.touches[1].pageX - u.main_do.getGlobalX() - u.scrollOffsets.x), (c.lastMouseY2 = e.touches[1].pageY - u.main_do.getGlobalY() - u.scrollOffsets.y); else if (e.touches && 2 < e.touches.length) return; c.hasPointerEvent_bl ? (window.addEventListener("MSPointerUp", c.windowOnTouchEnd), window.addEventListener("MSPointerMove", c.windowOnTouchMove)) : (window.addEventListener("touchend", c.windowOnTouchEnd), window.addEventListener("touchmove", c.windowOnTouchMove)); } }), (c.finishPinching_bl = !0), (this.windowOnTouchMove = function (e) { var t, o, n, i, s, r, l, a, d; e.preventDefault && e.preventDefault(), e.touches ? ((t = e.touches[0].pageX - u.main_do.getGlobalX() - u.scrollOffsets.x), (o = e.touches[0].pageY - u.main_do.getGlobalY() - u.scrollOffsets.y)) : ((t = e.pageX - u.main_do.getGlobalX() - u.scrollOffsets.x), (o = e.pageY - u.main_do.getGlobalY() - u.scrollOffsets.y)), (c.firstTouchMouseX < t - 1 || c.firstTouchMouseX > t + 1 || c.firstTouchMouseY < o - 1 || c.firstTouchMouseY > o + 1) && (c.disableOnDragOrSwipe_bl = !0), e.touches && 2 == e.touches.length && ((c.finishPinching_bl = !1), (n = t), (i = o), (s = e.touches[1].pageX - u.main_do.getGlobalX() - u.scrollOffsets.x), (r = e.touches[1].pageY - u.main_do.getGlobalY() - u.scrollOffsets.y), (c.mouseX = (s + n) / 2), (c.mouseY = (r + i) / 2), (a = n - s), (d = i - r), (l = Math.sqrt(a * a + d * d)), parseInt(c.pinchDist) != parseInt(l) && (c.pinchDist > l ? (c.currentScale -= 0.04) : (c.currentScale += 0.02), parseFloat(c.currentScale.toFixed(5)) <= parseFloat(c.smallestPossibleScale.toFixed(5)) ? (c.currentScale = c.smallestPossibleScale) : c.currentScale > c.zoomFactor && (c.currentScale = c.zoomFactor)), c.zoomImage(!0, !0), (c.pinchDist = l)); }), (this.windowOnTouchEnd = function (e) { e.preventDefault && e.preventDefault(), c.hasPointerEvent_bl ? (window.removeEventListener("MSPointerUp", c.windowOnTouchEnd), window.removeEventListener("MSPointerMove", c.windowOnTouchMove), clearTimeout(c.disableOnDragOrSwipeId_to), (c.disableOnDragOrSwipeId_to = setTimeout(function () { (c.disableOnDragOrSwipe_bl = !1), (c.finishPinching_bl = !0); }, 200))) : 0 == e.touches.length && (clearTimeout(c.disableOnDragOrSwipeId_to), (c.disableOnDragOrSwipeId_to = setTimeout(function () { (c.disableOnDragOrSwipe_bl = !1), (c.finishPinching_bl = !0); }, 200)), window.removeEventListener("touchend", c.windowOnTouchEnd), window.removeEventListener("touchmove", c.windowOnTouchMove)), (c.isDragged_bl = !1); }), (c.addPannSupport = function () { c.isMobile_bl ? c.hasPointerEvent_bl ? c.dumy_sdo.screen.addEventListener("MSPointerDown", c.panStartHandler) : c.dumy_sdo.screen.addEventListener("touchstart", c.panStartHandler) : c.screen.addEventListener ? c.dumy_sdo.screen.addEventListener("mousedown", c.panStartHandler) : c.screen.attachEvent && c.dumy_sdo.screen.attachEvent("onmousedown", c.panStartHandler); }), (c.panStartHandler = function (e) { if (!(c.draggingMode_str != s.PAN || c.isTweening_bl || c.disablePanOrRotate_bl || (e.preventDefault && e.preventDefault(), c.finalWidth < c.stageWidth && c.finalHeight < c.stageHeight))) { (c.isMobile_bl && e.pointerType != e.MSPOINTER_TYPE_MOUSE) || u.showPanDumy(); var t = FWDUtils.getViewportMouseCoordinates(e); (c.isDragging_bl = !0), (c.xPositionOnPress = c.mainImagesHolder_do.getX()), (c.yPositionOnPress = c.mainImagesHolder_do.getY()), (c.lastPresedX = t.screenX), (c.lastPresedY = t.screenY), c.dispatchEvent(s.PAN_START), c.isMobile_bl ? c.hasPointerEvent_bl ? (window.addEventListener("MSPointerMove", c.panMoveHandler), window.addEventListener("MSPointerUp", c.panEndHandler)) : (window.addEventListener("touchmove", c.panMoveHandler), window.addEventListener("touchend", c.panEndHandler)) : window.addEventListener ? (window.addEventListener("mousemove", c.panMoveHandler), window.addEventListener("mouseup", c.panEndHandler)) : document.attachEvent && (document.attachEvent("onmousemove", c.panMoveHandler), document.attachEvent("onmouseup", c.panEndHandler)); } }), (c.panMoveHandler = function (e) { if ((e.preventDefault && e.preventDefault(), !((e.touches && 1 != e.touches.length) || c.disablePanOrRotate_bl))) { var t = FWDUtils.getViewportMouseCoordinates(e); c.finalWidth > c.stageWidth + 1 && ((c.finalX = Math.round(c.xPositionOnPress + t.screenX - c.lastPresedX)), 0 < c.finalX ? (c.finalX = 0) : c.finalX <= c.stageWidth - c.finalWidth + 1 && (c.finalX = c.stageWidth - c.finalWidth + 1), c.mainImagesHolder_do.setX(c.finalX)), c.finalHeight > c.stageHeight + 1 && ((c.finalY = Math.round(c.yPositionOnPress + t.screenY - c.lastPresedY)), 0 < c.finalY ? (c.finalY = 0) : c.finalY <= c.stageHeight - c.finalHeight && (c.finalY = c.stageHeight - c.finalHeight), c.mainImagesHolder_do.setY(c.finalY)), c.showNavigator_bl && (c.hideOrShowNavigator(), c.updateNavigator(!1)), c.positionMarkers(!1); } }), (c.panEndHandler = function (e) { (c.isDragging_bl = !1), (c.isMobile_bl && e.pointerType != e.MSPOINTER_TYPE_MOUSE) || u.hidePanDumy(), c.isMobile_bl ? c.hasPointerEvent_bl ? (window.removeEventListener("MSPointerMove", c.panMoveHandler), window.removeEventListener("MSPointerUp", c.panEndHandler)) : (window.removeEventListener("touchmove", c.panMoveHandler), window.removeEventListener("touchend", c.panEndHandler)) : window.removeEventListener ? (window.removeEventListener("mousemove", c.panMoveHandler), window.removeEventListener("mouseup", c.panEndHandler)) : document.detachEvent && (document.detachEvent("onmousemove", c.panMoveHandler), document.detachEvent("onmouseup", c.panEndHandler)); }), (c.addRotationSupport = function () { c.isMobile_bl ? c.hasPointerEvent_bl ? c.dumy_sdo.screen.addEventListener("MSPointerDown", c.rotateStartHandler) : c.dumy_sdo.screen.addEventListener("touchstart", c.rotateStartHandler) : c.screen.addEventListener ? c.dumy_sdo.screen.addEventListener("mousedown", c.rotateStartHandler) : c.screen.attachEvent && c.dumy_sdo.screen.attachEvent("onmousedown", c.rotateStartHandler); }), (c.rotateStartHandler = function (e) { if (c.draggingMode_str == s.ROTATE && !c.isTweening_bl && !c.disablePanOrRotate_bl) { clearInterval(c.dragAndSpinId_int), e.preventDefault && e.preventDefault(); var t = FWDUtils.getViewportMouseCoordinates(e); (c.isDragging_bl = !0), (c.isSwiping_bl = !1), c.markersToolTipWindow_do && c.markersToolTipWindow_do.hide(), (c.isMobile_bl && "mouse" != e.pointerType) || u.showRotateDumy(), (c.currentDistX = c.lastPresedX = t.screenX), (c.currentDistY = c.lastPresedY = t.screenY), c.showOrHideMarkers(), c.positionMarkers(), c.dispatchEvent(s.ROTATE_START), c.isMobile_bl ? c.hasPointerEvent_bl ? (window.addEventListener("MSPointerMove", c.rotateMoveHandler), window.addEventListener("MSPointerUp", c.rotateEndHandler)) : (window.addEventListener("touchmove", c.rotateMoveHandler), window.addEventListener("touchend", c.rotateEndHandler)) : window.addEventListener ? (window.addEventListener("mousemove", c.rotateMoveHandler), window.addEventListener("mouseup", c.rotateEndHandler)) : document.attachEvent && (document.attachEvent("onmousemove", c.rotateMoveHandler), document.attachEvent("onmouseup", c.rotateEndHandler)); } }), (c.rotateMoveHandler = function (e) { if ((e.preventDefault && e.preventDefault(), !((e.touches && 1 != e.touches.length) || c.disablePanOrRotate_bl))) { var t = FWDUtils.getViewportMouseCoordinates(e), o = (t.screenX - c.lastPresedX) / (80 * c.rotationSpeed), n = (t.screenY - c.lastPresedY) / (80 * c.rotationSpeed); if (((c.swipeDragDistX = t.screenX - c.currentDistX), (c.currentDistX = t.screenX), (c.swipeDragDistY = t.screenY - c.currentDistY), (c.currentDistY = t.screenY), c.dragVertical_bl)) { if (c.isRotatingFirstTime_bl) return 0 < n ? 0 != n && (n = -1) : 0 != n && (n = 1), (c.curId += n), c.gotoImage(), void (c.isRotatingFirstTime_bl = !1); 1 <= Math.abs(n) && (0 < n ? ((c.lastPresedY = c.lastPresedY + 80 * c.rotationSpeed), 0 != n && (n = -1)) : ((c.lastPresedY = c.lastPresedY - 80 * c.rotationSpeed), 0 != n && (n = 1)), (c.curId += n), c.gotoImage()); } else { if ( (1 <= Math.abs(n) && (0 < n ? ((c.lastPresedY = c.lastPresedY + 80 * c.rotationSpeed), 0 != n && (n = -1)) : ((c.lastPresedY = c.lastPresedY - 80 * c.rotationSpeed), 0 != n && (n = 1)), (c.curSet += n), c.gotoImage()), c.isRotatingFirstTime_bl) ) return 0 < o ? 0 != o && (o = -1) : 0 != o && (o = 1), (c.curId += o), c.gotoImage(), void (c.isRotatingFirstTime_bl = !1); 1 <= Math.abs(o) && (0 < o ? ((c.lastPresedX = c.lastPresedX + 80 * c.rotationSpeed), 0 != o && (o = -1)) : ((c.lastPresedX = c.lastPresedX - 80 * c.rotationSpeed), 0 != o && (o = 1)), (c.curId += o), c.gotoImage()); } } }), (c.rotateEndHandler = function (e) { c.dragVertical_bl ? Math.abs(c.swipeDragDistY) > c.spinDist && c.addDragAndSpinSupport_bl && c.firstInteractionOccured_bl ? c.startToSwipe() : c.addLargeImage() : Math.abs(c.swipeDragDistX) > c.spinDist && c.addDragAndSpinSupport_bl && c.firstInteractionOccured_bl ? c.startToSwipe() : c.addLargeImage(), (c.isDragging_bl = !1), (c.isRotatingFirstTime_bl = !0), (c.firstInteractionOccured_bl = !0), (c.isMobile_bl && e.pointerType != e.MSPOINTER_TYPE_MOUSE) || u.hideRotateDumy(), c.isMobile_bl ? c.hasPointerEvent_bl ? (window.removeEventListener("MSPointerMove", c.rotateMoveHandler), window.removeEventListener("MSPointerUp", c.rotateEndHandler)) : (window.removeEventListener("touchmove", c.rotateMoveHandler), window.removeEventListener("touchend", c.rotateEndHandler)) : window.removeEventListener ? (window.removeEventListener("mousemove", c.rotateMoveHandler), window.removeEventListener("mouseup", c.rotateEndHandler)) : document.detachEvent && (document.detachEvent("onmousemove", c.rotateMoveHandler), document.detachEvent("onmouseup", c.rotateEndHandler)); }), (this.startToSwipe = function () { c.isSwiping_bl = !0; for (var e = 0; e < c.totalMarkers; e++) (marker = c.markers_ar[e]), marker.hide(); c.dragVertical_bl ? ((c.swipeDirection_str = c.swipeDragDistY < 0 ? "top" : "bottom"), (c.swipeDragDistY = Math.abs(c.swipeDragDistY / (20 * c.dragAndSpinSpeed)))) : ((c.swipeDirection_str = c.swipeDragDistX < 0 ? "left" : "right"), (c.swipeDragDistX = Math.abs(c.swipeDragDistX / (20 * c.dragAndSpinSpeed)))), (c.dragAndSpinId_int = setInterval(c.swipeTweenUpdate, 16)); }), (this.swipeTweenUpdate = function () { var e, t = 0; c.dragVertical_bl ? ((c.swipeDragDistY += 0.07 * (0 - c.swipeDragDistY)), (t = Math.round(c.swipeDragDistY)), (e = "top" == c.swipeDirection_str ? 1 : -1)) : ((c.swipeDragDistX += 0.07 * (0 - c.swipeDragDistX)), (t = Math.round(c.swipeDragDistX)), (e = "left" == c.swipeDirection_str ? 1 : -1)), (c.curId += t * e), 0 == t ? ((c.isSwiping_bl = !1), clearInterval(c.dragAndSpinId_int), c.gotoImage(), c.addLargeImage()) : c.gotoImage(); }), (c.addMouseWheelSupport = function () { window.addEventListener ? (c.dumy_sdo.screen.addEventListener("mousewheel", c.mouseWheelHandler), c.dumy_sdo.screen.addEventListener("DOMMouseScroll", c.mouseWheelHandler)) : document.attachEvent && c.dumy_sdo.screen.attachEvent("onmousewheel", c.mouseWheelHandler); }), (c.mouseWheelHandler = function (e) { if ((e.preventDefault && e.preventDefault(), !c.isDragging_bl && !c.disablePanOrRotate_bl)) { var t = FWDUtils.getViewportMouseCoordinates(e); c.hider && c.hider.reset(), (c.mouseX = t.screenX - c.getGlobalX()), (c.mouseY = t.screenY - c.getGlobalY()); var o = e.detail || e.wheelDelta; if ( (e.wheelDelta && (o *= -1), FWDUtils.isOpera && (o *= -1), 0 < o ? ((c.currentScale -= c.zoomSpeed), parseFloat(c.currentScale.toFixed(5)) <= parseFloat(c.smallestPossibleScale.toFixed(5)) && (c.currentScale = c.smallestPossibleScale)) : o < 0 && ((c.currentScale += c.zoomSpeed), c.currentScale > c.zoomFactor && (c.currentScale = c.zoomFactor)), c.zoomImage(!0), !e.preventDefault) ) return !1; e.preventDefault(); } }), (c.setupMarkers = function () { var e, t; c.totalMarkers = c.markersList_ar.length; for (var o = 0; o < c.totalMarkers; o++) (t = c.markersList_ar[o]), FWDMarker.setPrototype(), (e = new FWDMarker(t.markerId, t.normalStatePath_str, t.selectedStatePath_str, t.type, t.regPoint, t.toolTipLabel, t.markerWidth, t.markerHeight)), "tooltip" == t.type ? ((e.toolTipId = 0), (e.innerHTML_str = t.innerHTML), (e.toolTipWindowMaxWidth = t.maxWidth)) : "infowindow" == t.type ? (e.innerHTML_str = t.innerHTML) : "link" == t.type && ((e.link_str = t.link), (e.target_str = t.target)), c.markers_ar.push(e), c.addChild(e); }), (c.markerOnMouseOverHandler = function (e) { var t = e.target; t.hasToolTip_bl && c.showMarkerToolTip(t, t.toolTipLabel_str), "tooltip" == t.type_str && (c.lastMarkerId_str != t.markerId && c.hideToolTipWindow(), (c.lastMarkerId_str = t.markerId), (c.curMarker_do = t), clearTimeout(c.hideToolTipWindowId_to), c.showToolTipWindow(t, t.innerHTML_str, t.toolTipWindowMaxWidth)); }), (c.markerOnMouseOutHandler = function (e) { var t = e.target; if (t.hasToolTip_bl && c.markersToolTip_do) { c.contains(c.markersToolTip_do) && c.removeChild(c.markersToolTip_do); try { document.removeChild(c.markersToolTip_do.screen); } catch (e) { } c.markersToolTip_do.hide(); } "tooltip" == t.type_str && (c.toolTipWindowAddEventsToSetGlobalXAndGlobalY(), clearTimeout(c.hideToolTipWindowId_to), (c.hideToolTipWindowId_to = setTimeout(c.hideToolTipWindowWithDelay, 300))); }), (c.markerOnStartHandler = function (e) { var t = e.target; "infowindow" == t.type_str ? c.dispatchEvent(s.SHOW_INFO, { text: t.innerHTML_str }) : "tooltip" == t.type_str && (c.lastMarkerId_str != t.markerId && c.hideToolTipWindow(), (c.curMarker_do = t), (c.lastMarkerId_str = t.markerId), c.toolTipWindowAddEventsToSetGlobalXAndGlobalY(), c.showToolTipWindow(t, t.innerHTML_str, t.toolTipWindowMaxWidth)); }), (c.showMarkersWithAlphaForChromeFirstTime_bl = !0), (c.showOrHideMarkers = function () { for (var e, t, o, n = c.playListData_ar[c.curSet][c.curId].markersPosition_ar, i = 0; i < c.totalMarkers; i++) (e = c.markers_ar[i]).isActive_bl = !1; if (n) { o = n.length; for (i = 0; i < o; i++) { t = n[i]; for (var s = 0; s < c.totalMarkers; s++) (e = c.markers_ar[s]), t.markerId != e.markerId || e.isActive_bl || ((e.originalX = t.x), (e.originalY = t.y), e.show(), (e.isActive_bl = !0)); } } for (i = 0; i < c.totalMarkers; i++) (e = c.markers_ar[i]).isActive_bl || e.hide(), e.isActive_bl && c.showMarkersWithAlphaForChromeFirstTime_bl && e.showOnChromeOnce(); c.showMarkersWithAlphaForChromeFirstTime_bl = !1; }), (c.positionMarkers = function (e) { for (var t, o = 0; o < c.totalMarkers; o++) (t = c.markers_ar[o]).isActive_bl && ((t.finalX = c.finalX + t.offsetX + Math.round(t.originalX * c.currentScale)), (t.finalY = c.finalY + t.offsetY + Math.round(t.originalY * c.currentScale)), e ? (FWDAnimation.killTweensOf(t), FWDAnimation.to(t, 0.2, { x: t.finalX, y: t.finalY })) : (FWDAnimation.killTweensOf(t), t.setX(t.finalX), t.setY(t.finalY))); }), (c.setupMarkersToolTip = function () { FWDMarkerToolTip.setPrototype(), (c.markersToolTip_do = new FWDMarkerToolTip( c.toolTipLeft_img, c.toolTipPointer_img, c.buttonToolTipLeft_str, c.buttonToolTipMiddle_str, c.buttonToolTipRight_str, c.buttonToolTipFontColor_str, c.buttonToolTipTopPointer_str, c.buttonToolTipBottomPointer_str )), (c.markersToolTip_do.getStyle().zIndex = 99999999); }), (c.setupMarkersToolTipWindow = function () { FWDMarkerWindowToolTip.setPrototype(), (c.markersToolTipWindow_do = new FWDMarkerWindowToolTip(c, c.toolTipPointer_img, c.buttonToolTipTopPointer_str, c.buttonToolTipBottomPointer_str)), (c.markersToolTipWindow_do.screen.style.zIndex = 99999999), document.documentElement.appendChild(c.markersToolTipWindow_do.screen); }), (c.showMarkerToolTip = function (e, t) { c.getX(); var o, n, i, s = 0; document.documentElement.appendChild(c.markersToolTip_do.screen), c.markersToolTip_do.setLabel(t), c.markersToolTip_do.show(), clearTimeout(c.showMarkerToolTipId_to), (c.showMarkerToolTipId_to = setTimeout(function () { c.markersToolTip_do.isShowed_bl && ((n = e.finalY - c.markersToolTip_do.totalHeight - c.markerToolTipOffsetY + c.getGlobalY() + u.scrollOffsets.y) - u.scrollOffsets.y < 0 ? ((n = e.finalY + e.height + c.markerToolTipOffsetY + c.getGlobalY() + u.scrollOffsets.y + c.markersToolTip_do.pointerHeight), c.markersToolTip_do.pointerUp_sdo.setVisible(!0), c.markersToolTip_do.pointerDown_sdo.setVisible(!1), (i = FWDMarkerWindowToolTip.POINTER_UP)) : (c.markersToolTip_do.pointerUp_sdo.setVisible(!1), c.markersToolTip_do.pointerDown_sdo.setVisible(!0), (i = FWDMarkerWindowToolTip.POINTER_DOWN)), (o = parseInt(e.finalX + (e.width - c.markersToolTip_do.totalWidth) / 2) + c.getGlobalX() + u.scrollOffsets.x) < 0 ? ((s = o), (o = 0)) : o + c.markersToolTip_do.totalWidth > u.ws.w && ((s = -(u.ws.w - o - c.markersToolTip_do.totalWidth)), (o = u.ws.w - c.markersToolTip_do.totalWidth)), c.markersToolTip_do.setX(o), c.markersToolTip_do.setY(n), c.markersToolTip_do.positionPointer(s, i)); }, 80)); }), (c.showToolTipWindow = function (e, t, o) { if (c.markersToolTipWindow_do.toolTipWindowId != e.toolTipWindowId) { c.getX(); var n, i, s, r = 0; c.markersToolTipWindow_do.setLabel(t, o), (c.markersToolTipWindow_do.toolTipWindowId = e.toolTipWindowId), clearTimeout(c.showToolTipWindoId_to), (c.showToolTipWindoId_to = setTimeout(function () { (i = e.finalY - c.markersToolTipWindow_do.totalHeight - c.markerToolTipOffsetY + c.getGlobalY() + u.scrollOffsets.y) - u.scrollOffsets.y < 0 ? ((i = e.finalY + e.height + c.markerToolTipOffsetY + c.getGlobalY() + u.scrollOffsets.y + c.markersToolTipWindow_do.pointerHeight), c.markersToolTipWindow_do.pointerUp_sdo.setVisible(!0), c.markersToolTipWindow_do.pointerDown_sdo.setVisible(!1), (s = FWDMarkerWindowToolTip.POINTER_UP)) : (c.markersToolTipWindow_do.pointerUp_sdo.setVisible(!1), c.markersToolTipWindow_do.pointerDown_sdo.setVisible(!0), (s = FWDMarkerWindowToolTip.POINTER_DOWN)), (n = parseInt(e.finalX + (e.width - c.markersToolTipWindow_do.totalWidth) / 2) + c.getGlobalX() + u.scrollOffsets.x) < 0 ? ((r = n), (n = 0)) : n + c.markersToolTipWindow_do.totalWidth > u.ws.w && ((r = -(u.ws.w - n - c.markersToolTipWindow_do.totalWidth)), (n = u.ws.w - c.markersToolTipWindow_do.totalWidth)), c.markersToolTipWindow_do.show(), c.markersToolTipWindow_do.setX(n), c.markersToolTipWindow_do.setY(i), c.markersToolTipWindow_do.positionPointer(r, s); }, 80)); } }), (c.toolTipWindowAddEventsToSetGlobalXAndGlobalY = function () { c.isMobile_bl ? (c.addHideToolTipWindowTestWithDelayId_to = setTimeout(function () { c.hasPointerEvent_bl ? (window.addEventListener("MSPointerDown", c.hideToolTipWindowTest), window.addEventListener("MSPointerMove", c.hideToolTipWindowTest)) : window.addEventListener("touchstart", c.hideToolTipWindowTest); }, 50)) : window.addEventListener ? window.addEventListener("mousemove", c.hideToolTipWindowTest) : document.attachEvent && document.attachEvent("onmousemove", c.hideToolTipWindowTest); }), (c.hideToolTipWindowTest = function (e) { var t = FWDUtils.getViewportMouseCoordinates(e); (c.globalX = t.screenX), (c.globalY = t.screenY), (e.touches || e.pointerType != e.MSPOINTER_TYPE_MOUSE) && c.hideToolTipWindowWithDelay(); }), (c.hideToolTipWindowWithDelay = function (e) { FWDUtils.hitTest(c.markersToolTipWindow_do.screen, c.globalX, c.globalY) || FWDUtils.hitTest(c.curMarker_do.screen, c.globalX, c.globalY) ? (c.hideToolTipWindowId_to = setTimeout(c.hideToolTipWindowWithDelay, 300)) : (c.hideToolTipWindow(), c.isMobile_bl ? (clearTimeout(c.addHideToolTipWindowTestWithDelayId_to), c.hasPointerEvent_bl ? (window.removeEventListener("MSPointerDown", c.hideToolTipWindowTest), window.removeEventListener("MSPointerMove", c.hideToolTipWindowTest)) : window.removeEventListener("touchstart", c.hideToolTipWindowTest)) : window.removeEventListener ? window.removeEventListener("mousemove", c.hideToolTipWindowTest) : document.detachEvent && document.detachEvent("onmousemove", c.hideToolTipWindowTest)); }), (c.hideToolTipWindow = function () { c.markersToolTipWindow_do && (clearTimeout(c.hideToolTipWindowId_to), c.markersToolTipWindow_do.hide(), (c.markersToolTipWindow_do.toolTipWindowId = "none")); }), (c.setupMarkersInfo = function () { window.addEventListener ? (window.addEventListener("mousemove", c.showMarkersInfoPosition), window.addEventListener("mousewheel", c.showMarkersInfoPosition), window.addEventListener("DOMMouseScroll", c.showMarkersInfoPosition)) : document.attachEvent && (document.attachEvent("onmousemove", c.showMarkersInfoPosition), document.attachEvent("onmousewheel", c.showMarkersInfoPosition)), (c.markersPositionInfo_sdo = new FWDSimpleDisplayObject("div")), c.markersPositionInfo_sdo.setDisplay("inline-block"), (c.markersPositionInfo_sdo.getStyle().fontSmoothing = "antialiased"), (c.markersPositionInfo_sdo.getStyle().webkitFontSmoothing = "antialiased"), (c.markersPositionInfo_sdo.getStyle().textRendering = "optimizeLegibility"), (c.markersPositionInfo_sdo.getStyle().padding = "6px"), (c.markersPositionInfo_sdo.getStyle().fontFamily = "Arial"), (c.markersPositionInfo_sdo.getStyle().fontSize = "12px"), (c.markersPositionInfo_sdo.getStyle().lineHeight = "20px"), (c.markersPositionInfo_sdo.getStyle().color = "#000000"), c.markersPositionInfo_sdo.setBkColor("#FFFFFF"), c.addChild(c.markersPositionInfo_sdo); }), (c.showMarkersInfoPosition = function (e) { var t = FWDUtils.getViewportMouseCoordinates(e), o = c.getGlobalX(), n = c.getGlobalY(), i = t.screenX - o, s = t.screenY - n, r = parseInt((i - c.finalX) * (1 / c.currentScale)), l = parseInt((s - c.finalY) * (1 / c.currentScale)), a = i + 10, d = s + 10; c.markersPositionInfo_sdo.setInnerHTML("Image nr:" + (c.curId + 1) + "
    x:" + r + " y:" + l + ""); var u = c.markersPositionInfo_sdo.getWidth(), h = c.markersPositionInfo_sdo.getHeight(); a + u > c.stageWidth && (a = a - u - 10), d + h > c.stageHeight && (d = d - h - 10), c.markersPositionInfo_sdo.setX(a), c.markersPositionInfo_sdo.setY(d); }), (c.setDraggingMode = function (e) { c.draggingMode_str = e; }), (c.disableOrEnablePanOrTouch = function (e) { c.disablePanOrRotate_bl = e; }), (c.zoomInOrOutWithScrollBar = function (e) { (c.currentScale = e * (c.zoomFactor - c.smallestPossibleScale) + c.smallestPossibleScale), (c.mouseX = c.stageWidth / 2), (c.mouseY = c.stageHeight / 2), c.zoomImage(!0); }), (c.dispatchScrollBarUpdate = function (e, t) { (c.disablePanOrRotate_bl && !t) || c.dispatchEvent(s.SCROLL_BAR_UPDATE, { percent: (c.currentScale - c.smallestPossibleScale) / (c.zoomFactor - c.smallestPossibleScale), animate: e }); }), (c.zoomInOrOutWithButtons = function (e, t) { (c.mouseX = c.stageWidth / 2), (c.mouseY = c.stageHeight / 2), 0 < e ? ((c.currentScale += t ? c.zoomSpeed : c.zoomSpeed / 15), c.currentScale > c.zoomFactor && (c.currentScale = c.zoomFactor)) : e < 0 && ((c.currentScale -= t ? c.zoomSpeed : c.zoomSpeed / 15), parseFloat(c.currentScale.toFixed(5)) <= parseFloat(c.smallestPossibleScale.toFixed(5)) && (c.currentScale = c.smallestPossibleScale)), c.dispatchScrollBarUpdate(!0, !0), c.zoomImage(!0); }), (c.centerImage = function () { (c.mouseX = c.stageWidth / 2), (c.mouseY = c.stageHeight / 2), (c.finalX = Math.round((c.stageWidth - c.finalWidth) / 2)), (c.finalY = Math.round((c.stageHeight - c.finalHeight) / 2)), c.resizeAndPositionSmallImage(!1), c.positionMarkers(); }), (c.updateNavigator = function (e) { c.isNavigatorShowed_bl && c.dispatchEvent(s.UPDATE_NAVIGATOR, { percentX: Math.abs(c.finalX / (c.finalWidth - c.stageWidth)), percentY: Math.abs(c.finalY / (c.finalHeight - c.stageHeight)), percentWidth: c.stageWidth / c.finalWidth, percentHeight: c.stageHeight / c.finalHeight, animate: e, }); }), (c.hideOrShowNavigator = function () { c.stageWidth < c.finalWidth || c.stageHeight < c.finalHeight ? ((c.isNavigatorShowed_bl = !0), c.dispatchEvent(s.SHOW_NAVIGATOR)) : ((c.isNavigatorShowed_bl = !1), c.dispatchEvent(s.HIDE_NAVIGATOR)); }), (c.updateOnNavigatorPan = function (e, t) { (c.finalX = parseInt(e * (c.stageWidth - c.finalWidth))), (c.finalY = parseInt(t * (c.stageHeight - c.finalHeight))), c.positionMarkers(!0), c.resizeAndPositionSmallImage(!0); }), (c.cleanMainEvents = function () { window.addEventListener || window.attachEvent, c.isMobile_bl ? (c.dumy_sdo.screen.removeEventListener("touchstart", c.panStartHandler), c.dumy_sdo.screen.removeEventListener("MSPointerDown", c.panStartHandler), window.removeEventListener("touchmove", c.panMoveHandler), window.removeEventListener("touchend", c.panEndHandler), window.removeEventListener("MSPointerMove", c.panMoveHandler), window.removeEventListener("MSPointerUp", c.panEndHandler), c.dumy_sdo.screen.removeEventListener("touchstart", c.rotateStartHandler), c.dumy_sdo.screen.removeEventListener("MSPointerDown", c.rotateStartHandler), window.removeEventListener("touchmove", c.rotateMoveHandler), window.removeEventListener("touchend", c.rotateEndHandler), window.removeEventListener("MSPointerMove", c.rotateMoveHandler), window.removeEventListener("MSPointerUp", c.rotateEndHandler), window.removeEventListener("touchstart", c.hideToolTipWindowTest), window.removeEventListener("MSPointerDown", c.hideToolTipWindowTest), window.removeEventListener("MSPointerMove", c.hideToolTipWindowTest), c.screen.removeEventListener("gesturestart", c.gestureStartHandler), c.screen.removeEventListener("gesturechange", c.gestureChangeHandler)) : window.removeEventListener ? (c.dumy_sdo.screen.removeEventListener("mousedown", c.panStartHandler), window.removeEventListener("mousemove", c.panMoveHandler), window.removeEventListener("mouseup", c.panEndHandler), c.dumy_sdo.screen.removeEventListener("mousedown", c.rotateStartHandler), window.removeEventListener("mousemove", c.rotateMoveHandler), window.removeEventListener("mouseup", c.rotateEndHandler), c.dumy_sdo.screen.removeEventListener("mousewheel", c.mouseWheelHandler), c.dumy_sdo.screen.removeEventListener("DOMMouseScroll", c.mouseWheelHandler), window.removeEventListener("mousemove", c.hideToolTipWindowTest), window.removeEventListener("mousemove", c.showMarkersInfoPosition), window.removeEventListener("mousewheel", c.showMarkersInfoPosition), window.removeEventListener("DOMMouseScroll", c.showMarkersInfoPosition)) : document.detachEvent && (document.detachEvent("onmousemove", c.panMoveHandler), document.detachEvent("onmouseup", c.panEndHandler), c.dumy_sdo.screen.detachEvent("onmousedown", c.panStartHandler), c.dumy_sdo.screen.detachEvent("onmousedown", c.rotateStartHandler), document.detachEvent("onmousemove", c.rotateMoveHandler), document.detachEvent("onmouseup", c.rotateEndHandler), c.dumy_sdo.screen.detachEvent("onmousewheel", c.mouseWheelHandler), document.detachEvent("onmousemove", c.hideToolTipWindowTest), document.detachEvent("onmousemove", c.showMarkersInfoPosition), document.detachEvent("onmousewheel", c.showMarkersInfoPosition)), clearTimeout(c.tweenDone_to), clearTimeout(c.removeSmallSDOId_to), clearTimeout(c.setAlphaWithDelayId_to), clearTimeout(c.hideToolTipWindowId_to), clearTimeout(c.addHideToolTipWindowTestWithDelayId_to), clearTimeout(c.showToolTipWindoId_to), clearTimeout(c.showMarkerToolTipId_to), clearInterval(c.dragAndSpinId_int); }), (c.destroy = function () { if ( (c.cleanMainEvents(), c.largeImage_img && ((c.largeImage_img.onerror = null), (c.largeImage_img.onload = null), (c.largeImage_img.src = "")), c.mainImagesHolder_do && (FWDAnimation.killTweensOf(c.mainImagesHolder_do), c.mainImagesHolder_do.destroy()), c.smallImage_sdo && (FWDAnimation.killTweensOf(c.smallImage_sdo), c.smallImage_sdo.destroy()), c.showMarkers_bl) ) { for (var e, t = 0; t < c.totalMarkers; t++) (e = c.markers_ar[t]), FWDAnimation.killTweensOf(e), e.destroy(); c.markersToolTip_do && c.markersToolTip_do.destroy(), c.markersToolTipWindow_do.destroy(); } c.addCorrectionForWebKit_bl && (FWDAnimation.killTweensOf(c.left_sdo), FWDAnimation.killTweensOf(c.top_sdo), FWDAnimation.killTweensOf(c.right_sdo), FWDAnimation.killTweensOf(c.bottom_sdo), c.left_sdo.destroy(), c.top_sdo.destroy(), c.right_sdo.destroy(), c.bottom_sdo.destroy()); for (t = 0; t < c.smallDos_ar.length; t++) { var o = c.smallDos_ar[t]; FWDAnimation.killTweensOf(o), o.destroy(); } c.largeImage_sdo && (FWDAnimation.killTweensOf(c.largeImage_sdo), c.largeImage_sdo.destroy()), c.markersPositionInfo_sdo && (c.markersPositionInfo_sdo.setInnerHTML(""), c.markersPositionInfo_sdo.destroy()), (u = n = null), (c.playListData_ar = null), (c.images_ar = null), (c.smallDos_ar = null), (c.markers_ar = null), (c.markersList_ar = null), (c.markersPosition_ar = null), (c.largeImagesPaths_ar = null), (c.hider = null), (c.curMarker_do = null), (c.prevSmall_sdo = null), (c.largeImage_img = null), (c.dumy_sdo = null), (c.mainImagesHolder_do = null), (c.smallImage_sdo = null), (c.largeImage_sdo = null), (c.left_sdo = null), (c.top_sdo = null), (c.right_sdo = null), (c.bottom_sdo = null), (c.markersPositionInfo_sdo = null), (c.handMovePath_str = null), (c.backgroundColor_str = null), (c.draggingMode_str = null), c.setInnerHTML(""), i.destroy(), (i = c = null), (s.prototype = null); }), c.init(); }; (s.setPrototype = function () { s.prototype = new FWDDisplayObject("div"); }), (s.LARGE_IMAGE_LOAD_ERROR = "largeImageLoadError"), (s.IMAGE_ZOOM_COMPLETE = "zoomComplete"), (s.SCROLL_BAR_UPDATE = "scrollBarUpdate"), (s.PAN_START = "panStart"), (s.ROTATE_START = "rotateStart"), (s.ROTATE_UPDATE = "rotateUpdate"), (s.ROTATE = "rotate"), (s.PAN = "pan"), (s.UPDATE_NAVIGATOR = "updateNavigator"), (s.SHOW_NAVIGATOR = "showNavigator"), (s.HIDE_NAVIGATOR = "hideNavigator"), (s.SHOW_INFO = "showInfo"), (s.prototype = null), (window.FWDImageManager = s); })(window), (function (e) { var n = function (e, t) { var o = this; n.prototype; (this.textHolder_do = null), this.img_do, (this.warningIconPath_str = t), (this.show_to = null), (this.isShowed_bl = !1), (this.isShowedOnce_bl = !1), (this.allowToRemove_bl = !0), (this.init = function () { o.setResizableSizeAfterParent(), (o.getStyle().width = "80%"), (o.textHolder_do = new FWDDisplayObject("div")), FWDUtils.isIEAndLessThen9 || (o.textHolder_do.getStyle().font = "Arial"), (o.textHolder_do.getStyle().wordWrap = "break-word"), (o.textHolder_do.getStyle().padding = "10px"), (o.textHolder_do.getStyle().paddingLeft = "42px"), (o.textHolder_do.getStyle().lineHeight = "18px"), o.textHolder_do.setBkColor("#EEEEEE"); var e = new Image(); (e.src = this.warningIconPath_str), (this.img_do = new FWDDisplayObject("img")), this.img_do.setScreen(e), this.img_do.setWidth(28), this.img_do.setHeight(28), o.addChild(o.textHolder_do), o.addChild(o.img_do); }), (this.showText = function (e) { o.isShowedOnce_bl || (o.screen.addEventListener ? o.screen.addEventListener("click", o.closeWindow) : o.screen.attachEvent && o.screen.attachEvent("onclick", o.closeWindow), (o.isShowedOnce_bl = !0)), o.textHolder_do.setInnerHTML(e), clearTimeout(o.show_to), o.show(); }), (this.show = function () { (o.isShowed_bl = !0), o.setVisible(!0), setTimeout(function () { o.positionAndResize(); }, 60); }), (this.positionAndResize = function () { o.setHeight(o.textHolder_do.getHeight()), o.img_do.setX(6), o.img_do.setY(parseInt((o.h - o.img_do.h) / 2)); }), (this.closeWindow = function () { if (o.allowToRemove_bl) { (o.isShowed_bl = !1), clearTimeout(o.show_to); try { e.main_do.removeChild(o); } catch (e) { } } }), this.init(); }; (n.setPrototype = function () { n.prototype = new FWDDisplayObject("div", "relative"); }), (n.prototype = null), (e.FWDInfo = n); })(window), (function (d) { var e = navigator.platform, t = !1; if ((("iPad" != e && "iPhone" != e) || (t = !0), t)) { var o = !1; if ((-1 != navigator.userAgent.indexOf("6") && (o = !0), o)) { var n = {}, i = {}, s = d.setTimeout, u = d.setInterval, r = d.clearTimeout, l = d.clearInterval; (d.setTimeout = function () { return a(s, n, arguments); }), (d.setInterval = function () { return a(u, i, arguments); }), (d.clearTimeout = function (e) { var t = n[e]; t && (delete n[e], r(t.id)); }), (d.clearInterval = function (e) { var t = i[e]; t && (delete i[e], l(t.id)); }), d.addEventListener("scroll", function () { var e; for (e in n) h(s, r, n, e); for (e in i) h(u, l, i, e); }); } } function a(e, t, o) { var n, i = o[0], s = e === u; return ( (o[0] = function () { i && (i.apply(d, arguments), s || (delete t[n], (i = null))); }), (n = e.apply(d, o)), (t[n] = { args: o, created: Date.now(), cb: i, id: n }), n ); } function h(e, t, o, n, i) { var s = o[n]; if (s) { var r = e === u; if ((t(s.id), !r)) { var l = s.args[1], a = Date.now() - s.created; a < 0 && (a = 0), (l -= a) < 0 && (l = 0), (s.args[1] = l); } (s.args[0] = function () { s.cb && (s.cb.apply(d, arguments), r || (delete o[n], (s.cb = null))); }), (s.created = Date.now()), (s.id = e.apply(d, s.args)); } } })(window), (function (a) { var d = function (o, e, t, n, i, s) { var r = this, l = d.prototype; (this.mainLightBox_do = null), (this.lightBoxBackground_sdo = null), (this.lightBoxGridHolder_do = null), (this.closeButton_do = null), (this.mainBackgroundColor_str = e), (this.holderBackgroundColor_str = t), (this.lightBoxBackgroundOpacity = n), (this.lightBoxWidth = i), (this.lightBoxHeight = s), this.setupButtonWithDelayId_to, (this.isMobile_bl = FWDUtils.isMobile), (this.hasPointerEvent_bl = FWDUtils.hasPointerEvent), (this.closeButtonIsTweening_bl = !0), (this.init = function () { (r.getStyle().zIndex = 9999999), r.setupMainContainers(); }), (this.setupMainContainers = function () { var e = FWDUtils.getViewportSize(), t = FWDUtils.getScrollOffsets(); r.isMobile_bl && r.hasPointerEvent_bl && (r.getStyle().msTouchAction = "none"), r.setWidth(e.w), r.setHeight(e.h), r.setX(t.x), r.setY(t.y), (r.lightBoxBackground_sdo = new FWDSimpleDisplayObject("div")), r.lightBoxBackground_sdo.setResizableSizeAfterParent(), r.lightBoxBackground_sdo.setBkColor(r.mainBackgroundColor_str), r.addChild(r.lightBoxBackground_sdo), (r.mainLightBox_do = new FWDDisplayObject("div")), r.mainLightBox_do.setBkColor(r.holderBackgroundColor_str), (o.stageContainer = r.mainLightBox_do.screen), r.addChild(r.mainLightBox_do), -1 == navigator.userAgent.toLowerCase().indexOf("msie 7") ? document.documentElement.appendChild(r.screen) : document.getElementsByTagName("body")[0].appendChild(r.screen), r.lightBoxBackground_sdo.setAlpha(0), FWDAnimation.to(r.lightBoxBackground_sdo, 0.8, { alpha: r.lightBoxBackgroundOpacity }), r.setX(t.x), r.setY(t.y), r.mainLightBox_do.setWidth(0), r.mainLightBox_do.setHeight(0), r.mainLightBox_do.setX(parseInt(e.w / 2)), r.mainLightBox_do.setY(parseInt(e.h / 2)), r.lightBoxWidth > e.w ? ((r.finalLightBoxWidth = e.w), (r.finalLightBoxHeight = parseInt(r.lightBoxHeight * (e.w / r.lightBoxWidth)))) : ((r.finalLightBoxWidth = r.lightBoxWidth), (r.finalLightBoxHeight = r.lightBoxHeight)), FWDAnimation.to(r.mainLightBox_do, 0.8, { w: r.finalLightBoxWidth, h: r.finalLightBoxHeight, x: parseInt((e.w - r.finalLightBoxWidth) / 2), y: parseInt((e.h - r.finalLightBoxHeight) / 2), delay: 0.4, ease: Expo.easeInOut, }); }), (this.setupCloseButton = function (e, t) { var o = FWDUtils.getViewportSize(); FWDSimpleButton.setPrototype(), (r.closeButton_do = new FWDSimpleButton(e, t)), r.closeButton_do.addListener(FWDSimpleButton.MOUSE_DOWN, r.closeButtonOnStartHandler), r.addChild(r.closeButton_do); var n = parseInt((o.w + r.finalLightBoxWidth) / 2 - r.closeButton_do.totalWidth / 2), i = parseInt((o.h - r.finalLightBoxHeight) / 2 - r.closeButton_do.totalHeight / 2); n + r.closeButton_do.totalWidth > o.w && (n = o.w - r.closeButton_do.totalWidth), i < 0 && (i = 0), r.closeButton_do.setX(o.w), r.closeButton_do.setY(i), FWDAnimation.to(r.closeButton_do, 0.9, { x: n, onComplete: r.showCloseButtonComplete, ease: Expo.easeInOut }), r.isMobile_bl ? r.hasPointerEvent_bl || (a.addEventListener("touchstart", r.mouseDummyHandler), a.addEventListener("touchmove", r.mouseDummyHandler)) : a.addEventListener ? (a.addEventListener("mousewheel", r.mouseDummyHandler), a.addEventListener("DOMMouseScroll", r.mouseDummyHandler)) : document.attachEvent && document.attachEvent("onmousewheel", r.mouseDummyHandler); }), (this.showCloseButtonComplete = function () { r.closeButtonIsTweening_bl = !1; }), (this.mouseDummyHandler = function (e) { if (!e.preventDefault) return !1; e.preventDefault(); }), (this.closeButtonOnStartHandler = function (e) { var t = FWDUtils.getViewportSize(); (r.closeButton_do.isDisabled_bl = !0), FWDAnimation.to(r.closeButton_do, 0.9, { x: t.w, ease: Expo.easeInOut }), FWDAnimation.to(r.mainLightBox_do, 0.8, { w: 0, h: 0, x: parseInt(t.w / 2), y: parseInt(t.h / 2), delay: 0.4, ease: Expo.easeInOut }), FWDAnimation.to(r.lightBoxBackground_sdo, 0.8, { alpha: 0, delay: 0.8 }), (r.lighboxAnimDoneId_to = setTimeout(r.lighboxHideAnimationDone, 1600)), r.dispatchEvent(d.CLOSE); }), (this.lighboxHideAnimationDone = function () { r.dispatchEvent(d.HIDE_COMPLETE); }), (r.destroy = function () { try { -1 == navigator.userAgent.toLowerCase().indexOf("msie 7") ? document.documentElement.removeChild(r.screen) : document.getElementsByTagName("body")[0].removeChild(r.screen); } catch (e) { } r.isMobile_bl ? r.hasPointerEvent_bl || (a.removeEventListener("touchstart", r.mouseDummyHandler), a.removeEventListener("touchmove", r.mouseDummyHandler)) : a.removeEventListener ? (a.removeEventListener("mousewheel", r.mouseDummyHandler), a.removeEventListener("DOMMouseScroll", r.mouseDummyHandler)) : document.detachEvent && document.detachEvent("onmousewheel", r.mouseDummyHandler), clearTimeout(r.lighboxAnimDoneId_to), r.lightBoxBackground_sdo && (FWDAnimation.killTweensOf(r.lightBoxBackground_sdo), r.lightBoxBackground_sdo.destroy()), r.lightBoxGridHolder_do && (FWDAnimation.killTweensOf(r.lightBoxGridHolder_do), r.lightBoxGridHolder_do.destroy()), r.closeButton_do && (FWDAnimation.killTweensOf(r.closeButton_do), r.closeButton_do.destroy()), (r.mainLightBox_do = null), (r.lightBoxBackground_sdo = null), (r.lightBoxGridHolder_do = null), (r.closeButton_do = null), (r.mainBackgroundColor_str = null), (r.holderBackgroundColor_str = null), (t = e = o = null), r.setInnerHTML(""), l.destroy(), (l = r = null), (d.prototype = null); }), this.init(); }; (d.setPrototype = function () { d.prototype = new FWDDisplayObject("div"); }), (d.CLOSE = "ligtBoxClose"), (d.HIDE_COMPLETE = "hideComplete"), (d.prototype = null), (a.FWDLightBox = d); })(window), (function (u) { var h = function (e, t, o, n, i, s, r, l) { var a = this, d = h.prototype; this.n_do, this.s_do, (this.markerId = e), (this.normalImagePath_str = t), (this.selectedImagePath_str = o), (this.type_str = n), (this.toolTipLabel_str = s), this.innerHTML_str, this.link_str, this.target_str, (this.regPoint_str = i), this.toolTipWindowId, (this.width = r), (this.height = l), this.toolTipId, this.originalX, this.originalY, this.finalX, this.finalY, this.offsetX, this.offsetY, this.toolTipWindowMaxWidth, this.showId_to, (this.isDisabled_bl = !1), (this.hasToolTip_bl = !0), (this.isShowed_bl = !0), (this.isMobile_bl = FWDUtils.isMobile), (this.hasPointerEvent_bl = FWDUtils.hasPointerEvent), (a.init = function () { a.setOverflow("visible"), ("tooltip" != a.type_str && a.toolTipLabel_str) || (a.hasToolTip_bl = !1), "center" == a.regPoint_str ? ((a.offsetX = -parseInt(a.width / 2)), (a.offsetY = -parseInt(a.height / 2))) : "centertop" == a.regPoint_str ? ((a.offsetX = -parseInt(a.width / 2)), (a.offsetY = 0)) : "centerbottom" == a.regPoint_str && ((a.offsetX = -parseInt(a.width / 2)), (a.offsetY = -a.height)), a.setupMainContainers(), a.hide(); }), (a.setupMainContainers = function () { var e, t; (a.n_do = new FWDTransformDisplayObject("img")), ((e = new Image()).src = a.normalImagePath_str), (e.id = a.markerId), (e.className = a.markerId), a.n_do.setScreen(e), a.n_do.setWidth(a.width), a.n_do.setHeight(a.height), (a.w = a.n_do.w), (a.h = a.n_do.h), (a.s_do = new FWDTransformDisplayObject("img")), ((t = new Image()).src = a.selectedImagePath_str), a.s_do.setScreen(t), a.s_do.setWidth(a.width), a.s_do.setHeight(a.height), a.s_do.setAlpha(0), a.addChild(a.n_do), a.setButtonMode(!0), a.isMobile_bl ? a.hasPointerEvent_bl ? (a.screen.addEventListener("MSPointerDown", a.onMouseDown), a.screen.addEventListener("MSPointerUp", a.onClick), a.screen.addEventListener("MSPointerOver", a.onMouseOver), a.screen.addEventListener("MSPointerOut", a.onMouseOut)) : a.screen.addEventListener("touchstart", a.onMouseDown) : a.screen.addEventListener ? (a.screen.addEventListener("mouseover", a.onMouseOver), a.screen.addEventListener("mouseout", a.onMouseOut), a.screen.addEventListener("mousedown", a.onMouseDown), a.screen.addEventListener("click", a.onClick)) : a.screen.attachEvent && (a.screen.attachEvent("onmouseover", a.onMouseOver), a.screen.attachEvent("onmouseout", a.onMouseOut), a.screen.attachEvent("onmousedown", a.onMouseDown), a.screen.attachEvent("onclick", a.onClick)); }), (a.onMouseOver = function (e) { if (!e.pointerType || e.pointerType == e.MSPOINTER_TYPE_MOUSE) { if ((a.dispatchEvent(h.MOUSE_OVER, { e: e }), a.isDisabled_bl)) return; FWDAnimation.killTweensOf(a.s_do), FWDAnimation.to(a.s_do, 0.5, { alpha: 1, delay: 0.1, ease: Expo.easeOut }); } }), (a.onMouseOut = function (e) { if (!e.pointerType || e.pointerType == e.MSPOINTER_TYPE_MOUSE) { if ((a.dispatchEvent(h.MOUSE_OUT, { e: e }), a.isDisabled_bl)) return; FWDAnimation.killTweensOf(a.s_do), FWDAnimation.to(a.s_do, 0.5, { alpha: 0, ease: Expo.easeOut }); } }), (a.onClick = function (e) { a.isDisabled_bl || ("link" == a.type_str && (u.open(a.link_str, a.target_str), a.dispatchEvent(h.MOUSE_OUT, { e: e })), a.dispatchEvent(h.CLICK, { e: e })); }), (a.onMouseDown = function (e) { e.preventDefault && e.preventDefault(), a.isDisabled_bl || (a.isMobile_bl && !a.hasPointerEvent_bl && "link" == a.type_str && (u.open(a.link_str, a.target_str), a.dispatchEvent(h.MOUSE_OUT, { e: e })), a.dispatchEvent(h.MOUSE_DOWN, { e: e })); }), (a.hide = function () { a.isShowed_bl && ((a.isShowed_bl = !1), clearTimeout(a.showId_to), FWDAnimation.killTweensOf(a.n_do), a.n_do.setAlpha(0), a.hasTransform2d_bl ? (a.n_do.setScale(0), a.s_do.setScale(0)) : (a.n_do.setWidth(0), a.n_do.setHeight(0), a.s_do.setWidth(0), a.s_do.setHeight(0))); }), (a.show = function () { a.isShowed_bl || ((a.isShowed_bl = !0), clearTimeout(a.showId_to), (a.showId_to = setTimeout(function () { FWDAnimation.to(a.n_do, 0.8, { alpha: 1, ease: Quart.easeOut }), a.hasTransform2d_bl ? (a.n_do.setScale(1), a.s_do.setScale(1)) : (a.n_do.setWidth(r), a.n_do.setHeight(l), a.s_do.setWidth(r), a.s_do.setHeight(l)); }, 200))); }), (a.showOnChromeOnce = function () { a.n_do.setAlpha(0), FWDAnimation.to(a.n_do, 0.8, { alpha: 1, delay: 0.1, ease: Quart.easeOut }); }), (a.destroy = function () { a.isMobile_bl ? a.screen.removeEventListener("touchstart", a.onMouseDown) : a.screen.addEventListener ? (a.screen.removeEventListener("mouseover", a.onMouseOver), a.screen.removeEventListener("mouseout", a.onMouseOut), a.screen.removeEventListener("mousedown", a.onMouseDown), a.screen.removeEventListener("click", a.onClick)) : a.screen.detachEvent && (a.screen.detachEvent("onmouseover", a.onMouseOver), a.screen.detachEvent("onmouseout", a.onMouseOut), a.screen.detachEvent("onmousedown", a.onMouseDown), a.screen.detachEvent("onclick", a.onClick)), FWDAnimation.killTweensOf(a.n_do), FWDAnimation.killTweensOf(a.s_do), a.n_do.destroy(), a.s_do.destroy(), (a.n_do = null), (a.s_do = null), (a.markerId = null), (a.normalImagePath_str = null), (a.selectedImagePath_str = null), (a.type_str = null), (a.toolTipLabel_str = null), (a.innerHTML_str = null), (a.link_str = null), (a.target_str = null), (a.regPoint_str = null), (s = i = n = o = t = e = null), a.setInnerHTML(""), d.destroy(), (d = a = null), (h.prototype = null); }), a.init(); }; (h.setPrototype = function () { h.prototype = new FWDDisplayObject("div"); }), (h.CLICK = "onClick"), (h.MOUSE_OVER = "onMouseOver"), (h.MOUSE_OUT = "onMouseOut"), (h.MOUSE_DOWN = "onMouseDown"), (h.prototype = null), (u.FWDMarker = h); })(window), (function (e) { var u = function (e, t, o, n, i, s, r, l) { var a = this, d = u.prototype; a.pointerUp_img, a.pointerDown_img, (a.left_sdo = null), (a.middle_sdo = null), (a.right_sdo = null), (a.text_sdo = null), (a.pointerUp_sdo = null), (a.pointerDown_sdo = null), (a.leftImagePath_str = o), (a.middleImagePath_str = n), (a.rightImagePath_str = i), (a.fontColor_str = s), (a.bottomPointer_str = l), (a.topPointer_str = r), a.pointerPosition_str, a.toolTipLabel_str, (a.marginWidth = e.width), (a.totalHeight = e.height), (a.pointerWidth = t.width), (a.pointerHeight = t.height), a.totalWidth, (a.isMobile_bl = FWDUtils.isMobile), (a.isShowed_bl = !0), (a.init = function () { a.setOverflow("visible"), a.setWidth(300), a.setupMainContainers(), a.hide(); }), (a.setupMainContainers = function () { var e; (a.left_sdo = new FWDSimpleDisplayObject("img")), ((e = new Image()).src = a.leftImagePath_str), a.left_sdo.setScreen(e), a.left_sdo.setWidth(a.marginWidth), a.left_sdo.setHeight(a.totalHeight), a.addChild(a.left_sdo), (a.middle_sdo = new FWDSimpleDisplayObject("img")), ((e = new Image()).src = a.middleImagePath_str), a.middle_sdo.setScreen(e), a.middle_sdo.setX(a.marginWidth), a.middle_sdo.setWidth(a.marginWidth), a.middle_sdo.setHeight(a.totalHeight), a.middle_sdo.setBkColor("#FFFFFF"), a.addChild(a.middle_sdo), (a.right_sdo = new FWDSimpleDisplayObject("img")), ((e = new Image()).src = a.rightImagePath_str), a.right_sdo.setScreen(e), a.right_sdo.setWidth(a.marginWidth), a.right_sdo.setHeight(a.totalHeight), a.addChild(a.right_sdo), (a.text_sdo = new FWDSimpleDisplayObject("div")), a.text_sdo.setBackfaceVisibility(), a.text_sdo.setDisplay("inline-block"), (a.text_sdo.getStyle().fontFamily = "Arial"), (a.text_sdo.getStyle().fontSize = "12px"), a.text_sdo.setHeight(20), (a.text_sdo.getStyle().color = a.fontColor_str), (a.text_sdo.getStyle().fontSmoothing = "antialiased"), (a.text_sdo.getStyle().webkitFontSmoothing = "antialiased"), (a.text_sdo.getStyle().textRendering = "optimizeLegibility"), a.text_sdo.setX(a.marginWidth), FWDUtils.isIEAndLessThen9 || FWDUtils.isSafari ? a.text_sdo.setY(parseInt((a.totalHeight - 8) / 2) - 2) : a.text_sdo.setY(parseInt((a.totalHeight - 8) / 2) - 1), a.addChild(a.text_sdo), (a.pointerUp_img = new Image()), (a.pointerUp_img.src = a.topPointer_str), (a.pointerUp_sdo = new FWDSimpleDisplayObject("img")), a.pointerUp_sdo.setScreen(a.pointerUp_img), a.pointerUp_sdo.setWidth(a.pointerWidth), a.pointerUp_sdo.setHeight(a.pointerHeight), a.pointerUp_sdo.setVisible(!1), a.addChild(a.pointerUp_sdo), (a.pointerDown_img = new Image()), (a.pointerDown_img.src = a.bottomPointer_str), (a.pointerDown_sdo = new FWDSimpleDisplayObject("img")), a.pointerDown_sdo.setScreen(a.pointerDown_img), a.pointerDown_sdo.setWidth(a.pointerWidth), a.pointerDown_sdo.setHeight(a.pointerHeight), a.pointerDown_sdo.setVisible(!1), a.addChild(a.pointerDown_sdo), (a.totalHeight += a.pointerHeight); }), (a.setLabel = function (e) { null != a && a.middle_sdo && (a.text_sdo.setInnerHTML(e), setTimeout(function () { a.middle_sdo.setWidth(a.text_sdo.screen.offsetWidth), a.right_sdo.setX(a.text_sdo.screen.offsetWidth + a.marginWidth), (a.totalWidth = 2 * a.marginWidth + a.text_sdo.screen.offsetWidth); }, 79)); }), (a.positionPointer = function (e, t) { var o = 0, n = 0; e || (e = 0), (o = parseInt((a.totalWidth - a.pointerWidth) / 2) + e) < 0 && (o = 0), t == u.POINTER_DOWN ? ((n = a.totalHeight - a.pointerHeight - 1), a.pointerDown_sdo.setX(o), a.pointerDown_sdo.setY(n)) : ((n = 1 - a.pointerHeight), a.pointerUp_sdo.setX(o), a.pointerUp_sdo.setY(n)); }), (a.show = function () { a.isShowed_bl || (FWDAnimation.to(a, 0.4, { alpha: 1, delay: 0.1, ease: Quart.easeOut }), (a.isShowed_bl = !0)); }), (a.hide = function () { a.isShowed_bl && (FWDAnimation.killTweensOf(a), a.setX(-5e3), a.setAlpha(0), (a.isShowed_bl = !1)); }), (a.destroy = function () { FWDAnimation.killTweensOf(a), (a.pointerUp_img = null), (a.pointerDown_img = null), a.left_sdo.destroy(), a.middle_sdo.destroy(), a.right_sdo.destroy(), a.text_sdo.destroy(), a.pointerDown_sdo.destroy(), (a.leftImagePath_str = null), (a.middleImagePath_str = null), (a.rightImagePath_str = null), (a.fontColor_str = null), (a.bottomPointer_str = null), (a.topPointer_str = null), (a.pointerPosition_str = null), (a.toolTipLabel_str = null), (a.left_sdo = null), (a.middle_sdo = null), (a.right_sdo = null), (a.text_sdo = null), (a.pointerUp_sdo = null), (a.pointerDown_sdo = null), (l = r = s = i = n = o = t = e = null), a.setInnerHTML(""), d.destroy(), (d = a = null), (u.prototype = null); }), a.init(); }; (u.setPrototype = function () { u.prototype = new FWDDisplayObject("div"); }), (u.POINTER_UP = "pointerUp"), (u.POINTER_DOWN = "pointerDown"), (u.CLICK = "onClick"), (u.MOUSE_DOWN = "onMouseDown"), (u.prototype = null), (e.FWDMarkerToolTip = u); })(window), (function (e) { var r = function (n, e, t, o) { var i = this, s = r.prototype; i.pointerUp_img, i.pointerDown_img, (i.text_sdo = null), (i.pointerUp_sdo = null), (i.pointerDown_sdo = null), (i.bottomPointer_str = o), (i.topPointer_str = t), i.pointerPosition_str, i.toolTipLabel_str, (i.totalHeight = 0), (i.pointerWidth = e.width), (i.pointerHeight = e.height), i.totalWidth, i.maxWidth, (i.isMobile_bl = FWDUtils.isMobile), (i.isShowed_bl = !0), (i.hasLabel_bl = !1), (i.init = function () { i.setOverflow("visible"), i.setupMainContainers(), i.hide(); }), (i.setupMainContainers = function () { (i.text_sdo = new FWDSimpleDisplayObject("div")), i.text_sdo.setBackfaceVisibility(), (i.text_sdo.getStyle().fontSmoothing = "antialiased"), (i.text_sdo.getStyle().webkitFontSmoothing = "antialiased"), (i.text_sdo.getStyle().textRendering = "optimizeLegibility"), i.addChild(i.text_sdo), (i.pointerUp_img = new Image()), (i.pointerUp_img.src = i.topPointer_str), (i.pointerUp_sdo = new FWDSimpleDisplayObject("img")), i.pointerUp_sdo.setScreen(i.pointerUp_img), i.pointerUp_sdo.setWidth(i.pointerWidth), i.pointerUp_sdo.setHeight(i.pointerHeight), i.pointerUp_sdo.setVisible(!1), i.addChild(i.pointerUp_sdo), (i.pointerDown_img = new Image()), (i.pointerDown_img.src = i.bottomPointer_str), (i.pointerDown_sdo = new FWDSimpleDisplayObject("img")), i.pointerDown_sdo.setScreen(i.pointerDown_img), i.pointerDown_sdo.setWidth(i.pointerWidth), i.pointerDown_sdo.setHeight(i.pointerHeight), i.pointerDown_sdo.setVisible(!1), i.addChild(i.pointerDown_sdo); }), (i.setLabel = function (e, t) { if (null != i) { i.maxWidth = t; var o = Math.min(i.maxWidth, n.stageWidth); (i.totalWidth = o), i.setWidth(i.totalWidth), i.text_sdo.setInnerHTML(e), setTimeout(function () { (i.totalHeight = i.text_sdo.getHeight() + i.pointerHeight), i.setWidth(i.totalWidth), i.setHeight(i.totalHeight - i.pointerHeight); }, 79); } }), (i.positionPointer = function (e, t) { var o = 0, n = 0; e || (e = 0), (o = parseInt((i.totalWidth - i.pointerWidth) / 2) + e) < 0 && (o = 0), t == r.POINTER_DOWN ? ((n = i.totalHeight - i.pointerHeight - 1), i.pointerDown_sdo.setX(o), i.pointerDown_sdo.setY(n)) : ((n = 1 - i.pointerHeight), i.pointerUp_sdo.setX(o), i.pointerUp_sdo.setY(n)); }), (i.show = function () { i.isShowed_bl || (i.positionPointer(), i.isMobile_bl ? i.setAlpha(1) : FWDAnimation.to(i, 0.4, { alpha: 1, delay: 0.1, ease: Quart.easeOut }), (i.isShowed_bl = !0)); }), (i.hide = function () { i.isShowed_bl && (i.isMobile_bl || FWDAnimation.killTweensOf(i), i.setX(-5e3), i.setAlpha(0), i.text_sdo.setInnerHTML(""), (i.isShowed_bl = !1)); }), (i.destroy = function () { FWDAnimation.killTweensOf(i), i.text_sdo.destroy(), i.pointerUp_sdo.destroy(), i.pointerDown_sdo.destroy(), (i.text_sdo = null), (i.pointerUp_sdo = null), (i.pointerDown_sdo = null), (i.pointerUp_img = null), (i.pointerDown_img = null), (i.bottomPointer_str = null), (i.topPointer_str = null), (i.pointerPosition_str = null), (i.toolTipLabel_str = null), (o = t = e = n = null), i.setInnerHTML(""), s.destroy(), (s = i = null), (r.prototype = null); }), i.init(); }; (r.setPrototype = function () { (r.prototype = null), (r.prototype = new FWDDisplayObject("div")); }), (r.POINTER_UP = "pointerUp"), (r.POINTER_DOWN = "pointerDown"), (r.CLICK = "onClick"), (r.MOUSE_DOWN = "onMouseDown"), (r.prototype = null), (e.FWDMarkerWindowToolTip = r); })(window), (function (r) { var l = function (o, n) { var s = this, i = l.prototype; (this.hider = null), (this.mainHolder_do = null), (this.mainImagesHolder_do = null), (this.smallImage_sdo = null), (this.border_sdo = null), (this.handler_sdo = null), (this.images_ar = n.navigatorImages_ar), (this.iamgesSdo_ar = []), (this.borderColor_str = n.navigatorBorderColor_str), (this.handlerColor_str = n.navigatorHandlerColor_str), (this.handMovePath_str = n.handMovePath_str), (this.handGrabPath_str = n.handGrabPath_str), (this.navigatorPosition_str = n.navigatorPosition_str), (this.totalImages = s.images_ar.length), this.stageWidth, this.stageHeight, (this.totalWidth = n.navigatorWidth), (this.totalHeight = Math.round(s.totalWidth * (n.imageHeight / n.imageWidth))), (this.offsetX = n.navigatorOffsetX), (this.offsetY = n.navigatorOffsetY), this.finalWidth, this.finalHeight, this.finalX, this.finalY, this.xPositionOnPress, this.yPositionOnPress, this.lastPresedX, this.lastPresedY, this.tweenCompleteId_to, (this.isShowed_bl = !0), (this.isTweening_bl = !1), (this.isDragging_bl = !1), (this.isMobile_bl = FWDUtils.isMobile), (this.hasPointerEvent_bl = FWDUtils.hasPointerEvent), (s.init = function () { s.setOverflow("visible"), s.setSelectable(!1), s.setupMainContiners(), s.setupImagesSdos(0), s.hide(), s.resizeAndPosition(); }), (s.activate = function () { (s.images_ar = n.navigatorImages_ar), (s.totalImages = s.images_ar.length), s.setupImagesSdos(1), s.updateImage(o.imageManager_do.images_ar[o.imageManager_do.curId]), s.addPannSupport(), (s.screen.onmousedown = function () { s.dispatchEvent(l.MOUSE_DOWN); }), FWDUtils.isIEAndLessThen9 && (s.handler_sdo.screen.onmousedown = function () { s.dispatchEvent(l.MOUSE_DOWN); }); }), (s.resizeAndPosition = function () { (o.stageWidth == s.stageWidth && o.stageHeight == s.stageHeight) || ((s.stageWidth = o.stageWidth), (s.stageHeight = o.stageHeight), s.navigatorPosition_str == l.TOP_LEFT ? (s.setX(s.offsetX), s.setY(s.offsetY)) : s.navigatorPosition_str == l.TOP_RIGHT ? (s.setX(s.stageWidth - s.totalWidth - s.offsetX), s.setY(s.offsetY)) : s.navigatorPosition_str == l.BOTTOM_LEFT ? (s.setX(s.offsetX), s.setY(s.stageHeight - s.totalHeight - s.offsetY)) : s.navigatorPosition_str == l.BOTTOM_RIGHT && (s.setX(s.stageWidth - s.totalWidth - s.offsetX), s.setY(s.stageHeight - s.totalHeight - s.offsetY))); }), (s.setupHider = function (e) { (s.hider = e), s.hider.addListener(FWDHider.HIDE, s.onHiderHide); }), (s.onHiderHide = function () { FWDUtils.hitTest(s.mainHolder_do.screen, s.hider.globalX, s.hider.globalY) && s.hider.reset(); }), (s.setupMainContiners = function () { (s.mainHolder_do = new FWDDisplayObject("div", "absolute", "visible")), s.mainHolder_do.setWidth(s.totalWidth), s.mainHolder_do.setHeight(s.totalHeight), s.addChild(s.mainHolder_do), (s.mainImagesHolder_do = new FWDDisplayObject("div", "absolute", "visible")), (s.smallImage_sdo = new FWDSimpleDisplayObject("img")), s.mainHolder_do.addChild(s.mainImagesHolder_do), (s.border_sdo = new FWDSimpleDisplayObject("div")), s.border_sdo.setWidth(s.totalWidth - 2), s.border_sdo.setHeight(s.totalHeight - 2), (s.border_sdo.getStyle().borderStyle = "solid"), (s.border_sdo.getStyle().borderWidth = "1px"), (s.border_sdo.getStyle().borderColor = s.borderColor_str), s.mainHolder_do.addChild(s.border_sdo), (s.handler_sdo = new FWDSimpleDisplayObject("div")), s.handler_sdo.setWidth(s.totalWidth - 2), s.handler_sdo.setHeight(s.totalHeight - 2), (s.handler_sdo.getStyle().borderStyle = "solid"), (s.handler_sdo.getStyle().borderWidth = "1px"), FWDUtils.isIE && (s.handler_sdo.getStyle().background = "url('dumy')"), (s.handler_sdo.getStyle().borderColor = s.handlerColor_str), s.mainHolder_do.addChild(s.handler_sdo); }), (s.setupImagesSdos = function (e) { (s.image_canvas = new FWDSimpleDisplayObject("canvas")), (s.image_canvas.screen.width = s.totalWidth), (s.image_canvas.screen.height = s.totalHeight), (s.canvas_ctx = s.image_canvas.screen.getContext("2d")), s.mainHolder_do.addChildAt(s.image_canvas, 0); }), (s.updateImage = function (e) { "file:" != document.location.protocol && (s.canvas_ctx.clearRect(0, 0, s.image_canvas.width, s.image_canvas.height), s.canvas_ctx.drawImage(e, 0, 0, n.imageWidth, n.imageHeight, 0, 0, s.totalWidth, s.totalHeight)); }), (s.update = function (e, t, o, n, i) { 1 < o && (o = 1), 1 < n && (n = 1), 1 < e && (e = 1), 1 < t && (t = 1), isNaN(e) && (e = 0), isNaN(t) && (t = 0), (s.finalWidth = Math.round(o * (s.totalWidth - 4))), (s.finalHeight = Math.round(n * (s.totalHeight - 4))), (s.finalX = Math.round(e * (s.totalWidth - 2 - s.finalWidth))), (s.finalY = Math.round(t * (s.totalHeight - 2 - s.finalHeight))), clearTimeout(s.tweenCompleteId_to), i ? ((s.isTweening_bl = !0), (s.tweenCompleteId_to = setTimeout(function () { null != s && (s.isTweening_bl = !1); }, 200)), FWDAnimation.killTweensOf(s.handler_sdo), FWDAnimation.to(s.handler_sdo, 0.2, { x: s.finalX, y: s.finalY, w: s.finalWidth, h: s.finalHeight })) : ((s.isTweening_bl = !1), FWDAnimation.killTweensOf(s.handler_sdo), s.handler_sdo.setX(s.finalX), s.handler_sdo.setY(s.finalY), s.handler_sdo.setWidth(s.finalWidth), s.handler_sdo.setHeight(s.finalHeight)); }), (s.addPannSupport = function () { (s.handler_sdo.screen.style.cursor = "url(" + s.handMovePath_str + "), default"), s.isMobile_bl ? s.hasPointerEvent_bl ? s.handler_sdo.screen.addEventListener("MSPointerDown", s.panStartHandler) : s.handler_sdo.screen.addEventListener("touchstart", s.panStartHandler) : s.handler_sdo.screen.addEventListener ? s.handler_sdo.screen.addEventListener("mousedown", s.panStartHandler) : s.handler_sdo.screen.attachEvent && s.handler_sdo.screen.attachEvent("onmousedown", s.panStartHandler); }), (s.panStartHandler = function (e) { if ((e.preventDefault && e.preventDefault(), !s.isTweening_bl)) { s.isMobile_bl || o.showPanDumy(); var t = FWDUtils.getViewportMouseCoordinates(e); (s.isDragging_bl = !0), (s.xPositionOnPress = s.handler_sdo.getX()), (s.yPositionOnPress = s.handler_sdo.getY()), (s.lastPresedX = t.screenX), (s.lastPresedY = t.screenY), s.dispatchEvent(l.PAN_START), s.isMobile_bl ? s.hasPointerEvent_bl ? (r.addEventListener("MSPointerMove", s.panMoveHandler), r.addEventListener("MSPointerUp", s.panEndHandler)) : (r.addEventListener("touchmove", s.panMoveHandler), r.addEventListener("touchend", s.panEndHandler)) : ((s.handler_sdo.screen.style.cursor = "url(" + s.handGrabPath_str + "), default"), (s.screen.style.cursor = "url(" + s.handGrabPath_str + "), default"), r.addEventListener ? (r.addEventListener("mousemove", s.panMoveHandler), r.addEventListener("mouseup", s.panEndHandler)) : document.attachEvent && (document.attachEvent("onmousemove", s.panMoveHandler), document.attachEvent("onmouseup", s.panEndHandler))); } }), (s.panMoveHandler = function (e) { if ((e.preventDefault && e.preventDefault(), !e.touches || 1 == e.touches.length)) { var t = FWDUtils.getViewportMouseCoordinates(e); (s.finalX = Math.round(s.xPositionOnPress + t.screenX - s.lastPresedX)), s.finalX < 1 ? (s.finalX = 1) : s.finalX >= s.totalWidth - 3 - s.finalWidth && (s.finalX = s.totalWidth - 3 - s.finalWidth), s.handler_sdo.setX(s.finalX), (s.finalY = Math.round(s.yPositionOnPress + t.screenY - s.lastPresedY)), s.finalY < 1 ? (s.finalY = 1) : s.finalY >= s.totalHeight - 3 - s.finalHeight && (s.finalY = s.totalHeight - 3 - s.finalHeight), s.handler_sdo.setY(s.finalY), s.dispatchEvent(l.PAN, { percentX: s.finalX / (s.totalWidth - 2 - s.finalWidth), percentY: s.finalY / (s.totalHeight - 2 - s.finalHeight) }); } }), (s.panEndHandler = function (e) { (s.isDragging_bl = !1), s.isMobile_bl || o.hidePanDumy(), s.isMobile_bl ? s.hasPointerEvent_bl ? (r.removeEventListener("MSPointerMove", s.panMoveHandler), r.removeEventListener("MSPointerUp", s.panEndHandler)) : (r.removeEventListener("touchmove", s.panMoveHandler), r.removeEventListener("touchend", s.panEndHandler)) : ((s.handler_sdo.screen.style.cursor = "url(" + s.handMovePath_str + "), default"), (s.screen.style.cursor = "default"), r.removeEventListener ? (r.removeEventListener("mousemove", s.panMoveHandler), r.removeEventListener("mouseup", s.panEndHandler)) : document.detachEvent && (document.detachEvent("onmousemove", s.panMoveHandler), document.detachEvent("onmouseup", s.panEndHandler))); }), (s.show = function (e) { s.isShowed_bl || (s.resizeAndPosition(), e ? FWDAnimation.to(s.mainHolder_do, 1, { y: 0, ease: Expo.easeInOut }) : (FWDAnimation.killTweensOf(s.mainHolder_do), s.mainHolder_do.setY(0)), (s.isShowed_bl = !0)); }), (s.hide = function (e) { s.isShowed_bl && (s.navigatorPosition_str == l.TOP_LEFT || s.navigatorPosition_str == l.TOP_RIGHT ? e ? (FWDAnimation.to(s.mainHolder_do, 1, { y: -s.totalHeight - s.offsetY, ease: Expo.easeInOut }), s.update(1, 1, 1, 1, !0)) : (FWDAnimation.killTweensOf(s.mainHolder_do), s.mainHolder_do.setY(-s.totalHeight - s.offsetY)) : (s.navigatorPosition_str != l.BOTTOM_LEFT && s.navigatorPosition_str != l.BOTTOM_RIGHT) || (e ? (FWDAnimation.to(s.mainHolder_do, 1, { y: s.totalHeight + s.offsetY, ease: Expo.easeInOut }), s.update(1, 1, 1, 1, !0)) : (FWDAnimation.killTweensOf(s.mainHolder_do), s.mainHolder_do.setY(s.totalHeight + s.offsetY))), (s.isShowed_bl = !1)); }), (s.cleanMainEvents = function () { s.isMobile_bl ? (s.handler_sdo.screen.removeEventListener("touchstart", s.panStartHandler), s.handler_sdo.screen.addEventListener("MSPointerDown", s.panStartHandler), r.removeEventListener("touchmove", s.panMoveHandler), r.removeEventListener("touchend", s.panEndHandler), r.removeEventListener("MSPointerMove", s.panMoveHandler), r.removeEventListener("MSPointerUp", s.panEndHandler)) : s.handler_sdo.screen.removeEventListener ? (s.handler_sdo.screen.removeEventListener("mousedown", s.panStartHandler), r.removeEventListener("mousemove", s.panMoveHandler), r.removeEventListener("mouseup", s.panEndHandler)) : s.handler_sdo.screen.detachEvent && (s.handler_sdo.screen.detachEvent("onmousedown", s.panStartHandler), document.detachEvent("onmousemove", s.panMoveHandler), document.detachEvent("onmouseup", s.panEndHandler)), (s.screen.onmousedown = null), (s.handler_sdo.screen.onmousedown = null), clearTimeout(s.tweenCompleteId_to); }), (s.destroy = function () { s.cleanMainEvents(), s.hider && s.hider.removeListener(FWDHider.HIDE, s.onHiderHide); for (var e = s.iamgesSdo_ar.length, t = 0; t < e; t++) s.iamgesSdo_ar[t].destroy(); FWDAnimation.killTweensOf(s.mainHolder_do), s.mainHolder_do.destroy(), FWDAnimation.killTweensOf(s.handler_sdo), s.handler_sdo.destroy(), s.mainImagesHolder_do.destroy(), (s.hider = null), (s.mainHolder_do = null), (s.mainImagesHolder_do = null), (s.smallImage_sdo = null), (s.handler_sdo = null), (s.images_ar = n.navigatorImages_ar), (s.iamgesSdo_ar = []), (s.borderColor_str = null), (s.handlerColor_str = null), (s.handMovePath_str = null), (s.handGrabPath_str = null), (s.navigatorPosition_str = null), (o = n = null), s.setInnerHTML(""), i.destroy(), (i = s = null), (l.prototype = null); }), s.init(); }; (l.setPrototype = function () { l.prototype = new FWDDisplayObject("div"); }), (l.TOP_LEFT = "topleft"), (l.TOP_RIGHT = "topright"), (l.BOTTOM_LEFT = "bottomleft"), (l.BOTTOM_RIGHT = "bottomright"), (l.PAN_START = "panStart"), (l.PAN = "pan"), (l.MOUSE_DOWN = "navigatorOnMouseDown"), (l.prototype = null), (r.FWDNavigator = l); })(window), (function (e) { var d = function (e, t, o, n, i, s, r) { var l = this, a = d.prototype; (l.imageSource_img = t), (l.bk_do = null), (l.mainAnimHolder_do = null), (l.animHolder_do = null), (l.imageAnimHolder_do = null), (l.images_do = null), (l.text_do = null), (l.backgroundColor_str = r), (l.fontColor_str = s), l.stageWidth, l.stageHeight, (l.segmentWidth = o), (l.segmentHeight = n), (l.totalSegments = i), (l.isShowed_bl = !1), (l.allowResize_bl = !0), (l.init = function () { l.setupMainContainers(), FWDUtils.isMobile && l.screen.addEventListener("touchstart", l.windowTouchStartHandler); }), (l.windowTouchStartHandler = function (e) { e.preventDefault && e.preventDefault(); }), (l.setupMainContainers = function () { (l.bk_do = new FWDSimpleDisplayObject("div")), l.bk_do.setBkColor(l.backgroundColor_str), l.bk_do.setAlpha(0), l.bk_do.setResizableSizeAfterParent(), l.addChild(l.bk_do), (l.mainAnimHolder_do = new FWDDisplayObject("div")), l.mainAnimHolder_do.setOverflow("visible"), l.mainAnimHolder_do.setWidth(300), l.mainAnimHolder_do.setHeight(300), l.addChild(l.mainAnimHolder_do), (l.animHolder_do = new FWDDisplayObject("div")), l.animHolder_do.setOverflow("visible"), l.animHolder_do.setWidth(300), l.animHolder_do.setHeight(300), l.mainAnimHolder_do.addChild(l.animHolder_do), (l.imageAnimHolder_do = new FWDDisplayObject("div")), l.imageAnimHolder_do.setWidth(l.segmentWidth), l.imageAnimHolder_do.setHeight(l.segmentHeight), l.animHolder_do.addChild(l.imageAnimHolder_do), (l.images_do = new FWDSimpleDisplayObject("img")), l.images_do.setScreen(l.imageSource_img), l.imageAnimHolder_do.addChild(l.images_do), (l.text_do = new FWDSimpleDisplayObject("div")), l.text_do.setDisplay("inline-block"), (l.text_do.getStyle().fontFamily = "Arial"), (l.text_do.getStyle().fontSize = "12px"), (l.text_do.getStyle().whiteSpace = "nowrap"), (l.text_do.getStyle().color = l.fontColor_str), (l.text_do.getStyle().fontSmoothing = "antialiased"), (l.text_do.getStyle().webkitFontSmoothing = "antialiased"), (l.text_do.getStyle().textRendering = "optimizeLegibility"), l.text_do.setY(l.segmentHeight + 2), l.animHolder_do.addChild(l.text_do); }), (l.positionAndResize = function () { (e.stageWidth == l.stageWidth && e.stageHeight == l.stageHeight) || (l.allowResize_bl && ((l.stageWidth = e.stageWidth), (l.stageHeight = e.stageHeight), l.mainAnimHolder_do.setX(Math.round(l.stageWidth - l.segmentWidth) / 2), l.mainAnimHolder_do.setY(Math.round((l.stageHeight - l.segmentHeight) / 2) - 10), l.setWidth(l.stageWidth), l.setHeight(l.stageHeight))); }), (l.update = function (e, t) { var o = Math.round(e * (l.totalSegments - 1)) * l.segmentWidth; l.images_do.setX(-o), l.text_do.setInnerHTML(t), l.text_do.setX(Math.round((l.segmentWidth - l.text_do.getWidth()) / 2)); }), (l.show = function () { FWDAnimation.killTweensOf(l.bk_do), FWDAnimation.to(l.bk_do, 1, { alpha: 0.6 }), FWDAnimation.to(l.animHolder_do, 0.8, { y: 0, ease: Expo.easeInOut }), (l.isShowed_bl = !0); }), (l.hide = function (e) { null != l && (FWDAnimation.killTweensOf(l), FWDAnimation.killTweensOf(l.animHolder_do), e ? ((l.allowResize_bl = !1), FWDAnimation.to(l.bk_do, 0.8, { alpha: 0, delay: 0.6, onComplete: l.onHideComplete }), FWDAnimation.to(l.animHolder_do, 0.8, { y: l.stageHeight / 2 + l.segmentHeight, ease: Expo.easeInOut })) : (l.bk_do.setAlpha(0), l.animHolder_do.setY(-l.stageHeight / 2 - l.segmentHeight)), (l.isShowed_bl = !1)); }), (l.onHideComplete = function () { l.dispatchEvent(d.HIDE_COMPLETE); }), (l.destroy = function () { FWDUtils.isMobile && l.screen.removeEventListener("touchstart", l.windowTouchStartHandler), FWDAnimation.killTweensOf(l), FWDAnimation.killTweensOf(l.bk_do), FWDAnimation.killTweensOf(l.animHolder_do), l.bk_do.destroy(), l.mainAnimHolder_do.destroy(), l.animHolder_do.destroy(), l.imageAnimHolder_do.destroy(), l.images_do.destroy(), l.text_do.destroy(), (l.imageSource_img = null), (l.bk_do = null), (l.mainAnimHolder_do = null), (l.animHolder_do = null), (l.imageAnimHolder_do = null), (l.images_do = null), (l.text_do = null), (l.backgroundColor_str = null), (l.fontColor_str = null), (l.init = null), (l.setupMainContainers = null), (l.positionAndResize = null), (l.update = null), (l.show = null), (l.hide = null), (l.onHideComplete = null), (s = r = t = e = null), l.setInnerHTML(""), a.destroy(), (l = null), (d.prototype = null); }), l.init(); }; (d.setPrototype = function () { d.prototype = new FWDDisplayObject("div"); }), (d.HIDE_COMPLETE = "hideComplete"), (d.prototype = null), (e.FWDPreloader = d); })(window), (function (e) { var i = function (e, t) { var o = this, n = i.prototype; (o.nImg = e), (o.sImg = t), this.n_do, this.s_do, this.toolTipLabel_str, (this.totalWidth = this.nImg.width), (this.totalHeight = this.nImg.height), (this.isDisabled_bl = !1), (this.isSelectedFinal_bl = !1), (this.isActive_bl = !1), (this.isMobile_bl = FWDUtils.isMobile), (this.hasPointerEvent_bl = FWDUtils.hasPointerEvent), (o.init = function () { o.setupMainContainers(); }), (o.setupMainContainers = function () { (o.n_do = new FWDSimpleDisplayObject("img")), o.n_do.setScreen(o.nImg), (o.s_do = new FWDSimpleDisplayObject("img")), o.s_do.setScreen(o.sImg), o.s_do.setAlpha(0), o.addChild(o.n_do), o.addChild(o.s_do), o.setWidth(o.nImg.width), o.setHeight(o.nImg.height), o.setButtonMode(!0), o.isMobile_bl ? o.hasPointerEvent_bl ? (o.screen.addEventListener("MSPointerDown", o.onMouseDown), o.screen.addEventListener("MSPointerUp", o.onClick), o.screen.addEventListener("MSPointerOver", o.onMouseOver), o.screen.addEventListener("MSPointerOut", o.onMouseOut)) : o.screen.addEventListener("touchstart", o.onMouseDown) : o.screen.addEventListener ? (o.screen.addEventListener("mouseover", o.onMouseOver), o.screen.addEventListener("mouseout", o.onMouseOut), o.screen.addEventListener("mousedown", o.onMouseDown), o.screen.addEventListener("click", o.onClick)) : o.screen.attachEvent && (o.screen.attachEvent("onmouseover", o.onMouseOver), o.screen.attachEvent("onmouseout", o.onMouseOut), o.screen.attachEvent("onmousedown", o.onMouseDown), o.screen.attachEvent("onclick", o.onClick)); }), (o.onMouseOver = function (e) { if (!e.pointerType || e.pointerType == e.MSPOINTER_TYPE_MOUSE) { if ((o.dispatchEvent(i.MOUSE_OVER, { e: e }), o.isDisabled_bl || o.isSelectedFinal_bl)) return; FWDAnimation.killTweensOf(o.s_do), FWDAnimation.to(o.s_do, 0.5, { alpha: 1, delay: 0.1, ease: Expo.easeOut }); } }), (o.onMouseOut = function (e) { if (!e.pointerType || e.pointerType == e.MSPOINTER_TYPE_MOUSE) { if ((o.dispatchEvent(i.MOUSE_OUT, { e: e }), o.isDisabled_bl || o.isSelectedFinal_bl)) return; FWDAnimation.killTweensOf(o.s_do), FWDAnimation.to(o.s_do, 0.5, { alpha: 0, ease: Expo.easeOut }); } }), (o.onClick = function (e) { o.isDisabled_bl || o.isSelectedFinal_bl || o.dispatchEvent(i.CLICK, { e: e }); }), (o.onMouseDown = function (e) { e.preventDefault && e.preventDefault(), o.isDisabled_bl || o.isSelectedFinal_bl || o.dispatchEvent(i.MOUSE_DOWN, { e: e }); }), (o.setSelctedFinal = function () { (o.isSelectedFinal_bl = !0), FWDAnimation.killTweensOf(o.s_do), FWDAnimation.to(o.s_do, 0.8, { alpha: 1, ease: Expo.easeOut }), o.setButtonMode(!1); }), (o.setUnselctedFinal = function () { (o.isSelectedFinal_bl = !1), FWDAnimation.to(o.s_do, 0.8, { alpha: 0, delay: 0.1, ease: Expo.easeOut }), o.setButtonMode(!0); }), (o.destroy = function () { o.isMobile_bl ? o.hasPointerEvent_bl ? (o.screen.removeEventListener("MSPointerDown", o.onMouseDown), o.screen.removeEventListener("MSPointerUp", o.onClick), o.screen.removeEventListener("MSPointerOver", o.onMouseOver), o.screen.removeEventListener("MSPointerOut", o.onMouseOut)) : o.screen.removeEventListener("touchstart", o.onMouseDown) : o.screen.addEventListener ? (o.screen.removeEventListener("mouseover", o.onMouseOver), o.screen.removeEventListener("mouseout", o.onMouseOut), o.screen.removeEventListener("mousedown", o.onMouseDown), o.screen.removeEventListener("click", o.onClick)) : o.screen.detachEvent && (o.screen.detachEvent("onmouseover", o.onMouseOver), o.screen.detachEvent("onmouseout", o.onMouseOut), o.screen.detachEvent("onmousedown", o.onMouseDown), o.screen.detachEvent("onclick", o.onClick)), FWDAnimation.killTweensOf(o.s_do), o.n_do.destroy(), o.s_do.destroy(), (o.nImg = null), (o.sImg = null), (o.n_do = null), (o.s_do = null), (t = e = null), (o.toolTipLabel_str = null), (o.init = null), (o.setupMainContainers = null), (o.onMouseOver = null), (o.onMouseOut = null), (o.onClick = null), (o.onMouseDown = null), (o.setSelctedFinal = null), (o.setUnselctedFinal = null), o.setInnerHTML(""), n.destroy(), (n = o = null), (i.prototype = null); }), o.init(); }; (i.setPrototype = function () { (i.prototype = null), (i.prototype = new FWDDisplayObject("div")); }), (i.CLICK = "onClick"), (i.MOUSE_OVER = "onMouseOver"), (i.MOUSE_OUT = "onMouseOut"), (i.MOUSE_DOWN = "onMouseDown"), (i.prototype = null), (e.FWDSimpleButton = i); })(window), (window.FWDSimpleDisplayObject = function (e, t, o, n) { var i = this; if ("div" != e && "img" != e && "canvas" != e) throw Error("Type is not valid! " + e); (i.type = e), this.style, this.screen, this.transform, (this.position = t || "absolute"), (this.overflow = o || "hidden"), (this.display = n || "block"), (this.visible = !0), this.buttonMode, (this.x = 0), (this.y = 0), (this.w = 0), (this.h = 0), this.rect, (this.alpha = 1), (this.innerHTML = ""), (this.opacityType = ""), (this.isHtml5_bl = !1), (this.hasTransform3d_bl = FWDUtils.hasTransform3d), (this.hasTransform2d_bl = FWDUtils.hasTransform2d), (FWDUtils.isIE || FWDUtils.isFirefox) && (i.hasTransform3d_bl = !1), (this.hasBeenSetSelectable_bl = !1), (i.init = function () { i.setScreen(); }), (i.getTransform = function () { for (var e, t = ["transform", "msTransform", "WebkitTransform", "MozTransform", "OTransform"]; (e = t.shift());) if (void 0 !== i.screen.style[e]) return e; return !1; }), (i.getOpacityType = function () { return void 0 !== i.screen.style.opacity ? "opacity" : "filter"; }), (i.setScreen = function (e) { "img" == i.type && e ? (i.screen = e) : (i.screen = document.createElement(i.type)), i.setMainProperties(); }), (i.setMainProperties = function () { (i.transform = i.getTransform()), i.setPosition(i.position), i.setDisplay(i.display), i.setOverflow(i.overflow), (i.opacityType = i.getOpacityType()), "opacity" == i.opacityType && (i.isHtml5_bl = !0), "filter" == i.opacityType && (i.screen.style.filter = "inherit"), (i.screen.style.left = "0px"), (i.screen.style.top = "0px"), (i.screen.style.margin = "0px"), (i.screen.style.padding = "0px"), (i.screen.style.maxWidth = "none"), (i.screen.style.maxHeight = "none"), (i.screen.style.border = "none"), (i.screen.style.lineHeight = "1"), (i.screen.style.backgroundColor = "transparent"), (i.screen.style.backfaceVisibility = "hidden"), (i.screen.style.webkitBackfaceVisibility = "hidden"), (i.screen.style.MozBackfaceVisibility = "hidden"), "img" == e && (i.setWidth(i.screen.width), i.setHeight(i.screen.height), i.setSelectable(!1)); }), (i.setSelectable = function (e) { e || ((i.screen.style.userSelect = "none"), (i.screen.style.MozUserSelect = "none"), (i.screen.style.webkitUserSelect = "none"), (i.screen.style.khtmlUserSelect = "none"), (i.screen.style.oUserSelect = "none"), (i.screen.style.msUserSelect = "none"), (i.screen.msUserSelect = "none"), (i.screen.ondragstart = function (e) { return !1; }), (i.screen.onselectstart = function () { return !1; }), (i.screen.ontouchstart = function (e) { return !1; }), (i.screen.style.webkitTouchCallout = "none"), (i.hasBeenSetSelectable_bl = !0)); }), (i.setBackfaceVisibility = function () { (i.screen.style.backfaceVisibility = "visible"), (i.screen.style.webkitBackfaceVisibility = "visible"), (i.screen.style.MozBackfaceVisibility = "visible"); }), (i.removeBackfaceVisibility = function () { (i.screen.style.backfaceVisibility = "hidden"), (i.screen.style.webkitBackfaceVisibility = "hidden"), (i.screen.style.MozBackfaceVisibility = "hidden"); }), (i.getScreen = function () { return i.screen; }), (i.setVisible = function (e) { (i.visible = e), 1 == i.visible ? (i.screen.style.visibility = "visible") : (i.screen.style.visibility = "hidden"); }), (i.getVisible = function () { return i.visible; }), (i.setResizableSizeAfterParent = function () { (i.screen.style.width = "100%"), (i.screen.style.height = "100%"); }), (i.getStyle = function () { return i.screen.style; }), (i.setOverflow = function (e) { (i.overflow = e), (i.screen.style.overflow = i.overflow); }), (i.setPosition = function (e) { (i.position = e), (i.screen.style.position = i.position); }), (i.setDisplay = function (e) { (i.display = e), (i.screen.style.display = i.display); }), (i.setButtonMode = function (e) { (i.buttonMode = e), 1 == i.buttonMode ? (i.screen.style.cursor = "pointer") : (i.screen.style.cursor = "default"); }), (i.setBkColor = function (e) { i.screen.style.backgroundColor = e; }), (i.setInnerHTML = function (e) { (i.innerHTML = e), (i.screen.innerHTML = i.innerHTML); }), (i.getInnerHTML = function () { return i.innerHTML; }), (i.getRect = function () { return i.screen.getBoundingClientRect(); }), (i.setAlpha = function (e) { (i.alpha = e), "opacity" == i.opacityType ? (i.screen.style.opacity = i.alpha) : "filter" == i.opacityType && ((i.screen.style.filter = "alpha(opacity=" + 100 * i.alpha + ")"), (i.screen.style.filter = "progid:DXImageTransform.Microsoft.Alpha(Opacity=" + Math.round(100 * i.alpha) + ")")); }), (i.getAlpha = function () { return i.alpha; }), (i.getRect = function () { return i.screen.getBoundingClientRect(); }), (i.getGlobalX = function () { return i.getRect().left; }), (i.getGlobalY = function () { return i.getRect().top; }), (i.setX = function (e) { (i.x = e), i.hasTransform3d_bl ? (i.screen.style[i.transform] = "translate3d(" + i.x + "px," + i.y + "px,0)") : i.hasTransform2d_bl ? (i.screen.style[i.transform] = "translate(" + i.x + "px," + i.y + "px)") : (i.screen.style.left = i.x + "px"); }), (i.getX = function () { return i.x; }), (i.setY = function (e) { (i.y = e), i.hasTransform3d_bl ? (i.screen.style[i.transform] = "translate3d(" + i.x + "px," + i.y + "px,0)") : i.hasTransform2d_bl ? (i.screen.style[i.transform] = "translate(" + i.x + "px," + i.y + "px)") : (i.screen.style.top = i.y + "px"); }), (i.getY = function () { return i.y; }), (i.setWidth = function (e) { (i.w = e), "img" == i.type && (i.screen.width = i.w), (i.screen.style.width = i.w + "px"); }), (i.getWidth = function () { return "div" == i.type ? 0 != i.screen.offsetWidth ? i.screen.offsetWidth : i.w : "img" == i.type ? 0 != i.screen.offsetWidth ? i.screen.offsetWidth : 0 != i.screen.width ? i.screen.width : i._w : "canvas" == i.type ? 0 != i.screen.offsetWidth ? i.screen.offsetWidth : i.w : void 0; }), (i.setHeight = function (e) { (i.h = e), "img" == i.type && (i.screen.height = i.h), (i.screen.style.height = i.h + "px"); }), (i.getHeight = function () { return "div" == i.type ? 0 != i.screen.offsetHeight ? i.screen.offsetHeight : i.h : "img" == i.type ? 0 != i.screen.offsetHeight ? i.screen.offsetHeight : 0 != i.screen.height ? i.screen.height : i.h : "canvas" == i.type ? 0 != i.screen.offsetHeight ? i.screen.offsetHeight : i.h : void 0; }), (i.disposeImage = function () { "img" == i.type && (i.screen.src = null); }), (i.destroy = function () { null != i && (i.hasBeenSetSelectable_bl && ((i.screen.ondragstart = null), (i.screen.onselectstart = null), (i.screen.ontouchstart = null)), (i.style = null), (i.screen = null), (i.transform = null), (i.position = null), (i.overflow = null), (i.display = null), (i.visible = null), (i.buttonMode = null), (i.x = null), (i.y = null), (i.w = null), (i.h = null), (i.rect = null), (i.alpha = null), (i.innerHTML = null), (i.opacityType = null), (i.isHtml5_bl = null), (n = o = t = e = null), (i.hasTransform3d_bl = null), (i.hasTransform2d_bl = null), (i = null)); }), i.init(); }), (window.FWDTransformDisplayObject = function (e, t, o) { var n = this; if ("div" != e && "img" != e && "canvas" != e) throw Error("Type is not valid! " + e); (n.type = e), this.style, this.screen, this.transform, this.transformOrigin, (this.position = t || "absolute"), (this.overflow = o || "hidden"), (this.visible = !0), this.buttonMode, (this.x = 0), (this.y = 0), (this.w = 0), (this.h = 0), (this.scale = 1), this.rect, (this.alpha = 1), (this.innerHTML = ""), (this.opacityType = ""), (this.isHtml5_bl = !1), (this.hasTransform3d_bl = FWDUtils.hasTransform3d), (this.hasTransform2d_bl = FWDUtils.hasTransform2d), (FWDUtils.isIE || FWDUtils.isFirefox) && (n.hasTransform3d_bl = !1), (this.hasBeenSetSelectable_bl = !1), (n.init = function () { n.setScreen(); }), (n.getTransform = function () { for (var e, t = ["transform", "msTransform", "WebkitTransform", "MozTransform", "OTransform"]; (e = t.shift());) if (void 0 !== n.screen.style[e]) return e; }), (n.getTransformOrigin = function () { for (var e, t = ["transformOrigin", "msTransformOrigin", "WebkitTransformOrigin", "MozTransformOrigin", "OTransformOrigin"]; (e = t.shift());) if (void 0 !== n.screen.style[e]) return e; }), (n.getOpacityType = function () { return void 0 !== n.screen.style.opacity ? "opacity" : "filter"; }), (n.setScreen = function (e) { "img" == n.type && e ? (n.screen = e) : (n.screen = document.createElement(n.type)), n.setMainProperties(); }), (n.setMainProperties = function () { (n.transform = n.getTransform()), (n.transformOrigin = n.getTransformOrigin()), n.setPosition(n.position), n.setOverflow(n.overflow), (n.opacityType = n.getOpacityType()), "opacity" == n.opacityType && (n.isHtml5_bl = !0), "filter" == n.opacityType && (n.screen.style.filter = "inherit"), (n.screen.style.left = "0px"), (n.screen.style.top = "0px"), (n.screen.style.margin = "0px"), (n.screen.style.padding = "0px"), (n.screen.style.maxWidth = "none"), (n.screen.style.maxHeight = "none"), (n.screen.style.border = "none"), (n.screen.style.lineHeight = "1"), (n.screen.style.backgroundColor = "transparent"), (n.screen.style.backfaceVisibility = "hidden"), (n.screen.style.webkitBackfaceVisibility = "hidden"), (n.screen.style.MozBackfaceVisibility = "hidden"), "img" == e && (n.setWidth(n.screen.width), n.setHeight(n.screen.height), n.setSelectable(!1)); }), (n.setSelectable = function (e) { e || ((n.screen.style.userSelect = "none"), (n.screen.style.MozUserSelect = "none"), (n.screen.style.webkitUserSelect = "none"), (n.screen.style.khtmlUserSelect = "none"), (n.screen.style.oUserSelect = "none"), (n.screen.style.msUserSelect = "none"), (n.screen.msUserSelect = "none"), (n.screen.ondragstart = function (e) { return !1; }), (n.screen.onselectstart = function () { return !1; }), (n.screen.ontouchstart = function (e) { return !1; }), (n.screen.style.webkitTouchCallout = "none"), (n.hasBeenSetSelectable_bl = !0)); }), (n.setBackfaceVisibility = function () { (n.screen.style.backfaceVisibility = "visible"), (n.screen.style.webkitBackfaceVisibility = "visible"), (n.screen.style.MozBackfaceVisibility = "visible"); }), (n.removeBackfaceVisibility = function () { (n.screen.style.backfaceVisibility = "hidden"), (n.screen.style.webkitBackfaceVisibility = "hidden"), (n.screen.style.MozBackfaceVisibility = "hidden"); }), (n.getScreen = function () { return n.screen; }), (n.setVisible = function (e) { (n.visible = e), 1 == n.visible ? (n.screen.style.visibility = "visible") : (n.screen.style.visibility = "hidden"); }), (n.getVisible = function () { return n.visible; }), (n.setResizableSizeAfterParent = function () { (n.screen.style.width = "100%"), (n.screen.style.height = "100%"); }), (n.getStyle = function () { return n.screen.style; }), (n.setOverflow = function (e) { (n.overflow = e), (n.screen.style.overflow = n.overflow); }), (n.setPosition = function (e) { (n.position = e), (n.screen.style.position = n.position); }), (n.setDisplay = function (e) { (n.display = e), (n.screen.style.display = n.display); }), (n.setButtonMode = function (e) { (n.buttonMode = e), 1 == n.buttonMode ? (n.screen.style.cursor = "pointer") : (n.screen.style.cursor = "default"); }), (n.setBkColor = function (e) { n.screen.style.backgroundColor = e; }), (n.setInnerHTML = function (e) { (n.innerHTML = e), (n.screen.innerHTML = n.innerHTML); }), (n.getInnerHTML = function () { return n.innerHTML; }), (n.getRect = function () { return n.screen.getBoundingClientRect(); }), (n.setAlpha = function (e) { (n.alpha = e), "opacity" == n.opacityType ? (n.screen.style.opacity = n.alpha) : "filter" == n.opacityType && ((n.screen.style.filter = "alpha(opacity=" + 100 * n.alpha + ")"), (n.screen.style.filter = "progid:DXImageTransform.Microsoft.Alpha(Opacity=" + Math.round(100 * n.alpha) + ")")); }), (n.getAlpha = function () { return n.alpha; }), (n.getRect = function () { return n.screen.getBoundingClientRect(); }), (n.getGlobalX = function () { return n.getRect().left; }), (n.getGlobalY = function () { return n.getRect().top; }), (n.setX = function (e) { (n.x = e), n.hasTransform3d_bl ? (n.screen.style[n.transform] = "translate3d(" + n.x + "px," + n.y + "px,0) scale(" + n.scale + "," + n.scale + ")") : (n.screen.style.left = n.x + "px"); }), (n.getX = function () { return n.x; }), (n.setY = function (e) { (n.y = e), n.hasTransform3d_bl ? (n.screen.style[n.transform] = "translate3d(" + n.x + "px," + n.y + "px,0) scale(" + n.scale + "," + n.scale + ")") : (n.screen.style.top = n.y + "px"); }), (n.getY = function () { return n.y; }), (n.setWidth = function (e) { (n.w = e), "img" == n.type && (n.screen.width = n.w), (n.screen.style.width = n.w + "px"); }), (n.getWidth = function () { return "div" == n.type ? 0 != n.screen.offsetWidth ? n.screen.offsetWidth : n.w : "img" == n.type ? 0 != n.screen.offsetWidth ? n.screen.offsetWidth : 0 != n.screen.width ? n.screen.width : n._w : "canvas" == n.type ? 0 != n.screen.offsetWidth ? n.screen.offsetWidth : n.w : void 0; }), (n.setHeight = function (e) { (n.h = e), "img" == n.type && (n.screen.height = n.h), (n.screen.style.height = n.h + "px"); }), (n.getHeight = function () { return "div" == n.type ? 0 != n.screen.offsetHeight ? n.screen.offsetHeight : n.h : "img" == n.type ? 0 != n.screen.offsetHeight ? n.screen.offsetHeight : 0 != n.screen.height ? n.screen.height : n.h : "canvas" == n.type ? 0 != n.screen.offsetHeight ? n.screen.offsetHeight : n.h : void 0; }), (this.setScale = function (e) { (n.scale = e), n.hasTransform2d_bl ? (n.screen.style[n.transform] = "scale(" + n.scale + "," + n.scale + ")") : (n.screen.style[n.transform] = "translate3d(" + n.x + "px," + n.y + "px,0) scale(" + n.scale + "," + n.scale + ")"); }), (this.setTransformOrigin = function (e, t) { n.screen.style[n.transformOrigin] = e + "% " + t + "%"; }), (n.setPositionAndScale = function (e, t, o) { (n.x = e), (n.y = t), (n.scale = o), (n.screen.style[n.transform] = "translate3d(" + n.x + "px," + n.y + "px,0) scale(" + n.scale + "," + n.scale + ")"); }), (n.disposeImage = function () { "img" == n.type && (n.screen.src = null); }), (n.addChild = function (e) { n.contains(e) && n.children_ar.splice(FWDUtils.indexOfArray(n.children_ar, e), 1), n.children_ar.push(e), n.screen.appendChild(e.screen); }), (n.destroy = function () { n.hasBeenSetSelectable_bl && ((n.screen.ondragstart = null), (n.screen.onselectstart = null), (n.screen.ontouchstart = null)), (n.style = null), (n.screen = null), (n.transform = null), (n.position = null), (n.overflow = null), (n.display = null), (n.visible = null), (n.buttonMode = null), (n.x = null), (n.y = null), (n.w = null), (n.h = null), (n.rect = null), (n.alpha = null), (n.innerHTML = null), (n.opacityType = null), (n.isHtml5_bl = null), (e = null), (display = o = t = null), (n.hasTransform3d_bl = null), (n.hasTransform2d_bl = null), (n = null); }), n.init(); }), (function (t) { var r = function (e) { var s = this; (s.init = function () { FWDTweenLite.ticker.useRAF(!1), (s.props_obj = e), (s.isFullScreen_bl = !1), (s.mustHaveHolderDiv_bl = !1), (s.displayType = e.displayType.toLowerCase()), s.displayType || (s.displayType = r.FULL_SCREEN), s.displayType == r.RESPONSIVE && (s.mustHaveHolderDiv_bl = !0), (s.body = document.getElementsByTagName("body")[0]), s.props_obj ? s.props_obj.divHolderId || !s.mustHaveHolderDiv_bl ? !s.mustHaveHolderDiv_bl || FWDUtils.getChildById(s.props_obj.divHolderId) ? (s.displayType == r.FULL_SCREEN || s.displayType == r.LIGHTBOX ? (s.stageContainer = document.documentElement) : (s.stageContainer = FWDUtils.getChildById(s.props_obj.divHolderId)), (s.skinPath_str = s.props_obj.skinPath), s.skinPath_str.lastIndexOf("/") + 1 != s.skinPath_str.length && (s.skinPath_str += "/"), (this.warningIconPath_str = this.skinPath_str + "skin/warning.png"), (this.customContextMenu = null), (this.info_do = null), (this.main_do = null), (this.preloader_do = null), (this.navigator_do = null), (this.controller_do = null), (this.imageManager_do = null), (this.descriptionWindow_do = null), (this.hider = null), (this.lightBox_do = null), (this.rotateDumy_sdo = null), (this.markersDumy_sdo = null), (this.panDumy_sdo = null), (s.autoScale = "yes" == s.props_obj.autoScale), (s.originalWidth = s.props_obj.viewerWidth), (s.originalHeight = s.props_obj.viewerHeight), (this.backgroundColor_str = s.props_obj.backgroundColor || "transparent"), (this.lightBoxBackgroundColor_str = s.props_obj.lightBoxBackgroundColor || "transparent"), (this.viewportWidth = 0), (this.viewportHeight = 0), (this.stageWidth = 0), (this.stageHeight = 0), (this.pageXOffset = t.pageXOffset), (this.pageYOffset = t.pageYOffset), this.lastScrollY, this.lastScrollX, (this.lightBoxBackgroundOpacity = s.props_obj.lightBoxBackgroundOpacity || 1), (this.lightBoxWidth = s.props_obj.lightBoxWidth || 500), (this.lightBoxHeight = s.props_obj.lightBoxHeight || 400), this.finalLightBoxWidth, this.finalLightBoxHeight, this.resizeHandlerId_to, this.resizeHandler2Id_to, this.lighboxAnimDoneId_to, this.startHiderWithDelayId_to, this.initPluginId_to, this.activateWithDelayImagemanagerId_to, (this.isMobile_bl = FWDUtils.isMobile), (this.hibernate_bl = !1), (this.safeToControll_bl = !1), FWDUtils.isReadyMethodCalled_bl || FWDUtils.checkIfHasTransofrms(), (s.initializeOnlyWhenVisible_bl = s.props_obj.initializeOnlyWhenVisible), (s.initializeOnlyWhenVisible_bl = "yes" == s.initializeOnlyWhenVisible_bl), s.displayType != r.LIGHTBOX ? (s.setupMainDo(), s.startResizeHandler(), s.initializeOnlyWhenVisible_bl ? (t.addEventListener("scroll", s.onInitlalizeScrollHandler), (s.scrollInit_to = setTimeout(s.onInitlalizeScrollHandler, 500))) : s.setupViewer()) : (this.initPluginId_to = setTimeout(function () { s.setupLightBox(); }, 50))) : alert("FWDViewer holder div is not found, please make sure that the div exsists and the id is correct! " + s.props_obj.divHolderId) : alert("Property divHolderId is not defined in the FWDViewer constructor, self property represents the div id into which the grid is added as a child!") : alert("FWDViewer constructor properties object is not defined!"); }), (s.onInitlalizeScrollHandler = function () { var e = FWDUtils.getScrollOffsets(); (s.pageXOffset = e.x), (s.pageYOffset = e.y), s.main_do.getGlobalY() >= -s.stageHeight && s.main_do.getGlobalY() < s.ws.h && (t.removeEventListener("scroll", s.onInitlalizeScrollHandler), s.setupViewer()); }), (s.setupViewer = function () { s.data || (s.displayType == r.LIGHTBOX && (s.setupMainDo(), s.startResizeHandler()), clearTimeout(s.scrollInit_to), s.setupInfo(), s.setupData(), FWDUtils.hasPointerEvent && FWDUtils.isMobile && t.addEventListener("contextmenu", s.preventContextMenu)); }), (s.setupMainDo = function () { (s.main_do = new FWDDisplayObject("div", "relative")), (s.main_do.getStyle().msTouchAction = "none"), (s.main_do.getStyle().webkitTapHighlightColor = "rgba(0, 0, 0, 0)"), s.main_do.setBackfaceVisibility(), s.main_do.setBkColor(s.backgroundColor_str), (!FWDUtils.isMobile || (FWDUtils.isMobile && FWDUtils.hasPointerEvent)) && s.main_do.setSelectable(!1), s.displayType == r.FULL_SCREEN ? ((s.stageContainer.style.overflow = "hidden"), (s.main_do.getStyle().position = "absolute"), (document.documentElement.style.overflow = "hidden")) : s.displayType == r.LIGHTBOX && (s.main_do.getStyle().position = "absolute"), s.stageContainer.appendChild(s.main_do.screen); }), (s.preventContextMenu = function (e) { e.preventDefault(); }), (s.setupInfo = function () { FWDInfo.setPrototype(), (s.info_do = new FWDInfo(s, s.warningIconPath_str)); }), (s.startResizeHandler = function () { t.addEventListener("resize", s.onResizeHandler), t.addEventListener("scroll", s.onScrollHandler), s.onResizeHandler(!0), (s.resizeHandlerId_to = setTimeout(function () { s.resizeHandler(!0); }, 500)); }), (s.stopResizeHandler = function () { t.removeEventListener ? (t.removeEventListener("resize", s.onResizeHandler), t.removeEventListener("scroll", s.onScrollHandler)) : t.detachEvent && (t.detachEvent("onresize", s.onResizeHandler), t.detachEvent("onscroll", s.onScrollHandler)), clearTimeout(s.resizeHandlerId_to); }), (s.onResizeHandler = function (e) { s.resizeHandler(); }), (s.onScrollHandler = function (e) { if (!s.hibernate_bl) { (s.isFullScreen_bl || s.displayType == r.FULL_SCREEN || s.displayType == r.LIGHTBOX) && s.scrollHandler(); var t = FWDUtils.getScrollOffsets(); s.scrollOffsets = t; } }), (s.scrollHandler = function () { var e = FWDUtils.getScrollOffsets(); (s.pageXOffset = e.x), (s.pageYOffset = e.y), s.displayType == r.LIGHTBOX ? (s.lightBox_do.setX(e.x), s.lightBox_do.setY(e.y)) : (s.isFullScreen_bl || s.displayType == r.FULL_SCREEN) && (s.main_do.setX(e.x), s.main_do.setY(e.y)); }), (s.resizeHandler = function (e) { if (!s.hibernate_bl) { var t = FWDUtils.getScrollOffsets(); s.scrollOffsets = t; var o = FWDUtils.getViewportSize(); if (((s.ws = o), s.viewportWidth != o.w || s.viewportHeight != o.h || s.pageXOffset != t.x || s.pageYOffset != t.y || e)) { if (((s.viewportWidth = o.w), (s.viewportHeight = o.h), (s.pageXOffset = t.x), (s.pageYOffset = t.y), s.displayType != r.LIGHTBOX || s.isFullScreen_bl)) s.isFullScreen_bl || s.displayType == r.FULL_SCREEN ? (s.main_do.setX(t.x), s.main_do.setY(t.y), (s.stageWidth = o.w), (s.stageHeight = o.h)) : (s.autoScale ? ((s.stageContainer.style.width = "100%"), s.stageContainer.offsetWidth > s.originalWidth && (s.stageContainer.style.width = s.originalWidth + "px"), (s.scale = s.stageContainer.offsetWidth / s.originalWidth), (s.stageWidth = parseInt(s.scale * s.originalWidth)), (s.stageHeight = Math.max(parseInt(s.scale * s.originalHeight), 200)), (s.stageContainer.style.height = s.stageHeight + "px")) : ((s.stageContainer.style.width = "100%"), s.stageContainer.offsetWidth > s.originalWidth && (s.stageContainer.style.width = s.originalWidth + "px"), (s.stageWidth = parseInt(s.stageContainer.offsetWidth)), (s.stageHeight = s.originalHeight)), s.main_do.setX(0), s.main_do.setY(0)); else { if ( (s.lightBoxWidth > o.w ? ((s.finalLightBoxWidth = o.w), (s.finalLightBoxHeight = parseInt(s.lightBoxHeight * (o.w / s.lightBoxWidth)))) : ((s.finalLightBoxWidth = s.lightBoxWidth), (s.finalLightBoxHeight = s.lightBoxHeight)), s.lightBox_do.setWidth(o.w), s.lightBox_do.setHeight(o.h), s.lightBox_do.setX(t.x), s.lightBox_do.setY(t.y), s.lightBox_do.mainLightBox_do.setX(parseInt((o.w - s.finalLightBoxWidth) / 2)), s.lightBox_do.mainLightBox_do.setY(parseInt((o.h - s.finalLightBoxHeight) / 2)), s.lightBox_do.closeButton_do && !s.lightBox_do.closeButtonIsTweening_bl) ) { var n = parseInt((o.w + s.finalLightBoxWidth) / 2 - s.lightBox_do.closeButton_do.totalWidth / 2), i = parseInt((o.h - s.finalLightBoxHeight) / 2 - s.lightBox_do.closeButton_do.totalHeight / 2); n + s.lightBox_do.closeButton_do.totalWidth > s.viewportWidth && (n = s.viewportWidth - s.lightBox_do.closeButton_do.totalWidth), i < 0 && (i = 0), s.lightBox_do.closeButton_do.setX(n), s.lightBox_do.closeButton_do.setY(i); } s.main_do.setX(0), s.main_do.setY(0), s.lightBox_do.mainLightBox_do.setWidth(s.finalLightBoxWidth), s.lightBox_do.mainLightBox_do.setHeight(s.finalLightBoxHeight), (s.stageWidth = s.finalLightBoxWidth), (s.stageHeight = s.finalLightBoxHeight); } s.main_do.setWidth(s.stageWidth), s.main_do.setHeight(s.stageHeight), s.preloader_do && s.preloader_do.positionAndResize(), s.controller_do && s.controller_do.resizeAndPosition(), s.imageManager_do && s.imageManager_do.resizeAndPosition(!1), s.navigator_do && s.navigator_do.resizeAndPosition(), s.descriptionWindow_do && s.descriptionWindow_do.isShowed_bl && s.descriptionWindow_do.resizeAndPosition(); } } }), (s.setupLightBox = function () { FWDLightBox.setPrototype(), (s.lightBox_do = new FWDLightBox(s, s.lightBoxBackgroundColor_str, s.backgroundColor_str, s.lightBoxBackgroundOpacity, s.lightBoxWidth, s.lightBoxHeight)), s.lightBox_do.addListener(FWDLightBox.CLOSE, s.lightBoxCloseHandler), s.lightBox_do.addListener(FWDLightBox.HIDE_COMPLETE, s.lightBoxHideCompleteHandler), (s.lighboxAnimDoneId_to = setTimeout(s.setupViewer, 1200)); }), (s.lightBoxCloseHandler = function () { s.stopResizeHandler(), s.data && s.data.stopToLoad(); }), (s.lightBoxHideCompleteHandler = function () { s.dispatchEvent && s.dispatchEvent(r.CLOSE_LIGHTBOX), s.destroy(); }), (s.setupContextMenu = function () { 0 != s.data.buttons_ar.length && (FWDContextMenu.setPrototype(), (s.customContextMenu = new FWDContextMenu(s, s.data)), s.customContextMenu.addListener(FWDController.ROTATE, s.contextMenuRotateHandler), s.customContextMenu.addListener(FWDController.PAN, s.contextMenuPanHandler), s.customContextMenu.addListener(FWDController.GOTO_NEXT_IMAGE, s.contextMenuGoToNextImageHandler), s.customContextMenu.addListener(FWDController.GOTO_PREV_IMAGE, s.contextMenuGoToPrevImageHandler), s.customContextMenu.addListener(FWDController.ZOOM_IN, s.contextMenuZoomInHandler), s.customContextMenu.addListener(FWDController.ZOOM_OUT, s.contextMenuZoomOutHandler), s.customContextMenu.addListener(FWDController.START_SLIDE_SHOW, s.contextMenuStartSlideShowHandler), s.customContextMenu.addListener(FWDController.STOP_SLIDE_SHOW, s.contextMenuStopSlideShowHandler), s.customContextMenu.addListener(FWDController.SHOW_INFO, s.contextMenuShowInfoWindow), s.customContextMenu.addListener(FWDController.GO_FULL_SCREEN, s.controllerGoFullScreen), s.customContextMenu.addListener(FWDController.GO_NORMAL_SCREEN, s.controllerGoNormalSreen), (s.customContextMenu = null)); }), (s.contextMenuRotateHandler = function (e) { s.controller_do.rotateButtonOnMouseDownHandler(e); }), (s.contextMenuPanHandler = function (e) { s.controller_do.panButtonOnMouseDownHandler(e.e); }), (s.contextMenuGoToNextImageHandler = function (e) { s.controller_do.nextButtonStartHandler(e); }), (s.contextMenuGoToPrevImageHandler = function (e) { s.controller_do.prevButtonStartHandler(e); }), (s.contextMenuZoomInHandler = function (e) { s.controller_do.zoomInStartHandler(e); }), (s.contextMenuZoomOutHandler = function (e) { s.controller_do.zoomOutStartHandler(e); }), (s.contextMenuStartSlideShowHandler = function (e) { s.controller_do.startSlideshow(e); }), (s.contextMenuShowInfoWindow = function (e) { s.main_do.addChild(s.descriptionWindow_do), s.descriptionWindow_do.hide(!1, !0), s.descriptionWindow_do.show(s.data.infoText_str); }), (s.contextMenuStopSlideShowHandler = function (e) { s.controller_do.stopSlideShow(e); }), (s.setupData = function () { FWDData.setPrototype(), (s.data = new FWDData(s.props_obj)), s.data.addListener(FWDData.LIGHBOX_CLOSE_BUTTON_LOADED, s.onLightboxCloseButtonLoadComplete), s.data.addListener(FWDData.PRELOADER_LOAD_DONE, s.onPreloaderLoadDone), s.data.addListener(FWDData.FIRST_IMAGE_LOAD_COMPLETE, s.firstImageLoadComplete), s.data.addListener(FWDData.LOAD_ERROR, s.dataLoadError), s.data.addListener(FWDData.SKIN_PROGRESS, s.dataSkinProgressHandler), s.data.addListener(FWDData.IMAGES_PROGRESS, s.dataImagesProgressHandler), s.data.addListener(FWDData.LOAD_DONE, s.dataLoadComplete), s.data.addListener(FWDData.IMAGE_LOADED, s.onImageLoad), s.data.addListener(FWDData.IMAGES_LOAD_COMPLETE, s.dataImagesLoadComplete); }), (s.onLightboxCloseButtonLoadComplete = function () { s.displayType == r.LIGHTBOX && s.lightBox_do.setupCloseButton(s.data.mainLightboxCloseButtonN_img, s.data.mainLightboxCloseButtonS_img); }), (s.firstImageLoadComplete = function () { s.data.showNavigator_bl && s.setupNavigator(), s.imageManager_do.setAlpha(0), FWDAnimation.to(s.imageManager_do, 0.6, { alpha: 1 }), s.main_do.addChild(s.preloader_do); }), (s.onPreloaderLoadDone = function () { s.setupPreloader(); }), (s.onImageLoad = function (e) { s.imageManager_do.showLoadedImage(e.id); }), (s.dataLoadError = function (e, t) { s.main_do.addChild(s.info_do), s.info_do.showText(e.text); }), (s.dataSkinProgressHandler = function (e) { s.preloader_do && s.preloader_do.update(e.percent, "Loading skin:" + Math.round(100 * e.percent) + "%"); }), (s.dataImagesProgressHandler = function (e) { s.preloader_do.update(e.percent, s.data.preloaderText_str + Math.round(100 * e.percent) + "%"); }), (s.dataLoadComplete = function (e) { s.setupImageManager(), s.setupDisableMarkersDumy(), s.setupController(), s.main_do.addChild(s.preloader_do), s.isMobile_bl || s.setupContextMenu(); }), (s.dataImagesLoadComplete = function () { s.preloader_do.hide(!0), (s.activateWithDelayImagemanagerId_to = setTimeout(function () { s.imageManager_do.activate(); }, 41)), s.data.hideController_bl && (s.setupHider(), s.controller_do.setupHider(s.hider), s.imageManager_do.setupHider(s.hider), s.navigator_do && s.navigator_do.setupHider(s.hider), (s.startHiderWithDelayId_to = setTimeout(function () { s.hider.start(); }, s.data.hideControllerDelay))), s.customContextMenu && (s.customContextMenu.isActive_bl = !0), s.navigator_do && s.navigator_do.activate(), s.setupDescriptionWindow(), s.setupRotationDumy(), s.setupPanDumy(), s.data.slideShowAutoPlay_bl && s.controller_do.startSlideshow(), s.dispatchEvent && s.dispatchEvent(r.All_IMAGES_LOADED), (s.safeToControll_bl = !0); }), (s.setupPreloader = function () { FWDPreloader.setPrototype(), (s.preloader_do = new FWDPreloader(s, s.data.mainPreloader_img, 40, 43, 60, s.data.preloaderFontColor_str, s.data.preloaderBackgroundColor_str)), s.preloader_do.addListener(FWDPreloader.HIDE_COMPLETE, s.onPreloaderHideCompleteHandler), s.preloader_do.positionAndResize(), s.preloader_do.hide(!1), s.preloader_do.show(!0), s.main_do.addChild(s.preloader_do); }), (s.onPreloaderHideCompleteHandler = function () { s.main_do.removeChild(s.preloader_do), s.preloader_do.destroy(), (s.preloader_do = null); }), (s.setupHider = function () { FWDHider.setPrototype(), (s.hider = new FWDHider(s.data.isMobile_bl, s.main_do, s.data.hideControllerDelay)); }), (s.setupController = function () { FWDController.setPrototype(), (s.controller_do = new FWDController(s.data, s)), s.controller_do.addListener(FWDController.MOUSE_DOWN, s.controllerOnMouseDownHandler), s.controller_do.addListener(FWDController.CHANGE_NAVIGATION_STYLE, s.setImageViewerNavigationStyleHandler), s.controller_do.addListener(FWDController.GOTO_TOP_OR_BOTTOM_IMAGE, s.gotoTopOrBottomImageHandler), s.controller_do.addListener(FWDController.GOTO_NEXT_OR_PREV_IMAGE, s.gotoNextImageHandler), s.controller_do.addListener(FWDController.GOTO_NEXT_OR_PREV_IMAGE_COMPLETE, s.gotoNextImageCompleteHandler), s.controller_do.addListener(FWDController.DISABLE_PAN_OR_MOVE, s.disablePanOrMoveHandler), s.controller_do.addListener(FWDController.ENABLE_PAN_OR_MOVE, s.enablePanOrMoveHandler), s.controller_do.addListener(FWDController.SCROLL_BAR_UPDATE, s.controllerScrollBarUpdateHandler), s.controller_do.addListener(FWDController.ZOOM_WITH_BUTTONS, s.controllerZoomHandler), s.controller_do.addListener(FWDController.START_SLIDE_SHOW, s.controllerStartSlideshowHandler), s.controller_do.addListener(FWDController.STOP_SLIDE_SHOW, s.controllerStopSlideshowHandler), s.controller_do.addListener(FWDController.SHOW_INFO, s.controllerShowInfoHandler), s.controller_do.addListener(FWDController.GO_FULL_SCREEN, s.controllerGoFullScreen), s.controller_do.addListener(FWDController.GO_NORMAL_SCREEN, s.controllerGoNormalSreen), s.controller_do && s.controller_do.resizeAndPosition(), s.main_do.addChild(s.controller_do); }), (s.controllerOnMouseDownHandler = function () { s.imageManager_do.hideToolTipWindow(); }), (s.setImageViewerNavigationStyleHandler = function (e) { s.imageManager_do.setDraggingMode(e.draggingMode), s.customContextMenu && (e.draggingMode == FWDController.ROTATE ? s.customContextMenu.enablePanButton() : e.draggingMode == FWDController.PAN && s.customContextMenu.enableRotateButton()); }), (s.gotoTopOrBottomImageHandler = function (e) { s.data.areAllImagesLoaded_bl && ((s.imageManager_do.curSet += e.dir), s.imageManager_do.gotoImage()); }), (s.gotoNextImageHandler = function (e) { s.data.areAllImagesLoaded_bl && ((s.imageManager_do.curId += e.dir), s.imageManager_do.gotoImage()); }), (s.gotoNextImageCompleteHandler = function (e) { s.data.areAllImagesLoaded_bl && s.imageManager_do.addLargeImage(); }), (s.disablePanOrMoveHandler = function () { s.imageManager_do.disableOrEnablePanOrTouch(!0), s.showMarkersDumy(); }), (s.enablePanOrMoveHandler = function () { s.imageManager_do.disableOrEnablePanOrTouch(!1), s.hideMarkersDumy(); }), (s.controllerScrollBarUpdateHandler = function (e) { s.imageManager_do.zoomInOrOutWithScrollBar(e.percent); }), (s.controllerZoomHandler = function (e) { s.imageManager_do.zoomInOrOutWithButtons(e.dir, e.withPause); }), (s.controllerStartSlideshowHandler = function (e) { s.customContextMenu && s.customContextMenu.updateSlideShowButton(1); }), (s.controllerStopSlideshowHandler = function (e) { s.customContextMenu && s.customContextMenu.updateSlideShowButton(0); }), (s.controllerShowInfoHandler = function () { s.main_do.contains(s.descriptionWindow_do) || (s.main_do.addChild(s.descriptionWindow_do), s.descriptionWindow_do.hide(!1, !0), s.descriptionWindow_do.show(s.data.infoText_str)); }), (s.controllerGoFullScreen = function () { s.isFullScreen_bl || (s.imageManager_do.centerImage(), s.controller_do.setFullScreenButtonState(0), s.customContextMenu && s.customContextMenu.updateFullScreenButton(1), document.addEventListener("fullscreenchange", s.onFullScreenChange), document.addEventListener("mozfullscreenchange", s.onFullScreenChange), document.addEventListener("webkitfullscreenchange", s.onFullScreenChange), s.goFullScreen()); }), (s.controllerGoNormalSreen = function () { s.isFullScreen_bl && (s.goNormalScreen(), s.imageManager_do.centerImage(), s.controller_do.setFullScreenButtonState(1), s.customContextMenu && s.customContextMenu.updateFullScreenButton(0)); }), (this.onFullScreenChange = function (e) { document.fullScreen || document.mozFullScreen || document.webkitIsFullScreen || document.msieFullScreen || (s.showButtonsLabels_bl && s.fullscreenToolTip_do.setLabel(s.fullscreenToolTip_do.toolTipLabel2_str), s.controller_do.setFullScreenButtonState(1), s.customContextMenu && s.customContextMenu.updateFullScreenButton(0), s.controllerGoNormalSreen(), (s.isFullScreen_bl = !1)); }), (s.setupImageManager = function (e) { FWDImageManager.setPrototype(), (s.imageManager_do = new FWDImageManager(s.data, s)), s.imageManager_do.addListener(FWDImageManager.LARGE_IMAGE_LOAD_ERROR, s.imageManagerLoadError), s.imageManager_do.addListener(FWDImageManager.SCROLL_BAR_UPDATE, s.imageManagerScrollBarUpdate), s.imageManager_do.addListener(FWDImageManager.PAN_START, s.imageManagerPanStartHandler), s.imageManager_do.addListener(FWDImageManager.ROTATE_START, s.imageManagerRotateStartHandler), s.imageManager_do.addListener(FWDImageManager.ROTATE_UPDATE, s.imageManagerRotateUpdateHandler), s.imageManager_do.addListener(FWDImageManager.SHOW_NAVIGATOR, s.imageManagerShowNavigatorHandler), s.imageManager_do.addListener(FWDImageManager.HIDE_NAVIGATOR, s.imageManagerHideNavigatorHandler), s.imageManager_do.addListener(FWDImageManager.UPDATE_NAVIGATOR, s.imageManagerUpdateNavigatorHandler), s.imageManager_do.addListener(FWDImageManager.SHOW_INFO, s.imageManagerShowInfoHandler), s.main_do.addChild(s.imageManager_do); }), (s.imageManagerLoadError = function (e) { s.main_do.addChild(s.info_do), s.info_do.showText(e.error); }), (s.imageManagerScrollBarUpdate = function (e) { s.controller_do.updateScrollBar(e.percent, e.animate); }), (s.imageManagerPanStartHandler = function (e) { s.controller_do.stopSlideShow(); }), (s.imageManagerRotateStartHandler = function (e) { s.controller_do.stopSlideShow(); }), (s.imageManagerRotateUpdateHandler = function (e) { s.navigator_do && s.navigator_do.updateImage(e.image), s.main_do.contains(s.info_do) && s.main_do.removeChild(s.info_do); }), (s.imageManagerShowNavigatorHandler = function () { s.navigator_do.show(!0); }), (s.imageManagerHideNavigatorHandler = function () { s.navigator_do.hide(!0); }), (s.imageManagerUpdateNavigatorHandler = function (e) { (s.percentX = e.percentX), (s.percentY = e.percentY), (s.percentWidth = e.percentWidth), (s.percentHeight = e.percentHeight), s.navigator_do.update(e.percentX, e.percentY, e.percentWidth, e.percentHeight, e.animate); }), (s.imageManagerShowInfoHandler = function (e) { s.main_do.addChild(s.descriptionWindow_do), s.descriptionWindow_do.hide(!1, !0), s.descriptionWindow_do.show(e.text); }), (s.setupNavigator = function () { FWDNavigator.setPrototype(), (s.navigator_do = new FWDNavigator(s, s.data)), s.navigator_do.addListener(FWDNavigator.MOUSE_DOWN, s.navigatorOnMouseDownHandler), s.navigator_do.addListener(FWDNavigator.PAN_START, s.navigatorPanStartHandler), s.navigator_do.addListener(FWDNavigator.PAN, s.navigatorPanHandler), s.main_do.addChild(s.navigator_do); }), (s.navigatorOnMouseDownHandler = function () { s.imageManager_do.hideToolTipWindow(); }), (s.navigatorPanStartHandler = function (e) { s.controller_do.stopSlideShow(); }), (s.navigatorPanHandler = function (e) { s.imageManager_do.updateOnNavigatorPan(e.percentX, e.percentY); }), (s.setupDescriptionWindow = function () { FWDDescriptionWindow.setPrototype(), (s.descriptionWindow_do = new FWDDescriptionWindow(s, s.data)), s.descriptionWindow_do.addListener(FWDDescriptionWindow.SHOW_START, s.descWindowShowStartHandler), s.descriptionWindow_do.addListener(FWDDescriptionWindow.HIDE_COMPLETE, s.descWindowHideComplteHandler); }), (s.descWindowShowStartHandler = function () { s.customContextMenu && s.customContextMenu.disable(); }), (s.descWindowHideComplteHandler = function () { s.customContextMenu && s.customContextMenu.enable(), s.main_do.removeChild(s.descriptionWindow_do); }), (this.setupRotationDumy = function () { (s.rotateDumy_sdo = new FWDSimpleDisplayObject("div")), FWDUtils.isIE && (s.rotateDumy_sdo.getStyle().background = "url('dumy')"), s.data.dragInAllDirection_bl ? (s.rotateDumy_sdo.getStyle().cursor = "url(" + s.data.handGrabPath_str + "), default") : s.data.dragVertical_bl ? (s.rotateDumy_sdo.getStyle().cursor = "url(" + s.data.handGrabRotateVerticalPath_str + "), default") : (s.rotateDumy_sdo.getStyle().cursor = "url(" + s.data.handGrabRotatePath_str + "), default"), s.main_do.addChild(s.rotateDumy_sdo); }), (this.showRotateDumy = function () { s.rotateDumy_sdo.setWidth(s.stageWidth), s.rotateDumy_sdo.setHeight(s.stageHeight); }), (this.hideRotateDumy = function () { s.rotateDumy_sdo.setWidth(0), s.rotateDumy_sdo.setHeight(0); }), (this.setupPanDumy = function () { (s.panDumy_sdo = new FWDSimpleDisplayObject("div")), FWDUtils.isIE && (s.panDumy_sdo.getStyle().background = "url('dumy')"), (s.panDumy_sdo.getStyle().cursor = "url(" + s.data.handGrabPath_str + "), default"), s.main_do.addChild(s.panDumy_sdo); }), (this.showPanDumy = function () { s.panDumy_sdo.setWidth(s.stageWidth), s.panDumy_sdo.setHeight(s.stageHeight); }), (this.hidePanDumy = function () { s.panDumy_sdo.setWidth(0), s.panDumy_sdo.setHeight(0); }), (this.setupDisableMarkersDumy = function () { (s.markersDumy_sdo = new FWDSimpleDisplayObject("div")), FWDUtils.isIE && (s.markersDumy_sdo.getStyle().background = "url('dumy')"), s.main_do.addChild(s.markersDumy_sdo); }), (this.showMarkersDumy = function () { s.markersDumy_sdo.setWidth(s.stageWidth), s.markersDumy_sdo.setHeight(s.stageHeight); }), (this.hideMarkersDumy = function () { s.markersDumy_sdo.setWidth(0), s.markersDumy_sdo.setHeight(0); }), (s.goFullScreen = function () { var e = FWDUtils.getScrollOffsets(); (s.lastScrollX = e.x), (s.lastScrollY = e.y), document.documentElement.requestFullScreen ? document.documentElement.requestFullScreen() : document.documentElement.mozRequestFullScreen ? document.documentElement.mozRequestFullScreen() : document.documentElement.webkitRequestFullScreen ? document.documentElement.webkitRequestFullScreen() : document.documentElement.msieRequestFullScreen && document.documentElement.msieRequestFullScreen(), (s.main_do.getStyle().position = "absolute"), (s.body.style.overflow = "hidden"), (document.documentElement.style.overflow = "hidden"), FWDUtils.isIEAndLessThen9 ? s.body.appendChild(s.main_do.screen) : document.documentElement.appendChild(s.main_do.screen), (s.main_do.getStyle().zIndex = 9999999), (s.isFullScreen_bl = !0); s.resizeHandler(!0); setTimeout(function () { s.imageManager_do.currentScale = s.imageManager_do.stageWidth / s.imageManager_do.imageWidth; s.resizeHandler(!0); }, 100); }), (s.goNormalScreen = function () { document.cancelFullScreen ? document.cancelFullScreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.webkitCancelFullScreen ? document.webkitCancelFullScreen() : document.msieCancelFullScreen && document.msieCancelFullScreen(); (s.isFullScreen_bl = !1); // Make the image match the scale by rescaling the image after the DOM has adjusted setTimeout(function () { s.addMainDoToTheOriginalParent(); s.resizeHandler(!0); s.imageManager_do.currentScale = s.imageManager_do.stageWidth / s.imageManager_do.imageWidth; s.imageManager_do.finalY = 0; s.resizeHandler(!0); var event = document.createEvent('Event'); event.initEvent('360PlayerNormalScreenDone', true, true); document.dispatchEvent(event); }, 200); }), (s.addMainDoToTheOriginalParent = function () { s.displayType != r.FULL_SCREEN && ((document.documentElement.style.overflow = "visible"), (s.body.style.overflow = "visible"), (s.body.style.display = "inline")), s.displayType == r.FULL_SCREEN ? document.documentElement.appendChild(s.main_do.screen) : (s.displayType == r.LIGHTBOX || (s.main_do.getStyle().position = "relative"), s.stageContainer.appendChild(s.main_do.screen)), (s.main_do.getStyle().zIndex = 0), s.navigator_do && setTimeout(function () { s.navigator_do.update(0.5, 0.5, s.percentWidth, s.percentHeight, !1); }, 200), t.scrollTo(s.lastScrollX, s.lastScrollY); }), (this.pan = function () { s.safeToControll_bl && s.controller_do.pan(); }), (this.rotate = function () { s.safeToControll_bl && s.controller_do.rotate(); }), (this.rotateLeft = function () { s.safeToControll_bl && s.controller_do.prevButtonStartHandler(); }), (this.rotateRight = function () { s.safeToControll_bl && s.controller_do.nextButtonStartHandler(); }), (this.zoomOut = function () { s.safeToControll_bl && s.controller_do.zoomOutStartHandler(); }), (this.zoomIn = function () { s.safeToControll_bl && s.controller_do.zoomInStartHandler(); }), (this.play = function () { s.safeToControll_bl && s.controller_do.startSlideshow(); }), (this.pause = function () { s.safeToControll_bl && s.controller_do.stopSlideShow(); }), (this.info = function () { s.safeToControll_bl && s.controller_do.infoButtonStartHandler(); }), (this.fullScreen = function () { s.safeToControll_bl && s.controllerGoFullScreen(); }), (this.normalScreen = function () { s.safeToControll_bl && s.controllerGoNormalSreen(); }), (this.playToImage = function (e, t) { s.safeToControll_bl && s.controller_do.playToImage(e, t); }), (this.hideInfoWindow = function () { s.descriptionWindow_do.hide(!0); }), (s.cleanMainEvents = function () { t.removeEventListener ? (t.removeEventListener("resize", s.onResizeHandler), t.removeEventListener("scroll", s.onScrollHandler), document.removeEventListener("fullscreenchange", s.onFullScreenChange), document.removeEventListener("mozfullscreenchange", s.onFullScreenChange), document.removeEventListener("webkitfullscreenchange", s.onFullScreenChange)) : t.detachEvent && (t.detachEvent("onresize", s.onResizeHandler), t.detachEvent("onscroll", s.onScrollHandler)), s.isMobile_bl && t.removeEventListener("contextmenu", s.preventContextMenu), clearTimeout(s.resizeHandlerId_to), clearTimeout(s.resizeHandler2Id_to), clearTimeout(s.lighboxAnimDoneId_to), clearTimeout(s.startHiderWithDelayId_to), clearTimeout(s.initPluginId_to), clearTimeout(s.activateWithDelayImagemanagerId_to); }), (s.destroy = function () { s.cleanMainEvents(), s.data && s.data.destroy(), s.lightBox_do && s.lightBox_do.destroy(), s.preloader_do && s.preloader_do.destroy(), s.customContextMenu && s.customContextMenu.destroy(), s.info_do && s.info_do.destroy(), s.imageManager_do && (FWDAnimation.killTweensOf(s.imageManager_do), s.imageManager_do.destroy()), s.controller_do && s.controller_do.destroy(), s.navigator_do && s.navigator_do.destroy(), s.hider && s.hider.destroy(), s.descriptionWindow_do && s.descriptionWindow_do.destroy(), s.rotateDumy_sdo && s.rotateDumy_sdo.destroy(), s.markersDumy_sdo && s.markersDumy_sdo.destroy(), s.panDumy_sdo && s.panDumy_sdo.destroy(); try { s.main_do.screen.parentNode.removeChild(s.main_do.screen); } catch (e) { } s.main_do && (s.main_do.setInnerHTML(""), s.main_do.destroy()), (s.data = null), (s.lightBox_do = null), (s.customContextMenu = null), (s.preloader_do = null), (s.hider = null), (s.info_do = null), (s.main_do = null), (s.imageManager_do = null), (s.navigator_do = null), (s.rotateDumy_sdo = null), (s.markersDumy_sdo = null), (s.panDumy_sdo = null), (s = null); }), s.init(); }; (r.setPrototype = function () { r.prototype = new FWDEventDispatcher(); }), (r.CLOSE_LIGHTBOX = "closeLightBox"), (r.FULL_SCREEN = "fullscreen"), (r.LIGHTBOX = "lightbox"), (r.RESPONSIVE = "responsive"), (r.All_IMAGES_LOADED = "allImagesLoaded"), (t.FWDViewer = r); })(window); !function (t, e) { "object" == typeof exports ? module.exports = e() : t.PhotoSwipeAOS = e() } (this, function () { return function (t, e, i, n) { var o = { features: null, bind: function (t, e, i, n) { var o = (n ? "remove" : "add") + "EventListener"; e = e.split(" "); for (var s = 0; s < e.length; s++) e[s] && t[o](e[s], i, !1) }, isArray: function (t) { return t instanceof Array }, createEl: function (t, e) { var i = document.createElement(e || "div"); return t && (i.className = t), i }, getScrollY: function () { var t = window.pageYOffset; return void 0 !== t ? t : document.documentElement.scrollTop }, unbind: function (t, e, i) { o.bind(t, e, i, !0) }, removeClass: function (t, e) { var i = new RegExp("(\\s|^)" + e + "(\\s|$)"); t.className = t.className.replace(i, " ").replace(/^\s\s*/, "").replace(/\s\s*$/, "") }, addClass: function (t, e) { o.hasClass(t, e) || (t.className += (t.className ? " " : "") + e) }, hasClass: function (t, e) { return t.className && new RegExp("(^|\\s)" + e + "(\\s|$)").test(t.className) }, getChildByClass: function (t, e) { for (var i = t.firstChild; i; ) { if (o.hasClass(i, e)) return i; i = i.nextSibling } }, arraySearch: function (t, e, i) { for (var n = t.length; n--; ) if (t[n][i] === e) return n; return -1 }, extend: function (t, e, i) { for (var n in e) if (e.hasOwnProperty(n)) { if (i && t.hasOwnProperty(n)) continue; t[n] = e[n] } }, easing: { sine: { out: function (t) { return Math.sin(t * (Math.PI / 2)) }, inOut: function (t) { return - (Math.cos(Math.PI * t) - 1) / 2 } }, cubic: { out: function (t) { return --t * t * t + 1 } } }, detectFeatures: function () { if (o.features) return o.features; var t = o.createEl().style, e = "", i = {}; if (i.oldIE = document.all && !document.addEventListener, i.touch = "ontouchstart" in window, window.requestAnimationFrame && (i.raf = window.requestAnimationFrame, i.caf = window.cancelAnimationFrame), i.pointerEvent = navigator.pointerEnabled || navigator.msPointerEnabled, !i.pointerEvent) { var n = navigator.userAgent; if (/iP(hone|od)/.test(navigator.platform)) { var s = navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/); s && s.length > 0 && (s = parseInt(s[1], 10)) >= 1 && 8 > s && (i.isOldIOSPhone = !0) } var a = n.match(/Android\s([0-9\.]*)/), r = a ? a[1] : 0; (r = parseFloat(r)) >= 1 && (4.4 > r && (i.isOldAndroid = !0), i.androidVersion = r), i.isMobileOpera = /opera mini|opera mobi/i.test(n) } for (var l, u, c = ["transform", "perspective", "animationName"], h = ["", "webkit", "Moz", "ms", "O"], d = 0; 4 > d; d++) { e = h[d]; for (var p = 0; 3 > p; p++) l = c[p], u = e + (e ? l.charAt(0).toUpperCase() + l.slice(1) : l), !i[l] && u in t && (i[l] = u); e && !i.raf && (e = e.toLowerCase(), i.raf = window[e + "RequestAnimationFrame"], i.raf && (i.caf = window[e + "CancelAnimationFrame"] || window[e + "CancelRequestAnimationFrame"])) } if (!i.raf) { var m = 0; i.raf = function (t) { var e = (new Date).getTime(), i = Math.max(0, 16 - (e - m)), n = window.setTimeout(function () { t(e + i) }, i); return m = e + i, n }, i.caf = function (t) { clearTimeout(t) } } return i.svg = !!document.createElementNS && !!document.createElementNS("http://www.w3.org/2000/svg", "svg").createSVGRect, o.features = i, i } }; o.detectFeatures(), o.features.oldIE && (o.bind = function (t, e, i, n) { e = e.split(" "); for (var o, s = (n ? "detach" : "attach") + "Event", a = function () { i.handleEvent.call(i) }, r = 0; r < e.length; r++) if (o = e[r]) if ("object" == typeof i && i.handleEvent) { if (n) { if (!i["oldIE" + o]) return !1 } else i["oldIE" + o] = a; t[s]("on" + o, i["oldIE" + o]) } else t[s]("on" + o, i) }); var s = this, a = { allowPanToNext: !0, spacing: .12, bgOpacity: 1, mouseUsed: !1, loop: !0, pinchToClose: !1, closeOnScroll: !1, closeOnVerticalDrag: !1, verticalDragRange: .75, hideAnimationDuration: 333, showAnimationDuration: 333, showHideOpacity: !1, focus: !0, escKey: !0, arrowKeys: !0, mainScrollEndFriction: .35, panEndFriction: .35, isClickableElement: function (t) { return "A" === t.tagName }, getDoubleTapZoom: function (t, e) { return t ? 1 : e.initialZoomLevel < .7 ? 1 : 1.33 }, maxSpreadZoom: 1.33, modal: !0, scaleMode: "fit", alwaysFadeIn: !1 }; o.extend(a, n); var r, l, u, c, h, d, p, m, f, g, v, _, w, y, x, b, C, I, T, k, S, D, M, A, E, O, R, F, P, L, z, N, Z, W, q, U, B, H, K, j, X, Y, G, V, Q, J, $, tt, et, it, nt, ot, st, at, rt, lt, ut = { x: 0, y: 0 }, ct = { x: 0, y: 0 }, ht = { x: 0, y: 0 }, dt = {}, pt = 0, mt = {}, ft = { x: 0, y: 0 }, gt = 0, vt = !0, _t = [], wt = {}, yt = !1, xt = function (t, e) { o.extend(s, e.publicMethods), _t.push(t) }, bt = function (t) { var e = qe(); return t > e - 1 ? t - e : 0 > t ? e + t : t }, Ct = {}, It = function (t, e) { return Ct[t] || (Ct[t] = []), Ct[t].push(e) }, Tt = function (t) { var e = Ct[t]; if (e) { var i = Array.prototype.slice.call(arguments); i.shift(); for (var n = 0; n < e.length; n++) e[n].apply(s, i) } }, kt = function () { return (new Date).getTime() }, St = function (t) { st = t, s.bg.style.opacity = t * a.bgOpacity, s.bg.style.filter = "alpha(opacity=" + 100 * s.bg.style.opacity + ")" }, Dt = function (t, e, i, n, o) { (!yt || o && o !== s.currItem) && (n /= o ? o.fitRatio : s.currItem.fitRatio), t[D] = _ + e + "px, " + i + "px" + w + " scale(" + n + ")" }, Mt = function (t) { tt && (t && (g > s.currItem.fitRatio ? yt || (Ve(s.currItem, !1, !0), yt = !0) : yt && (Ve(s.currItem), yt = !1)), Dt(tt, ht.x, ht.y, g)) }, At = function (t) { t.container && Dt(t.container.style, t.initialPosition.x, t.initialPosition.y, t.initialZoomLevel, t) }, Et = function (t, e) { e[D] = _ + t + "px, 0px" + w }, Ot = function (t, e) { if (!a.loop && e) { var i = c + (ft.x * pt - t) / ft.x, n = Math.round(t - ce.x); (0 > i && n > 0 || i >= qe() - 1 && 0 > n) && (t = ce.x + n * a.mainScrollEndFriction) } ce.x = t, Et(t, h) }, Rt = function (t, e) { var i = he[t] - mt[t]; return ct[t] + ut[t] + i - i * (e / v) }, Ft = function (t, e) { t.x = e.x, t.y = e.y, e.id && (t.id = e.id) }, Pt = function (t) { t.x = Math.round(t.x), t.y = Math.round(t.y) }, Lt = null, zt = function () { Lt && (o.unbind(document, "mousemove", zt), o.addClass(t, "pswp--has_mouse"), a.mouseUsed = !0, Tt("mouseUsed")), Lt = setTimeout(function () { Lt = null }, 100) }, Nt = function (t, e) { var i = je(s.currItem, dt, t); return e && ($ = i), i }, Zt = function (t) { return t || (t = s.currItem), t.initialZoomLevel }, Wt = function (t) { return t || (t = s.currItem), t.w > 0 ? a.maxSpreadZoom : 1 }, qt = function (t, e, i, n) { return n === s.currItem.initialZoomLevel ? (i[t] = s.currItem.initialPosition[t], !0) : (i[t] = Rt(t, n), i[t] > e.min[t] ? (i[t] = e.min[t], !0) : i[t] < e.max[t] && (i[t] = e.max[t], !0)) }, Ut = function (t) { var e = ""; a.escKey && 27 === t.keyCode ? e = "close" : a.arrowKeys && (37 === t.keyCode ? e = "prev" : 39 === t.keyCode && (e = "next")), e && (t.ctrlKey || t.altKey || t.shiftKey || t.metaKey || (t.preventDefault ? t.preventDefault() : t.returnValue = !1, s[e]())) }, Bt = function (t) { t && (X || j || et || U) && (t.preventDefault(), t.stopPropagation()) }, Ht = function () { s.setScrollOffset(0, o.getScrollY()) }, Kt = {}, jt = 0, Xt = function (t) { Kt[t] && (Kt[t].raf && O(Kt[t].raf), jt--, delete Kt[t]) }, Yt = function (t) { Kt[t] && Xt(t), Kt[t] || (jt++, Kt[t] = {}) }, Gt = function () { for (var t in Kt) Kt.hasOwnProperty(t) && Xt(t) }, Vt = function (t, e, i, n, o, s, a) { var r, l = kt(); Yt(t); var u = function () { if (Kt[t]) { if ((r = kt() - l) >= n) return Xt(t), s(i), void(a && a()); s((i - e) * o(r / n) + e), Kt[t].raf = E(u) } }; u() }, Qt = { shout: Tt, listen: It, viewportSize: dt, options: a, isMainScrollAnimating: function () { return et }, getZoomLevel: function () { return g }, getCurrentIndex: function () { return c }, isDragging: function () { return H }, isZooming: function () { return Q }, setScrollOffset: function (t, e) { mt.x = t, L = mt.y = e, Tt("updateScrollOffset", mt) }, applyZoomPan: function (t, e, i, n) { ht.x = e, ht.y = i, g = t, Mt(n) }, init: function () { if (!r && !l) { var i; s.framework = o, s.template = t, s.bg = o.getChildByClass(t, "pswp__bg"), R = t.className, r = !0, z = o.detectFeatures(), E = z.raf, O = z.caf, D = z.transform, P = z.oldIE, s.scrollWrap = o.getChildByClass(t, "pswp__scroll-wrap"), s.container = o.getChildByClass(s.scrollWrap, "pswp__container"), s.carousel = o.getChildByClass(s.scrollWrap, "pswp__carousel"), h = s.container.style, s.itemHolders = b = [{ el: s.container.children[0], wrap: 0, index: -1 }, { el: s.container.children[1], wrap: 0, index: -1 }, { el: s.container.children[2], wrap: 0, index: -1 } ], b[0].el.style.display = b[2].el.style.display = "none", function () { if (D) { var e = z.perspective && !A; return _ = "translate" + (e ? "3d(" : "("), void(w = z.perspective ? ", 0px)" : ")") } D = "left", o.addClass(t, "pswp--ie"), Et = function (t, e) { e.left = t + "px" }, At = function (t) { var e = t.fitRatio > 1 ? 1 : t.fitRatio, i = t.container.style, n = e * t.w, o = e * t.h; i.width = n + "px", i.height = o + "px", i.left = t.initialPosition.x + "px", i.top = t.initialPosition.y + "px" }, Mt = function () { if (tt) { var t = tt, e = s.currItem, i = e.fitRatio > 1 ? 1 : e.fitRatio, n = i * e.w, o = i * e.h; t.width = n + "px", t.height = o + "px", t.left = ht.x + "px", t.top = ht.y + "px" } } } (), f = { resize: s.updateSize, orientationchange: function () { clearTimeout(lt), lt = setTimeout(function () { s.updateSize() }, 500) }, scroll: Ht, keydown: Ut, click: Bt }; var n = z.isOldIOSPhone || z.isOldAndroid || z.isMobileOpera; for (z.animationName && z.transform && !n || (a.showAnimationDuration = a.hideAnimationDuration = 0), i = 0; i < _t.length; i++) s["init" + _t[i]](); e && (s.ui = new e(s, o)).init(), Tt("firstUpdate"), c = c || a.index || 0, (isNaN(c) || 0 > c || c >= qe()) && (c = 0), s.currItem = We(c), (z.isOldIOSPhone || z.isOldAndroid) && (vt = !1), t.setAttribute("aria-hidden", "false"), a.modal && (vt ? t.style.position = "fixed" : (t.style.position = "absolute", t.style.top = o.getScrollY() + "px")), void 0 === L && (Tt("initialLayout"), L = F = o.getScrollY()); var u = "pswp--open "; for (a.mainClass && (u += a.mainClass + " "), a.showHideOpacity && (u += "pswp--animate_opacity "), u += A ? "pswp--touch" : "pswp--notouch", u += z.animationName ? " pswp--css_animation" : "", u += z.svg ? " pswp--svg" : "", o.addClass(t, u), s.updateSize(), d = -1, gt = null, i = 0; 3 > i; i++) Et((i + d) * ft.x, b[i].el.style); P || o.bind(s.scrollWrap, m, s), It("initialZoomInEnd", function () { s.setContent(b[0], c - 1), s.setContent(b[2], c + 1), b[0].el.style.display = b[2].el.style.display = "block", a.focus && t.focus(), o.bind(document, "keydown", s), z.transform && o.bind(s.scrollWrap, "click", s), a.mouseUsed || o.bind(document, "mousemove", zt), o.bind(window, "resize scroll", s), o.bind(window, "resize scroll orientationchange", s), Tt("bindEvents") }), s.setContent(b[1], c), s.updateCurrItem(), Tt("afterInit"), vt || (y = setInterval(function () { jt || H || Q || g !== s.currItem.initialZoomLevel || s.updateSize() }, 1e3)), o.addClass(t, "pswp--visible") } }, close: function () { r && (r = !1, l = !0, Tt("close"), o.unbind(window, "resize", s), o.unbind(window, "resize scroll orientationchange", s), o.unbind(window, "scroll", f.scroll), o.unbind(document, "keydown", s), o.unbind(document, "mousemove", zt), z.transform && o.unbind(s.scrollWrap, "click", s), H && o.unbind(window, p, s), clearTimeout(lt), Tt("unbindEvents"), Ue(s.currItem, null, !0, s.destroy)) }, destroy: function () { Tt("destroy"), Le && clearTimeout(Le), t.setAttribute("aria-hidden", "true"), t.className = R, y && clearInterval(y), o.unbind(s.scrollWrap, m, s), o.unbind(window, "scroll", s), me(), Gt(), Ct = null }, panTo: function (t, e, i) { i || (t > $.min.x ? t = $.min.x : t < $.max.x && (t = $.max.x), e > $.min.y ? e = $.min.y : e < $.max.y && (e = $.max.y)), ht.x = t, ht.y = e, Mt() }, handleEvent: function (t) { t = t || window.event, f[t.type] && f[t.type](t) }, goTo: function (t) { var e = (t = bt(t)) - c; gt = e, c = t, s.currItem = We(c), pt -= e, Ot(ft.x * pt), Gt(), et = !1, s.updateCurrItem() }, next: function () { c < qe() - 1 && s.goTo(c + 1) }, prev: function () { c > 0 && s.goTo(c - 1) }, updateCurrZoomItem: function (t) { if (t && Tt("beforeChange", 0), b[1].el.children.length) { var e = b[1].el.children[0]; tt = o.hasClass(e, "pswp__zoom-wrap") ? e.style : null } else tt = null; $ = s.currItem.bounds, v = g = s.currItem.initialZoomLevel, ht.x = $.center.x, ht.y = $.center.y, t && Tt("afterChange") }, invalidateCurrItems: function () { x = !0; for (var t = 0; 3 > t; t++) b[t].item && (b[t].item.needsUpdate = !0) }, updateCurrItem: function (t) { if (0 !== gt) { var e, i = Math.abs(gt); if (!(t && 2 > i)) { s.currItem = We(c), yt = !1, Tt("beforeChange", gt), i >= 3 && (d += gt + (gt > 0 ? -3 : 3), i = 3); for (var n = 0; i > n; n++) gt > 0 ? (e = b.shift(), b[2] = e, Et((++d + 2) * ft.x, e.el.style), s.setContent(e, c - i + n + 1 + 1)) : (e = b.pop(), b.unshift(e), Et(--d * ft.x, e.el.style), s.setContent(e, c + i - n - 1 - 1)); if (tt && 1 === Math.abs(gt)) { var o = We(C); o.initialZoomLevel !== g && (je(o, dt), Ve(o), At(o)) } (n = document.getElementsByClassName("pswp__aosc")[0]) && s.currItem.bounds && (n.style.marginTop = s.currItem.bounds.center.y + "px"), gt = 0, s.updateCurrZoomItem(), C = c, Tt("afterChange") } } }, updateSize: function (e) { if (!vt && a.modal) { var i = o.getScrollY(); if (L !== i && (t.style.top = i + "px", L = i), !e && wt.x === window.innerWidth && wt.y === window.innerHeight) return; wt.x = window.innerWidth, wt.y = window.innerHeight, t.style.height = wt.y + "px" } if (dt.x = s.scrollWrap.clientWidth, dt.y = s.scrollWrap.clientHeight, Ht(), ft.x = dt.x + Math.round(dt.x * a.spacing), ft.y = dt.y, Ot(ft.x * pt), Tt("beforeResize"), void 0 !== d) { for (var n, r, l = 0; 3 > l; l++) n = b[l], Et((l + d) * ft.x, n.el.style), u = c + l - 1, a.loop && qe() > 2 && (u = bt(u)), (r = We(u)) && (x || r.needsUpdate || !r.bounds) ? (s.cleanSlide(r), s.setContent(n, u), 1 === l && (s.currItem = r, s.updateCurrZoomItem(!0)), r.needsUpdate = !1) : -1 === n.index && u >= 0 && s.setContent(n, u), r && r.container && (je(r, dt), Ve(r), At(r)); x = !1 } var u; (u = document.getElementsByClassName("pswp__aosc")[0]) && s.currItem.bounds && (u.style.marginTop = s.currItem.bounds.center.y + "px"), v = g = s.currItem.initialZoomLevel, ($ = s.currItem.bounds) && (ht.x = $.center.x, ht.y = $.center.y, Mt(!0)), Tt("resize") }, zoomTo: function (t, e, i, n, s) { e && (v = g, he.x = Math.abs(e.x) - ht.x, he.y = Math.abs(e.y) - ht.y, Ft(ct, ht)); var a = Nt(t, !1), r = {}; qt("x", a, r, t), qt("y", a, r, t); var l = g, u = ht.x, c = ht.y; Pt(r); var h = function (e) { 1 === e ? (g = t, ht.x = r.x, ht.y = r.y) : (g = (t - l) * e + l, ht.x = (r.x - u) * e + u, ht.y = (r.y - c) * e + c), s && s(e), Mt(1 === e) }; i ? Vt("customZoomTo", 0, 1, i, n || o.easing.sine.inOut, h) : h(1), Tt("zoomTo", t) } }, Jt = {}, $t = {}, te = {}, ee = {}, ie = {}, ne = [], oe = {}, se = [], ae = {}, re = 0, le = { x: 0, y: 0 }, ue = 0, ce = { x: 0, y: 0 }, he = { x: 0, y: 0 }, de = { x: 0, y: 0 }, pe = function (t, e) { return ae.x = Math.abs(t.x - e.x), ae.y = Math.abs(t.y - e.y), Math.sqrt(ae.x * ae.x + ae.y * ae.y) }, me = function () { Y && (O(Y), Y = null) }, fe = function () { H && (Y = E(fe), Me()) }, ge = function (t, e) { return !!t && !(t.className && t.className.indexOf("pswp__scroll-wrap") > -1) && (e(t) ? t : ge(t.parentNode, e)) }, ve = {}, _e = function (t, e) { return ve.prevent = !ge(t.target, a.isClickableElement), Tt("preventDragEvent", t, e, ve), ve.prevent }, we = function (t, e) { return e.x = t.pageX, e.y = t.pageY, e.id = t.identifier, e }, ye = function (t, e, i) { i.x = .5 * (t.x + e.x), i.y = .5 * (t.y + e.y) }, xe = function () { var t = ht.y - s.currItem.initialPosition.y; return 1 - Math.abs(t / (dt.y / 2)) }, be = {}, Ce = {}, Ie = [], Te = function (t) { for (; Ie.length > 0; ) Ie.pop(); return M ? (rt = 0, ne.forEach(function (t) { 0 === rt ? Ie[0] = t : 1 === rt && (Ie[1] = t), rt++ })) : t.type.indexOf("touch") > -1 ? t.touches && t.touches.length > 0 && (Ie[0] = we(t.touches[0], be), t.touches.length > 1 && (Ie[1] = we(t.touches[1], Ce))) : (be.x = t.pageX, be.y = t.pageY, be.id = "", Ie[0] = be), Ie }, ke = function (t, e) { var i, n, o, r, l = ht[t] + e[t], u = e[t] > 0, c = ce.x + e.x, h = ce.x - oe.x; return i = l > $.min[t] || l < $.max[t] ? a.panEndFriction : 1, l = ht[t] + e[t] * i, !a.allowPanToNext && g !== s.currItem.initialZoomLevel || (tt ? "h" !== it || "x" !== t || j || (u ? (l > $.min[t] && (i = a.panEndFriction, $.min[t], n = $.min[t] - ct[t]), (0 >= n || 0 > h) && qe() > 1 ? (r = c, 0 > h && c > oe.x && (r = oe.x)) : $.min.x !== $.max.x && (o = l)) : (l < $.max[t] && (i = a.panEndFriction, $.max[t], n = ct[t] - $.max[t]), (0 >= n || h > 0) && qe() > 1 ? (r = c, h > 0 && c < oe.x && (r = oe.x)) : $.min.x !== $.max.x && (o = l))) : r = c, "x" !== t) ? void(et || G || g > s.currItem.fitRatio && (ht[t] += e[t] * i)) : (void 0 !== r && (Ot(r, !0), G = r !== oe.x), $.min.x !== $.max.x && (void 0 !== o ? ht.x = o : G || (ht.x += e.x * i)), void 0 !== r) }, Se = function (t) { if (!("mousedown" === t.type && t.button > 0)) { if (Ze) return void t.preventDefault(); if (!B || "mousedown" !== t.type) { if (_e(t, !0) && t.preventDefault(), Tt("pointerDown"), M) { var e = o.arraySearch(ne, t.pointerId, "id"); 0 > e && (e = ne.length), ne[e] = { x: t.pageX, y: t.pageY, id: t.pointerId } } var i = Te(t), n = i.length; V = null, Gt(), H && 1 !== n || (H = nt = !0, o.bind(window, p, s), q = at = ot = U = G = X = K = j = !1, it = null, Tt("firstTouchStart", i), Ft(ct, ht), ut.x = ut.y = 0, Ft(ee, i[0]), Ft(ie, ee), oe.x = ft.x * pt, se = [{ x: ee.x, y: ee.y } ], Z = N = kt(), Nt(g, !0), me(), fe()), !Q && n > 1 && !et && !G && (v = g, j = !1, Q = K = !0, ut.y = ut.x = 0, Ft(ct, ht), Ft(Jt, i[0]), Ft($t, i[1]), ye(Jt, $t, de), he.x = Math.abs(de.x) - ht.x, he.y = Math.abs(de.y) - ht.y, J = pe(Jt, $t)) } } }, De = function (t) { if (t.preventDefault(), M) { var e = o.arraySearch(ne, t.pointerId, "id"); if (e > -1) { var i = ne[e]; i.x = t.pageX, i.y = t.pageY } } if (H) { var n = Te(t); if (it || X || Q) V = n; else if (ce.x !== ft.x * pt) it = "h"; else { var s = Math.abs(n[0].x - ee.x) - Math.abs(n[0].y - ee.y); Math.abs(s) >= 10 && (it = s > 0 ? "h" : "v", V = n) } } }, Me = function () { if (V) { var t = V.length; if (0 !== t) if (Ft(Jt, V[0]), te.x = Jt.x - ee.x, te.y = Jt.y - ee.y, Q && t > 1) { if (ee.x = Jt.x, ee.y = Jt.y, !te.x && !te.y && function (t, e) { return t.x === e.x && t.y === e.y } (V[1], $t)) return; Ft($t, V[1]), j || (j = !0, Tt("zoomGestureStarted")); var e = pe(Jt, $t), i = Fe(e); i > s.currItem.initialZoomLevel + s.currItem.initialZoomLevel / 15 && (at = !0); var n = 1, r = Zt(), l = Wt(); if (r > i) if (a.pinchToClose && !at && v <= s.currItem.initialZoomLevel) { var u = 1 - (r - i) / (r / 1.2); St(u), Tt("onPinchClose", u), ot = !0 } else (n = (r - i) / r) > 1 && (n = 1), i = r - n * (r / 3); else i > l && ((n = (i - l) / (6 * r)) > 1 && (n = 1), i = l + n * r); 0 > n && (n = 0), ye(Jt, $t, le), ut.x += le.x - de.x, ut.y += le.y - de.y, Ft(de, le), ht.x = Rt("x", i), ht.y = Rt("y", i), q = i > g, g = i, Mt() } else { var c = void 0 !== window.pageYOffset ? window.pageYOffset : (document.documentElement || document.body.parentNode || document.body).scrollTop, h = s.carousel.getBoundingClientRect(); if (V[0].y > h.top + c && 0 != h.top && !o.hasClass(s.carousel, "pswp__ui--hidden")) return; if (!it) return; if (nt && (nt = !1, Math.abs(te.x) >= 10 && (te.x -= V[0].x - ie.x), Math.abs(te.y) >= 10 && (te.y -= V[0].y - ie.y)), ee.x = Jt.x, ee.y = Jt.y, 0 === te.x && 0 === te.y) return; if ("v" === it && a.closeOnVerticalDrag && "fit" === a.scaleMode && g === s.currItem.initialZoomLevel) { ut.y += te.y, ht.y += te.y; var d = xe(); return U = !0, Tt("onVerticalDrag", d), St(d), void Mt() } (function (t, e, i) { if (t - Z > 50) { var n = se.length > 2 ? se.shift() : {}; n.x = e, n.y = i, se.push(n), Z = t } })(kt(), Jt.x, Jt.y), X = !0, $ = s.currItem.bounds, ke("x", te) || (ke("y", te), Pt(ht), Mt()) } } }, Ae = function (t) { if (z.isOldAndroid) { if (B && "mouseup" === t.type) return; t.type.indexOf("touch") > -1 && (clearTimeout(B), B = setTimeout(function () { B = 0 }, 600)) } var e; if (Tt("pointerUp"), _e(t, !1) && t.preventDefault(), M) { var i = o.arraySearch(ne, t.pointerId, "id"); i > -1 && (e = ne.splice(i, 1)[0], navigator.pointerEnabled ? e.type = t.pointerType || "mouse" : (e.type = { 4: "mouse", 2: "touch", 3: "pen" } [t.pointerType], e.type || (e.type = t.pointerType || "mouse"))) } var n, r = Te(t), l = r.length; if ("mouseup" === t.type && (l = 0), 2 === l) return V = null, !0; 1 === l && Ft(ie, r[0]), 0 !== l || it || et || (e || ("mouseup" === t.type ? e = { x: t.pageX, y: t.pageY, type: "mouse" } : t.changedTouches && t.changedTouches[0] && (e = { x: t.changedTouches[0].pageX, y: t.changedTouches[0].pageY, type: "touch" })), Tt("touchRelease", t, e)); var u = -1; if (0 === l && (H = !1, o.unbind(window, p, s), me(), Q ? u = 0 : -1 !== ue && (u = kt() - ue)), ue = 1 === l ? kt() : -1, n = -1 !== u && 150 > u ? "zoom" : "swipe", Q && 2 > l && (Q = !1, 1 === l && (n = "zoomPointerUp"), Tt("zoomGestureEnded")), V = null, X || j || et || U) if (Gt(), W || (W = Ee()), W.calculateSwipeSpeed("x"), U) if (xe() < a.verticalDragRange) s.close(); else { var c = ht.y, h = st; Vt("verticalDrag", 0, 1, 300, o.easing.cubic.out, function (t) { ht.y = (s.currItem.initialPosition.y - c) * t + c, St((1 - h) * t + h), Mt() }), Tt("onVerticalDrag", 1) } else { if ((G || et) && 0 === l) { if (Re(n, W)) return; n = "zoomPointerUp" } if (!et) return "swipe" !== n ? void Pe() : void(!G && g > s.currItem.fitRatio && Oe(W)) } }, Ee = function () { var t, e, i = { lastFlickOffset: {}, lastFlickDist: {}, lastFlickSpeed: {}, slowDownRatio: {}, slowDownRatioReverse: {}, speedDecelerationRatio: {}, speedDecelerationRatioAbs: {}, distanceOffset: {}, backAnimDestination: {}, backAnimStarted: {}, calculateSwipeSpeed: function (n) { se.length > 1 ? (t = kt() - Z + 50, e = se[se.length - 2][n]) : (t = kt() - N, e = ie[n]), i.lastFlickOffset[n] = ee[n] - e, i.lastFlickDist[n] = Math.abs(i.lastFlickOffset[n]), i.lastFlickDist[n] > 20 ? i.lastFlickSpeed[n] = i.lastFlickOffset[n] / t : i.lastFlickSpeed[n] = 0, Math.abs(i.lastFlickSpeed[n]) < .1 && (i.lastFlickSpeed[n] = 0), i.slowDownRatio[n] = .95, i.slowDownRatioReverse[n] = 1 - i.slowDownRatio[n], i.speedDecelerationRatio[n] = 1 }, calculateOverBoundsAnimOffset: function (t, e) { i.backAnimStarted[t] || (ht[t] > $.min[t] ? i.backAnimDestination[t] = $.min[t] : ht[t] < $.max[t] && (i.backAnimDestination[t] = $.max[t]), void 0 !== i.backAnimDestination[t] && (i.slowDownRatio[t] = .7, i.slowDownRatioReverse[t] = 1 - i.slowDownRatio[t], i.speedDecelerationRatioAbs[t] < .05 && (i.lastFlickSpeed[t] = 0, i.backAnimStarted[t] = !0, Vt("bounceZoomPan" + t, ht[t], i.backAnimDestination[t], e || 300, o.easing.sine.out, function (e) { ht[t] = e, Mt() })))) }, calculateAnimOffset: function (t) { i.backAnimStarted[t] || (i.speedDecelerationRatio[t] = i.speedDecelerationRatio[t] * (i.slowDownRatio[t] + i.slowDownRatioReverse[t] - i.slowDownRatioReverse[t] * i.timeDiff / 10), i.speedDecelerationRatioAbs[t] = Math.abs(i.lastFlickSpeed[t] * i.speedDecelerationRatio[t]), i.distanceOffset[t] = i.lastFlickSpeed[t] * i.speedDecelerationRatio[t] * i.timeDiff, ht[t] += i.distanceOffset[t]) }, panAnimLoop: function () { return Kt.zoomPan && (Kt.zoomPan.raf = E(i.panAnimLoop), i.now = kt(), i.timeDiff = i.now - i.lastNow, i.lastNow = i.now, i.calculateAnimOffset("x"), i.calculateAnimOffset("y"), Mt(), i.calculateOverBoundsAnimOffset("x"), i.calculateOverBoundsAnimOffset("y"), i.speedDecelerationRatioAbs.x < .05 && i.speedDecelerationRatioAbs.y < .05) ? (ht.x = Math.round(ht.x), ht.y = Math.round(ht.y), Mt(), void Xt("zoomPan")) : void 0 } }; return i }, Oe = function (t) { return t.calculateSwipeSpeed("y"), $ = s.currItem.bounds, t.backAnimDestination = {}, t.backAnimStarted = {}, Math.abs(t.lastFlickSpeed.x) <= .05 && Math.abs(t.lastFlickSpeed.y) <= .05 ? (t.speedDecelerationRatioAbs.x = t.speedDecelerationRatioAbs.y = 0, t.calculateOverBoundsAnimOffset("x"), t.calculateOverBoundsAnimOffset("y"), !0) : (Yt("zoomPan"), t.lastNow = kt(), void t.panAnimLoop()) }, Re = function (t, e) { var i, n, r; if (et || (re = c), "swipe" === t) { var l = ee.x - ie.x, u = e.lastFlickDist.x < 10; l > 30 && (u || e.lastFlickOffset.x > 20) ? n = -1 : -30 > l && (u || e.lastFlickOffset.x < -20) && (n = 1) } n && (0 > (c += n) ? (c = a.loop ? qe() - 1 : 0, r = !0) : c >= qe() && (c = a.loop ? 0 : qe() - 1, r = !0), (!r || a.loop) && (gt += n, pt -= n, i = !0)); var h, d = ft.x * pt, p = Math.abs(d - ce.x); return i || d > ce.x == e.lastFlickSpeed.x > 0 ? (h = Math.abs(e.lastFlickSpeed.x) > 0 ? p / Math.abs(e.lastFlickSpeed.x) : 333, h = Math.min(h, 400), h = Math.max(h, 250)) : h = 333, re === c && (i = !1), et = !0, Tt("mainScrollAnimStart"), Vt("mainScroll", ce.x, d, h, o.easing.cubic.out, Ot, function () { Gt(), et = !1, re = -1, (i || re !== c) && s.updateCurrItem(), Tt("mainScrollAnimComplete") }), i && s.updateCurrItem(!0), i }, Fe = function (t) { return 1 / J * t * v }, Pe = function () { var t = g, e = Zt(), i = Wt(); e > g ? t = e : g > i && (t = i); var n, a = st; return ot && !q && !at && e > g ? (s.close(), !0) : (ot && (n = function (t) { St((1 - a) * t + a) }), s.zoomTo(t, 0, 200, o.easing.cubic.out, n), !0) }; xt("Gestures", { publicMethods: { initGestures: function () { var t = function (t, e, i, n, o) { I = t + e, T = t + i, k = t + n, S = o ? t + o : "" }; (M = z.pointerEvent) && z.touch && (z.touch = !1), M ? navigator.pointerEnabled ? t("pointer", "down", "move", "up", "cancel") : t("MSPointer", "Down", "Move", "Up", "Cancel") : z.touch ? (t("touch", "start", "move", "end", "cancel"), A = !0) : t("mouse", "down", "move", "up"), p = T + " " + k + " " + S, m = I, M && !A && (A = navigator.maxTouchPoints > 1 || navigator.msMaxTouchPoints > 1), s.likelyTouchDevice = A, f[I] = Se, f[T] = De, f[k] = Ae, S && (f[S] = f[k]), z.touch && (m += " mousedown", p += " mousemove mouseup", f.mousedown = f[I], f.mousemove = f[T], f.mouseup = f[k]), A || (a.allowPanToNext = !1) } } }); var Le, ze, Ne, Ze, We, qe, Ue = function (e, i, n, r) { var l; Le && clearTimeout(Le), Ze = !0, Ne = !0, e.initialLayout ? (l = e.initialLayout, e.initialLayout = null) : l = a.getThumbBoundsFn && a.getThumbBoundsFn(c); var h, d, p = n ? a.hideAnimationDuration : a.showAnimationDuration, m = function () { Xt("initialZoom"), n ? (s.template.removeAttribute("style"), s.bg.removeAttribute("style")) : (St(1), i && (i.style.display = "block"), o.addClass(t, "pswp--animated-in"), Tt("initialZoom" + (n ? "OutEnd" : "InEnd"))), r && r(), Ze = !1 }; if (!p || !l || void 0 === l.x) return Tt("initialZoom" + (n ? "Out" : "In")), g = e.initialZoomLevel, Ft(ht, e.initialPosition), Mt(), t.style.opacity = n ? 0 : 1, St(1), void m(); h = u, d = !s.currItem.src || s.currItem.loadError || a.showHideOpacity, e.miniImg && (e.miniImg.style.webkitBackfaceVisibility = "hidden"), n || (g = l.w / e.w, ht.x = l.x, ht.y = l.y - F, s[d ? "template" : "bg"].style.opacity = .001, Mt()), Yt("initialZoom"), n && !h && o.removeClass(t, "pswp--animated-in"), d && (n ? o[(h ? "remove" : "add") + "Class"](t, "pswp--animate_opacity") : setTimeout(function () { o.addClass(t, "pswp--animate_opacity") }, 30)), Le = setTimeout(function () { if (Tt("initialZoom" + (n ? "Out" : "In")), n) { var i = l.w / e.w, s = { x: ht.x, y: ht.y }, a = g, r = st, u = function (e) { 1 === e ? (g = i, ht.x = l.x, ht.y = l.y - L) : (g = (i - a) * e + a, ht.x = (l.x - s.x) * e + s.x, ht.y = (l.y - L - s.y) * e + s.y), Mt(), d ? t.style.opacity = 1 - e : St(r - e * r) }; h ? Vt("initialZoom", 0, 1, p, o.easing.cubic.out, u, m) : (u(1), Le = setTimeout(m, p + 20)) } else g = e.initialZoomLevel, Ft(ht, e.initialPosition), Mt(), St(1), d ? t.style.opacity = 1 : St(1), Le = setTimeout(m, p + 20) }, n ? 25 : 90) }, Be = {}, He = [], Ke = { index: 0, errorMsg: '
    The image could not be loaded.
    ', forceProgressiveLoading: !1, preload: [1, 1], getNumItemsFn: function () { return ze.length } }, je = function (t, e, i) { if (t.src && !t.loadError) { var n = !i; if (n && (t.vGap || (t.vGap = { top: 0, bottom: 0 }), Tt("parseVerticalMargin", t)), Be.x = e.x, Be.y = e.y - t.vGap.top - t.vGap.bottom, n) { var o = Be.x / t.w, s = Be.y / t.h; t.fitRatio = s > o ? o : s; var r = a.scaleMode; "orig" === r ? i = 1 : "fit" === r && (i = t.fitRatio), i > 1 && (i = 1), t.initialZoomLevel = i, t.bounds || (t.bounds = { center: { x: 0, y: 0 }, max: { x: 0, y: 0 }, min: { x: 0, y: 0 } }) } if (!i) return; return function (t, e, i) { var n = t.bounds; n.center.x = Math.round((Be.x - e) / 2), n.center.y = Math.round((Be.y - i) / 2) + t.vGap.top, n.max.x = e > Be.x ? Math.round(Be.x - e) : n.center.x, n.max.y = i > Be.y ? Math.round(Be.y - i) + t.vGap.top : n.center.y, n.min.x = e > Be.x ? 0 : n.center.x, n.min.y = i > Be.y ? t.vGap.top : n.center.y } (t, t.w * i, t.h * i), n && i === t.initialZoomLevel && (t.initialPosition = t.bounds.center), t.bounds } return t.w = t.h = 0, t.initialZoomLevel = t.fitRatio = 1, t.bounds = { center: { x: 0, y: 0 }, max: { x: 0, y: 0 }, min: { x: 0, y: 0 } }, t.initialPosition = t.bounds.center, t.bounds }, Xe = function (t, e, i, n, o, s) { e.loadError || n && (e.imageAppended = !0, Ve(e, n), i.appendChild(n), s && setTimeout(function () { e && e.loaded && e.placeholder && (e.placeholder.style.display = "none", e.placeholder = null) }, 500)) }, Ye = function (t) { t.loading = !0, t.loaded = !1; var e = t.img = o.createEl("pswp__img", "img"), i = function () { t.loading = !1, t.loaded = !0, t.loadComplete ? t.loadComplete(t) : t.img = null, e.onload = e.onerror = null, e = null }; return e.onload = i, e.onerror = function () { t.loadError = !0, i() }, e.src = t.src, e }, Ge = function (t, e) { return t.src && t.loadError && t.container ? (e && (t.container.innerHTML = ""), t.container.innerHTML = a.errorMsg.replace("%url%", t.src), !0) : void 0 }, Ve = function (t, e, i) { if (t.src) { e || (e = t.container.lastChild); var n = i ? t.w : Math.round(t.w * t.fitRatio), o = i ? t.h : Math.round(t.h * t.fitRatio), s = document.getElementsByClassName("pswp__aosc")[0]; s.style.width = n + "px", s.style.height = o + "px", t.placeholder && !t.loaded && (t.placeholder.style.width = n + "px", t.placeholder.style.height = o + "px"), e.style.width = n + "px", e.style.height = o + "px" } }, Qe = function () { if (He.length) { for (var t, e = 0; e < He.length; e++) (t = He[e]).holder.index === t.index && Xe(t.index, t.item, t.baseDiv, t.img, 0, t.clearPlaceholder); He = [] } }; xt("Controller", { publicMethods: { lazyLoadItem: function (t) { t = bt(t); var e = We(t); !e || e.loaded || e.loading || (Tt("gettingData", t, e), e.src && Ye(e)) }, initController: function () { o.extend(a, Ke, !0), s.items = ze = i, We = s.getItemAt, qe = a.getNumItemsFn, a.loop, qe() < 3 && (a.loop = !1), It("beforeChange", function (t) { var e, i = a.preload, n = null === t || t > 0, o = Math.min(i[0], qe()), r = Math.min(i[1], qe()); for (e = 1; (n ? r : o) >= e; e++) s.lazyLoadItem(c + e); for (e = 1; (n ? o : r) >= e; e++) s.lazyLoadItem(c - e) }), It("initialLayout", function () { s.currItem.initialLayout = a.getThumbBoundsFn && a.getThumbBoundsFn(c) }), It("mainScrollAnimComplete", Qe), It("initialZoomInEnd", Qe), It("destroy", function () { for (var t, e = 0; e < ze.length; e++) (t = ze[e]).container && (t.container = null), t.placeholder && (t.placeholder = null), t.img && (t.img = null), t.preloader && (t.preloader = null), t.loadError && (t.loaded = t.loadError = !1); He = null }) }, getItemAt: function (t) { return t >= 0 && void 0 !== ze[t] && ze[t] }, allowProgressiveImg: function () { return a.forceProgressiveLoading || !A || a.mouseUsed || screen.width > 1200 }, setContent: function (t, e) { a.loop && (e = bt(e)); var i = s.getItemAt(t.index); i && (i.container = null); var n, l = s.getItemAt(e); if (l) { Tt("gettingData", e, l), t.index = e, t.item = l; var u = l.container = o.createEl("pswp__zoom-wrap"); if (!l.src && l.html && (l.html.tagName ? u.appendChild(l.html) : u.innerHTML = l.html), Ge(l), je(l, dt), !l.src || l.loadError || l.loaded) l.src && !l.loadError && ((n = o.createEl("pswp__img", "img")).style.opacity = 1, n.src = l.src, Ve(l, n), Xe(0, l, u, n)); else { if (l.loadComplete = function (i) { if (r) { if (t && t.index === e) { if (Ge(i, !0)) return i.loadComplete = i.img = null, je(i, dt) , At(i), void(t.index === c && s.updateCurrZoomItem()); i.imageAppended ? !Ze && i.placeholder && (i.placeholder.style.display = "none", i.placeholder = null) : z.transform && (et || Ze) ? He.push({ item: i, baseDiv: u, img: i.img, index: e, holder: t, clearPlaceholder: !0 }) : Xe(0, i, u, i.img, 0, !0) } i.loadComplete = null, i.img = null, Tt("imageLoadComplete", e, i) } }, o.features.transform) { var h = "pswp__img pswp__img--placeholder"; h += l.msrc ? "" : " pswp__img--placeholder--blank"; var d = o.createEl(h, l.msrc ? "img" : ""); l.msrc && (d.src = l.msrc), Ve(l, d), u.appendChild(d), l.placeholder = d } l.loading || Ye(l), s.allowProgressiveImg() && (!Ne && z.transform ? He.push({ item: l, baseDiv: u, img: l.img, index: e, holder: t }) : Xe(0, l, u, l.img, 0, !0)) } Ne || e !== c ? At(l) : (tt = u.style, Ue(l, n || l.img)), t.el.innerHTML = "", t.el.appendChild(u) } else t.el.innerHTML = "" }, cleanSlide: function (t) { t.img && (t.img.onload = t.img.onerror = null), t.loaded = t.loading = t.img = t.imageAppended = !1 } } }); var Je, $e, ti = {}, ei = function (t, e, i) { var n = document.createEvent("CustomEvent"), o = { origEvent: t, target: t.target, releasePoint: e, pointerType: i || "touch" }; n.initCustomEvent("pswpTap", !0, !0, o), t.target.dispatchEvent(n) }; xt("Tap", { publicMethods: { initTap: function () { It("firstTouchStart", s.onTapStart), It("touchRelease", s.onTapRelease), It("destroy", function () { ti = {}, Je = null }) }, onTapStart: function (t) { t.length > 1 && (clearTimeout(Je), Je = null) }, onTapRelease: function (t, e) { if (e && !X && !K && !jt) { var i = e; if (Je && (clearTimeout(Je), Je = null, function (t, e) { return Math.abs(t.x - e.x) < 25 && Math.abs(t.y - e.y) < 25 } (i, ti))) return void Tt("doubleTap", i); if ("mouse" === e.type) return void ei(t, e, "mouse"); if ("BUTTON" === t.target.tagName.toUpperCase() || o.hasClass(t.target, "pswp__single-tap")) return void ei(t, e); Ft(ti, i), Je = setTimeout(function () { ei(t, e), Je = null }, 300) } } } }), xt("DesktopZoom", { publicMethods: { initDesktopZoom: function () { P || (A ? It("mouseUsed", function () { s.setupDesktopZoom() }) : s.setupDesktopZoom(!0)) }, setupDesktopZoom: function (e) { $e = {}; var i = "wheel mousewheel DOMMouseScroll"; It("bindEvents", function () { o.bind(t, i, s.handleMouseWheel) }), It("unbindEvents", function () { $e && o.unbind(t, i, s.handleMouseWheel) }), s.mouseZoomedIn = !1; var n, a = function () { s.mouseZoomedIn && (o.removeClass(t, "pswp--zoomed-in"), s.mouseZoomedIn = !1), g < s.options.maxSpreadZoom ? o.addClass(t, "pswp--zoom-allowed") : o.removeClass(t, "pswp--zoom-allowed"), r() }, r = function () { n && (o.removeClass(t, "pswp--dragging"), n = !1) }; It("resize", a), It("afterChange", a), It("pointerDown", function () { s.mouseZoomedIn && (n = !0, o.addClass(t, "pswp--dragging")) }), It("pointerUp", r), e || a() }, handleMouseWheel: function (t) { if (g <= s.currItem.fitRatio) return a.modal && (!a.closeOnScroll || jt || H ? t.preventDefault() : D && Math.abs(t.deltaY) > 2 && (u = !0, s.close())), !0; if (t.stopPropagation(), $e.x = 0, "deltaX" in t) 1 === t.deltaMode ? ($e.x = 18 * t.deltaX, $e.y = 18 * t.deltaY) : ($e.x = t.deltaX, $e.y = t.deltaY); else if ("wheelDelta" in t) t.wheelDeltaX && ($e.x = - .16 * t.wheelDeltaX), t.wheelDeltaY ? $e.y = - .16 * t.wheelDeltaY : $e.y = - .16 * t.wheelDelta; else { if (!("detail" in t)) return; $e.y = t.detail } Nt(g, !0); var e = ht.x - $e.x, i = ht.y - $e.y; (a.modal || e <= $.min.x && e >= $.max.x && i <= $.min.y && i >= $.max.y) && t.preventDefault(), s.panTo(e, i) }, toggleDesktopZoom: function (e) { e = e || { x: dt.x / 2 + mt.x, y: dt.y / 2 + mt.y }; var i = a.getDoubleTapZoom(!0, s.currItem), n = g === i; s.mouseZoomedIn = !n, s.zoomTo(n ? s.currItem.initialZoomLevel : i, e, 333), o[(n ? "remove" : "add") + "Class"](t, "pswp--zoomed-in") } } }); var ii, ni, oi, si, ai, ri, li, ui, ci, hi, di, pi, mi = { history: 0, galleryUID: 1 }, fi = function () { return di.hash.substring(1) }, gi = function () { ii && clearTimeout(ii), oi && clearTimeout(oi) }, vi = function () { var t = fi(), e = {}; if (t.length < 5) return e; var i, n = t.split("&"); for (i = 0; i < n.length; i++) if (n[i]) { var o = n[i].split("="); o.length < 2 || (e[o[0]] = o[1]) } if (a.galleryPIDs) { var s = e.pid; for (e.pid = 0, i = 0; i < ze.length; i++) if (ze[i].pid === s) { e.pid = i; break } } else e.pid = parseInt(e.pid, 10) - 1; return e.pid < 0 && (e.pid = 0), e }, _i = function () { if (oi && clearTimeout(oi), jt || H) oi = setTimeout(_i, 500); else { si ? clearTimeout(ni) : si = !0; var t = c + 1, e = We(c); e.hasOwnProperty("pid") && (t = e.pid); var i = li + "&gid=" + a.galleryUID + "&pid=" + t; ui || -1 === di.hash.indexOf(i) && (hi = !0); var n = di.href.split("#")[0] + "#" + i; pi ? "#" + i !== window.location.hash && history[ui ? "replaceState" : "pushState"]("", document.title, n) : ui ? di.replace(n) : di.hash = i, ui = !0, ni = setTimeout(function () { si = !1 }, 60) } }; xt("History", { publicMethods: { initHistory: function () { if (o.extend(a, mi, !0), a.history) { di = window.location, hi = !1, ci = !1, ui = !1, li = fi(), pi = "pushState" in history, li.indexOf("gid=") > -1 && (li = (li = li.split("&gid=")[0]).split("?gid=")[0]), It("afterChange", s.updateURL), It("unbindEvents", function () { o.unbind(window, "hashchange", s.onHashChange) }); var t = function () { ri = !0, ci || (hi ? history.back() : li ? di.hash = li : pi ? history.pushState("", document.title, di.pathname + di.search) : di.hash = ""), gi() }; It("unbindEvents", function () { u && t() }), It("destroy", function () { ri || t() }), It("firstUpdate", function () { c = vi().pid }); var e = li.indexOf("pid="); e > -1 && "&" === (li = li.substring(0, e)).slice(-1) && (li = li.slice(0, -1)), setTimeout(function () { r && o.bind(window, "hashchange", s.onHashChange) }, 40) } }, onHashChange: function () { return fi() === li ? (ci = !0, void s.close()) : void(si || (ai = !0, s.goTo(vi().pid), ai = !1)) }, updateURL: function () { gi(), ai || (ui ? ii = setTimeout(_i, 800) : _i()) } } }), o.extend(s, Qt) } }), function (t, e) { "object" == typeof exports ? module.exports = e() : t.PhotoSwipeUI_Default = e() } (this, function () { return function (t, e) { var i, n, o, s, a, r, l, u, c, h, d, p, m, f, g, v, _, w, y = this, x = !1, b = !0, C = !0, I = { barsSize: { top: 44, bottom: "auto" }, closeElClasses: ["item", "caption", "zoom-wrap", "ui", "top-bar"], timeToIdle: 4e3, timeToIdleOutside: 1e3, loadingIndicatorDelay: 1e3, addCaptionHTMLFn: function (t, e) { return t.title ? (e.children[0].innerHTML = t.title, !0) : (e.children[0].innerHTML = "", !1) }, closeEl: !0, captionEl: !0, fullscreenEl: !0, zoomEl: !0, shareEl: !0, counterEl: !0, arrowEl: !0, preloaderEl: !0, tapToClose: !1, tapToToggleControls: !0, clickToCloseNonZoomable: !1, shareButtons: [{ id: "facebook", label: "Share on Facebook", url: "https://www.facebook.com/sharer/sharer.php?u={{url}}" }, { id: "twitter", label: "Tweet", url: "https://twitter.com/intent/tweet?text={{text}}&url={{url}}" }, { id: "pinterest", label: "Pin it", url: "http://www.pinterest.com/pin/create/button/?url={{url}}&media={{image_url}}&description={{text}}" }, { id: "download", label: "Download image", url: "{{raw_image_url}}", download: !0 } ], getImageURLForShare: function () { return t.currItem.src || "" }, getPageURLForShare: function () { return window.location.href }, getTextForShare: function () { return t.currItem.title || "" }, indexIndicatorSep: " / " }, T = function (t) { if (_) return !0; t = t || window.event, v.timeToIdle && v.mouseUsed && !h && R(); for (var i, n, o = (t.target || t.srcElement).className, s = 0; s < z.length; s++) (i = z[s]).onTap && o.indexOf("pswp__" + i.name) > -1 && (i.onTap(), n = !0); if (n) { t.stopPropagation && t.stopPropagation(), _ = !0; var a = e.features.isOldAndroid ? 600 : 30; setTimeout(function () { _ = !1 }, a) } }, k = function (t, i, n) { e[(n ? "add" : "remove") + "Class"](t, "pswp__" + i) }, S = function () { var t = 1 === v.getNumItemsFn(); t !== g && (k(n, "ui--one-slide", t), g = t) }, D = function () { k(u, "share-modal--hidden", C) }, M = function () { return (C = !C) ? (e.removeClass(u, "pswp__share-modal--fade-in"), setTimeout(function () { C && D() }, 300)) : (D(), setTimeout(function () { C || e.addClass(u, "pswp__share-modal--fade-in") }, 30)), C || E(), !1 }, A = function (e) { var i = (e = e || window.event).target || e.srcElement; return t.shout("shareLinkClick", e, i), !(!i.href || !i.hasAttribute("download") && (window.open(i.href, "pswp_share", "scrollbars=yes,resizable=yes,toolbar=no,location=yes,width=550,height=420,top=100,left=" + (window.screen ? Math.round(screen.width / 2 - 275) : 100)), C || M(), 1)) }, E = function () { for (var t, e, i, n, o = "", s = 0; s < v.shareButtons.length; s++) t = v.shareButtons[s], e = v.getImageURLForShare(t), i = v.getPageURLForShare(t), n = v.getTextForShare(t), o += '", v.parseShareButtonOut && (o = v.parseShareButtonOut(t, o)); u.children[0].innerHTML = o, u.children[0].onclick = A }, O = function (t) { for (var i = 0; i < v.closeElClasses.length; i++) if (e.hasClass(t, "pswp__" + v.closeElClasses[i])) return !0 }, R = function () { clearTimeout(w), h && y.setIdle(!1) }, F = function (t) { var e = (t = t || window.event).relatedTarget || t.toElement; e && "HTML" !== e.nodeName || (clearTimeout(w), w = setTimeout(function () { y.setIdle(!0) }, v.timeToIdleOutside)) }, P = function (t) { m !== t && (k(p, "preloader--active", !t), m = t) }, L = function (i) { var o = i.vGap, r = e.getChildByClass(t.scrollWrap, "pswp__carousel"), l = e.getChildByClass(t.scrollWrap, "pswp__carouselDotsContainer"), u = e.getChildByClass(t.bg, "pswp__rotateDevice"); if (r && l && u) if (t.likelyTouchDevice ? t.viewportSize.x > t.viewportSize.y ? (r.style.display = "none", l.style.display = "block", u.style.display = "none") : (r.style.display = "block", l.style.display = "none", u.style.display = "block") : (r.style.display = "block", l.style.display = "none", u.style.display = "none"), !t.likelyTouchDevice || v.mouseUsed || screen.width > 1200) { var c = v.barsSize; if (v.captionEl && "auto" === c.bottom) if (a || ((a = e.createEl("pswp__caption pswp__caption--fake")).appendChild(e.createEl("pswp__caption__center")), n.insertBefore(a, s), e.addClass(n, "pswp__ui--fit")), v.addCaptionHTMLFn(i, a, !0)) { var h = a.clientHeight; o.bottom = parseInt(h, 10) || 44 } else t.viewportSize.x, window.devicePixelRatio, r = e.getChildByClass(t.scrollWrap, "pswp__carousel"), o.bottom = 110; else o.bottom = "auto" === c.bottom ? 0 : c.bottom; o.top = c.top } else o.top = o.bottom = 0 }, z = [{ name: "caption", option: "captionEl", onInit: function (t) { s = t } }, { name: "share-modal", option: "shareEl", onInit: function (t) { u = t }, onTap: function () { M() } }, { name: "button--share", option: "shareEl", onInit: function (t) { l = t }, onTap: function () { M() } }, { name: "button--zoom", option: "zoomEl", onTap: t.toggleDesktopZoom }, { name: "counter", option: "counterEl", onInit: function (t) { r = t } }, { name: "button--close", option: "closeEl", onTap: t.close }, { name: "button--arrow--left", option: "arrowEl", onTap: t.prev }, { name: "button--arrow--right", option: "arrowEl", onTap: t.next }, { name: "button--fs", option: "fullscreenEl", onTap: function () { i.isFullscreen() ? i.exit() : i.enter() } }, { name: "preloader", option: "preloaderEl", onInit: function (t) { p = t } } ]; y.init = function () { e.extend(t.options, I, !0), v = t.options, n = e.getChildByClass(t.scrollWrap, "pswp__ui"), o = e.getChildByClass(t.scrollWrap, "pswp__carousel"), d = t.listen, function () { var t; d("onVerticalDrag", function (t) { b && .95 > t ? y.hideControls() : !b && t >= .95 && y.showControls() }), d("onPinchClose", function (e) { b && .9 > e ? (y.hideControls(), t = !0) : t && !b && e > .9 && y.showControls() }), d("zoomGestureEnded", function () { (t = !1) && !b && y.showControls() }) } (), d("beforeChange", y.update), d("doubleTap", function (e) { var i = t.currItem.initialZoomLevel; t.getZoomLevel() !== i ? t.zoomTo(i, e, 333) : t.zoomTo(v.getDoubleTapZoom(!1, t.currItem), e, 333) }), d("preventDragEvent", function (t, e, i) { var n = t.target || t.srcElement; n && n.className && t.type.indexOf("mouse") > -1 && (n.className.indexOf("__caption") > 0 || /(SMALL|STRONG|EM)/i.test(n.tagName)) && (i.prevent = !1) }), d("bindEvents", function () { e.bind(n, "pswpTap click", T), e.bind(t.scrollWrap, "pswpTap", y.onGlobalTap), t.likelyTouchDevice || e.bind(t.scrollWrap, "mouseover", y.onMouseOver) }), d("unbindEvents", function () { C || M(), e.unbind(document, "mouseout", F), e.unbind(document, "mousemove", R), e.unbind(n, "pswpTap click", T), e.unbind(t.scrollWrap, "pswpTap", y.onGlobalTap), e.unbind(t.scrollWrap, "mouseover", y.onMouseOver), i && (e.unbind(document, i.eventK, y.updateFullscreen), i.isFullscreen() && (v.hideAnimationDuration = 0, i.exit()), i = null) }), d("destroy", function () { v.captionEl && (a && n.removeChild(a), e.removeClass(s, "pswp__caption--empty")), u && (u.children[0].onclick = null), e.removeClass(n, "pswp__ui--over-close"), e.addClass(n, "pswp__ui--hidden"), y.setIdle(!1) }), v.showAnimationDuration || e.removeClass(n, "pswp__ui--hidden"), d("initialZoomIn", function () { v.showAnimationDuration && e.removeClass(n, "pswp__ui--hidden") }), d("initialZoomOut", function () { e.addClass(n, "pswp__ui--hidden") }), d("parseVerticalMargin", L), function () { var t, i, o, s = function (n) { if (n) for (var s = n.length, a = 0; s > a; a++) { t = n[a], i = t.className; for (var r = 0; r < z.length; r++) o = z[r], i.indexOf("pswp__" + o.name) > -1 && (v[o.option] ? (e.removeClass(t, "pswp__element--disabled"), o.onInit && o.onInit(t)) : e.addClass(t, "pswp__element--disabled")) } }; s(n.children); var a = e.getChildByClass(n, "pswp__top-bar"); a && s(a.children) } (), v.shareEl && l && u && (C = !0), S(), v.fullscreenEl && (i || (i = y.getFullscreenAPI()), i ? (e.bind(document, i.eventK, y.updateFullscreen), y.updateFullscreen(), e.addClass(t.template, "pswp--supports-fs")) : e.removeClass(t.template, "pswp--supports-fs")), v.preloaderEl && (P(!0), d("beforeChange", function () { clearTimeout(f), f = setTimeout(function () { t.currItem && t.currItem.loading ? (!t.allowProgressiveImg() || t.currItem.img && !t.currItem.img.naturalWidth) && P(!1) : P(!0) }, v.loadingIndicatorDelay) }), d("imageLoadComplete", function (e, i) { t.currItem === i && P(!0) })), losjqisafe(".touchcarousel-container").empty(), losjqisafe(".pswp__carouselDotsUL").empty(); for (var r, c = v.getNumItemsFn(), h = 0; c > h; h++) (r = t.getItemAt(h)).smallImage && (h > 0 && losjqisafe(".touchcarousel-container").append('
  • '), losjqisafe(".touchcarousel-container").append('
  • ')); losjqisafe(".touchcarousel-item a").click(function (e) { e.preventDefault(), e.stopPropagation(); var i = Number(losjqisafe(e.target).attr("data-index")); isNaN(i), isNaN(i) || t.goTo(i) }); var p = losjqisafe(".pswp__carousel").touchCarousel({ itemsPerMove: 4, pagingNav: !1, scrollbar: !1, scrollToLast: !1, loopItems: !1 }).data("touchCarousel"); t.template.style, t.template.style.position = "absolute", t.template.style.right = 0, t.template.style.display = "block", p.updateCarouselSize(!0), t.template.style.position = "", t.template.style.right = "", t.template.style.display = "" }, y.setIdle = function (t) { h = t, k(n, "ui--idle", t) }, y.update = function () { b && t.currItem ? (y.updateIndexIndicator(), v.captionEl && (v.addCaptionHTMLFn(t.currItem, s), k(s, "caption--empty", !t.currItem.title)), x = !0) : x = !1, C || M(), S() }, y.updateFullscreen = function (n) { n && setTimeout(function () { t.setScrollOffset(0, e.getScrollY()) }, 50), e[(i.isFullscreen() ? "add" : "remove") + "Class"](t.template, "pswp--fs") }, y.updateIndexIndicator = function () { v.counterEl && (r.innerHTML = t.getCurrentIndex() + 1 + v.indexIndicatorSep + v.getNumItemsFn()), v.getNumItemsFn(), losjqisafe(".pswp__carouselDot").removeClass("selected"), losjqisafe("#AOSZGalleryDot_" + t.getCurrentIndex()).addClass("selected") }, y.onGlobalTap = function (i) { var n = (i = i || window.event).target || i.srcElement; if (!_) if (i.detail && "mouse" === i.detail.pointerType) { if (O(n)) return void t.close(); e.hasClass(n, "pswp__img") && (1 === t.getZoomLevel() && t.getZoomLevel() <= t.currItem.fitRatio ? v.clickToCloseNonZoomable && t.close() : t.toggleDesktopZoom(i.detail.releasePoint)) } else if (v.tapToToggleControls && (b ? y.hideControls() : y.showControls()), v.tapToClose && (e.hasClass(n, "pswp__img") || O(n))) return void t.close() }, y.onMouseOver = function (t) { var e = (t = t || window.event).target || t.srcElement; k(n, "ui--over-close", O(e)) }, y.hideControls = function () {}, y.showControls = function () { b = !0, x || y.update(), e.removeClass(n, "pswp__ui--hidden"), e.removeClass(o, "pswp__ui--hidden") }, y.supportsFullscreen = function () { var t = document; return !!(t.exitFullscreen || t.mozCancelFullScreen || t.webkitExitFullscreen || t.msExitFullscreen) }, y.getFullscreenAPI = function () { var e, i = document.documentElement, n = "fullscreenchange"; return i.requestFullscreen ? e = { enterK: "requestFullscreen", exitK: "exitFullscreen", elementK: "fullscreenElement", eventK: n } : i.mozRequestFullScreen ? e = { enterK: "mozRequestFullScreen", exitK: "mozCancelFullScreen", elementK: "mozFullScreenElement", eventK: "moz" + n } : i.webkitRequestFullscreen ? e = { enterK: "webkitRequestFullscreen", exitK: "webkitExitFullscreen", elementK: "webkitFullscreenElement", eventK: "webkit" + n } : i.msRequestFullscreen && (e = { enterK: "msRequestFullscreen", exitK: "msExitFullscreen", elementK: "msFullscreenElement", eventK: "MSFullscreenChange" }), e && (e.enter = function () { return c = v.closeOnScroll, v.closeOnScroll = !1, "webkitRequestFullscreen" !== this.enterK ? t.template[this.enterK]() : void t.template[this.enterK](Element.ALLOW_KEYBOARD_INPUT) }, e.exit = function () { return v.closeOnScroll = c, document[this.exitK]() }, e.isFullscreen = function () { return document[this.elementK] }), e } } }), function (t) { function e(e, i) { var n, o; this.carouselRoot = t(e); var s = this; this._b = this._a = !1, this._e = this._d = this._c = "", this._f, this._g, this._h, this._i, this._j, this._k = 0, this.settings = t.extend({}, t.fn.touchCarousel.defaults, i), this._l = this.carouselRoot.find(".touchcarousel-container"), this._m = this._l[0].style, this._n = this._l.wrap(t('
    ')).parent(); var a = this._l.find(".touchcarousel-item"); this.items = [], this.numItems = a.length, n = navigator.userAgent.toLowerCase(), o = /(chrome)[ \/]([\w.]+)/.exec(n) || /(webkit)[ \/]([\w.]+)/.exec(n) || /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(n) || /(msie) ([\w.]+)/.exec(n) || 0 > n.indexOf("compatible") && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(n) || [], n = o[1] || "", o = o[2] || "0"; var r = {}; n && (r[n] = !0, r.version = o), r.chrome && (r.webkit = !0), s._o = r, this._p, this._q = !1, this._t = this._s = this._r = 0, this._w = this._v = this._u = !1, "ontouchstart" in window ? (this.hasTouch = !0, this._c = "touchstart.rs", this._d = "touchmove.rs", this._e = "touchend.rs", this._x = this.settings.baseTouchFriction) : (this.hasTouch = !1, this._x = this.settings.baseMouseFriction, this.settings.dragUsingMouse ? (this._c = "mousedown.rs", this._d = "mousemove.rs", this._e = "mouseup.rs", this._y, this._z, (n = s._o).msie || n.opera ? this._y = this._z = "move" : n.mozilla && (this._y = "-moz-grab", this._z = "-moz-grabbing"), this._a1()) : this._n.addClass("auto-cursor")), (this.hasTouch || this.settings.useWebkit3d) && "WebKitCSSMatrix" in window && "m11" in new WebKitCSSMatrix && (this._l.css({ "-webkit-transform-origin": "0 0", "-webkit-transform": "translateZ(0)" }), this._w = !0), this._w ? (this._b1 = "-webkit-transform", this._c1 = "translate3d(", this._d1 = "px, 0, 0)") : (this._b1 = "left", this._c1 = "", this._d1 = "px"), this.hasTouch && (this.settings.directionNavAutoHide = !1), this.settings.directionNav || (this._f1 = this.settings.loopItems ? this._e1 = !0 : this._e1 = !1, this.settings.loopItems = !0); var l, u, c, h = 0; if (a.eq(this.numItems - 1).addClass("last"), a.each(function (e) { var i; (u = t(this), (l = {}).item = u, l.index = e, l.posX = h, l.width = u.outerWidth(!0) || s.settings.itemFallbackWidth, h += l.width, this.hasTouch) ? u.find("a").each(function () { (i = t(this)).data("tc-href", i.attr("href")), i.data("tc-target", i.attr("target")), i.attr("href", "#"), i.bind("click", function (e) { if (e.preventDefault(), s._q) return !1; e = t(this).data("tc-href"); var i = t(this).data("tc-target"); i && "_g1" !== i.toLowerCase() ? window.open(e) : window.location.href = e }) }) : u.find("a").bind("click.touchcarousel", function (t) { return s._q ? (t.preventDefault(), !1) : void 0 }); u.find(".non-draggable").bind(s._c, function (t) { s._q = !1, t.stopImmediatePropagation() }), s.items.push(l) }), this._h1 = this._f = h, this._i1 = 0 < this.settings.itemsPerMove ? this.settings.itemsPerMove : 1, this.settings.pagingNav) { if (this._j1 = this.settings.snapToItems = !0, this._k1 = Math.ceil(this.numItems / this._i1), this._l1 = 0, this.settings.pagingNavControls) { for (this._m1 = t('
    '), a = this._m1.find(".tc-paging-centerer-inside"), o = 1; o <= this._k1; o++) n = t('
    ' + o + "").data("tc-id", o), o === this._l1 + 1 && n.addClass("current"), a.append(n); this._n1 = a.find(".tc-paging-item").click(function (e) { e.preventDefault(), s.goTo((t(e.currentTarget).data("tc-id") - 1) * s._i1) }), this._n.after(this._m1) } } else this._j1 = !1; this._l.css({ width: h }), this.settings.directionNav && (this._n.after(" "), this.arrowLeft = this.carouselRoot.find(".arrow-holder.left"), this.arrowRight = this.carouselRoot.find(".arrow-holder.right"), 1 > this.arrowLeft.length || 1 > this.arrowRight.length ? this.settings.directionNav = !1 : this.settings.directionNavAutoHide && (this.arrowLeft.hide(), this.arrowRight.hide(), this.carouselRoot.one("mousemove.arrowshover", function () { s.arrowLeft.fadeIn("fast"), s.arrowRight.fadeIn("fast") }), this.carouselRoot.hover(function () { s.arrowLeft.fadeIn("fast"), s.arrowRight.fadeIn("fast") }, function () { s.arrowLeft.fadeOut("fast"), s.arrowRight.fadeOut("fast") })), this._p1(0), this.settings.directionNav && (this.arrowRight.click(function (t) { t.preventDefault(), (s.settings.loopItems && !s._u || !s._f1) && s.next() }), this.arrowLeft.click(function (t) { t.preventDefault(), (s.settings.loopItems && !s._u || !s._e1) && s.prev() }))), this.carouselWidth, this._q1 = "onorientationchange" in window ? "orientationchange.touchcarousel" : "resize.touchcarousel", t(window).bind(this._q1, function () { c && clearTimeout(c), c = setTimeout(function () { s.updateCarouselSize(!1) }, 100) }), this.settings.scrollbar ? (this._r1 = t("
    "), this._r1.appendTo(this.carouselRoot), this.scrollbarJQ = this._r1.find(".scrollbar"), this._s1 = "", this._t1 = this.scrollbarJQ[0].style, this._u1 = 0, this.settings.scrollbarAutoHide ? (this._v1 = !1, this.scrollbarJQ.css("opacity", 0)) : this._v1 = !0) : this.settings.scrollbarAutoHide = !1, this.updateCarouselSize(!0), this._n.bind(this._c, function (t) { s._w1(t) }), this.settings.autoplay && 0 < this.settings.autoplayDelay ? (this._x1 = !1, this.autoplayTimer = "", this.wasAutoplayRunning = !0, this.hasTouch || this.carouselRoot.hover(function () { s._x1 = !0, s._y1() }, function () { s._x1 = !1, s._z1() }), this.autoplay = !0, this._a2()) : this.autoplay = !1, this.settings.keyboardNav && t(document).bind("keydown.touchcarousel", function (t) { s._u || (37 === t.keyCode ? s.prev() : 39 === t.keyCode && s.next()) }), this.carouselRoot.css("overflow", "visible") } e.prototype = { goTo: function (t, e) { var i = this.items[t]; i && (!e && this.autoplay && this.settings.autoplayStopAtAction && this.stopAutoplay(), this._b2(t), this.endPos = this._c2(), (i = -i.posX) > 0 ? i = 0 : i < this.carouselWidth - this._h1 && (i = this.carouselWidth - this._h1), this.animateTo(i, this.settings.transitionSpeed, "easeInOutSine")) }, next: function (t) { var e = this._c2(), i = this._d2(e).index; this._j1 ? i = (e = this._l1 + 1) > this._k1 - 1 ? this.settings.loopItems ? 0 : (this._k1 - 1) * this._i1 : e * this._i1 : (i += this._i1, this.settings.loopItems && e <= this.carouselWidth - this._h1 && (i = 0), i > this.numItems - 1 && (i = this.numItems - 1)), this.goTo(i, t) }, prev: function (t) { var e = this._c2(), i = this._d2(e).index; this._j1 ? i = 0 > (e = this._l1 - 1) ? this.settings.loopItems ? (this._k1 - 1) * this._i1 : 0 : e * this._i1 : 0 > (i -= this._i1) && (i = this.settings.loopItems ? 0 > e ? 0 : this.numItems - 1 : 0), this.goTo(i, t) }, getCurrentId: function () { return this._d2(this._c2()).index }, setXPos: function (t, e) { e ? this._t1[this._b1] = this._c1 + t + this._d1 : this._m[this._b1] = this._c1 + t + this._d1 }, stopAutoplay: function () { this._y1(), this.wasAutoplayRunning = this.autoplay = !1 }, resumeAutoplay: function () { this.autoplay = !0, this.wasAutoplayRunning || this._z1() }, updateCarouselSize: function (t) { if (this.carouselWidth = this.carouselRoot.width(), this.settings.scrollToLast) { var e = 0; if (this._j1) { var i = this.numItems % this._i1; if (i > 0) for (i = this.numItems - i; i < this.numItems; i++) e += this.items[i].width; else e = this.carouselWidth } else e = this.items[this.numItems - 1].width; this._h1 = this._f + this.carouselWidth - e } else this._h1 = this._f; if (this.settings.scrollbar && (e = Math.round(this._r1.width() / (this._h1 / this.carouselWidth)), this.scrollbarJQ.css("width", e), this._u1 = this._r1.width() - e), !this.settings.scrollToLast) { if (this.carouselWidth >= this._f) return this._v = !0, this.settings.loopItems || (this._f1 = !0, this.arrowRight.addClass("disabled"), this._e1 = !0, this.arrowLeft.addClass("disabled")), void this.setXPos(0); this._v && (this._e1 = this._f1 = this._v = !1, this.arrowRight.removeClass("disabled"), this.arrowLeft.removeClass("disabled")) } t || ((t = this.endPos = this._c2()) > 0 ? t = 0 : t < this.carouselWidth - this._h1 && (t = this.carouselWidth - this._h1), this.animateTo(t, 300, "easeInOutSine")) }, animateTo: function (e, i, n, o, s, a, r) { function l() { u._b = !1, u._a2(), u.settings.scrollbarAutoHide && u._g2(), null !== u.settings.onAnimComplete && u.settings.onAnimComplete.call(u) } null !== this.settings.onAnimStart && this.settings.onAnimStart.call(this), this.autoplay && this.autoplayTimer && (this.wasAutoplayRunning = !0, this._y1()), this._e2(); var u = this, c = this.settings.scrollbar, h = u._b1, d = u._c1, p = u._d1, m = { containerPos: this.endPos }, f = { containerPos: e }, g = { containerPos: s }; s = o ? s : e; var v = u._m; if (u._b = !0, c) { var _ = this._t1, w = u._h1 - u.carouselWidth; this.settings.scrollbarAutoHide && (this._v1 || this._f2()) } this._p1(s), this._p = t(m).animate(f, { duration: i, easing: n, step: function () { c && (_[h] = d + Math.round(u._u1 * (-this.containerPos / w)) + p), v[h] = d + Math.round(this.containerPos) + p }, complete: function () { o ? u._p = t(f).animate(g, { duration: a, easing: r, step: function () { c && (_[h] = d + Math.round(u._u1 * (-this.containerPos / w)) + p), v[h] = d + Math.round(this.containerPos) + p }, complete: function () { c && (_[h] = d + Math.round(u._u1 * (-g.containerPos / w)) + p), v[h] = d + Math.round(g.containerPos) + p, l() } }) : (c && (_[h] = d + Math.round(u._u1 * (-f.containerPos / w)) + p), v[h] = d + Math.round(f.containerPos) + p, l()) } }) }, destroy: function () { this.stopAutoplay(), this._n.unbind(this._c), t(document).unbind(this._d).unbind(this._e), t(window).unbind(this._q1), this.settings.keyboardNav && t(document).unbind("keydown.touchcarousel"), this.carouselRoot.remove() }, _b2: function (t) { this._j1 && (this._l1 = t = this._h2(t), this.settings.pagingNavControls && (this._n1.removeClass("current"), this._n1.eq(t).addClass("current"))) }, _h2: function (t) { for (var e = this._i1, i = 0; i < this._k1; i++) if (t >= i * e && i * e + e > t) return i; return 0 > t ? 0 : t >= this._k1 && this._k1 - 1 }, _i2: function () { this.settings.loopItems || (this._e1 ? (this._e1 = !1, this.arrowLeft.removeClass("disabled")) : this._f1 && (this._f1 = !1, this.arrowRight.removeClass("disabled"))) }, _o1: function () { !this._e1 && !this.settings.loopItems && (this._e1 = !0, this.arrowLeft.addClass("disabled"), this._f1 && (this._f1 = !1, this.arrowRight.removeClass("disabled"))) }, _j2: function () { !this._f1 && !this.settings.loopItems && (this._f1 = !0, this.arrowRight.addClass("disabled"), this._e1 && (this._e1 = !1, this.arrowLeft.removeClass("disabled"))) }, _d2: function (t) { t = -t; for (var e, i = 0; i < this.numItems; i++) if (t >= (e = this.items[i]).posX && t < e.posX + e.width) return e; return -1 }, _a2: function () { this.autoplay && this.wasAutoplayRunning && (this._x1 || this._z1(), this.wasAutoplayRunning = !1) }, _g2: function () { var t = this; this._v1 = !1, this._s1 && clearTimeout(this._s1), this._s1 = setTimeout(function () { t.scrollbarJQ.animate({ opacity: 0 }, 150, "linear") }, 450) }, _f2: function () { this._v1 = !0, this._s1 && clearTimeout(this._s1), this.scrollbarJQ.stop().animate({ opacity: 1 }, 150, "linear") }, _e2: function () { this._p && this._p.stop() }, _z1: function () { if (this.autoplay) { var t = this; this.autoplayTimer || (this.autoplayTimer = setInterval(function () { !t._k2 && !t._b && t.next(!0) }, this.settings.autoplayDelay)) } }, _y1: function () { this.autoplayTimer && (clearInterval(this.autoplayTimer), this.autoplayTimer = "") }, _c2: function (t) { return t = t ? this.scrollbarJQ : this._l, this._w ? (t = t.css("-webkit-transform").replace(/^matrix\(/i, "").split(/, |\)$/g), parseInt(t[4], 10)) : Math.round(t.position().left) }, _w1: function (e) { if (!this._k2) { var i; if (this.autoplay && this.settings.autoplayStopAtAction && this.stopAutoplay(), this._e2(), this.settings.scrollbarAutoHide && this._f2(), this.hasTouch) { if (this._a = !1, !((i = e.originalEvent.touches) && 0 < i.length)) return !1; i = i[0] } else i = e, e.preventDefault(); this._l2(), this._k2 = !0; var n = this; this._w && n._l.css({ "-webkit-transition-duration": "0", "-webkit-transition-property": "none" }), t(document).bind(this._d, function (t) { n._m2(t) }), t(document).bind(this._e, function (t) { n._n2(t) }), this._o2 = this._c2(), this._i = i.clientX, this._q = !1, this._k = e.timeStamp || (new Date).getTime(), this._t = 0, this._s = this._r = i.clientX, this._p2 = i.clientY } }, _m2: function (t) { var e, i = t.timeStamp || (new Date).getTime(); if (this.hasTouch) { if (this._a) return !1; if (1 < (e = t.originalEvent.touches).length) return !1; if (e = e[0], Math.abs(e.clientY - this._p2) > Math.abs(e.clientX - this._r) + 3) return this.settings.lockAxis && (this._a = !0), !1 } else e = t; if (t.preventDefault(), this._j = e.clientX, this._q2 = this._r2, t = e.clientX - this._s, this._q2 != t && (this._r2 = t), 0 != t) { var n = this._o2 + this._t; n >= 0 ? (t /= 4, this._o1()) : n <= this.carouselWidth - this._h1 ? (this._j2(), t /= 4) : this._i2(), this._t += t, this.setXPos(n), this.settings.scrollbar && this.setXPos(this._u1 * (-n / (this._h1 - this.carouselWidth)), !0) } return this._s = e.clientX, 350 < i - this._k && (this._k = i, this._i = e.clientX), null !== this.settings.onDragStart && this.settings.onDragStart.call(this), !1 }, _n2: function (e) { if (this._k2) { var i = this; if (this._k2 = !1, this._a1(), this.endPos = this._c2(), this.isdrag = !1, t(document).unbind(this._d).unbind(this._e), this.endPos == this._o2) return this._q = !1, void(this.settings.scrollbarAutoHide && this._g2()); this._q = !0; var n = this._j - this._i; e = Math.max(40, (e.timeStamp || (new Date).getTime()) - this._k); var o = .5; e = Math.abs(n) / e; var s = function (t) { return t > 0 ? t = 0 : t < i.carouselWidth - i._h1 && (t = i.carouselWidth - i._h1), t }; if (this.settings.snapToItems) { this.autoplay && this.settings.autoplayStopAtAction && this.stopAutoplay(); n = Boolean(0 < this._r - this._s), o = s(this._c2()); var a = this._d2(o).index; this._j1 ? (n && (o = Math.max(o - this.carouselWidth - 1, 1 - i._h1), void 0 === (a = this._d2(o).index) && (a = this.numItems - 1)), a = this._h2(a) * this._i1) : a += n ? this._i1 : 1 - this._i1, a = n ? Math.min(a, this.numItems - 1) : Math.max(a, 0), o = this.items[a], this._b2(a), o && (o = s(-o.posX), s = Math.abs(this.endPos - o), e = Math.max(1.08 * s / e, 150), a = Boolean(180 > e), s *= .08, n && (s *= -1), this.animateTo(a ? o + s : o, Math.min(e, 400), "easeOutSine", a, o, 300, "easeOutCubic")) } else s = 0, 2 >= e ? (o = 3.5 * this._x, s = 0) : e > 2 && 3 >= e ? (o = 4 * this._x, s = 200) : e > 3 && (s = 300, e > 4 && (e = 4, s = 400, o = 6 * this._x), o = 5 * this._x), n = 2 * e * e / (2 * o) * (0 > n ? -1 : 1), o = 2 * e / o + s, 0 < this.endPos + n ? 0 < this.endPos ? this.animateTo(0, 800, "easeOutCubic") : this.animateTo(this.carouselWidth / 10 * ((s + 200) / 1e3), 1.1 * Math.abs(this.endPos) / e, "easeOutSine", !0, 0, 400, "easeOutCubic") : this.endPos + n < this.carouselWidth - this._h1 ? this.endPos < this.carouselWidth - this._h1 ? this.animateTo(this.carouselWidth - this._h1, 800, "easeOutCubic") : this.animateTo(this.carouselWidth - this._h1 - this.carouselWidth / 10 * ((s + 200) / 1e3), 1.1 * Math.abs(this.carouselWidth - this._h1 - this.endPos) / e, "easeOutSine", !0, this.carouselWidth - this._h1, 400, "easeOutCubic") : this.animateTo(this.endPos + n, o, "easeOutCubic"); null !== this.settings.onDragRelease && this.settings.onDragRelease.call(this) } return !1 }, _p1: function (t) { void 0 === t && (t = this._c2()), this.settings.loopItems || (t >= 0 ? this._o1() : t <= this.carouselWidth - this._h1 ? this._j2() : this._i2()) }, _a1: function () { this._y ? this._n.css("cursor", this._y) : (this._n.removeClass("grabbing-cursor"), this._n.addClass("grab-cursor")) }, _l2: function () { this._z ? this._n.css("cursor", this._z) : (this._n.removeClass("grab-cursor"), this._n.addClass("grabbing-cursor")) } }, t.fn.touchCarousel = function (i) { return this.each(function () { var n = new e(t(this), i); t(this).data("touchCarousel", n) }) }, t.fn.touchCarousel.defaults = { itemsPerMove: 1, snapToItems: !1, pagingNav: !1, pagingNavControls: !0, autoplay: !1, autoplayDelay: 3e3, autoplayStopAtAction: !0, scrollbar: !0, scrollbarAutoHide: !1, scrollbarTheme: "dark", transitionSpeed: 600, directionNav: !0, directionNavAutoHide: !1, loopItems: !1, keyboardNav: !1, dragUsingMouse: !0, scrollToLast: !1, itemFallbackWidth: 500, baseMouseFriction: .0012, baseTouchFriction: 8e-4, lockAxis: !0, useWebkit3d: !1, onAnimStart: null, onAnimComplete: null, onDragStart: null, onDragRelease: null }, t.fn.touchCarousel.settings = {}, t.extend(jQuery.easing, { easeInOutSine: function (t, e, i, n, o) { return -n / 2 * (Math.cos(Math.PI * e / o) - 1) + i }, easeOutSine: function (t, e, i, n, o) { return n * Math.sin(e / o * (Math.PI / 2)) + i }, easeOutCubic: function (t, e, i, n, o) { return n * ((e = e / o - 1) * e * e + 1) + i } }) } (losjqisafe), function () { if (navigator.userAgent.match(/OS 6(_\d)+/i) && void 0 === window.getTimeouts) { var t = {}, e = {}, i = window.setTimeout, n = window.setInterval, o = window.clearTimeout, s = window.clearInterval, a = function (o, s, a, r) { if (a) { var l, u = function () { var t = (new Date).getTime(); !1 !== d[l].loop ? (d[l].requestededFrame = webkitRequestAnimationFrame(u), d[l].loop = c >= t) : (d[l].callback && d[l].callback(), h ? (c = (new Date).getTime() + s, d[l].loop = c >= t, d[l].requestedFrame = webkitRequestAnimationFrame(u)) : delete d[l]) }; a = o.name || "rafTimer" + Math.floor(1e3 * Math.random()); var c = (new Date).getTime() + s, h = r || !1, d = h ? e : t; return d[l = a + "" + c] = {}, d[l].loop = !0, d[l].callback = o, u(), l } return r ? n(o, s) : i(o, s) }, r = function (i, n) { var a; return i.indexOf && -1 < i.indexOf("rafTimer") ? ((a = n ? e : t)[i] ? (a[i].callback = void 0, a[i].loop = !1, a = !0) : a = !1, a) : n ? s(i) : o(i) }; window.getTimeouts = function () { return { timeouts: t, intervals: e } }, window.setTimeout = function (t, e) { return a(t, e, !0) }, window.setInterval = function (t, e) { return a(t, e, !0, !0) }, window.clearTimeout = function (t) { return r(t) }, window.clearInterval = function (t) { return r(t, !0) } } } (); !function (t, e) { "object" == typeof exports ? module.exports = e() : t.PhotoSwipeAOS = e() } (this, function () { return function (t, e, i, n) { var o = { features: null, bind: function (t, e, i, n) { var o = (n ? "remove" : "add") + "EventListener"; e = e.split(" "); for (var s = 0; s < e.length; s++) e[s] && t[o](e[s], i, !1) }, isArray: function (t) { return t instanceof Array }, createEl: function (t, e) { var i = document.createElement(e || "div"); return t && (i.className = t), i }, getScrollY: function () { var t = window.pageYOffset; return void 0 !== t ? t : document.documentElement.scrollTop }, unbind: function (t, e, i) { o.bind(t, e, i, !0) }, removeClass: function (t, e) { var i = new RegExp("(\\s|^)" + e + "(\\s|$)"); t.className = t.className.replace(i, " ").replace(/^\s\s*/, "").replace(/\s\s*$/, "") }, addClass: function (t, e) { o.hasClass(t, e) || (t.className += (t.className ? " " : "") + e) }, hasClass: function (t, e) { return t.className && new RegExp("(^|\\s)" + e + "(\\s|$)").test(t.className) }, getChildByClass: function (t, e) { for (var i = t.firstChild; i; ) { if (o.hasClass(i, e)) return i; i = i.nextSibling } }, arraySearch: function (t, e, i) { for (var n = t.length; n--; ) if (t[n][i] === e) return n; return -1 }, extend: function (t, e, i) { for (var n in e) if (e.hasOwnProperty(n)) { if (i && t.hasOwnProperty(n)) continue; t[n] = e[n] } }, easing: { sine: { out: function (t) { return Math.sin(t * (Math.PI / 2)) }, inOut: function (t) { return - (Math.cos(Math.PI * t) - 1) / 2 } }, cubic: { out: function (t) { return --t * t * t + 1 } } }, detectFeatures: function () { if (o.features) return o.features; var t = o.createEl().style, e = "", i = {}; if (i.oldIE = document.all && !document.addEventListener, i.touch = "ontouchstart" in window, window.requestAnimationFrame && (i.raf = window.requestAnimationFrame, i.caf = window.cancelAnimationFrame), i.pointerEvent = navigator.pointerEnabled || navigator.msPointerEnabled, !i.pointerEvent) { var n = navigator.userAgent; if (/iP(hone|od)/.test(navigator.platform)) { var s = navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/); s && s.length > 0 && (s = parseInt(s[1], 10)) >= 1 && 8 > s && (i.isOldIOSPhone = !0) } var a = n.match(/Android\s([0-9\.]*)/), r = a ? a[1] : 0; (r = parseFloat(r)) >= 1 && (4.4 > r && (i.isOldAndroid = !0), i.androidVersion = r), i.isMobileOpera = /opera mini|opera mobi/i.test(n) } for (var l, u, c = ["transform", "perspective", "animationName"], h = ["", "webkit", "Moz", "ms", "O"], d = 0; 4 > d; d++) { e = h[d]; for (var p = 0; 3 > p; p++) l = c[p], u = e + (e ? l.charAt(0).toUpperCase() + l.slice(1) : l), !i[l] && u in t && (i[l] = u); e && !i.raf && (e = e.toLowerCase(), i.raf = window[e + "RequestAnimationFrame"], i.raf && (i.caf = window[e + "CancelAnimationFrame"] || window[e + "CancelRequestAnimationFrame"])) } if (!i.raf) { var m = 0; i.raf = function (t) { var e = (new Date).getTime(), i = Math.max(0, 16 - (e - m)), n = window.setTimeout(function () { t(e + i) }, i); return m = e + i, n }, i.caf = function (t) { clearTimeout(t) } } return i.svg = !!document.createElementNS && !!document.createElementNS("http://www.w3.org/2000/svg", "svg").createSVGRect, o.features = i, i } }; o.detectFeatures(), o.features.oldIE && (o.bind = function (t, e, i, n) { e = e.split(" "); for (var o, s = (n ? "detach" : "attach") + "Event", a = function () { i.handleEvent.call(i) }, r = 0; r < e.length; r++) if (o = e[r]) if ("object" == typeof i && i.handleEvent) { if (n) { if (!i["oldIE" + o]) return !1 } else i["oldIE" + o] = a; t[s]("on" + o, i["oldIE" + o]) } else t[s]("on" + o, i) }); var s = this, a = { allowPanToNext: !0, spacing: .12, bgOpacity: 1, mouseUsed: !1, loop: !0, pinchToClose: !1, closeOnScroll: !1, closeOnVerticalDrag: !1, verticalDragRange: .75, hideAnimationDuration: 333, showAnimationDuration: 333, showHideOpacity: !1, focus: !0, escKey: !0, arrowKeys: !0, mainScrollEndFriction: .35, panEndFriction: .35, isClickableElement: function (t) { return "A" === t.tagName }, getDoubleTapZoom: function (t, e) { return t ? 1 : e.initialZoomLevel < .7 ? 1 : 1.33 }, maxSpreadZoom: 1.33, modal: !0, scaleMode: "fit", alwaysFadeIn: !1 }; o.extend(a, n); var r, l, u, c, h, d, p, m, f, g, v, _, w, y, x, b, C, I, T, k, S, D, M, A, E, O, R, F, P, L, z, N, Z, W, q, U, B, H, K, j, X, Y, G, V, Q, J, $, tt, et, it, nt, ot, st, at, rt, lt, ut = { x: 0, y: 0 }, ct = { x: 0, y: 0 }, ht = { x: 0, y: 0 }, dt = {}, pt = 0, mt = {}, ft = { x: 0, y: 0 }, gt = 0, vt = !0, _t = [], wt = {}, yt = !1, xt = function (t, e) { o.extend(s, e.publicMethods), _t.push(t) }, bt = function (t) { var e = qe(); return t > e - 1 ? t - e : 0 > t ? e + t : t }, Ct = {}, It = function (t, e) { return Ct[t] || (Ct[t] = []), Ct[t].push(e) }, Tt = function (t) { var e = Ct[t]; if (e) { var i = Array.prototype.slice.call(arguments); i.shift(); for (var n = 0; n < e.length; n++) e[n].apply(s, i) } }, kt = function () { return (new Date).getTime() }, St = function (t) { st = t, s.bg.style.opacity = t * a.bgOpacity, s.bg.style.filter = "alpha(opacity=" + 100 * s.bg.style.opacity + ")" }, Dt = function (t, e, i, n, o) { (!yt || o && o !== s.currItem) && (n /= o ? o.fitRatio : s.currItem.fitRatio), t[D] = _ + e + "px, " + i + "px" + w + " scale(" + n + ")" }, Mt = function (t) { tt && (t && (g > s.currItem.fitRatio ? yt || (Ve(s.currItem, !1, !0), yt = !0) : yt && (Ve(s.currItem), yt = !1)), Dt(tt, ht.x, ht.y, g)) }, At = function (t) { t.container && Dt(t.container.style, t.initialPosition.x, t.initialPosition.y, t.initialZoomLevel, t) }, Et = function (t, e) { e[D] = _ + t + "px, 0px" + w }, Ot = function (t, e) { if (!a.loop && e) { var i = c + (ft.x * pt - t) / ft.x, n = Math.round(t - ce.x); (0 > i && n > 0 || i >= qe() - 1 && 0 > n) && (t = ce.x + n * a.mainScrollEndFriction) } ce.x = t, Et(t, h) }, Rt = function (t, e) { var i = he[t] - mt[t]; return ct[t] + ut[t] + i - i * (e / v) }, Ft = function (t, e) { t.x = e.x, t.y = e.y, e.id && (t.id = e.id) }, Pt = function (t) { t.x = Math.round(t.x), t.y = Math.round(t.y) }, Lt = null, zt = function () { Lt && (o.unbind(document, "mousemove", zt), o.addClass(t, "pswp--has_mouse"), a.mouseUsed = !0, Tt("mouseUsed")), Lt = setTimeout(function () { Lt = null }, 100) }, Nt = function (t, e) { var i = je(s.currItem, dt, t); return e && ($ = i), i }, Zt = function (t) { return t || (t = s.currItem), t.initialZoomLevel }, Wt = function (t) { return t || (t = s.currItem), t.w > 0 ? a.maxSpreadZoom : 1 }, qt = function (t, e, i, n) { return n === s.currItem.initialZoomLevel ? (i[t] = s.currItem.initialPosition[t], !0) : (i[t] = Rt(t, n), i[t] > e.min[t] ? (i[t] = e.min[t], !0) : i[t] < e.max[t] && (i[t] = e.max[t], !0)) }, Ut = function (t) { var e = ""; a.escKey && 27 === t.keyCode ? e = "close" : a.arrowKeys && (37 === t.keyCode ? e = "prev" : 39 === t.keyCode && (e = "next")), e && (t.ctrlKey || t.altKey || t.shiftKey || t.metaKey || (t.preventDefault ? t.preventDefault() : t.returnValue = !1, s[e]())) }, Bt = function (t) { t && (X || j || et || U) && (t.preventDefault(), t.stopPropagation()) }, Ht = function () { s.setScrollOffset(0, o.getScrollY()) }, Kt = {}, jt = 0, Xt = function (t) { Kt[t] && (Kt[t].raf && O(Kt[t].raf), jt--, delete Kt[t]) }, Yt = function (t) { Kt[t] && Xt(t), Kt[t] || (jt++, Kt[t] = {}) }, Gt = function () { for (var t in Kt) Kt.hasOwnProperty(t) && Xt(t) }, Vt = function (t, e, i, n, o, s, a) { var r, l = kt(); Yt(t); var u = function () { if (Kt[t]) { if ((r = kt() - l) >= n) return Xt(t), s(i), void(a && a()); s((i - e) * o(r / n) + e), Kt[t].raf = E(u) } }; u() }, Qt = { shout: Tt, listen: It, viewportSize: dt, options: a, isMainScrollAnimating: function () { return et }, getZoomLevel: function () { return g }, getCurrentIndex: function () { return c }, isDragging: function () { return H }, isZooming: function () { return Q }, setScrollOffset: function (t, e) { mt.x = t, L = mt.y = e, Tt("updateScrollOffset", mt) }, applyZoomPan: function (t, e, i, n) { ht.x = e, ht.y = i, g = t, Mt(n) }, init: function () { if (!r && !l) { var i; s.framework = o, s.template = t, s.bg = o.getChildByClass(t, "pswp__bg"), R = t.className, r = !0, z = o.detectFeatures(), E = z.raf, O = z.caf, D = z.transform, P = z.oldIE, s.scrollWrap = o.getChildByClass(t, "pswp__scroll-wrap"), s.container = o.getChildByClass(s.scrollWrap, "pswp__container"), s.carousel = o.getChildByClass(s.scrollWrap, "pswp__carousel"), h = s.container.style, s.itemHolders = b = [{ el: s.container.children[0], wrap: 0, index: -1 }, { el: s.container.children[1], wrap: 0, index: -1 }, { el: s.container.children[2], wrap: 0, index: -1 } ], b[0].el.style.display = b[2].el.style.display = "none", function () { if (D) { var e = z.perspective && !A; return _ = "translate" + (e ? "3d(" : "("), void(w = z.perspective ? ", 0px)" : ")") } D = "left", o.addClass(t, "pswp--ie"), Et = function (t, e) { e.left = t + "px" }, At = function (t) { var e = t.fitRatio > 1 ? 1 : t.fitRatio, i = t.container.style, n = e * t.w, o = e * t.h; i.width = n + "px", i.height = o + "px", i.left = t.initialPosition.x + "px", i.top = t.initialPosition.y + "px" }, Mt = function () { if (tt) { var t = tt, e = s.currItem, i = e.fitRatio > 1 ? 1 : e.fitRatio, n = i * e.w, o = i * e.h; t.width = n + "px", t.height = o + "px", t.left = ht.x + "px", t.top = ht.y + "px" } } } (), f = { resize: s.updateSize, orientationchange: function () { clearTimeout(lt), lt = setTimeout(function () { s.updateSize() }, 500) }, scroll: Ht, keydown: Ut, click: Bt }; var n = z.isOldIOSPhone || z.isOldAndroid || z.isMobileOpera; for (z.animationName && z.transform && !n || (a.showAnimationDuration = a.hideAnimationDuration = 0), i = 0; i < _t.length; i++) s["init" + _t[i]](); e && (s.ui = new e(s, o)).init(), Tt("firstUpdate"), c = c || a.index || 0, (isNaN(c) || 0 > c || c >= qe()) && (c = 0), s.currItem = We(c), (z.isOldIOSPhone || z.isOldAndroid) && (vt = !1), t.setAttribute("aria-hidden", "false"), a.modal && (vt ? t.style.position = "fixed" : (t.style.position = "absolute", t.style.top = o.getScrollY() + "px")), void 0 === L && (Tt("initialLayout"), L = F = o.getScrollY()); var u = "pswp--open "; for (a.mainClass && (u += a.mainClass + " "), a.showHideOpacity && (u += "pswp--animate_opacity "), u += A ? "pswp--touch" : "pswp--notouch", u += z.animationName ? " pswp--css_animation" : "", u += z.svg ? " pswp--svg" : "", o.addClass(t, u), s.updateSize(), d = -1, gt = null, i = 0; 3 > i; i++) Et((i + d) * ft.x, b[i].el.style); P || o.bind(s.scrollWrap, m, s), It("initialZoomInEnd", function () { s.setContent(b[0], c - 1), s.setContent(b[2], c + 1), b[0].el.style.display = b[2].el.style.display = "block", a.focus && t.focus(), o.bind(document, "keydown", s), z.transform && o.bind(s.scrollWrap, "click", s), a.mouseUsed || o.bind(document, "mousemove", zt), o.bind(window, "resize scroll", s), o.bind(window, "resize scroll orientationchange", s), Tt("bindEvents") }), s.setContent(b[1], c), s.updateCurrItem(), Tt("afterInit"), vt || (y = setInterval(function () { jt || H || Q || g !== s.currItem.initialZoomLevel || s.updateSize() }, 1e3)), o.addClass(t, "pswp--visible") } }, close: function () { r && (r = !1, l = !0, Tt("close"), o.unbind(window, "resize", s), o.unbind(window, "resize scroll orientationchange", s), o.unbind(window, "scroll", f.scroll), o.unbind(document, "keydown", s), o.unbind(document, "mousemove", zt), z.transform && o.unbind(s.scrollWrap, "click", s), H && o.unbind(window, p, s), clearTimeout(lt), Tt("unbindEvents"), Ue(s.currItem, null, !0, s.destroy)) }, destroy: function () { Tt("destroy"), Le && clearTimeout(Le), t.setAttribute("aria-hidden", "true"), t.className = R, y && clearInterval(y), o.unbind(s.scrollWrap, m, s), o.unbind(window, "scroll", s), me(), Gt(), Ct = null }, panTo: function (t, e, i) { i || (t > $.min.x ? t = $.min.x : t < $.max.x && (t = $.max.x), e > $.min.y ? e = $.min.y : e < $.max.y && (e = $.max.y)), ht.x = t, ht.y = e, Mt() }, handleEvent: function (t) { t = t || window.event, f[t.type] && f[t.type](t) }, goTo: function (t) { var e = (t = bt(t)) - c; gt = e, c = t, s.currItem = We(c), pt -= e, Ot(ft.x * pt), Gt(), et = !1, s.updateCurrItem() }, next: function () { c < qe() - 1 && s.goTo(c + 1) }, prev: function () { c > 0 && s.goTo(c - 1) }, updateCurrZoomItem: function (t) { if (t && Tt("beforeChange", 0), b[1].el.children.length) { var e = b[1].el.children[0]; tt = o.hasClass(e, "pswp__zoom-wrap") ? e.style : null } else tt = null; $ = s.currItem.bounds, v = g = s.currItem.initialZoomLevel, ht.x = $.center.x, ht.y = $.center.y, t && Tt("afterChange") }, invalidateCurrItems: function () { x = !0; for (var t = 0; 3 > t; t++) b[t].item && (b[t].item.needsUpdate = !0) }, updateCurrItem: function (t) { if (0 !== gt) { var e, i = Math.abs(gt); if (!(t && 2 > i)) { s.currItem = We(c), yt = !1, Tt("beforeChange", gt), i >= 3 && (d += gt + (gt > 0 ? -3 : 3), i = 3); for (var n = 0; i > n; n++) gt > 0 ? (e = b.shift(), b[2] = e, Et((++d + 2) * ft.x, e.el.style), s.setContent(e, c - i + n + 1 + 1)) : (e = b.pop(), b.unshift(e), Et(--d * ft.x, e.el.style), s.setContent(e, c + i - n - 1 - 1)); if (tt && 1 === Math.abs(gt)) { var o = We(C); o.initialZoomLevel !== g && (je(o, dt), Ve(o), At(o)) } (n = document.getElementsByClassName("pswp__aosc")[0]) && s.currItem.bounds && (n.style.marginTop = s.currItem.bounds.center.y + "px"), gt = 0, s.updateCurrZoomItem(), C = c, Tt("afterChange") } } }, updateSize: function (e) { if (!vt && a.modal) { var i = o.getScrollY(); if (L !== i && (t.style.top = i + "px", L = i), !e && wt.x === window.innerWidth && wt.y === window.innerHeight) return; wt.x = window.innerWidth, wt.y = window.innerHeight, t.style.height = wt.y + "px" } if (dt.x = s.scrollWrap.clientWidth, dt.y = s.scrollWrap.clientHeight, Ht(), ft.x = dt.x + Math.round(dt.x * a.spacing), ft.y = dt.y, Ot(ft.x * pt), Tt("beforeResize"), void 0 !== d) { for (var n, r, l = 0; 3 > l; l++) n = b[l], Et((l + d) * ft.x, n.el.style), u = c + l - 1, a.loop && qe() > 2 && (u = bt(u)), (r = We(u)) && (x || r.needsUpdate || !r.bounds) ? (s.cleanSlide(r), s.setContent(n, u), 1 === l && (s.currItem = r, s.updateCurrZoomItem(!0)), r.needsUpdate = !1) : -1 === n.index && u >= 0 && s.setContent(n, u), r && r.container && (je(r, dt), Ve(r), At(r)); x = !1 } var u; (u = document.getElementsByClassName("pswp__aosc")[0]) && s.currItem.bounds && (u.style.marginTop = s.currItem.bounds.center.y + "px"), v = g = s.currItem.initialZoomLevel, ($ = s.currItem.bounds) && (ht.x = $.center.x, ht.y = $.center.y, Mt(!0)), Tt("resize") }, zoomTo: function (t, e, i, n, s) { e && (v = g, he.x = Math.abs(e.x) - ht.x, he.y = Math.abs(e.y) - ht.y, Ft(ct, ht)); var a = Nt(t, !1), r = {}; qt("x", a, r, t), qt("y", a, r, t); var l = g, u = ht.x, c = ht.y; Pt(r); var h = function (e) { 1 === e ? (g = t, ht.x = r.x, ht.y = r.y) : (g = (t - l) * e + l, ht.x = (r.x - u) * e + u, ht.y = (r.y - c) * e + c), s && s(e), Mt(1 === e) }; i ? Vt("customZoomTo", 0, 1, i, n || o.easing.sine.inOut, h) : h(1), Tt("zoomTo", t) } }, Jt = {}, $t = {}, te = {}, ee = {}, ie = {}, ne = [], oe = {}, se = [], ae = {}, re = 0, le = { x: 0, y: 0 }, ue = 0, ce = { x: 0, y: 0 }, he = { x: 0, y: 0 }, de = { x: 0, y: 0 }, pe = function (t, e) { return ae.x = Math.abs(t.x - e.x), ae.y = Math.abs(t.y - e.y), Math.sqrt(ae.x * ae.x + ae.y * ae.y) }, me = function () { Y && (O(Y), Y = null) }, fe = function () { H && (Y = E(fe), Me()) }, ge = function (t, e) { return !!t && !(t.className && t.className.indexOf("pswp__scroll-wrap") > -1) && (e(t) ? t : ge(t.parentNode, e)) }, ve = {}, _e = function (t, e) { return ve.prevent = !ge(t.target, a.isClickableElement), Tt("preventDragEvent", t, e, ve), ve.prevent }, we = function (t, e) { return e.x = t.pageX, e.y = t.pageY, e.id = t.identifier, e }, ye = function (t, e, i) { i.x = .5 * (t.x + e.x), i.y = .5 * (t.y + e.y) }, xe = function () { var t = ht.y - s.currItem.initialPosition.y; return 1 - Math.abs(t / (dt.y / 2)) }, be = {}, Ce = {}, Ie = [], Te = function (t) { for (; Ie.length > 0; ) Ie.pop(); return M ? (rt = 0, ne.forEach(function (t) { 0 === rt ? Ie[0] = t : 1 === rt && (Ie[1] = t), rt++ })) : t.type.indexOf("touch") > -1 ? t.touches && t.touches.length > 0 && (Ie[0] = we(t.touches[0], be), t.touches.length > 1 && (Ie[1] = we(t.touches[1], Ce))) : (be.x = t.pageX, be.y = t.pageY, be.id = "", Ie[0] = be), Ie }, ke = function (t, e) { var i, n, o, r, l = ht[t] + e[t], u = e[t] > 0, c = ce.x + e.x, h = ce.x - oe.x; return i = l > $.min[t] || l < $.max[t] ? a.panEndFriction : 1, l = ht[t] + e[t] * i, !a.allowPanToNext && g !== s.currItem.initialZoomLevel || (tt ? "h" !== it || "x" !== t || j || (u ? (l > $.min[t] && (i = a.panEndFriction, $.min[t], n = $.min[t] - ct[t]), (0 >= n || 0 > h) && qe() > 1 ? (r = c, 0 > h && c > oe.x && (r = oe.x)) : $.min.x !== $.max.x && (o = l)) : (l < $.max[t] && (i = a.panEndFriction, $.max[t], n = ct[t] - $.max[t]), (0 >= n || h > 0) && qe() > 1 ? (r = c, h > 0 && c < oe.x && (r = oe.x)) : $.min.x !== $.max.x && (o = l))) : r = c, "x" !== t) ? void(et || G || g > s.currItem.fitRatio && (ht[t] += e[t] * i)) : (void 0 !== r && (Ot(r, !0), G = r !== oe.x), $.min.x !== $.max.x && (void 0 !== o ? ht.x = o : G || (ht.x += e.x * i)), void 0 !== r) }, Se = function (t) { if (!("mousedown" === t.type && t.button > 0)) { if (Ze) return void t.preventDefault(); if (!B || "mousedown" !== t.type) { if (_e(t, !0) && t.preventDefault(), Tt("pointerDown"), M) { var e = o.arraySearch(ne, t.pointerId, "id"); 0 > e && (e = ne.length), ne[e] = { x: t.pageX, y: t.pageY, id: t.pointerId } } var i = Te(t), n = i.length; V = null, Gt(), H && 1 !== n || (H = nt = !0, o.bind(window, p, s), q = at = ot = U = G = X = K = j = !1, it = null, Tt("firstTouchStart", i), Ft(ct, ht), ut.x = ut.y = 0, Ft(ee, i[0]), Ft(ie, ee), oe.x = ft.x * pt, se = [{ x: ee.x, y: ee.y } ], Z = N = kt(), Nt(g, !0), me(), fe()), !Q && n > 1 && !et && !G && (v = g, j = !1, Q = K = !0, ut.y = ut.x = 0, Ft(ct, ht), Ft(Jt, i[0]), Ft($t, i[1]), ye(Jt, $t, de), he.x = Math.abs(de.x) - ht.x, he.y = Math.abs(de.y) - ht.y, J = pe(Jt, $t)) } } }, De = function (t) { if (t.preventDefault(), M) { var e = o.arraySearch(ne, t.pointerId, "id"); if (e > -1) { var i = ne[e]; i.x = t.pageX, i.y = t.pageY } } if (H) { var n = Te(t); if (it || X || Q) V = n; else if (ce.x !== ft.x * pt) it = "h"; else { var s = Math.abs(n[0].x - ee.x) - Math.abs(n[0].y - ee.y); Math.abs(s) >= 10 && (it = s > 0 ? "h" : "v", V = n) } } }, Me = function () { if (V) { var t = V.length; if (0 !== t) if (Ft(Jt, V[0]), te.x = Jt.x - ee.x, te.y = Jt.y - ee.y, Q && t > 1) { if (ee.x = Jt.x, ee.y = Jt.y, !te.x && !te.y && function (t, e) { return t.x === e.x && t.y === e.y } (V[1], $t)) return; Ft($t, V[1]), j || (j = !0, Tt("zoomGestureStarted")); var e = pe(Jt, $t), i = Fe(e); i > s.currItem.initialZoomLevel + s.currItem.initialZoomLevel / 15 && (at = !0); var n = 1, r = Zt(), l = Wt(); if (r > i) if (a.pinchToClose && !at && v <= s.currItem.initialZoomLevel) { var u = 1 - (r - i) / (r / 1.2); St(u), Tt("onPinchClose", u), ot = !0 } else (n = (r - i) / r) > 1 && (n = 1), i = r - n * (r / 3); else i > l && ((n = (i - l) / (6 * r)) > 1 && (n = 1), i = l + n * r); 0 > n && (n = 0), ye(Jt, $t, le), ut.x += le.x - de.x, ut.y += le.y - de.y, Ft(de, le), ht.x = Rt("x", i), ht.y = Rt("y", i), q = i > g, g = i, Mt() } else { var c = void 0 !== window.pageYOffset ? window.pageYOffset : (document.documentElement || document.body.parentNode || document.body).scrollTop, h = s.carousel.getBoundingClientRect(); if (V[0].y > h.top + c && 0 != h.top && !o.hasClass(s.carousel, "pswp__ui--hidden")) return; if (!it) return; if (nt && (nt = !1, Math.abs(te.x) >= 10 && (te.x -= V[0].x - ie.x), Math.abs(te.y) >= 10 && (te.y -= V[0].y - ie.y)), ee.x = Jt.x, ee.y = Jt.y, 0 === te.x && 0 === te.y) return; if ("v" === it && a.closeOnVerticalDrag && "fit" === a.scaleMode && g === s.currItem.initialZoomLevel) { ut.y += te.y, ht.y += te.y; var d = xe(); return U = !0, Tt("onVerticalDrag", d), St(d), void Mt() } (function (t, e, i) { if (t - Z > 50) { var n = se.length > 2 ? se.shift() : {}; n.x = e, n.y = i, se.push(n), Z = t } })(kt(), Jt.x, Jt.y), X = !0, $ = s.currItem.bounds, ke("x", te) || (ke("y", te), Pt(ht), Mt()) } } }, Ae = function (t) { if (z.isOldAndroid) { if (B && "mouseup" === t.type) return; t.type.indexOf("touch") > -1 && (clearTimeout(B), B = setTimeout(function () { B = 0 }, 600)) } var e; if (Tt("pointerUp"), _e(t, !1) && t.preventDefault(), M) { var i = o.arraySearch(ne, t.pointerId, "id"); i > -1 && (e = ne.splice(i, 1)[0], navigator.pointerEnabled ? e.type = t.pointerType || "mouse" : (e.type = { 4: "mouse", 2: "touch", 3: "pen" } [t.pointerType], e.type || (e.type = t.pointerType || "mouse"))) } var n, r = Te(t), l = r.length; if ("mouseup" === t.type && (l = 0), 2 === l) return V = null, !0; 1 === l && Ft(ie, r[0]), 0 !== l || it || et || (e || ("mouseup" === t.type ? e = { x: t.pageX, y: t.pageY, type: "mouse" } : t.changedTouches && t.changedTouches[0] && (e = { x: t.changedTouches[0].pageX, y: t.changedTouches[0].pageY, type: "touch" })), Tt("touchRelease", t, e)); var u = -1; if (0 === l && (H = !1, o.unbind(window, p, s), me(), Q ? u = 0 : -1 !== ue && (u = kt() - ue)), ue = 1 === l ? kt() : -1, n = -1 !== u && 150 > u ? "zoom" : "swipe", Q && 2 > l && (Q = !1, 1 === l && (n = "zoomPointerUp"), Tt("zoomGestureEnded")), V = null, X || j || et || U) if (Gt(), W || (W = Ee()), W.calculateSwipeSpeed("x"), U) if (xe() < a.verticalDragRange) s.close(); else { var c = ht.y, h = st; Vt("verticalDrag", 0, 1, 300, o.easing.cubic.out, function (t) { ht.y = (s.currItem.initialPosition.y - c) * t + c, St((1 - h) * t + h), Mt() }), Tt("onVerticalDrag", 1) } else { if ((G || et) && 0 === l) { if (Re(n, W)) return; n = "zoomPointerUp" } if (!et) return "swipe" !== n ? void Pe() : void(!G && g > s.currItem.fitRatio && Oe(W)) } }, Ee = function () { var t, e, i = { lastFlickOffset: {}, lastFlickDist: {}, lastFlickSpeed: {}, slowDownRatio: {}, slowDownRatioReverse: {}, speedDecelerationRatio: {}, speedDecelerationRatioAbs: {}, distanceOffset: {}, backAnimDestination: {}, backAnimStarted: {}, calculateSwipeSpeed: function (n) { se.length > 1 ? (t = kt() - Z + 50, e = se[se.length - 2][n]) : (t = kt() - N, e = ie[n]), i.lastFlickOffset[n] = ee[n] - e, i.lastFlickDist[n] = Math.abs(i.lastFlickOffset[n]), i.lastFlickDist[n] > 20 ? i.lastFlickSpeed[n] = i.lastFlickOffset[n] / t : i.lastFlickSpeed[n] = 0, Math.abs(i.lastFlickSpeed[n]) < .1 && (i.lastFlickSpeed[n] = 0), i.slowDownRatio[n] = .95, i.slowDownRatioReverse[n] = 1 - i.slowDownRatio[n], i.speedDecelerationRatio[n] = 1 }, calculateOverBoundsAnimOffset: function (t, e) { i.backAnimStarted[t] || (ht[t] > $.min[t] ? i.backAnimDestination[t] = $.min[t] : ht[t] < $.max[t] && (i.backAnimDestination[t] = $.max[t]), void 0 !== i.backAnimDestination[t] && (i.slowDownRatio[t] = .7, i.slowDownRatioReverse[t] = 1 - i.slowDownRatio[t], i.speedDecelerationRatioAbs[t] < .05 && (i.lastFlickSpeed[t] = 0, i.backAnimStarted[t] = !0, Vt("bounceZoomPan" + t, ht[t], i.backAnimDestination[t], e || 300, o.easing.sine.out, function (e) { ht[t] = e, Mt() })))) }, calculateAnimOffset: function (t) { i.backAnimStarted[t] || (i.speedDecelerationRatio[t] = i.speedDecelerationRatio[t] * (i.slowDownRatio[t] + i.slowDownRatioReverse[t] - i.slowDownRatioReverse[t] * i.timeDiff / 10), i.speedDecelerationRatioAbs[t] = Math.abs(i.lastFlickSpeed[t] * i.speedDecelerationRatio[t]), i.distanceOffset[t] = i.lastFlickSpeed[t] * i.speedDecelerationRatio[t] * i.timeDiff, ht[t] += i.distanceOffset[t]) }, panAnimLoop: function () { return Kt.zoomPan && (Kt.zoomPan.raf = E(i.panAnimLoop), i.now = kt(), i.timeDiff = i.now - i.lastNow, i.lastNow = i.now, i.calculateAnimOffset("x"), i.calculateAnimOffset("y"), Mt(), i.calculateOverBoundsAnimOffset("x"), i.calculateOverBoundsAnimOffset("y"), i.speedDecelerationRatioAbs.x < .05 && i.speedDecelerationRatioAbs.y < .05) ? (ht.x = Math.round(ht.x), ht.y = Math.round(ht.y), Mt(), void Xt("zoomPan")) : void 0 } }; return i }, Oe = function (t) { return t.calculateSwipeSpeed("y"), $ = s.currItem.bounds, t.backAnimDestination = {}, t.backAnimStarted = {}, Math.abs(t.lastFlickSpeed.x) <= .05 && Math.abs(t.lastFlickSpeed.y) <= .05 ? (t.speedDecelerationRatioAbs.x = t.speedDecelerationRatioAbs.y = 0, t.calculateOverBoundsAnimOffset("x"), t.calculateOverBoundsAnimOffset("y"), !0) : (Yt("zoomPan"), t.lastNow = kt(), void t.panAnimLoop()) }, Re = function (t, e) { var i, n, r; if (et || (re = c), "swipe" === t) { var l = ee.x - ie.x, u = e.lastFlickDist.x < 10; l > 30 && (u || e.lastFlickOffset.x > 20) ? n = -1 : -30 > l && (u || e.lastFlickOffset.x < -20) && (n = 1) } n && (0 > (c += n) ? (c = a.loop ? qe() - 1 : 0, r = !0) : c >= qe() && (c = a.loop ? 0 : qe() - 1, r = !0), (!r || a.loop) && (gt += n, pt -= n, i = !0)); var h, d = ft.x * pt, p = Math.abs(d - ce.x); return i || d > ce.x == e.lastFlickSpeed.x > 0 ? (h = Math.abs(e.lastFlickSpeed.x) > 0 ? p / Math.abs(e.lastFlickSpeed.x) : 333, h = Math.min(h, 400), h = Math.max(h, 250)) : h = 333, re === c && (i = !1), et = !0, Tt("mainScrollAnimStart"), Vt("mainScroll", ce.x, d, h, o.easing.cubic.out, Ot, function () { Gt(), et = !1, re = -1, (i || re !== c) && s.updateCurrItem(), Tt("mainScrollAnimComplete") }), i && s.updateCurrItem(!0), i }, Fe = function (t) { return 1 / J * t * v }, Pe = function () { var t = g, e = Zt(), i = Wt(); e > g ? t = e : g > i && (t = i); var n, a = st; return ot && !q && !at && e > g ? (s.close(), !0) : (ot && (n = function (t) { St((1 - a) * t + a) }), s.zoomTo(t, 0, 200, o.easing.cubic.out, n), !0) }; xt("Gestures", { publicMethods: { initGestures: function () { var t = function (t, e, i, n, o) { I = t + e, T = t + i, k = t + n, S = o ? t + o : "" }; (M = z.pointerEvent) && z.touch && (z.touch = !1), M ? navigator.pointerEnabled ? t("pointer", "down", "move", "up", "cancel") : t("MSPointer", "Down", "Move", "Up", "Cancel") : z.touch ? (t("touch", "start", "move", "end", "cancel"), A = !0) : t("mouse", "down", "move", "up"), p = T + " " + k + " " + S, m = I, M && !A && (A = navigator.maxTouchPoints > 1 || navigator.msMaxTouchPoints > 1), s.likelyTouchDevice = A, f[I] = Se, f[T] = De, f[k] = Ae, S && (f[S] = f[k]), z.touch && (m += " mousedown", p += " mousemove mouseup", f.mousedown = f[I], f.mousemove = f[T], f.mouseup = f[k]), A || (a.allowPanToNext = !1) } } }); var Le, ze, Ne, Ze, We, qe, Ue = function (e, i, n, r) { var l; Le && clearTimeout(Le), Ze = !0, Ne = !0, e.initialLayout ? (l = e.initialLayout, e.initialLayout = null) : l = a.getThumbBoundsFn && a.getThumbBoundsFn(c); var h, d, p = n ? a.hideAnimationDuration : a.showAnimationDuration, m = function () { Xt("initialZoom"), n ? (s.template.removeAttribute("style"), s.bg.removeAttribute("style")) : (St(1), i && (i.style.display = "block"), o.addClass(t, "pswp--animated-in"), Tt("initialZoom" + (n ? "OutEnd" : "InEnd"))), r && r(), Ze = !1 }; if (!p || !l || void 0 === l.x) return Tt("initialZoom" + (n ? "Out" : "In")), g = e.initialZoomLevel, Ft(ht, e.initialPosition), Mt(), t.style.opacity = n ? 0 : 1, St(1), void m(); h = u, d = !s.currItem.src || s.currItem.loadError || a.showHideOpacity, e.miniImg && (e.miniImg.style.webkitBackfaceVisibility = "hidden"), n || (g = l.w / e.w, ht.x = l.x, ht.y = l.y - F, s[d ? "template" : "bg"].style.opacity = .001, Mt()), Yt("initialZoom"), n && !h && o.removeClass(t, "pswp--animated-in"), d && (n ? o[(h ? "remove" : "add") + "Class"](t, "pswp--animate_opacity") : setTimeout(function () { o.addClass(t, "pswp--animate_opacity") }, 30)), Le = setTimeout(function () { if (Tt("initialZoom" + (n ? "Out" : "In")), n) { var i = l.w / e.w, s = { x: ht.x, y: ht.y }, a = g, r = st, u = function (e) { 1 === e ? (g = i, ht.x = l.x, ht.y = l.y - L) : (g = (i - a) * e + a, ht.x = (l.x - s.x) * e + s.x, ht.y = (l.y - L - s.y) * e + s.y), Mt(), d ? t.style.opacity = 1 - e : St(r - e * r) }; h ? Vt("initialZoom", 0, 1, p, o.easing.cubic.out, u, m) : (u(1), Le = setTimeout(m, p + 20)) } else g = e.initialZoomLevel, Ft(ht, e.initialPosition), Mt(), St(1), d ? t.style.opacity = 1 : St(1), Le = setTimeout(m, p + 20) }, n ? 25 : 90) }, Be = {}, He = [], Ke = { index: 0, errorMsg: '
    The image could not be loaded.
    ', forceProgressiveLoading: !1, preload: [1, 1], getNumItemsFn: function () { return ze.length } }, je = function (t, e, i) { if (t.src && !t.loadError) { var n = !i; if (n && (t.vGap || (t.vGap = { top: 0, bottom: 0 }), Tt("parseVerticalMargin", t)), Be.x = e.x, Be.y = e.y - t.vGap.top - t.vGap.bottom, n) { var o = Be.x / t.w, s = Be.y / t.h; t.fitRatio = s > o ? o : s; var r = a.scaleMode; "orig" === r ? i = 1 : "fit" === r && (i = t.fitRatio), i > 1 && (i = 1), t.initialZoomLevel = i, t.bounds || (t.bounds = { center: { x: 0, y: 0 }, max: { x: 0, y: 0 }, min: { x: 0, y: 0 } }) } if (!i) return; return function (t, e, i) { var n = t.bounds; n.center.x = Math.round((Be.x - e) / 2), n.center.y = Math.round((Be.y - i) / 2) + t.vGap.top, n.max.x = e > Be.x ? Math.round(Be.x - e) : n.center.x, n.max.y = i > Be.y ? Math.round(Be.y - i) + t.vGap.top : n.center.y, n.min.x = e > Be.x ? 0 : n.center.x, n.min.y = i > Be.y ? t.vGap.top : n.center.y } (t, t.w * i, t.h * i), n && i === t.initialZoomLevel && (t.initialPosition = t.bounds.center), t.bounds } return t.w = t.h = 0, t.initialZoomLevel = t.fitRatio = 1, t.bounds = { center: { x: 0, y: 0 }, max: { x: 0, y: 0 }, min: { x: 0, y: 0 } }, t.initialPosition = t.bounds.center, t.bounds }, Xe = function (t, e, i, n, o, s) { e.loadError || n && (e.imageAppended = !0, Ve(e, n), i.appendChild(n), s && setTimeout(function () { e && e.loaded && e.placeholder && (e.placeholder.style.display = "none", e.placeholder = null) }, 500)) }, Ye = function (t) { t.loading = !0, t.loaded = !1; var e = t.img = o.createEl("pswp__img", "img"), i = function () { t.loading = !1, t.loaded = !0, t.loadComplete ? t.loadComplete(t) : t.img = null, e.onload = e.onerror = null, e = null }; return e.onload = i, e.onerror = function () { t.loadError = !0, i() }, e.src = t.src, e }, Ge = function (t, e) { return t.src && t.loadError && t.container ? (e && (t.container.innerHTML = ""), t.container.innerHTML = a.errorMsg.replace("%url%", t.src), !0) : void 0 }, Ve = function (t, e, i) { if (t.src) { e || (e = t.container.lastChild); var n = i ? t.w : Math.round(t.w * t.fitRatio), o = i ? t.h : Math.round(t.h * t.fitRatio), s = document.getElementsByClassName("pswp__aosc")[0]; s.style.width = n + "px", s.style.height = o + "px", t.placeholder && !t.loaded && (t.placeholder.style.width = n + "px", t.placeholder.style.height = o + "px"), e.style.width = n + "px", e.style.height = o + "px" } }, Qe = function () { if (He.length) { for (var t, e = 0; e < He.length; e++) (t = He[e]).holder.index === t.index && Xe(t.index, t.item, t.baseDiv, t.img, 0, t.clearPlaceholder); He = [] } }; xt("Controller", { publicMethods: { lazyLoadItem: function (t) { t = bt(t); var e = We(t); !e || e.loaded || e.loading || (Tt("gettingData", t, e), e.src && Ye(e)) }, initController: function () { o.extend(a, Ke, !0), s.items = ze = i, We = s.getItemAt, qe = a.getNumItemsFn, a.loop, qe() < 3 && (a.loop = !1), It("beforeChange", function (t) { var e, i = a.preload, n = null === t || t > 0, o = Math.min(i[0], qe()), r = Math.min(i[1], qe()); for (e = 1; (n ? r : o) >= e; e++) s.lazyLoadItem(c + e); for (e = 1; (n ? o : r) >= e; e++) s.lazyLoadItem(c - e) }), It("initialLayout", function () { s.currItem.initialLayout = a.getThumbBoundsFn && a.getThumbBoundsFn(c) }), It("mainScrollAnimComplete", Qe), It("initialZoomInEnd", Qe), It("destroy", function () { for (var t, e = 0; e < ze.length; e++) (t = ze[e]).container && (t.container = null), t.placeholder && (t.placeholder = null), t.img && (t.img = null), t.preloader && (t.preloader = null), t.loadError && (t.loaded = t.loadError = !1); He = null }) }, getItemAt: function (t) { return t >= 0 && void 0 !== ze[t] && ze[t] }, allowProgressiveImg: function () { return a.forceProgressiveLoading || !A || a.mouseUsed || screen.width > 1200 }, setContent: function (t, e) { a.loop && (e = bt(e)); var i = s.getItemAt(t.index); i && (i.container = null); var n, l = s.getItemAt(e); if (l) { Tt("gettingData", e, l), t.index = e, t.item = l; var u = l.container = o.createEl("pswp__zoom-wrap"); if (!l.src && l.html && (l.html.tagName ? u.appendChild(l.html) : u.innerHTML = l.html), Ge(l), je(l, dt), !l.src || l.loadError || l.loaded) l.src && !l.loadError && ((n = o.createEl("pswp__img", "img")).style.opacity = 1, n.src = l.src, Ve(l, n), Xe(0, l, u, n)); else { if (l.loadComplete = function (i) { if (r) { if (t && t.index === e) { if (Ge(i, !0)) return i.loadComplete = i.img = null, je(i, dt) , At(i), void(t.index === c && s.updateCurrZoomItem()); i.imageAppended ? !Ze && i.placeholder && (i.placeholder.style.display = "none", i.placeholder = null) : z.transform && (et || Ze) ? He.push({ item: i, baseDiv: u, img: i.img, index: e, holder: t, clearPlaceholder: !0 }) : Xe(0, i, u, i.img, 0, !0) } i.loadComplete = null, i.img = null, Tt("imageLoadComplete", e, i) } }, o.features.transform) { var h = "pswp__img pswp__img--placeholder"; h += l.msrc ? "" : " pswp__img--placeholder--blank"; var d = o.createEl(h, l.msrc ? "img" : ""); l.msrc && (d.src = l.msrc), Ve(l, d), u.appendChild(d), l.placeholder = d } l.loading || Ye(l), s.allowProgressiveImg() && (!Ne && z.transform ? He.push({ item: l, baseDiv: u, img: l.img, index: e, holder: t }) : Xe(0, l, u, l.img, 0, !0)) } Ne || e !== c ? At(l) : (tt = u.style, Ue(l, n || l.img)), t.el.innerHTML = "", t.el.appendChild(u) } else t.el.innerHTML = "" }, cleanSlide: function (t) { t.img && (t.img.onload = t.img.onerror = null), t.loaded = t.loading = t.img = t.imageAppended = !1 } } }); var Je, $e, ti = {}, ei = function (t, e, i) { var n = document.createEvent("CustomEvent"), o = { origEvent: t, target: t.target, releasePoint: e, pointerType: i || "touch" }; n.initCustomEvent("pswpTap", !0, !0, o), t.target.dispatchEvent(n) }; xt("Tap", { publicMethods: { initTap: function () { It("firstTouchStart", s.onTapStart), It("touchRelease", s.onTapRelease), It("destroy", function () { ti = {}, Je = null }) }, onTapStart: function (t) { t.length > 1 && (clearTimeout(Je), Je = null) }, onTapRelease: function (t, e) { if (e && !X && !K && !jt) { var i = e; if (Je && (clearTimeout(Je), Je = null, function (t, e) { return Math.abs(t.x - e.x) < 25 && Math.abs(t.y - e.y) < 25 } (i, ti))) return void Tt("doubleTap", i); if ("mouse" === e.type) return void ei(t, e, "mouse"); if ("BUTTON" === t.target.tagName.toUpperCase() || o.hasClass(t.target, "pswp__single-tap")) return void ei(t, e); Ft(ti, i), Je = setTimeout(function () { ei(t, e), Je = null }, 300) } } } }), xt("DesktopZoom", { publicMethods: { initDesktopZoom: function () { P || (A ? It("mouseUsed", function () { s.setupDesktopZoom() }) : s.setupDesktopZoom(!0)) }, setupDesktopZoom: function (e) { $e = {}; var i = "wheel mousewheel DOMMouseScroll"; It("bindEvents", function () { o.bind(t, i, s.handleMouseWheel) }), It("unbindEvents", function () { $e && o.unbind(t, i, s.handleMouseWheel) }), s.mouseZoomedIn = !1; var n, a = function () { s.mouseZoomedIn && (o.removeClass(t, "pswp--zoomed-in"), s.mouseZoomedIn = !1), g < s.options.maxSpreadZoom ? o.addClass(t, "pswp--zoom-allowed") : o.removeClass(t, "pswp--zoom-allowed"), r() }, r = function () { n && (o.removeClass(t, "pswp--dragging"), n = !1) }; It("resize", a), It("afterChange", a), It("pointerDown", function () { s.mouseZoomedIn && (n = !0, o.addClass(t, "pswp--dragging")) }), It("pointerUp", r), e || a() }, handleMouseWheel: function (t) { if (g <= s.currItem.fitRatio) return a.modal && (!a.closeOnScroll || jt || H ? t.preventDefault() : D && Math.abs(t.deltaY) > 2 && (u = !0, s.close())), !0; if (t.stopPropagation(), $e.x = 0, "deltaX" in t) 1 === t.deltaMode ? ($e.x = 18 * t.deltaX, $e.y = 18 * t.deltaY) : ($e.x = t.deltaX, $e.y = t.deltaY); else if ("wheelDelta" in t) t.wheelDeltaX && ($e.x = - .16 * t.wheelDeltaX), t.wheelDeltaY ? $e.y = - .16 * t.wheelDeltaY : $e.y = - .16 * t.wheelDelta; else { if (!("detail" in t)) return; $e.y = t.detail } Nt(g, !0); var e = ht.x - $e.x, i = ht.y - $e.y; (a.modal || e <= $.min.x && e >= $.max.x && i <= $.min.y && i >= $.max.y) && t.preventDefault(), s.panTo(e, i) }, toggleDesktopZoom: function (e) { e = e || { x: dt.x / 2 + mt.x, y: dt.y / 2 + mt.y }; var i = a.getDoubleTapZoom(!0, s.currItem), n = g === i; s.mouseZoomedIn = !n, s.zoomTo(n ? s.currItem.initialZoomLevel : i, e, 333), o[(n ? "remove" : "add") + "Class"](t, "pswp--zoomed-in") } } }); var ii, ni, oi, si, ai, ri, li, ui, ci, hi, di, pi, mi = { history: 0, galleryUID: 1 }, fi = function () { return di.hash.substring(1) }, gi = function () { ii && clearTimeout(ii), oi && clearTimeout(oi) }, vi = function () { var t = fi(), e = {}; if (t.length < 5) return e; var i, n = t.split("&"); for (i = 0; i < n.length; i++) if (n[i]) { var o = n[i].split("="); o.length < 2 || (e[o[0]] = o[1]) } if (a.galleryPIDs) { var s = e.pid; for (e.pid = 0, i = 0; i < ze.length; i++) if (ze[i].pid === s) { e.pid = i; break } } else e.pid = parseInt(e.pid, 10) - 1; return e.pid < 0 && (e.pid = 0), e }, _i = function () { if (oi && clearTimeout(oi), jt || H) oi = setTimeout(_i, 500); else { si ? clearTimeout(ni) : si = !0; var t = c + 1, e = We(c); e.hasOwnProperty("pid") && (t = e.pid); var i = li + "&gid=" + a.galleryUID + "&pid=" + t; ui || -1 === di.hash.indexOf(i) && (hi = !0); var n = di.href.split("#")[0] + "#" + i; pi ? "#" + i !== window.location.hash && history[ui ? "replaceState" : "pushState"]("", document.title, n) : ui ? di.replace(n) : di.hash = i, ui = !0, ni = setTimeout(function () { si = !1 }, 60) } }; xt("History", { publicMethods: { initHistory: function () { if (o.extend(a, mi, !0), a.history) { di = window.location, hi = !1, ci = !1, ui = !1, li = fi(), pi = "pushState" in history, li.indexOf("gid=") > -1 && (li = (li = li.split("&gid=")[0]).split("?gid=")[0]), It("afterChange", s.updateURL), It("unbindEvents", function () { o.unbind(window, "hashchange", s.onHashChange) }); var t = function () { ri = !0, ci || (hi ? history.back() : li ? di.hash = li : pi ? history.pushState("", document.title, di.pathname + di.search) : di.hash = ""), gi() }; It("unbindEvents", function () { u && t() }), It("destroy", function () { ri || t() }), It("firstUpdate", function () { c = vi().pid }); var e = li.indexOf("pid="); e > -1 && "&" === (li = li.substring(0, e)).slice(-1) && (li = li.slice(0, -1)), setTimeout(function () { r && o.bind(window, "hashchange", s.onHashChange) }, 40) } }, onHashChange: function () { return fi() === li ? (ci = !0, void s.close()) : void(si || (ai = !0, s.goTo(vi().pid), ai = !1)) }, updateURL: function () { gi(), ai || (ui ? ii = setTimeout(_i, 800) : _i()) } } }), o.extend(s, Qt) } }), function (t, e) { "object" == typeof exports ? module.exports = e() : t.PhotoSwipeUI_Default = e() } (this, function () { return function (t, e) { var i, n, o, s, a, r, l, u, c, h, d, p, m, f, g, v, _, w, y = this, x = !1, b = !0, C = !0, I = { barsSize: { top: 44, bottom: "auto" }, closeElClasses: ["item", "caption", "zoom-wrap", "ui", "top-bar"], timeToIdle: 4e3, timeToIdleOutside: 1e3, loadingIndicatorDelay: 1e3, addCaptionHTMLFn: function (t, e) { return t.title ? (e.children[0].innerHTML = t.title, !0) : (e.children[0].innerHTML = "", !1) }, closeEl: !0, captionEl: !0, fullscreenEl: !0, zoomEl: !0, shareEl: !0, counterEl: !0, arrowEl: !0, preloaderEl: !0, tapToClose: !1, tapToToggleControls: !0, clickToCloseNonZoomable: !1, shareButtons: [{ id: "facebook", label: "Share on Facebook", url: "https://www.facebook.com/sharer/sharer.php?u={{url}}" }, { id: "twitter", label: "Tweet", url: "https://twitter.com/intent/tweet?text={{text}}&url={{url}}" }, { id: "pinterest", label: "Pin it", url: "http://www.pinterest.com/pin/create/button/?url={{url}}&media={{image_url}}&description={{text}}" }, { id: "download", label: "Download image", url: "{{raw_image_url}}", download: !0 } ], getImageURLForShare: function () { return t.currItem.src || "" }, getPageURLForShare: function () { return window.location.href }, getTextForShare: function () { return t.currItem.title || "" }, indexIndicatorSep: " / " }, T = function (t) { if (_) return !0; t = t || window.event, v.timeToIdle && v.mouseUsed && !h && R(); for (var i, n, o = (t.target || t.srcElement).className, s = 0; s < z.length; s++) (i = z[s]).onTap && o.indexOf("pswp__" + i.name) > -1 && (i.onTap(), n = !0); if (n) { t.stopPropagation && t.stopPropagation(), _ = !0; var a = e.features.isOldAndroid ? 600 : 30; setTimeout(function () { _ = !1 }, a) } }, k = function (t, i, n) { e[(n ? "add" : "remove") + "Class"](t, "pswp__" + i) }, S = function () { var t = 1 === v.getNumItemsFn(); t !== g && (k(n, "ui--one-slide", t), g = t) }, D = function () { k(u, "share-modal--hidden", C) }, M = function () { return (C = !C) ? (e.removeClass(u, "pswp__share-modal--fade-in"), setTimeout(function () { C && D() }, 300)) : (D(), setTimeout(function () { C || e.addClass(u, "pswp__share-modal--fade-in") }, 30)), C || E(), !1 }, A = function (e) { var i = (e = e || window.event).target || e.srcElement; return t.shout("shareLinkClick", e, i), !(!i.href || !i.hasAttribute("download") && (window.open(i.href, "pswp_share", "scrollbars=yes,resizable=yes,toolbar=no,location=yes,width=550,height=420,top=100,left=" + (window.screen ? Math.round(screen.width / 2 - 275) : 100)), C || M(), 1)) }, E = function () { for (var t, e, i, n, o = "", s = 0; s < v.shareButtons.length; s++) t = v.shareButtons[s], e = v.getImageURLForShare(t), i = v.getPageURLForShare(t), n = v.getTextForShare(t), o += '", v.parseShareButtonOut && (o = v.parseShareButtonOut(t, o)); u.children[0].innerHTML = o, u.children[0].onclick = A }, O = function (t) { for (var i = 0; i < v.closeElClasses.length; i++) if (e.hasClass(t, "pswp__" + v.closeElClasses[i])) return !0 }, R = function () { clearTimeout(w), h && y.setIdle(!1) }, F = function (t) { var e = (t = t || window.event).relatedTarget || t.toElement; e && "HTML" !== e.nodeName || (clearTimeout(w), w = setTimeout(function () { y.setIdle(!0) }, v.timeToIdleOutside)) }, P = function (t) { m !== t && (k(p, "preloader--active", !t), m = t) }, L = function (i) { var o = i.vGap, r = e.getChildByClass(t.scrollWrap, "pswp__carousel"), l = e.getChildByClass(t.scrollWrap, "pswp__carouselDotsContainer"), u = e.getChildByClass(t.bg, "pswp__rotateDevice"); if (r && l && u) if (t.likelyTouchDevice ? t.viewportSize.x > t.viewportSize.y ? (r.style.display = "none", l.style.display = "block", u.style.display = "none") : (r.style.display = "block", l.style.display = "none", u.style.display = "block") : (r.style.display = "block", l.style.display = "none", u.style.display = "none"), !t.likelyTouchDevice || v.mouseUsed || screen.width > 1200) { var c = v.barsSize; if (v.captionEl && "auto" === c.bottom) if (a || ((a = e.createEl("pswp__caption pswp__caption--fake")).appendChild(e.createEl("pswp__caption__center")), n.insertBefore(a, s), e.addClass(n, "pswp__ui--fit")), v.addCaptionHTMLFn(i, a, !0)) { var h = a.clientHeight; o.bottom = parseInt(h, 10) || 44 } else t.viewportSize.x, window.devicePixelRatio, r = e.getChildByClass(t.scrollWrap, "pswp__carousel"), o.bottom = 110; else o.bottom = "auto" === c.bottom ? 0 : c.bottom; o.top = c.top } else o.top = o.bottom = 0 }, z = [{ name: "caption", option: "captionEl", onInit: function (t) { s = t } }, { name: "share-modal", option: "shareEl", onInit: function (t) { u = t }, onTap: function () { M() } }, { name: "button--share", option: "shareEl", onInit: function (t) { l = t }, onTap: function () { M() } }, { name: "button--zoom", option: "zoomEl", onTap: t.toggleDesktopZoom }, { name: "counter", option: "counterEl", onInit: function (t) { r = t } }, { name: "button--close", option: "closeEl", onTap: t.close }, { name: "button--arrow--left", option: "arrowEl", onTap: t.prev }, { name: "button--arrow--right", option: "arrowEl", onTap: t.next }, { name: "button--fs", option: "fullscreenEl", onTap: function () { i.isFullscreen() ? i.exit() : i.enter() } }, { name: "preloader", option: "preloaderEl", onInit: function (t) { p = t } } ]; y.init = function () { e.extend(t.options, I, !0), v = t.options, n = e.getChildByClass(t.scrollWrap, "pswp__ui"), o = e.getChildByClass(t.scrollWrap, "pswp__carousel"), d = t.listen, function () { var t; d("onVerticalDrag", function (t) { b && .95 > t ? y.hideControls() : !b && t >= .95 && y.showControls() }), d("onPinchClose", function (e) { b && .9 > e ? (y.hideControls(), t = !0) : t && !b && e > .9 && y.showControls() }), d("zoomGestureEnded", function () { (t = !1) && !b && y.showControls() }) } (), d("beforeChange", y.update), d("doubleTap", function (e) { var i = t.currItem.initialZoomLevel; t.getZoomLevel() !== i ? t.zoomTo(i, e, 333) : t.zoomTo(v.getDoubleTapZoom(!1, t.currItem), e, 333) }), d("preventDragEvent", function (t, e, i) { var n = t.target || t.srcElement; n && n.className && t.type.indexOf("mouse") > -1 && (n.className.indexOf("__caption") > 0 || /(SMALL|STRONG|EM)/i.test(n.tagName)) && (i.prevent = !1) }), d("bindEvents", function () { e.bind(n, "pswpTap click", T), e.bind(t.scrollWrap, "pswpTap", y.onGlobalTap), t.likelyTouchDevice || e.bind(t.scrollWrap, "mouseover", y.onMouseOver) }), d("unbindEvents", function () { C || M(), e.unbind(document, "mouseout", F), e.unbind(document, "mousemove", R), e.unbind(n, "pswpTap click", T), e.unbind(t.scrollWrap, "pswpTap", y.onGlobalTap), e.unbind(t.scrollWrap, "mouseover", y.onMouseOver), i && (e.unbind(document, i.eventK, y.updateFullscreen), i.isFullscreen() && (v.hideAnimationDuration = 0, i.exit()), i = null) }), d("destroy", function () { v.captionEl && (a && n.removeChild(a), e.removeClass(s, "pswp__caption--empty")), u && (u.children[0].onclick = null), e.removeClass(n, "pswp__ui--over-close"), e.addClass(n, "pswp__ui--hidden"), y.setIdle(!1) }), v.showAnimationDuration || e.removeClass(n, "pswp__ui--hidden"), d("initialZoomIn", function () { v.showAnimationDuration && e.removeClass(n, "pswp__ui--hidden") }), d("initialZoomOut", function () { e.addClass(n, "pswp__ui--hidden") }), d("parseVerticalMargin", L), function () { var t, i, o, s = function (n) { if (n) for (var s = n.length, a = 0; s > a; a++) { t = n[a], i = t.className; for (var r = 0; r < z.length; r++) o = z[r], i.indexOf("pswp__" + o.name) > -1 && (v[o.option] ? (e.removeClass(t, "pswp__element--disabled"), o.onInit && o.onInit(t)) : e.addClass(t, "pswp__element--disabled")) } }; s(n.children); var a = e.getChildByClass(n, "pswp__top-bar"); a && s(a.children) } (), v.shareEl && l && u && (C = !0), S(), v.fullscreenEl && (i || (i = y.getFullscreenAPI()), i ? (e.bind(document, i.eventK, y.updateFullscreen), y.updateFullscreen(), e.addClass(t.template, "pswp--supports-fs")) : e.removeClass(t.template, "pswp--supports-fs")), v.preloaderEl && (P(!0), d("beforeChange", function () { clearTimeout(f), f = setTimeout(function () { t.currItem && t.currItem.loading ? (!t.allowProgressiveImg() || t.currItem.img && !t.currItem.img.naturalWidth) && P(!1) : P(!0) }, v.loadingIndicatorDelay) }), d("imageLoadComplete", function (e, i) { t.currItem === i && P(!0) })), losjqisafe(".touchcarousel-container").empty(), losjqisafe(".pswp__carouselDotsUL").empty(); for (var r, c = v.getNumItemsFn(), h = 0; c > h; h++) (r = t.getItemAt(h)).smallImage && (h > 0 && losjqisafe(".touchcarousel-container").append('
  • '), losjqisafe(".touchcarousel-container").append('
  • ')); losjqisafe(".touchcarousel-item a").click(function (e) { e.preventDefault(), e.stopPropagation(); var i = Number(losjqisafe(e.target).attr("data-index")); isNaN(i), isNaN(i) || t.goTo(i) }); var p = losjqisafe(".pswp__carousel").touchCarousel({ itemsPerMove: 4, pagingNav: !1, scrollbar: !1, scrollToLast: !1, loopItems: !1 }).data("touchCarousel"); t.template.style, t.template.style.position = "absolute", t.template.style.right = 0, t.template.style.display = "block", p.updateCarouselSize(!0), t.template.style.position = "", t.template.style.right = "", t.template.style.display = "" }, y.setIdle = function (t) { h = t, k(n, "ui--idle", t) }, y.update = function () { b && t.currItem ? (y.updateIndexIndicator(), v.captionEl && (v.addCaptionHTMLFn(t.currItem, s), k(s, "caption--empty", !t.currItem.title)), x = !0) : x = !1, C || M(), S() }, y.updateFullscreen = function (n) { n && setTimeout(function () { t.setScrollOffset(0, e.getScrollY()) }, 50), e[(i.isFullscreen() ? "add" : "remove") + "Class"](t.template, "pswp--fs") }, y.updateIndexIndicator = function () { v.counterEl && (r.innerHTML = t.getCurrentIndex() + 1 + v.indexIndicatorSep + v.getNumItemsFn()), v.getNumItemsFn(), losjqisafe(".pswp__carouselDot").removeClass("selected"), losjqisafe("#AOSZGalleryDot_" + t.getCurrentIndex()).addClass("selected") }, y.onGlobalTap = function (i) { var n = (i = i || window.event).target || i.srcElement; if (!_) if (i.detail && "mouse" === i.detail.pointerType) { if (O(n)) return void t.close(); e.hasClass(n, "pswp__img") && (1 === t.getZoomLevel() && t.getZoomLevel() <= t.currItem.fitRatio ? v.clickToCloseNonZoomable && t.close() : t.toggleDesktopZoom(i.detail.releasePoint)) } else if (v.tapToToggleControls && (b ? y.hideControls() : y.showControls()), v.tapToClose && (e.hasClass(n, "pswp__img") || O(n))) return void t.close() }, y.onMouseOver = function (t) { var e = (t = t || window.event).target || t.srcElement; k(n, "ui--over-close", O(e)) }, y.hideControls = function () {}, y.showControls = function () { b = !0, x || y.update(), e.removeClass(n, "pswp__ui--hidden"), e.removeClass(o, "pswp__ui--hidden") }, y.supportsFullscreen = function () { var t = document; return !!(t.exitFullscreen || t.mozCancelFullScreen || t.webkitExitFullscreen || t.msExitFullscreen) }, y.getFullscreenAPI = function () { var e, i = document.documentElement, n = "fullscreenchange"; return i.requestFullscreen ? e = { enterK: "requestFullscreen", exitK: "exitFullscreen", elementK: "fullscreenElement", eventK: n } : i.mozRequestFullScreen ? e = { enterK: "mozRequestFullScreen", exitK: "mozCancelFullScreen", elementK: "mozFullScreenElement", eventK: "moz" + n } : i.webkitRequestFullscreen ? e = { enterK: "webkitRequestFullscreen", exitK: "webkitExitFullscreen", elementK: "webkitFullscreenElement", eventK: "webkit" + n } : i.msRequestFullscreen && (e = { enterK: "msRequestFullscreen", exitK: "msExitFullscreen", elementK: "msFullscreenElement", eventK: "MSFullscreenChange" }), e && (e.enter = function () { return c = v.closeOnScroll, v.closeOnScroll = !1, "webkitRequestFullscreen" !== this.enterK ? t.template[this.enterK]() : void t.template[this.enterK](Element.ALLOW_KEYBOARD_INPUT) }, e.exit = function () { return v.closeOnScroll = c, document[this.exitK]() }, e.isFullscreen = function () { return document[this.elementK] }), e } } }), function (t) { function e(e, i) { var n, o; this.carouselRoot = t(e); var s = this; this._b = this._a = !1, this._e = this._d = this._c = "", this._f, this._g, this._h, this._i, this._j, this._k = 0, this.settings = t.extend({}, t.fn.touchCarousel.defaults, i), this._l = this.carouselRoot.find(".touchcarousel-container"), this._m = this._l[0].style, this._n = this._l.wrap(t('
    ')).parent(); var a = this._l.find(".touchcarousel-item"); this.items = [], this.numItems = a.length, n = navigator.userAgent.toLowerCase(), o = /(chrome)[ \/]([\w.]+)/.exec(n) || /(webkit)[ \/]([\w.]+)/.exec(n) || /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(n) || /(msie) ([\w.]+)/.exec(n) || 0 > n.indexOf("compatible") && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(n) || [], n = o[1] || "", o = o[2] || "0"; var r = {}; n && (r[n] = !0, r.version = o), r.chrome && (r.webkit = !0), s._o = r, this._p, this._q = !1, this._t = this._s = this._r = 0, this._w = this._v = this._u = !1, "ontouchstart" in window ? (this.hasTouch = !0, this._c = "touchstart.rs", this._d = "touchmove.rs", this._e = "touchend.rs", this._x = this.settings.baseTouchFriction) : (this.hasTouch = !1, this._x = this.settings.baseMouseFriction, this.settings.dragUsingMouse ? (this._c = "mousedown.rs", this._d = "mousemove.rs", this._e = "mouseup.rs", this._y, this._z, (n = s._o).msie || n.opera ? this._y = this._z = "move" : n.mozilla && (this._y = "-moz-grab", this._z = "-moz-grabbing"), this._a1()) : this._n.addClass("auto-cursor")), (this.hasTouch || this.settings.useWebkit3d) && "WebKitCSSMatrix" in window && "m11" in new WebKitCSSMatrix && (this._l.css({ "-webkit-transform-origin": "0 0", "-webkit-transform": "translateZ(0)" }), this._w = !0), this._w ? (this._b1 = "-webkit-transform", this._c1 = "translate3d(", this._d1 = "px, 0, 0)") : (this._b1 = "left", this._c1 = "", this._d1 = "px"), this.hasTouch && (this.settings.directionNavAutoHide = !1), this.settings.directionNav || (this._f1 = this.settings.loopItems ? this._e1 = !0 : this._e1 = !1, this.settings.loopItems = !0); var l, u, c, h = 0; if (a.eq(this.numItems - 1).addClass("last"), a.each(function (e) { var i; (u = t(this), (l = {}).item = u, l.index = e, l.posX = h, l.width = u.outerWidth(!0) || s.settings.itemFallbackWidth, h += l.width, this.hasTouch) ? u.find("a").each(function () { (i = t(this)).data("tc-href", i.attr("href")), i.data("tc-target", i.attr("target")), i.attr("href", "#"), i.bind("click", function (e) { if (e.preventDefault(), s._q) return !1; e = t(this).data("tc-href"); var i = t(this).data("tc-target"); i && "_g1" !== i.toLowerCase() ? window.open(e) : window.location.href = e }) }) : u.find("a").bind("click.touchcarousel", function (t) { return s._q ? (t.preventDefault(), !1) : void 0 }); u.find(".non-draggable").bind(s._c, function (t) { s._q = !1, t.stopImmediatePropagation() }), s.items.push(l) }), this._h1 = this._f = h, this._i1 = 0 < this.settings.itemsPerMove ? this.settings.itemsPerMove : 1, this.settings.pagingNav) { if (this._j1 = this.settings.snapToItems = !0, this._k1 = Math.ceil(this.numItems / this._i1), this._l1 = 0, this.settings.pagingNavControls) { for (this._m1 = t('
    '), a = this._m1.find(".tc-paging-centerer-inside"), o = 1; o <= this._k1; o++) n = t('
    ' + o + "").data("tc-id", o), o === this._l1 + 1 && n.addClass("current"), a.append(n); this._n1 = a.find(".tc-paging-item").click(function (e) { e.preventDefault(), s.goTo((t(e.currentTarget).data("tc-id") - 1) * s._i1) }), this._n.after(this._m1) } } else this._j1 = !1; this._l.css({ width: h }), this.settings.directionNav && (this._n.after(" "), this.arrowLeft = this.carouselRoot.find(".arrow-holder.left"), this.arrowRight = this.carouselRoot.find(".arrow-holder.right"), 1 > this.arrowLeft.length || 1 > this.arrowRight.length ? this.settings.directionNav = !1 : this.settings.directionNavAutoHide && (this.arrowLeft.hide(), this.arrowRight.hide(), this.carouselRoot.one("mousemove.arrowshover", function () { s.arrowLeft.fadeIn("fast"), s.arrowRight.fadeIn("fast") }), this.carouselRoot.hover(function () { s.arrowLeft.fadeIn("fast"), s.arrowRight.fadeIn("fast") }, function () { s.arrowLeft.fadeOut("fast"), s.arrowRight.fadeOut("fast") })), this._p1(0), this.settings.directionNav && (this.arrowRight.click(function (t) { t.preventDefault(), (s.settings.loopItems && !s._u || !s._f1) && s.next() }), this.arrowLeft.click(function (t) { t.preventDefault(), (s.settings.loopItems && !s._u || !s._e1) && s.prev() }))), this.carouselWidth, this._q1 = "onorientationchange" in window ? "orientationchange.touchcarousel" : "resize.touchcarousel", t(window).bind(this._q1, function () { c && clearTimeout(c), c = setTimeout(function () { s.updateCarouselSize(!1) }, 100) }), this.settings.scrollbar ? (this._r1 = t("
    "), this._r1.appendTo(this.carouselRoot), this.scrollbarJQ = this._r1.find(".scrollbar"), this._s1 = "", this._t1 = this.scrollbarJQ[0].style, this._u1 = 0, this.settings.scrollbarAutoHide ? (this._v1 = !1, this.scrollbarJQ.css("opacity", 0)) : this._v1 = !0) : this.settings.scrollbarAutoHide = !1, this.updateCarouselSize(!0), this._n.bind(this._c, function (t) { s._w1(t) }), this.settings.autoplay && 0 < this.settings.autoplayDelay ? (this._x1 = !1, this.autoplayTimer = "", this.wasAutoplayRunning = !0, this.hasTouch || this.carouselRoot.hover(function () { s._x1 = !0, s._y1() }, function () { s._x1 = !1, s._z1() }), this.autoplay = !0, this._a2()) : this.autoplay = !1, this.settings.keyboardNav && t(document).bind("keydown.touchcarousel", function (t) { s._u || (37 === t.keyCode ? s.prev() : 39 === t.keyCode && s.next()) }), this.carouselRoot.css("overflow", "visible") } e.prototype = { goTo: function (t, e) { var i = this.items[t]; i && (!e && this.autoplay && this.settings.autoplayStopAtAction && this.stopAutoplay(), this._b2(t), this.endPos = this._c2(), (i = -i.posX) > 0 ? i = 0 : i < this.carouselWidth - this._h1 && (i = this.carouselWidth - this._h1), this.animateTo(i, this.settings.transitionSpeed, "easeInOutSine")) }, next: function (t) { var e = this._c2(), i = this._d2(e).index; this._j1 ? i = (e = this._l1 + 1) > this._k1 - 1 ? this.settings.loopItems ? 0 : (this._k1 - 1) * this._i1 : e * this._i1 : (i += this._i1, this.settings.loopItems && e <= this.carouselWidth - this._h1 && (i = 0), i > this.numItems - 1 && (i = this.numItems - 1)), this.goTo(i, t) }, prev: function (t) { var e = this._c2(), i = this._d2(e).index; this._j1 ? i = 0 > (e = this._l1 - 1) ? this.settings.loopItems ? (this._k1 - 1) * this._i1 : 0 : e * this._i1 : 0 > (i -= this._i1) && (i = this.settings.loopItems ? 0 > e ? 0 : this.numItems - 1 : 0), this.goTo(i, t) }, getCurrentId: function () { return this._d2(this._c2()).index }, setXPos: function (t, e) { e ? this._t1[this._b1] = this._c1 + t + this._d1 : this._m[this._b1] = this._c1 + t + this._d1 }, stopAutoplay: function () { this._y1(), this.wasAutoplayRunning = this.autoplay = !1 }, resumeAutoplay: function () { this.autoplay = !0, this.wasAutoplayRunning || this._z1() }, updateCarouselSize: function (t) { if (this.carouselWidth = this.carouselRoot.width(), this.settings.scrollToLast) { var e = 0; if (this._j1) { var i = this.numItems % this._i1; if (i > 0) for (i = this.numItems - i; i < this.numItems; i++) e += this.items[i].width; else e = this.carouselWidth } else e = this.items[this.numItems - 1].width; this._h1 = this._f + this.carouselWidth - e } else this._h1 = this._f; if (this.settings.scrollbar && (e = Math.round(this._r1.width() / (this._h1 / this.carouselWidth)), this.scrollbarJQ.css("width", e), this._u1 = this._r1.width() - e), !this.settings.scrollToLast) { if (this.carouselWidth >= this._f) return this._v = !0, this.settings.loopItems || (this._f1 = !0, this.arrowRight.addClass("disabled"), this._e1 = !0, this.arrowLeft.addClass("disabled")), void this.setXPos(0); this._v && (this._e1 = this._f1 = this._v = !1, this.arrowRight.removeClass("disabled"), this.arrowLeft.removeClass("disabled")) } t || ((t = this.endPos = this._c2()) > 0 ? t = 0 : t < this.carouselWidth - this._h1 && (t = this.carouselWidth - this._h1), this.animateTo(t, 300, "easeInOutSine")) }, animateTo: function (e, i, n, o, s, a, r) { function l() { u._b = !1, u._a2(), u.settings.scrollbarAutoHide && u._g2(), null !== u.settings.onAnimComplete && u.settings.onAnimComplete.call(u) } null !== this.settings.onAnimStart && this.settings.onAnimStart.call(this), this.autoplay && this.autoplayTimer && (this.wasAutoplayRunning = !0, this._y1()), this._e2(); var u = this, c = this.settings.scrollbar, h = u._b1, d = u._c1, p = u._d1, m = { containerPos: this.endPos }, f = { containerPos: e }, g = { containerPos: s }; s = o ? s : e; var v = u._m; if (u._b = !0, c) { var _ = this._t1, w = u._h1 - u.carouselWidth; this.settings.scrollbarAutoHide && (this._v1 || this._f2()) } this._p1(s), this._p = t(m).animate(f, { duration: i, easing: n, step: function () { c && (_[h] = d + Math.round(u._u1 * (-this.containerPos / w)) + p), v[h] = d + Math.round(this.containerPos) + p }, complete: function () { o ? u._p = t(f).animate(g, { duration: a, easing: r, step: function () { c && (_[h] = d + Math.round(u._u1 * (-this.containerPos / w)) + p), v[h] = d + Math.round(this.containerPos) + p }, complete: function () { c && (_[h] = d + Math.round(u._u1 * (-g.containerPos / w)) + p), v[h] = d + Math.round(g.containerPos) + p, l() } }) : (c && (_[h] = d + Math.round(u._u1 * (-f.containerPos / w)) + p), v[h] = d + Math.round(f.containerPos) + p, l()) } }) }, destroy: function () { this.stopAutoplay(), this._n.unbind(this._c), t(document).unbind(this._d).unbind(this._e), t(window).unbind(this._q1), this.settings.keyboardNav && t(document).unbind("keydown.touchcarousel"), this.carouselRoot.remove() }, _b2: function (t) { this._j1 && (this._l1 = t = this._h2(t), this.settings.pagingNavControls && (this._n1.removeClass("current"), this._n1.eq(t).addClass("current"))) }, _h2: function (t) { for (var e = this._i1, i = 0; i < this._k1; i++) if (t >= i * e && i * e + e > t) return i; return 0 > t ? 0 : t >= this._k1 && this._k1 - 1 }, _i2: function () { this.settings.loopItems || (this._e1 ? (this._e1 = !1, this.arrowLeft.removeClass("disabled")) : this._f1 && (this._f1 = !1, this.arrowRight.removeClass("disabled"))) }, _o1: function () { !this._e1 && !this.settings.loopItems && (this._e1 = !0, this.arrowLeft.addClass("disabled"), this._f1 && (this._f1 = !1, this.arrowRight.removeClass("disabled"))) }, _j2: function () { !this._f1 && !this.settings.loopItems && (this._f1 = !0, this.arrowRight.addClass("disabled"), this._e1 && (this._e1 = !1, this.arrowLeft.removeClass("disabled"))) }, _d2: function (t) { t = -t; for (var e, i = 0; i < this.numItems; i++) if (t >= (e = this.items[i]).posX && t < e.posX + e.width) return e; return -1 }, _a2: function () { this.autoplay && this.wasAutoplayRunning && (this._x1 || this._z1(), this.wasAutoplayRunning = !1) }, _g2: function () { var t = this; this._v1 = !1, this._s1 && clearTimeout(this._s1), this._s1 = setTimeout(function () { t.scrollbarJQ.animate({ opacity: 0 }, 150, "linear") }, 450) }, _f2: function () { this._v1 = !0, this._s1 && clearTimeout(this._s1), this.scrollbarJQ.stop().animate({ opacity: 1 }, 150, "linear") }, _e2: function () { this._p && this._p.stop() }, _z1: function () { if (this.autoplay) { var t = this; this.autoplayTimer || (this.autoplayTimer = setInterval(function () { !t._k2 && !t._b && t.next(!0) }, this.settings.autoplayDelay)) } }, _y1: function () { this.autoplayTimer && (clearInterval(this.autoplayTimer), this.autoplayTimer = "") }, _c2: function (t) { return t = t ? this.scrollbarJQ : this._l, this._w ? (t = t.css("-webkit-transform").replace(/^matrix\(/i, "").split(/, |\)$/g), parseInt(t[4], 10)) : Math.round(t.position().left) }, _w1: function (e) { if (!this._k2) { var i; if (this.autoplay && this.settings.autoplayStopAtAction && this.stopAutoplay(), this._e2(), this.settings.scrollbarAutoHide && this._f2(), this.hasTouch) { if (this._a = !1, !((i = e.originalEvent.touches) && 0 < i.length)) return !1; i = i[0] } else i = e, e.preventDefault(); this._l2(), this._k2 = !0; var n = this; this._w && n._l.css({ "-webkit-transition-duration": "0", "-webkit-transition-property": "none" }), t(document).bind(this._d, function (t) { n._m2(t) }), t(document).bind(this._e, function (t) { n._n2(t) }), this._o2 = this._c2(), this._i = i.clientX, this._q = !1, this._k = e.timeStamp || (new Date).getTime(), this._t = 0, this._s = this._r = i.clientX, this._p2 = i.clientY } }, _m2: function (t) { var e, i = t.timeStamp || (new Date).getTime(); if (this.hasTouch) { if (this._a) return !1; if (1 < (e = t.originalEvent.touches).length) return !1; if (e = e[0], Math.abs(e.clientY - this._p2) > Math.abs(e.clientX - this._r) + 3) return this.settings.lockAxis && (this._a = !0), !1 } else e = t; if (t.preventDefault(), this._j = e.clientX, this._q2 = this._r2, t = e.clientX - this._s, this._q2 != t && (this._r2 = t), 0 != t) { var n = this._o2 + this._t; n >= 0 ? (t /= 4, this._o1()) : n <= this.carouselWidth - this._h1 ? (this._j2(), t /= 4) : this._i2(), this._t += t, this.setXPos(n), this.settings.scrollbar && this.setXPos(this._u1 * (-n / (this._h1 - this.carouselWidth)), !0) } return this._s = e.clientX, 350 < i - this._k && (this._k = i, this._i = e.clientX), null !== this.settings.onDragStart && this.settings.onDragStart.call(this), !1 }, _n2: function (e) { if (this._k2) { var i = this; if (this._k2 = !1, this._a1(), this.endPos = this._c2(), this.isdrag = !1, t(document).unbind(this._d).unbind(this._e), this.endPos == this._o2) return this._q = !1, void(this.settings.scrollbarAutoHide && this._g2()); this._q = !0; var n = this._j - this._i; e = Math.max(40, (e.timeStamp || (new Date).getTime()) - this._k); var o = .5; e = Math.abs(n) / e; var s = function (t) { return t > 0 ? t = 0 : t < i.carouselWidth - i._h1 && (t = i.carouselWidth - i._h1), t }; if (this.settings.snapToItems) { this.autoplay && this.settings.autoplayStopAtAction && this.stopAutoplay(); n = Boolean(0 < this._r - this._s), o = s(this._c2()); var a = this._d2(o).index; this._j1 ? (n && (o = Math.max(o - this.carouselWidth - 1, 1 - i._h1), void 0 === (a = this._d2(o).index) && (a = this.numItems - 1)), a = this._h2(a) * this._i1) : a += n ? this._i1 : 1 - this._i1, a = n ? Math.min(a, this.numItems - 1) : Math.max(a, 0), o = this.items[a], this._b2(a), o && (o = s(-o.posX), s = Math.abs(this.endPos - o), e = Math.max(1.08 * s / e, 150), a = Boolean(180 > e), s *= .08, n && (s *= -1), this.animateTo(a ? o + s : o, Math.min(e, 400), "easeOutSine", a, o, 300, "easeOutCubic")) } else s = 0, 2 >= e ? (o = 3.5 * this._x, s = 0) : e > 2 && 3 >= e ? (o = 4 * this._x, s = 200) : e > 3 && (s = 300, e > 4 && (e = 4, s = 400, o = 6 * this._x), o = 5 * this._x), n = 2 * e * e / (2 * o) * (0 > n ? -1 : 1), o = 2 * e / o + s, 0 < this.endPos + n ? 0 < this.endPos ? this.animateTo(0, 800, "easeOutCubic") : this.animateTo(this.carouselWidth / 10 * ((s + 200) / 1e3), 1.1 * Math.abs(this.endPos) / e, "easeOutSine", !0, 0, 400, "easeOutCubic") : this.endPos + n < this.carouselWidth - this._h1 ? this.endPos < this.carouselWidth - this._h1 ? this.animateTo(this.carouselWidth - this._h1, 800, "easeOutCubic") : this.animateTo(this.carouselWidth - this._h1 - this.carouselWidth / 10 * ((s + 200) / 1e3), 1.1 * Math.abs(this.carouselWidth - this._h1 - this.endPos) / e, "easeOutSine", !0, this.carouselWidth - this._h1, 400, "easeOutCubic") : this.animateTo(this.endPos + n, o, "easeOutCubic"); null !== this.settings.onDragRelease && this.settings.onDragRelease.call(this) } return !1 }, _p1: function (t) { void 0 === t && (t = this._c2()), this.settings.loopItems || (t >= 0 ? this._o1() : t <= this.carouselWidth - this._h1 ? this._j2() : this._i2()) }, _a1: function () { this._y ? this._n.css("cursor", this._y) : (this._n.removeClass("grabbing-cursor"), this._n.addClass("grab-cursor")) }, _l2: function () { this._z ? this._n.css("cursor", this._z) : (this._n.removeClass("grab-cursor"), this._n.addClass("grabbing-cursor")) } }, t.fn.touchCarousel = function (i) { return this.each(function () { var n = new e(t(this), i); t(this).data("touchCarousel", n) }) }, t.fn.touchCarousel.defaults = { itemsPerMove: 1, snapToItems: !1, pagingNav: !1, pagingNavControls: !0, autoplay: !1, autoplayDelay: 3e3, autoplayStopAtAction: !0, scrollbar: !0, scrollbarAutoHide: !1, scrollbarTheme: "dark", transitionSpeed: 600, directionNav: !0, directionNavAutoHide: !1, loopItems: !1, keyboardNav: !1, dragUsingMouse: !0, scrollToLast: !1, itemFallbackWidth: 500, baseMouseFriction: .0012, baseTouchFriction: 8e-4, lockAxis: !0, useWebkit3d: !1, onAnimStart: null, onAnimComplete: null, onDragStart: null, onDragRelease: null }, t.fn.touchCarousel.settings = {}, t.extend(jQuery.easing, { easeInOutSine: function (t, e, i, n, o) { return -n / 2 * (Math.cos(Math.PI * e / o) - 1) + i }, easeOutSine: function (t, e, i, n, o) { return n * Math.sin(e / o * (Math.PI / 2)) + i }, easeOutCubic: function (t, e, i, n, o) { return n * ((e = e / o - 1) * e * e + 1) + i } }) } (losjqisafe), function () { if (navigator.userAgent.match(/OS 6(_\d)+/i) && void 0 === window.getTimeouts) { var t = {}, e = {}, i = window.setTimeout, n = window.setInterval, o = window.clearTimeout, s = window.clearInterval, a = function (o, s, a, r) { if (a) { var l, u = function () { var t = (new Date).getTime(); !1 !== d[l].loop ? (d[l].requestededFrame = webkitRequestAnimationFrame(u), d[l].loop = c >= t) : (d[l].callback && d[l].callback(), h ? (c = (new Date).getTime() + s, d[l].loop = c >= t, d[l].requestedFrame = webkitRequestAnimationFrame(u)) : delete d[l]) }; a = o.name || "rafTimer" + Math.floor(1e3 * Math.random()); var c = (new Date).getTime() + s, h = r || !1, d = h ? e : t; return d[l = a + "" + c] = {}, d[l].loop = !0, d[l].callback = o, u(), l } return r ? n(o, s) : i(o, s) }, r = function (i, n) { var a; return i.indexOf && -1 < i.indexOf("rafTimer") ? ((a = n ? e : t)[i] ? (a[i].callback = void 0, a[i].loop = !1, a = !0) : a = !1, a) : n ? s(i) : o(i) }; window.getTimeouts = function () { return { timeouts: t, intervals: e } }, window.setTimeout = function (t, e) { return a(t, e, !0) }, window.setInterval = function (t, e) { return a(t, e, !0, !0) }, window.clearTimeout = function (t) { return r(t) }, window.clearInterval = function (t) { return r(t, !0) } } } (); !function (a, b, c, d) { c.swipebox = function (e, f) { var g, h, i = { useCSS: !0, useSVG: !0, initialIndexOnArray: 0, removeBarsOnMobile: !0, hideCloseButtonOnMobile: !1, hideBarsDelay: 0, videoMaxWidth: 1140, vimeoColor: "cccccc", beforeOpen: null, afterOpen: null, afterClose: null, nextSlide: null, prevSlide: null, loopAtEnd: !1, autoplayVideos: !1, queryStringData: {}, toggleClassOnLoad: "" }, j = this, k = [], l = e.selector, m = c(l), n = navigator.userAgent.match(/(iPad)|(iPhone)|(iPod)|(Android)|(PlayBook)|(BB10)|(BlackBerry)|(Opera Mini)|(IEMobile)|(webOS)|(MeeGo)/i), o = null !== n || b.createTouch !== d || "ontouchstart" in a || "onmsgesturechange" in a || navigator.msMaxTouchPoints, p = !!b.createElementNS && !!b.createElementNS("http://www.w3.org/2000/svg", "svg").createSVGRect, q = a.innerWidth ? a.innerWidth : c(a).width(), r = a.innerHeight ? a.innerHeight : c(a).height(), s = 0, t = '
    '; j.settings = {}, c.swipebox.close = function () { g.closeSlide() }, c.swipebox.extend = function () { return g }, j.init = function () { j.settings = c.extend({}, i, f), c.isArray(e) ? (k = e, g.target = c(a), g.init(j.settings.initialIndexOnArray)) : c(b).on("click", l, function (a) { if ("slide current" === a.target.parentNode.className) return !1; c.isArray(e) || (g.destroy(), h = c(l), g.actions()), k = []; var b, d, f; f || (d = "data-rel", f = c(this).attr(d)), f || (d = "rel", f = c(this).attr(d)), h = f && "" !== f && "nofollow" !== f ? m.filter("[" + d + '="' + f + '"]') : c(l), h.each(function () { var a = null, b = null; c(this).attr("title") && (a = c(this).attr("title")), c(this).attr("href") && (b = c(this).attr("href")), k.push({ href: b, title: a }) }), b = h.index(c(this)), a.preventDefault(), a.stopPropagation(), g.target = c(a.target), g.init(b) }) }, g = { init: function (a) { j.settings.beforeOpen && j.settings.beforeOpen(), this.target.trigger("swipebox-start"), c.swipebox.isOpen = !0, this.build(), this.openSlide(a), this.openMedia(a), this.preloadMedia(a + 1), this.preloadMedia(a - 1), j.settings.afterOpen && j.settings.afterOpen() }, build: function () { var a, b = this; c("body").append(t), p && j.settings.useSVG === !0 && (a = c("#swipebox-close").css("background-image"), a = a.replace("png", "svg"), c("#swipebox-prev, #swipebox-next, #swipebox-close").css({ "background-image": a })), n && j.settings.removeBarsOnMobile && c("#swipebox-bottom-bar, #swipebox-top-bar").remove(), c.each(k, function () { c("#swipebox-slider").append('
    ') }), b.setDim(), b.actions(), o && b.gesture(), b.keyboard(), b.animBars(), b.resize() }, setDim: function () { var b, d, e = {}; "onorientationchange" in a ? a.addEventListener("orientationchange", function () { 0 === a.orientation ? (b = q, d = r) : (90 === a.orientation || -90 === a.orientation) && (b = r, d = q) }, !1) : (b = a.innerWidth ? a.innerWidth : c(a).width(), d = a.innerHeight ? a.innerHeight : c(a).height()), e = { width: b, height: d }, c("#swipebox-overlay").css(e) }, resize: function () { var b = this; c(a).resize(function () { b.setDim() }).resize() }, supportTransition: function () { var a, c = "transition WebkitTransition MozTransition OTransition msTransition KhtmlTransition".split(" "); for (a = 0; a < c.length; a++) if (b.createElement("div").style[c[a]] !== d) return c[a]; return !1 }, doCssTrans: function () { return j.settings.useCSS && this.supportTransition() ? !0 : void 0 }, gesture: function () { var a, b, d, e, f, g, h = this, i = !1, j = !1, l = 10, m = 50, n = {}, o = {}, p = c("#swipebox-top-bar, #swipebox-bottom-bar"), r = c("#swipebox-slider"); p.addClass("visible-bars"), h.setTimeout(), c("body").bind("touchstart", function (h) { return c(this).addClass("touching"), a = c("#swipebox-slider .slide").index(c("#swipebox-slider .slide.current")), o = h.originalEvent.targetTouches[0], n.pageX = h.originalEvent.targetTouches[0].pageX, n.pageY = h.originalEvent.targetTouches[0].pageY, c("#swipebox-slider").css({ "-webkit-transform": "translate3d(" + s + "%, 0, 0)", transform: "translate3d(" + s + "%, 0, 0)" }), c(".touching").bind("touchmove", function (h) { if (h.preventDefault(), h.stopPropagation(), o = h.originalEvent.targetTouches[0], !j && (f = d, d = o.pageY - n.pageY, Math.abs(d) >= m || i)) { var p = .75 - Math.abs(d) / r.height(); r.css({ top: d + "px" }), r.css({ opacity: p }), i = !0 } e = b, b = o.pageX - n.pageX, g = 100 * b / q, !j && !i && Math.abs(b) >= l && (c("#swipebox-slider").css({ "-webkit-transition": "", transition: "" }), j = !0), j && (b > 0 ? 0 === a ? c("#swipebox-overlay").addClass("leftSpringTouch") : (c("#swipebox-overlay").removeClass("leftSpringTouch").removeClass("rightSpringTouch"), c("#swipebox-slider").css({ "-webkit-transform": "translate3d(" + (s + g) + "%, 0, 0)", transform: "translate3d(" + (s + g) + "%, 0, 0)" })) : 0 > b && (k.length === a + 1 ? c("#swipebox-overlay").addClass("rightSpringTouch") : (c("#swipebox-overlay").removeClass("leftSpringTouch").removeClass("rightSpringTouch"), c("#swipebox-slider").css({ "-webkit-transform": "translate3d(" + (s + g) + "%, 0, 0)", transform: "translate3d(" + (s + g) + "%, 0, 0)" })))) }), !1 }).bind("touchend", function (a) { if (a.preventDefault(), a.stopPropagation(), c("#swipebox-slider").css({ "-webkit-transition": "-webkit-transform 0.4s ease", transition: "transform 0.4s ease" }), d = o.pageY - n.pageY, b = o.pageX - n.pageX, g = 100 * b / q, i) if (i = !1, Math.abs(d) >= 2 * m && Math.abs(d) > Math.abs(f)) { var k = d > 0 ? r.height() : -r.height(); r.animate({ top: k + "px", opacity: 0 }, 300, function () { h.closeSlide() }) } else r.animate({ top: 0, opacity: 1 }, 300); else j ? (j = !1, b >= l && b >= e ? h.getPrev() : -l >= b && e >= b && h.getNext()) : p.hasClass("visible-bars") ? (h.clearTimeout(), h.hideBars()) : (h.showBars(), h.setTimeout()); c("#swipebox-slider").css({ "-webkit-transform": "translate3d(" + s + "%, 0, 0)", transform: "translate3d(" + s + "%, 0, 0)" }), c("#swipebox-overlay").removeClass("leftSpringTouch").removeClass("rightSpringTouch"), c(".touching").off("touchmove").removeClass("touching") }) }, setTimeout: function () { if (j.settings.hideBarsDelay > 0) { var b = this; b.clearTimeout(), b.timeout = a.setTimeout(function () { b.hideBars() }, j.settings.hideBarsDelay) } }, clearTimeout: function () { a.clearTimeout(this.timeout), this.timeout = null }, showBars: function () { var a = c("#swipebox-top-bar, #swipebox-bottom-bar"); this.doCssTrans() ? a.addClass("visible-bars") : (c("#swipebox-top-bar").animate({ top: 0 }, 500), c("#swipebox-bottom-bar").animate({ bottom: 0 }, 500), setTimeout(function () { a.addClass("visible-bars") }, 1e3)) }, hideBars: function () { var a = c("#swipebox-top-bar, #swipebox-bottom-bar"); this.doCssTrans() ? a.removeClass("visible-bars") : (c("#swipebox-top-bar").animate({ top: "-50px" }, 500), c("#swipebox-bottom-bar").animate({ bottom: "-50px" }, 500), setTimeout(function () { a.removeClass("visible-bars") }, 1e3)) }, animBars: function () { var a = this, b = c("#swipebox-top-bar, #swipebox-bottom-bar"); b.addClass("visible-bars"), a.setTimeout(), c("#swipebox-slider").click(function () { b.hasClass("visible-bars") || (a.showBars(), a.setTimeout()) }), c("#swipebox-bottom-bar").hover(function () { a.showBars(), b.addClass("visible-bars"), a.clearTimeout() }, function () { j.settings.hideBarsDelay > 0 && (b.removeClass("visible-bars"), a.setTimeout()) }) }, keyboard: function () { var b = this; c(a).bind("keyup", function (a) { a.preventDefault(), a.stopPropagation(), 37 === a.keyCode ? b.getPrev() : 39 === a.keyCode ? b.getNext() : 27 === a.keyCode && b.closeSlide() }) }, actions: function () { var a = this, b = "touchend click"; k.length < 2 ? (c("#swipebox-bottom-bar").hide(), d === k[1] && c("#swipebox-top-bar").hide()) : (c("#swipebox-prev").bind(b, function (b) { b.preventDefault(), b.stopPropagation(), a.getPrev(), a.setTimeout() }), c("#swipebox-next").bind(b, function (b) { b.preventDefault(), b.stopPropagation(), a.getNext(), a.setTimeout() })), c("#swipebox-close").bind(b, function () { a.closeSlide() }) }, setSlide: function (a, b) { b = b || !1; var d = c("#swipebox-slider"); s = 100 * -a, this.doCssTrans() ? d.css({ "-webkit-transform": "translate3d(" + 100 * -a + "%, 0, 0)", transform: "translate3d(" + 100 * -a + "%, 0, 0)" }) : d.animate({ left: 100 * -a + "%" }), c("#swipebox-slider .slide").removeClass("current"), c("#swipebox-slider .slide").eq(a).addClass("current"), this.setTitle(a), b && d.fadeIn(), c("#swipebox-prev, #swipebox-next").removeClass("disabled"), 0 === a ? c("#swipebox-prev").addClass("disabled") : a === k.length - 1 && j.settings.loopAtEnd !== !0 && c("#swipebox-next").addClass("disabled") }, openSlide: function (b) { c("html").addClass("swipebox-html"), o ? (c("html").addClass("swipebox-touch"), j.settings.hideCloseButtonOnMobile && c("html").addClass("swipebox-no-close-button")) : c("html").addClass("swipebox-no-touch"), c(a).trigger("resize"), this.setSlide(b, !0) }, preloadMedia: function (a) { var b = this, c = null; k[a] !== d && (c = k[a].href), b.isVideo(c) ? b.openMedia(a) : setTimeout(function () { b.openMedia(a) }, 1e3) }, openMedia: function (a) { var b, e, f = this; return k[a] !== d && (b = k[a].href), 0 > a || a >= k.length ? !1 : (e = c("#swipebox-slider .slide").eq(a), void(f.isVideo(b) ? e.html(f.getVideo(b)) : (e.addClass("slide-loading"), f.loadMedia(b, function () { e.removeClass("slide-loading"), e.html(this) })))) }, setTitle: function (a) { var b = null; c("#swipebox-title").empty(), k[a] !== d && (b = k[a].title), b ? (c("#swipebox-top-bar").show(), c("#swipebox-title").append(b)) : c("#swipebox-top-bar").hide() }, isVideo: function (a) { if (a) { if (a.match(/(youtube\.com|youtube-nocookie\.com)\/watch\?v=([a-zA-Z0-9\-_]+)/) || a.match(/vimeo\.com\/([0-9]*)/) || a.match(/youtu\.be\/([a-zA-Z0-9\-_]+)/)) return !0; if (a.toLowerCase().indexOf("swipeboxvideo=1") >= 0) return !0 } }, parseUri: function (a, d) { var e = b.createElement("a"), f = {}; return e.href = decodeURIComponent(a), e.search && (f = JSON.parse('{"' + e.search.toLowerCase().replace("?", "").replace(/&/g, '","').replace(/=/g, '":"') + '"}')), c.isPlainObject(d) && (f = c.extend(f, d, j.settings.queryStringData)), c.map(f, function (a, b) { return a && a > "" ? encodeURIComponent(b) + "=" + encodeURIComponent(a) : void 0 }).join("&") }, getVideo: function (a) { var b = "", c = a.match(/((?:www\.)?youtube\.com|(?:www\.)?youtube-nocookie\.com)\/watch\?v=([a-zA-Z0-9\-_]+)/), d = a.match(/(?:www\.)?youtu\.be\/([a-zA-Z0-9\-_]+)/), e = a.match(/(?:www\.)?vimeo\.com\/([0-9]*)/), f = ""; return c || d ? (d && (c = d), f = g.parseUri(a, { autoplay: j.settings.autoplayVideos ? "1" : "0", v: "" }), b = '') : e ? (f = g.parseUri(a, { autoplay: j.settings.autoplayVideos ? "1" : "0", byline: "0", portrait: "0", color: j.settings.vimeoColor }), b = '') : b = '', '
    ' + b + "
    " }, loadMedia: function (a, b) { if (0 === a.trim().indexOf("#")) b.call(c("
    ", { "class": "swipebox-inline-container" }).append(c(a).clone().toggleClass(j.settings.toggleClassOnLoad))); else if (!this.isVideo(a)) { var d = c("").on("load", function () { b.call(d) }); d.attr("src", a) } }, getNext: function () { var a, b = this, d = c("#swipebox-slider .slide").index(c("#swipebox-slider .slide.current")); d + 1 < k.length ? (a = c("#swipebox-slider .slide").eq(d).contents().find("iframe").attr("src"), c("#swipebox-slider .slide").eq(d).contents().find("iframe").attr("src", a), d++, b.setSlide(d), b.preloadMedia(d + 1), j.settings.nextSlide && j.settings.nextSlide()) : j.settings.loopAtEnd === !0 ? (a = c("#swipebox-slider .slide").eq(d).contents().find("iframe").attr("src"), c("#swipebox-slider .slide").eq(d).contents().find("iframe").attr("src", a), d = 0, b.preloadMedia(d), b.setSlide(d), b.preloadMedia(d + 1), j.settings.nextSlide && j.settings.nextSlide()) : (c("#swipebox-overlay").addClass("rightSpring"), setTimeout(function () { c("#swipebox-overlay").removeClass("rightSpring") }, 500)) }, getPrev: function () { var a, b = c("#swipebox-slider .slide").index(c("#swipebox-slider .slide.current")); b > 0 ? (a = c("#swipebox-slider .slide").eq(b).contents().find("iframe").attr("src"), c("#swipebox-slider .slide").eq(b).contents().find("iframe").attr("src", a), b--, this.setSlide(b), this.preloadMedia(b - 1), j.settings.prevSlide && j.settings.prevSlide()) : (c("#swipebox-overlay").addClass("leftSpring"), setTimeout(function () { c("#swipebox-overlay").removeClass("leftSpring") }, 500)) }, nextSlide: function () {}, prevSlide: function () {}, closeSlide: function () { c("html").removeClass("swipebox-html"), c("html").removeClass("swipebox-touch"), c(a).trigger("resize"), this.destroy() }, destroy: function () { c(a).unbind("keyup"), c("body").unbind("touchstart"), c("body").unbind("touchmove"), c("body").unbind("touchend"), c("#swipebox-slider").unbind(), c("#swipebox-overlay").remove(), c.isArray(e) || e.removeData("_swipebox"), this.target && this.target.trigger("swipebox-destroy"), c.swipebox.isOpen = !1, j.settings.afterClose && j.settings.afterClose() } }, j.init() }, c.fn.swipebox = function (a) { if (!c.data(this, "_swipebox")) { var b = new c.swipebox(this, a); this.data("_swipebox", b) } return this.data("_swipebox") } } (window, document, losjqisafe); !function (i) { "use strict"; var e = window.Slick || {}; (e = function () { var e = 0; return function (t, o) { var s, n = this; n.defaults = { accessibility: !0, adaptiveHeight: !1, appendArrows: i(t), appendDots: i(t), arrows: !0, asNavFor: null, prevArrow: '', nextArrow: '', autoplay: !1, autoplaySpeed: 3e3, centerMode: !1, centerPadding: "50px", cssEase: "ease", customPaging: function (i, e) { return '" }, dots: !1, dotsClass: "slick-dots", draggable: !0, easing: "linear", edgeFriction: .35, fade: !1, focusOnSelect: !1, infinite: !0, initialSlide: 0, lazyLoad: "ondemand", mobileFirst: !1, pauseOnHover: !0, pauseOnDotsHover: !1, respondTo: "window", responsive: null, rows: 1, rtl: !1, slide: "", slidesPerRow: 1, slidesToShow: 1, slidesToScroll: 1, speed: 500, swipe: !0, swipeToSlide: !1, touchMove: !0, touchThreshold: 5, useCSS: !0, useTransform: !1, variableWidth: !1, vertical: !1, verticalSwiping: !1, waitForAnimate: !0, zIndex: 1e3 }, n.initials = { animating: !1, dragging: !1, autoPlayTimer: null, currentDirection: 0, currentLeft: null, currentSlide: 0, direction: 1, $dots: null, listWidth: null, listHeight: null, loadIndex: 0, $nextArrow: null, $prevArrow: null, slideCount: null, slideWidth: null, $slideTrack: null, $slides: null, sliding: !1, slideOffset: 0, swipeLeft: null, $list: null, touchObject: {}, transformsEnabled: !1, unslicked: !1 }, i.extend(n, n.initials), n.activeBreakpoint = null, n.animType = null, n.animProp = null, n.breakpoints = [], n.breakpointSettings = [], n.cssTransitions = !1, n.hidden = "hidden", n.paused = !1, n.positionProp = null, n.respondTo = null, n.rowCount = 1, n.shouldClick = !0, n.$slider = i(t), n.$slidesCache = null, n.transformType = null, n.transitionType = null, n.visibilityChange = "visibilitychange", n.windowWidth = 0, n.windowTimer = null, s = i(t).data("slick") || {}, n.options = i.extend({}, n.defaults, s, o), n.currentSlide = n.options.initialSlide, n.originalSettings = n.options, void 0 !== document.mozHidden ? (n.hidden = "mozHidden", n.visibilityChange = "mozvisibilitychange") : void 0 !== document.webkitHidden && (n.hidden = "webkitHidden", n.visibilityChange = "webkitvisibilitychange"), n.autoPlay = i.proxy(n.autoPlay, n), n.autoPlayClear = i.proxy(n.autoPlayClear, n), n.changeSlide = i.proxy(n.changeSlide, n), n.clickHandler = i.proxy(n.clickHandler, n), n.selectHandler = i.proxy(n.selectHandler, n), n.setPosition = i.proxy(n.setPosition, n), n.swipeHandler = i.proxy(n.swipeHandler, n), n.dragHandler = i.proxy(n.dragHandler, n), n.keyHandler = i.proxy(n.keyHandler, n), n.autoPlayIterator = i.proxy(n.autoPlayIterator, n), n.instanceUid = e++, n.htmlExpr = /^(?:\s*(<[\w\W]+>)[^>]*)$/, n.registerBreakpoints(), n.init(!0), n.checkResponsive(!0) } } (losjqisafe)).prototype.addSlide = e.prototype.slickAdd = function (e, t, o) { var s = this; if ("boolean" == typeof t) o = t, t = null; else if (0 > t || t >= s.slideCount) return !1; s.unload(), "number" == typeof t ? 0 === t && 0 === s.$slides.length ? i(e).appendTo(s.$slideTrack) : o ? i(e).insertBefore(s.$slides.eq(t)) : i(e).insertAfter(s.$slides.eq(t)) : !0 === o ? i(e).prependTo(s.$slideTrack) : i(e).appendTo(s.$slideTrack), s.$slides = s.$slideTrack.children(this.options.slide), s.$slideTrack.children(this.options.slide).detach(), s.$slideTrack.append(s.$slides), s.$slides.each(function (e, t) { i(t).attr("data-slick-index", e) }), s.$slidesCache = s.$slides, s.reinit() }, e.prototype.animateHeight = function () { var i = this; if (1 === i.options.slidesToShow && !0 === i.options.adaptiveHeight && !1 === i.options.vertical) { var e = i.$slides.eq(i.currentSlide).outerHeight(!0); i.$list.animate({ height: e }, i.options.speed) } }, e.prototype.animateSlide = function (e, t) { var o = {}, s = this; s.animateHeight(), !0 === s.options.rtl && !1 === s.options.vertical && (e = -e), !1 === s.transformsEnabled ? !1 === s.options.vertical ? s.$slideTrack.animate({ left: e }, s.options.speed, s.options.easing, t) : s.$slideTrack.animate({ top: e }, s.options.speed, s.options.easing, t) : !1 === s.cssTransitions ? (!0 === s.options.rtl && (s.currentLeft = -s.currentLeft), i({ animStart: s.currentLeft }).animate({ animStart: e }, { duration: s.options.speed, easing: s.options.easing, step: function (i) { i = Math.ceil(i), !1 === s.options.vertical ? (o[s.animType] = "translate(" + i + "px, 0px)", s.$slideTrack.css(o)) : (o[s.animType] = "translate(0px," + i + "px)", s.$slideTrack.css(o)) }, complete: function () { t && t.call() } })) : (s.applyTransition(), e = Math.ceil(e), !1 === s.options.vertical ? o[s.animType] = "translate3d(" + e + "px, 0px, 0px)" : o[s.animType] = "translate3d(0px," + e + "px, 0px)", s.$slideTrack.css(o), t && setTimeout(function () { s.disableTransition(), t.call() }, s.options.speed)) }, e.prototype.asNavFor = function (e) { var t = this.options.asNavFor; t && null !== t && (t = i(t).not(this.$slider)), null !== t && "object" == typeof t && t.each(function () { var t = i(this).slick("getSlick"); t.unslicked || t.slideHandler(e, !0) }) }, e.prototype.applyTransition = function (i) { var e = this, t = {}; !1 === e.options.fade ? t[e.transitionType] = e.transformType + " " + e.options.speed + "ms " + e.options.cssEase : t[e.transitionType] = "opacity " + e.options.speed + "ms " + e.options.cssEase, !1 === e.options.fade ? e.$slideTrack.css(t) : e.$slides.eq(i).css(t) }, e.prototype.autoPlay = function () { var i = this; i.autoPlayTimer && clearInterval(i.autoPlayTimer), i.slideCount > i.options.slidesToShow && !0 !== i.paused && (i.autoPlayTimer = setInterval(i.autoPlayIterator, i.options.autoplaySpeed)) }, e.prototype.autoPlayClear = function () { this.autoPlayTimer && clearInterval(this.autoPlayTimer) }, e.prototype.autoPlayIterator = function () { var i = this; !1 === i.options.infinite ? 1 === i.direction ? (i.currentSlide + 1 === i.slideCount - 1 && (i.direction = 0), i.slideHandler(i.currentSlide + i.options.slidesToScroll)) : (i.currentSlide - 1 == 0 && (i.direction = 1), i.slideHandler(i.currentSlide - i.options.slidesToScroll)) : i.slideHandler(i.currentSlide + i.options.slidesToScroll) }, e.prototype.buildArrows = function () { var e = this; !0 === e.options.arrows && (e.$prevArrow = i(e.options.prevArrow).addClass("slick-arrow"), e.$nextArrow = i(e.options.nextArrow).addClass("slick-arrow"), e.slideCount > e.options.slidesToShow ? (e.$prevArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"), e.$nextArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"), e.htmlExpr.test(e.options.prevArrow) && e.$prevArrow.prependTo(e.options.appendArrows), e.htmlExpr.test(e.options.nextArrow) && e.$nextArrow.appendTo(e.options.appendArrows), !0 !== e.options.infinite && e.$prevArrow.addClass("slick-disabled").attr("aria-disabled", "true")) : e.$prevArrow.add(e.$nextArrow).addClass("slick-hidden").attr({ "aria-disabled": "true", tabindex: "-1" })) }, e.prototype.buildDots = function () { var e, t, o = this; if (!0 === o.options.dots && o.slideCount > o.options.slidesToShow) { for (t = '
      ', e = 0; e <= o.getDotCount(); e += 1) t += "
    • " + o.options.customPaging.call(this, o, e) + "
    • "; t += "
    ", o.$dots = i(t).appendTo(o.options.appendDots), o.$dots.find("li").first().addClass("slick-active").attr("aria-hidden", "false") } }, e.prototype.buildOut = function () { var e = this; e.$slides = e.$slider.children(e.options.slide + ":not(.slick-cloned)").addClass("slick-slide"), e.slideCount = e.$slides.length, e.$slides.each(function (e, t) { i(t).attr("data-slick-index", e).data("originalStyling", i(t).attr("style") || "") }), e.$slider.addClass("slick-slider"), e.$slideTrack = 0 === e.slideCount ? i('
    ').appendTo(e.$slider) : e.$slides.wrapAll('
    ').parent(), e.$list = e.$slideTrack.wrap('
    ').parent(), e.$slideTrack.css("opacity", 0), (!0 === e.options.centerMode || !0 === e.options.swipeToSlide) && (e.options.slidesToScroll = 1), i("img[data-lazy]", e.$slider).not("[src]").addClass("slick-loading"), e.setupInfinite(), e.buildArrows(), e.buildDots(), e.updateDots(), e.setSlideClasses("number" == typeof e.currentSlide ? e.currentSlide : 0), !0 === e.options.draggable && e.$list.addClass("draggable") }, e.prototype.buildRows = function () { var i, e, t, o, s, n, l, r = this; if (o = document.createDocumentFragment(), n = r.$slider.children(), r.options.rows > 1) { for (l = r.options.slidesPerRow * r.options.rows, s = Math.ceil(n.length / l), i = 0; s > i; i++) { var a = document.createElement("div"); for (e = 0; e < r.options.rows; e++) { var d = document.createElement("div"); for (t = 0; t < r.options.slidesPerRow; t++) { var c = i * l + (e * r.options.slidesPerRow + t); n.get(c) && d.appendChild(n.get(c)) } a.appendChild(d) } o.appendChild(a) } r.$slider.html(o), r.$slider.children().children().children().css({ width: 100 / r.options.slidesPerRow + "%", display: "inline-block" }) } }, e.prototype.checkResponsive = function (e, t) { var o, s, n, l = this, r = !1, a = l.$slider.width(), d = window.innerWidth || i(window).width(); if ("window" === l.respondTo ? n = d : "slider" === l.respondTo ? n = a : "min" === l.respondTo && (n = Math.min(d, a)), l.options.responsive && l.options.responsive.length && null !== l.options.responsive) { for (o in s = null, l.breakpoints) l.breakpoints.hasOwnProperty(o) && (!1 === l.originalSettings.mobileFirst ? n < l.breakpoints[o] && (s = l.breakpoints[o]) : n > l.breakpoints[o] && (s = l.breakpoints[o])); null !== s ? null !== l.activeBreakpoint ? (s !== l.activeBreakpoint || t) && (l.activeBreakpoint = s, "unslick" === l.breakpointSettings[s] ? l.unslick(s) : (l.options = i.extend({}, l.originalSettings, l.breakpointSettings[s]), !0 === e && (l.currentSlide = l.options.initialSlide), l.refresh(e)), r = s) : (l.activeBreakpoint = s, "unslick" === l.breakpointSettings[s] ? l.unslick(s) : (l.options = i.extend({}, l.originalSettings, l.breakpointSettings[s]), !0 === e && (l.currentSlide = l.options.initialSlide), l.refresh(e)), r = s) : null !== l.activeBreakpoint && (l.activeBreakpoint = null, l.options = l.originalSettings, !0 === e && (l.currentSlide = l.options.initialSlide), l.refresh(e), r = s), e || !1 === r || l.$slider.trigger("breakpoint", [l, r]) } }, e.prototype.changeSlide = function (e, t) { var o, s, n = this, l = i(e.target); switch (l.is("a") && e.preventDefault(), l.is("li") || (l = l.closest("li")), o = n.slideCount % n.options.slidesToScroll != 0 ? 0 : (n.slideCount - n.currentSlide) % n.options.slidesToScroll, e.data.message) { case "previous": s = 0 === o ? n.options.slidesToScroll : n.options.slidesToShow - o, n.slideCount > n.options.slidesToShow && n.slideHandler(n.currentSlide - s, !1, t); break; case "next": s = 0 === o ? n.options.slidesToScroll : o, n.slideCount > n.options.slidesToShow && n.slideHandler(n.currentSlide + s, !1, t); break; case "index": var r = 0 === e.data.index ? 0 : e.data.index || l.index() * n.options.slidesToScroll; n.slideHandler(n.checkNavigable(r), !1, t), l.children().trigger("focus"); break; default: return } }, e.prototype.checkNavigable = function (i) { var e, t; if (t = 0, i > (e = this.getNavigableIndexes())[e.length - 1]) i = e[e.length - 1]; else for (var o in e) { if (i < e[o]) { i = t; break } t = e[o] } return i }, e.prototype.cleanUpEvents = function () { var e = this; e.options.dots && null !== e.$dots && (i("li", e.$dots).off("click.slick", e.changeSlide), !0 === e.options.pauseOnDotsHover && !0 === e.options.autoplay && i("li", e.$dots).off("mouseenter.slick", i.proxy(e.setPaused, e, !0)).off("mouseleave.slick", i.proxy(e.setPaused, e, !1))), !0 === e.options.arrows && e.slideCount > e.options.slidesToShow && (e.$prevArrow && e.$prevArrow.off("click.slick", e.changeSlide), e.$nextArrow && e.$nextArrow.off("click.slick", e.changeSlide)), e.$list.off("touchstart.slick mousedown.slick", e.swipeHandler), e.$list.off("touchmove.slick mousemove.slick", e.swipeHandler), e.$list.off("touchend.slick mouseup.slick", e.swipeHandler), e.$list.off("touchcancel.slick mouseleave.slick", e.swipeHandler), e.$list.off("click.slick", e.clickHandler), i(document).off(e.visibilityChange, e.visibility), e.$list.off("mouseenter.slick", i.proxy(e.setPaused, e, !0)), e.$list.off("mouseleave.slick", i.proxy(e.setPaused, e, !1)), !0 === e.options.accessibility && e.$list.off("keydown.slick", e.keyHandler), !0 === e.options.focusOnSelect && i(e.$slideTrack).children().off("click.slick", e.selectHandler), i(window).off("orientationchange.slick.slick-" + e.instanceUid, e.orientationChange), i(window).off("resize.slick.slick-" + e.instanceUid, e.resize), i("[draggable!=true]", e.$slideTrack).off("dragstart", e.preventDefault), i(window).off("load.slick.slick-" + e.instanceUid, e.setPosition), i(document).off("ready.slick.slick-" + e.instanceUid, e.setPosition) }, e.prototype.cleanUpRows = function () { var i, e = this; e.options.rows > 1 && ((i = e.$slides.children().children()).removeAttr("style"), e.$slider.html(i)) }, e.prototype.clickHandler = function (i) { !1 === this.shouldClick && (i.stopImmediatePropagation(), i.stopPropagation(), i.preventDefault()) }, e.prototype.destroy = function (e) { var t = this; t.autoPlayClear(), t.touchObject = {}, t.cleanUpEvents(), i(".slick-cloned", t.$slider).detach(), t.$dots && t.$dots.remove(), t.$prevArrow && t.$prevArrow.length && (t.$prevArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display", ""), t.htmlExpr.test(t.options.prevArrow) && t.$prevArrow.remove()), t.$nextArrow && t.$nextArrow.length && (t.$nextArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display", ""), t.htmlExpr.test(t.options.nextArrow) && t.$nextArrow.remove()), t.$slides && (t.$slides.removeClass("slick-slide slick-active slick-center slick-visible slick-current").removeAttr("aria-hidden").removeAttr("data-slick-index").each(function () { i(this).attr("style", i(this).data("originalStyling")) }), t.$slideTrack.children(this.options.slide).detach(), t.$slideTrack.detach(), t.$list.detach(), t.$slider.append(t.$slides)), t.cleanUpRows(), t.$slider.removeClass("slick-slider"), t.$slider.removeClass("slick-initialized"), t.unslicked = !0, e || t.$slider.trigger("destroy", [t]) }, e.prototype.disableTransition = function (i) { var e = this, t = {}; t[e.transitionType] = "", !1 === e.options.fade ? e.$slideTrack.css(t) : e.$slides.eq(i).css(t) }, e.prototype.fadeSlide = function (i, e) { var t = this; !1 === t.cssTransitions ? (t.$slides.eq(i).css({ zIndex: t.options.zIndex }), t.$slides.eq(i).animate({ opacity: 1 }, t.options.speed, t.options.easing, e)) : (t.applyTransition(i), t.$slides.eq(i).css({ opacity: 1, zIndex: t.options.zIndex }), e && setTimeout(function () { t.disableTransition(i), e.call() }, t.options.speed)) }, e.prototype.fadeSlideOut = function (i) { var e = this; !1 === e.cssTransitions ? e.$slides.eq(i).animate({ opacity: 0, zIndex: e.options.zIndex - 2 }, e.options.speed, e.options.easing) : (e.applyTransition(i), e.$slides.eq(i).css({ opacity: 0, zIndex: e.options.zIndex - 2 })) }, e.prototype.filterSlides = e.prototype.slickFilter = function (i) { var e = this; null !== i && (e.$slidesCache = e.$slides, e.unload(), e.$slideTrack.children(this.options.slide).detach(), e.$slidesCache.filter(i).appendTo(e.$slideTrack), e.reinit()) }, e.prototype.getCurrent = e.prototype.slickCurrentSlide = function () { return this.currentSlide }, e.prototype.getDotCount = function () { var i = this, e = 0, t = 0, o = 0; if (!0 === i.options.infinite) for (; e < i.slideCount; ) ++o, e = t + i.options.slidesToScroll, t += i.options.slidesToScroll <= i.options.slidesToShow ? i.options.slidesToScroll : i.options.slidesToShow; else if (!0 === i.options.centerMode) o = i.slideCount; else for (; e < i.slideCount; ) ++o, e = t + i.options.slidesToScroll, t += i.options.slidesToScroll <= i.options.slidesToShow ? i.options.slidesToScroll : i.options.slidesToShow; return o - 1 }, e.prototype.getLeft = function (i) { var e, t, o, s = this, n = 0; return s.slideOffset = 0, t = s.$slides.first().outerHeight(!0), !0 === s.options.infinite ? (s.slideCount > s.options.slidesToShow && (s.slideOffset = s.slideWidth * s.options.slidesToShow * -1, n = t * s.options.slidesToShow * -1), s.slideCount % s.options.slidesToScroll != 0 && i + s.options.slidesToScroll > s.slideCount && s.slideCount > s.options.slidesToShow && (i > s.slideCount ? (s.slideOffset = (s.options.slidesToShow - (i - s.slideCount)) * s.slideWidth * -1, n = (s.options.slidesToShow - (i - s.slideCount)) * t * -1) : (s.slideOffset = s.slideCount % s.options.slidesToScroll * s.slideWidth * -1, n = s.slideCount % s.options.slidesToScroll * t * -1))) : i + s.options.slidesToShow > s.slideCount && (s.slideOffset = (i + s.options.slidesToShow - s.slideCount) * s.slideWidth, n = (i + s.options.slidesToShow - s.slideCount) * t), s.slideCount <= s.options.slidesToShow && (s.slideOffset = 0, n = 0), !0 === s.options.centerMode && !0 === s.options.infinite ? s.slideOffset += s.slideWidth * Math.floor(s.options.slidesToShow / 2) - s.slideWidth : !0 === s.options.centerMode && (s.slideOffset = 0, s.slideOffset += s.slideWidth * Math.floor(s.options.slidesToShow / 2)), e = !1 === s.options.vertical ? i * s.slideWidth * -1 + s.slideOffset : i * t * -1 + n, !0 === s.options.variableWidth && (o = s.slideCount <= s.options.slidesToShow || !1 === s.options.infinite ? s.$slideTrack.children(".slick-slide").eq(i) : s.$slideTrack.children(".slick-slide").eq(i + s.options.slidesToShow), e = !0 === s.options.rtl ? o[0] ? -1 * (s.$slideTrack.width() - o[0].offsetLeft - o.width()) : 0 : o[0] ? -1 * o[0].offsetLeft : 0, !0 === s.options.centerMode && (o = s.slideCount <= s.options.slidesToShow || !1 === s.options.infinite ? s.$slideTrack.children(".slick-slide").eq(i) : s.$slideTrack.children(".slick-slide").eq(i + s.options.slidesToShow + 1), e = !0 === s.options.rtl ? o[0] ? -1 * (s.$slideTrack.width() - o[0].offsetLeft - o.width()) : 0 : o[0] ? -1 * o[0].offsetLeft : 0, e += (s.$list.width() - o.outerWidth()) / 2)), e }, e.prototype.getOption = e.prototype.slickGetOption = function (i) { return this.options[i] }, e.prototype.getNavigableIndexes = function () { var i, e = this, t = 0, o = 0, s = []; for (!1 === e.options.infinite ? i = e.slideCount : (t = -1 * e.options.slidesToScroll, o = -1 * e.options.slidesToScroll, i = 2 * e.slideCount); i > t; ) s.push(t), t = o + e.options.slidesToScroll, o += e.options.slidesToScroll <= e.options.slidesToShow ? e.options.slidesToScroll : e.options.slidesToShow; return s }, e.prototype.getSlick = function () { return this }, e.prototype.getSlideCount = function () { var e, t, o = this; return t = !0 === o.options.centerMode ? o.slideWidth * Math.floor(o.options.slidesToShow / 2) : 0, !0 === o.options.swipeToSlide ? (o.$slideTrack.find(".slick-slide").each(function (s, n) { return n.offsetLeft - t + i(n).outerWidth() / 2 > -1 * o.swipeLeft ? (e = n, !1) : void 0 }), Math.abs(i(e).attr("data-slick-index") - o.currentSlide) || 1) : o.options.slidesToScroll }, e.prototype.goTo = e.prototype.slickGoTo = function (i, e) { this.changeSlide({ data: { message: "index", index: parseInt(i) } }, e) }, e.prototype.init = function (e) { var t = this; i(t.$slider).hasClass("slick-initialized") || (i(t.$slider).addClass("slick-initialized"), t.buildRows(), t.buildOut(), t.setProps(), t.startLoad(), t.loadSlider(), t.initializeEvents(), t.updateArrows(), t.updateDots()), e && t.$slider.trigger("init", [t]), !0 === t.options.accessibility && t.initADA() }, e.prototype.initArrowEvents = function () { var i = this; !0 === i.options.arrows && i.slideCount > i.options.slidesToShow && (i.$prevArrow.on("click.slick", { message: "previous" }, i.changeSlide), i.$nextArrow.on("click.slick", { message: "next" }, i.changeSlide)) }, e.prototype.initDotEvents = function () { var e = this; !0 === e.options.dots && e.slideCount > e.options.slidesToShow && i("li", e.$dots).on("click.slick", { message: "index" }, e.changeSlide), !0 === e.options.dots && !0 === e.options.pauseOnDotsHover && !0 === e.options.autoplay && i("li", e.$dots).on("mouseenter.slick", i.proxy(e.setPaused, e, !0)).on("mouseleave.slick", i.proxy(e.setPaused, e, !1)) }, e.prototype.initializeEvents = function () { var e = this; e.initArrowEvents(), e.initDotEvents(), e.$list.on("touchstart.slick mousedown.slick", { action: "start" }, e.swipeHandler), e.$list.on("touchmove.slick mousemove.slick", { action: "move" }, e.swipeHandler), e.$list.on("touchend.slick mouseup.slick", { action: "end" }, e.swipeHandler), e.$list.on("touchcancel.slick mouseleave.slick", { action: "end" }, e.swipeHandler), e.$list.on("click.slick", e.clickHandler), i(document).on(e.visibilityChange, i.proxy(e.visibility, e)), e.$list.on("mouseenter.slick", i.proxy(e.setPaused, e, !0)), e.$list.on("mouseleave.slick", i.proxy(e.setPaused, e, !1)), !0 === e.options.accessibility && e.$list.on("keydown.slick", e.keyHandler), !0 === e.options.focusOnSelect && i(e.$slideTrack).children().on("click.slick", e.selectHandler), i(window).on("orientationchange.slick.slick-" + e.instanceUid, i.proxy(e.orientationChange, e)), i(window).on("resize.slick.slick-" + e.instanceUid, i.proxy(e.resize, e)), i("[draggable!=true]", e.$slideTrack).on("dragstart", e.preventDefault), i(window).on("load.slick.slick-" + e.instanceUid, e.setPosition), i(document).on("ready.slick.slick-" + e.instanceUid, e.setPosition) }, e.prototype.initUI = function () { var i = this; !0 === i.options.arrows && i.slideCount > i.options.slidesToShow && (i.$prevArrow.show(), i.$nextArrow.show()), !0 === i.options.dots && i.slideCount > i.options.slidesToShow && i.$dots.show(), !0 === i.options.autoplay && i.autoPlay() }, e.prototype.keyHandler = function (i) { var e = this; i.target.tagName.match("TEXTAREA|INPUT|SELECT") || (37 === i.keyCode && !0 === e.options.accessibility ? e.changeSlide({ data: { message: "previous" } }) : 39 === i.keyCode && !0 === e.options.accessibility && e.changeSlide({ data: { message: "next" } })) }, e.prototype.lazyLoad = function () { function e(e) { i("img[data-lazy]", e).each(function () { var e = i(this), t = i(this).attr("data-lazy"), o = document.createElement("img"); o.onload = function () { e.animate({ opacity: 0 }, 100, function () { e.attr("src", t).animate({ opacity: 1 }, 200, function () { e.removeAttr("data-lazy").removeClass("slick-loading") }) }) }, o.src = t }) } var t, o, s = this; !0 === s.options.centerMode ? !0 === s.options.infinite ? o = (t = s.currentSlide + (s.options.slidesToShow / 2 + 1)) + s.options.slidesToShow + 2 : (t = Math.max(0, s.currentSlide - (s.options.slidesToShow / 2 + 1)), o = s.options.slidesToShow / 2 + 1 + 2 + s.currentSlide) : (o = (t = s.options.infinite ? s.options.slidesToShow + s.currentSlide : s.currentSlide) + s.options.slidesToShow, !0 === s.options.fade && (t > 0 && t--, o <= s.slideCount && o++)), e(s.$slider.find(".slick-slide").slice(t, o)), s.slideCount <= s.options.slidesToShow ? e(s.$slider.find(".slick-slide")) : s.currentSlide >= s.slideCount - s.options.slidesToShow ? e(s.$slider.find(".slick-cloned").slice(0, s.options.slidesToShow)) : 0 === s.currentSlide && e(s.$slider.find(".slick-cloned").slice(-1 * s.options.slidesToShow)) }, e.prototype.loadSlider = function () { var i = this; i.setPosition(), i.$slideTrack.css({ opacity: 1 }), i.$slider.removeClass("slick-loading"), i.initUI(), "progressive" === i.options.lazyLoad && i.progressiveLazyLoad() }, e.prototype.next = e.prototype.slickNext = function () { this.changeSlide({ data: { message: "next" } }) }, e.prototype.orientationChange = function () { setTimeout(function(){ console.log('orientationchanged'); var s = viewer; s.resizeHandler(!0); s.imageManager_do.currentScale = s.imageManager_do.stageWidth / s.imageManager_do.imageWidth; s.resizeHandler(!0); },200); this.checkResponsive(), this.setPosition() }, e.prototype.pause = e.prototype.slickPause = function () { this.autoPlayClear(), this.paused = !0 }, e.prototype.play = e.prototype.slickPlay = function () { this.paused = !1, this.autoPlay() }, e.prototype.postSlide = function (i) { var e = this; e.$slider.trigger("afterChange", [e, i]), e.animating = !1, e.setPosition(), e.swipeLeft = null, !0 === e.options.autoplay && !1 === e.paused && e.autoPlay(), !0 === e.options.accessibility && e.initADA() }, e.prototype.prev = e.prototype.slickPrev = function () { this.changeSlide({ data: { message: "previous" } }) }, e.prototype.preventDefault = function (i) { i.preventDefault() }, e.prototype.progressiveLazyLoad = function () { var e, t = this; i("img[data-lazy]", t.$slider).length > 0 && ((e = i("img[data-lazy]", t.$slider).first()).attr("src", null), e.attr("src", e.attr("data-lazy")).removeClass("slick-loading").load(function () { e.removeAttr("data-lazy"), t.progressiveLazyLoad(), !0 === t.options.adaptiveHeight && t.setPosition() }).error(function () { e.removeAttr("data-lazy"), t.progressiveLazyLoad() })) }, e.prototype.refresh = function (e) { var t, o, s = this; o = s.slideCount - s.options.slidesToShow, s.options.infinite || (s.slideCount <= s.options.slidesToShow ? s.currentSlide = 0 : s.currentSlide > o && (s.currentSlide = o)), t = s.currentSlide, s.destroy(!0), i.extend(s, s.initials, { currentSlide: t }), s.init(), e || s.changeSlide({ data: { message: "index", index: t } }, !1) }, e.prototype.registerBreakpoints = function () { var e, t, o, s = this, n = s.options.responsive || null; if ("array" === i.type(n) && n.length) { for (e in s.respondTo = s.options.respondTo || "window", n) if (o = s.breakpoints.length - 1, t = n[e].breakpoint, n.hasOwnProperty(e)) { for (; o >= 0; ) s.breakpoints[o] && s.breakpoints[o] === t && s.breakpoints.splice(o, 1), o--; s.breakpoints.push(t), s.breakpointSettings[t] = n[e].settings } s.breakpoints.sort(function (i, e) { return s.options.mobileFirst ? i - e : e - i }) } }, e.prototype.reinit = function () { var e = this; e.$slides = e.$slideTrack.children(e.options.slide).addClass("slick-slide"), e.slideCount = e.$slides.length, e.currentSlide >= e.slideCount && 0 !== e.currentSlide && (e.currentSlide = e.currentSlide - e.options.slidesToScroll), e.slideCount <= e.options.slidesToShow && (e.currentSlide = 0), e.registerBreakpoints(), e.setProps(), e.setupInfinite(), e.buildArrows(), e.updateArrows(), e.initArrowEvents(), e.buildDots(), e.updateDots(), e.initDotEvents(), e.checkResponsive(!1, !0), !0 === e.options.focusOnSelect && i(e.$slideTrack).children().on("click.slick", e.selectHandler), e.setSlideClasses(0), e.setPosition(), e.$slider.trigger("reInit", [e]), !0 === e.options.autoplay && e.focusHandler() }, e.prototype.resize = function () { var e = this; i(window).width() !== e.windowWidth && (clearTimeout(e.windowDelay), e.windowDelay = window.setTimeout(function () { e.windowWidth = i(window).width(), e.checkResponsive(), e.unslicked || e.setPosition() }, 50)) }, e.prototype.removeSlide = e.prototype.slickRemove = function (i, e, t) { var o = this; return "boolean" == typeof i ? i = !0 === (e = i) ? 0 : o.slideCount - 1 : i = !0 === e ? --i : i, !(o.slideCount < 1 || 0 > i || i > o.slideCount - 1) && (o.unload(), !0 === t ? o.$slideTrack.children().remove() : o.$slideTrack.children(this.options.slide).eq(i).remove(), o.$slides = o.$slideTrack.children(this.options.slide), o.$slideTrack.children(this.options.slide).detach(), o.$slideTrack.append(o.$slides), o.$slidesCache = o.$slides, void o.reinit()) }, e.prototype.setCSS = function (i) { var e, t, o = this, s = {}; !0 === o.options.rtl && (i = -i), e = "left" == o.positionProp ? Math.ceil(i) + "px" : "0px", t = "top" == o.positionProp ? Math.ceil(i) + "px" : "0px", s[o.positionProp] = i, !1 === o.transformsEnabled ? o.$slideTrack.css(s) : (s = {}, !1 === o.cssTransitions ? (s[o.animType] = "translate(" + e + ", " + t + ")", o.$slideTrack.css(s)) : (s[o.animType] = "translate3d(" + e + ", " + t + ", 0px)", o.$slideTrack.css(s))) }, e.prototype.setDimensions = function () { var i = this; !1 === i.options.vertical ? !0 === i.options.centerMode && i.$list.css({ padding: "0px " + i.options.centerPadding }) : (i.$list.height(i.$slides.first().outerHeight(!0) * i.options.slidesToShow), !0 === i.options.centerMode && i.$list.css({ padding: i.options.centerPadding + " 0px" })), i.listWidth = i.$list.width(), i.listHeight = i.$list.height(), !1 === i.options.vertical && !1 === i.options.variableWidth ? (i.slideWidth = Math.ceil(i.listWidth / i.options.slidesToShow), i.$slideTrack.width(Math.ceil(i.slideWidth * i.$slideTrack.children(".slick-slide").length))) : !0 === i.options.variableWidth ? i.$slideTrack.width(5e3 * i.slideCount) : (i.slideWidth = Math.ceil(i.listWidth), i.$slideTrack.height(Math.ceil(i.$slides.first().outerHeight(!0) * i.$slideTrack.children(".slick-slide").length))); var e = i.$slides.first().outerWidth(!0) - i.$slides.first().width(); !1 === i.options.variableWidth && i.$slideTrack.children(".slick-slide").width(i.slideWidth - e) }, e.prototype.setFade = function () { var e, t = this; t.$slides.each(function (o, s) { e = t.slideWidth * o * -1, !0 === t.options.rtl ? i(s).css({ position: "relative", right: e, top: 0, zIndex: t.options.zIndex - 2, opacity: 0 }) : i(s).css({ position: "relative", left: e, top: 0, zIndex: t.options.zIndex - 2, opacity: 0 }) }), t.$slides.eq(t.currentSlide).css({ zIndex: t.options.zIndex - 1, opacity: 1 }) }, e.prototype.setHeight = function () { var i = this; if (1 === i.options.slidesToShow && !0 === i.options.adaptiveHeight && !1 === i.options.vertical) { var e = i.$slides.eq(i.currentSlide).outerHeight(!0); i.$list.css("height", e) } }, e.prototype.setOption = e.prototype.slickSetOption = function (e, t, o) { var s, n, l = this; if ("responsive" === e && "array" === i.type(t)) for (n in t) if ("array" !== i.type(l.options.responsive)) l.options.responsive = [t[n]]; else { for (s = l.options.responsive.length - 1; s >= 0; ) l.options.responsive[s].breakpoint === t[n].breakpoint && l.options.responsive.splice(s, 1), s--; l.options.responsive.push(t[n]) } else l.options[e] = t; !0 === o && (l.unload(), l.reinit()) }, e.prototype.setPosition = function () { var i = this; i.setDimensions(), i.setHeight(), !1 === i.options.fade ? i.setCSS(i.getLeft(i.currentSlide)) : i.setFade(), i.$slider.trigger("setPosition", [i]) }, e.prototype.setProps = function () { var i = this, e = document.body.style; i.positionProp = !0 === i.options.vertical ? "top" : "left", "top" === i.positionProp ? i.$slider.addClass("slick-vertical") : i.$slider.removeClass("slick-vertical"), (void 0 !== e.WebkitTransition || void 0 !== e.MozTransition || void 0 !== e.msTransition) && !0 === i.options.useCSS && (i.cssTransitions = !0), i.options.fade && ("number" == typeof i.options.zIndex ? i.options.zIndex < 3 && (i.options.zIndex = 3) : i.options.zIndex = i.defaults.zIndex), void 0 !== e.OTransform && (i.animType = "OTransform", i.transformType = "-o-transform", i.transitionType = "OTransition", void 0 === e.perspectiveProperty && void 0 === e.webkitPerspective && (i.animType = !1)), void 0 !== e.MozTransform && (i.animType = "MozTransform", i.transformType = "-moz-transform", i.transitionType = "MozTransition", void 0 === e.perspectiveProperty && void 0 === e.MozPerspective && (i.animType = !1)), void 0 !== e.webkitTransform && (i.animType = "webkitTransform", i.transformType = "-webkit-transform", i.transitionType = "webkitTransition", void 0 === e.perspectiveProperty && void 0 === e.webkitPerspective && (i.animType = !1)), void 0 !== e.msTransform && (i.animType = "msTransform", i.transformType = "-ms-transform", i.transitionType = "msTransition", void 0 === e.msTransform && (i.animType = !1)), void 0 !== e.transform && !1 !== i.animType && (i.animType = "transform", i.transformType = "transform", i.transitionType = "transition"), i.transformsEnabled = i.options.useTransform && null !== i.animType && !1 !== i.animType }, e.prototype.setSlideClasses = function (i) { var e, t, o, s, n = this; t = n.$slider.find(".slick-slide").removeClass("slick-active slick-center slick-current").attr("aria-hidden", "true"), n.$slides.eq(i).addClass("slick-current"), !0 === n.options.centerMode ? (e = Math.floor(n.options.slidesToShow / 2), !0 === n.options.infinite && (i >= e && i <= n.slideCount - 1 - e ? n.$slides.slice(i - e, i + e + 1).addClass("slick-active").attr("aria-hidden", "false") : (o = n.options.slidesToShow + i, t.slice(o - e + 1, o + e + 2).addClass("slick-active").attr("aria-hidden", "false")), 0 === i ? t.eq(t.length - 1 - n.options.slidesToShow).addClass("slick-center") : i === n.slideCount - 1 && t.eq(n.options.slidesToShow).addClass("slick-center")), n.$slides.eq(i).addClass("slick-center")) : i >= 0 && i <= n.slideCount - n.options.slidesToShow ? n.$slides.slice(i, i + n.options.slidesToShow).addClass("slick-active").attr("aria-hidden", "false") : t.length <= n.options.slidesToShow ? t.addClass("slick-active").attr("aria-hidden", "false") : (s = n.slideCount % n.options.slidesToShow, o = !0 === n.options.infinite ? n.options.slidesToShow + i : i, n.options.slidesToShow == n.options.slidesToScroll && n.slideCount - i < n.options.slidesToShow ? t.slice(o - (n.options.slidesToShow - s), o + s).addClass("slick-active").attr("aria-hidden", "false") : t.slice(o, o + n.options.slidesToShow).addClass("slick-active").attr("aria-hidden", "false")), "ondemand" === n.options.lazyLoad && n.lazyLoad() }, e.prototype.setupInfinite = function () { var e, t, o, s = this; if (!0 === s.options.fade && (s.options.centerMode = !1), !0 === s.options.infinite && !1 === s.options.fade && (t = null, s.slideCount > s.options.slidesToShow)) { for (o = !0 === s.options.centerMode ? s.options.slidesToShow + 1 : s.options.slidesToShow, e = s.slideCount; e > s.slideCount - o; e -= 1) t = e - 1, i(s.$slides[t]).clone(!0).attr("id", "").attr("data-slick-index", t - s.slideCount).prependTo(s.$slideTrack).addClass("slick-cloned"); for (e = 0; o > e; e += 1) t = e, i(s.$slides[t]).clone(!0).attr("id", "").attr("data-slick-index", t + s.slideCount).appendTo(s.$slideTrack).addClass("slick-cloned"); s.$slideTrack.find(".slick-cloned").find("[id]").each(function () { i(this).attr("id", "") }) } }, e.prototype.setPaused = function (i) { var e = this; !0 === e.options.autoplay && !0 === e.options.pauseOnHover && (e.paused = i, i ? e.autoPlayClear() : e.autoPlay()) }, e.prototype.selectHandler = function (e) { var t = this, o = i(e.target).is(".slick-slide") ? i(e.target) : i(e.target).parents(".slick-slide"), s = parseInt(o.attr("data-slick-index")); return s || (s = 0), t.slideCount <= t.options.slidesToShow ? (t.setSlideClasses(s), void t.asNavFor(s)) : void t.slideHandler(s) }, e.prototype.slideHandler = function (i, e, t) { var o, s, n, l, r = null, a = this; return e = e || !1, !0 === a.animating && !0 === a.options.waitForAnimate || !0 === a.options.fade && a.currentSlide === i || a.slideCount <= a.options.slidesToShow ? void 0 : (!1 === e && a.asNavFor(i), o = i, r = a.getLeft(o), l = a.getLeft(a.currentSlide), a.currentLeft = null === a.swipeLeft ? l : a.swipeLeft, !1 === a.options.infinite && !1 === a.options.centerMode && (0 > i || i > a.getDotCount() * a.options.slidesToScroll) ? void(!1 === a.options.fade && (o = a.currentSlide, !0 !== t ? a.animateSlide(l, function () { a.postSlide(o) }) : a.postSlide(o))) : !1 === a.options.infinite && !0 === a.options.centerMode && (0 > i || i > a.slideCount - a.options.slidesToScroll) ? void(!1 === a.options.fade && (o = a.currentSlide, !0 !== t ? a.animateSlide(l, function () { a.postSlide(o) }) : a.postSlide(o))) : (!0 === a.options.autoplay && clearInterval(a.autoPlayTimer), s = 0 > o ? a.slideCount % a.options.slidesToScroll != 0 ? a.slideCount - a.slideCount % a.options.slidesToScroll : a.slideCount + o : o >= a.slideCount ? a.slideCount % a.options.slidesToScroll != 0 ? 0 : o - a.slideCount : o, a.animating = !0, a.$slider.trigger("beforeChange", [a, a.currentSlide, s]), n = a.currentSlide, a.currentSlide = s, a.setSlideClasses(a.currentSlide), a.updateDots(), a.updateArrows(), !0 === a.options.fade ? (!0 !== t ? (a.fadeSlideOut(n), a.fadeSlide(s, function () { a.postSlide(s) })) : a.postSlide(s), void a.animateHeight()) : void(!0 !== t ? a.animateSlide(r, function () { a.postSlide(s) }) : a.postSlide(s)))) }, e.prototype.startLoad = function () { var i = this; !0 === i.options.arrows && i.slideCount > i.options.slidesToShow && (i.$prevArrow.hide(), i.$nextArrow.hide()), !0 === i.options.dots && i.slideCount > i.options.slidesToShow && i.$dots.hide(), i.$slider.addClass("slick-loading") }, e.prototype.swipeDirection = function () { var i, e, t, o, s = this; return i = s.touchObject.startX - s.touchObject.curX, e = s.touchObject.startY - s.touchObject.curY, t = Math.atan2(e, i), 0 > (o = Math.round(180 * t / Math.PI)) && (o = 360 - Math.abs(o)), 45 >= o && o >= 0 ? !1 === s.options.rtl ? "left" : "right" : 360 >= o && o >= 315 ? !1 === s.options.rtl ? "left" : "right" : o >= 135 && 225 >= o ? !1 === s.options.rtl ? "right" : "left" : !0 === s.options.verticalSwiping ? o >= 35 && 135 >= o ? "left" : "right" : "vertical" }, e.prototype.swipeEnd = function (i) { var e, t = this; if (t.dragging = !1, t.shouldClick = !(t.touchObject.swipeLength > 10), void 0 === t.touchObject.curX) return !1; if (!0 === t.touchObject.edgeHit && t.$slider.trigger("edge", [t, t.swipeDirection()]), t.touchObject.swipeLength >= t.touchObject.minSwipe) switch (t.swipeDirection()) { case "left": e = t.options.swipeToSlide ? t.checkNavigable(t.currentSlide + t.getSlideCount()) : t.currentSlide + t.getSlideCount(), t.slideHandler(e), t.currentDirection = 0, t.touchObject = {}, t.$slider.trigger("swipe", [t, "left"]); break; case "right": e = t.options.swipeToSlide ? t.checkNavigable(t.currentSlide - t.getSlideCount()) : t.currentSlide - t.getSlideCount(), t.slideHandler(e), t.currentDirection = 1, t.touchObject = {}, t.$slider.trigger("swipe", [t, "right"]) } else t.touchObject.startX !== t.touchObject.curX && (t.slideHandler(t.currentSlide), t.touchObject = {}) }, e.prototype.swipeHandler = function (i) { var e = this; if (!(!1 === e.options.swipe || "ontouchend" in document && !1 === e.options.swipe || !1 === e.options.draggable && -1 !== i.type.indexOf("mouse"))) switch (e.touchObject.fingerCount = i.originalEvent && void 0 !== i.originalEvent.touches ? i.originalEvent.touches.length : 1, e.touchObject.minSwipe = e.listWidth / e.options.touchThreshold, !0 === e.options.verticalSwiping && (e.touchObject.minSwipe = e.listHeight / e.options.touchThreshold), i.data.action) { case "start": e.swipeStart(i); break; case "move": e.swipeMove(i); break; case "end": e.swipeEnd(i) } }, e.prototype.swipeMove = function (i) { var e, t, o, s, n, l = this; return n = void 0 !== i.originalEvent ? i.originalEvent.touches : null, !(!l.dragging || n && 1 !== n.length) && (e = l.getLeft(l.currentSlide), l.touchObject.curX = void 0 !== n ? n[0].pageX : i.clientX, l.touchObject.curY = void 0 !== n ? n[0].pageY : i.clientY, l.touchObject.swipeLength = Math.round(Math.sqrt(Math.pow(l.touchObject.curX - l.touchObject.startX, 2))), !0 === l.options.verticalSwiping && (l.touchObject.swipeLength = Math.round(Math.sqrt(Math.pow(l.touchObject.curY - l.touchObject.startY, 2)))), "vertical" !== (t = l.swipeDirection()) ? (void 0 !== i.originalEvent && l.touchObject.swipeLength > 4 && i.preventDefault(), s = (!1 === l.options.rtl ? 1 : -1) * (l.touchObject.curX > l.touchObject.startX ? 1 : -1), !0 === l.options.verticalSwiping && (s = l.touchObject.curY > l.touchObject.startY ? 1 : -1), o = l.touchObject.swipeLength, l.touchObject.edgeHit = !1, !1 === l.options.infinite && (0 === l.currentSlide && "right" === t || l.currentSlide >= l.getDotCount() && "left" === t) && (o = l.touchObject.swipeLength * l.options.edgeFriction, l.touchObject.edgeHit = !0), !1 === l.options.vertical ? l.swipeLeft = e + o * s : l.swipeLeft = e + o * (l.$list.height() / l.listWidth) * s, !0 === l.options.verticalSwiping && (l.swipeLeft = e + o * s), !0 !== l.options.fade && !1 !== l.options.touchMove && (!0 === l.animating ? (l.swipeLeft = null, !1) : void l.setCSS(l.swipeLeft))) : void 0) }, e.prototype.swipeStart = function (i) { var e, t = this; return 1 !== t.touchObject.fingerCount || t.slideCount <= t.options.slidesToShow ? (t.touchObject = {}, !1) : (void 0 !== i.originalEvent && void 0 !== i.originalEvent.touches && (e = i.originalEvent.touches[0]), t.touchObject.startX = t.touchObject.curX = void 0 !== e ? e.pageX : i.clientX, t.touchObject.startY = t.touchObject.curY = void 0 !== e ? e.pageY : i.clientY, void(t.dragging = !0)) }, e.prototype.unfilterSlides = e.prototype.slickUnfilter = function () { var i = this; null !== i.$slidesCache && (i.unload(), i.$slideTrack.children(this.options.slide).detach(), i.$slidesCache.appendTo(i.$slideTrack), i.reinit()) }, e.prototype.unload = function () { var e = this; i(".slick-cloned", e.$slider).remove(), e.$dots && e.$dots.remove(), e.$prevArrow && e.htmlExpr.test(e.options.prevArrow) && e.$prevArrow.remove(), e.$nextArrow && e.htmlExpr.test(e.options.nextArrow) && e.$nextArrow.remove(), e.$slides.removeClass("slick-slide slick-active slick-visible slick-current").attr("aria-hidden", "true").css("width", "") }, e.prototype.unslick = function (i) { var e = this; e.$slider.trigger("unslick", [e, i]), e.destroy() }, e.prototype.updateArrows = function () { var i = this; Math.floor(i.options.slidesToShow / 2), !0 === i.options.arrows && i.slideCount > i.options.slidesToShow && !i.options.infinite && (i.$prevArrow.removeClass("slick-disabled").attr("aria-disabled", "false"), i.$nextArrow.removeClass("slick-disabled").attr("aria-disabled", "false"), 0 === i.currentSlide ? (i.$prevArrow.addClass("slick-disabled").attr("aria-disabled", "true"), i.$nextArrow.removeClass("slick-disabled").attr("aria-disabled", "false")) : i.currentSlide >= i.slideCount - i.options.slidesToShow && !1 === i.options.centerMode ? (i.$nextArrow.addClass("slick-disabled").attr("aria-disabled", "true"), i.$prevArrow.removeClass("slick-disabled").attr("aria-disabled", "false")) : i.currentSlide >= i.slideCount - 1 && !0 === i.options.centerMode && (i.$nextArrow.addClass("slick-disabled").attr("aria-disabled", "true"), i.$prevArrow.removeClass("slick-disabled").attr("aria-disabled", "false"))) }, e.prototype.updateDots = function () { var i = this; null !== i.$dots && (i.$dots.find("li").removeClass("slick-active").attr("aria-hidden", "true"), i.$dots.find("li").eq(Math.floor(i.currentSlide / i.options.slidesToScroll)).addClass("slick-active").attr("aria-hidden", "false")) }, e.prototype.visibility = function () { var i = this; document[i.hidden] ? (i.paused = !0, i.autoPlayClear()) : !0 === i.options.autoplay && (i.paused = !1, i.autoPlay()) }, e.prototype.initADA = function () { var e = this; e.$slides.add(e.$slideTrack.find(".slick-cloned")).attr({ "aria-hidden": "true", tabindex: "-1" }).find("a, input, button, select").attr({ tabindex: "-1" }), e.$slideTrack.attr("role", "listbox"), e.$slides.not(e.$slideTrack.find(".slick-cloned")).each(function (t) { i(this).attr({ role: "option", "aria-describedby": "slick-slide" + e.instanceUid + t }) }), null !== e.$dots && e.$dots.attr("role", "tablist").find("li").each(function (t) { i(this).attr({ role: "presentation", "aria-selected": "false", "aria-controls": "navigation" + e.instanceUid + t, id: "slick-slide" + e.instanceUid + t }) }).first().attr("aria-selected", "true").end().find("button").attr("role", "button").end().closest("div").attr("role", "toolbar"), e.activateADA() }, e.prototype.activateADA = function () { this.$slideTrack.find(".slick-active").attr({ "aria-hidden": "false" }).find("a, input, button, select").attr({ tabindex: "0" }) }, e.prototype.focusHandler = function () { var e = this; e.$slider.on("focus.slick blur.slick", "*", function (t) { t.stopImmediatePropagation(); var o = i(this); setTimeout(function () { e.isPlay && (o.is(":focus") ? (e.autoPlayClear(), e.paused = !0) : (e.paused = !1, e.autoPlay())) }, 0) }) }, i.fn.slick = function () { var i, t, o = this, s = arguments[0], n = Array.prototype.slice.call(arguments, 1), l = o.length; for (i = 0; l > i; i++) if ("object" == typeof s || void 0 === s ? o[i].slick = new e(o[i], s) : t = o[i].slick[s].apply(o[i].slick, n), void 0 !== t) return t; return o } } (losjqisafe); // threejs.org/license (function (h, pa) { "object" === typeof exports && "undefined" !== typeof module ? pa(exports) : "function" === typeof define && define.amd ? define(["exports"], pa) : pa(h.THREE = h.THREE || {}) })(this, function (h) { function pa() {} function C(a, b) { this.x = a || 0; this.y = b || 0 } function ba(a, b, c, d, e, f, g, k, l, m) { Object.defineProperty(this, "id", { value: Pd++ }); this.uuid = h.Math.generateUUID(); this.sourceFile = this.name = ""; this.image = void 0 !== a ? a : ba.DEFAULT_IMAGE; this.mipmaps = []; this.mapping = void 0 !== b ? b : ba.DEFAULT_MAPPING; this.wrapS = void 0 !== c ? c : 1001; this.wrapT = void 0 !== d ? d : 1001; this.magFilter = void 0 !== e ? e : 1006; this.minFilter = void 0 !== f ? f : 1008; this.anisotropy = void 0 !== l ? l : 1; this.format = void 0 !== g ? g : 1023; this.type = void 0 !== k ? k : 1009; this.offset = new C(0, 0); this.repeat = new C(1, 1); this.generateMipmaps = !0; this.premultiplyAlpha = !1; this.flipY = !0; this.unpackAlignment = 4; this.encoding = void 0 !== m ? m : 3E3; this.version = 0; this.onUpdate = null } function da(a, b, c, d) { this.x = a || 0; this.y = b || 0; this.z = c || 0; this.w = void 0 !== d ? d : 1 } function zb(a, b, c) { this.uuid = h.Math.generateUUID(); this.width = a; this.height = b; this.scissor = new da(0, 0, a, b); this.scissorTest = !1; this.viewport = new da(0, 0, a, b); c = c || {}; void 0 === c.minFilter && (c.minFilter = 1006); this.texture = new ba(void 0, void 0, c.wrapS, c.wrapT, c.magFilter, c.minFilter, c.format, c.type, c.anisotropy, c.encoding); this.depthBuffer = void 0 !== c.depthBuffer ? c.depthBuffer : !0; this.stencilBuffer = void 0 !== c.stencilBuffer ? c.stencilBuffer : !0; this.depthTexture = void 0 !== c.depthTexture ? c.depthTexture : null } function Ab(a, b, c) { zb.call(this, a, b, c); this.activeMipMapLevel = this.activeCubeFace = 0 } function ca(a, b, c, d) { this._x = a || 0; this._y = b || 0; this._z = c || 0; this._w = void 0 !== d ? d : 1 } function q(a, b, c) { this.x = a || 0; this.y = b || 0; this.z = c || 0 } function P() { this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]); 0 < arguments.length && console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.") } function Ta(a, b, c, d, e, f, g, k, l, m) { a = void 0 !== a ? a : []; ba.call(this, a, void 0 !== b ? b : 301, c, d, e, f, g, k, l, m); this.flipY = !1 } function Bb(a, b, c) { var d = a[0]; if (0 >= d || 0 < d) return a; var e = b * c, f = Qd[e]; void 0 === f && (f = new Float32Array(e), Qd[e] = f); if (0 !== b) for (d.toArray(f, 0), d = 1, e = 0; d !== b; ++d) e += c, a[d].toArray(f, e); return f } function Rd(a, b) { var c = Sd[b]; void 0 === c && (c = new Int32Array(b), Sd[b] = c); for (var d = 0; d !== b; ++d) c[d] = a.allocTextureUnit(); return c } function se(a, b) { a.uniform1f(this.addr, b) } function te(a, b) { a.uniform1i(this.addr, b) } function ue(a, b) { void 0 === b.x ? a.uniform2fv(this.addr, b) : a.uniform2f(this.addr, b.x, b.y) } function ve(a, b) { void 0 !== b.x ? a.uniform3f(this.addr, b.x, b.y, b.z) : void 0 !== b.r ? a.uniform3f(this.addr, b.r, b.g, b.b) : a.uniform3fv(this.addr, b) } function we(a, b) { void 0 === b.x ? a.uniform4fv(this.addr, b) : a.uniform4f(this.addr, b.x, b.y, b.z, b.w) } function xe(a, b) { a.uniformMatrix2fv(this.addr, !1, b.elements || b) } function ye(a, b) { a.uniformMatrix3fv(this.addr, !1, b.elements || b) } function ze(a, b) { a.uniformMatrix4fv(this.addr, !1, b.elements || b) } function Ae(a, b, c) { var d = c.allocTextureUnit(); a.uniform1i(this.addr, d); c.setTexture2D(b || Td, d) } function Be(a, b, c) { var d = c.allocTextureUnit(); a.uniform1i(this.addr, d); c.setTextureCube(b || Ud, d) } function Vd(a, b) { a.uniform2iv(this.addr, b) } function Wd(a, b) { a.uniform3iv(this.addr, b) } function Xd(a, b) { a.uniform4iv(this.addr, b) } function Ce(a) { switch (a) { case 5126: return se; case 35664: return ue; case 35665: return ve; case 35666: return we; case 35674: return xe; case 35675: return ye; case 35676: return ze; case 35678: return Ae; case 35680: return Be; case 5124: case 35670: return te; case 35667: case 35671: return Vd; case 35668: case 35672: return Wd; case 35669: case 35673: return Xd } } function De(a, b) { a.uniform1fv(this.addr, b) } function Ee(a, b) { a.uniform1iv(this.addr, b) } function Fe(a, b) { a.uniform2fv(this.addr, Bb(b, this.size, 2)) } function Ge(a, b) { a.uniform3fv(this.addr, Bb(b, this.size, 3)) } function He(a, b) { a.uniform4fv(this.addr, Bb(b, this.size, 4)) } function Ie(a, b) { a.uniformMatrix2fv(this.addr, !1, Bb(b, this.size, 4)) } function Je(a, b) { a.uniformMatrix3fv(this.addr, !1, Bb(b, this.size, 9)) } function Ke(a, b) { a.uniformMatrix4fv(this.addr, !1, Bb(b, this.size, 16)) } function Le(a, b, c) { var d = b.length, e = Rd(c, d); a.uniform1iv(this.addr, e); for (a = 0; a !== d; ++a) c.setTexture2D(b[a] || Td, e[a]) } function Me(a, b, c) { var d = b.length, e = Rd(c, d); a.uniform1iv(this.addr, e); for (a = 0; a !== d; ++a) c.setTextureCube(b[a] || Ud, e[a]) } function Ne(a) { switch (a) { case 5126: return De; case 35664: return Fe; case 35665: return Ge; case 35666: return He; case 35674: return Ie; case 35675: return Je; case 35676: return Ke; case 35678: return Le; case 35680: return Me; case 5124: case 35670: return Ee; case 35667: case 35671: return Vd; case 35668: case 35672: return Wd; case 35669: case 35673: return Xd } } function Oe(a, b, c) { this.id = a; this.addr = c; this.setValue = Ce(b.type) } function Pe(a, b, c) { this.id = a; this.addr = c; this.size = b.size; this.setValue = Ne(b.type) } function Yd(a) { this.id = a; this.seq = []; this.map = {} } function Ga(a, b, c) { this.seq = []; this.map = {}; this.renderer = c; c = a.getProgramParameter(b, a.ACTIVE_UNIFORMS); for (var d = 0; d !== c; ++d) { var e = a.getActiveUniform(b, d), f = a.getUniformLocation(b, e.name), g = this, k = e.name, l = k.length; for (kd.lastIndex = 0; ; ) { var m = kd.exec(k), u = kd.lastIndex, p = m[1], n = m[3]; "]" === m[2] && (p |= 0); if (void 0 === n || "[" === n && u + 2 === l) { k = g; e = void 0 === n ? new Oe(p, e, f) : new Pe(p, e, f); k.seq.push(e); k.map[e.id] = e; break } else n = g.map[p], void 0 === n && (n = new Yd(p), p = g, g = n, p.seq.push(g), p.map[g.id] = g), g = n } } } function H(a, b, c) { return void 0 === b && void 0 === c ? this.set(a) : this.setRGB(a, b, c) } function cc(a, b) { this.min = void 0 !== a ? a : new C(Infinity, Infinity); this.max = void 0 !== b ? b : new C(-Infinity, -Infinity) } function Qe(a, b) { var c, d, e, f, g, k, l, m, u, p, n = a.context, h = a.state, t, v, A, w, x, T; this.render = function (y, F, G) { if (0 !== b.length) { y = new q; var E = G.w / G.z, J = .5 * G.z, Ma = .5 * G.w, N = 16 / G.w, ea = new C(N * E, N), xa = new q(1, 1, 0), ab = new C(1, 1), Ea = new cc; Ea.min.set(0, 0); Ea.max.set(G.z - 16, G.w - 16); if (void 0 === w) { var N = new Float32Array([-1, -1, 0, 0, 1, -1, 1, 0, 1, 1, 1, 1, -1, 1, 0, 1]), L = new Uint16Array([0, 1, 2, 0, 2, 3]); t = n.createBuffer(); v = n.createBuffer(); n.bindBuffer(n.ARRAY_BUFFER, t); n.bufferData(n.ARRAY_BUFFER, N, n.STATIC_DRAW); n.bindBuffer(n.ELEMENT_ARRAY_BUFFER, v); n.bufferData(n.ELEMENT_ARRAY_BUFFER, L, n.STATIC_DRAW); x = n.createTexture(); T = n.createTexture(); h.bindTexture(n.TEXTURE_2D, x); n.texImage2D(n.TEXTURE_2D, 0, n.RGB, 16, 16, 0, n.RGB, n.UNSIGNED_BYTE, null); n.texParameteri(n.TEXTURE_2D, n.TEXTURE_WRAP_S, n.CLAMP_TO_EDGE); n.texParameteri(n.TEXTURE_2D, n.TEXTURE_WRAP_T, n.CLAMP_TO_EDGE); n.texParameteri(n.TEXTURE_2D, n.TEXTURE_MAG_FILTER, n.NEAREST); n.texParameteri(n.TEXTURE_2D, n.TEXTURE_MIN_FILTER, n.NEAREST); h.bindTexture(n.TEXTURE_2D, T); n.texImage2D(n.TEXTURE_2D, 0, n.RGBA, 16, 16, 0, n.RGBA, n.UNSIGNED_BYTE, null); n.texParameteri(n.TEXTURE_2D, n.TEXTURE_WRAP_S, n.CLAMP_TO_EDGE); n.texParameteri(n.TEXTURE_2D, n.TEXTURE_WRAP_T, n.CLAMP_TO_EDGE); n.texParameteri(n.TEXTURE_2D, n.TEXTURE_MAG_FILTER, n.NEAREST); n.texParameteri(n.TEXTURE_2D, n.TEXTURE_MIN_FILTER, n.NEAREST); var N = A = { vertexShader: "uniform lowp int renderType;\nuniform vec3 screenPosition;\nuniform vec2 scale;\nuniform float rotation;\nuniform sampler2D occlusionMap;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvarying float vVisibility;\nvoid main() {\nvUV = uv;\nvec2 pos = position;\nif ( renderType == 2 ) {\nvec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );\nvVisibility = visibility.r / 9.0;\nvVisibility *= 1.0 - visibility.g / 9.0;\nvVisibility *= visibility.b / 9.0;\nvVisibility *= 1.0 - visibility.a / 9.0;\npos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;\npos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;\n}\ngl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );\n}", fragmentShader: "uniform lowp int renderType;\nuniform sampler2D map;\nuniform float opacity;\nuniform vec3 color;\nvarying vec2 vUV;\nvarying float vVisibility;\nvoid main() {\nif ( renderType == 0 ) {\ngl_FragColor = vec4( 1.0, 0.0, 1.0, 0.0 );\n} else if ( renderType == 1 ) {\ngl_FragColor = texture2D( map, vUV );\n} else {\nvec4 texture = texture2D( map, vUV );\ntexture.a *= opacity * vVisibility;\ngl_FragColor = texture;\ngl_FragColor.rgb *= color;\n}\n}" }, L = n.createProgram(), M = n.createShader(n.FRAGMENT_SHADER), O = n.createShader(n.VERTEX_SHADER), Q = "precision " + a.getPrecision() + " float;\n"; n.shaderSource(M, Q + N.fragmentShader); n.shaderSource(O, Q + N.vertexShader); n.compileShader(M); n.compileShader(O); n.attachShader(L, M); n.attachShader(L, O); n.linkProgram(L); w = L; u = n.getAttribLocation(w, "position"); p = n.getAttribLocation(w, "uv"); c = n.getUniformLocation(w, "renderType"); d = n.getUniformLocation(w, "map"); e = n.getUniformLocation(w, "occlusionMap"); f = n.getUniformLocation(w, "opacity"); g = n.getUniformLocation(w, "color"); k = n.getUniformLocation(w, "scale"); l = n.getUniformLocation(w, "rotation"); m = n.getUniformLocation(w, "screenPosition") } n.useProgram(w); h.initAttributes(); h.enableAttribute(u); h.enableAttribute(p); h.disableUnusedAttributes(); n.uniform1i(e, 0); n.uniform1i(d, 1); n.bindBuffer(n.ARRAY_BUFFER, t); n.vertexAttribPointer(u, 2, n.FLOAT, !1, 16, 0); n.vertexAttribPointer(p, 2, n.FLOAT, !1, 16, 8); n.bindBuffer(n.ELEMENT_ARRAY_BUFFER, v); h.disable(n.CULL_FACE); h.setDepthWrite(!1); L = 0; for (M = b.length; L < M; L++) if (N = 16 / G.w, ea.set(N * E, N), O = b[L], y.set(O.matrixWorld.elements[12], O.matrixWorld.elements[13], O.matrixWorld.elements[14]), y.applyMatrix4(F.matrixWorldInverse), y.applyProjection(F.projectionMatrix), xa.copy(y), ab.x = G.x + xa.x * J + J - 8, ab.y = G.y + xa.y * Ma + Ma - 8, !0 === Ea.containsPoint(ab)) { h.activeTexture(n.TEXTURE0); h.bindTexture(n.TEXTURE_2D, null); h.activeTexture(n.TEXTURE1); h.bindTexture(n.TEXTURE_2D, x); n.copyTexImage2D(n.TEXTURE_2D, 0, n.RGB, ab.x, ab.y, 16, 16, 0); n.uniform1i(c, 0); n.uniform2f(k, ea.x, ea.y); n.uniform3f(m, xa.x, xa.y, xa.z); h.disable(n.BLEND); h.enable(n.DEPTH_TEST); n.drawElements(n.TRIANGLES, 6, n.UNSIGNED_SHORT, 0); h.activeTexture(n.TEXTURE0); h.bindTexture(n.TEXTURE_2D, T); n.copyTexImage2D(n.TEXTURE_2D, 0, n.RGBA, ab.x, ab.y, 16, 16, 0); n.uniform1i(c, 1); h.disable(n.DEPTH_TEST); h.activeTexture(n.TEXTURE1); h.bindTexture(n.TEXTURE_2D, x); n.drawElements(n.TRIANGLES, 6, n.UNSIGNED_SHORT, 0); O.positionScreen.copy(xa); O.customUpdateCallback ? O.customUpdateCallback(O) : O.updateLensFlares(); n.uniform1i(c, 2); h.enable(n.BLEND); for (var Q = 0, Re = O.lensFlares.length; Q < Re; Q++) { var V = O.lensFlares[Q]; .001 < V.opacity && .001 < V.scale && (xa.x = V.x, xa.y = V.y, xa.z = V.z, N = V.size * V.scale / G.w, ea.x = N * E, ea.y = N, n.uniform3f(m, xa.x, xa.y, xa.z), n.uniform2f(k, ea.x, ea.y), n.uniform1f(l, V.rotation), n.uniform1f(f, V.opacity), n.uniform3f(g, V.color.r, V.color.g, V.color.b), h.setBlending(V.blending, V.blendEquation, V.blendSrc, V.blendDst), a.setTexture2D(V.texture, 1), n.drawElements(n.TRIANGLES, 6, n.UNSIGNED_SHORT, 0)) } } h.enable(n.CULL_FACE); h.enable(n.DEPTH_TEST); h.setDepthWrite(!0); a.resetGLState() } } } function Se(a, b) { var c, d, e, f, g, k, l, m, u, h, n, r, t, v, A, w, x; function T(a, b) { return a.renderOrder !== b.renderOrder ? a.renderOrder - b.renderOrder : a.z !== b.z ? b.z - a.z : b.id - a.id } var y = a.context, F = a.state, G, E, J, Ma, N = new q, ea = new ca, xa = new q; this.render = function (q, Ea) { if (0 !== b.length) { if (void 0 === J) { var L = new Float32Array([ - .5, - .5, 0, 0, .5, - .5, 1, 0, .5, .5, 1, 1, - .5, .5, 0, 1]), M = new Uint16Array([0, 1, 2, 0, 2, 3]); G = y.createBuffer(); E = y.createBuffer(); y.bindBuffer(y.ARRAY_BUFFER, G); y.bufferData(y.ARRAY_BUFFER, L, y.STATIC_DRAW); y.bindBuffer(y.ELEMENT_ARRAY_BUFFER, E); y.bufferData(y.ELEMENT_ARRAY_BUFFER, M, y.STATIC_DRAW); var L = y.createProgram(), M = y.createShader(y.VERTEX_SHADER), O = y.createShader(y.FRAGMENT_SHADER); y.shaderSource(M, ["precision " + a.getPrecision() + " float;", "uniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform float rotation;\nuniform vec2 scale;\nuniform vec2 uvOffset;\nuniform vec2 uvScale;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvoid main() {\nvUV = uvOffset + uv * uvScale;\nvec2 alignedPosition = position * scale;\nvec2 rotatedPosition;\nrotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\nrotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\nvec4 finalPosition;\nfinalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\nfinalPosition.xy += rotatedPosition;\nfinalPosition = projectionMatrix * finalPosition;\ngl_Position = finalPosition;\n}"].join("\n")); y.shaderSource(O, ["precision " + a.getPrecision() + " float;", "uniform vec3 color;\nuniform sampler2D map;\nuniform float opacity;\nuniform int fogType;\nuniform vec3 fogColor;\nuniform float fogDensity;\nuniform float fogNear;\nuniform float fogFar;\nuniform float alphaTest;\nvarying vec2 vUV;\nvoid main() {\nvec4 texture = texture2D( map, vUV );\nif ( texture.a < alphaTest ) discard;\ngl_FragColor = vec4( color * texture.xyz, texture.a * opacity );\nif ( fogType > 0 ) {\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\nfloat fogFactor = 0.0;\nif ( fogType == 1 ) {\nfogFactor = smoothstep( fogNear, fogFar, depth );\n} else {\nconst float LOG2 = 1.442695;\nfogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n}\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n}\n}"].join("\n")); y.compileShader(M); y.compileShader(O); y.attachShader(L, M); y.attachShader(L, O); y.linkProgram(L); J = L; w = y.getAttribLocation(J, "position"); x = y.getAttribLocation(J, "uv"); c = y.getUniformLocation(J, "uvOffset"); d = y.getUniformLocation(J, "uvScale"); e = y.getUniformLocation(J, "rotation"); f = y.getUniformLocation(J, "scale"); g = y.getUniformLocation(J, "color"); k = y.getUniformLocation(J, "map"); l = y.getUniformLocation(J, "opacity"); m = y.getUniformLocation(J, "modelViewMatrix"); u = y.getUniformLocation(J, "projectionMatrix"); h = y.getUniformLocation(J, "fogType"); n = y.getUniformLocation(J, "fogDensity"); r = y.getUniformLocation(J, "fogNear"); t = y.getUniformLocation(J, "fogFar"); v = y.getUniformLocation(J, "fogColor"); A = y.getUniformLocation(J, "alphaTest"); L = document.createElementNS("http://www.w3.org/1999/xhtml", "canvas"); L.width = 8; L.height = 8; M = L.getContext("2d"); M.fillStyle = "white"; M.fillRect(0, 0, 8, 8); Ma = new ba(L); Ma.needsUpdate = !0 } y.useProgram(J); F.initAttributes(); F.enableAttribute(w); F.enableAttribute(x); F.disableUnusedAttributes(); F.disable(y.CULL_FACE); F.enable(y.BLEND); y.bindBuffer(y.ARRAY_BUFFER, G); y.vertexAttribPointer(w, 2, y.FLOAT, !1, 16, 0); y.vertexAttribPointer(x, 2, y.FLOAT, !1, 16, 8); y.bindBuffer(y.ELEMENT_ARRAY_BUFFER, E); y.uniformMatrix4fv(u, !1, Ea.projectionMatrix.elements); F.activeTexture(y.TEXTURE0); y.uniform1i(k, 0); M = L = 0; (O = q.fog) ? (y.uniform3f(v, O.color.r, O.color.g, O.color.b), O && O.isFog ? (y.uniform1f(r, O.near), y.uniform1f(t, O.far), y.uniform1i(h, 1), M = L = 1) : O && O.isFogExp2 && (y.uniform1f(n, O.density), y.uniform1i(h, 2), M = L = 2)) : (y.uniform1i(h, 0), M = L = 0); for (var O = 0, Q = b.length; O < Q; O++) { var C = b[O]; C.modelViewMatrix.multiplyMatrices(Ea.matrixWorldInverse, C.matrixWorld); C.z = -C.modelViewMatrix.elements[14] } b.sort(T); for (var V = [], O = 0, Q = b.length; O < Q; O++) { var C = b[O], W = C.material; !1 !== W.visible && (y.uniform1f(A, W.alphaTest), y.uniformMatrix4fv(m, !1, C.modelViewMatrix.elements), C.matrixWorld.decompose(N, ea, xa), V[0] = xa.x, V[1] = xa.y, C = 0, q.fog && W.fog && (C = M), L !== C && (y.uniform1i(h, C), L = C), null !== W.map ? (y.uniform2f(c, W.map.offset.x, W.map.offset.y), y.uniform2f(d, W.map.repeat.x, W.map.repeat.y)) : (y.uniform2f(c, 0, 0), y.uniform2f(d, 1, 1)), y.uniform1f(l, W.opacity), y.uniform3f(g, W.color.r, W.color.g, W.color.b), y.uniform1f(e, W.rotation), y.uniform2fv(f, V), F.setBlending(W.blending, W.blendEquation, W.blendSrc, W.blendDst), F.setDepthTest(W.depthTest), F.setDepthWrite(W.depthWrite), W.map ? a.setTexture2D(W.map, 0) : a.setTexture2D(Ma, 0), y.drawElements(y.TRIANGLES, 6, y.UNSIGNED_SHORT, 0)) } F.enable(y.CULL_FACE); a.resetGLState() } } } function S() { Object.defineProperty(this, "id", { value: Zd++ }); this.uuid = h.Math.generateUUID(); this.name = ""; this.type = "Material"; this.lights = this.fog = !0; this.blending = 1; this.side = 0; this.shading = 2; this.vertexColors = 0; this.opacity = 1; this.transparent = !1; this.blendSrc = 204; this.blendDst = 205; this.blendEquation = 100; this.blendEquationAlpha = this.blendDstAlpha = this.blendSrcAlpha = null; this.depthFunc = 3; this.depthWrite = this.depthTest = !0; this.clippingPlanes = null; this.clipShadows = !1; this.colorWrite = !0; this.precision = null; this.polygonOffset = !1; this.alphaTest = this.polygonOffsetUnits = this.polygonOffsetFactor = 0; this.premultipliedAlpha = !1; this.overdraw = 0; this._needsUpdate = this.visible = !0 } function Da(a) { S.call(this); this.type = "ShaderMaterial"; this.defines = {}; this.uniforms = {}; this.vertexShader = "void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}"; this.fragmentShader = "void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}"; this.linewidth = 1; this.wireframe = !1; this.wireframeLinewidth = 1; this.morphNormals = this.morphTargets = this.skinning = this.clipping = this.lights = this.fog = !1; this.extensions = { derivatives: !1, fragDepth: !1, drawBuffers: !1, shaderTextureLOD: !1 }; this.defaultAttributeValues = { color: [1, 1, 1], uv: [0, 0], uv2: [0, 0] }; this.index0AttributeName = void 0; void 0 !== a && (void 0 !== a.attributes && console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."), this.setValues(a)) } function Ua(a) { S.call(this); this.type = "MeshDepthMaterial"; this.depthPacking = 3200; this.morphTargets = this.skinning = !1; this.displacementMap = this.alphaMap = this.map = null; this.displacementScale = 1; this.displacementBias = 0; this.wireframe = !1; this.wireframeLinewidth = 1; this.lights = this.fog = !1; this.setValues(a) } function Ha(a, b) { this.min = void 0 !== a ? a : new q(Infinity, Infinity, Infinity); this.max = void 0 !== b ? b : new q(-Infinity, -Infinity, -Infinity) } function Aa(a, b) { this.center = void 0 !== a ? a : new q; this.radius = void 0 !== b ? b : 0 } function ya() { this.elements = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]); 0 < arguments.length && console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.") } function fa(a, b) { this.normal = void 0 !== a ? a : new q(1, 0, 0); this.constant = void 0 !== b ? b : 0 } function dc(a, b, c, d, e, f) { this.planes = [void 0 !== a ? a : new fa, void 0 !== b ? b : new fa, void 0 !== c ? c : new fa, void 0 !== d ? d : new fa, void 0 !== e ? e : new fa, void 0 !== f ? f : new fa] } function $d(a, b, c, d) { function e(b, c, d, e) { var f = b.geometry, g; g = A; var k = b.customDepthMaterial; d && (g = w, k = b.customDistanceMaterial); k ? g = k : (k = !1, c.morphTargets && (f && f.isBufferGeometry ? k = f.morphAttributes && f.morphAttributes.position && 0 < f.morphAttributes.position.length : f && f.isGeometry && (k = f.morphTargets && 0 < f.morphTargets.length)), b = b.isSkinnedMesh && c.skinning, f = 0, k && (f |= 1), b && (f |= 2), g = g[f]); a.localClippingEnabled && !0 === c.clipShadows && 0 !== c.clippingPlanes.length && (f = g.uuid, k = c.uuid, b = x[f], void 0 === b && (b = {}, x[f] = b), f = b[k], void 0 === f && (f = g.clone(), b[k] = f), g = f); g.visible = c.visible; g.wireframe = c.wireframe; k = c.side; ea.renderSingleSided && 2 == k && (k = 0); ea.renderReverseSided && (0 === k ? k = 1 : 1 === k && (k = 0)); g.side = k; g.clipShadows = c.clipShadows; g.clippingPlanes = c.clippingPlanes; g.wireframeLinewidth = c.wireframeLinewidth; g.linewidth = c.linewidth; d && void 0 !== g.uniforms.lightPos && g.uniforms.lightPos.value.copy(e); return g } function f(a, b, c) { if (!1 !== a.visible) { 0 !== (a.layers.mask & b.layers.mask) && (a.isMesh || a.isLine || a.isPoints) && a.castShadow && (!1 === a.frustumCulled || !0 === l.intersectsObject(a)) && !0 === a.material.visible && (a.modelViewMatrix.multiplyMatrices(c.matrixWorldInverse, a.matrixWorld), v.push(a)); a = a.children; for (var d = 0, e = a.length; d < e; d++) f(a[d], b, c) } } var g = a.context, k = a.state, l = new dc, m = new P, u = b.shadows, p = new C, n = new C(d.maxTextureSize, d.maxTextureSize), r = new q, t = new q, v = [], A = Array(4), w = Array(4), x = {}, T = [new q(1, 0, 0), new q(-1, 0, 0), new q(0, 0, 1), new q(0, 0, -1), new q(0, 1, 0), new q(0, -1, 0)], y = [new q(0, 1, 0), new q(0, 1, 0), new q(0, 1, 0), new q(0, 1, 0), new q(0, 0, 1), new q(0, 0, -1)], F = [new da, new da, new da, new da, new da, new da]; b = new Ua; b.depthPacking = 3201; b.clipping = !0; d = Cb.distanceRGBA; for (var G = h.UniformsUtils.clone(d.uniforms), E = 0; 4 !== E; ++E) { var J = 0 !== (E & 1), Ma = 0 !== (E & 2), N = b.clone(); N.morphTargets = J; N.skinning = Ma; A[E] = N; J = new Da({ defines: { USE_SHADOWMAP: "" }, uniforms: G, vertexShader: d.vertexShader, fragmentShader: d.fragmentShader, morphTargets: J, skinning: Ma, clipping: !0 }); w[E] = J } var ea = this; this.enabled = !1; this.autoUpdate = !0; this.needsUpdate = !1; this.type = 1; this.renderSingleSided = this.renderReverseSided = !0; this.render = function (b, d) { if (!1 !== ea.enabled && (!1 !== ea.autoUpdate || !1 !== ea.needsUpdate) && 0 !== u.length) { k.clearColor(1, 1, 1, 1); k.disable(g.BLEND); k.setDepthTest(!0); k.setScissorTest(!1); for (var h, x, w = 0, A = u.length; w < A; w++) { var q = u[w], G = q.shadow; if (void 0 === G) console.warn("THREE.WebGLShadowMap:", q, "has no shadow."); else { var E = G.camera; p.copy(G.mapSize); p.min(n); if (q && q.isPointLight) { h = 6; x = !0; var J = p.x, N = p.y; F[0].set(2 * J, N, J, N); F[1].set(0, N, J, N); F[2].set(3 * J, N, J, N); F[3].set(J, N, J, N); F[4].set(3 * J, 0, J, N); F[5].set(J, 0, J, N); p.x *= 4; p.y *= 2 } else h = 1, x = !1; null === G.map && (G.map = new zb(p.x, p.y, { minFilter: 1003, magFilter: 1003, format: 1023 }), E.updateProjectionMatrix()); G && G.isSpotLightShadow && G.update(q); J = G.map; G = G.matrix; t.setFromMatrixPosition(q.matrixWorld); E.position.copy(t); a.setRenderTarget(J); a.clear(); for (J = 0; J < h; J++) { x ? (r.copy(E.position), r.add(T[J]), E.up.copy(y[J]), E.lookAt(r), k.viewport(F[J])) : (r.setFromMatrixPosition(q.target.matrixWorld), E.lookAt(r)); E.updateMatrixWorld(); E.matrixWorldInverse.getInverse(E.matrixWorld); G.set(.5, 0, 0, .5, 0, .5, 0, .5, 0, 0, .5, .5, 0, 0, 0, 1); G.multiply(E.projectionMatrix); G.multiply(E.matrixWorldInverse); m.multiplyMatrices(E.projectionMatrix, E.matrixWorldInverse); l.setFromMatrix(m); v.length = 0; f(b, d, E); for (var N = 0, Ma = v.length; N < Ma; N++) { var C = v[N], z = c.update(C), D = C.material; if (D && D.isMultiMaterial) for (var Va = z.groups, D = D.materials, ld = 0, Ba = Va.length; ld < Ba; ld++) { var Qa = Va[ld], Na = D[Qa.materialIndex]; !0 === Na.visible && (Na = e(C, Na, x, t), a.renderBufferDirect(E, null, z, Na, C, Qa)) } else Na = e(C, D, x, t), a.renderBufferDirect(E, null, z, Na, C, null) } } } } h = a.getClearColor(); x = a.getClearAlpha(); a.setClearColor(h, x); ea.needsUpdate = !1 } } } function Wa(a, b) { this.origin = void 0 !== a ? a : new q; this.direction = void 0 !== b ? b : new q } function Xa(a, b, c, d) { this._x = a || 0; this._y = b || 0; this._z = c || 0; this._order = d || Xa.DefaultOrder } function Kc() { this.mask = 1 } function D() { Object.defineProperty(this, "id", { value: ae++ }); this.uuid = h.Math.generateUUID(); this.name = ""; this.type = "Object3D"; this.parent = null; this.children = []; this.up = D.DefaultUp.clone(); var a = new q, b = new Xa, c = new ca, d = new q(1, 1, 1); b.onChange(function () { c.setFromEuler(b, !1) }); c.onChange(function () { b.setFromQuaternion(c, void 0, !1) }); Object.defineProperties(this, { position: { enumerable: !0, value: a }, rotation: { enumerable: !0, value: b }, quaternion: { enumerable: !0, value: c }, scale: { enumerable: !0, value: d }, modelViewMatrix: { value: new P }, normalMatrix: { value: new ya } }); this.matrix = new P; this.matrixWorld = new P; this.matrixAutoUpdate = D.DefaultMatrixAutoUpdate; this.matrixWorldNeedsUpdate = !1; this.layers = new Kc; this.visible = !0; this.receiveShadow = this.castShadow = !1; this.frustumCulled = !0; this.renderOrder = 0; this.userData = {}; this.onBeforeRender = null } function cb(a, b) { this.start = void 0 !== a ? a : new q; this.end = void 0 !== b ? b : new q } function Fa(a, b, c) { this.a = void 0 !== a ? a : new q; this.b = void 0 !== b ? b : new q; this.c = void 0 !== c ? c : new q } function ga(a, b, c, d, e, f) { this.a = a; this.b = b; this.c = c; this.normal = d && d.isVector3 ? d : new q; this.vertexNormals = Array.isArray(d) ? d : []; this.color = e && e.isColor ? e : new H; this.vertexColors = Array.isArray(e) ? e : []; this.materialIndex = void 0 !== f ? f : 0 } function Ia(a) { S.call(this); this.type = "MeshBasicMaterial"; this.color = new H(16777215); this.aoMap = this.map = null; this.aoMapIntensity = 1; this.envMap = this.alphaMap = this.specularMap = null; this.combine = 0; this.reflectivity = 1; this.refractionRatio = .98; this.wireframe = !1; this.wireframeLinewidth = 1; this.wireframeLinejoin = this.wireframeLinecap = "round"; this.lights = this.morphTargets = this.skinning = !1; this.setValues(a) } function z(a, b, c) { if (Array.isArray(a)) throw new TypeError("THREE.BufferAttribute: array should be a Typed Array."); this.uuid = h.Math.generateUUID(); this.array = a; this.itemSize = b; this.count = void 0 !== a ? a.length / b : 0; this.normalized = !0 === c; this.dynamic = !1; this.updateRange = { offset: 0, count: -1 }; this.version = 0 } function be(a, b) { return new z(new Uint16Array(a), b) } function ce(a, b) { return new z(new Uint32Array(a), b) } function ma(a, b) { return new z(new Float32Array(a), b) } function R() { Object.defineProperty(this, "id", { value: Lc++ }); this.uuid = h.Math.generateUUID(); this.name = ""; this.type = "Geometry"; this.vertices = []; this.colors = []; this.faces = []; this.faceVertexUvs = [[]]; this.morphTargets = []; this.morphNormals = []; this.skinWeights = []; this.skinIndices = []; this.lineDistances = []; this.boundingSphere = this.boundingBox = null; this.groupsNeedUpdate = this.lineDistancesNeedUpdate = this.colorsNeedUpdate = this.normalsNeedUpdate = this.uvsNeedUpdate = this.verticesNeedUpdate = this.elementsNeedUpdate = !1 } function de() { Object.defineProperty(this, "id", { value: Lc++ }); this.uuid = h.Math.generateUUID(); this.name = ""; this.type = "DirectGeometry"; this.indices = []; this.vertices = []; this.normals = []; this.colors = []; this.uvs = []; this.uvs2 = []; this.groups = []; this.morphTargets = {}; this.skinWeights = []; this.skinIndices = []; this.boundingSphere = this.boundingBox = null; this.groupsNeedUpdate = this.uvsNeedUpdate = this.colorsNeedUpdate = this.normalsNeedUpdate = this.verticesNeedUpdate = !1 } function I() { Object.defineProperty(this, "id", { value: Lc++ }); this.uuid = h.Math.generateUUID(); this.name = ""; this.type = "BufferGeometry"; this.index = null; this.attributes = {}; this.morphAttributes = {}; this.groups = []; this.boundingSphere = this.boundingBox = null; this.drawRange = { start: 0, count: Infinity } } function va(a, b) { D.call(this); this.type = "Mesh"; this.geometry = void 0 !== a ? a : new I; this.material = void 0 !== b ? b : new Ia({ color: 16777215 * Math.random() }); this.drawMode = 0; this.updateMorphTargets() } function db(a, b, c, d, e, f) { function g(a, b, c, d, e, f, g, l, m, C, D) { var z = f / m, L = g / C, M = f / 2, O = g / 2, Q = l / 2; g = m + 1; for (var H = C + 1, V = f = 0, W = new q, K = 0; K < H; K++) for (var P = K * L - O, I = 0; I < g; I++) W[a] = (I * z - M) * d, W[b] = P * e, W[c] = Q, h[t] = W.x, h[t + 1] = W.y, h[t + 2] = W.z, W[a] = 0, W[b] = 0, W[c] = 0 < l ? 1 : -1, n[t] = W.x, n[t + 1] = W.y, n[t + 2] = W.z, r[v] = I / m, r[v + 1] = 1 - K / C, t += 3, v += 2, f += 1; for (K = 0; K < C; K++) for (I = 0; I < m; I++) a = w + I + g * (K + 1), b = w + (I + 1) + g * (K + 1), c = w + (I + 1) + g * K, u[A] = w + I + g * K, u[A + 1] = a, u[A + 2] = c, u[A + 3] = a, u[A + 4] = b, u[A + 5] = c, A += 6, V += 6; k.addGroup(x, V, D); x += V; w += f } I.call(this); this.type = "BoxBufferGeometry"; this.parameters = { width: a, height: b, depth: c, widthSegments: d, heightSegments: e, depthSegments: f }; var k = this; d = Math.floor(d) || 1; e = Math.floor(e) || 1; f = Math.floor(f) || 1; var l = function (a, b, c) { return a = 0 + (a + 1) * (b + 1) * 2 + (a + 1) * (c + 1) * 2 + (c + 1) * (b + 1) * 2 } (d, e, f), m = function (a, b, c) { a = 0 + a * b * 2 + a * c * 2 + c * b * 2; return 6 * a } (d, e, f), u = new(65535 < m ? Uint32Array : Uint16Array)(m), h = new Float32Array(3 * l), n = new Float32Array(3 * l), r = new Float32Array(2 * l), t = 0, v = 0, A = 0, w = 0, x = 0; g("z", "y", "x", -1, -1, c, b, a, f, e, 0); g("z", "y", "x", 1, -1, c, b, -a, f, e, 1); g("x", "z", "y", 1, 1, a, c, b, d, f, 2); g("x", "z", "y", 1, -1, a, c, -b, d, f, 3); g("x", "y", "z", 1, -1, a, b, c, d, e, 4); g("x", "y", "z", -1, -1, a, b, -c, d, e, 5); this.setIndex(new z(u, 1)); this.addAttribute("position", new z(h, 3)); this.addAttribute("normal", new z(n, 3)); this.addAttribute("uv", new z(r, 2)) } function eb(a, b, c, d) { I.call(this); this.type = "PlaneBufferGeometry"; this.parameters = { width: a, height: b, widthSegments: c, heightSegments: d }; var e = a / 2, f = b / 2; c = Math.floor(c) || 1; d = Math.floor(d) || 1; var g = c + 1, k = d + 1, l = a / c, m = b / d; b = new Float32Array(g * k * 3); a = new Float32Array(g * k * 3); for (var u = new Float32Array(g * k * 2), h = 0, n = 0, r = 0; r < k; r++) for (var t = r * m - f, v = 0; v < g; v++) b[h] = v * l - e, b[h + 1] = -t, a[h + 2] = 1, u[n] = v / c, u[n + 1] = 1 - r / d, h += 3, n += 2; h = 0; e = new(65535 < b.length / 3 ? Uint32Array : Uint16Array)(c * d * 6); for (r = 0; r < d; r++) for (v = 0; v < c; v++) f = v + g * (r + 1), k = v + 1 + g * (r + 1), l = v + 1 + g * r, e[h] = v + g * r, e[h + 1] = f, e[h + 2] = l, e[h + 3] = f, e[h + 4] = k, e[h + 5] = l, h += 6; this.setIndex(new z(e, 1)); this.addAttribute("position", new z(b, 3)); this.addAttribute("normal", new z(a, 3)); this.addAttribute("uv", new z(u, 2)) } function qa() { D.call(this); this.type = "Camera"; this.matrixWorldInverse = new P; this.projectionMatrix = new P } function Ca(a, b, c, d) { qa.call(this); this.type = "PerspectiveCamera"; this.fov = void 0 !== a ? a : 50; this.zoom = 1; this.near = void 0 !== c ? c : .1; this.far = void 0 !== d ? d : 2E3; this.focus = 10; this.aspect = void 0 !== b ? b : 1; this.view = null; this.filmGauge = 35; this.filmOffset = 0; this.updateProjectionMatrix() } function Db(a, b, c, d, e, f) { qa.call(this); this.type = "OrthographicCamera"; this.zoom = 1; this.view = null; this.left = a; this.right = b; this.top = c; this.bottom = d; this.near = void 0 !== e ? e : .1; this.far = void 0 !== f ? f : 2E3; this.updateProjectionMatrix() } function Te(a, b, c) { var d, e, f; return { setMode: function (a) { d = a }, setIndex: function (c) { c.array instanceof Uint32Array && b.get("OES_element_index_uint") ? (e = a.UNSIGNED_INT, f = 4) : (e = a.UNSIGNED_SHORT, f = 2) }, render: function (b, k) { a.drawElements(d, k, e, b * f); c.calls++; c.vertices += k; d === a.TRIANGLES && (c.faces += k / 3) }, renderInstances: function (g, k, l) { var m = b.get("ANGLE_instanced_arrays"); null === m ? console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.") : (m.drawElementsInstancedANGLE(d, l, e, k * f, g.maxInstancedCount), c.calls++, c.vertices += l * g.maxInstancedCount, d === a.TRIANGLES && (c.faces += g.maxInstancedCount * l / 3)) } } } function Ue(a, b, c) { var d; return { setMode: function (a) { d = a }, render: function (b, f) { a.drawArrays(d, b, f); c.calls++; c.vertices += f; d === a.TRIANGLES && (c.faces += f / 3) }, renderInstances: function (e) { var f = b.get("ANGLE_instanced_arrays"); if (null === f) console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays."); else { var g = e.attributes.position, g = g && g.isInterleavedBufferAttribute ? g.data.count : g.count; f.drawArraysInstancedANGLE(d, 0, g, e.maxInstancedCount); c.calls++; c.vertices += g * e.maxInstancedCount; d === a.TRIANGLES && (c.faces += e.maxInstancedCount * g / 3) } } } } function Ve() { var a = {}; return { get: function (b) { if (void 0 !== a[b.id]) return a[b.id]; var c; switch (b.type) { case "DirectionalLight": c = { direction: new q, color: new H, shadow: !1, shadowBias: 0, shadowRadius: 1, shadowMapSize: new C }; break; case "SpotLight": c = { position: new q, direction: new q, color: new H, distance: 0, coneCos: 0, penumbraCos: 0, decay: 0, shadow: !1, shadowBias: 0, shadowRadius: 1, shadowMapSize: new C }; break; case "PointLight": c = { position: new q, color: new H, distance: 0, decay: 0, shadow: !1, shadowBias: 0, shadowRadius: 1, shadowMapSize: new C }; break; case "HemisphereLight": c = { direction: new q, skyColor: new H, groundColor: new H } } return a[b.id] = c } } } function We(a) { a = a.split("\n"); for (var b = 0; b < a.length; b++) a[b] = b + 1 + ": " + a[b]; return a.join("\n") } function ee(a, b, c) { var d = a.createShader(b); a.shaderSource(d, c); a.compileShader(d); !1 === a.getShaderParameter(d, a.COMPILE_STATUS) && console.error("THREE.WebGLShader: Shader couldn't compile."); "" !== a.getShaderInfoLog(d) && console.warn("THREE.WebGLShader: gl.getShaderInfoLog()", b === a.VERTEX_SHADER ? "vertex" : "fragment", a.getShaderInfoLog(d), We(c)); return d } function fe(a) { switch (a) { case 3E3: return ["Linear", "( value )"]; case 3001: return ["sRGB", "( value )"]; case 3002: return ["RGBE", "( value )"]; case 3004: return ["RGBM", "( value, 7.0 )"]; case 3005: return ["RGBM", "( value, 16.0 )"]; case 3006: return ["RGBD", "( value, 256.0 )"]; case 3007: return ["Gamma", "( value, float( GAMMA_FACTOR ) )"]; default: throw Error("unsupported encoding: " + a); } } function md(a, b) { var c = fe(b); return "vec4 " + a + "( vec4 value ) { return " + c[0] + "ToLinear" + c[1] + "; }" } function Xe(a, b) { var c = fe(b); return "vec4 " + a + "( vec4 value ) { return LinearTo" + c[0] + c[1] + "; }" } function Ye(a, b) { var c; switch (b) { case 1: c = "Linear"; break; case 2: c = "Reinhard"; break; case 3: c = "Uncharted2"; break; case 4: c = "OptimizedCineon"; break; default: throw Error("unsupported toneMapping: " + b); } return "vec3 " + a + "( vec3 color ) { return " + c + "ToneMapping( color ); }" } function Ze(a, b, c) { a = a || {}; return [a.derivatives || b.envMapCubeUV || b.bumpMap || b.normalMap || b.flatShading ? "#extension GL_OES_standard_derivatives : enable" : "", (a.fragDepth || b.logarithmicDepthBuffer) && c.get("EXT_frag_depth") ? "#extension GL_EXT_frag_depth : enable" : "", a.drawBuffers && c.get("WEBGL_draw_buffers") ? "#extension GL_EXT_draw_buffers : require" : "", (a.shaderTextureLOD || b.envMap) && c.get("EXT_shader_texture_lod") ? "#extension GL_EXT_shader_texture_lod : enable" : ""].filter(ec).join("\n") } function $e(a) { var b = [], c; for (c in a) { var d = a[c]; !1 !== d && b.push("#define " + c + " " + d) } return b.join("\n") } function ec(a) { return "" !== a } function ge(a, b) { return a.replace(/NUM_DIR_LIGHTS/g, b.numDirLights).replace(/NUM_SPOT_LIGHTS/g, b.numSpotLights).replace(/NUM_POINT_LIGHTS/g, b.numPointLights).replace(/NUM_HEMI_LIGHTS/g, b.numHemiLights) } function nd(a) { return a.replace(/#include +<([\w\d.]+)>/g, function (a, c) { var d = Z[c]; if (void 0 === d) throw Error("Can not resolve #include <" + c + ">"); return nd(d) }) } function he(a) { return a.replace(/for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g, function (a, c, d, e) { a = ""; for (c = parseInt(c); c < parseInt(d); c++) a += e.replace(/\[ i \]/g, "[ " + c + " ]"); return a }) } function af(a, b, c, d) { var e = a.context, f = c.extensions, g = c.defines, k = c.__webglShader.vertexShader, l = c.__webglShader.fragmentShader, m = "SHADOWMAP_TYPE_BASIC"; 1 === d.shadowMapType ? m = "SHADOWMAP_TYPE_PCF" : 2 === d.shadowMapType && (m = "SHADOWMAP_TYPE_PCF_SOFT"); var h = "ENVMAP_TYPE_CUBE", p = "ENVMAP_MODE_REFLECTION", n = "ENVMAP_BLENDING_MULTIPLY"; if (d.envMap) { switch (c.envMap.mapping) { case 301: case 302: h = "ENVMAP_TYPE_CUBE"; break; case 306: case 307: h = "ENVMAP_TYPE_CUBE_UV"; break; case 303: case 304: h = "ENVMAP_TYPE_EQUIREC"; break; case 305: h = "ENVMAP_TYPE_SPHERE" } switch (c.envMap.mapping) { case 302: case 304: p = "ENVMAP_MODE_REFRACTION" } switch (c.combine) { case 0: n = "ENVMAP_BLENDING_MULTIPLY"; break; case 1: n = "ENVMAP_BLENDING_MIX"; break; case 2: n = "ENVMAP_BLENDING_ADD" } } var r = 0 < a.gammaFactor ? a.gammaFactor : 1, f = Ze(f, d, a.extensions), t = $e(g), v = e.createProgram(); c.isRawShaderMaterial ? (g = [t, "\n"].filter(ec).join("\n"), m = [f, t, "\n"].filter(ec).join("\n")) : (g = ["precision " + d.precision + " float;", "precision " + d.precision + " int;", "#define SHADER_NAME " + c.__webglShader.name, t, d.supportsVertexTextures ? "#define VERTEX_TEXTURES" : "", "#define GAMMA_FACTOR " + r, "#define MAX_BONES " + d.maxBones, d.map ? "#define USE_MAP" : "", d.envMap ? "#define USE_ENVMAP" : "", d.envMap ? "#define " + p : "", d.lightMap ? "#define USE_LIGHTMAP" : "", d.aoMap ? "#define USE_AOMAP" : "", d.emissiveMap ? "#define USE_EMISSIVEMAP" : "", d.bumpMap ? "#define USE_BUMPMAP" : "", d.normalMap ? "#define USE_NORMALMAP" : "", d.displacementMap && d.supportsVertexTextures ? "#define USE_DISPLACEMENTMAP" : "", d.specularMap ? "#define USE_SPECULARMAP" : "", d.roughnessMap ? "#define USE_ROUGHNESSMAP" : "", d.metalnessMap ? "#define USE_METALNESSMAP" : "", d.alphaMap ? "#define USE_ALPHAMAP" : "", d.vertexColors ? "#define USE_COLOR" : "", d.flatShading ? "#define FLAT_SHADED" : "", d.skinning ? "#define USE_SKINNING" : "", d.useVertexTexture ? "#define BONE_TEXTURE" : "", d.morphTargets ? "#define USE_MORPHTARGETS" : "", d.morphNormals && !1 === d.flatShading ? "#define USE_MORPHNORMALS" : "", d.doubleSided ? "#define DOUBLE_SIDED" : "", d.flipSided ? "#define FLIP_SIDED" : "", "#define NUM_CLIPPING_PLANES " + d.numClippingPlanes, d.shadowMapEnabled ? "#define USE_SHADOWMAP" : "", d.shadowMapEnabled ? "#define " + m : "", d.sizeAttenuation ? "#define USE_SIZEATTENUATION" : "", d.logarithmicDepthBuffer ? "#define USE_LOGDEPTHBUF" : "", d.logarithmicDepthBuffer && a.extensions.get("EXT_frag_depth") ? "#define USE_LOGDEPTHBUF_EXT" : "", "uniform mat4 modelMatrix;", "uniform mat4 modelViewMatrix;", "uniform mat4 projectionMatrix;", "uniform mat4 viewMatrix;", "uniform mat3 normalMatrix;", "uniform vec3 cameraPosition;", "attribute vec3 position;", "attribute vec3 normal;", "attribute vec2 uv;", "#ifdef USE_COLOR", "\tattribute vec3 color;", "#endif", "#ifdef USE_MORPHTARGETS", "\tattribute vec3 morphTarget0;", "\tattribute vec3 morphTarget1;", "\tattribute vec3 morphTarget2;", "\tattribute vec3 morphTarget3;", "\t#ifdef USE_MORPHNORMALS", "\t\tattribute vec3 morphNormal0;", "\t\tattribute vec3 morphNormal1;", "\t\tattribute vec3 morphNormal2;", "\t\tattribute vec3 morphNormal3;", "\t#else", "\t\tattribute vec3 morphTarget4;", "\t\tattribute vec3 morphTarget5;", "\t\tattribute vec3 morphTarget6;", "\t\tattribute vec3 morphTarget7;", "\t#endif", "#endif", "#ifdef USE_SKINNING", "\tattribute vec4 skinIndex;", "\tattribute vec4 skinWeight;", "#endif", "\n"].filter(ec).join("\n"), m = [f, "precision " + d.precision + " float;", "precision " + d.precision + " int;", "#define SHADER_NAME " + c.__webglShader.name, t, d.alphaTest ? "#define ALPHATEST " + d.alphaTest : "", "#define GAMMA_FACTOR " + r, d.useFog && d.fog ? "#define USE_FOG" : "", d.useFog && d.fogExp ? "#define FOG_EXP2" : "", d.map ? "#define USE_MAP" : "", d.envMap ? "#define USE_ENVMAP" : "", d.envMap ? "#define " + h : "", d.envMap ? "#define " + p : "", d.envMap ? "#define " + n : "", d.lightMap ? "#define USE_LIGHTMAP" : "", d.aoMap ? "#define USE_AOMAP" : "", d.emissiveMap ? "#define USE_EMISSIVEMAP" : "", d.bumpMap ? "#define USE_BUMPMAP" : "", d.normalMap ? "#define USE_NORMALMAP" : "", d.specularMap ? "#define USE_SPECULARMAP" : "", d.roughnessMap ? "#define USE_ROUGHNESSMAP" : "", d.metalnessMap ? "#define USE_METALNESSMAP" : "", d.alphaMap ? "#define USE_ALPHAMAP" : "", d.vertexColors ? "#define USE_COLOR" : "", d.flatShading ? "#define FLAT_SHADED" : "", d.doubleSided ? "#define DOUBLE_SIDED" : "", d.flipSided ? "#define FLIP_SIDED" : "", "#define NUM_CLIPPING_PLANES " + d.numClippingPlanes, d.shadowMapEnabled ? "#define USE_SHADOWMAP" : "", d.shadowMapEnabled ? "#define " + m : "", d.premultipliedAlpha ? "#define PREMULTIPLIED_ALPHA" : "", d.physicallyCorrectLights ? "#define PHYSICALLY_CORRECT_LIGHTS" : "", d.logarithmicDepthBuffer ? "#define USE_LOGDEPTHBUF" : "", d.logarithmicDepthBuffer && a.extensions.get("EXT_frag_depth") ? "#define USE_LOGDEPTHBUF_EXT" : "", d.envMap && a.extensions.get("EXT_shader_texture_lod") ? "#define TEXTURE_LOD_EXT" : "", "uniform mat4 viewMatrix;", "uniform vec3 cameraPosition;", 0 !== d.toneMapping ? "#define TONE_MAPPING" : "", 0 !== d.toneMapping ? Z.tonemapping_pars_fragment : "", 0 !== d.toneMapping ? Ye("toneMapping", d.toneMapping) : "", d.outputEncoding || d.mapEncoding || d.envMapEncoding || d.emissiveMapEncoding ? Z.encodings_pars_fragment : "", d.mapEncoding ? md("mapTexelToLinear", d.mapEncoding) : "", d.envMapEncoding ? md("envMapTexelToLinear", d.envMapEncoding) : "", d.emissiveMapEncoding ? md("emissiveMapTexelToLinear", d.emissiveMapEncoding) : "", d.outputEncoding ? Xe("linearToOutputTexel", d.outputEncoding) : "", d.depthPacking ? "#define DEPTH_PACKING " + c.depthPacking : "", "\n"].filter(ec).join("\n")); k = nd(k, d); k = ge(k, d); l = nd(l, d); l = ge(l, d); c.isShaderMaterial || (k = he(k), l = he(l)); l = m + l; k = ee(e, e.VERTEX_SHADER, g + k); l = ee(e, e.FRAGMENT_SHADER, l); e.attachShader(v, k); e.attachShader(v, l); void 0 !== c.index0AttributeName ? e.bindAttribLocation(v, 0, c.index0AttributeName) : !0 === d.morphTargets && e.bindAttribLocation(v, 0, "position"); e.linkProgram(v); d = e.getProgramInfoLog(v); h = e.getShaderInfoLog(k); p = e.getShaderInfoLog(l); r = n = !0; if (!1 === e.getProgramParameter(v, e.LINK_STATUS)) n = !1, console.error("THREE.WebGLProgram: shader error: ", e.getError(), "gl.VALIDATE_STATUS", e.getProgramParameter(v, e.VALIDATE_STATUS), "gl.getProgramInfoLog", d, h, p); else if ("" !== d) console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()", d); else if ("" === h || "" === p) r = !1; r && (this.diagnostics = { runnable: n, material: c, programLog: d, vertexShader: { log: h, prefix: g }, fragmentShader: { log: p, prefix: m } }); e.deleteShader(k); e.deleteShader(l); var A; this.getUniforms = function () { void 0 === A && (A = new Ga(e, v, a)); return A }; var w; this.getAttributes = function () { if (void 0 === w) { for (var a = {}, b = e.getProgramParameter(v, e.ACTIVE_ATTRIBUTES), c = 0; c < b; c++) { var d = e.getActiveAttrib(v, c).name; a[d] = e.getAttribLocation(v, d) } w = a } return w }; this.destroy = function () { e.deleteProgram(v); this.program = void 0 }; Object.defineProperties(this, { uniforms: { get: function () { console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."); return this.getUniforms() } }, attributes: { get: function () { console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."); return this.getAttributes() } } }); this.id = bf++; this.code = b; this.usedTimes = 1; this.program = v; this.vertexShader = k; this.fragmentShader = l; return this } function cf(a, b) { function c(a, b) { var c; a ? a && a.isTexture ? c = a.encoding : a && a.isWebGLRenderTarget && (console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."), c = a.texture.encoding) : c = 3E3; 3E3 === c && b && (c = 3007); return c } var d = [], e = { MeshDepthMaterial: "depth", MeshNormalMaterial: "normal", MeshBasicMaterial: "basic", MeshLambertMaterial: "lambert", MeshPhongMaterial: "phong", MeshStandardMaterial: "physical", MeshPhysicalMaterial: "physical", LineBasicMaterial: "basic", LineDashedMaterial: "dashed", PointsMaterial: "points" }, f = "precision supportsVertexTextures map mapEncoding envMap envMapMode envMapEncoding lightMap aoMap emissiveMap emissiveMapEncoding bumpMap normalMap displacementMap specularMap roughnessMap metalnessMap alphaMap combine vertexColors fog useFog fogExp flatShading sizeAttenuation logarithmicDepthBuffer skinning maxBones useVertexTexture morphTargets morphNormals maxMorphTargets maxMorphNormals premultipliedAlpha numDirLights numPointLights numSpotLights numHemiLights shadowMapEnabled shadowMapType toneMapping physicallyCorrectLights alphaTest doubleSided flipSided numClippingPlanes depthPacking".split(" "); this.getParameters = function (d, f, l, m, h) { var p = e[d.type], n; b.floatVertexTextures && h && h.skeleton && h.skeleton.useVertexTexture ? n = 1024 : (n = Math.floor((b.maxVertexUniforms - 20) / 4), void 0 !== h && h && h.isSkinnedMesh && (n = Math.min(h.skeleton.bones.length, n), n < h.skeleton.bones.length && console.warn("WebGLRenderer: too many bones - " + h.skeleton.bones.length + ", this GPU supports just " + n + " (try OpenGL instead of ANGLE)"))); var r = a.getPrecision(); null !== d.precision && (r = b.getMaxPrecision(d.precision), r !== d.precision && console.warn("THREE.WebGLProgram.getParameters:", d.precision, "not supported, using", r, "instead.")); var t = a.getCurrentRenderTarget(); return { shaderID: p, precision: r, supportsVertexTextures: b.vertexTextures, outputEncoding: c(t ? t.texture : null, a.gammaOutput), map: !!d.map, mapEncoding: c(d.map, a.gammaInput), envMap: !!d.envMap, envMapMode: d.envMap && d.envMap.mapping, envMapEncoding: c(d.envMap, a.gammaInput), envMapCubeUV: !!d.envMap && (306 === d.envMap.mapping || 307 === d.envMap.mapping), lightMap: !!d.lightMap, aoMap: !!d.aoMap, emissiveMap: !!d.emissiveMap, emissiveMapEncoding: c(d.emissiveMap, a.gammaInput), bumpMap: !!d.bumpMap, normalMap: !!d.normalMap, displacementMap: !!d.displacementMap, roughnessMap: !!d.roughnessMap, metalnessMap: !!d.metalnessMap, specularMap: !!d.specularMap, alphaMap: !!d.alphaMap, combine: d.combine, vertexColors: d.vertexColors, fog: !!l, useFog: d.fog, fogExp: l && l.isFogExp2, flatShading: 1 === d.shading, sizeAttenuation: d.sizeAttenuation, logarithmicDepthBuffer: b.logarithmicDepthBuffer, skinning: d.skinning, maxBones: n, useVertexTexture: b.floatVertexTextures && h && h.skeleton && h.skeleton.useVertexTexture, morphTargets: d.morphTargets, morphNormals: d.morphNormals, maxMorphTargets: a.maxMorphTargets, maxMorphNormals: a.maxMorphNormals, numDirLights: f.directional.length, numPointLights: f.point.length, numSpotLights: f.spot.length, numHemiLights: f.hemi.length, numClippingPlanes: m, shadowMapEnabled: a.shadowMap.enabled && h.receiveShadow && 0 < f.shadows.length, shadowMapType: a.shadowMap.type, toneMapping: a.toneMapping, physicallyCorrectLights: a.physicallyCorrectLights, premultipliedAlpha: d.premultipliedAlpha, alphaTest: d.alphaTest, doubleSided: 2 === d.side, flipSided: 1 === d.side, depthPacking: void 0 !== d.depthPacking ? d.depthPacking : !1 } }; this.getProgramCode = function (a, b) { var c = []; b.shaderID ? c.push(b.shaderID) : (c.push(a.fragmentShader), c.push(a.vertexShader)); if (void 0 !== a.defines) for (var d in a.defines) c.push(d), c.push(a.defines[d]); for (d = 0; d < f.length; d++) c.push(b[f[d]]); return c.join() }; this.acquireProgram = function (b, c, e) { for (var f, h = 0, p = d.length; h < p; h++) { var n = d[h]; if (n.code === e) { f = n; ++f.usedTimes; break } } void 0 === f && (f = new af(a, e, b, c), d.push(f)); return f }; this.releaseProgram = function (a) { if (0 === --a.usedTimes) { var b = d.indexOf(a); d[b] = d[d.length - 1]; d.pop(); a.destroy() } }; this.programs = d } function df(a, b, c) { function d(a) { var k = a.target; a = f[k.id]; null !== a.index && e(a.index); var l = a.attributes, m; for (m in l) e(l[m]); k.removeEventListener("dispose", d); delete f[k.id]; m = b.get(k); m.wireframe && e(m.wireframe); b["delete"](k); k = b.get(a); k.wireframe && e(k.wireframe); b["delete"](a); c.memory.geometries-- } function e(c) { var d; d = c.isInterleavedBufferAttribute ? b.get(c.data).__webglBuffer : b.get(c).__webglBuffer; void 0 !== d && (a.deleteBuffer(d), c.isInterleavedBufferAttribute ? b["delete"](c.data) : b["delete"](c)) } var f = {}; return { get: function (a) { var b = a.geometry; if (void 0 !== f[b.id]) return f[b.id]; b.addEventListener("dispose", d); var e; b.isBufferGeometry ? e = b : b.isGeometry && (void 0 === b._bufferGeometry && (b._bufferGeometry = (new I).setFromObject(a)), e = b._bufferGeometry); f[b.id] = e; c.memory.geometries++; return e } } } function ef(a, b, c) { function d(c, d) { var e = c.isInterleavedBufferAttribute ? c.data : c, l = b.get(e); void 0 === l.__webglBuffer ? (l.__webglBuffer = a.createBuffer(), a.bindBuffer(d, l.__webglBuffer), a.bufferData(d, e.array, e.dynamic ? a.DYNAMIC_DRAW : a.STATIC_DRAW), l.version = e.version) : l.version !== e.version && (a.bindBuffer(d, l.__webglBuffer), !1 === e.dynamic || -1 === e.updateRange.count ? a.bufferSubData(d, 0, e.array) : 0 === e.updateRange.count ? console.error("THREE.WebGLObjects.updateBuffer: dynamic THREE.BufferAttribute marked as needsUpdate but updateRange.count is 0, ensure you are using set methods or updating manually.") : (a.bufferSubData(d, e.updateRange.offset * e.array.BYTES_PER_ELEMENT, e.array.subarray(e.updateRange.offset, e.updateRange.offset + e.updateRange.count)), e.updateRange.count = 0), l.version = e.version) } var e = new df(a, b, c); return { getAttributeBuffer: function (a) { return a.isInterleavedBufferAttribute ? b.get(a.data).__webglBuffer : b.get(a).__webglBuffer }, getWireframeAttribute: function (c) { var e = b.get(c); if (void 0 !== e.wireframe) return e.wireframe; var k = [], l = c.index, m = c.attributes; c = m.position; if (null !== l) for (var l = l.array, m = 0, h = l.length; m < h; m += 3) { var p = l[m + 0], n = l[m + 1], r = l[m + 2]; k.push(p, n, n, r, r, p) } else for (l = m.position.array, m = 0, h = l.length / 3 - 1; m < h; m += 3) p = m + 0, n = m + 1, r = m + 2, k.push(p, n, n, r, r, p); k = new z(new(65535 < c.count ? Uint32Array : Uint16Array)(k), 1); d(k, a.ELEMENT_ARRAY_BUFFER); return e.wireframe = k }, update: function (b) { var c = e.get(b); b.geometry.isGeometry && c.updateFromObject(b); b = c.index; var k = c.attributes; null !== b && d(b, a.ELEMENT_ARRAY_BUFFER); for (var l in k) d(k[l], a.ARRAY_BUFFER); b = c.morphAttributes; for (l in b) for (var k = b[l], m = 0, h = k.length; m < h; m++) d(k[m], a.ARRAY_BUFFER); return c } } } function ff(a, b, c, d, e, f, g) { function k(a, b) { if (a.width > b || a.height > b) { var c = b / Math.max(a.width, a.height), d = document.createElementNS("http://www.w3.org/1999/xhtml", "canvas"); d.width = Math.floor(a.width * c); d.height = Math.floor(a.height * c); d.getContext("2d").drawImage(a, 0, 0, a.width, a.height, 0, 0, d.width, d.height); console.warn("THREE.WebGLRenderer: image is too big (" + a.width + "x" + a.height + "). Resized to " + d.width + "x" + d.height, a); return d } return a } function l(a) { return h.Math.isPowerOfTwo(a.width) && h.Math.isPowerOfTwo(a.height) } function m(b) { return 1003 === b || 1004 === b || 1005 === b ? a.NEAREST : a.LINEAR } function u(b) { b = b.target; b.removeEventListener("dispose", u); a: { var c = d.get(b); if (b.image && c.__image__webglTextureCube) a.deleteTexture(c.__image__webglTextureCube); else { if (void 0 === c.__webglInit) break a; a.deleteTexture(c.__webglTexture) } d["delete"](b) } A.textures-- } function p(b) { b = b.target; b.removeEventListener("dispose", p); var c = d.get(b), e = d.get(b.texture); if (b) { void 0 !== e.__webglTexture && a.deleteTexture(e.__webglTexture); b.depthTexture && b.depthTexture.dispose(); if (b && b.isWebGLRenderTargetCube) for (e = 0; 6 > e; e++) a.deleteFramebuffer(c.__webglFramebuffer[e]), c.__webglDepthbuffer && a.deleteRenderbuffer(c.__webglDepthbuffer[e]); else a.deleteFramebuffer(c.__webglFramebuffer), c.__webglDepthbuffer && a.deleteRenderbuffer(c.__webglDepthbuffer); d["delete"](b.texture); d["delete"](b) } A.textures-- } function n(b, g) { var m = d.get(b); if (0 < b.version && m.__version !== b.version) { var n = b.image; if (void 0 === n) console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined", b); else if (!1 === n.complete) console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete", b); else { void 0 === m.__webglInit && (m.__webglInit = !0, b.addEventListener("dispose", u), m.__webglTexture = a.createTexture(), A.textures++); c.activeTexture(a.TEXTURE0 + g); c.bindTexture(a.TEXTURE_2D, m.__webglTexture); a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL, b.flipY); a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL, b.premultiplyAlpha); a.pixelStorei(a.UNPACK_ALIGNMENT, b.unpackAlignment); var p = k(b.image, e.maxTextureSize); if ((1001 !== b.wrapS || 1001 !== b.wrapT || 1003 !== b.minFilter && 1006 !== b.minFilter) && !1 === l(p)) if (n = p, n instanceof HTMLImageElement || n instanceof HTMLCanvasElement) { var t = document.createElementNS("http://www.w3.org/1999/xhtml", "canvas"); t.width = h.Math.nearestPowerOfTwo(n.width); t.height = h.Math.nearestPowerOfTwo(n.height); t.getContext("2d").drawImage(n, 0, 0, t.width, t.height); console.warn("THREE.WebGLRenderer: image is not power of two (" + n.width + "x" + n.height + "). Resized to " + t.width + "x" + t.height, n); p = t } else p = n; var n = l(p), t = f(b.format), v = f(b.type); r(a.TEXTURE_2D, b, n); var q = b.mipmaps; if (b && b.isDepthTexture) { q = a.DEPTH_COMPONENT; if (1015 === b.type) { if (!w) throw Error("Float Depth Texture only supported in WebGL2.0"); q = a.DEPTH_COMPONENT32F } else w && (q = a.DEPTH_COMPONENT16); 1027 === b.format && (q = a.DEPTH_STENCIL); c.texImage2D(a.TEXTURE_2D, 0, q, p.width, p.height, 0, t, v, null) } else if (b && b.isDataTexture) if (0 < q.length && n) { for (var N = 0, C = q.length; N < C; N++) p = q[N], c.texImage2D(a.TEXTURE_2D, N, t, p.width, p.height, 0, t, v, p.data); b.generateMipmaps = !1 } else c.texImage2D(a.TEXTURE_2D, 0, t, p.width, p.height, 0, t, v, p.data); else if (b && b.isCompressedTexture) for (N = 0, C = q.length; N < C; N++) p = q[N], 1023 !== b.format && 1022 !== b.format ? -1 < c.getCompressedTextureFormats().indexOf(t) ? c.compressedTexImage2D(a.TEXTURE_2D, N, t, p.width, p.height, 0, p.data) : console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()") : c.texImage2D(a.TEXTURE_2D, N, t, p.width, p.height, 0, t, v, p.data); else if (0 < q.length && n) { N = 0; for (C = q.length; N < C; N++) p = q[N], c.texImage2D(a.TEXTURE_2D, N, t, t, v, p); b.generateMipmaps = !1 } else c.texImage2D(a.TEXTURE_2D, 0, t, t, v, p); b.generateMipmaps && n && a.generateMipmap(a.TEXTURE_2D); m.__version = b.version; if (b.onUpdate) b.onUpdate(b); return } } c.activeTexture(a.TEXTURE0 + g); c.bindTexture(a.TEXTURE_2D, m.__webglTexture) } function r(c, g, k) { k ? (a.texParameteri(c, a.TEXTURE_WRAP_S, f(g.wrapS)), a.texParameteri(c, a.TEXTURE_WRAP_T, f(g.wrapT)), a.texParameteri(c, a.TEXTURE_MAG_FILTER, f(g.magFilter)), a.texParameteri(c, a.TEXTURE_MIN_FILTER, f(g.minFilter))) : (a.texParameteri(c, a.TEXTURE_WRAP_S, a.CLAMP_TO_EDGE), a.texParameteri(c, a.TEXTURE_WRAP_T, a.CLAMP_TO_EDGE), 1001 === g.wrapS && 1001 === g.wrapT || console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.", g), a.texParameteri(c, a.TEXTURE_MAG_FILTER, m(g.magFilter)), a.texParameteri(c, a.TEXTURE_MIN_FILTER, m(g.minFilter)), 1003 !== g.minFilter && 1006 !== g.minFilter && console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.", g)); !(k = b.get("EXT_texture_filter_anisotropic")) || 1015 === g.type && null === b.get("OES_texture_float_linear") || 1016 === g.type && null === b.get("OES_texture_half_float_linear") || !(1 < g.anisotropy || d.get(g).__currentAnisotropy) || (a.texParameterf(c, k.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(g.anisotropy, e.getMaxAnisotropy())), d.get(g).__currentAnisotropy = g.anisotropy) } function t(b, e, g, k) { var l = f(e.texture.format), m = f(e.texture.type); c.texImage2D(k, 0, l, e.width, e.height, 0, l, m, null); a.bindFramebuffer(a.FRAMEBUFFER, b); a.framebufferTexture2D(a.FRAMEBUFFER, g, k, d.get(e.texture).__webglTexture, 0); a.bindFramebuffer(a.FRAMEBUFFER, null) } function v(b, c) { a.bindRenderbuffer(a.RENDERBUFFER, b); c.depthBuffer && !c.stencilBuffer ? (a.renderbufferStorage(a.RENDERBUFFER, a.DEPTH_COMPONENT16, c.width, c.height), a.framebufferRenderbuffer(a.FRAMEBUFFER, a.DEPTH_ATTACHMENT, a.RENDERBUFFER, b)) : c.depthBuffer && c.stencilBuffer ? (a.renderbufferStorage(a.RENDERBUFFER, a.DEPTH_STENCIL, c.width, c.height), a.framebufferRenderbuffer(a.FRAMEBUFFER, a.DEPTH_STENCIL_ATTACHMENT, a.RENDERBUFFER, b)) : a.renderbufferStorage(a.RENDERBUFFER, a.RGBA4, c.width, c.height); a.bindRenderbuffer(a.RENDERBUFFER, null) } var A = g.memory, w = "undefined" !== typeof WebGL2RenderingContext && a instanceof WebGL2RenderingContext; this.setTexture2D = n; this.setTextureCube = function (b, g) { var m = d.get(b); if (6 === b.image.length) if (0 < b.version && m.__version !== b.version) { m.__image__webglTextureCube || (b.addEventListener("dispose", u), m.__image__webglTextureCube = a.createTexture(), A.textures++); c.activeTexture(a.TEXTURE0 + g); c.bindTexture(a.TEXTURE_CUBE_MAP, m.__image__webglTextureCube); a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL, b.flipY); for (var h = b && b.isCompressedTexture, n = b.image[0] && b.image[0].isDataTexture, p = [], t = 0; 6 > t; t++) p[t] = h || n ? n ? b.image[t].image : b.image[t] : k(b.image[t], e.maxCubemapSize); var v = l(p[0]), q = f(b.format), w = f(b.type); r(a.TEXTURE_CUBE_MAP, b, v); for (t = 0; 6 > t; t++) if (h) for (var C, D = p[t].mipmaps, z = 0, L = D.length; z < L; z++) C = D[z], 1023 !== b.format && 1022 !== b.format ? -1 < c.getCompressedTextureFormats().indexOf(q) ? c.compressedTexImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X + t, z, q, C.width, C.height, 0, C.data) : console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()") : c.texImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X + t, z, q, C.width, C.height, 0, q, w, C.data); else n ? c.texImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X + t, 0, q, p[t].width, p[t].height, 0, q, w, p[t].data) : c.texImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X + t, 0, q, q, w, p[t]); b.generateMipmaps && v && a.generateMipmap(a.TEXTURE_CUBE_MAP); m.__version = b.version; if (b.onUpdate) b.onUpdate(b) } else c.activeTexture(a.TEXTURE0 + g), c.bindTexture(a.TEXTURE_CUBE_MAP, m.__image__webglTextureCube) }; this.setTextureCubeDynamic = function (b, e) { c.activeTexture(a.TEXTURE0 + e); c.bindTexture(a.TEXTURE_CUBE_MAP, d.get(b).__webglTexture) }; this.setupRenderTarget = function (b) { var e = d.get(b), f = d.get(b.texture); b.addEventListener("dispose", p); f.__webglTexture = a.createTexture(); A.textures++; var g = b && b.isWebGLRenderTargetCube, k = l(b); if (g) { e.__webglFramebuffer = []; for (var m = 0; 6 > m; m++) e.__webglFramebuffer[m] = a.createFramebuffer() } else e.__webglFramebuffer = a.createFramebuffer(); if (g) { c.bindTexture(a.TEXTURE_CUBE_MAP, f.__webglTexture); r(a.TEXTURE_CUBE_MAP, b.texture, k); for (m = 0; 6 > m; m++) t(e.__webglFramebuffer[m], b, a.COLOR_ATTACHMENT0, a.TEXTURE_CUBE_MAP_POSITIVE_X + m); b.texture.generateMipmaps && k && a.generateMipmap(a.TEXTURE_CUBE_MAP); c.bindTexture(a.TEXTURE_CUBE_MAP, null) } else c.bindTexture(a.TEXTURE_2D, f.__webglTexture), r(a.TEXTURE_2D, b.texture, k), t(e.__webglFramebuffer, b, a.COLOR_ATTACHMENT0, a.TEXTURE_2D), b.texture.generateMipmaps && k && a.generateMipmap(a.TEXTURE_2D), c.bindTexture(a.TEXTURE_2D, null); if (b.depthBuffer) { e = d.get(b); f = b && b.isWebGLRenderTargetCube; if (b.depthTexture) { if (f) throw Error("target.depthTexture not supported in Cube render targets"); if (b && b.isWebGLRenderTargetCube) throw Error("Depth Texture with cube render targets is not supported!"); a.bindFramebuffer(a.FRAMEBUFFER, e.__webglFramebuffer); if (!b.depthTexture || !b.depthTexture.isDepthTexture) throw Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture"); d.get(b.depthTexture).__webglTexture && b.depthTexture.image.width === b.width && b.depthTexture.image.height === b.height || (b.depthTexture.image.width = b.width, b.depthTexture.image.height = b.height, b.depthTexture.needsUpdate = !0); n(b.depthTexture, 0); e = d.get(b.depthTexture).__webglTexture; if (1026 === b.depthTexture.format) a.framebufferTexture2D(a.FRAMEBUFFER, a.DEPTH_ATTACHMENT, a.TEXTURE_2D, e, 0); else if (1027 === b.depthTexture.format) a.framebufferTexture2D(a.FRAMEBUFFER, a.DEPTH_STENCIL_ATTACHMENT, a.TEXTURE_2D, e, 0); else throw Error("Unknown depthTexture format"); } else if (f) for (e.__webglDepthbuffer = [], f = 0; 6 > f; f++) a.bindFramebuffer(a.FRAMEBUFFER, e.__webglFramebuffer[f]), e.__webglDepthbuffer[f] = a.createRenderbuffer(), v(e.__webglDepthbuffer[f], b); else a.bindFramebuffer(a.FRAMEBUFFER, e.__webglFramebuffer), e.__webglDepthbuffer = a.createRenderbuffer(), v(e.__webglDepthbuffer, b); a.bindFramebuffer(a.FRAMEBUFFER, null) } }; this.updateRenderTargetMipmap = function (b) { var e = b.texture; e.generateMipmaps && l(b) && 1003 !== e.minFilter && 1006 !== e.minFilter && (b = b && b.isWebGLRenderTargetCube ? a.TEXTURE_CUBE_MAP : a.TEXTURE_2D, e = d.get(e).__webglTexture, c.bindTexture(b, e), a.generateMipmap(b), c.bindTexture(b, null)) } } function gf() { var a = {}; return { get: function (b) { b = b.uuid; var c = a[b]; void 0 === c && (c = {}, a[b] = c); return c }, "delete": function (b) { delete a[b.uuid] }, clear: function () { a = {} } } } function hf(a, b, c) { function d(b, c, d) { var e = new Uint8Array(4), f = a.createTexture(); a.bindTexture(b, f); a.texParameteri(b, a.TEXTURE_MIN_FILTER, a.NEAREST); a.texParameteri(b, a.TEXTURE_MAG_FILTER, a.NEAREST); for (b = 0; b < d; b++) a.texImage2D(c + b, 0, a.RGBA, 1, 1, 0, a.RGBA, a.UNSIGNED_BYTE, e); return f } function e(b) { !0 !== F[b] && (a.enable(b), F[b] = !0) } function f(b) { !1 !== F[b] && (a.disable(b), F[b] = !1) } function g(b, d, g, k, l, m, h, n) { if (0 !== b) { e(a.BLEND); if (b !== E || n !== Ea) 2 === b ? n ? (a.blendEquationSeparate(a.FUNC_ADD, a.FUNC_ADD), a.blendFuncSeparate(a.ONE, a.ONE, a.ONE, a.ONE)) : (a.blendEquation(a.FUNC_ADD), a.blendFunc(a.SRC_ALPHA, a.ONE)) : 3 === b ? n ? (a.blendEquationSeparate(a.FUNC_ADD, a.FUNC_ADD), a.blendFuncSeparate(a.ZERO, a.ZERO, a.ONE_MINUS_SRC_COLOR, a.ONE_MINUS_SRC_ALPHA)) : (a.blendEquation(a.FUNC_ADD), a.blendFunc(a.ZERO, a.ONE_MINUS_SRC_COLOR)) : 4 === b ? n ? (a.blendEquationSeparate(a.FUNC_ADD, a.FUNC_ADD), a.blendFuncSeparate(a.ZERO, a.SRC_COLOR, a.ZERO, a.SRC_ALPHA)) : (a.blendEquation(a.FUNC_ADD), a.blendFunc(a.ZERO, a.SRC_COLOR)) : n ? (a.blendEquationSeparate(a.FUNC_ADD, a.FUNC_ADD), a.blendFuncSeparate(a.ONE, a.ONE_MINUS_SRC_ALPHA, a.ONE, a.ONE_MINUS_SRC_ALPHA)) : (a.blendEquationSeparate(a.FUNC_ADD, a.FUNC_ADD), a.blendFuncSeparate(a.SRC_ALPHA, a.ONE_MINUS_SRC_ALPHA, a.ONE, a.ONE_MINUS_SRC_ALPHA)), E = b, Ea = n; if (5 === b) { l = l || d; m = m || g; h = h || k; if (d !== J || l !== ea) a.blendEquationSeparate(c(d), c(l)), J = d, ea = l; if (g !== C || k !== N || m !== z || h !== D) a.blendFuncSeparate(c(g), c(k), c(m), c(h)), C = g, N = k, z = m, D = h } else D = z = ea = N = C = J = null } else f(a.BLEND), E = b } function k(a) { v.setFunc(a) } function l(b) { L !== b && (b ? a.frontFace(a.CW) : a.frontFace(a.CCW), L = b) } function m(b) { 0 !== b ? (e(a.CULL_FACE), b !== M && (1 === b ? a.cullFace(a.BACK) : 2 === b ? a.cullFace(a.FRONT) : a.cullFace(a.FRONT_AND_BACK))) : f(a.CULL_FACE); M = b } function h(b) { void 0 === b && (b = a.TEXTURE0 + W - 1); K !== b && (a.activeTexture(b), K = b) } function p(a, b, c, d) { t.setClear(a, b, c, d) } function n(a) { v.setClear(a) } function r(a) { q.setClear(a) } var t = new function () { var b = !1, c = new da, d = null, e = new da; return { setMask: function (c) { d === c || b || (a.colorMask(c, c, c, c), d = c) }, setLocked: function (a) { b = a }, setClear: function (b, d, f, g) { c.set(b, d, f, g); !1 === e.equals(c) && (a.clearColor(b, d, f, g), e.copy(c)) }, reset: function () { b = !1; d = null; e.set(0, 0, 0, 1) } } }, v = new function () { var b = !1, c = null, d = null, g = null; return { setTest: function (b) { b ? e(a.DEPTH_TEST) : f(a.DEPTH_TEST) }, setMask: function (d) { c === d || b || (a.depthMask(d), c = d) }, setFunc: function (b) { if (d !== b) { if (b) switch (b) { case 0: a.depthFunc(a.NEVER); break; case 1: a.depthFunc(a.ALWAYS); break; case 2: a.depthFunc(a.LESS); break; case 3: a.depthFunc(a.LEQUAL); break; case 4: a.depthFunc(a.EQUAL); break; case 5: a.depthFunc(a.GEQUAL); break; case 6: a.depthFunc(a.GREATER); break; case 7: a.depthFunc(a.NOTEQUAL); break; default: a.depthFunc(a.LEQUAL) } else a.depthFunc(a.LEQUAL); d = b } }, setLocked: function (a) { b = a }, setClear: function (b) { g !== b && (a.clearDepth(b), g = b) }, reset: function () { b = !1; g = d = c = null } } }, q = new function () { var b = !1, c = null, d = null, g = null, k = null, l = null, m = null, h = null, n = null; return { setTest: function (b) { b ? e(a.STENCIL_TEST) : f(a.STENCIL_TEST) }, setMask: function (d) { c === d || b || (a.stencilMask(d), c = d) }, setFunc: function (b, c, e) { if (d !== b || g !== c || k !== e) a.stencilFunc(b, c, e), d = b, g = c, k = e }, setOp: function (b, c, d) { if (l !== b || m !== c || h !== d) a.stencilOp(b, c, d), l = b, m = c, h = d }, setLocked: function (a) { b = a }, setClear: function (b) { n !== b && (a.clearStencil(b), n = b) }, reset: function () { b = !1; n = h = m = l = k = g = d = c = null } } }, w = a.getParameter(a.MAX_VERTEX_ATTRIBS), x = new Uint8Array(w), T = new Uint8Array(w), y = new Uint8Array(w), F = {}, G = null, E = null, J = null, C = null, N = null, ea = null, z = null, D = null, Ea = !1, L = null, M = null, O = null, Q = null, I = null, V = null, W = a.getParameter(a.MAX_TEXTURE_IMAGE_UNITS), K = null, H = {}, P = new da, S = new da, bb = {}; bb[a.TEXTURE_2D] = d(a.TEXTURE_2D, a.TEXTURE_2D, 1); bb[a.TEXTURE_CUBE_MAP] = d(a.TEXTURE_CUBE_MAP, a.TEXTURE_CUBE_MAP_POSITIVE_X, 6); return { buffers: { color: t, depth: v, stencil: q }, init: function () { p(0, 0, 0, 1); n(1); r(0); e(a.DEPTH_TEST); k(3); l(!1); m(1); e(a.CULL_FACE); e(a.BLEND); g(1) }, initAttributes: function () { for (var a = 0, b = x.length; a < b; a++) x[a] = 0 }, enableAttribute: function (c) { x[c] = 1; 0 === T[c] && (a.enableVertexAttribArray(c), T[c] = 1); 0 !== y[c] && (b.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(c, 0), y[c] = 0) }, enableAttributeAndDivisor: function (b, c, d) { x[b] = 1; 0 === T[b] && (a.enableVertexAttribArray(b), T[b] = 1); y[b] !== c && (d.vertexAttribDivisorANGLE(b, c), y[b] = c) }, disableUnusedAttributes: function () { for (var b = 0, c = T.length; b !== c; ++b) T[b] !== x[b] && (a.disableVertexAttribArray(b), T[b] = 0) }, enable: e, disable: f, getCompressedTextureFormats: function () { if (null === G && (G = [], b.get("WEBGL_compressed_texture_pvrtc") || b.get("WEBGL_compressed_texture_s3tc") || b.get("WEBGL_compressed_texture_etc1"))) for (var c = a.getParameter(a.COMPRESSED_TEXTURE_FORMATS), d = 0; d < c.length; d++) G.push(c[d]); return G }, setBlending: g, setColorWrite: function (a) { t.setMask(a) }, setDepthTest: function (a) { v.setTest(a) }, setDepthWrite: function (a) { v.setMask(a) }, setDepthFunc: k, setStencilTest: function (a) { q.setTest(a) }, setStencilWrite: function (a) { q.setMask(a) }, setStencilFunc: function (a, b, c) { q.setFunc(a, b, c) }, setStencilOp: function (a, b, c) { q.setOp(a, b, c) }, setFlipSided: l, setCullFace: m, setLineWidth: function (b) { b !== O && (a.lineWidth(b), O = b) }, setPolygonOffset: function (b, c, d) { if (b) { if (e(a.POLYGON_OFFSET_FILL), Q !== c || I !== d) a.polygonOffset(c, d), Q = c, I = d } else f(a.POLYGON_OFFSET_FILL) }, getScissorTest: function () { return V }, setScissorTest: function (b) { (V = b) ? e(a.SCISSOR_TEST) : f(a.SCISSOR_TEST) }, activeTexture: h, bindTexture: function (b, c) { null === K && h(); var d = H[K]; void 0 === d && (d = { type: void 0, texture: void 0 }, H[K] = d); if (d.type !== b || d.texture !== c) a.bindTexture(b, c || bb[b]), d.type = b, d.texture = c }, compressedTexImage2D: function () { try { a.compressedTexImage2D.apply(a, arguments) } catch (b) { console.error(b) } }, texImage2D: function () { try { a.texImage2D.apply(a, arguments) } catch (b) { console.error(b) } }, clearColor: p, clearDepth: n, clearStencil: r, scissor: function (b) { !1 === P.equals(b) && (a.scissor(b.x, b.y, b.z, b.w), P.copy(b)) }, viewport: function (b) { !1 === S.equals(b) && (a.viewport(b.x, b.y, b.z, b.w), S.copy(b)) }, reset: function () { for (var b = 0; b < T.length; b++) 1 === T[b] && (a.disableVertexAttribArray(b), T[b] = 0); F = {}; K = G = null; H = {}; M = L = E = null; t.reset(); v.reset(); q.reset() } } } function jf(a, b, c) { function d(b) { if ("highp" === b) { if (0 < a.getShaderPrecisionFormat(a.VERTEX_SHADER, a.HIGH_FLOAT).precision && 0 < a.getShaderPrecisionFormat(a.FRAGMENT_SHADER, a.HIGH_FLOAT).precision) return "highp"; b = "mediump" } return "mediump" === b && 0 < a.getShaderPrecisionFormat(a.VERTEX_SHADER, a.MEDIUM_FLOAT).precision && 0 < a.getShaderPrecisionFormat(a.FRAGMENT_SHADER, a.MEDIUM_FLOAT).precision ? "mediump" : "lowp" } var e, f = void 0 !== c.precision ? c.precision : "highp", g = d(f); g !== f && (console.warn("THREE.WebGLRenderer:", f, "not supported, using", g, "instead."), f = g); c = !0 === c.logarithmicDepthBuffer && !!b.get("EXT_frag_depth"); var g = a.getParameter(a.MAX_TEXTURE_IMAGE_UNITS), k = a.getParameter(a.MAX_VERTEX_TEXTURE_IMAGE_UNITS), l = a.getParameter(a.MAX_TEXTURE_SIZE), m = a.getParameter(a.MAX_CUBE_MAP_TEXTURE_SIZE), h = a.getParameter(a.MAX_VERTEX_ATTRIBS), p = a.getParameter(a.MAX_VERTEX_UNIFORM_VECTORS), n = a.getParameter(a.MAX_VARYING_VECTORS), r = a.getParameter(a.MAX_FRAGMENT_UNIFORM_VECTORS), t = 0 < k, v = !!b.get("OES_texture_float"); return { getMaxAnisotropy: function () { if (void 0 !== e) return e; var c = b.get("EXT_texture_filter_anisotropic"); return e = null !== c ? a.getParameter(c.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 0 }, getMaxPrecision: d, precision: f, logarithmicDepthBuffer: c, maxTextures: g, maxVertexTextures: k, maxTextureSize: l, maxCubemapSize: m, maxAttributes: h, maxVertexUniforms: p, maxVaryings: n, maxFragmentUniforms: r, vertexTextures: t, floatFragmentTextures: v, floatVertexTextures: t && v } } function kf(a) { var b = {}; return { get: function (c) { if (void 0 !== b[c]) return b[c]; var d; switch (c) { case "WEBGL_depth_texture": d = a.getExtension("WEBGL_depth_texture") || a.getExtension("MOZ_WEBGL_depth_texture") || a.getExtension("WEBKIT_WEBGL_depth_texture"); break; case "EXT_texture_filter_anisotropic": d = a.getExtension("EXT_texture_filter_anisotropic") || a.getExtension("MOZ_EXT_texture_filter_anisotropic") || a.getExtension("WEBKIT_EXT_texture_filter_anisotropic"); break; case "WEBGL_compressed_texture_s3tc": d = a.getExtension("WEBGL_compressed_texture_s3tc") || a.getExtension("MOZ_WEBGL_compressed_texture_s3tc") || a.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc"); break; case "WEBGL_compressed_texture_pvrtc": d = a.getExtension("WEBGL_compressed_texture_pvrtc") || a.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"); break; case "WEBGL_compressed_texture_etc1": d = a.getExtension("WEBGL_compressed_texture_etc1"); break; default: d = a.getExtension(c) } null === d && console.warn("THREE.WebGLRenderer: " + c + " extension not supported."); return b[c] = d } } } function lf() { function a() { m.value !== d && (m.value = d, m.needsUpdate = 0 < e); c.numPlanes = e } function b(a, b, d, e) { var f = null !== a ? a.length : 0, g = null; if (0 !== f) { g = m.value; if (!0 !== e || null === g) { e = d + 4 * f; b = b.matrixWorldInverse; l.getNormalMatrix(b); if (null === g || g.length < e) g = new Float32Array(e); for (e = 0; e !== f; ++e, d += 4) k.copy(a[e]).applyMatrix4(b, l), k.normal.toArray(g, d), g[d + 3] = k.constant } m.value = g; m.needsUpdate = !0 } c.numPlanes = f; return g } var c = this, d = null, e = 0, f = !1, g = !1, k = new fa, l = new ya, m = { value: null, needsUpdate: !1 }; this.uniform = m; this.numPlanes = 0; this.init = function (a, c, g) { var k = 0 !== a.length || c || 0 !== e || f; f = c; d = b(a, g, 0); e = a.length; return k }; this.beginShadows = function () { g = !0; b(null) }; this.endShadows = function () { g = !1; a() }; this.setState = function (c, k, l, h, t) { if (!f || null === c || 0 === c.length || g && !k) g ? b(null) : a(); else { k = g ? 0 : e; var v = 4 * k, q = h.clippingState || null; m.value = q; q = b(c, l, v, t); for (c = 0; c !== v; ++c) q[c] = d[c]; h.clippingState = q; this.numPlanes += k } } } function od(a) { function b(a, b, c, d) { !0 === J && (a *= d, b *= d, c *= d); X.clearColor(a, b, c, d) } function c() { X.init(); X.scissor(Z.copy(ha).multiplyScalar(Oa)); X.viewport(Va.copy(ga).multiplyScalar(Oa)); b(Ba.r, Ba.g, Ba.b, Qa) } function d() { U = S = null; R = ""; K = -1; X.reset() } function e(a) { a.preventDefault(); d(); c(); fa.clear() } function f(a) { a = a.target; a.removeEventListener("dispose", f); g(a); fa["delete"](a) } function g(a) { var b = fa.get(a).program; a.program = void 0; void 0 !== b && ta.releaseProgram(b) } function k(a, b) { return Math.abs(b[0]) - Math.abs(a[0]) } function l(a, b) { return a.object.renderOrder !== b.object.renderOrder ? a.object.renderOrder - b.object.renderOrder : a.material.program && b.material.program && a.material.program !== b.material.program ? a.material.program.id - b.material.program.id : a.material.id !== b.material.id ? a.material.id - b.material.id : a.z !== b.z ? a.z - b.z : a.id - b.id } function m(a, b) { return a.object.renderOrder !== b.object.renderOrder ? a.object.renderOrder - b.object.renderOrder : a.z !== b.z ? b.z - a.z : a.id - b.id } function u(a, b, c, d, e) { var f; c.transparent ? (d = D, f = ++Ea) : (d = ea, f = ++z); f = d[f]; void 0 !== f ? (f.id = a.id, f.object = a, f.geometry = b, f.material = c, f.z = Y.z, f.group = e) : (f = { id: a.id, object: a, geometry: b, material: c, z: Y.z, group: e }, d.push(f)) } function p(a) { if (!na.intersectsSphere(a)) return !1; var b = ca.numPlanes; if (0 === b) return !0; var c = Q.clippingPlanes, d = a.center; a = -a.radius; var e = 0; do if (c[e].distanceToPoint(d) < a) return !1; while (++e !== b); return !0 } function n(a, b) { if (!1 !== a.visible) { if (0 !== (a.layers.mask & b.layers.mask)) if (a.isLight) N.push(a); else if (a.isSprite) { var c; (c = !1 === a.frustumCulled) || (la.center.set(0, 0, 0), la.radius = .7071067811865476, la.applyMatrix4(a.matrixWorld), c = !0 === p(la)); c && M.push(a) } else if (a.isLensFlare) O.push(a); else if (a.isImmediateRenderObject) !0 === Q.sortObjects && (Y.setFromMatrixPosition(a.matrixWorld), Y.applyProjection(qa)), u(a, null, a.material, Y.z, null); else if (a.isMesh || a.isLine || a.isPoints) if (a.isSkinnedMesh && a.skeleton.update(), (c = !1 === a.frustumCulled) || (c = a.geometry, null === c.boundingSphere && c.computeBoundingSphere(), la.copy(c.boundingSphere).applyMatrix4(a.matrixWorld), c = !0 === p(la)), c) { var d = a.material; if (!0 === d.visible) if (!0 === Q.sortObjects && (Y.setFromMatrixPosition(a.matrixWorld), Y.applyProjection(qa)), c = ra.update(a), d.isMultiMaterial) for (var e = c.groups, f = d.materials, d = 0, g = e.length; d < g; d++) { var k = e[d], l = f[k.materialIndex]; !0 === l.visible && u(a, c, l, Y.z, k) } else u(a, c, d, Y.z, null) } c = a.children; d = 0; for (g = c.length; d < g; d++) n(c[d], b) } } function r(a, b, c, d) { for (var e = 0, f = a.length; e < f; e++) { var g = a[e], k = g.object, l = g.geometry, m = void 0 === d ? g.material : d, g = g.group; k.modelViewMatrix.multiplyMatrices(b.matrixWorldInverse, k.matrixWorld); k.normalMatrix.getNormalMatrix(k.modelViewMatrix); if (k.isImmediateRenderObject) { t(m); var h = v(b, c, m, k); R = ""; k.render(function (a) { Q.renderBufferImmediate(a, h, m) }) } else { if (null !== k.onBeforeRender) k.onBeforeRender(); Q.renderBufferDirect(b, c, l, m, k, g) } } } function t(a) { 2 === a.side ? X.disable(B.CULL_FACE) : X.enable(B.CULL_FACE); X.setFlipSided(1 === a.side); !0 === a.transparent ? X.setBlending(a.blending, a.blendEquation, a.blendSrc, a.blendDst, a.blendEquationAlpha, a.blendSrcAlpha, a.blendDstAlpha, a.premultipliedAlpha) : X.setBlending(0); X.setDepthFunc(a.depthFunc); X.setDepthTest(a.depthTest); X.setDepthWrite(a.depthWrite); X.setColorWrite(a.colorWrite); X.setPolygonOffset(a.polygonOffset, a.polygonOffsetFactor, a.polygonOffsetUnits) } function v(a, b, c, d) { ba = 0; var e = fa.get(c); oa && (pa || a !== U) && ca.setState(c.clippingPlanes, c.clipShadows, a, e, a === U && c.id === K); !1 === c.needsUpdate && (void 0 === e.program ? c.needsUpdate = !0 : c.fog && e.fog !== b ? c.needsUpdate = !0 : c.lights && e.lightsHash !== aa.hash ? c.needsUpdate = !0 : void 0 !== e.numClippingPlanes && e.numClippingPlanes !== ca.numPlanes && (c.needsUpdate = !0)); if (c.needsUpdate) { a: { var k = fa.get(c), l = ta.getParameters(c, aa, b, ca.numPlanes, d), m = ta.getProgramCode(c, l), n = k.program, p = !0; if (void 0 === n) c.addEventListener("dispose", f); else if (n.code !== m) g(c); else if (void 0 !== l.shaderID) break a; else p = !1; p && (l.shaderID ? (n = Cb[l.shaderID], k.__webglShader = { name: c.type, uniforms: h.UniformsUtils.clone(n.uniforms), vertexShader: n.vertexShader, fragmentShader: n.fragmentShader }) : k.__webglShader = { name: c.type, uniforms: c.uniforms, vertexShader: c.vertexShader, fragmentShader: c.fragmentShader }, c.__webglShader = k.__webglShader, n = ta.acquireProgram(c, l, m), k.program = n, c.program = n); l = n.getAttributes(); if (c.morphTargets) for (m = c.numSupportedMorphTargets = 0; m < Q.maxMorphTargets; m++) 0 <= l["morphTarget" + m] && c.numSupportedMorphTargets++; if (c.morphNormals) for (m = c.numSupportedMorphNormals = 0; m < Q.maxMorphNormals; m++) 0 <= l["morphNormal" + m] && c.numSupportedMorphNormals++; l = k.__webglShader.uniforms; if (!c.isShaderMaterial && !c.isRawShaderMaterial || !0 === c.clipping) k.numClippingPlanes = ca.numPlanes, l.clippingPlanes = ca.uniform; k.fog = b; k.lightsHash = aa.hash; c.lights && (l.ambientLightColor.value = aa.ambient, l.directionalLights.value = aa.directional, l.spotLights.value = aa.spot, l.pointLights.value = aa.point, l.hemisphereLights.value = aa.hemi, l.directionalShadowMap.value = aa.directionalShadowMap, l.directionalShadowMatrix.value = aa.directionalShadowMatrix, l.spotShadowMap.value = aa.spotShadowMap, l.spotShadowMatrix.value = aa.spotShadowMatrix, l.pointShadowMap.value = aa.pointShadowMap, l.pointShadowMatrix.value = aa.pointShadowMatrix); m = k.program.getUniforms(); m = Ga.seqWithValue(m.seq, l); k.uniformsList = m; k.dynamicUniforms = Ga.splitDynamic(m, l) } c.needsUpdate = !1 } var u = !1, p = n = !1, k = e.program, m = k.getUniforms(), l = e.__webglShader.uniforms; k.id !== S && (B.useProgram(k.program), S = k.id, p = n = u = !0); c.id !== K && (K = c.id, n = !0); if (u || a !== U) { m.set(B, a, "projectionMatrix"); ja.logarithmicDepthBuffer && m.setValue(B, "logDepthBufFC", 2 / (Math.log(a.far + 1) / Math.LN2)); a !== U && (U = a, p = n = !0); if (c.isShaderMaterial || c.isMeshPhongMaterial || c.isMeshStandardMaterial || c.envMap) u = m.map.cameraPosition, void 0 !== u && u.setValue(B, Y.setFromMatrixPosition(a.matrixWorld)); (c.isMeshPhongMaterial || c.isMeshLambertMaterial || c.isMeshBasicMaterial || c.isMeshStandardMaterial || c.isShaderMaterial || c.skinning) && m.setValue(B, "viewMatrix", a.matrixWorldInverse); m.set(B, Q, "toneMappingExposure"); m.set(B, Q, "toneMappingWhitePoint") } c.skinning && (m.setOptional(B, d, "bindMatrix"), m.setOptional(B, d, "bindMatrixInverse"), u = d.skeleton) && (ja.floatVertexTextures && u.useVertexTexture ? (m.set(B, u, "boneTexture"), m.set(B, u, "boneTextureWidth"), m.set(B, u, "boneTextureHeight")) : m.setOptional(B, u, "boneMatrices")); if (n) { c.lights && (n = p, l.ambientLightColor.needsUpdate = n, l.directionalLights.needsUpdate = n, l.pointLights.needsUpdate = n, l.spotLights.needsUpdate = n, l.hemisphereLights.needsUpdate = n); b && c.fog && (l.fogColor.value = b.color, b.isFog ? (l.fogNear.value = b.near, l.fogFar.value = b.far) : b.isFogExp2 && (l.fogDensity.value = b.density)); if (c.isMeshBasicMaterial || c.isMeshLambertMaterial || c.isMeshPhongMaterial || c.isMeshStandardMaterial || c.isMeshDepthMaterial) { l.opacity.value = c.opacity; l.diffuse.value = c.color; c.emissive && l.emissive.value.copy(c.emissive).multiplyScalar(c.emissiveIntensity); l.map.value = c.map; l.specularMap.value = c.specularMap; l.alphaMap.value = c.alphaMap; c.aoMap && (l.aoMap.value = c.aoMap, l.aoMapIntensity.value = c.aoMapIntensity); var r; c.map ? r = c.map : c.specularMap ? r = c.specularMap : c.displacementMap ? r = c.displacementMap : c.normalMap ? r = c.normalMap : c.bumpMap ? r = c.bumpMap : c.roughnessMap ? r = c.roughnessMap : c.metalnessMap ? r = c.metalnessMap : c.alphaMap ? r = c.alphaMap : c.emissiveMap && (r = c.emissiveMap); void 0 !== r && (r.isWebGLRenderTarget && (r = r.texture), b = r.offset, r = r.repeat, l.offsetRepeat.value.set(b.x, b.y, r.x, r.y)); l.envMap.value = c.envMap; l.flipEnvMap.value = c.envMap && c.envMap.isCubeTexture ? -1 : 1; l.reflectivity.value = c.reflectivity; l.refractionRatio.value = c.refractionRatio } c.isLineBasicMaterial ? (l.diffuse.value = c.color, l.opacity.value = c.opacity) : c.isLineDashedMaterial ? (l.diffuse.value = c.color, l.opacity.value = c.opacity, l.dashSize.value = c.dashSize, l.totalSize.value = c.dashSize + c.gapSize, l.scale.value = c.scale) : c.isPointsMaterial ? (l.diffuse.value = c.color, l.opacity.value = c.opacity, l.size.value = c.size * Oa, l.scale.value = .5 * x.clientHeight, l.map.value = c.map, null !== c.map && (r = c.map.offset, b = c.map.repeat, l.offsetRepeat.value.set(r.x, r.y, b.x, b.y))) : c.isMeshLambertMaterial ? (c.lightMap && (l.lightMap.value = c.lightMap, l.lightMapIntensity.value = c.lightMapIntensity), c.emissiveMap && (l.emissiveMap.value = c.emissiveMap)) : c.isMeshPhongMaterial ? (l.specular.value = c.specular, l.shininess.value = Math.max(c.shininess, 1E-4), c.lightMap && (l.lightMap.value = c.lightMap, l.lightMapIntensity.value = c.lightMapIntensity), c.emissiveMap && (l.emissiveMap.value = c.emissiveMap), c.bumpMap && (l.bumpMap.value = c.bumpMap, l.bumpScale.value = c.bumpScale), c.normalMap && (l.normalMap.value = c.normalMap, l.normalScale.value.copy(c.normalScale)), c.displacementMap && (l.displacementMap.value = c.displacementMap, l.displacementScale.value = c.displacementScale, l.displacementBias.value = c.displacementBias)) : c.isMeshPhysicalMaterial ? (l.clearCoat.value = c.clearCoat, l.clearCoatRoughness.value = c.clearCoatRoughness, A(l, c)) : c.isMeshStandardMaterial ? A(l, c) : c.isMeshDepthMaterial ? c.displacementMap && (l.displacementMap.value = c.displacementMap, l.displacementScale.value = c.displacementScale, l.displacementBias.value = c.displacementBias) : c.isMeshNormalMaterial && (l.opacity.value = c.opacity); Ga.upload(B, e.uniformsList, l, Q) } m.set(B, d, "modelViewMatrix"); m.set(B, d, "normalMatrix"); m.setValue(B, "modelMatrix", d.matrixWorld); e = e.dynamicUniforms; null !== e && (Ga.evalDynamic(e, l, d, c, a), Ga.upload(B, e, l, Q)); return k } function A(a, b) { a.roughness.value = b.roughness; a.metalness.value = b.metalness; b.roughnessMap && (a.roughnessMap.value = b.roughnessMap); b.metalnessMap && (a.metalnessMap.value = b.metalnessMap); b.lightMap && (a.lightMap.value = b.lightMap, a.lightMapIntensity.value = b.lightMapIntensity); b.emissiveMap && (a.emissiveMap.value = b.emissiveMap); b.bumpMap && (a.bumpMap.value = b.bumpMap, a.bumpScale.value = b.bumpScale); b.normalMap && (a.normalMap.value = b.normalMap, a.normalScale.value.copy(b.normalScale)); b.displacementMap && (a.displacementMap.value = b.displacementMap, a.displacementScale.value = b.displacementScale, a.displacementBias.value = b.displacementBias); b.envMap && (a.envMapIntensity.value = b.envMapIntensity) } function w(a) { var b; if (1E3 === a) return B.REPEAT; if (1001 === a) return B.CLAMP_TO_EDGE; if (1002 === a) return B.MIRRORED_REPEAT; if (1003 === a) return B.NEAREST; if (1004 === a) return B.NEAREST_MIPMAP_NEAREST; if (1005 === a) return B.NEAREST_MIPMAP_LINEAR; if (1006 === a) return B.LINEAR; if (1007 === a) return B.LINEAR_MIPMAP_NEAREST; if (1008 === a) return B.LINEAR_MIPMAP_LINEAR; if (1009 === a) return B.UNSIGNED_BYTE; if (1017 === a) return B.UNSIGNED_SHORT_4_4_4_4; if (1018 === a) return B.UNSIGNED_SHORT_5_5_5_1; if (1019 === a) return B.UNSIGNED_SHORT_5_6_5; if (1010 === a) return B.BYTE; if (1011 === a) return B.SHORT; if (1012 === a) return B.UNSIGNED_SHORT; if (1013 === a) return B.INT; if (1014 === a) return B.UNSIGNED_INT; if (1015 === a) return B.FLOAT; b = ia.get("OES_texture_half_float"); if (null !== b && 1016 === a) return b.HALF_FLOAT_OES; if (1021 === a) return B.ALPHA; if (1022 === a) return B.RGB; if (1023 === a) return B.RGBA; if (1024 === a) return B.LUMINANCE; if (1025 === a) return B.LUMINANCE_ALPHA; if (1026 === a) return B.DEPTH_COMPONENT; if (1027 === a) return B.DEPTH_STENCIL; if (100 === a) return B.FUNC_ADD; if (101 === a) return B.FUNC_SUBTRACT; if (102 === a) return B.FUNC_REVERSE_SUBTRACT; if (200 === a) return B.ZERO; if (201 === a) return B.ONE; if (202 === a) return B.SRC_COLOR; if (203 === a) return B.ONE_MINUS_SRC_COLOR; if (204 === a) return B.SRC_ALPHA; if (205 === a) return B.ONE_MINUS_SRC_ALPHA; if (206 === a) return B.DST_ALPHA; if (207 === a) return B.ONE_MINUS_DST_ALPHA; if (208 === a) return B.DST_COLOR; if (209 === a) return B.ONE_MINUS_DST_COLOR; if (210 === a) return B.SRC_ALPHA_SATURATE; b = ia.get("WEBGL_compressed_texture_s3tc"); if (null !== b) { if (2001 === a) return b.COMPRESSED_RGB_S3TC_DXT1_EXT; if (2002 === a) return b.COMPRESSED_RGBA_S3TC_DXT1_EXT; if (2003 === a) return b.COMPRESSED_RGBA_S3TC_DXT3_EXT; if (2004 === a) return b.COMPRESSED_RGBA_S3TC_DXT5_EXT } b = ia.get("WEBGL_compressed_texture_pvrtc"); if (null !== b) { if (2100 === a) return b.COMPRESSED_RGB_PVRTC_4BPPV1_IMG; if (2101 === a) return b.COMPRESSED_RGB_PVRTC_2BPPV1_IMG; if (2102 === a) return b.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG; if (2103 === a) return b.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG } b = ia.get("WEBGL_compressed_texture_etc1"); if (null !== b && 2151 === a) return b.COMPRESSED_RGB_ETC1_WEBGL; b = ia.get("EXT_blend_minmax"); if (null !== b) { if (103 === a) return b.MIN_EXT; if (104 === a) return b.MAX_EXT } b = ia.get("WEBGL_depth_texture"); return null !== b && 1020 === a ? b.UNSIGNED_INT_24_8_WEBGL : 0 } console.log("THREE.WebGLRenderer", "81"); a = a || {}; var x = void 0 !== a.canvas ? a.canvas : document.createElementNS("http://www.w3.org/1999/xhtml", "canvas"), T = void 0 !== a.context ? a.context : null, y = void 0 !== a.alpha ? a.alpha : !1, F = void 0 !== a.depth ? a.depth : !0, G = void 0 !== a.stencil ? a.stencil : !0, E = void 0 !== a.antialias ? a.antialias : !1, J = void 0 !== a.premultipliedAlpha ? a.premultipliedAlpha : !0, C = void 0 !== a.preserveDrawingBuffer ? a.preserveDrawingBuffer : !1, N = [], ea = [], z = -1, D = [], Ea = -1, L = new Float32Array(8), M = [], O = []; this.domElement = x; this.context = null; this.sortObjects = this.autoClearStencil = this.autoClearDepth = this.autoClearColor = this.autoClear = !0; this.clippingPlanes = []; this.localClippingEnabled = !1; this.gammaFactor = 2; this.physicallyCorrectLights = this.gammaOutput = this.gammaInput = !1; this.toneMappingWhitePoint = this.toneMappingExposure = this.toneMapping = 1; this.maxMorphTargets = 8; this.maxMorphNormals = 4; var Q = this, S = null, V = null, W = null, K = -1, R = "", U = null, Z = new da, bb = null, Va = new da, ba = 0, Ba = new H(0), Qa = 0, Na = x.width, Mc = x.height, Oa = 1, ha = new da(0, 0, Na, Mc), ka = !1, ga = new da(0, 0, Na, Mc), na = new dc, ca = new lf, oa = !1, pa = !1, la = new Aa, qa = new P, Y = new q, aa = { hash: "", ambient: [0, 0, 0], directional: [], directionalShadowMap: [], directionalShadowMatrix: [], spot: [], spotShadowMap: [], spotShadowMatrix: [], point: [], pointShadowMap: [], pointShadowMatrix: [], hemi: [], shadows: [] }, ma = { calls: 0, vertices: 0, faces: 0, points: 0 }; this.info = { render: ma, memory: { geometries: 0, textures: 0 }, programs: null }; var B; try { y = { alpha: y, depth: F, stencil: G, antialias: E, premultipliedAlpha: J, preserveDrawingBuffer: C }; B = T || x.getContext("webgl", y) || x.getContext("experimental-webgl", y); if (null === B) { if (null !== x.getContext("webgl")) throw "Error creating WebGL context with your selected attributes."; throw "Error creating WebGL context."; } void 0 === B.getShaderPrecisionFormat && (B.getShaderPrecisionFormat = function () { return { rangeMin: 1, rangeMax: 1, precision: 1 } }); x.addEventListener("webglcontextlost", e, !1) } catch (mf) { console.error("THREE.WebGLRenderer: " + mf) } var ia = new kf(B); ia.get("WEBGL_depth_texture"); ia.get("OES_texture_float"); ia.get("OES_texture_float_linear"); ia.get("OES_texture_half_float"); ia.get("OES_texture_half_float_linear"); ia.get("OES_standard_derivatives"); ia.get("ANGLE_instanced_arrays"); ia.get("OES_element_index_uint") && (I.MaxIndex = 4294967296); var ja = new jf(B, ia, a), X = new hf(B, ia, w), fa = new gf, sa = new ff(B, ia, X, fa, ja, w, this.info), ra = new ef(B, fa, this.info), ta = new cf(this, ja), ya = new Ve; this.info.programs = ta.programs; var Fa = new Ue(B, ia, ma), Ha = new Te(B, ia, ma), Ja = new Db(-1, 1, 1, -1, 0, 1), wa = new Ca, za = new va(new eb(2, 2), new Ia({ depthTest: !1, depthWrite: !1, fog: !1 })); a = Cb.cube; var ua = new va(new db(5, 5, 5), new Da({ uniforms: a.uniforms, vertexShader: a.vertexShader, fragmentShader: a.fragmentShader, side: 1, depthTest: !1, depthWrite: !1, fog: !1 })); c(); this.context = B; this.capabilities = ja; this.extensions = ia; this.properties = fa; this.state = X; var Ka = new $d(this, aa, ra, ja); this.shadowMap = Ka; var La = new Se(this, M), Pa = new Qe(this, O); this.getContext = function () { return B }; this.getContextAttributes = function () { return B.getContextAttributes() }; this.forceContextLoss = function () { ia.get("WEBGL_lose_context").loseContext() }; this.getMaxAnisotropy = function () { return ja.getMaxAnisotropy() }; this.getPrecision = function () { return ja.precision }; this.getPixelRatio = function () { return Oa }; this.setPixelRatio = function (a) { void 0 !== a && (Oa = a, this.setSize(ga.z, ga.w, !1)) }; this.getSize = function () { return { width: Na, height: Mc } }; this.setSize = function (a, b, c) { Na = a; Mc = b; x.width = a * Oa; x.height = b * Oa; !1 !== c && (x.style.width = a + "px", x.style.height = b + "px"); this.setViewport(0, 0, a, b) }; this.setViewport = function (a, b, c, d) { X.viewport(ga.set(a, b, c, d)) }; this.setScissor = function (a, b, c, d) { X.scissor(ha.set(a, b, c, d)) }; this.setScissorTest = function (a) { X.setScissorTest(ka = a) }; this.getClearColor = function () { return Ba }; this.setClearColor = function (a, c) { Ba.set(a); Qa = void 0 !== c ? c : 1; b(Ba.r, Ba.g, Ba.b, Qa) }; this.getClearAlpha = function () { return Qa }; this.setClearAlpha = function (a) { Qa = a; b(Ba.r, Ba.g, Ba.b, Qa) }; this.clear = function (a, b, c) { var d = 0; if (void 0 === a || a) d |= B.COLOR_BUFFER_BIT; if (void 0 === b || b) d |= B.DEPTH_BUFFER_BIT; if (void 0 === c || c) d |= B.STENCIL_BUFFER_BIT; B.clear(d) }; this.clearColor = function () { this.clear(!0, !1, !1) }; this.clearDepth = function () { this.clear(!1, !0, !1) }; this.clearStencil = function () { this.clear(!1, !1, !0) }; this.clearTarget = function (a, b, c, d) { this.setRenderTarget(a); this.clear(b, c, d) }; this.resetGLState = d; this.dispose = function () { D = []; Ea = -1; ea = []; z = -1; x.removeEventListener("webglcontextlost", e, !1) }; this.renderBufferImmediate = function (a, b, c) { X.initAttributes(); var d = fa.get(a); a.hasPositions && !d.position && (d.position = B.createBuffer()); a.hasNormals && !d.normal && (d.normal = B.createBuffer()); a.hasUvs && !d.uv && (d.uv = B.createBuffer()); a.hasColors && !d.color && (d.color = B.createBuffer()); b = b.getAttributes(); a.hasPositions && (B.bindBuffer(B.ARRAY_BUFFER, d.position), B.bufferData(B.ARRAY_BUFFER, a.positionArray, B.DYNAMIC_DRAW), X.enableAttribute(b.position), B.vertexAttribPointer(b.position, 3, B.FLOAT, !1, 0, 0)); if (a.hasNormals) { B.bindBuffer(B.ARRAY_BUFFER, d.normal); if (!c.isMeshPhongMaterial && !c.isMeshStandardMaterial && 1 === c.shading) for (var e = 0, f = 3 * a.count; e < f; e += 9) { var g = a.normalArray, k = (g[e + 0] + g[e + 3] + g[e + 6]) / 3, l = (g[e + 1] + g[e + 4] + g[e + 7]) / 3, m = (g[e + 2] + g[e + 5] + g[e + 8]) / 3; g[e + 0] = k; g[e + 1] = l; g[e + 2] = m; g[e + 3] = k; g[e + 4] = l; g[e + 5] = m; g[e + 6] = k; g[e + 7] = l; g[e + 8] = m } B.bufferData(B.ARRAY_BUFFER, a.normalArray, B.DYNAMIC_DRAW); X.enableAttribute(b.normal); B.vertexAttribPointer(b.normal, 3, B.FLOAT, !1, 0, 0) } a.hasUvs && c.map && (B.bindBuffer(B.ARRAY_BUFFER, d.uv), B.bufferData(B.ARRAY_BUFFER, a.uvArray, B.DYNAMIC_DRAW), X.enableAttribute(b.uv), B.vertexAttribPointer(b.uv, 2, B.FLOAT, !1, 0, 0)); a.hasColors && 0 !== c.vertexColors && (B.bindBuffer(B.ARRAY_BUFFER, d.color), B.bufferData(B.ARRAY_BUFFER, a.colorArray, B.DYNAMIC_DRAW), X.enableAttribute(b.color), B.vertexAttribPointer(b.color, 3, B.FLOAT, !1, 0, 0)); X.disableUnusedAttributes(); B.drawArrays(B.TRIANGLES, 0, a.count); a.count = 0 }; this.renderBufferDirect = function (a, b, c, d, e, f) { t(d); var g = v(a, b, d, e), l = !1; a = c.id + "_" + g.id + "_" + d.wireframe; a !== R && (R = a, l = !0); b = e.morphTargetInfluences; if (void 0 !== b) { var m = []; a = 0; for (var h = b.length; a < h; a++) l = b[a], m.push([l, a]); m.sort(k); 8 < m.length && (m.length = 8); var n = c.morphAttributes; a = 0; for (h = m.length; a < h; a++) l = m[a], L[a] = l[0], 0 !== l[0] ? (b = l[1], !0 === d.morphTargets && n.position && c.addAttribute("morphTarget" + a, n.position[b]), !0 === d.morphNormals && n.normal && c.addAttribute("morphNormal" + a, n.normal[b])) : (!0 === d.morphTargets && c.removeAttribute("morphTarget" + a), !0 === d.morphNormals && c.removeAttribute("morphNormal" + a)); a = m.length; for (b = L.length; a < b; a++) L[a] = 0; g.getUniforms().setValue(B, "morphTargetInfluences", L); l = !0 } b = c.index; h = c.attributes.position; m = 1; !0 === d.wireframe && (b = ra.getWireframeAttribute(c), m = 2); null !== b ? (a = Ha, a.setIndex(b)) : a = Fa; if (l) { a: { var l = void 0, p; if (c && c.isInstancedBufferGeometry && (p = ia.get("ANGLE_instanced_arrays"), null === p)) { console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays."); break a } void 0 === l && (l = 0); X.initAttributes(); var n = c.attributes, g = g.getAttributes(), u = d.defaultAttributeValues, r; for (r in g) { var x = g[r]; if (0 <= x) { var q = n[r]; if (void 0 !== q) { var w = B.FLOAT, y = q.array, A = q.normalized; y instanceof Float32Array ? w = B.FLOAT : y instanceof Float64Array ? console.warn("Unsupported data buffer format: Float64Array") : y instanceof Uint16Array ? w = B.UNSIGNED_SHORT : y instanceof Int16Array ? w = B.SHORT : y instanceof Uint32Array ? w = B.UNSIGNED_INT : y instanceof Int32Array ? w = B.INT : y instanceof Int8Array ? w = B.BYTE : y instanceof Uint8Array && (w = B.UNSIGNED_BYTE); var y = q.itemSize, G = ra.getAttributeBuffer(q); if (q && q.isInterleavedBufferAttribute) { var E = q.data, J = E.stride, q = q.offset; E && E.isInstancedInterleavedBuffer ? (X.enableAttributeAndDivisor(x, E.meshPerAttribute, p), void 0 === c.maxInstancedCount && (c.maxInstancedCount = E.meshPerAttribute * E.count)) : X.enableAttribute(x); B.bindBuffer(B.ARRAY_BUFFER, G); B.vertexAttribPointer(x, y, w, A, J * E.array.BYTES_PER_ELEMENT, (l * J + q) * E.array.BYTES_PER_ELEMENT) } else q && q.isInstancedBufferAttribute ? (X.enableAttributeAndDivisor(x, q.meshPerAttribute, p), void 0 === c.maxInstancedCount && (c.maxInstancedCount = q.meshPerAttribute * q.count)) : X.enableAttribute(x), B.bindBuffer(B.ARRAY_BUFFER, G), B.vertexAttribPointer(x, y, w, A, 0, l * y * q.array.BYTES_PER_ELEMENT) } else if (void 0 !== u && (w = u[r], void 0 !== w)) switch (w.length) { case 2: B.vertexAttrib2fv(x, w); break; case 3: B.vertexAttrib3fv(x, w); break; case 4: B.vertexAttrib4fv(x, w); break; default: B.vertexAttrib1fv(x, w) } } } X.disableUnusedAttributes() } null !== b && B.bindBuffer(B.ELEMENT_ARRAY_BUFFER, ra.getAttributeBuffer(b)) } p = 0; null !== b ? p = b.count : void 0 !== h && (p = h.count); b = c.drawRange.start * m; h = null !== f ? f.start * m : 0; r = Math.max(b, h); f = Math.max(0, Math.min(p, b + c.drawRange.count * m, h + (null !== f ? f.count * m : Infinity)) - 1 - r + 1); if (0 !== f) { if (e.isMesh) if (!0 === d.wireframe) X.setLineWidth(d.wireframeLinewidth * (null === V ? Oa : 1)), a.setMode(B.LINES); else switch (e.drawMode) { case 0: a.setMode(B.TRIANGLES); break; case 1: a.setMode(B.TRIANGLE_STRIP); break; case 2: a.setMode(B.TRIANGLE_FAN) } else e.isLine ? (d = d.linewidth, void 0 === d && (d = 1), X.setLineWidth(d * (null === V ? Oa : 1)), e.isLineSegments ? a.setMode(B.LINES) : a.setMode(B.LINE_STRIP)) : e.isPoints && a.setMode(B.POINTS); c && c.isInstancedBufferGeometry ? 0 < c.maxInstancedCount && a.renderInstances(c, r, f) : a.render(r, f) } }; this.render = function (a, c, d, e) { if (void 0 !== c && !0 !== c.isCamera) console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera."); else { var f = a.fog; R = ""; K = -1; U = null; !0 === a.autoUpdate && a.updateMatrixWorld(); null === c.parent && c.updateMatrixWorld(); c.matrixWorldInverse.getInverse(c.matrixWorld); qa.multiplyMatrices(c.projectionMatrix, c.matrixWorldInverse); na.setFromMatrix(qa); N.length = 0; Ea = z = -1; M.length = 0; O.length = 0; pa = this.localClippingEnabled; oa = ca.init(this.clippingPlanes, pa, c); n(a, c); ea.length = z + 1; D.length = Ea + 1; !0 === Q.sortObjects && (ea.sort(l), D.sort(m)); oa && ca.beginShadows(); for (var g = N, k = 0, h = 0, p = g.length; h < p; h++) { var u = g[h]; u.castShadow && (aa.shadows[k++] = u) } aa.shadows.length = k; Ka.render(a, c); for (var g = N, t = u = 0, v = 0, q, x, w, y, A = c.matrixWorldInverse, E = 0, G = 0, J = 0, T = 0, k = 0, h = g.length; k < h; k++) if (p = g[k], q = p.color, x = p.intensity, w = p.distance, y = p.shadow && p.shadow.map ? p.shadow.map.texture : null, p.isAmbientLight) u += q.r * x, t += q.g * x, v += q.b * x; else if (p.isDirectionalLight) { var F = ya.get(p); F.color.copy(p.color).multiplyScalar(p.intensity); F.direction.setFromMatrixPosition(p.matrixWorld); Y.setFromMatrixPosition(p.target.matrixWorld); F.direction.sub(Y); F.direction.transformDirection(A); if (F.shadow = p.castShadow) F.shadowBias = p.shadow.bias, F.shadowRadius = p.shadow.radius, F.shadowMapSize = p.shadow.mapSize; aa.directionalShadowMap[E] = y; aa.directionalShadowMatrix[E] = p.shadow.matrix; aa.directional[E++] = F } else if (p.isSpotLight) { F = ya.get(p); F.position.setFromMatrixPosition(p.matrixWorld); F.position.applyMatrix4(A); F.color.copy(q).multiplyScalar(x); F.distance = w; F.direction.setFromMatrixPosition(p.matrixWorld); Y.setFromMatrixPosition(p.target.matrixWorld); F.direction.sub(Y); F.direction.transformDirection(A); F.coneCos = Math.cos(p.angle); F.penumbraCos = Math.cos(p.angle * (1 - p.penumbra)); F.decay = 0 === p.distance ? 0 : p.decay; if (F.shadow = p.castShadow) F.shadowBias = p.shadow.bias, F.shadowRadius = p.shadow.radius, F.shadowMapSize = p.shadow.mapSize; aa.spotShadowMap[J] = y; aa.spotShadowMatrix[J] = p.shadow.matrix; aa.spot[J++] = F } else if (p.isPointLight) { F = ya.get(p); F.position.setFromMatrixPosition(p.matrixWorld); F.position.applyMatrix4(A); F.color.copy(p.color).multiplyScalar(p.intensity); F.distance = p.distance; F.decay = 0 === p.distance ? 0 : p.decay; if (F.shadow = p.castShadow) F.shadowBias = p.shadow.bias, F.shadowRadius = p.shadow.radius, F.shadowMapSize = p.shadow.mapSize; aa.pointShadowMap[G] = y; void 0 === aa.pointShadowMatrix[G] && (aa.pointShadowMatrix[G] = new P); Y.setFromMatrixPosition(p.matrixWorld).negate(); aa.pointShadowMatrix[G].identity().setPosition(Y); aa.point[G++] = F } else p.isHemisphereLight && (F = ya.get(p), F.direction.setFromMatrixPosition(p.matrixWorld), F.direction.transformDirection(A), F.direction.normalize(), F.skyColor.copy(p.color).multiplyScalar(x), F.groundColor.copy(p.groundColor).multiplyScalar(x), aa.hemi[T++] = F); aa.ambient[0] = u; aa.ambient[1] = t; aa.ambient[2] = v; aa.directional.length = E; aa.spot.length = J; aa.point.length = G; aa.hemi.length = T; aa.hash = E + "," + G + "," + J + "," + T + "," + aa.shadows.length; oa && ca.endShadows(); ma.calls = 0; ma.vertices = 0; ma.faces = 0; ma.points = 0; void 0 === d && (d = null); this.setRenderTarget(d); g = a.background; null === g ? b(Ba.r, Ba.g, Ba.b, Qa) : g && g.isColor && (b(g.r, g.g, g.b, 1), e = !0); (this.autoClear || e) && this.clear(this.autoClearColor, this.autoClearDepth, this.autoClearStencil); g && g.isCubeTexture ? (wa.projectionMatrix.copy(c.projectionMatrix), wa.matrixWorld.extractRotation(c.matrixWorld), wa.matrixWorldInverse.getInverse(wa.matrixWorld), ua.material.uniforms.tCube.value = g, ua.modelViewMatrix.multiplyMatrices(wa.matrixWorldInverse, ua.matrixWorld), ra.update(ua), Q.renderBufferDirect(wa, null, ua.geometry, ua.material, ua, null)) : g && g.isTexture && (za.material.map = g, ra.update(za), Q.renderBufferDirect(Ja, null, za.geometry, za.material, za, null)); a.overrideMaterial ? (e = a.overrideMaterial, r(ea, c, f, e), r(D, c, f, e)) : (X.setBlending(0), r(ea, c, f), r(D, c, f)); La.render(a, c); Pa.render(a, c, Va); d && sa.updateRenderTargetMipmap(d); X.setDepthTest(!0); X.setDepthWrite(!0); X.setColorWrite(!0) } }; this.setFaceCulling = function (a, b) { X.setCullFace(a); X.setFlipSided(0 === b) }; this.allocTextureUnit = function () { var a = ba; a >= ja.maxTextures && console.warn("WebGLRenderer: trying to use " + a + " texture units while this GPU supports only " + ja.maxTextures); ba += 1; return a }; this.setTexture2D = function () { var a = !1; return function (b, c) { b && b.isWebGLRenderTarget && (a || (console.warn("THREE.WebGLRenderer.setTexture2D: don't use render targets as textures. Use their .texture property instead."), a = !0), b = b.texture); sa.setTexture2D(b, c) } } (); this.setTexture = function () { var a = !1; return function (b, c) { a || (console.warn("THREE.WebGLRenderer: .setTexture is deprecated, use setTexture2D instead."), a = !0); sa.setTexture2D(b, c) } } (); this.setTextureCube = function () { var a = !1; return function (b, c) { b && b.isWebGLRenderTargetCube && (a || (console.warn("THREE.WebGLRenderer.setTextureCube: don't use cube render targets as textures. Use their .texture property instead."), a = !0), b = b.texture); b && b.isCubeTexture || Array.isArray(b.image) && 6 === b.image.length ? sa.setTextureCube(b, c) : sa.setTextureCubeDynamic(b, c) } } (); this.getCurrentRenderTarget = function () { return V }; this.setRenderTarget = function (a) { (V = a) && void 0 === fa.get(a).__webglFramebuffer && sa.setupRenderTarget(a); var b = a && a.isWebGLRenderTargetCube, c; a ? (c = fa.get(a), c = b ? c.__webglFramebuffer[a.activeCubeFace] : c.__webglFramebuffer, Z.copy(a.scissor), bb = a.scissorTest, Va.copy(a.viewport)) : (c = null, Z.copy(ha).multiplyScalar(Oa), bb = ka, Va.copy(ga).multiplyScalar(Oa)); W !== c && (B.bindFramebuffer(B.FRAMEBUFFER, c), W = c); X.scissor(Z); X.setScissorTest(bb); X.viewport(Va); b && (b = fa.get(a.texture), B.framebufferTexture2D(B.FRAMEBUFFER, B.COLOR_ATTACHMENT0, B.TEXTURE_CUBE_MAP_POSITIVE_X + a.activeCubeFace, b.__webglTexture, a.activeMipMapLevel)) }; this.readRenderTargetPixels = function (a, b, c, d, e, f) { if (!1 === (a && a.isWebGLRenderTarget)) console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget."); else { var g = fa.get(a).__webglFramebuffer; if (g) { var k = !1; g !== W && (B.bindFramebuffer(B.FRAMEBUFFER, g), k = !0); try { var l = a.texture, m = l.format, h = l.type; 1023 !== m && w(m) !== B.getParameter(B.IMPLEMENTATION_COLOR_READ_FORMAT) ? console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.") : 1009 === h || w(h) === B.getParameter(B.IMPLEMENTATION_COLOR_READ_TYPE) || 1015 === h && (ia.get("OES_texture_float") || ia.get("WEBGL_color_buffer_float")) || 1016 === h && ia.get("EXT_color_buffer_half_float") ? B.checkFramebufferStatus(B.FRAMEBUFFER) === B.FRAMEBUFFER_COMPLETE ? 0 <= b && b <= a.width - d && 0 <= c && c <= a.height - e && B.readPixels(b, c, d, e, w(m), w(h), f) : console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.") : console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.") } finally { k && B.bindFramebuffer(B.FRAMEBUFFER, W) } } } } } function Eb(a, b) { this.name = ""; this.color = new H(a); this.density = void 0 !== b ? b : 2.5E-4 } function Fb(a, b, c) { this.name = ""; this.color = new H(a); this.near = void 0 !== b ? b : 1; this.far = void 0 !== c ? c : 1E3 } function fb() { D.call(this); this.type = "Scene"; this.overrideMaterial = this.fog = this.background = null; this.autoUpdate = !0 } function pd(a, b, c, d, e) { D.call(this); this.lensFlares = []; this.positionScreen = new q; this.customUpdateCallback = void 0; void 0 !== a && this.add(a, b, c, d, e) } function gb(a) { S.call(this); this.type = "SpriteMaterial"; this.color = new H(16777215); this.map = null; this.rotation = 0; this.lights = this.fog = !1; this.setValues(a) } function fc(a) { D.call(this); this.type = "Sprite"; this.material = void 0 !== a ? a : new gb } function gc() { D.call(this); this.type = "LOD"; Object.defineProperties(this, { levels: { enumerable: !0, value: [] } }) } function hb(a, b, c, d, e, f, g, k, l, m, h, p) { ba.call(this, null, f, g, k, l, m, d, e, h, p); this.image = { data: a, width: b, height: c }; this.magFilter = void 0 !== l ? l : 1003; this.minFilter = void 0 !== m ? m : 1003; this.generateMipmaps = this.flipY = !1 } function Nc(a, b, c) { this.useVertexTexture = void 0 !== c ? c : !0; this.identityMatrix = new P; a = a || []; this.bones = a.slice(0); this.useVertexTexture ? (a = Math.sqrt(4 * this.bones.length), a = h.Math.nextPowerOfTwo(Math.ceil(a)), this.boneTextureHeight = this.boneTextureWidth = a = Math.max(a, 4), this.boneMatrices = new Float32Array(this.boneTextureWidth * this.boneTextureHeight * 4), this.boneTexture = new hb(this.boneMatrices, this.boneTextureWidth, this.boneTextureHeight, 1023, 1015)) : this.boneMatrices = new Float32Array(16 * this.bones.length); if (void 0 === b) this.calculateInverses(); else if (this.bones.length === b.length) this.boneInverses = b.slice(0); else for (console.warn("THREE.Skeleton bonInverses is the wrong length."), this.boneInverses = [], b = 0, a = this.bones.length; b < a; b++) this.boneInverses.push(new P) } function Oc(a) { D.call(this); this.type = "Bone"; this.skin = a } function Pc(a, b, c) { va.call(this, a, b); this.type = "SkinnedMesh"; this.bindMode = "attached"; this.bindMatrix = new P; this.bindMatrixInverse = new P; a = []; if (this.geometry && void 0 !== this.geometry.bones) { for (var d, e = 0, f = this.geometry.bones.length; e < f; ++e) d = this.geometry.bones[e], b = new Oc(this), a.push(b), b.name = d.name, b.position.fromArray(d.pos), b.quaternion.fromArray(d.rotq), void 0 !== d.scl && b.scale.fromArray(d.scl); e = 0; for (f = this.geometry.bones.length; e < f; ++e) d = this.geometry.bones[e], -1 !== d.parent && null !== d.parent && void 0 !== a[d.parent] ? a[d.parent].add(a[e]) : this.add(a[e]) } this.normalizeSkinWeights(); this.updateMatrixWorld(!0); this.bind(new Nc(a, void 0, c), this.matrixWorld) } function na(a) { S.call(this); this.type = "LineBasicMaterial"; this.color = new H(16777215); this.linewidth = 1; this.linejoin = this.linecap = "round"; this.lights = !1; this.setValues(a) } function Pa(a, b, c) { if (1 === c) return console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."), new ha(a, b); D.call(this); this.type = "Line"; this.geometry = void 0 !== a ? a : new I; this.material = void 0 !== b ? b : new na({ color: 16777215 * Math.random() }) } function ha(a, b) { Pa.call(this, a, b); this.type = "LineSegments" } function Ja(a) { S.call(this); this.type = "PointsMaterial"; this.color = new H(16777215); this.map = null; this.size = 1; this.sizeAttenuation = !0; this.lights = !1; this.setValues(a) } function Gb(a, b) { D.call(this); this.type = "Points"; this.geometry = void 0 !== a ? a : new I; this.material = void 0 !== b ? b : new Ja({ color: 16777215 * Math.random() }) } function hc() { D.call(this); this.type = "Group" } function Qc(a, b, c, d, e, f, g, k, l) { function m() { requestAnimationFrame(m); a.readyState >= a.HAVE_CURRENT_DATA && (h.needsUpdate = !0) } ba.call(this, a, b, c, d, e, f, g, k, l); this.generateMipmaps = !1; var h = this; m() } function Hb(a, b, c, d, e, f, g, k, l, m, h, p) { ba.call(this, null, f, g, k, l, m, d, e, h, p); this.image = { width: b, height: c }; this.mipmaps = a; this.generateMipmaps = this.flipY = !1 } function Rc(a, b, c, d, e, f, g, k, l) { ba.call(this, a, b, c, d, e, f, g, k, l); this.needsUpdate = !0 } function ic(a, b, c, d, e, f, g, k, l, m) { m = void 0 !== m ? m : 1026; if (1026 !== m && 1027 !== m) throw Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat"); ba.call(this, null, d, e, f, g, k, m, c, l); this.image = { width: a, height: b }; this.type = void 0 !== c ? c : 1012; this.magFilter = void 0 !== g ? g : 1003; this.minFilter = void 0 !== k ? k : 1003; this.generateMipmaps = this.flipY = !1 } function Ib(a) { function b(a, b) { return a - b } I.call(this); var c = [0, 0], d = {}, e = ["a", "b", "c"]; if (a && a.isGeometry) { var f = a.vertices, g = a.faces, k = 0, l = new Uint32Array(6 * g.length); a = 0; for (var m = g.length; a < m; a++) for (var h = g[a], p = 0; 3 > p; p++) { c[0] = h[e[p]]; c[1] = h[e[(p + 1) % 3]]; c.sort(b); var n = c.toString(); void 0 === d[n] && (l[2 * k] = c[0], l[2 * k + 1] = c[1], d[n] = !0, k++) } c = new Float32Array(6 * k); a = 0; for (m = k; a < m; a++) for (p = 0; 2 > p; p++) d = f[l[2 * a + p]], k = 6 * a + 3 * p, c[k + 0] = d.x, c[k + 1] = d.y, c[k + 2] = d.z; this.addAttribute("position", new z(c, 3)) } else if (a && a.isBufferGeometry) { if (null !== a.index) { m = a.index.array; f = a.attributes.position; e = a.groups; k = 0; 0 === e.length && a.addGroup(0, m.length); l = new Uint32Array(2 * m.length); g = 0; for (h = e.length; g < h; ++g) { a = e[g]; p = a.start; n = a.count; a = p; for (var r = p + n; a < r; a += 3) for (p = 0; 3 > p; p++) c[0] = m[a + p], c[1] = m[a + (p + 1) % 3], c.sort(b), n = c.toString(), void 0 === d[n] && (l[2 * k] = c[0], l[2 * k + 1] = c[1], d[n] = !0, k++) } c = new Float32Array(6 * k); a = 0; for (m = k; a < m; a++) for (p = 0; 2 > p; p++) k = 6 * a + 3 * p, d = l[2 * a + p], c[k + 0] = f.getX(d), c[k + 1] = f.getY(d), c[k + 2] = f.getZ(d) } else for (f = a.attributes.position.array, k = f.length / 3, l = k / 3, c = new Float32Array(6 * k), a = 0, m = l; a < m; a++) for (p = 0; 3 > p; p++) k = 18 * a + 6 * p, l = 9 * a + 3 * p, c[k + 0] = f[l], c[k + 1] = f[l + 1], c[k + 2] = f[l + 2], d = 9 * a + (p + 1) % 3 * 3, c[k + 3] = f[d], c[k + 4] = f[d + 1], c[k + 5] = f[d + 2]; this.addAttribute("position", new z(c, 3)) } } function jc(a, b, c) { R.call(this); this.type = "ParametricGeometry"; this.parameters = { func: a, slices: b, stacks: c }; var d = this.vertices, e = this.faces, f = this.faceVertexUvs[0], g, k, l, m, h = b + 1; for (g = 0; g <= c; g++) for (m = g / c, k = 0; k <= b; k++) l = k / b, l = a(l, m), d.push(l); var p, n, r, t; for (g = 0; g < c; g++) for (k = 0; k < b; k++) a = g * h + k, d = g * h + k + 1, m = (g + 1) * h + k + 1, l = (g + 1) * h + k, p = new C(k / b, g / c), n = new C((k + 1) / b, g / c), r = new C((k + 1) / b, (g + 1) / c), t = new C(k / b, (g + 1) / c), e.push(new ga(a, d, l)), f.push([p, n, t]), e.push(new ga(d, m, l)), f.push([n.clone(), r, t.clone()]); this.computeFaceNormals(); this.computeVertexNormals() } function sa(a, b, c, d) { function e(a) { var b = a.normalize().clone(); b.index = l.vertices.push(b) - 1; b.uv = new C(Math.atan2(a.z, -a.x) / 2 / Math.PI + .5, 1 - (Math.atan2(-a.y, Math.sqrt(a.x * a.x + a.z * a.z)) / Math.PI + .5)); return b } function f(a, b, c) { var d = new ga(a.index, b.index, c.index, [a.clone(), b.clone(), c.clone()]); l.faces.push(d); A.copy(a).add(b).add(c).divideScalar(3); d = Math.atan2(A.z, -A.x); l.faceVertexUvs[0].push([k(a.uv, a, d), k(b.uv, b, d), k(c.uv, c, d)]) } function g(a, b) { for (var c = Math.pow(2, b), d = e(l.vertices[a.a]), g = e(l.vertices[a.b]), k = e(l.vertices[a.c]), m = [], h = 0; h <= c; h++) { m[h] = []; for (var n = e(d.clone().lerp(k, h / c)), p = e(g.clone().lerp(k, h / c)), u = c - h, r = 0; r <= u; r++) m[h][r] = 0 === r && h === c ? n : e(n.clone().lerp(p, r / u)) } for (h = 0; h < c; h++) for (r = 0; r < 2 * (c - h) - 1; r++) d = Math.floor(r / 2), 0 === r % 2 ? f(m[h][d + 1], m[h + 1][d], m[h][d]) : f(m[h][d + 1], m[h + 1][d + 1], m[h + 1][d]) } function k(a, b, c) { 0 > c && 1 === a.x && (a = new C(a.x - 1, a.y)); 0 === b.x && 0 === b.z && (a = new C(c / 2 / Math.PI + .5, a.y)); return a.clone() } R.call(this); this.type = "PolyhedronGeometry"; this.parameters = { vertices: a, indices: b, radius: c, detail: d }; c = c || 1; d = d || 0; for (var l = this, m = 0, h = a.length; m < h; m += 3) e(new q(a[m], a[m + 1], a[m + 2])); a = this.vertices; for (var p = [], n = m = 0, h = b.length; m < h; m += 3, n++) { var r = a[b[m]], t = a[b[m + 1]], v = a[b[m + 2]]; p[n] = new ga(r.index, t.index, v.index, [r.clone(), t.clone(), v.clone()]) } for (var A = new q, m = 0, h = p.length; m < h; m++) g(p[m], d); m = 0; for (h = this.faceVertexUvs[0].length; m < h; m++) b = this.faceVertexUvs[0][m], d = b[0].x, a = b[1].x, p = b[2].x, n = Math.min(d, a, p), .9 < Math.max(d, a, p) && .1 > n && (.2 > d && (b[0].x += 1), .2 > a && (b[1].x += 1), .2 > p && (b[2].x += 1)); m = 0; for (h = this.vertices.length; m < h; m++) this.vertices[m].multiplyScalar(c); this.mergeVertices(); this.computeFaceNormals(); this.boundingSphere = new Aa(new q, c) } function kc(a, b) { sa.call(this, [1, 1, 1, -1, -1, 1, -1, 1, -1, 1, -1, -1], [2, 1, 0, 0, 3, 2, 1, 3, 0, 2, 3, 1], a, b); this.type = "TetrahedronGeometry"; this.parameters = { radius: a, detail: b } } function lc(a, b) { sa.call(this, [1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1], [0, 2, 4, 0, 4, 3, 0, 3, 5, 0, 5, 2, 1, 2, 5, 1, 5, 3, 1, 3, 4, 1, 4, 2], a, b); this.type = "OctahedronGeometry"; this.parameters = { radius: a, detail: b } } function mc(a, b) { var c = (1 + Math.sqrt(5)) / 2; sa.call(this, [-1, c, 0, 1, c, 0, -1, -c, 0, 1, -c, 0, 0, -1, c, 0, 1, c, 0, -1, -c, 0, 1, -c, c, 0, -1, c, 0, 1, -c, 0, -1, -c, 0, 1], [0, 11, 5, 0, 5, 1, 0, 1, 7, 0, 7, 10, 0, 10, 11, 1, 5, 9, 5, 11, 4, 11, 10, 2, 10, 7, 6, 7, 1, 8, 3, 9, 4, 3, 4, 2, 3, 2, 6, 3, 6, 8, 3, 8, 9, 4, 9, 5, 2, 4, 11, 6, 2, 10, 8, 6, 7, 9, 8, 1], a, b); this.type = "IcosahedronGeometry"; this.parameters = { radius: a, detail: b } } function nc(a, b) { var c = (1 + Math.sqrt(5)) / 2, d = 1 / c; sa.call(this, [-1, -1, -1, -1, -1, 1, -1, 1, -1, -1, 1, 1, 1, -1, -1, 1, -1, 1, 1, 1, -1, 1, 1, 1, 0, -d, -c, 0, -d, c, 0, d, -c, 0, d, c, -d, -c, 0, -d, c, 0, d, -c, 0, d, c, 0, -c, 0, -d, c, 0, -d, -c, 0, d, c, 0, d], [3, 11, 7, 3, 7, 15, 3, 15, 13, 7, 19, 17, 7, 17, 6, 7, 6, 15, 17, 4, 8, 17, 8, 10, 17, 10, 6, 8, 0, 16, 8, 16, 2, 8, 2, 10, 0, 12, 1, 0, 1, 18, 0, 18, 16, 6, 10, 2, 6, 2, 13, 6, 13, 15, 2, 16, 18, 2, 18, 3, 2, 3, 13, 18, 1, 9, 18, 9, 11, 18, 11, 3, 4, 14, 12, 4, 12, 0, 4, 0, 8, 11, 9, 5, 11, 5, 19, 11, 19, 7, 19, 5, 14, 19, 14, 4, 19, 4, 17, 1, 12, 14, 1, 14, 5, 1, 5, 9], a, b); this.type = "DodecahedronGeometry"; this.parameters = { radius: a, detail: b } } function wa(a, b, c, d, e, f) { R.call(this); this.type = "TubeGeometry"; this.parameters = { path: a, segments: b, radius: c, radialSegments: d, closed: e, taper: f }; b = b || 64; c = c || 1; d = d || 8; e = e || !1; f = f || wa.NoTaper; var g = [], k, l, m = b + 1, h, p, n, r, t, v = new q, A, w, x; A = new wa.FrenetFrames(a, b, e); w = A.normals; x = A.binormals; this.tangents = A.tangents; this.normals = w; this.binormals = x; for (A = 0; A < m; A++) for (g[A] = [], h = A / (m - 1), t = a.getPointAt(h), k = w[A], l = x[A], n = c * f(h), h = 0; h < d; h++) p = h / d * 2 * Math.PI, r = -n * Math.cos(p), p = n * Math.sin(p), v.copy(t), v.x += r * k.x + p * l.x, v.y += r * k.y + p * l.y, v.z += r * k.z + p * l.z, g[A][h] = this.vertices.push(new q(v.x, v.y, v.z)) - 1; for (A = 0; A < b; A++) for (h = 0; h < d; h++) f = e ? (A + 1) % b : A + 1, m = (h + 1) % d, a = g[A][h], c = g[f][h], f = g[f][m], m = g[A][m], v = new C(A / b, h / d), w = new C((A + 1) / b, h / d), x = new C((A + 1) / b, (h + 1) / d), k = new C(A / b, (h + 1) / d), this.faces.push(new ga(a, c, m)), this.faceVertexUvs[0].push([v, w, k]), this.faces.push(new ga(c, f, m)), this.faceVertexUvs[0].push([w.clone(), x, k.clone()]); this.computeFaceNormals(); this.computeVertexNormals() } function Jb(a, b, c, d, e, f) { function g(a, b, c, d, e) { var f = Math.sin(a); b = c / b * a; c = Math.cos(b); e.x = d * (2 + c) * .5 * Math.cos(a); e.y = d * (2 + c) * f * .5; e.z = d * Math.sin(b) * .5 } I.call(this); this.type = "TorusKnotBufferGeometry"; this.parameters = { radius: a, tube: b, tubularSegments: c, radialSegments: d, p: e, q: f }; a = a || 100; b = b || 40; c = Math.floor(c) || 64; d = Math.floor(d) || 8; e = e || 2; f = f || 3; var k = (d + 1) * (c + 1), l = d * c * 6, l = new z(new(65535 < l ? Uint32Array : Uint16Array)(l), 1), m = new z(new Float32Array(3 * k), 3), h = new z(new Float32Array(3 * k), 3), k = new z(new Float32Array(2 * k), 2), p, n, r = 0, t = 0, v = new q, A = new q, w = new C, x = new q, T = new q, y = new q, F = new q, G = new q; for (p = 0; p <= c; ++p) for (n = p / c * e * Math.PI * 2, g(n, e, f, a, x), g(n + .01, e, f, a, T), F.subVectors(T, x), G.addVectors(T, x), y.crossVectors(F, G), G.crossVectors(y, F), y.normalize(), G.normalize(), n = 0; n <= d; ++n) { var E = n / d * Math.PI * 2, J = -b * Math.cos(E), E = b * Math.sin(E); v.x = x.x + (J * G.x + E * y.x); v.y = x.y + (J * G.y + E * y.y); v.z = x.z + (J * G.z + E * y.z); m.setXYZ(r, v.x, v.y, v.z); A.subVectors(v, x).normalize(); h.setXYZ(r, A.x, A.y, A.z); w.x = p / c; w.y = n / d; k.setXY(r, w.x, w.y); r++ } for (n = 1; n <= c; n++) for (p = 1; p <= d; p++) a = (d + 1) * n + (p - 1), b = (d + 1) * n + p, e = (d + 1) * (n - 1) + p, l.setX(t, (d + 1) * (n - 1) + (p - 1)), t++, l.setX(t, a), t++, l.setX(t, e), t++, l.setX(t, a), t++, l.setX(t, b), t++, l.setX(t, e), t++; this.setIndex(l); this.addAttribute("position", m); this.addAttribute("normal", h); this.addAttribute("uv", k) } function oc(a, b, c, d, e, f, g) { R.call(this); this.type = "TorusKnotGeometry"; this.parameters = { radius: a, tube: b, tubularSegments: c, radialSegments: d, p: e, q: f }; void 0 !== g && console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."); this.fromBufferGeometry(new Jb(a, b, c, d, e, f)); this.mergeVertices() } function Kb(a, b, c, d, e) { I.call(this); this.type = "TorusBufferGeometry"; this.parameters = { radius: a, tube: b, radialSegments: c, tubularSegments: d, arc: e }; a = a || 100; b = b || 40; c = Math.floor(c) || 8; d = Math.floor(d) || 6; e = e || 2 * Math.PI; var f = (c + 1) * (d + 1), g = c * d * 6, g = new(65535 < g ? Uint32Array : Uint16Array)(g), k = new Float32Array(3 * f), l = new Float32Array(3 * f), f = new Float32Array(2 * f), m = 0, h = 0, p = 0, n = new q, r = new q, t = new q, v, A; for (v = 0; v <= c; v++) for (A = 0; A <= d; A++) { var w = A / d * e, x = v / c * Math.PI * 2; r.x = (a + b * Math.cos(x)) * Math.cos(w); r.y = (a + b * Math.cos(x)) * Math.sin(w); r.z = b * Math.sin(x); k[m] = r.x; k[m + 1] = r.y; k[m + 2] = r.z; n.x = a * Math.cos(w); n.y = a * Math.sin(w); t.subVectors(r, n).normalize(); l[m] = t.x; l[m + 1] = t.y; l[m + 2] = t.z; f[h] = A / d; f[h + 1] = v / c; m += 3; h += 2 } for (v = 1; v <= c; v++) for (A = 1; A <= d; A++) a = (d + 1) * (v - 1) + A - 1, b = (d + 1) * (v - 1) + A, e = (d + 1) * v + A, g[p] = (d + 1) * v + A - 1, g[p + 1] = a, g[p + 2] = e, g[p + 3] = a, g[p + 4] = b, g[p + 5] = e, p += 6; this.setIndex(new z(g, 1)); this.addAttribute("position", new z(k, 3)); this.addAttribute("normal", new z(l, 3)); this.addAttribute("uv", new z(f, 2)) } function pc(a, b, c, d, e) { R.call(this); this.type = "TorusGeometry"; this.parameters = { radius: a, tube: b, radialSegments: c, tubularSegments: d, arc: e }; this.fromBufferGeometry(new Kb(a, b, c, d, e)) } function ra(a, b) { "undefined" !== typeof a && (R.call(this), this.type = "ExtrudeGeometry", a = Array.isArray(a) ? a : [a], this.addShapeList(a, b), this.computeFaceNormals()) } function qc(a, b) { b = b || {}; var c = b.font; if (!1 === (c && c.isFont)) return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."), new R; c = c.generateShapes(a, b.size, b.curveSegments); b.amount = void 0 !== b.height ? b.height : 50; void 0 === b.bevelThickness && (b.bevelThickness = 10); void 0 === b.bevelSize && (b.bevelSize = 8); void 0 === b.bevelEnabled && (b.bevelEnabled = !1); ra.call(this, c, b); this.type = "TextGeometry" } function ib(a, b, c, d, e, f, g) { I.call(this); this.type = "SphereBufferGeometry"; this.parameters = { radius: a, widthSegments: b, heightSegments: c, phiStart: d, phiLength: e, thetaStart: f, thetaLength: g }; a = a || 50; b = Math.max(3, Math.floor(b) || 8); c = Math.max(2, Math.floor(c) || 6); d = void 0 !== d ? d : 0; e = void 0 !== e ? e : 2 * Math.PI; f = void 0 !== f ? f : 0; g = void 0 !== g ? g : Math.PI; for (var k = f + g, l = (b + 1) * (c + 1), m = new z(new Float32Array(3 * l), 3), h = new z(new Float32Array(3 * l), 3), l = new z(new Float32Array(2 * l), 2), p = 0, n = [], r = new q, t = 0; t <= c; t++) { for (var v = [], A = t / c, w = 0; w <= b; w++) { var x = w / b, T = -a * Math.cos(d + x * e) * Math.sin(f + A * g), y = a * Math.cos(f + A * g), F = a * Math.sin(d + x * e) * Math.sin(f + A * g); r.set(T, y, F).normalize(); m.setXYZ(p, T, y, F); h.setXYZ(p, r.x, r.y, r.z); l.setXY(p, x, 1 - A); v.push(p); p++ } n.push(v) } d = []; for (t = 0; t < c; t++) for (w = 0; w < b; w++) e = n[t][w + 1], g = n[t][w], p = n[t + 1][w], r = n[t + 1][w + 1], (0 !== t || 0 < f) && d.push(e, g, r), (t !== c - 1 || k < Math.PI) && d.push(g, p, r); this.setIndex(new(65535 < m.count ? ce : be)(d, 1)); this.addAttribute("position", m); this.addAttribute("normal", h); this.addAttribute("uv", l); this.boundingSphere = new Aa(new q, a) } function Lb(a, b, c, d, e, f, g) { R.call(this); this.type = "SphereGeometry"; this.parameters = { radius: a, widthSegments: b, heightSegments: c, phiStart: d, phiLength: e, thetaStart: f, thetaLength: g }; this.fromBufferGeometry(new ib(a, b, c, d, e, f, g)) } function Mb(a, b, c, d, e, f) { I.call(this); this.type = "RingBufferGeometry"; this.parameters = { innerRadius: a, outerRadius: b, thetaSegments: c, phiSegments: d, thetaStart: e, thetaLength: f }; a = a || 20; b = b || 50; e = void 0 !== e ? e : 0; f = void 0 !== f ? f : 2 * Math.PI; c = void 0 !== c ? Math.max(3, c) : 8; d = void 0 !== d ? Math.max(1, d) : 1; var g = (c + 1) * (d + 1), k = c * d * 6, k = new z(new(65535 < k ? Uint32Array : Uint16Array)(k), 1), l = new z(new Float32Array(3 * g), 3), m = new z(new Float32Array(3 * g), 3), g = new z(new Float32Array(2 * g), 2), h = 0, p = 0, n, r = a, t = (b - a) / d, v = new q, A = new C, w; for (a = 0; a <= d; a++) { for (w = 0; w <= c; w++) n = e + w / c * f, v.x = r * Math.cos(n), v.y = r * Math.sin(n), l.setXYZ(h, v.x, v.y, v.z), m.setXYZ(h, 0, 0, 1), A.x = (v.x / b + 1) / 2, A.y = (v.y / b + 1) / 2, g.setXY(h, A.x, A.y), h++; r += t } for (a = 0; a < d; a++) for (b = a * (c + 1), w = 0; w < c; w++) e = n = w + b, f = n + c + 1, h = n + c + 2, n += 1, k.setX(p, e), p++, k.setX(p, f), p++, k.setX(p, h), p++, k.setX(p, e), p++, k.setX(p, h), p++, k.setX(p, n), p++; this.setIndex(k); this.addAttribute("position", l); this.addAttribute("normal", m); this.addAttribute("uv", g) } function rc(a, b, c, d, e, f) { R.call(this); this.type = "RingGeometry"; this.parameters = { innerRadius: a, outerRadius: b, thetaSegments: c, phiSegments: d, thetaStart: e, thetaLength: f }; this.fromBufferGeometry(new Mb(a, b, c, d, e, f)) } function sc(a, b, c, d) { R.call(this); this.type = "PlaneGeometry"; this.parameters = { width: a, height: b, widthSegments: c, heightSegments: d }; this.fromBufferGeometry(new eb(a, b, c, d)) } function Nb(a, b, c, d) { I.call(this); this.type = "LatheBufferGeometry"; this.parameters = { points: a, segments: b, phiStart: c, phiLength: d }; b = Math.floor(b) || 12; c = c || 0; d = d || 2 * Math.PI; d = h.Math.clamp(d, 0, 2 * Math.PI); for (var e = (b + 1) * a.length, f = b * a.length * 6, g = new z(new(65535 < f ? Uint32Array : Uint16Array)(f), 1), k = new z(new Float32Array(3 * e), 3), l = new z(new Float32Array(2 * e), 2), m = 0, u = 0, p = 1 / b, n = new q, r = new C, e = 0; e <= b; e++) for (var f = c + e * p * d, t = Math.sin(f), v = Math.cos(f), f = 0; f <= a.length - 1; f++) n.x = a[f].x * t, n.y = a[f].y, n.z = a[f].x * v, k.setXYZ(m, n.x, n.y, n.z), r.x = e / b, r.y = f / (a.length - 1), l.setXY(m, r.x, r.y), m++; for (e = 0; e < b; e++) for (f = 0; f < a.length - 1; f++) c = f + e * a.length, m = c + a.length, p = c + a.length + 1, n = c + 1, g.setX(u, c), u++, g.setX(u, m), u++, g.setX(u, n), u++, g.setX(u, m), u++, g.setX(u, p), u++, g.setX(u, n), u++; this.setIndex(g); this.addAttribute("position", k); this.addAttribute("uv", l); this.computeVertexNormals(); if (d === 2 * Math.PI) for (d = this.attributes.normal.array, g = new q, k = new q, l = new q, c = b * a.length * 3, f = e = 0; e < a.length; e++, f += 3) g.x = d[f + 0], g.y = d[f + 1], g.z = d[f + 2], k.x = d[c + f + 0], k.y = d[c + f + 1], k.z = d[c + f + 2], l.addVectors(g, k).normalize(), d[f + 0] = d[c + f + 0] = l.x, d[f + 1] = d[c + f + 1] = l.y, d[f + 2] = d[c + f + 2] = l.z } function tc(a, b, c, d) { R.call(this); this.type = "LatheGeometry"; this.parameters = { points: a, segments: b, phiStart: c, phiLength: d }; this.fromBufferGeometry(new Nb(a, b, c, d)); this.mergeVertices() } function Ya(a, b) { R.call(this); this.type = "ShapeGeometry"; !1 === Array.isArray(a) && (a = [a]); this.addShapeList(a, b); this.computeFaceNormals() } function Ob(a, b) { function c(a, b) { return a - b } I.call(this); var d = Math.cos(h.Math.DEG2RAD * (void 0 !== b ? b : 1)), e = [0, 0], f = {}, g = ["a", "b", "c"], k; a && a.isBufferGeometry ? (k = new R, k.fromBufferGeometry(a)) : k = a.clone(); k.mergeVertices(); k.computeFaceNormals(); var l = k.vertices; k = k.faces; for (var m = 0, u = k.length; m < u; m++) for (var p = k[m], n = 0; 3 > n; n++) { e[0] = p[g[n]]; e[1] = p[g[(n + 1) % 3]]; e.sort(c); var r = e.toString(); void 0 === f[r] ? f[r] = { vert1: e[0], vert2: e[1], face1: m, face2: void 0 } : f[r].face2 = m } e = []; for (r in f) if (g = f[r], void 0 === g.face2 || k[g.face1].normal.dot(k[g.face2].normal) <= d) m = l[g.vert1], e.push(m.x), e.push(m.y), e.push(m.z), m = l[g.vert2], e.push(m.x), e.push(m.y), e.push(m.z); this.addAttribute("position", new z(new Float32Array(e), 3)) } function Za(a, b, c, d, e, f, g, k) { function l(c) { var e, f, l, h = new C, n = new q, p = 0, u = !0 === c ? a : b, T = !0 === c ? 1 : -1; f = w; for (e = 1; e <= d; e++) t.setXYZ(w, 0, y * T, 0), v.setXYZ(w, 0, T, 0), h.x = .5, h.y = .5, A.setXY(w, h.x, h.y), w++; l = w; for (e = 0; e <= d; e++) { var D = e / d * k + g, z = Math.cos(D), D = Math.sin(D); n.x = u * D; n.y = y * T; n.z = u * z; t.setXYZ(w, n.x, n.y, n.z); v.setXYZ(w, 0, T, 0); h.x = .5 * z + .5; h.y = .5 * D * T + .5; A.setXY(w, h.x, h.y); w++ } for (e = 0; e < d; e++) h = f + e, n = l + e, !0 === c ? (r.setX(x, n), x++, r.setX(x, n + 1)) : (r.setX(x, n + 1), x++, r.setX(x, n)), x++, r.setX(x, h), x++, p += 3; m.addGroup(F, p, !0 === c ? 1 : 2); F += p } I.call(this); this.type = "CylinderBufferGeometry"; this.parameters = { radiusTop: a, radiusBottom: b, height: c, radialSegments: d, heightSegments: e, openEnded: f, thetaStart: g, thetaLength: k }; var m = this; a = void 0 !== a ? a : 20; b = void 0 !== b ? b : 20; c = void 0 !== c ? c : 100; d = Math.floor(d) || 8; e = Math.floor(e) || 1; f = void 0 !== f ? f : !1; g = void 0 !== g ? g : 0; k = void 0 !== k ? k : 2 * Math.PI; var h = 0; !1 === f && (0 < a && h++, 0 < b && h++); var p = function () { var a = (d + 1) * (e + 1); !1 === f && (a += (d + 1) * h + d * h); return a } (), n = function () { var a = d * e * 6; !1 === f && (a += d * h * 3); return a } (), r = new z(new(65535 < n ? Uint32Array : Uint16Array)(n), 1), t = new z(new Float32Array(3 * p), 3), v = new z(new Float32Array(3 * p), 3), A = new z(new Float32Array(2 * p), 2), w = 0, x = 0, T = [], y = c / 2, F = 0; (function () { var f, l, h = new q, n = new q, p = 0, u = (b - a) / c; for (l = 0; l <= e; l++) { var C = [], D = l / e, z = D * (b - a) + a; for (f = 0; f <= d; f++) { var L = f / d, M = L * k + g, O = Math.sin(M), M = Math.cos(M); n.x = z * O; n.y = -D * c + y; n.z = z * M; t.setXYZ(w, n.x, n.y, n.z); h.set(O, u, M).normalize(); v.setXYZ(w, h.x, h.y, h.z); A.setXY(w, L, 1 - D); C.push(w); w++ } T.push(C) } for (f = 0; f < d; f++) for (l = 0; l < e; l++) h = T[l + 1][f], n = T[l + 1][f + 1], u = T[l][f + 1], r.setX(x, T[l][f]), x++, r.setX(x, h), x++, r.setX(x, u), x++, r.setX(x, h), x++, r.setX(x, n), x++, r.setX(x, u), x++, p += 6; m.addGroup(F, p, 0); F += p })(); !1 === f && (0 < a && l(!0), 0 < b && l(!1)); this.setIndex(r); this.addAttribute("position", t); this.addAttribute("normal", v); this.addAttribute("uv", A) } function jb(a, b, c, d, e, f, g, k) { R.call(this); this.type = "CylinderGeometry"; this.parameters = { radiusTop: a, radiusBottom: b, height: c, radialSegments: d, heightSegments: e, openEnded: f, thetaStart: g, thetaLength: k }; this.fromBufferGeometry(new Za(a, b, c, d, e, f, g, k)); this.mergeVertices() } function uc(a, b, c, d, e, f, g) { jb.call(this, 0, a, b, c, d, e, f, g); this.type = "ConeGeometry"; this.parameters = { radius: a, height: b, radialSegments: c, heightSegments: d, openEnded: e, thetaStart: f, thetaLength: g } } function vc(a, b, c, d, e, f, g) { Za.call(this, 0, a, b, c, d, e, f, g); this.type = "ConeBufferGeometry"; this.parameters = { radius: a, height: b, radialSegments: c, heightSegments: d, thetaStart: f, thetaLength: g } } function Pb(a, b, c, d) { I.call(this); this.type = "CircleBufferGeometry"; this.parameters = { radius: a, segments: b, thetaStart: c, thetaLength: d }; a = a || 50; b = void 0 !== b ? Math.max(3, b) : 8; c = void 0 !== c ? c : 0; d = void 0 !== d ? d : 2 * Math.PI; var e = b + 2, f = new Float32Array(3 * e), g = new Float32Array(3 * e), e = new Float32Array(2 * e); g[2] = 1; e[0] = .5; e[1] = .5; for (var k = 0, l = 3, m = 2; k <= b; k++, l += 3, m += 2) { var h = c + k / b * d; f[l] = a * Math.cos(h); f[l + 1] = a * Math.sin(h); g[l + 2] = 1; e[m] = (f[l] / a + 1) / 2; e[m + 1] = (f[l + 1] / a + 1) / 2 } c = []; for (l = 1; l <= b; l++) c.push(l, l + 1, 0); this.setIndex(new z(new Uint16Array(c), 1)); this.addAttribute("position", new z(f, 3)); this.addAttribute("normal", new z(g, 3)); this.addAttribute("uv", new z(e, 2)); this.boundingSphere = new Aa(new q, a) } function wc(a, b, c, d) { R.call(this); this.type = "CircleGeometry"; this.parameters = { radius: a, segments: b, thetaStart: c, thetaLength: d }; this.fromBufferGeometry(new Pb(a, b, c, d)) } function kb(a, b, c, d, e, f) { R.call(this); this.type = "BoxGeometry"; this.parameters = { width: a, height: b, depth: c, widthSegments: d, heightSegments: e, depthSegments: f }; this.fromBufferGeometry(new db(a, b, c, d, e, f)); this.mergeVertices() } function Qb() { Da.call(this, { uniforms: h.UniformsUtils.merge([U.lights, { opacity: { value: 1 } } ]), vertexShader: Z.shadow_vert, fragmentShader: Z.shadow_frag }); this.transparent = this.lights = !0; Object.defineProperties(this, { opacity: { enumerable: !0, get: function () { return this.uniforms.opacity.value }, set: function (a) { this.uniforms.opacity.value = a } } }) } function Rb(a) { Da.call(this, a); this.type = "RawShaderMaterial" } function xc(a) { this.uuid = h.Math.generateUUID(); this.type = "MultiMaterial"; this.materials = a instanceof Array ? a : []; this.visible = !0 } function Ka(a) { S.call(this); this.defines = { STANDARD: "" }; this.type = "MeshStandardMaterial"; this.color = new H(16777215); this.metalness = this.roughness = .5; this.lightMap = this.map = null; this.lightMapIntensity = 1; this.aoMap = null; this.aoMapIntensity = 1; this.emissive = new H(0); this.emissiveIntensity = 1; this.bumpMap = this.emissiveMap = null; this.bumpScale = 1; this.normalMap = null; this.normalScale = new C(1, 1); this.displacementMap = null; this.displacementScale = 1; this.displacementBias = 0; this.envMap = this.alphaMap = this.metalnessMap = this.roughnessMap = null; this.envMapIntensity = 1; this.refractionRatio = .98; this.wireframe = !1; this.wireframeLinewidth = 1; this.wireframeLinejoin = this.wireframeLinecap = "round"; this.morphNormals = this.morphTargets = this.skinning = !1; this.setValues(a) } function lb(a) { Ka.call(this); this.defines = { PHYSICAL: "" }; this.type = "MeshPhysicalMaterial"; this.reflectivity = .5; this.clearCoatRoughness = this.clearCoat = 0; this.setValues(a) } function $a(a) { S.call(this); this.type = "MeshPhongMaterial"; this.color = new H(16777215); this.specular = new H(1118481); this.shininess = 30; this.lightMap = this.map = null; this.lightMapIntensity = 1; this.aoMap = null; this.aoMapIntensity = 1; this.emissive = new H(0); this.emissiveIntensity = 1; this.bumpMap = this.emissiveMap = null; this.bumpScale = 1; this.normalMap = null; this.normalScale = new C(1, 1); this.displacementMap = null; this.displacementScale = 1; this.displacementBias = 0; this.envMap = this.alphaMap = this.specularMap = null; this.combine = 0; this.reflectivity = 1; this.refractionRatio = .98; this.wireframe = !1; this.wireframeLinewidth = 1; this.wireframeLinejoin = this.wireframeLinecap = "round"; this.morphNormals = this.morphTargets = this.skinning = !1; this.setValues(a) } function mb(a) { S.call(this, a); this.type = "MeshNormalMaterial"; this.wireframe = !1; this.wireframeLinewidth = 1; this.morphTargets = this.lights = this.fog = !1; this.setValues(a) } function nb(a) { S.call(this); this.type = "MeshLambertMaterial"; this.color = new H(16777215); this.lightMap = this.map = null; this.lightMapIntensity = 1; this.aoMap = null; this.aoMapIntensity = 1; this.emissive = new H(0); this.emissiveIntensity = 1; this.envMap = this.alphaMap = this.specularMap = this.emissiveMap = null; this.combine = 0; this.reflectivity = 1; this.refractionRatio = .98; this.wireframe = !1; this.wireframeLinewidth = 1; this.wireframeLinejoin = this.wireframeLinecap = "round"; this.morphNormals = this.morphTargets = this.skinning = !1; this.setValues(a) } function ob(a) { S.call(this); this.type = "LineDashedMaterial"; this.color = new H(16777215); this.scale = this.linewidth = 1; this.dashSize = 3; this.gapSize = 1; this.lights = !1; this.setValues(a) } function qd(a, b, c) { var d = this, e = !1, f = 0, g = 0; this.onStart = void 0; this.onLoad = a; this.onProgress = b; this.onError = c; this.itemStart = function (a) { g++; if (!1 === e && void 0 !== d.onStart) d.onStart(a, f, g); e = !0 }; this.itemEnd = function (a) { f++; if (void 0 !== d.onProgress) d.onProgress(a, f, g); if (f === g && (e = !1, void 0 !== d.onLoad)) d.onLoad() }; this.itemError = function (a) { if (void 0 !== d.onError) d.onError(a) } } function za(a) { this.manager = void 0 !== a ? a : h.DefaultLoadingManager } function ie(a) { this.manager = void 0 !== a ? a : h.DefaultLoadingManager; this._parser = null } function rd(a) { this.manager = void 0 !== a ? a : h.DefaultLoadingManager; this._parser = null } function yc(a) { this.manager = void 0 !== a ? a : h.DefaultLoadingManager } function sd(a) { this.manager = void 0 !== a ? a : h.DefaultLoadingManager } function Sc(a) { this.manager = void 0 !== a ? a : h.DefaultLoadingManager } function oa(a, b) { D.call(this); this.type = "Light"; this.color = new H(a); this.intensity = void 0 !== b ? b : 1; this.receiveShadow = void 0 } function Tc(a, b, c) { oa.call(this, a, c); this.type = "HemisphereLight"; this.castShadow = void 0; this.position.copy(D.DefaultUp); this.updateMatrix(); this.groundColor = new H(b) } function pb(a) { this.camera = a; this.bias = 0; this.radius = 1; this.mapSize = new C(512, 512); this.map = null; this.matrix = new P } function Uc() { pb.call(this, new Ca(50, 1, .5, 500)) } function Vc(a, b, c, d, e, f) { oa.call(this, a, b); this.type = "SpotLight"; this.position.copy(D.DefaultUp); this.updateMatrix(); this.target = new D; Object.defineProperty(this, "power", { get: function () { return this.intensity * Math.PI }, set: function (a) { this.intensity = a / Math.PI } }); this.distance = void 0 !== c ? c : 0; this.angle = void 0 !== d ? d : Math.PI / 3; this.penumbra = void 0 !== e ? e : 0; this.decay = void 0 !== f ? f : 1; this.shadow = new Uc } function Wc(a, b, c, d) { oa.call(this, a, b); this.type = "PointLight"; Object.defineProperty(this, "power", { get: function () { return 4 * this.intensity * Math.PI }, set: function (a) { this.intensity = a / (4 * Math.PI) } }); this.distance = void 0 !== c ? c : 0; this.decay = void 0 !== d ? d : 1; this.shadow = new pb(new Ca(90, 1, .5, 500)) } function Xc(a) { pb.call(this, new Db(-5, 5, 5, -5, .5, 500)) } function Yc(a, b) { oa.call(this, a, b); this.type = "DirectionalLight"; this.position.copy(D.DefaultUp); this.updateMatrix(); this.target = new D; this.shadow = new Xc } function Zc(a, b) { oa.call(this, a, b); this.type = "AmbientLight"; this.castShadow = void 0 } function ja(a, b, c, d) { this.parameterPositions = a; this._cachedIndex = 0; this.resultBuffer = void 0 !== d ? d : new b.constructor(c); this.sampleValues = b; this.valueSize = c } function $c(a, b, c, d) { ja.call(this, a, b, c, d); this._offsetNext = this._weightNext = this._offsetPrev = this._weightPrev = -0 } function zc(a, b, c, d) { ja.call(this, a, b, c, d) } function ad(a, b, c, d) { ja.call(this, a, b, c, d) } function qb(a, b, c, d) { if (void 0 === a) throw Error("track name is undefined"); if (void 0 === b || 0 === b.length) throw Error("no keyframes in track named " + a); this.name = a; this.times = h.AnimationUtils.convertArray(b, this.TimeBufferType); this.values = h.AnimationUtils.convertArray(c, this.ValueBufferType); this.setInterpolation(d || this.DefaultInterpolation); this.validate(); this.optimize() } function Sb(a, b, c, d) { qb.call(this, a, b, c, d) } function bd(a, b, c, d) { ja.call(this, a, b, c, d) } function Ac(a, b, c, d) { qb.call(this, a, b, c, d) } function Tb(a, b, c, d) { qb.call(this, a, b, c, d) } function cd(a, b, c, d) { qb.call(this, a, b, c, d) } function dd(a, b, c) { qb.call(this, a, b, c) } function ed(a, b, c, d) { qb.call(this, a, b, c, d) } function rb(a, b, c, d) { qb.apply(this, arguments) } function ta(a, b, c) { this.name = a; this.tracks = c; this.duration = void 0 !== b ? b : -1; this.uuid = h.Math.generateUUID(); 0 > this.duration && this.resetDuration(); this.optimize() } function fd(a) { this.manager = void 0 !== a ? a : h.DefaultLoadingManager; this.textures = {} } function td(a) { this.manager = void 0 !== a ? a : h.DefaultLoadingManager } function sb() { this.onLoadStart = function () {}; this.onLoadProgress = function () {}; this.onLoadComplete = function () {} } function ud(a) { "boolean" === typeof a && (console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."), a = void 0); this.manager = void 0 !== a ? a : h.DefaultLoadingManager; this.withCredentials = !1 } function je(a) { this.manager = void 0 !== a ? a : h.DefaultLoadingManager; this.texturePath = "" } function Y() {} function La(a, b) { this.v1 = a; this.v2 = b } function Bc() { this.curves = []; this.autoClose = !1 } function Ra(a, b, c, d, e, f, g, k) { this.aX = a; this.aY = b; this.xRadius = c; this.yRadius = d; this.aStartAngle = e; this.aEndAngle = f; this.aClockwise = g; this.aRotation = k || 0 } function tb(a) { this.points = void 0 === a ? [] : a } function ub(a, b, c, d) { this.v0 = a; this.v1 = b; this.v2 = c; this.v3 = d } function vb(a, b, c) { this.v0 = a; this.v1 = b; this.v2 = c } function wb() { Cc.apply(this, arguments); this.holes = [] } function Cc(a) { Bc.call(this); this.currentPoint = new C; a && this.fromPoints(a) } function vd() { this.subPaths = []; this.currentPath = null } function wd(a) { this.data = a } function ke(a) { this.manager = void 0 !== a ? a : h.DefaultLoadingManager } function xd() { void 0 === yd && (yd = new(window.AudioContext || window.webkitAudioContext)); return yd } function zd(a) { this.manager = void 0 !== a ? a : h.DefaultLoadingManager } function le() { this.type = "StereoCamera"; this.aspect = 1; this.eyeSep = .064; this.cameraL = new Ca; this.cameraL.layers.enable(1); this.cameraL.matrixAutoUpdate = !1; this.cameraR = new Ca; this.cameraR.layers.enable(2); this.cameraR.matrixAutoUpdate = !1 } function gd(a, b, c) { D.call(this); this.type = "CubeCamera"; var d = new Ca(90, 1, a, b); d.up.set(0, -1, 0); d.lookAt(new q(1, 0, 0)); this.add(d); var e = new Ca(90, 1, a, b); e.up.set(0, -1, 0); e.lookAt(new q(-1, 0, 0)); this.add(e); var f = new Ca(90, 1, a, b); f.up.set(0, 0, 1); f.lookAt(new q(0, 1, 0)); this.add(f); var g = new Ca(90, 1, a, b); g.up.set(0, 0, -1); g.lookAt(new q(0, -1, 0)); this.add(g); var k = new Ca(90, 1, a, b); k.up.set(0, -1, 0); k.lookAt(new q(0, 0, 1)); this.add(k); var l = new Ca(90, 1, a, b); l.up.set(0, -1, 0); l.lookAt(new q(0, 0, -1)); this.add(l); this.renderTarget = new Ab(c, c, { format: 1022, magFilter: 1006, minFilter: 1006 }); this.updateCubeMap = function (a, b) { null === this.parent && this.updateMatrixWorld(); var c = this.renderTarget, h = c.texture.generateMipmaps; c.texture.generateMipmaps = !1; c.activeCubeFace = 0; a.render(b, d, c); c.activeCubeFace = 1; a.render(b, e, c); c.activeCubeFace = 2; a.render(b, f, c); c.activeCubeFace = 3; a.render(b, g, c); c.activeCubeFace = 4; a.render(b, k, c); c.texture.generateMipmaps = h; c.activeCubeFace = 5; a.render(b, l, c); a.setRenderTarget(null) } } function Ad() { D.call(this); this.type = "AudioListener"; this.context = xd(); this.gain = this.context.createGain(); this.gain.connect(this.context.destination); this.filter = null } function Ub(a) { D.call(this); this.type = "Audio"; this.context = a.context; this.source = this.context.createBufferSource(); this.source.onended = this.onEnded.bind(this); this.gain = this.context.createGain(); this.gain.connect(a.getInput()); this.autoplay = !1; this.startTime = 0; this.playbackRate = 1; this.isPlaying = !1; this.hasPlaybackControl = !0; this.sourceType = "empty"; this.filters = [] } function Bd(a) { Ub.call(this, a); this.panner = this.context.createPanner(); this.panner.connect(this.gain) } function Cd(a, b) { this.analyser = a.context.createAnalyser(); this.analyser.fftSize = void 0 !== b ? b : 2048; this.data = new Uint8Array(this.analyser.frequencyBinCount); a.getOutput().connect(this.analyser) } function hd(a, b, c) { this.binding = a; this.valueSize = c; a = Float64Array; switch (b) { case "quaternion": b = this._slerp; break; case "string": case "bool": a = Array; b = this._select; break; default: b = this._lerp } this.buffer = new a(4 * c); this._mixBufferRegion = b; this.referenceCount = this.useCount = this.cumulativeWeight = 0 } function ka(a, b, c) { this.path = b; this.parsedPath = c || ka.parseTrackName(b); this.node = ka.findNode(a, this.parsedPath.nodeName) || a; this.rootNode = a } function Dd(a) { this.uuid = h.Math.generateUUID(); this._objects = Array.prototype.slice.call(arguments); this.nCachedObjects_ = 0; var b = {}; this._indicesByUUID = b; for (var c = 0, d = arguments.length; c !== d; ++c) b[arguments[c].uuid] = c; this._paths = []; this._parsedPaths = []; this._bindings = []; this._bindingsIndicesByPath = {}; var e = this; this.stats = { objects: { get total() { return e._objects.length }, get inUse() { return this.total - e.nCachedObjects_ } }, get bindingsPerObject() { return e._bindings.length } } } function Ed(a, b, c) { this._mixer = a; this._clip = b; this._localRoot = c || null; a = b.tracks; b = a.length; c = Array(b); for (var d = { endingStart: 2400, endingEnd: 2400 }, e = 0; e !== b; ++e) { var f = a[e].createInterpolant(null); c[e] = f; f.settings = d } this._interpolantSettings = d; this._interpolants = c; this._propertyBindings = Array(b); this._weightInterpolant = this._timeScaleInterpolant = this._byClipCacheIndex = this._cacheIndex = null; this.loop = 2201; this._loopCount = -1; this._startTime = null; this.time = 0; this._effectiveWeight = this.weight = this._effectiveTimeScale = this.timeScale = 1; this.repetitions = Infinity; this.paused = !1; this.enabled = !0; this.clampWhenFinished = !1; this.zeroSlopeAtEnd = this.zeroSlopeAtStart = !0 } function Fd(a) { this._root = a; this._initMemoryManager(); this.time = this._accuIndex = 0; this.timeScale = 1 } function Gd(a, b) { "string" === typeof a && (console.warn("THREE.Uniform: Type parameter is no longer needed."), a = b); this.value = a; this.dynamic = !1 } function xb() { I.call(this); this.type = "InstancedBufferGeometry"; this.maxInstancedCount = void 0 } function Hd(a, b, c, d) { this.uuid = h.Math.generateUUID(); this.data = a; this.itemSize = b; this.offset = c; this.normalized = !0 === d } function Vb(a, b) { this.uuid = h.Math.generateUUID(); this.array = a; this.stride = b; this.count = void 0 !== a ? a.length / b : 0; this.dynamic = !1; this.updateRange = { offset: 0, count: -1 }; this.version = 0 } function Wb(a, b, c) { Vb.call(this, a, b); this.meshPerAttribute = c || 1 } function Xb(a, b, c) { z.call(this, a, b); this.meshPerAttribute = c || 1 } function Id(a, b, c, d) { this.ray = new Wa(a, b); this.near = c || 0; this.far = d || Infinity; this.params = { Mesh: {}, Line: {}, LOD: {}, Points: { threshold: 1 }, Sprite: {} }; Object.defineProperties(this.params, { PointCloud: { get: function () { console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."); return this.Points } } }) } function me(a, b) { return a.distance - b.distance } function Jd(a, b, c, d) { if (!1 !== a.visible && (a.raycast(b, c), !0 === d)) { a = a.children; d = 0; for (var e = a.length; d < e; d++) Jd(a[d], b, c, !0) } } function Kd(a) { this.autoStart = void 0 !== a ? a : !0; this.elapsedTime = this.oldTime = this.startTime = 0; this.running = !1 } function Ld(a, b, c) { this.radius = void 0 !== a ? a : 1; this.phi = void 0 !== b ? b : 0; this.theta = void 0 !== c ? c : 0; return this } function la(a, b) { va.call(this, a, b); this.animationsMap = {}; this.animationsList = []; var c = this.geometry.morphTargets.length; this.createAnimation("__default", 0, c - 1, c / 1); this.setAnimationWeight("__default", 1) } function Dc(a) { D.call(this); this.material = a; this.render = function (a) {} } function Ec(a, b, c, d) { this.object = a; this.size = void 0 !== b ? b : 1; a = void 0 !== c ? c : 16711680; d = void 0 !== d ? d : 1; b = 0; (c = this.object.geometry) && c.isGeometry ? b = 3 * c.faces.length : c && c.isBufferGeometry && (b = c.attributes.normal.count); c = new I; b = new ma(6 * b, 3); c.addAttribute("position", b); ha.call(this, c, new na({ color: a, linewidth: d })); this.matrixAutoUpdate = !1; this.update() } function Yb(a) { D.call(this); this.light = a; this.light.updateMatrixWorld(); this.matrix = a.matrixWorld; this.matrixAutoUpdate = !1; a = new I; for (var b = [0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, -1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, -1, 1], c = 0, d = 1; 32 > c; c++, d++) { var e = c / 32 * Math.PI * 2, f = d / 32 * Math.PI * 2; b.push(Math.cos(e), Math.sin(e), 1, Math.cos(f), Math.sin(f), 1) } a.addAttribute("position", new ma(b, 3)); b = new na({ fog: !1 }); this.cone = new ha(a, b); this.add(this.cone); this.update() } function Zb(a) { this.bones = this.getBoneList(a); for (var b = new R, c = 0; c < this.bones.length; c++) { var d = this.bones[c]; d.parent && d.parent.isBone && (b.vertices.push(new q), b.vertices.push(new q), b.colors.push(new H(0, 0, 1)), b.colors.push(new H(0, 1, 0))) } b.dynamic = !0; c = new na({ vertexColors: 2, depthTest: !1, depthWrite: !1, transparent: !0 }); ha.call(this, b, c); this.root = a; this.matrix = a.matrixWorld; this.matrixAutoUpdate = !1; this.update() } function $b(a, b) { this.light = a; this.light.updateMatrixWorld(); var c = new ib(b, 4, 2), d = new Ia({ wireframe: !0, fog: !1 }); d.color.copy(this.light.color).multiplyScalar(this.light.intensity); va.call(this, c, d); this.matrix = this.light.matrixWorld; this.matrixAutoUpdate = !1 } function ac(a, b) { D.call(this); this.light = a; this.light.updateMatrixWorld(); this.matrix = a.matrixWorld; this.matrixAutoUpdate = !1; this.colors = [new H, new H]; var c = new Lb(b, 4, 2); c.rotateX(-Math.PI / 2); for (var d = 0; 8 > d; d++) c.faces[d].color = this.colors[4 > d ? 0 : 1]; d = new Ia({ vertexColors: 1, wireframe: !0 }); this.lightSphere = new va(c, d); this.add(this.lightSphere); this.update() } function Fc(a, b, c, d) { b = b || 1; c = new H(void 0 !== c ? c : 4473924); d = new H(void 0 !== d ? d : 8947848); for (var e = b / 2, f = 2 * a / b, g = [], k = [], l = 0, m = 0, h = -a; l <= b; l++, h += f) { g.push(-a, 0, h, a, 0, h); g.push(h, 0, -a, h, 0, a); var p = l === e ? c : d; p.toArray(k, m); m += 3; p.toArray(k, m); m += 3; p.toArray(k, m); m += 3; p.toArray(k, m); m += 3 } a = new I; a.addAttribute("position", new ma(g, 3)); a.addAttribute("color", new ma(k, 3)); g = new na({ vertexColors: 2 }); ha.call(this, a, g) } function Gc(a, b, c, d) { this.object = a; this.size = void 0 !== b ? b : 1; a = void 0 !== c ? c : 16776960; d = void 0 !== d ? d : 1; b = 0; (c = this.object.geometry) && c.isGeometry ? b = c.faces.length : console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead."); c = new I; b = new ma(6 * b, 3); c.addAttribute("position", b); ha.call(this, c, new na({ color: a, linewidth: d })); this.matrixAutoUpdate = !1; this.update() } function bc(a, b) { D.call(this); this.light = a; this.light.updateMatrixWorld(); this.matrix = a.matrixWorld; this.matrixAutoUpdate = !1; void 0 === b && (b = 1); var c = new I; c.addAttribute("position", new ma([-b, b, 0, b, b, 0, b, -b, 0, -b, -b, 0, -b, b, 0], 3)); var d = new na({ fog: !1 }); this.add(new Pa(c, d)); c = new I; c.addAttribute("position", new ma([0, 0, 0, 0, 0, 1], 3)); this.add(new Pa(c, d)); this.update() } function Hc(a) { function b(a, b, d) { c(a, d); c(b, d) } function c(a, b) { d.vertices.push(new q); d.colors.push(new H(b)); void 0 === f[a] && (f[a] = []); f[a].push(d.vertices.length - 1) } var d = new R, e = new na({ color: 16777215, vertexColors: 1 }), f = {}; b("n1", "n2", 16755200); b("n2", "n4", 16755200); b("n4", "n3", 16755200); b("n3", "n1", 16755200); b("f1", "f2", 16755200); b("f2", "f4", 16755200); b("f4", "f3", 16755200); b("f3", "f1", 16755200); b("n1", "f1", 16755200); b("n2", "f2", 16755200); b("n3", "f3", 16755200); b("n4", "f4", 16755200); b("p", "n1", 16711680); b("p", "n2", 16711680); b("p", "n3", 16711680); b("p", "n4", 16711680); b("u1", "u2", 43775); b("u2", "u3", 43775); b("u3", "u1", 43775); b("c", "t", 16777215); b("p", "c", 3355443); b("cn1", "cn2", 3355443); b("cn3", "cn4", 3355443); b("cf1", "cf2", 3355443); b("cf3", "cf4", 3355443); ha.call(this, d, e); this.camera = a; this.camera.updateProjectionMatrix && this.camera.updateProjectionMatrix(); this.matrix = a.matrixWorld; this.matrixAutoUpdate = !1; this.pointMap = f; this.update() } function Ic(a, b) { var c = void 0 !== b ? b : 8947848; this.object = a; this.box = new Ha; va.call(this, new kb(1, 1, 1), new Ia({ color: c, wireframe: !0 })) } function Jc(a, b) { void 0 === b && (b = 16776960); var c = new Uint16Array([0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7]), d = new Float32Array(24), e = new I; e.setIndex(new z(c, 1)); e.addAttribute("position", new z(d, 3)); ha.call(this, e, new na({ color: b })); void 0 !== a && this.update(a) } function yb(a, b, c, d, e, f) { D.call(this); void 0 === d && (d = 16776960); void 0 === c && (c = 1); void 0 === e && (e = .2 * c); void 0 === f && (f = .2 * e); this.position.copy(b); this.line = new Pa(ne, new na({ color: d })); this.line.matrixAutoUpdate = !1; this.add(this.line); this.cone = new va(oe, new Ia({ color: d })); this.cone.matrixAutoUpdate = !1; this.add(this.cone); this.setDirection(a); this.setLength(c, e, f) } function id(a) { a = a || 1; var b = new Float32Array([0, 0, 0, a, 0, 0, 0, 0, 0, 0, a, 0, 0, 0, 0, 0, 0, a]), c = new Float32Array([1, 0, 0, 1, .6, 0, 0, 1, 0, .6, 1, 0, 0, 0, 1, 0, .6, 1]); a = new I; a.addAttribute("position", new z(b, 3)); a.addAttribute("color", new z(c, 3)); b = new na({ vertexColors: 2 }); ha.call(this, a, b) } function pe(a) { console.warn("THREE.ClosedSplineCurve3 has been deprecated. Please use THREE.CatmullRomCurve3."); h.CatmullRomCurve3.call(this, a); this.type = "catmullrom"; this.closed = !0 } function jd(a, b, c, d, e, f) { Ra.call(this, a, b, c, c, d, e, f) } void 0 === Number.EPSILON && (Number.EPSILON = Math.pow(2, -52)); void 0 === Math.sign && (Math.sign = function (a) { return 0 > a ? -1 : 0 < a ? 1 : +a }); void 0 === Function.prototype.name && Object.defineProperty(Function.prototype, "name", { get: function () { return this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1] } }); void 0 === Object.assign && function () { Object.assign = function (a) { if (void 0 === a || null === a) throw new TypeError("Cannot convert undefined or null to object"); for (var b = Object(a), c = 1; c < arguments.length; c++) { var d = arguments[c]; if (void 0 !== d && null !== d) for (var e in d) Object.prototype.hasOwnProperty.call(d, e) && (b[e] = d[e]) } return b } } (); Object.assign(pa.prototype, { addEventListener: function (a, b) { void 0 === this._listeners && (this._listeners = {}); var c = this._listeners; void 0 === c[a] && (c[a] = []); -1 === c[a].indexOf(b) && c[a].push(b) }, hasEventListener: function (a, b) { if (void 0 === this._listeners) return !1; var c = this._listeners; return void 0 !== c[a] && -1 !== c[a].indexOf(b) ? !0 : !1 }, removeEventListener: function (a, b) { if (void 0 !== this._listeners) { var c = this._listeners[a]; if (void 0 !== c) { var d = c.indexOf(b); -1 !== d && c.splice(d, 1) } } }, dispatchEvent: function (a) { if (void 0 !== this._listeners) { var b = this._listeners[a.type]; if (void 0 !== b) { a.target = this; var c = [], d, e = b.length; for (d = 0; d < e; d++) c[d] = b[d]; for (d = 0; d < e; d++) c[d].call(this, a) } } } }); var qe = { NoBlending: 0, NormalBlending: 1, AdditiveBlending: 2, SubtractiveBlending: 3, MultiplyBlending: 4, CustomBlending: 5 }, re = { UVMapping: 300, CubeReflectionMapping: 301, CubeRefractionMapping: 302, EquirectangularReflectionMapping: 303, EquirectangularRefractionMapping: 304, SphericalReflectionMapping: 305, CubeUVReflectionMapping: 306, CubeUVRefractionMapping: 307 }, Md = { RepeatWrapping: 1E3, ClampToEdgeWrapping: 1001, MirroredRepeatWrapping: 1002 }, Nd = { NearestFilter: 1003, NearestMipMapNearestFilter: 1004, NearestMipMapLinearFilter: 1005, LinearFilter: 1006, LinearMipMapNearestFilter: 1007, LinearMipMapLinearFilter: 1008 }; h.Math = { DEG2RAD: Math.PI / 180, RAD2DEG: 180 / Math.PI, generateUUID: function () { var a = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""), b = Array(36), c = 0, d; return function () { for (var e = 0; 36 > e; e++) 8 === e || 13 === e || 18 === e || 23 === e ? b[e] = "-" : 14 === e ? b[e] = "4" : (2 >= c && (c = 33554432 + 16777216 * Math.random() | 0), d = c & 15, c >>= 4, b[e] = a[19 === e ? d & 3 | 8 : d]); return b.join("") } } (), clamp: function (a, b, c) { return Math.max(b, Math.min(c, a)) }, euclideanModulo: function (a, b) { return (a % b + b) % b }, mapLinear: function (a, b, c, d, e) { return d + (a - b) * (e - d) / (c - b) }, smoothstep: function (a, b, c) { if (a <= b) return 0; if (a >= c) return 1; a = (a - b) / (c - b); return a * a * (3 - 2 * a) }, smootherstep: function (a, b, c) { if (a <= b) return 0; if (a >= c) return 1; a = (a - b) / (c - b); return a * a * a * (a * (6 * a - 15) + 10) }, random16: function () { console.warn("THREE.Math.random16() has been deprecated. Use Math.random() instead."); return Math.random() }, randInt: function (a, b) { return a + Math.floor(Math.random() * (b - a + 1)) }, randFloat: function (a, b) { return a + Math.random() * (b - a) }, randFloatSpread: function (a) { return a * (.5 - Math.random()) }, degToRad: function (a) { return a * h.Math.DEG2RAD }, radToDeg: function (a) { return a * h.Math.RAD2DEG }, isPowerOfTwo: function (a) { return 0 === (a & a - 1) && 0 !== a }, nearestPowerOfTwo: function (a) { return Math.pow(2, Math.round(Math.log(a) / Math.LN2)) }, nextPowerOfTwo: function (a) { a--; a |= a >> 1; a |= a >> 2; a |= a >> 4; a |= a >> 8; a |= a >> 16; a++; return a } }; C.prototype = { constructor: C, isVector2: !0, get width() { return this.x }, set width(a) { this.x = a }, get height() { return this.y }, set height(a) { this.y = a }, set: function (a, b) { this.x = a; this.y = b; return this }, setScalar: function (a) { this.y = this.x = a; return this }, setX: function (a) { this.x = a; return this }, setY: function (a) { this.y = a; return this }, setComponent: function (a, b) { switch (a) { case 0: this.x = b; break; case 1: this.y = b; break; default: throw Error("index is out of range: " + a); } }, getComponent: function (a) { switch (a) { case 0: return this.x; case 1: return this.y; default: throw Error("index is out of range: " + a); } }, clone: function () { return new this.constructor(this.x, this.y) }, copy: function (a) { this.x = a.x; this.y = a.y; return this }, add: function (a, b) { if (void 0 !== b) return console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."), this.addVectors(a, b); this.x += a.x; this.y += a.y; return this }, addScalar: function (a) { this.x += a; this.y += a; return this }, addVectors: function (a, b) { this.x = a.x + b.x; this.y = a.y + b.y; return this }, addScaledVector: function (a, b) { this.x += a.x * b; this.y += a.y * b; return this }, sub: function (a, b) { if (void 0 !== b) return console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."), this.subVectors(a, b); this.x -= a.x; this.y -= a.y; return this }, subScalar: function (a) { this.x -= a; this.y -= a; return this }, subVectors: function (a, b) { this.x = a.x - b.x; this.y = a.y - b.y; return this }, multiply: function (a) { this.x *= a.x; this.y *= a.y; return this }, multiplyScalar: function (a) { isFinite(a) ? (this.x *= a, this.y *= a) : this.y = this.x = 0; return this }, divide: function (a) { this.x /= a.x; this.y /= a.y; return this }, divideScalar: function (a) { return this.multiplyScalar(1 / a) }, min: function (a) { this.x = Math.min(this.x, a.x); this.y = Math.min(this.y, a.y); return this }, max: function (a) { this.x = Math.max(this.x, a.x); this.y = Math.max(this.y, a.y); return this }, clamp: function (a, b) { this.x = Math.max(a.x, Math.min(b.x, this.x)); this.y = Math.max(a.y, Math.min(b.y, this.y)); return this }, clampScalar: function () { var a, b; return function (c, d) { void 0 === a && (a = new C, b = new C); a.set(c, c); b.set(d, d); return this.clamp(a, b) } } (), clampLength: function (a, b) { var c = this.length(); return this.multiplyScalar(Math.max(a, Math.min(b, c)) / c) }, floor: function () { this.x = Math.floor(this.x); this.y = Math.floor(this.y); return this }, ceil: function () { this.x = Math.ceil(this.x); this.y = Math.ceil(this.y); return this }, round: function () { this.x = Math.round(this.x); this.y = Math.round(this.y); return this }, roundToZero: function () { this.x = 0 > this.x ? Math.ceil(this.x) : Math.floor(this.x); this.y = 0 > this.y ? Math.ceil(this.y) : Math.floor(this.y); return this }, negate: function () { this.x = -this.x; this.y = -this.y; return this }, dot: function (a) { return this.x * a.x + this.y * a.y }, lengthSq: function () { return this.x * this.x + this.y * this.y }, length: function () { return Math.sqrt(this.x * this.x + this.y * this.y) }, lengthManhattan: function () { return Math.abs(this.x) + Math.abs(this.y) }, normalize: function () { return this.divideScalar(this.length()) }, angle: function () { var a = Math.atan2(this.y, this.x); 0 > a && (a += 2 * Math.PI); return a }, distanceTo: function (a) { return Math.sqrt(this.distanceToSquared(a)) }, distanceToSquared: function (a) { var b = this.x - a.x; a = this.y - a.y; return b * b + a * a }, distanceToManhattan: function (a) { return Math.abs(this.x - a.x) + Math.abs(this.y - a.y) }, setLength: function (a) { return this.multiplyScalar(a / this.length()) }, lerp: function (a, b) { this.x += (a.x - this.x) * b; this.y += (a.y - this.y) * b; return this }, lerpVectors: function (a, b, c) { return this.subVectors(b, a).multiplyScalar(c).add(a) }, equals: function (a) { return a.x === this.x && a.y === this.y }, fromArray: function (a, b) { void 0 === b && (b = 0); this.x = a[b]; this.y = a[b + 1]; return this }, toArray: function (a, b) { void 0 === a && (a = []); void 0 === b && (b = 0); a[b] = this.x; a[b + 1] = this.y; return a }, fromAttribute: function (a, b, c) { void 0 === c && (c = 0); b = b * a.itemSize + c; this.x = a.array[b]; this.y = a.array[b + 1]; return this }, rotateAround: function (a, b) { var c = Math.cos(b), d = Math.sin(b), e = this.x - a.x, f = this.y - a.y; this.x = e * c - f * d + a.x; this.y = e * d + f * c + a.y; return this } }; ba.DEFAULT_IMAGE = void 0; ba.DEFAULT_MAPPING = 300; ba.prototype = { constructor: ba, isTexture: !0, set needsUpdate(a) { !0 === a && this.version++ }, clone: function () { return (new this.constructor).copy(this) }, copy: function (a) { this.image = a.image; this.mipmaps = a.mipmaps.slice(0); this.mapping = a.mapping; this.wrapS = a.wrapS; this.wrapT = a.wrapT; this.magFilter = a.magFilter; this.minFilter = a.minFilter; this.anisotropy = a.anisotropy; this.format = a.format; this.type = a.type; this.offset.copy(a.offset); this.repeat.copy(a.repeat); this.generateMipmaps = a.generateMipmaps; this.premultiplyAlpha = a.premultiplyAlpha; this.flipY = a.flipY; this.unpackAlignment = a.unpackAlignment; this.encoding = a.encoding; return this }, toJSON: function (a) { if (void 0 !== a.textures[this.uuid]) return a.textures[this.uuid]; var b = { metadata: { version: 4.4, type: "Texture", generator: "Texture.toJSON" }, uuid: this.uuid, name: this.name, mapping: this.mapping, repeat: [this.repeat.x, this.repeat.y], offset: [this.offset.x, this.offset.y], wrap: [this.wrapS, this.wrapT], minFilter: this.minFilter, magFilter: this.magFilter, anisotropy: this.anisotropy, flipY: this.flipY }; if (void 0 !== this.image) { var c = this.image; void 0 === c.uuid && (c.uuid = h.Math.generateUUID()); if (void 0 === a.images[c.uuid]) { var d = a.images, e = c.uuid, f = c.uuid, g; void 0 !== c.toDataURL ? g = c : (g = document.createElementNS("http://www.w3.org/1999/xhtml", "canvas"), g.width = c.width, g.height = c.height, g.getContext("2d").drawImage(c, 0, 0, c.width, c.height)); g = 2048 < g.width || 2048 < g.height ? g.toDataURL("image/jpeg", .6) : g.toDataURL("image/png"); d[e] = { uuid: f, url: g } } b.image = c.uuid } return a.textures[this.uuid] = b }, dispose: function () { this.dispatchEvent({ type: "dispose" }) }, transformUv: function (a) { if (300 === this.mapping) { a.multiply(this.repeat); a.add(this.offset); if (0 > a.x || 1 < a.x) switch (this.wrapS) { case 1E3: a.x -= Math.floor(a.x); break; case 1001: a.x = 0 > a.x ? 0 : 1; break; case 1002: a.x = 1 === Math.abs(Math.floor(a.x) % 2) ? Math.ceil(a.x) - a.x : a.x - Math.floor(a.x) } if (0 > a.y || 1 < a.y) switch (this.wrapT) { case 1E3: a.y -= Math.floor(a.y); break; case 1001: a.y = 0 > a.y ? 0 : 1; break; case 1002: a.y = 1 === Math.abs(Math.floor(a.y) % 2) ? Math.ceil(a.y) - a.y : a.y - Math.floor(a.y) } this.flipY && (a.y = 1 - a.y) } } }; Object.assign(ba.prototype, pa.prototype); var Pd = 0; da.prototype = { constructor: da, isVector4: !0, set: function (a, b, c, d) { this.x = a; this.y = b; this.z = c; this.w = d; return this }, setScalar: function (a) { this.w = this.z = this.y = this.x = a; return this }, setX: function (a) { this.x = a; return this }, setY: function (a) { this.y = a; return this }, setZ: function (a) { this.z = a; return this }, setW: function (a) { this.w = a; return this }, setComponent: function (a, b) { switch (a) { case 0: this.x = b; break; case 1: this.y = b; break; case 2: this.z = b; break; case 3: this.w = b; break; default: throw Error("index is out of range: " + a); } }, getComponent: function (a) { switch (a) { case 0: return this.x; case 1: return this.y; case 2: return this.z; case 3: return this.w; default: throw Error("index is out of range: " + a); } }, clone: function () { return new this.constructor(this.x, this.y, this.z, this.w) }, copy: function (a) { this.x = a.x; this.y = a.y; this.z = a.z; this.w = void 0 !== a.w ? a.w : 1; return this }, add: function (a, b) { if (void 0 !== b) return console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."), this.addVectors(a, b); this.x += a.x; this.y += a.y; this.z += a.z; this.w += a.w; return this }, addScalar: function (a) { this.x += a; this.y += a; this.z += a; this.w += a; return this }, addVectors: function (a, b) { this.x = a.x + b.x; this.y = a.y + b.y; this.z = a.z + b.z; this.w = a.w + b.w; return this }, addScaledVector: function (a, b) { this.x += a.x * b; this.y += a.y * b; this.z += a.z * b; this.w += a.w * b; return this }, sub: function (a, b) { if (void 0 !== b) return console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."), this.subVectors(a, b); this.x -= a.x; this.y -= a.y; this.z -= a.z; this.w -= a.w; return this }, subScalar: function (a) { this.x -= a; this.y -= a; this.z -= a; this.w -= a; return this }, subVectors: function (a, b) { this.x = a.x - b.x; this.y = a.y - b.y; this.z = a.z - b.z; this.w = a.w - b.w; return this }, multiplyScalar: function (a) { isFinite(a) ? (this.x *= a, this.y *= a, this.z *= a, this.w *= a) : this.w = this.z = this.y = this.x = 0; return this }, applyMatrix4: function (a) { var b = this.x, c = this.y, d = this.z, e = this.w; a = a.elements; this.x = a[0] * b + a[4] * c + a[8] * d + a[12] * e; this.y = a[1] * b + a[5] * c + a[9] * d + a[13] * e; this.z = a[2] * b + a[6] * c + a[10] * d + a[14] * e; this.w = a[3] * b + a[7] * c + a[11] * d + a[15] * e; return this }, divideScalar: function (a) { return this.multiplyScalar(1 / a) }, setAxisAngleFromQuaternion: function (a) { this.w = 2 * Math.acos(a.w); var b = Math.sqrt(1 - a.w * a.w); 1E-4 > b ? (this.x = 1, this.z = this.y = 0) : (this.x = a.x / b, this.y = a.y / b, this.z = a.z / b); return this }, setAxisAngleFromRotationMatrix: function (a) { var b, c, d; a = a.elements; var e = a[0]; d = a[4]; var f = a[8], g = a[1], k = a[5], l = a[9]; c = a[2]; b = a[6]; var m = a[10]; if (.01 > Math.abs(d - g) && .01 > Math.abs(f - c) && .01 > Math.abs(l - b)) { if (.1 > Math.abs(d + g) && .1 > Math.abs(f + c) && .1 > Math.abs(l + b) && .1 > Math.abs(e + k + m - 3)) return this.set(1, 0, 0, 0), this; a = Math.PI; e = (e + 1) / 2; k = (k + 1) / 2; m = (m + 1) / 2; d = (d + g) / 4; f = (f + c) / 4; l = (l + b) / 4; e > k && e > m ? .01 > e ? (b = 0, d = c = .707106781) : (b = Math.sqrt(e), c = d / b, d = f / b) : k > m ? .01 > k ? (b = .707106781, c = 0, d = .707106781) : (c = Math.sqrt(k), b = d / c, d = l / c) : .01 > m ? (c = b = .707106781, d = 0) : (d = Math.sqrt(m), b = f / d, c = l / d); this.set(b, c, d, a); return this } a = Math.sqrt((b - l) * (b - l) + (f - c) * (f - c) + (g - d) * (g - d)); .001 > Math.abs(a) && (a = 1); this.x = (b - l) / a; this.y = (f - c) / a; this.z = (g - d) / a; this.w = Math.acos((e + k + m - 1) / 2); return this }, min: function (a) { this.x = Math.min(this.x, a.x); this.y = Math.min(this.y, a.y); this.z = Math.min(this.z, a.z); this.w = Math.min(this.w, a.w); return this }, max: function (a) { this.x = Math.max(this.x, a.x); this.y = Math.max(this.y, a.y); this.z = Math.max(this.z, a.z); this.w = Math.max(this.w, a.w); return this }, clamp: function (a, b) { this.x = Math.max(a.x, Math.min(b.x, this.x)); this.y = Math.max(a.y, Math.min(b.y, this.y)); this.z = Math.max(a.z, Math.min(b.z, this.z)); this.w = Math.max(a.w, Math.min(b.w, this.w)); return this }, clampScalar: function () { var a, b; return function (c, d) { void 0 === a && (a = new da, b = new da); a.set(c, c, c, c); b.set(d, d, d, d); return this.clamp(a, b) } } (), floor: function () { this.x = Math.floor(this.x); this.y = Math.floor(this.y); this.z = Math.floor(this.z); this.w = Math.floor(this.w); return this }, ceil: function () { this.x = Math.ceil(this.x); this.y = Math.ceil(this.y); this.z = Math.ceil(this.z); this.w = Math.ceil(this.w); return this }, round: function () { this.x = Math.round(this.x); this.y = Math.round(this.y); this.z = Math.round(this.z); this.w = Math.round(this.w); return this }, roundToZero: function () { this.x = 0 > this.x ? Math.ceil(this.x) : Math.floor(this.x); this.y = 0 > this.y ? Math.ceil(this.y) : Math.floor(this.y); this.z = 0 > this.z ? Math.ceil(this.z) : Math.floor(this.z); this.w = 0 > this.w ? Math.ceil(this.w) : Math.floor(this.w); return this }, negate: function () { this.x = -this.x; this.y = -this.y; this.z = -this.z; this.w = -this.w; return this }, dot: function (a) { return this.x * a.x + this.y * a.y + this.z * a.z + this.w * a.w }, lengthSq: function () { return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w }, length: function () { return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w) }, lengthManhattan: function () { return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w) }, normalize: function () { return this.divideScalar(this.length()) }, setLength: function (a) { return this.multiplyScalar(a / this.length()) }, lerp: function (a, b) { this.x += (a.x - this.x) * b; this.y += (a.y - this.y) * b; this.z += (a.z - this.z) * b; this.w += (a.w - this.w) * b; return this }, lerpVectors: function (a, b, c) { return this.subVectors(b, a).multiplyScalar(c).add(a) }, equals: function (a) { return a.x === this.x && a.y === this.y && a.z === this.z && a.w === this.w }, fromArray: function (a, b) { void 0 === b && (b = 0); this.x = a[b]; this.y = a[b + 1]; this.z = a[b + 2]; this.w = a[b + 3]; return this }, toArray: function (a, b) { void 0 === a && (a = []); void 0 === b && (b = 0); a[b] = this.x; a[b + 1] = this.y; a[b + 2] = this.z; a[b + 3] = this.w; return a }, fromAttribute: function (a, b, c) { void 0 === c && (c = 0); b = b * a.itemSize + c; this.x = a.array[b]; this.y = a.array[b + 1]; this.z = a.array[b + 2]; this.w = a.array[b + 3]; return this } }; Object.assign(zb.prototype, pa.prototype, { isWebGLRenderTarget: !0, setSize: function (a, b) { if (this.width !== a || this.height !== b) this.width = a, this.height = b, this.dispose(); this.viewport.set(0, 0, a, b); this.scissor.set(0, 0, a, b) }, clone: function () { return (new this.constructor).copy(this) }, copy: function (a) { this.width = a.width; this.height = a.height; this.viewport.copy(a.viewport); this.texture = a.texture.clone(); this.depthBuffer = a.depthBuffer; this.stencilBuffer = a.stencilBuffer; this.depthTexture = a.depthTexture; return this }, dispose: function () { this.dispatchEvent({ type: "dispose" }) } }); Ab.prototype = Object.create(zb.prototype); Ab.prototype.constructor = Ab; Ab.prototype.isWebGLRenderTargetCube = !0; ca.prototype = { constructor: ca, get x() { return this._x }, set x(a) { this._x = a; this.onChangeCallback() }, get y() { return this._y }, set y(a) { this._y = a; this.onChangeCallback() }, get z() { return this._z }, set z(a) { this._z = a; this.onChangeCallback() }, get w() { return this._w }, set w(a) { this._w = a; this.onChangeCallback() }, set: function (a, b, c, d) { this._x = a; this._y = b; this._z = c; this._w = d; this.onChangeCallback(); return this }, clone: function () { return new this.constructor(this._x, this._y, this._z, this._w) }, copy: function (a) { this._x = a.x; this._y = a.y; this._z = a.z; this._w = a.w; this.onChangeCallback(); return this }, setFromEuler: function (a, b) { if (!1 === (a && a.isEuler)) throw Error("THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order."); var c = Math.cos(a._x / 2), d = Math.cos(a._y / 2), e = Math.cos(a._z / 2), f = Math.sin(a._x / 2), g = Math.sin(a._y / 2), k = Math.sin(a._z / 2), l = a.order; "XYZ" === l ? (this._x = f * d * e + c * g * k, this._y = c * g * e - f * d * k, this._z = c * d * k + f * g * e, this._w = c * d * e - f * g * k) : "YXZ" === l ? (this._x = f * d * e + c * g * k, this._y = c * g * e - f * d * k, this._z = c * d * k - f * g * e, this._w = c * d * e + f * g * k) : "ZXY" === l ? (this._x = f * d * e - c * g * k, this._y = c * g * e + f * d * k, this._z = c * d * k + f * g * e, this._w = c * d * e - f * g * k) : "ZYX" === l ? (this._x = f * d * e - c * g * k, this._y = c * g * e + f * d * k, this._z = c * d * k - f * g * e, this._w = c * d * e + f * g * k) : "YZX" === l ? (this._x = f * d * e + c * g * k, this._y = c * g * e + f * d * k, this._z = c * d * k - f * g * e, this._w = c * d * e - f * g * k) : "XZY" === l && (this._x = f * d * e - c * g * k, this._y = c * g * e - f * d * k, this._z = c * d * k + f * g * e, this._w = c * d * e + f * g * k); if (!1 !== b) this.onChangeCallback(); return this }, setFromAxisAngle: function (a, b) { var c = b / 2, d = Math.sin(c); this._x = a.x * d; this._y = a.y * d; this._z = a.z * d; this._w = Math.cos(c); this.onChangeCallback(); return this }, setFromRotationMatrix: function (a) { var b = a.elements, c = b[0]; a = b[4]; var d = b[8], e = b[1], f = b[5], g = b[9], k = b[2], l = b[6], b = b[10], m = c + f + b; 0 < m ? (c = .5 / Math.sqrt(m + 1), this._w = .25 / c, this._x = (l - g) * c, this._y = (d - k) * c, this._z = (e - a) * c) : c > f && c > b ? (c = 2 * Math.sqrt(1 + c - f - b), this._w = (l - g) / c, this._x = .25 * c, this._y = (a + e) / c, this._z = (d + k) / c) : f > b ? (c = 2 * Math.sqrt(1 + f - c - b), this._w = (d - k) / c, this._x = (a + e) / c, this._y = .25 * c, this._z = (g + l) / c) : (c = 2 * Math.sqrt(1 + b - c - f), this._w = (e - a) / c, this._x = (d + k) / c, this._y = (g + l) / c, this._z = .25 * c); this.onChangeCallback(); return this }, setFromUnitVectors: function () { var a, b; return function (c, d) { void 0 === a && (a = new q); b = c.dot(d) + 1; 1E-6 > b ? (b = 0, Math.abs(c.x) > Math.abs(c.z) ? a.set(-c.y, c.x, 0) : a.set(0, -c.z, c.y)) : a.crossVectors(c, d); this._x = a.x; this._y = a.y; this._z = a.z; this._w = b; return this.normalize() } } (), inverse: function () { return this.conjugate().normalize() }, conjugate: function () { this._x *= -1; this._y *= -1; this._z *= -1; this.onChangeCallback(); return this }, dot: function (a) { return this._x * a._x + this._y * a._y + this._z * a._z + this._w * a._w }, lengthSq: function () { return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w }, length: function () { return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w) }, normalize: function () { var a = this.length(); 0 === a ? (this._z = this._y = this._x = 0, this._w = 1) : (a = 1 / a, this._x *= a, this._y *= a, this._z *= a, this._w *= a); this.onChangeCallback(); return this }, multiply: function (a, b) { return void 0 !== b ? (console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."), this.multiplyQuaternions(a, b)) : this.multiplyQuaternions(this, a) }, premultiply: function (a) { return this.multiplyQuaternions(a, this) }, multiplyQuaternions: function (a, b) { var c = a._x, d = a._y, e = a._z, f = a._w, g = b._x, k = b._y, l = b._z, m = b._w; this._x = c * m + f * g + d * l - e * k; this._y = d * m + f * k + e * g - c * l; this._z = e * m + f * l + c * k - d * g; this._w = f * m - c * g - d * k - e * l; this.onChangeCallback(); return this }, slerp: function (a, b) { if (0 === b) return this; if (1 === b) return this.copy(a); var c = this._x, d = this._y, e = this._z, f = this._w, g = f * a._w + c * a._x + d * a._y + e * a._z; 0 > g ? (this._w = -a._w, this._x = -a._x, this._y = -a._y, this._z = -a._z, g = -g) : this.copy(a); if (1 <= g) return this._w = f, this._x = c, this._y = d, this._z = e, this; var k = Math.sqrt(1 - g * g); if (.001 > Math.abs(k)) return this._w = .5 * (f + this._w), this._x = .5 * (c + this._x), this._y = .5 * (d + this._y), this._z = .5 * (e + this._z), this; var l = Math.atan2(k, g), g = Math.sin((1 - b) * l) / k, k = Math.sin(b * l) / k; this._w = f * g + this._w * k; this._x = c * g + this._x * k; this._y = d * g + this._y * k; this._z = e * g + this._z * k; this.onChangeCallback(); return this }, equals: function (a) { return a._x === this._x && a._y === this._y && a._z === this._z && a._w === this._w }, fromArray: function (a, b) { void 0 === b && (b = 0); this._x = a[b]; this._y = a[b + 1]; this._z = a[b + 2]; this._w = a[b + 3]; this.onChangeCallback(); return this }, toArray: function (a, b) { void 0 === a && (a = []); void 0 === b && (b = 0); a[b] = this._x; a[b + 1] = this._y; a[b + 2] = this._z; a[b + 3] = this._w; return a }, onChange: function (a) { this.onChangeCallback = a; return this }, onChangeCallback: function () {} }; Object.assign(ca, { slerp: function (a, b, c, d) { return c.copy(a).slerp(b, d) }, slerpFlat: function (a, b, c, d, e, f, g) { var k = c[d + 0], l = c[d + 1], m = c[d + 2]; c = c[d + 3]; d = e[f + 0]; var h = e[f + 1], p = e[f + 2]; e = e[f + 3]; if (c !== e || k !== d || l !== h || m !== p) { f = 1 - g; var n = k * d + l * h + m * p + c * e, r = 0 <= n ? 1 : -1, t = 1 - n * n; t > Number.EPSILON && (t = Math.sqrt(t), n = Math.atan2(t, n * r), f = Math.sin(f * n) / t, g = Math.sin(g * n) / t); r *= g; k = k * f + d * r; l = l * f + h * r; m = m * f + p * r; c = c * f + e * r; f === 1 - g && (g = 1 / Math.sqrt(k * k + l * l + m * m + c * c), k *= g, l *= g, m *= g, c *= g) } a[b] = k; a[b + 1] = l; a[b + 2] = m; a[b + 3] = c } }); q.prototype = { constructor: q, isVector3: !0, set: function (a, b, c) { this.x = a; this.y = b; this.z = c; return this }, setScalar: function (a) { this.z = this.y = this.x = a; return this }, setX: function (a) { this.x = a; return this }, setY: function (a) { this.y = a; return this }, setZ: function (a) { this.z = a; return this }, setComponent: function (a, b) { switch (a) { case 0: this.x = b; break; case 1: this.y = b; break; case 2: this.z = b; break; default: throw Error("index is out of range: " + a); } }, getComponent: function (a) { switch (a) { case 0: return this.x; case 1: return this.y; case 2: return this.z; default: throw Error("index is out of range: " + a); } }, clone: function () { return new this.constructor(this.x, this.y, this.z) }, copy: function (a) { this.x = a.x; this.y = a.y; this.z = a.z; return this }, add: function (a, b) { if (void 0 !== b) return console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."), this.addVectors(a, b); this.x += a.x; this.y += a.y; this.z += a.z; return this }, addScalar: function (a) { this.x += a; this.y += a; this.z += a; return this }, addVectors: function (a, b) { this.x = a.x + b.x; this.y = a.y + b.y; this.z = a.z + b.z; return this }, addScaledVector: function (a, b) { this.x += a.x * b; this.y += a.y * b; this.z += a.z * b; return this }, sub: function (a, b) { if (void 0 !== b) return console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."), this.subVectors(a, b); this.x -= a.x; this.y -= a.y; this.z -= a.z; return this }, subScalar: function (a) { this.x -= a; this.y -= a; this.z -= a; return this }, subVectors: function (a, b) { this.x = a.x - b.x; this.y = a.y - b.y; this.z = a.z - b.z; return this }, multiply: function (a, b) { if (void 0 !== b) return console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."), this.multiplyVectors(a, b); this.x *= a.x; this.y *= a.y; this.z *= a.z; return this }, multiplyScalar: function (a) { isFinite(a) ? (this.x *= a, this.y *= a, this.z *= a) : this.z = this.y = this.x = 0; return this }, multiplyVectors: function (a, b) { this.x = a.x * b.x; this.y = a.y * b.y; this.z = a.z * b.z; return this }, applyEuler: function () { var a; return function (b) { !1 === (b && b.isEuler) && console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."); void 0 === a && (a = new ca); return this.applyQuaternion(a.setFromEuler(b)) } } (), applyAxisAngle: function () { var a; return function (b, c) { void 0 === a && (a = new ca); return this.applyQuaternion(a.setFromAxisAngle(b, c)) } } (), applyMatrix3: function (a) { var b = this.x, c = this.y, d = this.z; a = a.elements; this.x = a[0] * b + a[3] * c + a[6] * d; this.y = a[1] * b + a[4] * c + a[7] * d; this.z = a[2] * b + a[5] * c + a[8] * d; return this }, applyMatrix4: function (a) { var b = this.x, c = this.y, d = this.z; a = a.elements; this.x = a[0] * b + a[4] * c + a[8] * d + a[12]; this.y = a[1] * b + a[5] * c + a[9] * d + a[13]; this.z = a[2] * b + a[6] * c + a[10] * d + a[14]; return this }, applyProjection: function (a) { var b = this.x, c = this.y, d = this.z; a = a.elements; var e = 1 / (a[3] * b + a[7] * c + a[11] * d + a[15]); this.x = (a[0] * b + a[4] * c + a[8] * d + a[12]) * e; this.y = (a[1] * b + a[5] * c + a[9] * d + a[13]) * e; this.z = (a[2] * b + a[6] * c + a[10] * d + a[14]) * e; return this }, applyQuaternion: function (a) { var b = this.x, c = this.y, d = this.z, e = a.x, f = a.y, g = a.z; a = a.w; var k = a * b + f * d - g * c, l = a * c + g * b - e * d, m = a * d + e * c - f * b, b = -e * b - f * c - g * d; this.x = k * a + b * -e + l * -g - m * -f; this.y = l * a + b * -f + m * -e - k * -g; this.z = m * a + b * -g + k * -f - l * -e; return this }, project: function () { var a; return function (b) { void 0 === a && (a = new P); a.multiplyMatrices(b.projectionMatrix, a.getInverse(b.matrixWorld)); return this.applyProjection(a) } } (), unproject: function () { var a; return function (b) { void 0 === a && (a = new P); a.multiplyMatrices(b.matrixWorld, a.getInverse(b.projectionMatrix)); return this.applyProjection(a) } } (), transformDirection: function (a) { var b = this.x, c = this.y, d = this.z; a = a.elements; this.x = a[0] * b + a[4] * c + a[8] * d; this.y = a[1] * b + a[5] * c + a[9] * d; this.z = a[2] * b + a[6] * c + a[10] * d; return this.normalize() }, divide: function (a) { this.x /= a.x; this.y /= a.y; this.z /= a.z; return this }, divideScalar: function (a) { return this.multiplyScalar(1 / a) }, min: function (a) { this.x = Math.min(this.x, a.x); this.y = Math.min(this.y, a.y); this.z = Math.min(this.z, a.z); return this }, max: function (a) { this.x = Math.max(this.x, a.x); this.y = Math.max(this.y, a.y); this.z = Math.max(this.z, a.z); return this }, clamp: function (a, b) { this.x = Math.max(a.x, Math.min(b.x, this.x)); this.y = Math.max(a.y, Math.min(b.y, this.y)); this.z = Math.max(a.z, Math.min(b.z, this.z)); return this }, clampScalar: function () { var a, b; return function (c, d) { void 0 === a && (a = new q, b = new q); a.set(c, c, c); b.set(d, d, d); return this.clamp(a, b) } } (), clampLength: function (a, b) { var c = this.length(); return this.multiplyScalar(Math.max(a, Math.min(b, c)) / c) }, floor: function () { this.x = Math.floor(this.x); this.y = Math.floor(this.y); this.z = Math.floor(this.z); return this }, ceil: function () { this.x = Math.ceil(this.x); this.y = Math.ceil(this.y); this.z = Math.ceil(this.z); return this }, round: function () { this.x = Math.round(this.x); this.y = Math.round(this.y); this.z = Math.round(this.z); return this }, roundToZero: function () { this.x = 0 > this.x ? Math.ceil(this.x) : Math.floor(this.x); this.y = 0 > this.y ? Math.ceil(this.y) : Math.floor(this.y); this.z = 0 > this.z ? Math.ceil(this.z) : Math.floor(this.z); return this }, negate: function () { this.x = -this.x; this.y = -this.y; this.z = -this.z; return this }, dot: function (a) { return this.x * a.x + this.y * a.y + this.z * a.z }, lengthSq: function () { return this.x * this.x + this.y * this.y + this.z * this.z }, length: function () { return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z) }, lengthManhattan: function () { return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) }, normalize: function () { return this.divideScalar(this.length()) }, setLength: function (a) { return this.multiplyScalar(a / this.length()) }, lerp: function (a, b) { this.x += (a.x - this.x) * b; this.y += (a.y - this.y) * b; this.z += (a.z - this.z) * b; return this }, lerpVectors: function (a, b, c) { return this.subVectors(b, a).multiplyScalar(c).add(a) }, cross: function (a, b) { if (void 0 !== b) return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."), this.crossVectors(a, b); var c = this.x, d = this.y, e = this.z; this.x = d * a.z - e * a.y; this.y = e * a.x - c * a.z; this.z = c * a.y - d * a.x; return this }, crossVectors: function (a, b) { var c = a.x, d = a.y, e = a.z, f = b.x, g = b.y, k = b.z; this.x = d * k - e * g; this.y = e * f - c * k; this.z = c * g - d * f; return this }, projectOnVector: function (a) { var b = a.dot(this) / a.lengthSq(); return this.copy(a).multiplyScalar(b) }, projectOnPlane: function () { var a; return function (b) { void 0 === a && (a = new q); a.copy(this).projectOnVector(b); return this.sub(a) } } (), reflect: function () { var a; return function (b) { void 0 === a && (a = new q); return this.sub(a.copy(b).multiplyScalar(2 * this.dot(b))) } } (), angleTo: function (a) { a = this.dot(a) / Math.sqrt(this.lengthSq() * a.lengthSq()); return Math.acos(h.Math.clamp(a, -1, 1)) }, distanceTo: function (a) { return Math.sqrt(this.distanceToSquared(a)) }, distanceToSquared: function (a) { var b = this.x - a.x, c = this.y - a.y; a = this.z - a.z; return b * b + c * c + a * a }, distanceToManhattan: function (a) { return Math.abs(this.x - a.x) + Math.abs(this.y - a.y) + Math.abs(this.z - a.z) }, setFromSpherical: function (a) { var b = Math.sin(a.phi) * a.radius; this.x = b * Math.sin(a.theta); this.y = Math.cos(a.phi) * a.radius; this.z = b * Math.cos(a.theta); return this }, setFromMatrixPosition: function (a) { return this.setFromMatrixColumn(a, 3) }, setFromMatrixScale: function (a) { var b = this.setFromMatrixColumn(a, 0).length(), c = this.setFromMatrixColumn(a, 1).length(); a = this.setFromMatrixColumn(a, 2).length(); this.x = b; this.y = c; this.z = a; return this }, setFromMatrixColumn: function (a, b) { if ("number" === typeof a) { console.warn("THREE.Vector3: setFromMatrixColumn now expects ( matrix, index )."); var c = a; a = b; b = c } return this.fromArray(a.elements, 4 * b) }, equals: function (a) { return a.x === this.x && a.y === this.y && a.z === this.z }, fromArray: function (a, b) { void 0 === b && (b = 0); this.x = a[b]; this.y = a[b + 1]; this.z = a[b + 2]; return this }, toArray: function (a, b) { void 0 === a && (a = []); void 0 === b && (b = 0); a[b] = this.x; a[b + 1] = this.y; a[b + 2] = this.z; return a }, fromAttribute: function (a, b, c) { void 0 === c && (c = 0); b = b * a.itemSize + c; this.x = a.array[b]; this.y = a.array[b + 1]; this.z = a.array[b + 2]; return this } }; P.prototype = { constructor: P, isMatrix4: !0, set: function (a, b, c, d, e, f, g, k, l, m, h, p, n, r, t, v) { var q = this.elements; q[0] = a; q[4] = b; q[8] = c; q[12] = d; q[1] = e; q[5] = f; q[9] = g; q[13] = k; q[2] = l; q[6] = m; q[10] = h; q[14] = p; q[3] = n; q[7] = r; q[11] = t; q[15] = v; return this }, identity: function () { this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); return this }, clone: function () { return (new P).fromArray(this.elements) }, copy: function (a) { this.elements.set(a.elements); return this }, copyPosition: function (a) { var b = this.elements; a = a.elements; b[12] = a[12]; b[13] = a[13]; b[14] = a[14]; return this }, extractBasis: function (a, b, c) { a.setFromMatrixColumn(this, 0); b.setFromMatrixColumn(this, 1); c.setFromMatrixColumn(this, 2); return this }, makeBasis: function (a, b, c) { this.set(a.x, b.x, c.x, 0, a.y, b.y, c.y, 0, a.z, b.z, c.z, 0, 0, 0, 0, 1); return this }, extractRotation: function () { var a; return function (b) { void 0 === a && (a = new q); var c = this.elements, d = b.elements, e = 1 / a.setFromMatrixColumn(b, 0).length(), f = 1 / a.setFromMatrixColumn(b, 1).length(); b = 1 / a.setFromMatrixColumn(b, 2).length(); c[0] = d[0] * e; c[1] = d[1] * e; c[2] = d[2] * e; c[4] = d[4] * f; c[5] = d[5] * f; c[6] = d[6] * f; c[8] = d[8] * b; c[9] = d[9] * b; c[10] = d[10] * b; return this } } (), makeRotationFromEuler: function (a) { !1 === (a && a.isEuler) && console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order."); var b = this.elements, c = a.x, d = a.y, e = a.z, f = Math.cos(c), c = Math.sin(c), g = Math.cos(d), d = Math.sin(d), k = Math.cos(e), e = Math.sin(e); if ("XYZ" === a.order) { a = f * k; var l = f * e, m = c * k, h = c * e; b[0] = g * k; b[4] = -g * e; b[8] = d; b[1] = l + m * d; b[5] = a - h * d; b[9] = -c * g; b[2] = h - a * d; b[6] = m + l * d; b[10] = f * g } else "YXZ" === a.order ? (a = g * k, l = g * e, m = d * k, h = d * e, b[0] = a + h * c, b[4] = m * c - l, b[8] = f * d, b[1] = f * e, b[5] = f * k, b[9] = -c, b[2] = l * c - m, b[6] = h + a * c, b[10] = f * g) : "ZXY" === a.order ? (a = g * k, l = g * e, m = d * k, h = d * e, b[0] = a - h * c, b[4] = -f * e, b[8] = m + l * c, b[1] = l + m * c, b[5] = f * k, b[9] = h - a * c, b[2] = -f * d, b[6] = c, b[10] = f * g) : "ZYX" === a.order ? (a = f * k, l = f * e, m = c * k, h = c * e, b[0] = g * k, b[4] = m * d - l, b[8] = a * d + h, b[1] = g * e, b[5] = h * d + a, b[9] = l * d - m, b[2] = -d, b[6] = c * g, b[10] = f * g) : "YZX" === a.order ? (a = f * g, l = f * d, m = c * g, h = c * d, b[0] = g * k, b[4] = h - a * e, b[8] = m * e + l, b[1] = e, b[5] = f * k, b[9] = -c * k, b[2] = -d * k, b[6] = l * e + m, b[10] = a - h * e) : "XZY" === a.order && (a = f * g, l = f * d, m = c * g, h = c * d, b[0] = g * k, b[4] = -e, b[8] = d * k, b[1] = a * e + h, b[5] = f * k, b[9] = l * e - m, b[2] = m * e - l, b[6] = c * k, b[10] = h * e + a); b[3] = 0; b[7] = 0; b[11] = 0; b[12] = 0; b[13] = 0; b[14] = 0; b[15] = 1; return this }, makeRotationFromQuaternion: function (a) { var b = this.elements, c = a.x, d = a.y, e = a.z, f = a.w, g = c + c, k = d + d, l = e + e; a = c * g; var h = c * k, c = c * l, u = d * k, d = d * l, e = e * l, g = f * g, k = f * k, f = f * l; b[0] = 1 - (u + e); b[4] = h - f; b[8] = c + k; b[1] = h + f; b[5] = 1 - (a + e); b[9] = d - g; b[2] = c - k; b[6] = d + g; b[10] = 1 - (a + u); b[3] = 0; b[7] = 0; b[11] = 0; b[12] = 0; b[13] = 0; b[14] = 0; b[15] = 1; return this }, lookAt: function () { var a, b, c; return function (d, e, f) { void 0 === a && (a = new q, b = new q, c = new q); var g = this.elements; c.subVectors(d, e).normalize(); 0 === c.lengthSq() && (c.z = 1); a.crossVectors(f, c).normalize(); 0 === a.lengthSq() && (c.z += 1E-4, a.crossVectors(f, c).normalize()); b.crossVectors(c, a); g[0] = a.x; g[4] = b.x; g[8] = c.x; g[1] = a.y; g[5] = b.y; g[9] = c.y; g[2] = a.z; g[6] = b.z; g[10] = c.z; return this } } (), multiply: function (a, b) { return void 0 !== b ? (console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."), this.multiplyMatrices(a, b)) : this.multiplyMatrices(this, a) }, premultiply: function (a) { return this.multiplyMatrices(a, this) }, multiplyMatrices: function (a, b) { var c = a.elements, d = b.elements, e = this.elements, f = c[0], g = c[4], k = c[8], l = c[12], h = c[1], u = c[5], p = c[9], n = c[13], r = c[2], t = c[6], v = c[10], q = c[14], w = c[3], x = c[7], T = c[11], c = c[15], y = d[0], F = d[4], G = d[8], E = d[12], J = d[1], C = d[5], N = d[9], D = d[13], z = d[2], I = d[6], H = d[10], L = d[14], M = d[3], O = d[7], Q = d[11], d = d[15]; e[0] = f * y + g * J + k * z + l * M; e[4] = f * F + g * C + k * I + l * O; e[8] = f * G + g * N + k * H + l * Q; e[12] = f * E + g * D + k * L + l * d; e[1] = h * y + u * J + p * z + n * M; e[5] = h * F + u * C + p * I + n * O; e[9] = h * G + u * N + p * H + n * Q; e[13] = h * E + u * D + p * L + n * d; e[2] = r * y + t * J + v * z + q * M; e[6] = r * F + t * C + v * I + q * O; e[10] = r * G + t * N + v * H + q * Q; e[14] = r * E + t * D + v * L + q * d; e[3] = w * y + x * J + T * z + c * M; e[7] = w * F + x * C + T * I + c * O; e[11] = w * G + x * N + T * H + c * Q; e[15] = w * E + x * D + T * L + c * d; return this }, multiplyToArray: function (a, b, c) { var d = this.elements; this.multiplyMatrices(a, b); c[0] = d[0]; c[1] = d[1]; c[2] = d[2]; c[3] = d[3]; c[4] = d[4]; c[5] = d[5]; c[6] = d[6]; c[7] = d[7]; c[8] = d[8]; c[9] = d[9]; c[10] = d[10]; c[11] = d[11]; c[12] = d[12]; c[13] = d[13]; c[14] = d[14]; c[15] = d[15]; return this }, multiplyScalar: function (a) { var b = this.elements; b[0] *= a; b[4] *= a; b[8] *= a; b[12] *= a; b[1] *= a; b[5] *= a; b[9] *= a; b[13] *= a; b[2] *= a; b[6] *= a; b[10] *= a; b[14] *= a; b[3] *= a; b[7] *= a; b[11] *= a; b[15] *= a; return this }, applyToVector3Array: function () { var a; return function (b, c, d) { void 0 === a && (a = new q); void 0 === c && (c = 0); void 0 === d && (d = b.length); for (var e = 0; e < d; e += 3, c += 3) a.fromArray(b, c), a.applyMatrix4(this), a.toArray(b, c); return b } } (), applyToBuffer: function () { var a; return function (b, c, d) { void 0 === a && (a = new q); void 0 === c && (c = 0); void 0 === d && (d = b.length / b.itemSize); for (var e = 0; e < d; e++, c++) a.x = b.getX(c), a.y = b.getY(c), a.z = b.getZ(c), a.applyMatrix4(this), b.setXYZ(a.x, a.y, a.z); return b } } (), determinant: function () { var a = this.elements, b = a[0], c = a[4], d = a[8], e = a[12], f = a[1], g = a[5], k = a[9], l = a[13], h = a[2], u = a[6], p = a[10], n = a[14]; return a[3] * (+e * k * u - d * l * u - e * g * p + c * l * p + d * g * n - c * k * n) + a[7] * (+b * k * n - b * l * p + e * f * p - d * f * n + d * l * h - e * k * h) + a[11] * (+b * l * u - b * g * n - e * f * u + c * f * n + e * g * h - c * l * h) + a[15] * (-d * g * h - b * k * u + b * g * p + d * f * u - c * f * p + c * k * h) }, transpose: function () { var a = this.elements, b; b = a[1]; a[1] = a[4]; a[4] = b; b = a[2]; a[2] = a[8]; a[8] = b; b = a[6]; a[6] = a[9]; a[9] = b; b = a[3]; a[3] = a[12]; a[12] = b; b = a[7]; a[7] = a[13]; a[13] = b; b = a[11]; a[11] = a[14]; a[14] = b; return this }, flattenToArrayOffset: function (a, b) { console.warn("THREE.Matrix3: .flattenToArrayOffset is deprecated - just use .toArray instead."); return this.toArray(a, b) }, getPosition: function () { var a; return function () { void 0 === a && (a = new q); console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."); return a.setFromMatrixColumn(this, 3) } } (), setPosition: function (a) { var b = this.elements; b[12] = a.x; b[13] = a.y; b[14] = a.z; return this }, getInverse: function (a, b) { var c = this.elements, d = a.elements, e = d[0], f = d[1], g = d[2], k = d[3], l = d[4], h = d[5], u = d[6], p = d[7], n = d[8], r = d[9], t = d[10], v = d[11], q = d[12], w = d[13], x = d[14], d = d[15], T = r * x * p - w * t * p + w * u * v - h * x * v - r * u * d + h * t * d, y = q * t * p - n * x * p - q * u * v + l * x * v + n * u * d - l * t * d, F = n * w * p - q * r * p + q * h * v - l * w * v - n * h * d + l * r * d, G = q * r * u - n * w * u - q * h * t + l * w * t + n * h * x - l * r * x, E = e * T + f * y + g * F + k * G; if (0 === E) { if (!0 === b) throw Error("THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0"); console.warn("THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0"); return this.identity() } E = 1 / E; c[0] = T * E; c[1] = (w * t * k - r * x * k - w * g * v + f * x * v + r * g * d - f * t * d) * E; c[2] = (h * x * k - w * u * k + w * g * p - f * x * p - h * g * d + f * u * d) * E; c[3] = (r * u * k - h * t * k - r * g * p + f * t * p + h * g * v - f * u * v) * E; c[4] = y * E; c[5] = (n * x * k - q * t * k + q * g * v - e * x * v - n * g * d + e * t * d) * E; c[6] = (q * u * k - l * x * k - q * g * p + e * x * p + l * g * d - e * u * d) * E; c[7] = (l * t * k - n * u * k + n * g * p - e * t * p - l * g * v + e * u * v) * E; c[8] = F * E; c[9] = (q * r * k - n * w * k - q * f * v + e * w * v + n * f * d - e * r * d) * E; c[10] = (l * w * k - q * h * k + q * f * p - e * w * p - l * f * d + e * h * d) * E; c[11] = (n * h * k - l * r * k - n * f * p + e * r * p + l * f * v - e * h * v) * E; c[12] = G * E; c[13] = (n * w * g - q * r * g + q * f * t - e * w * t - n * f * x + e * r * x) * E; c[14] = (q * h * g - l * w * g - q * f * u + e * w * u + l * f * x - e * h * x) * E; c[15] = (l * r * g - n * h * g + n * f * u - e * r * u - l * f * t + e * h * t) * E; return this }, scale: function (a) { var b = this.elements, c = a.x, d = a.y; a = a.z; b[0] *= c; b[4] *= d; b[8] *= a; b[1] *= c; b[5] *= d; b[9] *= a; b[2] *= c; b[6] *= d; b[10] *= a; b[3] *= c; b[7] *= d; b[11] *= a; return this }, getMaxScaleOnAxis: function () { var a = this.elements; return Math.sqrt(Math.max(a[0] * a[0] + a[1] * a[1] + a[2] * a[2], a[4] * a[4] + a[5] * a[5] + a[6] * a[6], a[8] * a[8] + a[9] * a[9] + a[10] * a[10])) }, makeTranslation: function (a, b, c) { this.set(1, 0, 0, a, 0, 1, 0, b, 0, 0, 1, c, 0, 0, 0, 1); return this }, makeRotationX: function (a) { var b = Math.cos(a); a = Math.sin(a); this.set(1, 0, 0, 0, 0, b, -a, 0, 0, a, b, 0, 0, 0, 0, 1); return this }, makeRotationY: function (a) { var b = Math.cos(a); a = Math.sin(a); this.set(b, 0, a, 0, 0, 1, 0, 0, -a, 0, b, 0, 0, 0, 0, 1); return this }, makeRotationZ: function (a) { var b = Math.cos(a); a = Math.sin(a); this.set(b, -a, 0, 0, a, b, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); return this }, makeRotationAxis: function (a, b) { var c = Math.cos(b), d = Math.sin(b), e = 1 - c, f = a.x, g = a.y, k = a.z, l = e * f, h = e * g; this.set(l * f + c, l * g - d * k, l * k + d * g, 0, l * g + d * k, h * g + c, h * k - d * f, 0, l * k - d * g, h * k + d * f, e * k * k + c, 0, 0, 0, 0, 1); return this }, makeScale: function (a, b, c) { this.set(a, 0, 0, 0, 0, b, 0, 0, 0, 0, c, 0, 0, 0, 0, 1); return this }, compose: function (a, b, c) { this.makeRotationFromQuaternion(b); this.scale(c); this.setPosition(a); return this }, decompose: function () { var a, b; return function (c, d, e) { void 0 === a && (a = new q, b = new P); var f = this.elements, g = a.set(f[0], f[1], f[2]).length(), k = a.set(f[4], f[5], f[6]).length(), l = a.set(f[8], f[9], f[10]).length(); 0 > this.determinant() && (g = -g); c.x = f[12]; c.y = f[13]; c.z = f[14]; b.elements.set(this.elements); c = 1 / g; var f = 1 / k, h = 1 / l; b.elements[0] *= c; b.elements[1] *= c; b.elements[2] *= c; b.elements[4] *= f; b.elements[5] *= f; b.elements[6] *= f; b.elements[8] *= h; b.elements[9] *= h; b.elements[10] *= h; d.setFromRotationMatrix(b); e.x = g; e.y = k; e.z = l; return this } } (), makeFrustum: function (a, b, c, d, e, f) { var g = this.elements; g[0] = 2 * e / (b - a); g[4] = 0; g[8] = (b + a) / (b - a); g[12] = 0; g[1] = 0; g[5] = 2 * e / (d - c); g[9] = (d + c) / (d - c); g[13] = 0; g[2] = 0; g[6] = 0; g[10] = - (f + e) / (f - e); g[14] = -2 * f * e / (f - e); g[3] = 0; g[7] = 0; g[11] = -1; g[15] = 0; return this }, makePerspective: function (a, b, c, d) { a = c * Math.tan(h.Math.DEG2RAD * a * .5); var e = -a; return this.makeFrustum(e * b, a * b, e, a, c, d) }, makeOrthographic: function (a, b, c, d, e, f) { var g = this.elements, k = 1 / (b - a), l = 1 / (c - d), h = 1 / (f - e); g[0] = 2 * k; g[4] = 0; g[8] = 0; g[12] = - ((b + a) * k); g[1] = 0; g[5] = 2 * l; g[9] = 0; g[13] = - ((c + d) * l); g[2] = 0; g[6] = 0; g[10] = -2 * h; g[14] = - ((f + e) * h); g[3] = 0; g[7] = 0; g[11] = 0; g[15] = 1; return this }, equals: function (a) { var b = this.elements; a = a.elements; for (var c = 0; 16 > c; c++) if (b[c] !== a[c]) return !1; return !0 }, fromArray: function (a, b) { void 0 === b && (b = 0); for (var c = 0; 16 > c; c++) this.elements[c] = a[c + b]; return this }, toArray: function (a, b) { void 0 === a && (a = []); void 0 === b && (b = 0); var c = this.elements; a[b] = c[0]; a[b + 1] = c[1]; a[b + 2] = c[2]; a[b + 3] = c[3]; a[b + 4] = c[4]; a[b + 5] = c[5]; a[b + 6] = c[6]; a[b + 7] = c[7]; a[b + 8] = c[8]; a[b + 9] = c[9]; a[b + 10] = c[10]; a[b + 11] = c[11]; a[b + 12] = c[12]; a[b + 13] = c[13]; a[b + 14] = c[14]; a[b + 15] = c[15]; return a } }; Ta.prototype = Object.create(ba.prototype); Ta.prototype.constructor = Ta; Ta.prototype.isCubeTexture = !0; Object.defineProperty(Ta.prototype, "images", { get: function () { return this.image }, set: function (a) { this.image = a } }); var Td = new ba, Ud = new Ta, Qd = [], Sd = []; Yd.prototype.setValue = function (a, b) { for (var c = this.seq, d = 0, e = c.length; d !== e; ++d) { var f = c[d]; f.setValue(a, b[f.id]) } }; var kd = /([\w\d_]+)(\])?(\[|\.)?/g; Ga.prototype.setValue = function (a, b, c) { b = this.map[b]; void 0 !== b && b.setValue(a, c, this.renderer) }; Ga.prototype.set = function (a, b, c) { var d = this.map[c]; void 0 !== d && d.setValue(a, b[c], this.renderer) }; Ga.prototype.setOptional = function (a, b, c) { b = b[c]; void 0 !== b && this.setValue(a, c, b) }; Ga.upload = function (a, b, c, d) { for (var e = 0, f = b.length; e !== f; ++e) { var g = b[e], k = c[g.id]; !1 !== k.needsUpdate && g.setValue(a, k.value, d) } }; Ga.seqWithValue = function (a, b) { for (var c = [], d = 0, e = a.length; d !== e; ++d) { var f = a[d]; f.id in b && c.push(f) } return c }; Ga.splitDynamic = function (a, b) { for (var c = null, d = a.length, e = 0, f = 0; f !== d; ++f) { var g = a[f], k = b[g.id]; k && !0 === k.dynamic ? (null === c && (c = []), c.push(g)) : (e < f && (a[e] = g), ++e) } e < d && (a.length = e); return c }; Ga.evalDynamic = function (a, b, c, d, e) { for (var f = 0, g = a.length; f !== g; ++f) { var k = b[a[f].id], l = k.onUpdateCallback; void 0 !== l && l.call(k, c, d, e) } }; h.UniformsUtils = { merge: function (a) { for (var b = {}, c = 0; c < a.length; c++) { var d = this.clone(a[c]), e; for (e in d) b[e] = d[e] } return b }, clone: function (a) { var b = {}, c; for (c in a) { b[c] = {}; for (var d in a[c]) { var e = a[c][d]; e && e.isColor || e && e.isVector2 || e && e.isVector3 || e && e.isVector4 || e && e.isMatrix3 || e && e.isMatrix4 || e && e.isTexture ? b[c][d] = e.clone() : Array.isArray(e) ? b[c][d] = e.slice() : b[c][d] = e } } return b } }; var Z = { alphamap_fragment: "#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n", alphamap_pars_fragment: "#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n", alphatest_fragment: "#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n", aomap_fragment: "#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( PHYSICAL )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n\t#endif\n#endif\n", aomap_pars_fragment: "#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif", begin_vertex: "\nvec3 transformed = vec3( position );\n", beginnormal_vertex: "\nvec3 objectNormal = vec3( normal );\n", bsdfs: "bool testLightInRange( const in float lightDistance, const in float cutoffDistance ) {\n\treturn any( bvec2( cutoffDistance == 0.0, lightDistance < cutoffDistance ) );\n}\nfloat punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\t\tif( decayExponent > 0.0 ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\t\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\t\tfloat maxDistanceCutoffFactor = pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t\treturn distanceFalloff * maxDistanceCutoffFactor;\n#else\n\t\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n#endif\n\t\t}\n\t\treturn 1.0;\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNL = saturate( dot( geometry.normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec3 BRDF_Specular_GGX_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 AB = vec2( -1.04, 1.04 ) * a004 + r.zw;\n\treturn specularColor * AB.x + AB.y;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n", bumpmap_pars_fragment: "#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = dFdx( surf_pos );\n\t\tvec3 vSigmaY = dFdy( surf_pos );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif\n", clipping_planes_fragment: "#if NUM_CLIPPING_PLANES > 0\n\tfor ( int i = 0; i < NUM_CLIPPING_PLANES; ++ i ) {\n\t\tvec4 plane = clippingPlanes[ i ];\n\t\tif ( dot( vViewPosition, plane.xyz ) > plane.w ) discard;\n\t}\n#endif\n", clipping_planes_pars_fragment: "#if NUM_CLIPPING_PLANES > 0\n\t#if ! defined( PHYSICAL ) && ! defined( PHONG )\n\t\tvarying vec3 vViewPosition;\n\t#endif\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif\n", clipping_planes_pars_vertex: "#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG )\n\tvarying vec3 vViewPosition;\n#endif\n", clipping_planes_vertex: "#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n", color_fragment: "#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif", color_pars_fragment: "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n", color_pars_vertex: "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif", color_vertex: "#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif", common: "#define PI 3.14159265359\n#define PI2 6.28318530718\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#define whiteCompliment(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract(sin(sn) * c);\n}\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\n", cube_uv_reflection_fragment: "#ifdef ENVMAP_TYPE_CUBE_UV\n#define cubeUV_textureSize (1024.0)\nint getFaceFromDirection(vec3 direction) {\n\tvec3 absDirection = abs(direction);\n\tint face = -1;\n\tif( absDirection.x > absDirection.z ) {\n\t\tif(absDirection.x > absDirection.y )\n\t\t\tface = direction.x > 0.0 ? 0 : 3;\n\t\telse\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\n\t}\n\telse {\n\t\tif(absDirection.z > absDirection.y )\n\t\t\tface = direction.z > 0.0 ? 2 : 5;\n\t\telse\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\n\t}\n\treturn face;\n}\n#define cubeUV_maxLods1 (log2(cubeUV_textureSize*0.25) - 1.0)\n#define cubeUV_rangeClamp (exp2((6.0 - 1.0) * 2.0))\nvec2 MipLevelInfo( vec3 vec, float roughnessLevel, float roughness ) {\n\tfloat scale = exp2(cubeUV_maxLods1 - roughnessLevel);\n\tfloat dxRoughness = dFdx(roughness);\n\tfloat dyRoughness = dFdy(roughness);\n\tvec3 dx = dFdx( vec * scale * dxRoughness );\n\tvec3 dy = dFdy( vec * scale * dyRoughness );\n\tfloat d = max( dot( dx, dx ), dot( dy, dy ) );\n\td = clamp(d, 1.0, cubeUV_rangeClamp);\n\tfloat mipLevel = 0.5 * log2(d);\n\treturn vec2(floor(mipLevel), fract(mipLevel));\n}\n#define cubeUV_maxLods2 (log2(cubeUV_textureSize*0.25) - 2.0)\n#define cubeUV_rcpTextureSize (1.0 / cubeUV_textureSize)\nvec2 getCubeUV(vec3 direction, float roughnessLevel, float mipLevel) {\n\tmipLevel = roughnessLevel > cubeUV_maxLods2 - 3.0 ? 0.0 : mipLevel;\n\tfloat a = 16.0 * cubeUV_rcpTextureSize;\n\tvec2 exp2_packed = exp2( vec2( roughnessLevel, mipLevel ) );\n\tvec2 rcp_exp2_packed = vec2( 1.0 ) / exp2_packed;\n\tfloat powScale = exp2_packed.x * exp2_packed.y;\n\tfloat scale = rcp_exp2_packed.x * rcp_exp2_packed.y * 0.25;\n\tfloat mipOffset = 0.75*(1.0 - rcp_exp2_packed.y) * rcp_exp2_packed.x;\n\tbool bRes = mipLevel == 0.0;\n\tscale = bRes && (scale < a) ? a : scale;\n\tvec3 r;\n\tvec2 offset;\n\tint face = getFaceFromDirection(direction);\n\tfloat rcpPowScale = 1.0 / powScale;\n\tif( face == 0) {\n\t\tr = vec3(direction.x, -direction.z, direction.y);\n\t\toffset = vec2(0.0+mipOffset,0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 1) {\n\t\tr = vec3(direction.y, direction.x, direction.z);\n\t\toffset = vec2(scale+mipOffset, 0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 2) {\n\t\tr = vec3(direction.z, direction.x, direction.y);\n\t\toffset = vec2(2.0*scale+mipOffset, 0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 3) {\n\t\tr = vec3(direction.x, direction.z, direction.y);\n\t\toffset = vec2(0.0+mipOffset,0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\telse if( face == 4) {\n\t\tr = vec3(direction.y, direction.x, -direction.z);\n\t\toffset = vec2(scale+mipOffset, 0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\telse {\n\t\tr = vec3(direction.z, -direction.x, direction.y);\n\t\toffset = vec2(2.0*scale+mipOffset, 0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\tr = normalize(r);\n\tfloat texelOffset = 0.5 * cubeUV_rcpTextureSize;\n\tvec2 s = ( r.yz / abs( r.x ) + vec2( 1.0 ) ) * 0.5;\n\tvec2 base = offset + vec2( texelOffset );\n\treturn base + s * ( scale - 2.0 * texelOffset );\n}\n#define cubeUV_maxLods3 (log2(cubeUV_textureSize*0.25) - 3.0)\nvec4 textureCubeUV(vec3 reflectedDirection, float roughness ) {\n\tfloat roughnessVal = roughness* cubeUV_maxLods3;\n\tfloat r1 = floor(roughnessVal);\n\tfloat r2 = r1 + 1.0;\n\tfloat t = fract(roughnessVal);\n\tvec2 mipInfo = MipLevelInfo(reflectedDirection, r1, roughness);\n\tfloat s = mipInfo.y;\n\tfloat level0 = mipInfo.x;\n\tfloat level1 = level0 + 1.0;\n\tlevel1 = level1 > 5.0 ? 5.0 : level1;\n\tlevel0 += min( floor( s + 0.5 ), 5.0 );\n\tvec2 uv_10 = getCubeUV(reflectedDirection, r1, level0);\n\tvec4 color10 = envMapTexelToLinear(texture2D(envMap, uv_10));\n\tvec2 uv_20 = getCubeUV(reflectedDirection, r2, level0);\n\tvec4 color20 = envMapTexelToLinear(texture2D(envMap, uv_20));\n\tvec4 result = mix(color10, color20, t);\n\treturn vec4(result.rgb, 1.0);\n}\n#endif\n", defaultnormal_vertex: "#ifdef FLIP_SIDED\n\tobjectNormal = -objectNormal;\n#endif\nvec3 transformedNormal = normalMatrix * objectNormal;\n", displacementmap_pars_vertex: "#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n", displacementmap_vertex: "#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n", emissivemap_fragment: "#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif\n", emissivemap_pars_fragment: "#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n", encodings_fragment: " gl_FragColor = linearToOutputTexel( gl_FragColor );\n", encodings_pars_fragment: "\nvec4 LinearToLinear( in vec4 value ) {\n return value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n return vec4( pow( value.xyz, vec3( gammaFactor ) ), value.w );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n return vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.w );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.w );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n float maxComponent = max( max( value.r, value.g ), value.b );\n float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n return vec4( value.xyz * value.w * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n float maxRGB = max( value.x, max( value.g, value.b ) );\n float M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n M = ceil( M * 255.0 ) / 255.0;\n return vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n return vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n float maxRGB = max( value.x, max( value.g, value.b ) );\n float D = max( maxRange / maxRGB, 1.0 );\n D = min( floor( D ) / 255.0, 1.0 );\n return vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n vec3 Xp_Y_XYZp = value.rgb * cLogLuvM;\n Xp_Y_XYZp = max(Xp_Y_XYZp, vec3(1e-6, 1e-6, 1e-6));\n vec4 vResult;\n vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n vResult.w = fract(Le);\n vResult.z = (Le - (floor(vResult.w*255.0))/255.0)/255.0;\n return vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n float Le = value.z * 255.0 + value.w;\n vec3 Xp_Y_XYZp;\n Xp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);\n Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n vec3 vRGB = Xp_Y_XYZp.rgb * cLogLuvInverseM;\n return vec4( max(vRGB, 0.0), 1.0 );\n}\n", envmap_fragment: "#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\tvec2 sampleUV;\n\t\tsampleUV.y = saturate( flipNormal * reflectVec.y * 0.5 + 0.5 );\n\t\tsampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\tvec3 reflectView = flipNormal * normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) );\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\tenvColor = envMapTexelToLinear( envColor );\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif\n", envmap_pars_fragment: "#if defined( USE_ENVMAP ) || defined( PHYSICAL )\n\tuniform float reflectivity;\n\tuniform float envMapIntenstiy;\n#endif\n#ifdef USE_ENVMAP\n\t#if ! defined( PHYSICAL ) && ( defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) )\n\t\tvarying vec3 vWorldPosition;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\tuniform float flipEnvMap;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( PHYSICAL )\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif\n", envmap_pars_vertex: "#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif\n", envmap_vertex: "#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif\n", fog_fragment: "#ifdef USE_FOG\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tfloat depth = gl_FragDepthEXT / gl_FragCoord.w;\n\t#else\n\t\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\t#endif\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * depth * depth * LOG2 ) );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, depth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif\n", fog_pars_fragment: "#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif", lightmap_fragment: "#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n", lightmap_pars_fragment: "#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif", lights_lambert_vertex: "vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\n#if NUM_POINT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_DIR_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvLightFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n#endif\n", lights_pars: "uniform vec3 ambientLightColor;\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tif ( testLightInRange( lightDistance, pointLight.distance ) ) {\n\t\t\tdirectLight.color = pointLight.color;\n\t\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( all( bvec2( angleCos > spotLight.coneCos, testLightInRange( lightDistance, spotLight.distance ) ) ) ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif\n#if defined( USE_ENVMAP ) && defined( PHYSICAL )\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\t#include \n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = flipNormal * vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryVec = flipNormal * vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\tvec4 envMapColor = textureCubeUV( queryVec, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar - 0.79248 - 0.5 * log2( pow2( blinnShininessExponent ) + 1.0 );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in GeometricContext geometry, const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -geometry.viewDir, geometry.normal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -geometry.viewDir, geometry.normal, refractionRatio );\n\t\t#endif\n\t\t#include \n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( blinnShininessExponent, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryReflectVec = flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\tvec4 envMapColor = textureCubeUV(queryReflectVec, BlinnExponentToGGXRoughness(blinnShininessExponent));\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\t\tvec2 sampleUV;\n\t\t\tsampleUV.y = saturate( flipNormal * reflectVec.y * 0.5 + 0.5 );\n\t\t\tsampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\t\tvec3 reflectView = flipNormal * normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0,0.0,1.0 ) );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif\n", lights_phong_fragment: "BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n", lights_phong_pars_fragment: "varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)\n", lights_physical_fragment: "PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nmaterial.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );\n#ifdef STANDARD\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.clearCoat = saturate( clearCoat );\tmaterial.clearCoatRoughness = clamp( clearCoatRoughness, 0.04, 1.0 );\n#endif\n", lights_physical_pars_fragment: "struct PhysicalMaterial {\n\tvec3\tdiffuseColor;\n\tfloat\tspecularRoughness;\n\tvec3\tspecularColor;\n\t#ifndef STANDARD\n\t\tfloat clearCoat;\n\t\tfloat clearCoatRoughness;\n\t#endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearCoatDHRApprox( const in float roughness, const in float dotNL ) {\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n}\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\t#ifndef STANDARD\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\n\t#else\n\t\tfloat clearCoatDHR = 0.0;\n\t#endif\n\treflectedLight.directSpecular += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry, material.specularColor, material.specularRoughness );\n\treflectedLight.directDiffuse += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\t#ifndef STANDARD\n\t\treflectedLight.directSpecular += irradiance * material.clearCoat * BRDF_Specular_GGX( directLight, geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\n\t#endif\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 clearCoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t#ifndef STANDARD\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\tfloat dotNL = dotNV;\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\n\t#else\n\t\tfloat clearCoatDHR = 0.0;\n\t#endif\n\treflectedLight.indirectSpecular += ( 1.0 - clearCoatDHR ) * radiance * BRDF_Specular_GGX_Environment( geometry, material.specularColor, material.specularRoughness );\n\t#ifndef STANDARD\n\t\treflectedLight.indirectSpecular += clearCoatRadiance * material.clearCoat * BRDF_Specular_GGX_Environment( geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\n\t#endif\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\n#define Material_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.specularRoughness )\n#define Material_ClearCoat_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.clearCoatRoughness )\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}\n", lights_template: "\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = normalize( vViewPosition );\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( pointLight.shadow, directLight.visible ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( spotLight.shadow, directLight.visible ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( directionalLight.shadow, directLight.visible ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\t#ifdef USE_LIGHTMAP\n\t\tvec3 lightMapIrradiance = texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( PHYSICAL ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t \tirradiance += getLightProbeIndirectIrradiance( geometry, 8 );\n\t#endif\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tvec3 radiance = getLightProbeIndirectRadiance( geometry, Material_BlinnShininessExponent( material ), 8 );\n\t#ifndef STANDARD\n\t\tvec3 clearCoatRadiance = getLightProbeIndirectRadiance( geometry, Material_ClearCoat_BlinnShininessExponent( material ), 8 );\n\t#else\n\t\tvec3 clearCoatRadiance = vec3( 0.0 );\n\t#endif\n\t\t\n\tRE_IndirectSpecular( radiance, clearCoatRadiance, geometry, material, reflectedLight );\n#endif\n", logdepthbuf_fragment: "#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif", logdepthbuf_pars_fragment: "#ifdef USE_LOGDEPTHBUF\n\tuniform float logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n#endif\n", logdepthbuf_pars_vertex: "#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n\tuniform float logDepthBufFC;\n#endif", logdepthbuf_vertex: "#ifdef USE_LOGDEPTHBUF\n\tgl_Position.z = log2(max( EPSILON, gl_Position.w + 1.0 )) * logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t#else\n\t\tgl_Position.z = (gl_Position.z - 1.0) * gl_Position.w;\n\t#endif\n#endif\n", map_fragment: "#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n", map_pars_fragment: "#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n", map_particle_fragment: "#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y ) * offsetRepeat.zw + offsetRepeat.xy );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n", map_particle_pars_fragment: "#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n", metalnessmap_fragment: "float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.r;\n#endif\n", metalnessmap_pars_fragment: "#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif", morphnormal_vertex: "#ifdef USE_MORPHNORMALS\n\tobjectNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\n\tobjectNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\n\tobjectNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\n\tobjectNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\n#endif\n", morphtarget_pars_vertex: "#ifdef USE_MORPHTARGETS\n\t#ifndef USE_MORPHNORMALS\n\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif", morphtarget_vertex: "#ifdef USE_MORPHTARGETS\n\ttransformed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\n\ttransformed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\n\ttransformed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\n\ttransformed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\ttransformed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\n\ttransformed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\n\ttransformed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\n\ttransformed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\n\t#endif\n#endif\n", normal_flip: "#ifdef DOUBLE_SIDED\n\tfloat flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n#else\n\tfloat flipNormal = 1.0;\n#endif\n", normal_fragment: "#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal ) * flipNormal;\n#endif\n#ifdef USE_NORMALMAP\n\tnormal = perturbNormal2Arb( -vViewPosition, normal );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif\n", normalmap_pars_fragment: "#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tvec3 S = normalize( q0 * st1.t - q1 * st0.t );\n\t\tvec3 T = normalize( -q0 * st1.s + q1 * st0.s );\n\t\tvec3 N = normalize( surf_norm );\n\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\tmapN.xy = normalScale * mapN.xy;\n\t\tmat3 tsn = mat3( S, T, N );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif\n", packing: "vec3 packNormalToRGB( const in vec3 normal ) {\n return normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n return 1.0 - 2.0 * rgb.xyz;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n return ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n return linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n return (( near + viewZ ) * far ) / (( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n return ( near * far ) / ( ( far - near ) * invClipZ - far );\n}\n", premultiplied_alpha_fragment: "#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n", project_vertex: "#ifdef USE_SKINNING\n\tvec4 mvPosition = modelViewMatrix * skinned;\n#else\n\tvec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\n#endif\ngl_Position = projectionMatrix * mvPosition;\n", roughnessmap_fragment: "float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.r;\n#endif\n", roughnessmap_pars_fragment: "#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif", shadowmap_pars_fragment: "#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tfloat texture2DShadowLerp( sampler2D depths, vec2 size, vec2 uv, float compare ) {\n\t\tconst vec2 offset = vec2( 0.0, 1.0 );\n\t\tvec2 texelSize = vec2( 1.0 ) / size;\n\t\tvec2 centroidUV = floor( uv * size + 0.5 ) / size;\n\t\tfloat lb = texture2DCompare( depths, centroidUV + texelSize * offset.xx, compare );\n\t\tfloat lt = texture2DCompare( depths, centroidUV + texelSize * offset.xy, compare );\n\t\tfloat rb = texture2DCompare( depths, centroidUV + texelSize * offset.yx, compare );\n\t\tfloat rt = texture2DCompare( depths, centroidUV + texelSize * offset.yy, compare );\n\t\tvec2 f = fract( uv * size + 0.5 );\n\t\tfloat a = mix( lb, lt, f.y );\n\t\tfloat b = mix( rb, rt, f.y );\n\t\tfloat c = mix( a, b, f.x );\n\t\treturn c;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\treturn (\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn 1.0;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\tfloat dp = ( length( lightToPosition ) - shadowBias ) / 1000.0;\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif\n", shadowmap_pars_vertex: "#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n#endif\n", shadowmap_vertex: "#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n#endif\n", shadowmask_pars_fragment: "float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tDirectionalLight directionalLight;\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tshadow *= bool( directionalLight.shadow ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tSpotLight spotLight;\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tshadow *= bool( spotLight.shadow ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tPointLight pointLight;\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tshadow *= bool( pointLight.shadow ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#endif\n\treturn shadow;\n}\n", skinbase_vertex: "#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif", skinning_pars_vertex: "#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform sampler2D boneTexture;\n\t\tuniform int boneTextureWidth;\n\t\tuniform int boneTextureHeight;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureWidth ) );\n\t\t\tfloat y = floor( j / float( boneTextureWidth ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureWidth );\n\t\t\tfloat dy = 1.0 / float( boneTextureHeight );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif\n", skinning_vertex: "#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\tskinned = bindMatrixInverse * skinned;\n#endif\n", skinnormal_vertex: "#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n#endif\n", specularmap_fragment: "float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif", specularmap_pars_fragment: "#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif", tonemapping_fragment: "#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n", tonemapping_pars_fragment: "#define saturate(a) clamp( a, 0.0, 1.0 )\nuniform float toneMappingExposure;\nuniform float toneMappingWhitePoint;\nvec3 LinearToneMapping( vec3 color ) {\n return toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n return saturate( color / ( vec3( 1.0 ) + color ) );\n}\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\nvec3 Uncharted2ToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n return saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n color = max( vec3( 0.0 ), color - 0.004 );\n return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\n", uv_pars_fragment: "#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n#endif", uv_pars_vertex: "#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n\tuniform vec4 offsetRepeat;\n#endif\n", uv_vertex: "#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvUv = uv * offsetRepeat.zw + offsetRepeat.xy;\n#endif", uv2_pars_fragment: "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif", uv2_pars_vertex: "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif", uv2_vertex: "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif", worldpos_vertex: "#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( PHYSICAL ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP )\n\t#ifdef USE_SKINNING\n\t\tvec4 worldPosition = modelMatrix * skinned;\n\t#else\n\t\tvec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\n\t#endif\n#endif\n", cube_frag: "uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldPosition;\n#include \nvoid main() {\n\tgl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );\n\tgl_FragColor.a *= opacity;\n}\n", cube_vert: "varying vec3 vWorldPosition;\n#include \nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}\n", depth_frag: "#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( gl_FragCoord.z ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( gl_FragCoord.z );\n\t#endif\n}\n", depth_vert: "#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}\n", distanceRGBA_frag: "uniform vec3 lightPos;\nvarying vec4 vWorldPosition;\n#include \n#include \n#include \nvoid main () {\n\t#include \n\tgl_FragColor = packDepthToRGBA( length( vWorldPosition.xyz - lightPos.xyz ) / 1000.0 );\n}\n", distanceRGBA_vert: "varying vec4 vWorldPosition;\n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvWorldPosition = worldPosition;\n}\n", equirect_frag: "uniform sampler2D tEquirect;\nuniform float tFlip;\nvarying vec3 vWorldPosition;\n#include \nvoid main() {\n\tvec3 direction = normalize( vWorldPosition );\n\tvec2 sampleUV;\n\tsampleUV.y = saturate( tFlip * direction.y * -0.5 + 0.5 );\n\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n}\n", equirect_vert: "varying vec3 vWorldPosition;\n#include \nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}\n", linedashed_frag: "uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}\n", linedashed_vert: "uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvLineDistance = scale * lineDistance;\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include \n\t#include \n}\n", meshbasic_frag: "uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tReflectedLight reflectedLight;\n\treflectedLight.directDiffuse = vec3( 0.0 );\n\treflectedLight.directSpecular = vec3( 0.0 );\n\treflectedLight.indirectDiffuse = diffuseColor.rgb;\n\treflectedLight.indirectSpecular = vec3( 0.0 );\n\t#include \n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include \n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}\n", meshbasic_vert: "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef USE_ENVMAP\n\t#include \n\t#include \n\t#include \n\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}\n", meshlambert_frag: "uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\n\t#include \n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}\n", meshlambert_vert: "#define LAMBERT\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}\n", meshphong_frag: "#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}\n", meshphong_vert: "#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}\n", meshphysical_frag: "#define PHYSICAL\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifndef STANDARD\n\tuniform float clearCoat;\n\tuniform float clearCoatRoughness;\n#endif\nuniform float envMapIntensity;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}\n", meshphysical_vert: "#define PHYSICAL\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n}\n", normal_frag: "uniform float opacity;\nvarying vec3 vNormal;\n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tgl_FragColor = vec4( packNormalToRGB( vNormal ), opacity );\n\t#include \n}\n", normal_vert: "varying vec3 vNormal;\n#include \n#include \n#include \n#include \nvoid main() {\n\tvNormal = normalize( normalMatrix * normal );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}\n", points_frag: "uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}\n", points_vert: "uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#ifdef USE_SIZEATTENUATION\n\t\tgl_PointSize = size * ( scale / - mvPosition.z );\n\t#else\n\t\tgl_PointSize = size;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n}\n", shadow_frag: "uniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tgl_FragColor = vec4( 0.0, 0.0, 0.0, opacity * ( 1.0 - getShadowMask() ) );\n}\n", shadow_vert: "#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n}\n" }; H.prototype = { constructor: H, isColor: !0, r: 1, g: 1, b: 1, set: function (a) { a && a.isColor ? this.copy(a) : "number" === typeof a ? this.setHex(a) : "string" === typeof a && this.setStyle(a); return this }, setScalar: function (a) { this.b = this.g = this.r = a }, setHex: function (a) { a = Math.floor(a); this.r = (a >> 16 & 255) / 255; this.g = (a >> 8 & 255) / 255; this.b = (a & 255) / 255; return this }, setRGB: function (a, b, c) { this.r = a; this.g = b; this.b = c; return this }, setHSL: function () { function a(a, c, d) { 0 > d && (d += 1); 1 < d && --d; return d < 1 / 6 ? a + 6 * (c - a) * d : .5 > d ? c : d < 2 / 3 ? a + 6 * (c - a) * (2 / 3 - d) : a } return function (b, c, d) { b = h.Math.euclideanModulo(b, 1); c = h.Math.clamp(c, 0, 1); d = h.Math.clamp(d, 0, 1); 0 === c ? this.r = this.g = this.b = d : (c = .5 >= d ? d * (1 + c) : d + c - d * c, d = 2 * d - c, this.r = a(d, c, b + 1 / 3), this.g = a(d, c, b), this.b = a(d, c, b - 1 / 3)); return this } } (), setStyle: function (a) { function b(b) { void 0 !== b && 1 > parseFloat(b) && console.warn("THREE.Color: Alpha component of " + a + " will be ignored.") } var c; if (c = /^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(a)) { var d = c[2]; switch (c[1]) { case "rgb": case "rgba": if (c = /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(d)) return this.r = Math.min(255, parseInt(c[1], 10)) / 255, this.g = Math.min(255, parseInt(c[2], 10)) / 255, this.b = Math.min(255, parseInt(c[3], 10)) / 255, b(c[5]), this; if (c = /^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(d)) return this.r = Math.min(100, parseInt(c[1], 10)) / 100, this.g = Math.min(100, parseInt(c[2], 10)) / 100, this.b = Math.min(100, parseInt(c[3], 10)) / 100, b(c[5]), this; break; case "hsl": case "hsla": if (c = /^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(d)) { var d = parseFloat(c[1]) / 360, e = parseInt(c[2], 10) / 100, f = parseInt(c[3], 10) / 100; b(c[5]); return this.setHSL(d, e, f) } } } else if (c = /^\#([A-Fa-f0-9]+)$/.exec(a)) { c = c[1]; d = c.length; if (3 === d) return this.r = parseInt(c.charAt(0) + c.charAt(0), 16) / 255, this.g = parseInt(c.charAt(1) + c.charAt(1), 16) / 255, this.b = parseInt(c.charAt(2) + c.charAt(2), 16) / 255, this; if (6 === d) return this.r = parseInt(c.charAt(0) + c.charAt(1), 16) / 255, this.g = parseInt(c.charAt(2) + c.charAt(3), 16) / 255, this.b = parseInt(c.charAt(4) + c.charAt(5), 16) / 255, this } a && 0 < a.length && (c = h.ColorKeywords[a], void 0 !== c ? this.setHex(c) : console.warn("THREE.Color: Unknown color " + a)); return this }, clone: function () { return new this.constructor(this.r, this.g, this.b) }, copy: function (a) { this.r = a.r; this.g = a.g; this.b = a.b; return this }, copyGammaToLinear: function (a, b) { void 0 === b && (b = 2); this.r = Math.pow(a.r, b); this.g = Math.pow(a.g, b); this.b = Math.pow(a.b, b); return this }, copyLinearToGamma: function (a, b) { void 0 === b && (b = 2); var c = 0 < b ? 1 / b : 1; this.r = Math.pow(a.r, c); this.g = Math.pow(a.g, c); this.b = Math.pow(a.b, c); return this }, convertGammaToLinear: function () { var a = this.r, b = this.g, c = this.b; this.r = a * a; this.g = b * b; this.b = c * c; return this }, convertLinearToGamma: function () { this.r = Math.sqrt(this.r); this.g = Math.sqrt(this.g); this.b = Math.sqrt(this.b); return this }, getHex: function () { return 255 * this.r << 16 ^ 255 * this.g << 8 ^ 255 * this.b << 0 }, getHexString: function () { return ("000000" + this.getHex().toString(16)).slice(-6) }, getHSL: function (a) { a = a || { h: 0, s: 0, l: 0 }; var b = this.r, c = this.g, d = this.b, e = Math.max(b, c, d), f = Math.min(b, c, d), g, k = (f + e) / 2; if (f === e) f = g = 0; else { var l = e - f, f = .5 >= k ? l / (e + f) : l / (2 - e - f); switch (e) { case b: g = (c - d) / l + (c < d ? 6 : 0); break; case c: g = (d - b) / l + 2; break; case d: g = (b - c) / l + 4 } g /= 6 } a.h = g; a.s = f; a.l = k; return a }, getStyle: function () { return "rgb(" + (255 * this.r | 0) + "," + (255 * this.g | 0) + "," + (255 * this.b | 0) + ")" }, offsetHSL: function (a, b, c) { var d = this.getHSL(); d.h += a; d.s += b; d.l += c; this.setHSL(d.h, d.s, d.l); return this }, add: function (a) { this.r += a.r; this.g += a.g; this.b += a.b; return this }, addColors: function (a, b) { this.r = a.r + b.r; this.g = a.g + b.g; this.b = a.b + b.b; return this }, addScalar: function (a) { this.r += a; this.g += a; this.b += a; return this }, sub: function (a) { this.r = Math.max(0, this.r - a.r); this.g = Math.max(0, this.g - a.g); this.b = Math.max(0, this.b - a.b); return this }, multiply: function (a) { this.r *= a.r; this.g *= a.g; this.b *= a.b; return this }, multiplyScalar: function (a) { this.r *= a; this.g *= a; this.b *= a; return this }, lerp: function (a, b) { this.r += (a.r - this.r) * b; this.g += (a.g - this.g) * b; this.b += (a.b - this.b) * b; return this }, equals: function (a) { return a.r === this.r && a.g === this.g && a.b === this.b }, fromArray: function (a, b) { void 0 === b && (b = 0); this.r = a[b]; this.g = a[b + 1]; this.b = a[b + 2]; return this }, toArray: function (a, b) { void 0 === a && (a = []); void 0 === b && (b = 0); a[b] = this.r; a[b + 1] = this.g; a[b + 2] = this.b; return a }, toJSON: function () { return this.getHex() } }; h.ColorKeywords = { aliceblue: 15792383, antiquewhite: 16444375, aqua: 65535, aquamarine: 8388564, azure: 15794175, beige: 16119260, bisque: 16770244, black: 0, blanchedalmond: 16772045, blue: 255, blueviolet: 9055202, brown: 10824234, burlywood: 14596231, cadetblue: 6266528, chartreuse: 8388352, chocolate: 13789470, coral: 16744272, cornflowerblue: 6591981, cornsilk: 16775388, crimson: 14423100, cyan: 65535, darkblue: 139, darkcyan: 35723, darkgoldenrod: 12092939, darkgray: 11119017, darkgreen: 25600, darkgrey: 11119017, darkkhaki: 12433259, darkmagenta: 9109643, darkolivegreen: 5597999, darkorange: 16747520, darkorchid: 10040012, darkred: 9109504, darksalmon: 15308410, darkseagreen: 9419919, darkslateblue: 4734347, darkslategray: 3100495, darkslategrey: 3100495, darkturquoise: 52945, darkviolet: 9699539, deeppink: 16716947, deepskyblue: 49151, dimgray: 6908265, dimgrey: 6908265, dodgerblue: 2003199, firebrick: 11674146, floralwhite: 16775920, forestgreen: 2263842, fuchsia: 16711935, gainsboro: 14474460, ghostwhite: 16316671, gold: 16766720, goldenrod: 14329120, gray: 8421504, green: 32768, greenyellow: 11403055, grey: 8421504, honeydew: 15794160, hotpink: 16738740, indianred: 13458524, indigo: 4915330, ivory: 16777200, khaki: 15787660, lavender: 15132410, lavenderblush: 16773365, lawngreen: 8190976, lemonchiffon: 16775885, lightblue: 11393254, lightcoral: 15761536, lightcyan: 14745599, lightgoldenrodyellow: 16448210, lightgray: 13882323, lightgreen: 9498256, lightgrey: 13882323, lightpink: 16758465, lightsalmon: 16752762, lightseagreen: 2142890, lightskyblue: 8900346, lightslategray: 7833753, lightslategrey: 7833753, lightsteelblue: 11584734, lightyellow: 16777184, lime: 65280, limegreen: 3329330, linen: 16445670, magenta: 16711935, maroon: 8388608, mediumaquamarine: 6737322, mediumblue: 205, mediumorchid: 12211667, mediumpurple: 9662683, mediumseagreen: 3978097, mediumslateblue: 8087790, mediumspringgreen: 64154, mediumturquoise: 4772300, mediumvioletred: 13047173, midnightblue: 1644912, mintcream: 16121850, mistyrose: 16770273, moccasin: 16770229, navajowhite: 16768685, navy: 128, oldlace: 16643558, olive: 8421376, olivedrab: 7048739, orange: 16753920, orangered: 16729344, orchid: 14315734, palegoldenrod: 15657130, palegreen: 10025880, paleturquoise: 11529966, palevioletred: 14381203, papayawhip: 16773077, peachpuff: 16767673, peru: 13468991, pink: 16761035, plum: 14524637, powderblue: 11591910, purple: 8388736, red: 16711680, rosybrown: 12357519, royalblue: 4286945, saddlebrown: 9127187, salmon: 16416882, sandybrown: 16032864, seagreen: 3050327, seashell: 16774638, sienna: 10506797, silver: 12632256, skyblue: 8900331, slateblue: 6970061, slategray: 7372944, slategrey: 7372944, snow: 16775930, springgreen: 65407, steelblue: 4620980, tan: 13808780, teal: 32896, thistle: 14204888, tomato: 16737095, turquoise: 4251856, violet: 15631086, wheat: 16113331, white: 16777215, whitesmoke: 16119285, yellow: 16776960, yellowgreen: 10145074 }; var U = { common: { diffuse: { value: new H(15658734) }, opacity: { value: 1 }, map: { value: null }, offsetRepeat: { value: new da(0, 0, 1, 1) }, specularMap: { value: null }, alphaMap: { value: null }, envMap: { value: null }, flipEnvMap: { value: -1 }, reflectivity: { value: 1 }, refractionRatio: { value: .98 } }, aomap: { aoMap: { value: null }, aoMapIntensity: { value: 1 } }, lightmap: { lightMap: { value: null }, lightMapIntensity: { value: 1 } }, emissivemap: { emissiveMap: { value: null } }, bumpmap: { bumpMap: { value: null }, bumpScale: { value: 1 } }, normalmap: { normalMap: { value: null }, normalScale: { value: new C(1, 1) } }, displacementmap: { displacementMap: { value: null }, displacementScale: { value: 1 }, displacementBias: { value: 0 } }, roughnessmap: { roughnessMap: { value: null } }, metalnessmap: { metalnessMap: { value: null } }, fog: { fogDensity: { value: 2.5E-4 }, fogNear: { value: 1 }, fogFar: { value: 2E3 }, fogColor: { value: new H(16777215) } }, lights: { ambientLightColor: { value: [] }, directionalLights: { value: [], properties: { direction: {}, color: {}, shadow: {}, shadowBias: {}, shadowRadius: {}, shadowMapSize: {} } }, directionalShadowMap: { value: [] }, directionalShadowMatrix: { value: [] }, spotLights: { value: [], properties: { color: {}, position: {}, direction: {}, distance: {}, coneCos: {}, penumbraCos: {}, decay: {}, shadow: {}, shadowBias: {}, shadowRadius: {}, shadowMapSize: {} } }, spotShadowMap: { value: [] }, spotShadowMatrix: { value: [] }, pointLights: { value: [], properties: { color: {}, position: {}, decay: {}, distance: {}, shadow: {}, shadowBias: {}, shadowRadius: {}, shadowMapSize: {} } }, pointShadowMap: { value: [] }, pointShadowMatrix: { value: [] }, hemisphereLights: { value: [], properties: { direction: {}, skyColor: {}, groundColor: {} } } }, points: { diffuse: { value: new H(15658734) }, opacity: { value: 1 }, size: { value: 1 }, scale: { value: 1 }, map: { value: null }, offsetRepeat: { value: new da(0, 0, 1, 1) } } }, Cb = { basic: { uniforms: h.UniformsUtils.merge([U.common, U.aomap, U.fog]), vertexShader: Z.meshbasic_vert, fragmentShader: Z.meshbasic_frag }, lambert: { uniforms: h.UniformsUtils.merge([U.common, U.aomap, U.lightmap, U.emissivemap, U.fog, U.lights, { emissive: { value: new H(0) } } ]), vertexShader: Z.meshlambert_vert, fragmentShader: Z.meshlambert_frag }, phong: { uniforms: h.UniformsUtils.merge([U.common, U.aomap, U.lightmap, U.emissivemap, U.bumpmap, U.normalmap, U.displacementmap, U.fog, U.lights, { emissive: { value: new H(0) }, specular: { value: new H(1118481) }, shininess: { value: 30 } } ]), vertexShader: Z.meshphong_vert, fragmentShader: Z.meshphong_frag }, standard: { uniforms: h.UniformsUtils.merge([U.common, U.aomap, U.lightmap, U.emissivemap, U.bumpmap, U.normalmap, U.displacementmap, U.roughnessmap, U.metalnessmap, U.fog, U.lights, { emissive: { value: new H(0) }, roughness: { value: .5 }, metalness: { value: 0 }, envMapIntensity: { value: 1 } } ]), vertexShader: Z.meshphysical_vert, fragmentShader: Z.meshphysical_frag }, points: { uniforms: h.UniformsUtils.merge([U.points, U.fog]), vertexShader: Z.points_vert, fragmentShader: Z.points_frag }, dashed: { uniforms: h.UniformsUtils.merge([U.common, U.fog, { scale: { value: 1 }, dashSize: { value: 1 }, totalSize: { value: 2 } } ]), vertexShader: Z.linedashed_vert, fragmentShader: Z.linedashed_frag }, depth: { uniforms: h.UniformsUtils.merge([U.common, U.displacementmap]), vertexShader: Z.depth_vert, fragmentShader: Z.depth_frag }, normal: { uniforms: { opacity: { value: 1 } }, vertexShader: Z.normal_vert, fragmentShader: Z.normal_frag }, cube: { uniforms: { tCube: { value: null }, tFlip: { value: -1 }, opacity: { value: 1 } }, vertexShader: Z.cube_vert, fragmentShader: Z.cube_frag }, equirect: { uniforms: { tEquirect: { value: null }, tFlip: { value: -1 } }, vertexShader: Z.equirect_vert, fragmentShader: Z.equirect_frag }, distanceRGBA: { uniforms: { lightPos: { value: new q } }, vertexShader: Z.distanceRGBA_vert, fragmentShader: Z.distanceRGBA_frag } }; Cb.physical = { uniforms: h.UniformsUtils.merge([Cb.standard.uniforms, { clearCoat: { value: 0 }, clearCoatRoughness: { value: 0 } } ]), vertexShader: Z.meshphysical_vert, fragmentShader: Z.meshphysical_frag }; cc.prototype = { constructor: cc, set: function (a, b) { this.min.copy(a); this.max.copy(b); return this }, setFromPoints: function (a) { this.makeEmpty(); for (var b = 0, c = a.length; b < c; b++) this.expandByPoint(a[b]); return this }, setFromCenterAndSize: function () { var a = new C; return function (b, c) { var d = a.copy(c).multiplyScalar(.5); this.min.copy(b).sub(d); this.max.copy(b).add(d); return this } } (), clone: function () { return (new this.constructor).copy(this) }, copy: function (a) { this.min.copy(a.min); this.max.copy(a.max); return this }, makeEmpty: function () { this.min.x = this.min.y = Infinity; this.max.x = this.max.y = -Infinity; return this }, isEmpty: function () { return this.max.x < this.min.x || this.max.y < this.min.y }, getCenter: function (a) { a = a || new C; return this.isEmpty() ? a.set(0, 0) : a.addVectors(this.min, this.max).multiplyScalar(.5) }, getSize: function (a) { a = a || new C; return this.isEmpty() ? a.set(0, 0) : a.subVectors(this.max, this.min) }, expandByPoint: function (a) { this.min.min(a); this.max.max(a); return this }, expandByVector: function (a) { this.min.sub(a); this.max.add(a); return this }, expandByScalar: function (a) { this.min.addScalar(-a); this.max.addScalar(a); return this }, containsPoint: function (a) { return a.x < this.min.x || a.x > this.max.x || a.y < this.min.y || a.y > this.max.y ? !1 : !0 }, containsBox: function (a) { return this.min.x <= a.min.x && a.max.x <= this.max.x && this.min.y <= a.min.y && a.max.y <= this.max.y ? !0 : !1 }, getParameter: function (a, b) { return (b || new C).set((a.x - this.min.x) / (this.max.x - this.min.x), (a.y - this.min.y) / (this.max.y - this.min.y)) }, intersectsBox: function (a) { return a.max.x < this.min.x || a.min.x > this.max.x || a.max.y < this.min.y || a.min.y > this.max.y ? !1 : !0 }, clampPoint: function (a, b) { return (b || new C).copy(a).clamp(this.min, this.max) }, distanceToPoint: function () { var a = new C; return function (b) { return a.copy(b).clamp(this.min, this.max).sub(b).length() } } (), intersect: function (a) { this.min.max(a.min); this.max.min(a.max); return this }, union: function (a) { this.min.min(a.min); this.max.max(a.max); return this }, translate: function (a) { this.min.add(a); this.max.add(a); return this }, equals: function (a) { return a.min.equals(this.min) && a.max.equals(this.max) } }; S.prototype = { constructor: S, isMaterial: !0, get needsUpdate() { return this._needsUpdate }, set needsUpdate(a) { !0 === a && this.update(); this._needsUpdate = a }, setValues: function (a) { if (void 0 !== a) for (var b in a) { var c = a[b]; if (void 0 === c) console.warn("THREE.Material: '" + b + "' parameter is undefined."); else { var d = this[b]; void 0 === d ? console.warn("THREE." + this.type + ": '" + b + "' is not a property of this material.") : d && d.isColor ? d.set(c) : d && d.isVector3 && c && c.isVector3 ? d.copy(c) : this[b] = "overdraw" === b ? Number(c) : c } } }, toJSON: function (a) { function b(a) { var b = [], c; for (c in a) { var d = a[c]; delete d.metadata; b.push(d) } return b } var c = void 0 === a; c && (a = { textures: {}, images: {} }); var d = { metadata: { version: 4.4, type: "Material", generator: "Material.toJSON" } }; d.uuid = this.uuid; d.type = this.type; "" !== this.name && (d.name = this.name); this.color && this.color.isColor && (d.color = this.color.getHex()); void 0 !== this.roughness && (d.roughness = this.roughness); void 0 !== this.metalness && (d.metalness = this.metalness); this.emissive && this.emissive.isColor && (d.emissive = this.emissive.getHex()); this.specular && this.specular.isColor && (d.specular = this.specular.getHex()); void 0 !== this.shininess && (d.shininess = this.shininess); this.map && this.map.isTexture && (d.map = this.map.toJSON(a).uuid); this.alphaMap && this.alphaMap.isTexture && (d.alphaMap = this.alphaMap.toJSON(a).uuid); this.lightMap && this.lightMap.isTexture && (d.lightMap = this.lightMap.toJSON(a).uuid); this.bumpMap && this.bumpMap.isTexture && (d.bumpMap = this.bumpMap.toJSON(a).uuid, d.bumpScale = this.bumpScale); this.normalMap && this.normalMap.isTexture && (d.normalMap = this.normalMap.toJSON(a).uuid, d.normalScale = this.normalScale.toArray()); this.displacementMap && this.displacementMap.isTexture && (d.displacementMap = this.displacementMap.toJSON(a).uuid, d.displacementScale = this.displacementScale, d.displacementBias = this.displacementBias); this.roughnessMap && this.roughnessMap.isTexture && (d.roughnessMap = this.roughnessMap.toJSON(a).uuid); this.metalnessMap && this.metalnessMap.isTexture && (d.metalnessMap = this.metalnessMap.toJSON(a).uuid); this.emissiveMap && this.emissiveMap.isTexture && (d.emissiveMap = this.emissiveMap.toJSON(a).uuid); this.specularMap && this.specularMap.isTexture && (d.specularMap = this.specularMap.toJSON(a).uuid); this.envMap && this.envMap.isTexture && (d.envMap = this.envMap.toJSON(a).uuid, d.reflectivity = this.reflectivity); void 0 !== this.size && (d.size = this.size); void 0 !== this.sizeAttenuation && (d.sizeAttenuation = this.sizeAttenuation); 1 !== this.blending && (d.blending = this.blending); 2 !== this.shading && (d.shading = this.shading); 0 !== this.side && (d.side = this.side); 0 !== this.vertexColors && (d.vertexColors = this.vertexColors); 1 > this.opacity && (d.opacity = this.opacity); !0 === this.transparent && (d.transparent = this.transparent); d.depthFunc = this.depthFunc; d.depthTest = this.depthTest; d.depthWrite = this.depthWrite; 0 < this.alphaTest && (d.alphaTest = this.alphaTest); !0 === this.premultipliedAlpha && (d.premultipliedAlpha = this.premultipliedAlpha); !0 === this.wireframe && (d.wireframe = this.wireframe); 1 < this.wireframeLinewidth && (d.wireframeLinewidth = this.wireframeLinewidth); "round" !== this.wireframeLinecap && (d.wireframeLinecap = this.wireframeLinecap); "round" !== this.wireframeLinejoin && (d.wireframeLinejoin = this.wireframeLinejoin); d.skinning = this.skinning; d.morphTargets = this.morphTargets; c && (c = b(a.textures), a = b(a.images), 0 < c.length && (d.textures = c), 0 < a.length && (d.images = a)); return d }, clone: function () { return (new this.constructor).copy(this) }, copy: function (a) { this.name = a.name; this.fog = a.fog; this.lights = a.lights; this.blending = a.blending; this.side = a.side; this.shading = a.shading; this.vertexColors = a.vertexColors; this.opacity = a.opacity; this.transparent = a.transparent; this.blendSrc = a.blendSrc; this.blendDst = a.blendDst; this.blendEquation = a.blendEquation; this.blendSrcAlpha = a.blendSrcAlpha; this.blendDstAlpha = a.blendDstAlpha; this.blendEquationAlpha = a.blendEquationAlpha; this.depthFunc = a.depthFunc; this.depthTest = a.depthTest; this.depthWrite = a.depthWrite; this.colorWrite = a.colorWrite; this.precision = a.precision; this.polygonOffset = a.polygonOffset; this.polygonOffsetFactor = a.polygonOffsetFactor; this.polygonOffsetUnits = a.polygonOffsetUnits; this.alphaTest = a.alphaTest; this.premultipliedAlpha = a.premultipliedAlpha; this.overdraw = a.overdraw; this.visible = a.visible; this.clipShadows = a.clipShadows; a = a.clippingPlanes; var b = null; if (null !== a) for (var c = a.length, b = Array(c), d = 0; d !== c; ++d) b[d] = a[d].clone(); this.clippingPlanes = b; return this }, update: function () { this.dispatchEvent({ type: "update" }) }, dispose: function () { this.dispatchEvent({ type: "dispose" }) } }; Object.assign(S.prototype, pa.prototype); var Zd = 0; Da.prototype = Object.create(S.prototype); Da.prototype.constructor = Da; Da.prototype.isShaderMaterial = !0; Da.prototype.copy = function (a) { S.prototype.copy.call(this, a); this.fragmentShader = a.fragmentShader; this.vertexShader = a.vertexShader; this.uniforms = h.UniformsUtils.clone(a.uniforms); this.defines = a.defines; this.wireframe = a.wireframe; this.wireframeLinewidth = a.wireframeLinewidth; this.lights = a.lights; this.clipping = a.clipping; this.skinning = a.skinning; this.morphTargets = a.morphTargets; this.morphNormals = a.morphNormals; this.extensions = a.extensions; return this }; Da.prototype.toJSON = function (a) { a = S.prototype.toJSON.call(this, a); a.uniforms = this.uniforms; a.vertexShader = this.vertexShader; a.fragmentShader = this.fragmentShader; return a }; Ua.prototype = Object.create(S.prototype); Ua.prototype.constructor = Ua; Ua.prototype.isMeshDepthMaterial = !0; Ua.prototype.copy = function (a) { S.prototype.copy.call(this, a); this.depthPacking = a.depthPacking; this.skinning = a.skinning; this.morphTargets = a.morphTargets; this.map = a.map; this.alphaMap = a.alphaMap; this.displacementMap = a.displacementMap; this.displacementScale = a.displacementScale; this.displacementBias = a.displacementBias; this.wireframe = a.wireframe; this.wireframeLinewidth = a.wireframeLinewidth; return this }; Ha.prototype = { constructor: Ha, isBox3: !0, set: function (a, b) { this.min.copy(a); this.max.copy(b); return this }, setFromArray: function (a) { for (var b = Infinity, c = Infinity, d = Infinity, e = -Infinity, f = -Infinity, g = -Infinity, k = 0, l = a.length; k < l; k += 3) { var h = a[k], u = a[k + 1], p = a[k + 2]; h < b && (b = h); u < c && (c = u); p < d && (d = p); h > e && (e = h); u > f && (f = u); p > g && (g = p) } this.min.set(b, c, d); this.max.set(e, f, g) }, setFromPoints: function (a) { this.makeEmpty(); for (var b = 0, c = a.length; b < c; b++) this.expandByPoint(a[b]); return this }, setFromCenterAndSize: function () { var a = new q; return function (b, c) { var d = a.copy(c).multiplyScalar(.5); this.min.copy(b).sub(d); this.max.copy(b).add(d); return this } } (), setFromObject: function () { var a = new q; return function (b) { var c = this; b.updateMatrixWorld(!0); this.makeEmpty(); b.traverse(function (b) { var e = b.geometry; if (void 0 !== e) if (e && e.isGeometry) for (var e = e.vertices, f = 0, g = e.length; f < g; f++) a.copy(e[f]), a.applyMatrix4(b.matrixWorld), c.expandByPoint(a); else if (e && e.isBufferGeometry && (g = e.attributes.position, void 0 !== g)) { var k; g && g.isInterleavedBufferAttribute ? (e = g.data.array, f = g.offset, k = g.data.stride) : (e = g.array, f = 0, k = 3); for (g = e.length; f < g; f += k) a.fromArray(e, f), a.applyMatrix4(b.matrixWorld), c.expandByPoint(a) } }); return this } } (), clone: function () { return (new this.constructor).copy(this) }, copy: function (a) { this.min.copy(a.min); this.max.copy(a.max); return this }, makeEmpty: function () { this.min.x = this.min.y = this.min.z = Infinity; this.max.x = this.max.y = this.max.z = -Infinity; return this }, isEmpty: function () { return this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z }, getCenter: function (a) { a = a || new q; return this.isEmpty() ? a.set(0, 0, 0) : a.addVectors(this.min, this.max).multiplyScalar(.5) }, getSize: function (a) { a = a || new q; return this.isEmpty() ? a.set(0, 0, 0) : a.subVectors(this.max, this.min) }, expandByPoint: function (a) { this.min.min(a); this.max.max(a); return this }, expandByVector: function (a) { this.min.sub(a); this.max.add(a); return this }, expandByScalar: function (a) { this.min.addScalar(-a); this.max.addScalar(a); return this }, containsPoint: function (a) { return a.x < this.min.x || a.x > this.max.x || a.y < this.min.y || a.y > this.max.y || a.z < this.min.z || a.z > this.max.z ? !1 : !0 }, containsBox: function (a) { return this.min.x <= a.min.x && a.max.x <= this.max.x && this.min.y <= a.min.y && a.max.y <= this.max.y && this.min.z <= a.min.z && a.max.z <= this.max.z ? !0 : !1 }, getParameter: function (a, b) { return (b || new q).set((a.x - this.min.x) / (this.max.x - this.min.x), (a.y - this.min.y) / (this.max.y - this.min.y), (a.z - this.min.z) / (this.max.z - this.min.z)) }, intersectsBox: function (a) { return a.max.x < this.min.x || a.min.x > this.max.x || a.max.y < this.min.y || a.min.y > this.max.y || a.max.z < this.min.z || a.min.z > this.max.z ? !1 : !0 }, intersectsSphere: function () { var a; return function (b) { void 0 === a && (a = new q); this.clampPoint(b.center, a); return a.distanceToSquared(b.center) <= b.radius * b.radius } } (), intersectsPlane: function (a) { var b, c; 0 < a.normal.x ? (b = a.normal.x * this.min.x, c = a.normal.x * this.max.x) : (b = a.normal.x * this.max.x, c = a.normal.x * this.min.x); 0 < a.normal.y ? (b += a.normal.y * this.min.y, c += a.normal.y * this.max.y) : (b += a.normal.y * this.max.y, c += a.normal.y * this.min.y); 0 < a.normal.z ? (b += a.normal.z * this.min.z, c += a.normal.z * this.max.z) : (b += a.normal.z * this.max.z, c += a.normal.z * this.min.z); return b <= a.constant && c >= a.constant }, clampPoint: function (a, b) { return (b || new q).copy(a).clamp(this.min, this.max) }, distanceToPoint: function () { var a = new q; return function (b) { return a.copy(b).clamp(this.min, this.max).sub(b).length() } } (), getBoundingSphere: function () { var a = new q; return function (b) { b = b || new Aa; this.getCenter(b.center); b.radius = .5 * this.size(a).length(); return b } } (), intersect: function (a) { this.min.max(a.min); this.max.min(a.max); this.isEmpty() && this.makeEmpty(); return this }, union: function (a) { this.min.min(a.min); this.max.max(a.max); return this }, applyMatrix4: function () { var a = [new q, new q, new q, new q, new q, new q, new q, new q]; return function (b) { if (this.isEmpty()) return this; a[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(b); a[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(b); a[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(b); a[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(b); a[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(b); a[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(b); a[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(b); a[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(b); this.setFromPoints(a); return this } } (), translate: function (a) { this.min.add(a); this.max.add(a); return this }, equals: function (a) { return a.min.equals(this.min) && a.max.equals(this.max) } }; Aa.prototype = { constructor: Aa, set: function (a, b) { this.center.copy(a); this.radius = b; return this }, setFromPoints: function () { var a = new Ha; return function (b, c) { var d = this.center; void 0 !== c ? d.copy(c) : a.setFromPoints(b).getCenter(d); for (var e = 0, f = 0, g = b.length; f < g; f++) e = Math.max(e, d.distanceToSquared(b[f])); this.radius = Math.sqrt(e); return this } } (), clone: function () { return (new this.constructor).copy(this) }, copy: function (a) { this.center.copy(a.center); this.radius = a.radius; return this }, empty: function () { return 0 >= this.radius }, containsPoint: function (a) { return a.distanceToSquared(this.center) <= this.radius * this.radius }, distanceToPoint: function (a) { return a.distanceTo(this.center) - this.radius }, intersectsSphere: function (a) { var b = this.radius + a.radius; return a.center.distanceToSquared(this.center) <= b * b }, intersectsBox: function (a) { return a.intersectsSphere(this) }, intersectsPlane: function (a) { return Math.abs(this.center.dot(a.normal) - a.constant) <= this.radius }, clampPoint: function (a, b) { var c = this.center.distanceToSquared(a), d = b || new q; d.copy(a); c > this.radius * this.radius && (d.sub(this.center).normalize(), d.multiplyScalar(this.radius).add(this.center)); return d }, getBoundingBox: function (a) { a = a || new Ha; a.set(this.center, this.center); a.expandByScalar(this.radius); return a }, applyMatrix4: function (a) { this.center.applyMatrix4(a); this.radius *= a.getMaxScaleOnAxis(); return this }, translate: function (a) { this.center.add(a); return this }, equals: function (a) { return a.center.equals(this.center) && a.radius === this.radius } }; ya.prototype = { constructor: ya, isMatrix3: !0, set: function (a, b, c, d, e, f, g, k, l) { var h = this.elements; h[0] = a; h[1] = d; h[2] = g; h[3] = b; h[4] = e; h[5] = k; h[6] = c; h[7] = f; h[8] = l; return this }, identity: function () { this.set(1, 0, 0, 0, 1, 0, 0, 0, 1); return this }, clone: function () { return (new this.constructor).fromArray(this.elements) }, copy: function (a) { a = a.elements; this.set(a[0], a[3], a[6], a[1], a[4], a[7], a[2], a[5], a[8]); return this }, setFromMatrix4: function (a) { a = a.elements; this.set(a[0], a[4], a[8], a[1], a[5], a[9], a[2], a[6], a[10]); return this }, applyToVector3Array: function () { var a; return function (b, c, d) { void 0 === a && (a = new q); void 0 === c && (c = 0); void 0 === d && (d = b.length); for (var e = 0; e < d; e += 3, c += 3) a.fromArray(b, c), a.applyMatrix3(this), a.toArray(b, c); return b } } (), applyToBuffer: function () { var a; return function (b, c, d) { void 0 === a && (a = new q); void 0 === c && (c = 0); void 0 === d && (d = b.length / b.itemSize); for (var e = 0; e < d; e++, c++) a.x = b.getX(c), a.y = b.getY(c), a.z = b.getZ(c), a.applyMatrix3(this), b.setXYZ(a.x, a.y, a.z); return b } } (), multiplyScalar: function (a) { var b = this.elements; b[0] *= a; b[3] *= a; b[6] *= a; b[1] *= a; b[4] *= a; b[7] *= a; b[2] *= a; b[5] *= a; b[8] *= a; return this }, determinant: function () { var a = this.elements, b = a[0], c = a[1], d = a[2], e = a[3], f = a[4], g = a[5], k = a[6], l = a[7], a = a[8]; return b * f * a - b * g * l - c * e * a + c * g * k + d * e * l - d * f * k }, getInverse: function (a, b) { a && a.isMatrix4 && console.error("THREE.Matrix3.getInverse no longer takes a Matrix4 argument."); var c = a.elements, d = this.elements, e = c[0], f = c[1], g = c[2], k = c[3], l = c[4], h = c[5], u = c[6], p = c[7], c = c[8], n = c * l - h * p, r = h * u - c * k, t = p * k - l * u, q = e * n + f * r + g * t; if (0 === q) { if (!0 === b) throw Error("THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0"); console.warn("THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0"); return this.identity() } q = 1 / q; d[0] = n * q; d[1] = (g * p - c * f) * q; d[2] = (h * f - g * l) * q; d[3] = r * q; d[4] = (c * e - g * u) * q; d[5] = (g * k - h * e) * q; d[6] = t * q; d[7] = (f * u - p * e) * q; d[8] = (l * e - f * k) * q; return this }, transpose: function () { var a, b = this.elements; a = b[1]; b[1] = b[3]; b[3] = a; a = b[2]; b[2] = b[6]; b[6] = a; a = b[5]; b[5] = b[7]; b[7] = a; return this }, flattenToArrayOffset: function (a, b) { console.warn("THREE.Matrix3: .flattenToArrayOffset is deprecated - just use .toArray instead."); return this.toArray(a, b) }, getNormalMatrix: function (a) { return this.setFromMatrix4(a).getInverse(this).transpose() }, transposeIntoArray: function (a) { var b = this.elements; a[0] = b[0]; a[1] = b[3]; a[2] = b[6]; a[3] = b[1]; a[4] = b[4]; a[5] = b[7]; a[6] = b[2]; a[7] = b[5]; a[8] = b[8]; return this }, fromArray: function (a, b) { void 0 === b && (b = 0); for (var c = 0; 9 > c; c++) this.elements[c] = a[c + b]; return this }, toArray: function (a, b) { void 0 === a && (a = []); void 0 === b && (b = 0); var c = this.elements; a[b] = c[0]; a[b + 1] = c[1]; a[b + 2] = c[2]; a[b + 3] = c[3]; a[b + 4] = c[4]; a[b + 5] = c[5]; a[b + 6] = c[6]; a[b + 7] = c[7]; a[b + 8] = c[8]; return a } }; fa.prototype = { constructor: fa, set: function (a, b) { this.normal.copy(a); this.constant = b; return this }, setComponents: function (a, b, c, d) { this.normal.set(a, b, c); this.constant = d; return this }, setFromNormalAndCoplanarPoint: function (a, b) { this.normal.copy(a); this.constant = -b.dot(this.normal); return this }, setFromCoplanarPoints: function () { var a = new q, b = new q; return function (c, d, e) { d = a.subVectors(e, d).cross(b.subVectors(c, d)).normalize(); this.setFromNormalAndCoplanarPoint(d, c); return this } } (), clone: function () { return (new this.constructor).copy(this) }, copy: function (a) { this.normal.copy(a.normal); this.constant = a.constant; return this }, normalize: function () { var a = 1 / this.normal.length(); this.normal.multiplyScalar(a); this.constant *= a; return this }, negate: function () { this.constant *= -1; this.normal.negate(); return this }, distanceToPoint: function (a) { return this.normal.dot(a) + this.constant }, distanceToSphere: function (a) { return this.distanceToPoint(a.center) - a.radius }, projectPoint: function (a, b) { return this.orthoPoint(a, b).sub(a).negate() }, orthoPoint: function (a, b) { var c = this.distanceToPoint(a); return (b || new q).copy(this.normal).multiplyScalar(c) }, intersectLine: function () { var a = new q; return function (b, c) { var d = c || new q, e = b.delta(a), f = this.normal.dot(e); if (0 === f) { if (0 === this.distanceToPoint(b.start)) return d.copy(b.start) } else return f = - (b.start.dot(this.normal) + this.constant) / f, 0 > f || 1 < f ? void 0 : d.copy(e).multiplyScalar(f).add(b.start) } } (), intersectsLine: function (a) { var b = this.distanceToPoint(a.start); a = this.distanceToPoint(a.end); return 0 > b && 0 < a || 0 > a && 0 < b }, intersectsBox: function (a) { return a.intersectsPlane(this) }, intersectsSphere: function (a) { return a.intersectsPlane(this) }, coplanarPoint: function (a) { return (a || new q).copy(this.normal).multiplyScalar(-this.constant) }, applyMatrix4: function () { var a = new q, b = new ya; return function (c, d) { var e = this.coplanarPoint(a).applyMatrix4(c), f = d || b.getNormalMatrix(c), f = this.normal.applyMatrix3(f).normalize(); this.constant = -e.dot(f); return this } } (), translate: function (a) { this.constant -= a.dot(this.normal); return this }, equals: function (a) { return a.normal.equals(this.normal) && a.constant === this.constant } }; dc.prototype = { constructor: dc, set: function (a, b, c, d, e, f) { var g = this.planes; g[0].copy(a); g[1].copy(b); g[2].copy(c); g[3].copy(d); g[4].copy(e); g[5].copy(f); return this }, clone: function () { return (new this.constructor).copy(this) }, copy: function (a) { for (var b = this.planes, c = 0; 6 > c; c++) b[c].copy(a.planes[c]); return this }, setFromMatrix: function (a) { var b = this.planes, c = a.elements; a = c[0]; var d = c[1], e = c[2], f = c[3], g = c[4], k = c[5], l = c[6], h = c[7], u = c[8], p = c[9], n = c[10], r = c[11], t = c[12], q = c[13], A = c[14], c = c[15]; b[0].setComponents(f - a, h - g, r - u, c - t).normalize(); b[1].setComponents(f + a, h + g, r + u, c + t).normalize(); b[2].setComponents(f + d, h + k, r + p, c + q).normalize(); b[3].setComponents(f - d, h - k, r - p, c - q).normalize(); b[4].setComponents(f - e, h - l, r - n, c - A).normalize(); b[5].setComponents(f + e, h + l, r + n, c + A).normalize(); return this }, intersectsObject: function () { var a = new Aa; return function (b) { var c = b.geometry; null === c.boundingSphere && c.computeBoundingSphere(); a.copy(c.boundingSphere).applyMatrix4(b.matrixWorld); return this.intersectsSphere(a) } } (), intersectsSprite: function () { var a = new Aa; return function (b) { a.center.set(0, 0, 0); a.radius = .7071067811865476; a.applyMatrix4(b.matrixWorld); return this.intersectsSphere(a) } } (), intersectsSphere: function (a) { var b = this.planes, c = a.center; a = -a.radius; for (var d = 0; 6 > d; d++) if (b[d].distanceToPoint(c) < a) return !1; return !0 }, intersectsBox: function () { var a = new q, b = new q; return function (c) { for (var d = this.planes, e = 0; 6 > e; e++) { var f = d[e]; a.x = 0 < f.normal.x ? c.min.x : c.max.x; b.x = 0 < f.normal.x ? c.max.x : c.min.x; a.y = 0 < f.normal.y ? c.min.y : c.max.y; b.y = 0 < f.normal.y ? c.max.y : c.min.y; a.z = 0 < f.normal.z ? c.min.z : c.max.z; b.z = 0 < f.normal.z ? c.max.z : c.min.z; var g = f.distanceToPoint(a), f = f.distanceToPoint(b); if (0 > g && 0 > f) return !1 } return !0 } } (), containsPoint: function (a) { for (var b = this.planes, c = 0; 6 > c; c++) if (0 > b[c].distanceToPoint(a)) return !1; return !0 } }; Wa.prototype = { constructor: Wa, set: function (a, b) { this.origin.copy(a); this.direction.copy(b); return this }, clone: function () { return (new this.constructor).copy(this) }, copy: function (a) { this.origin.copy(a.origin); this.direction.copy(a.direction); return this }, at: function (a, b) { return (b || new q).copy(this.direction).multiplyScalar(a).add(this.origin) }, lookAt: function (a) { this.direction.copy(a).sub(this.origin).normalize(); return this }, recast: function () { var a = new q; return function (b) { this.origin.copy(this.at(b, a)); return this } } (), closestPointToPoint: function (a, b) { var c = b || new q; c.subVectors(a, this.origin); var d = c.dot(this.direction); return 0 > d ? c.copy(this.origin) : c.copy(this.direction).multiplyScalar(d).add(this.origin) }, distanceToPoint: function (a) { return Math.sqrt(this.distanceSqToPoint(a)) }, distanceSqToPoint: function () { var a = new q; return function (b) { var c = a.subVectors(b, this.origin).dot(this.direction); if (0 > c) return this.origin.distanceToSquared(b); a.copy(this.direction).multiplyScalar(c).add(this.origin); return a.distanceToSquared(b) } } (), distanceSqToSegment: function () { var a = new q, b = new q, c = new q; return function (d, e, f, g) { a.copy(d).add(e).multiplyScalar(.5); b.copy(e).sub(d).normalize(); c.copy(this.origin).sub(a); var k = .5 * d.distanceTo(e), l = -this.direction.dot(b), h = c.dot(this.direction), u = -c.dot(b), p = c.lengthSq(), n = Math.abs(1 - l * l), r; 0 < n ? (d = l * u - h, e = l * h - u, r = k * n, 0 <= d ? e >= -r ? e <= r ? (k = 1 / n, d *= k, e *= k, l = d * (d + l * e + 2 * h) + e * (l * d + e + 2 * u) + p) : (e = k, d = Math.max(0, - (l * e + h)), l = -d * d + e * (e + 2 * u) + p) : (e = -k, d = Math.max(0, - (l * e + h)), l = -d * d + e * (e + 2 * u) + p) : e <= -r ? (d = Math.max(0, - (-l * k + h)), e = 0 < d ? -k : Math.min(Math.max(-k, -u), k), l = -d * d + e * (e + 2 * u) + p) : e <= r ? (d = 0, e = Math.min(Math.max(-k, -u), k), l = e * (e + 2 * u) + p) : (d = Math.max(0, - (l * k + h)), e = 0 < d ? k : Math.min(Math.max(-k, -u), k), l = -d * d + e * (e + 2 * u) + p)) : (e = 0 < l ? -k : k, d = Math.max(0, - (l * e + h)), l = -d * d + e * (e + 2 * u) + p); f && f.copy(this.direction).multiplyScalar(d).add(this.origin); g && g.copy(b).multiplyScalar(e).add(a); return l } } (), intersectSphere: function () { var a = new q; return function (b, c) { a.subVectors(b.center, this.origin); var d = a.dot(this.direction), e = a.dot(a) - d * d, f = b.radius * b.radius; if (e > f) return null; f = Math.sqrt(f - e); e = d - f; d += f; return 0 > e && 0 > d ? null : 0 > e ? this.at(d, c) : this.at(e, c) } } (), intersectsSphere: function (a) { return this.distanceToPoint(a.center) <= a.radius }, distanceToPlane: function (a) { var b = a.normal.dot(this.direction); if (0 === b) return 0 === a.distanceToPoint(this.origin) ? 0 : null; a = - (this.origin.dot(a.normal) + a.constant) / b; return 0 <= a ? a : null }, intersectPlane: function (a, b) { var c = this.distanceToPlane(a); return null === c ? null : this.at(c, b) }, intersectsPlane: function (a) { var b = a.distanceToPoint(this.origin); return 0 === b || 0 > a.normal.dot(this.direction) * b ? !0 : !1 }, intersectBox: function (a, b) { var c, d, e, f, g; d = 1 / this.direction.x; f = 1 / this.direction.y; g = 1 / this.direction.z; var k = this.origin; 0 <= d ? (c = (a.min.x - k.x) * d, d *= a.max.x - k.x) : (c = (a.max.x - k.x) * d, d *= a.min.x - k.x); 0 <= f ? (e = (a.min.y - k.y) * f, f *= a.max.y - k.y) : (e = (a.max.y - k.y) * f, f *= a.min.y - k.y); if (c > f || e > d) return null; if (e > c || c !== c) c = e; if (f < d || d !== d) d = f; 0 <= g ? (e = (a.min.z - k.z) * g, g *= a.max.z - k.z) : (e = (a.max.z - k.z) * g, g *= a.min.z - k.z); if (c > g || e > d) return null; if (e > c || c !== c) c = e; if (g < d || d !== d) d = g; return 0 > d ? null : this.at(0 <= c ? c : d, b) }, intersectsBox: function () { var a = new q; return function (b) { return null !== this.intersectBox(b, a) } } (), intersectTriangle: function () { var a = new q, b = new q, c = new q, d = new q; return function (e, f, g, k, l) { b.subVectors(f, e); c.subVectors(g, e); d.crossVectors(b, c); f = this.direction.dot(d); if (0 < f) { if (k) return null; k = 1 } else if (0 > f) k = -1, f = -f; else return null; a.subVectors(this.origin, e); e = k * this.direction.dot(c.crossVectors(a, c)); if (0 > e) return null; g = k * this.direction.dot(b.cross(a)); if (0 > g || e + g > f) return null; e = -k * a.dot(d); return 0 > e ? null : this.at(e / f, l) } } (), applyMatrix4: function (a) { this.direction.add(this.origin).applyMatrix4(a); this.origin.applyMatrix4(a); this.direction.sub(this.origin); this.direction.normalize(); return this }, equals: function (a) { return a.origin.equals(this.origin) && a.direction.equals(this.direction) } }; Xa.RotationOrders = "XYZ YZX ZXY XZY YXZ ZYX".split(" "); Xa.DefaultOrder = "XYZ"; Xa.prototype = { constructor: Xa, isEuler: !0, get x() { return this._x }, set x(a) { this._x = a; this.onChangeCallback() }, get y() { return this._y }, set y(a) { this._y = a; this.onChangeCallback() }, get z() { return this._z }, set z(a) { this._z = a; this.onChangeCallback() }, get order() { return this._order }, set order(a) { this._order = a; this.onChangeCallback() }, set: function (a, b, c, d) { this._x = a; this._y = b; this._z = c; this._order = d || this._order; this.onChangeCallback(); return this }, clone: function () { return new this.constructor(this._x, this._y, this._z, this._order) }, copy: function (a) { this._x = a._x; this._y = a._y; this._z = a._z; this._order = a._order; this.onChangeCallback(); return this }, setFromRotationMatrix: function (a, b, c) { var d = h.Math.clamp, e = a.elements; a = e[0]; var f = e[4], g = e[8], k = e[1], l = e[5], m = e[9], u = e[2], p = e[6], e = e[10]; b = b || this._order; "XYZ" === b ? (this._y = Math.asin(d(g, -1, 1)), .99999 > Math.abs(g) ? (this._x = Math.atan2(-m, e), this._z = Math.atan2(-f, a)) : (this._x = Math.atan2(p, l), this._z = 0)) : "YXZ" === b ? (this._x = Math.asin(-d(m, -1, 1)), .99999 > Math.abs(m) ? (this._y = Math.atan2(g, e), this._z = Math.atan2(k, l)) : (this._y = Math.atan2(-u, a), this._z = 0)) : "ZXY" === b ? (this._x = Math.asin(d(p, -1, 1)), .99999 > Math.abs(p) ? (this._y = Math.atan2(-u, e), this._z = Math.atan2(-f, l)) : (this._y = 0, this._z = Math.atan2(k, a))) : "ZYX" === b ? (this._y = Math.asin(-d(u, -1, 1)), .99999 > Math.abs(u) ? (this._x = Math.atan2(p, e), this._z = Math.atan2(k, a)) : (this._x = 0, this._z = Math.atan2(-f, l))) : "YZX" === b ? (this._z = Math.asin(d(k, -1, 1)), .99999 > Math.abs(k) ? (this._x = Math.atan2(-m, l), this._y = Math.atan2(-u, a)) : (this._x = 0, this._y = Math.atan2(g, e))) : "XZY" === b ? (this._z = Math.asin(-d(f, -1, 1)), .99999 > Math.abs(f) ? (this._x = Math.atan2(p, l), this._y = Math.atan2(g, a)) : (this._x = Math.atan2(-m, e), this._y = 0)) : console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: " + b); this._order = b; if (!1 !== c) this.onChangeCallback(); return this }, setFromQuaternion: function () { var a; return function (b, c, d) { void 0 === a && (a = new P); a.makeRotationFromQuaternion(b); return this.setFromRotationMatrix(a, c, d) } } (), setFromVector3: function (a, b) { return this.set(a.x, a.y, a.z, b || this._order) }, reorder: function () { var a = new ca; return function (b) { a.setFromEuler(this); return this.setFromQuaternion(a, b) } } (), equals: function (a) { return a._x === this._x && a._y === this._y && a._z === this._z && a._order === this._order }, fromArray: function (a) { this._x = a[0]; this._y = a[1]; this._z = a[2]; void 0 !== a[3] && (this._order = a[3]); this.onChangeCallback(); return this }, toArray: function (a, b) { void 0 === a && (a = []); void 0 === b && (b = 0); a[b] = this._x; a[b + 1] = this._y; a[b + 2] = this._z; a[b + 3] = this._order; return a }, toVector3: function (a) { return a ? a.set(this._x, this._y, this._z) : new q(this._x, this._y, this._z) }, onChange: function (a) { this.onChangeCallback = a; return this }, onChangeCallback: function () {} }; Kc.prototype = { constructor: Kc, set: function (a) { this.mask = 1 << a }, enable: function (a) { this.mask |= 1 << a }, toggle: function (a) { this.mask ^= 1 << a }, disable: function (a) { this.mask &= ~(1 << a) }, test: function (a) { return 0 !== (this.mask & a.mask) } }; D.DefaultUp = new q(0, 1, 0); D.DefaultMatrixAutoUpdate = !0; Object.assign(D.prototype, pa.prototype, { isObject3D: !0, applyMatrix: function (a) { this.matrix.multiplyMatrices(a, this.matrix); this.matrix.decompose(this.position, this.quaternion, this.scale) }, setRotationFromAxisAngle: function (a, b) { this.quaternion.setFromAxisAngle(a, b) }, setRotationFromEuler: function (a) { this.quaternion.setFromEuler(a, !0) }, setRotationFromMatrix: function (a) { this.quaternion.setFromRotationMatrix(a) }, setRotationFromQuaternion: function (a) { this.quaternion.copy(a) }, rotateOnAxis: function () { var a = new ca; return function (b, c) { a.setFromAxisAngle(b, c); this.quaternion.multiply(a); return this } } (), rotateX: function () { var a = new q(1, 0, 0); return function (b) { return this.rotateOnAxis(a, b) } } (), rotateY: function () { var a = new q(0, 1, 0); return function (b) { return this.rotateOnAxis(a, b) } } (), rotateZ: function () { var a = new q(0, 0, 1); return function (b) { return this.rotateOnAxis(a, b) } } (), translateOnAxis: function () { var a = new q; return function (b, c) { a.copy(b).applyQuaternion(this.quaternion); this.position.add(a.multiplyScalar(c)); return this } } (), translateX: function () { var a = new q(1, 0, 0); return function (b) { return this.translateOnAxis(a, b) } } (), translateY: function () { var a = new q(0, 1, 0); return function (b) { return this.translateOnAxis(a, b) } } (), translateZ: function () { var a = new q(0, 0, 1); return function (b) { return this.translateOnAxis(a, b) } } (), localToWorld: function (a) { return a.applyMatrix4(this.matrixWorld) }, worldToLocal: function () { var a = new P; return function (b) { return b.applyMatrix4(a.getInverse(this.matrixWorld)) } } (), lookAt: function () { var a = new P; return function (b) { a.lookAt(b, this.position, this.up); this.quaternion.setFromRotationMatrix(a) } } (), add: function (a) { if (1 < arguments.length) { for (var b = 0; b < arguments.length; b++) this.add(arguments[b]); return this } if (a === this) return console.error("THREE.Object3D.add: object can't be added as a child of itself.", a), this; a && a.isObject3D ? (null !== a.parent && a.parent.remove(a), a.parent = this, a.dispatchEvent({ type: "added" }), this.children.push(a)) : console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.", a); return this }, remove: function (a) { if (1 < arguments.length) for (var b = 0; b < arguments.length; b++) this.remove(arguments[b]); b = this.children.indexOf(a); -1 !== b && (a.parent = null, a.dispatchEvent({ type: "removed" }), this.children.splice(b, 1)) }, getObjectById: function (a) { return this.getObjectByProperty("id", a) }, getObjectByName: function (a) { return this.getObjectByProperty("name", a) }, getObjectByProperty: function (a, b) { if (this[a] === b) return this; for (var c = 0, d = this.children.length; c < d; c++) { var e = this.children[c].getObjectByProperty(a, b); if (void 0 !== e) return e } }, getWorldPosition: function (a) { a = a || new q; this.updateMatrixWorld(!0); return a.setFromMatrixPosition(this.matrixWorld) }, getWorldQuaternion: function () { var a = new q, b = new q; return function (c) { c = c || new ca; this.updateMatrixWorld(!0); this.matrixWorld.decompose(a, c, b); return c } } (), getWorldRotation: function () { var a = new ca; return function (b) { b = b || new Xa; this.getWorldQuaternion(a); return b.setFromQuaternion(a, this.rotation.order, !1) } } (), getWorldScale: function () { var a = new q, b = new ca; return function (c) { c = c || new q; this.updateMatrixWorld(!0); this.matrixWorld.decompose(a, b, c); return c } } (), getWorldDirection: function () { var a = new ca; return function (b) { b = b || new q; this.getWorldQuaternion(a); return b.set(0, 0, 1).applyQuaternion(a) } } (), raycast: function () {}, traverse: function (a) { a(this); for (var b = this.children, c = 0, d = b.length; c < d; c++) b[c].traverse(a) }, traverseVisible: function (a) { if (!1 !== this.visible) { a(this); for (var b = this.children, c = 0, d = b.length; c < d; c++) b[c].traverseVisible(a) } }, traverseAncestors: function (a) { var b = this.parent; null !== b && (a(b), b.traverseAncestors(a)) }, updateMatrix: function () { this.matrix.compose(this.position, this.quaternion, this.scale); this.matrixWorldNeedsUpdate = !0 }, updateMatrixWorld: function (a) { !0 === this.matrixAutoUpdate && this.updateMatrix(); if (!0 === this.matrixWorldNeedsUpdate || !0 === a) null === this.parent ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix), this.matrixWorldNeedsUpdate = !1, a = !0; for (var b = this.children, c = 0, d = b.length; c < d; c++) b[c].updateMatrixWorld(a) }, toJSON: function (a) { function b(a) { var b = [], c; for (c in a) { var d = a[c]; delete d.metadata; b.push(d) } return b } var c = void 0 === a || "" === a, d = {}; c && (a = { geometries: {}, materials: {}, textures: {}, images: {} }, d.metadata = { version: 4.4, type: "Object", generator: "Object3D.toJSON" }); var e = {}; e.uuid = this.uuid; e.type = this.type; "" !== this.name && (e.name = this.name); "{}" !== JSON.stringify(this.userData) && (e.userData = this.userData); !0 === this.castShadow && (e.castShadow = !0); !0 === this.receiveShadow && (e.receiveShadow = !0); !1 === this.visible && (e.visible = !1); e.matrix = this.matrix.toArray(); void 0 !== this.geometry && (void 0 === a.geometries[this.geometry.uuid] && (a.geometries[this.geometry.uuid] = this.geometry.toJSON(a)), e.geometry = this.geometry.uuid); void 0 !== this.material && (void 0 === a.materials[this.material.uuid] && (a.materials[this.material.uuid] = this.material.toJSON(a)), e.material = this.material.uuid); if (0 < this.children.length) { e.children = []; for (var f = 0; f < this.children.length; f++) e.children.push(this.children[f].toJSON(a).object) } if (c) { var c = b(a.geometries), f = b(a.materials), g = b(a.textures); a = b(a.images); 0 < c.length && (d.geometries = c); 0 < f.length && (d.materials = f); 0 < g.length && (d.textures = g); 0 < a.length && (d.images = a) } d.object = e; return d }, clone: function (a) { return (new this.constructor).copy(this, a) }, copy: function (a, b) { void 0 === b && (b = !0); this.name = a.name; this.up.copy(a.up); this.position.copy(a.position); this.quaternion.copy(a.quaternion); this.scale.copy(a.scale); this.matrix.copy(a.matrix); this.matrixWorld.copy(a.matrixWorld); this.matrixAutoUpdate = a.matrixAutoUpdate; this.matrixWorldNeedsUpdate = a.matrixWorldNeedsUpdate; this.visible = a.visible; this.castShadow = a.castShadow; this.receiveShadow = a.receiveShadow; this.frustumCulled = a.frustumCulled; this.renderOrder = a.renderOrder; this.userData = JSON.parse(JSON.stringify(a.userData)); if (!0 === b) for (var c = 0; c < a.children.length; c++) this.add(a.children[c].clone()); return this } }); var ae = 0; cb.prototype = { constructor: cb, set: function (a, b) { this.start.copy(a); this.end.copy(b); return this }, clone: function () { return (new this.constructor).copy(this) }, copy: function (a) { this.start.copy(a.start); this.end.copy(a.end); return this }, getCenter: function (a) { return (a || new q).addVectors(this.start, this.end).multiplyScalar(.5) }, delta: function (a) { return (a || new q).subVectors(this.end, this.start) }, distanceSq: function () { return this.start.distanceToSquared(this.end) }, distance: function () { return this.start.distanceTo(this.end) }, at: function (a, b) { var c = b || new q; return this.delta(c).multiplyScalar(a).add(this.start) }, closestPointToPointParameter: function () { var a = new q, b = new q; return function (c, d) { a.subVectors(c, this.start); b.subVectors(this.end, this.start); var e = b.dot(b), e = b.dot(a) / e; d && (e = h.Math.clamp(e, 0, 1)); return e } } (), closestPointToPoint: function (a, b, c) { a = this.closestPointToPointParameter(a, b); c = c || new q; return this.delta(c).multiplyScalar(a).add(this.start) }, applyMatrix4: function (a) { this.start.applyMatrix4(a); this.end.applyMatrix4(a); return this }, equals: function (a) { return a.start.equals(this.start) && a.end.equals(this.end) } }; Fa.normal = function () { var a = new q; return function (b, c, d, e) { e = e || new q; e.subVectors(d, c); a.subVectors(b, c); e.cross(a); b = e.lengthSq(); return 0 < b ? e.multiplyScalar(1 / Math.sqrt(b)) : e.set(0, 0, 0) } } (); Fa.barycoordFromPoint = function () { var a = new q, b = new q, c = new q; return function (d, e, f, g, k) { a.subVectors(g, e); b.subVectors(f, e); c.subVectors(d, e); d = a.dot(a); e = a.dot(b); f = a.dot(c); var l = b.dot(b); g = b.dot(c); var h = d * l - e * e; k = k || new q; if (0 === h) return k.set(-2, -1, -1); h = 1 / h; l = (l * f - e * g) * h; d = (d * g - e * f) * h; return k.set(1 - l - d, d, l) } } (); Fa.containsPoint = function () { var a = new q; return function (b, c, d, e) { b = Fa.barycoordFromPoint(b, c, d, e, a); return 0 <= b.x && 0 <= b.y && 1 >= b.x + b.y } } (); Fa.prototype = { constructor: Fa, set: function (a, b, c) { this.a.copy(a); this.b.copy(b); this.c.copy(c); return this }, setFromPointsAndIndices: function (a, b, c, d) { this.a.copy(a[b]); this.b.copy(a[c]); this.c.copy(a[d]); return this }, clone: function () { return (new this.constructor).copy(this) }, copy: function (a) { this.a.copy(a.a); this.b.copy(a.b); this.c.copy(a.c); return this }, area: function () { var a = new q, b = new q; return function () { a.subVectors(this.c, this.b); b.subVectors(this.a, this.b); return .5 * a.cross(b).length() } } (), midpoint: function (a) { return (a || new q).addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3) }, normal: function (a) { return Fa.normal(this.a, this.b, this.c, a) }, plane: function (a) { return (a || new fa).setFromCoplanarPoints(this.a, this.b, this.c) }, barycoordFromPoint: function (a, b) { return Fa.barycoordFromPoint(a, this.a, this.b, this.c, b) }, containsPoint: function (a) { return Fa.containsPoint(a, this.a, this.b, this.c) }, closestPointToPoint: function () { var a, b, c, d; return function (e, f) { void 0 === a && (a = new fa, b = [new cb, new cb, new cb], c = new q, d = new q); var g = f || new q, k = Infinity; a.setFromCoplanarPoints(this.a, this.b, this.c); a.projectPoint(e, c); if (!0 === this.containsPoint(c)) g.copy(c); else { b[0].set(this.a, this.b); b[1].set(this.b, this.c); b[2].set(this.c, this.a); for (var l = 0; l < b.length; l++) { b[l].closestPointToPoint(c, !0, d); var h = c.distanceToSquared(d); h < k && (k = h, g.copy(d)) } } return g } } (), equals: function (a) { return a.a.equals(this.a) && a.b.equals(this.b) && a.c.equals(this.c) } }; ga.prototype = { constructor: ga, clone: function () { return (new this.constructor).copy(this) }, copy: function (a) { this.a = a.a; this.b = a.b; this.c = a.c; this.normal.copy(a.normal); this.color.copy(a.color); this.materialIndex = a.materialIndex; for (var b = 0, c = a.vertexNormals.length; b < c; b++) this.vertexNormals[b] = a.vertexNormals[b].clone(); b = 0; for (c = a.vertexColors.length; b < c; b++) this.vertexColors[b] = a.vertexColors[b].clone(); return this } }; Ia.prototype = Object.create(S.prototype); Ia.prototype.constructor = Ia; Ia.prototype.isMeshBasicMaterial = !0; Ia.prototype.copy = function (a) { S.prototype.copy.call(this, a); this.color.copy(a.color); this.map = a.map; this.aoMap = a.aoMap; this.aoMapIntensity = a.aoMapIntensity; this.specularMap = a.specularMap; this.alphaMap = a.alphaMap; this.envMap = a.envMap; this.combine = a.combine; this.reflectivity = a.reflectivity; this.refractionRatio = a.refractionRatio; this.wireframe = a.wireframe; this.wireframeLinewidth = a.wireframeLinewidth; this.wireframeLinecap = a.wireframeLinecap; this.wireframeLinejoin = a.wireframeLinejoin; this.skinning = a.skinning; this.morphTargets = a.morphTargets; return this }; z.prototype = { constructor: z, isBufferAttribute: !0, set needsUpdate(a) { !0 === a && this.version++ }, setDynamic: function (a) { this.dynamic = a; return this }, copy: function (a) { this.array = new a.array.constructor(a.array); this.itemSize = a.itemSize; this.count = a.count; this.normalized = a.normalized; this.dynamic = a.dynamic; return this }, copyAt: function (a, b, c) { a *= this.itemSize; c *= b.itemSize; for (var d = 0, e = this.itemSize; d < e; d++) this.array[a + d] = b.array[c + d]; return this }, copyArray: function (a) { this.array.set(a); return this }, copyColorsArray: function (a) { for (var b = this.array, c = 0, d = 0, e = a.length; d < e; d++) { var f = a[d]; void 0 === f && (console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined", d), f = new H); b[c++] = f.r; b[c++] = f.g; b[c++] = f.b } return this }, copyIndicesArray: function (a) { for (var b = this.array, c = 0, d = 0, e = a.length; d < e; d++) { var f = a[d]; b[c++] = f.a; b[c++] = f.b; b[c++] = f.c } return this }, copyVector2sArray: function (a) { for (var b = this.array, c = 0, d = 0, e = a.length; d < e; d++) { var f = a[d]; void 0 === f && (console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined", d), f = new C); b[c++] = f.x; b[c++] = f.y } return this }, copyVector3sArray: function (a) { for (var b = this.array, c = 0, d = 0, e = a.length; d < e; d++) { var f = a[d]; void 0 === f && (console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined", d), f = new q); b[c++] = f.x; b[c++] = f.y; b[c++] = f.z } return this }, copyVector4sArray: function (a) { for (var b = this.array, c = 0, d = 0, e = a.length; d < e; d++) { var f = a[d]; void 0 === f && (console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined", d), f = new da); b[c++] = f.x; b[c++] = f.y; b[c++] = f.z; b[c++] = f.w } return this }, set: function (a, b) { void 0 === b && (b = 0); this.array.set(a, b); return this }, getX: function (a) { return this.array[a * this.itemSize] }, setX: function (a, b) { this.array[a * this.itemSize] = b; return this }, getY: function (a) { return this.array[a * this.itemSize + 1] }, setY: function (a, b) { this.array[a * this.itemSize + 1] = b; return this }, getZ: function (a) { return this.array[a * this.itemSize + 2] }, setZ: function (a, b) { this.array[a * this.itemSize + 2] = b; return this }, getW: function (a) { return this.array[a * this.itemSize + 3] }, setW: function (a, b) { this.array[a * this.itemSize + 3] = b; return this }, setXY: function (a, b, c) { a *= this.itemSize; this.array[a + 0] = b; this.array[a + 1] = c; return this }, setXYZ: function (a, b, c, d) { a *= this.itemSize; this.array[a + 0] = b; this.array[a + 1] = c; this.array[a + 2] = d; return this }, setXYZW: function (a, b, c, d, e) { a *= this.itemSize; this.array[a + 0] = b; this.array[a + 1] = c; this.array[a + 2] = d; this.array[a + 3] = e; return this }, clone: function () { return (new this.constructor).copy(this) } }; Object.assign(R.prototype, pa.prototype, { isGeometry: !0, applyMatrix: function (a) { for (var b = (new ya).getNormalMatrix(a), c = 0, d = this.vertices.length; c < d; c++) this.vertices[c].applyMatrix4(a); c = 0; for (d = this.faces.length; c < d; c++) { a = this.faces[c]; a.normal.applyMatrix3(b).normalize(); for (var e = 0, f = a.vertexNormals.length; e < f; e++) a.vertexNormals[e].applyMatrix3(b).normalize() } null !== this.boundingBox && this.computeBoundingBox(); null !== this.boundingSphere && this.computeBoundingSphere(); this.normalsNeedUpdate = this.verticesNeedUpdate = !0; return this }, rotateX: function () { var a; return function (b) { void 0 === a && (a = new P); a.makeRotationX(b); this.applyMatrix(a); return this } } (), rotateY: function () { var a; return function (b) { void 0 === a && (a = new P); a.makeRotationY(b); this.applyMatrix(a); return this } } (), rotateZ: function () { var a; return function (b) { void 0 === a && (a = new P); a.makeRotationZ(b); this.applyMatrix(a); return this } } (), translate: function () { var a; return function (b, c, d) { void 0 === a && (a = new P); a.makeTranslation(b, c, d); this.applyMatrix(a); return this } } (), scale: function () { var a; return function (b, c, d) { void 0 === a && (a = new P); a.makeScale(b, c, d); this.applyMatrix(a); return this } } (), lookAt: function () { var a; return function (b) { void 0 === a && (a = new D); a.lookAt(b); a.updateMatrix(); this.applyMatrix(a.matrix) } } (), fromBufferGeometry: function (a) { function b(a, b, d, e) { var f = void 0 !== g ? [u[a].clone(), u[b].clone(), u[d].clone()] : [], r = void 0 !== k ? [c.colors[a].clone(), c.colors[b].clone(), c.colors[d].clone()] : []; e = new ga(a, b, d, f, r, e); c.faces.push(e); void 0 !== l && c.faceVertexUvs[0].push([p[a].clone(), p[b].clone(), p[d].clone()]); void 0 !== h && c.faceVertexUvs[1].push([n[a].clone(), n[b].clone(), n[d].clone()]) } var c = this, d = null !== a.index ? a.index.array : void 0, e = a.attributes, f = e.position.array, g = void 0 !== e.normal ? e.normal.array : void 0, k = void 0 !== e.color ? e.color.array : void 0, l = void 0 !== e.uv ? e.uv.array : void 0, h = void 0 !== e.uv2 ? e.uv2.array : void 0; void 0 !== h && (this.faceVertexUvs[1] = []); for (var u = [], p = [], n = [], r = e = 0; e < f.length; e += 3, r += 2) c.vertices.push(new q(f[e], f[e + 1], f[e + 2])), void 0 !== g && u.push(new q(g[e], g[e + 1], g[e + 2])), void 0 !== k && c.colors.push(new H(k[e], k[e + 1], k[e + 2])), void 0 !== l && p.push(new C(l[r], l[r + 1])), void 0 !== h && n.push(new C(h[r], h[r + 1])); if (void 0 !== d) if (f = a.groups, 0 < f.length) for (e = 0; e < f.length; e++) for (var t = f[e], v = t.start, A = t.count, r = v, v = v + A; r < v; r += 3) b(d[r], d[r + 1], d[r + 2], t.materialIndex); else for (e = 0; e < d.length; e += 3) b(d[e], d[e + 1], d[e + 2]); else for (e = 0; e < f.length / 3; e += 3) b(e, e + 1, e + 2); this.computeFaceNormals(); null !== a.boundingBox && (this.boundingBox = a.boundingBox.clone()); null !== a.boundingSphere && (this.boundingSphere = a.boundingSphere.clone()); return this }, center: function () { this.computeBoundingBox(); var a = this.boundingBox.getCenter().negate(); this.translate(a.x, a.y, a.z); return a }, normalize: function () { this.computeBoundingSphere(); var a = this.boundingSphere.center, b = this.boundingSphere.radius, b = 0 === b ? 1 : 1 / b, c = new P; c.set(b, 0, 0, -b * a.x, 0, b, 0, -b * a.y, 0, 0, b, -b * a.z, 0, 0, 0, 1); this.applyMatrix(c); return this }, computeFaceNormals: function () { for (var a = new q, b = new q, c = 0, d = this.faces.length; c < d; c++) { var e = this.faces[c], f = this.vertices[e.a], g = this.vertices[e.b]; a.subVectors(this.vertices[e.c], g); b.subVectors(f, g); a.cross(b); a.normalize(); e.normal.copy(a) } }, computeVertexNormals: function (a) { void 0 === a && (a = !0); var b, c, d; d = Array(this.vertices.length); b = 0; for (c = this.vertices.length; b < c; b++) d[b] = new q; if (a) { var e, f, g, k = new q, l = new q; a = 0; for (b = this.faces.length; a < b; a++) c = this.faces[a], e = this.vertices[c.a], f = this.vertices[c.b], g = this.vertices[c.c], k.subVectors(g, f), l.subVectors(e, f), k.cross(l), d[c.a].add(k), d[c.b].add(k), d[c.c].add(k) } else for (a = 0, b = this.faces.length; a < b; a++) c = this.faces[a], d[c.a].add(c.normal), d[c.b].add(c.normal), d[c.c].add(c.normal); b = 0; for (c = this.vertices.length; b < c; b++) d[b].normalize(); a = 0; for (b = this.faces.length; a < b; a++) c = this.faces[a], e = c.vertexNormals, 3 === e.length ? (e[0].copy(d[c.a]), e[1].copy(d[c.b]), e[2].copy(d[c.c])) : (e[0] = d[c.a].clone(), e[1] = d[c.b].clone(), e[2] = d[c.c].clone()); 0 < this.faces.length && (this.normalsNeedUpdate = !0) }, computeMorphNormals: function () { var a, b, c, d, e; c = 0; for (d = this.faces.length; c < d; c++) for (e = this.faces[c], e.__originalFaceNormal ? e.__originalFaceNormal.copy(e.normal) : e.__originalFaceNormal = e.normal.clone(), e.__originalVertexNormals || (e.__originalVertexNormals = []), a = 0, b = e.vertexNormals.length; a < b; a++) e.__originalVertexNormals[a] ? e.__originalVertexNormals[a].copy(e.vertexNormals[a]) : e.__originalVertexNormals[a] = e.vertexNormals[a].clone(); var f = new R; f.faces = this.faces; a = 0; for (b = this.morphTargets.length; a < b; a++) { if (!this.morphNormals[a]) { this.morphNormals[a] = {}; this.morphNormals[a].faceNormals = []; this.morphNormals[a].vertexNormals = []; e = this.morphNormals[a].faceNormals; var g = this.morphNormals[a].vertexNormals, k, l; c = 0; for (d = this.faces.length; c < d; c++) k = new q, l = { a: new q, b: new q, c: new q }, e.push(k), g.push(l) } g = this.morphNormals[a]; f.vertices = this.morphTargets[a].vertices; f.computeFaceNormals(); f.computeVertexNormals(); c = 0; for (d = this.faces.length; c < d; c++) e = this.faces[c], k = g.faceNormals[c], l = g.vertexNormals[c], k.copy(e.normal), l.a.copy(e.vertexNormals[0]), l.b.copy(e.vertexNormals[1]), l.c.copy(e.vertexNormals[2]) } c = 0; for (d = this.faces.length; c < d; c++) e = this.faces[c], e.normal = e.__originalFaceNormal, e.vertexNormals = e.__originalVertexNormals }, computeTangents: function () { console.warn("THREE.Geometry: .computeTangents() has been removed.") }, computeLineDistances: function () { for (var a = 0, b = this.vertices, c = 0, d = b.length; c < d; c++) 0 < c && (a += b[c].distanceTo(b[c - 1])), this.lineDistances[c] = a }, computeBoundingBox: function () { null === this.boundingBox && (this.boundingBox = new Ha); this.boundingBox.setFromPoints(this.vertices) }, computeBoundingSphere: function () { null === this.boundingSphere && (this.boundingSphere = new Aa); this.boundingSphere.setFromPoints(this.vertices) }, merge: function (a, b, c) { if (!1 === (a && a.isGeometry)) console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.", a); else { var d, e = this.vertices.length, f = this.vertices, g = a.vertices, k = this.faces, l = a.faces, h = this.faceVertexUvs[0], u = a.faceVertexUvs[0], p = this.colors, n = a.colors; void 0 === c && (c = 0); void 0 !== b && (d = (new ya).getNormalMatrix(b)); a = 0; for (var r = g.length; a < r; a++) { var t = g[a].clone(); void 0 !== b && t.applyMatrix4(b); f.push(t) } a = 0; for (r = n.length; a < r; a++) p.push(n[a].clone()); a = 0; for (r = l.length; a < r; a++) { var g = l[a], q = g.vertexNormals, n = g.vertexColors, p = new ga(g.a + e, g.b + e, g.c + e); p.normal.copy(g.normal); void 0 !== d && p.normal.applyMatrix3(d).normalize(); b = 0; for (f = q.length; b < f; b++) t = q[b].clone(), void 0 !== d && t.applyMatrix3(d).normalize(), p.vertexNormals.push(t); p.color.copy(g.color); b = 0; for (f = n.length; b < f; b++) t = n[b], p.vertexColors.push(t.clone()); p.materialIndex = g.materialIndex + c; k.push(p) } a = 0; for (r = u.length; a < r; a++) if (c = u[a], d = [], void 0 !== c) { b = 0; for (f = c.length; b < f; b++) d.push(c[b].clone()); h.push(d) } } }, mergeMesh: function (a) { !1 === (a && a.isMesh) ? console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.", a) : (a.matrixAutoUpdate && a.updateMatrix(), this.merge(a.geometry, a.matrix)) }, mergeVertices: function () { var a = {}, b = [], c = [], d, e = Math.pow(10, 4), f, g; f = 0; for (g = this.vertices.length; f < g; f++) d = this.vertices[f], d = Math.round(d.x * e) + "_" + Math.round(d.y * e) + "_" + Math.round(d.z * e), void 0 === a[d] ? (a[d] = f, b.push(this.vertices[f]), c[f] = b.length - 1) : c[f] = c[a[d]]; a = []; f = 0; for (g = this.faces.length; f < g; f++) for (e = this.faces[f], e.a = c[e.a], e.b = c[e.b], e.c = c[e.c], e = [e.a, e.b, e.c], d = 0; 3 > d; d++) if (e[d] === e[(d + 1) % 3]) { a.push(f); break } for (f = a.length - 1; 0 <= f; f--) for (e = a[f], this.faces.splice(e, 1), c = 0, g = this.faceVertexUvs.length; c < g; c++) this.faceVertexUvs[c].splice(e, 1); f = this.vertices.length - b.length; this.vertices = b; return f }, sortFacesByMaterialIndex: function () { for (var a = this.faces, b = a.length, c = 0; c < b; c++) a[c]._id = c; a.sort(function (a, b) { return a.materialIndex - b.materialIndex }); var d = this.faceVertexUvs[0], e = this.faceVertexUvs[1], f, g; d && d.length === b && (f = []); e && e.length === b && (g = []); for (c = 0; c < b; c++) { var k = a[c]._id; f && f.push(d[k]); g && g.push(e[k]) } f && (this.faceVertexUvs[0] = f); g && (this.faceVertexUvs[1] = g) }, toJSON: function () { function a(a, b, c) { return c ? a | 1 << b : a & ~(1 << b) } function b(a) { var b = a.x.toString() + a.y.toString() + a.z.toString(); if (void 0 !== h[b]) return h[b]; h[b] = l.length / 3; l.push(a.x, a.y, a.z); return h[b] } function c(a) { var b = a.r.toString() + a.g.toString() + a.b.toString(); if (void 0 !== p[b]) return p[b]; p[b] = u.length; u.push(a.getHex()); return p[b] } function d(a) { var b = a.x.toString() + a.y.toString(); if (void 0 !== r[b]) return r[b]; r[b] = n.length / 2; n.push(a.x, a.y); return r[b] } var e = { metadata: { version: 4.4, type: "Geometry", generator: "Geometry.toJSON" } }; e.uuid = this.uuid; e.type = this.type; "" !== this.name && (e.name = this.name); if (void 0 !== this.parameters) { var f = this.parameters, g; for (g in f) void 0 !== f[g] && (e[g] = f[g]); return e } f = []; for (g = 0; g < this.vertices.length; g++) { var k = this.vertices[g]; f.push(k.x, k.y, k.z) } var k = [], l = [], h = {}, u = [], p = {}, n = [], r = {}; for (g = 0; g < this.faces.length; g++) { var t = this.faces[g], q = void 0 !== this.faceVertexUvs[0][g], A = 0 < t.normal.length(), w = 0 < t.vertexNormals.length, x = 1 !== t.color.r || 1 !== t.color.g || 1 !== t.color.b, T = 0 < t.vertexColors.length, y = 0, y = a(y, 0, 0), y = a(y, 1, !0), y = a(y, 2, !1), y = a(y, 3, q), y = a(y, 4, A), y = a(y, 5, w), y = a(y, 6, x), y = a(y, 7, T); k.push(y); k.push(t.a, t.b, t.c); k.push(t.materialIndex); q && (q = this.faceVertexUvs[0][g], k.push(d(q[0]), d(q[1]), d(q[2]))); A && k.push(b(t.normal)); w && (A = t.vertexNormals, k.push(b(A[0]), b(A[1]), b(A[2]))); x && k.push(c(t.color)); T && (t = t.vertexColors, k.push(c(t[0]), c(t[1]), c(t[2]))) } e.data = {}; e.data.vertices = f; e.data.normals = l; 0 < u.length && (e.data.colors = u); 0 < n.length && (e.data.uvs = [n]); e.data.faces = k; return e }, clone: function () { return (new R).copy(this) }, copy: function (a) { this.vertices = []; this.faces = []; this.faceVertexUvs = [[]]; this.colors = []; for (var b = a.vertices, c = 0, d = b.length; c < d; c++) this.vertices.push(b[c].clone()); b = a.colors; c = 0; for (d = b.length; c < d; c++) this.colors.push(b[c].clone()); b = a.faces; c = 0; for (d = b.length; c < d; c++) this.faces.push(b[c].clone()); c = 0; for (d = a.faceVertexUvs.length; c < d; c++) { b = a.faceVertexUvs[c]; void 0 === this.faceVertexUvs[c] && (this.faceVertexUvs[c] = []); for (var e = 0, f = b.length; e < f; e++) { for (var g = b[e], k = [], l = 0, h = g.length; l < h; l++) k.push(g[l].clone()); this.faceVertexUvs[c].push(k) } } return this }, dispose: function () { this.dispatchEvent({ type: "dispose" }) } }); var Lc = 0; Object.assign(de.prototype, pa.prototype, { computeBoundingBox: R.prototype.computeBoundingBox, computeBoundingSphere: R.prototype.computeBoundingSphere, computeFaceNormals: function () { console.warn("THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.") }, computeVertexNormals: function () { console.warn("THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.") }, computeGroups: function (a) { var b, c = [], d; a = a.faces; for (var e = 0; e < a.length; e++) { var f = a[e]; f.materialIndex !== d && (d = f.materialIndex, void 0 !== b && (b.count = 3 * e - b.start, c.push(b)), b = { start: 3 * e, materialIndex: d }) } void 0 !== b && (b.count = 3 * e - b.start, c.push(b)); this.groups = c }, fromGeometry: function (a) { var b = a.faces, c = a.vertices, d = a.faceVertexUvs, e = d[0] && 0 < d[0].length, f = d[1] && 0 < d[1].length, g = a.morphTargets, k = g.length, l; if (0 < k) { l = []; for (var h = 0; h < k; h++) l[h] = []; this.morphTargets.position = l } var u = a.morphNormals, p = u.length, n; if (0 < p) { n = []; for (h = 0; h < p; h++) n[h] = []; this.morphTargets.normal = n } for (var r = a.skinIndices, t = a.skinWeights, q = r.length === c.length, A = t.length === c.length, h = 0; h < b.length; h++) { var w = b[h]; this.vertices.push(c[w.a], c[w.b], c[w.c]); var x = w.vertexNormals; 3 === x.length ? this.normals.push(x[0], x[1], x[2]) : (x = w.normal, this.normals.push(x, x, x)); x = w.vertexColors; 3 === x.length ? this.colors.push(x[0], x[1], x[2]) : (x = w.color, this.colors.push(x, x, x)); !0 === e && (x = d[0][h], void 0 !== x ? this.uvs.push(x[0], x[1], x[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ", h), this.uvs.push(new C, new C, new C))); !0 === f && (x = d[1][h], void 0 !== x ? this.uvs2.push(x[0], x[1], x[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ", h), this.uvs2.push(new C, new C, new C))); for (x = 0; x < k; x++) { var T = g[x].vertices; l[x].push(T[w.a], T[w.b], T[w.c]) } for (x = 0; x < p; x++) T = u[x].vertexNormals[h], n[x].push(T.a, T.b, T.c); q && this.skinIndices.push(r[w.a], r[w.b], r[w.c]); A && this.skinWeights.push(t[w.a], t[w.b], t[w.c]) } this.computeGroups(a); this.verticesNeedUpdate = a.verticesNeedUpdate; this.normalsNeedUpdate = a.normalsNeedUpdate; this.colorsNeedUpdate = a.colorsNeedUpdate; this.uvsNeedUpdate = a.uvsNeedUpdate; this.groupsNeedUpdate = a.groupsNeedUpdate; return this }, dispose: function () { this.dispatchEvent({ type: "dispose" }) } }); Object.assign(I.prototype, pa.prototype, { isBufferGeometry: !0, getIndex: function () { return this.index }, setIndex: function (a) { this.index = a }, addAttribute: function (a, b, c) { if (!1 === (b && b.isBufferAttribute) && !1 === (b && b.isInterleavedBufferAttribute)) console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."), this.addAttribute(a, new z(b, c)); else if ("index" === a) console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."), this.setIndex(b); else return this.attributes[a] = b, this }, getAttribute: function (a) { return this.attributes[a] }, removeAttribute: function (a) { delete this.attributes[a]; return this }, addGroup: function (a, b, c) { this.groups.push({ start: a, count: b, materialIndex: void 0 !== c ? c : 0 }) }, clearGroups: function () { this.groups = [] }, setDrawRange: function (a, b) { this.drawRange.start = a; this.drawRange.count = b }, applyMatrix: function (a) { var b = this.attributes.position; void 0 !== b && (a.applyToVector3Array(b.array), b.needsUpdate = !0); b = this.attributes.normal; void 0 !== b && ((new ya).getNormalMatrix(a).applyToVector3Array(b.array), b.needsUpdate = !0); null !== this.boundingBox && this.computeBoundingBox(); null !== this.boundingSphere && this.computeBoundingSphere(); return this }, rotateX: function () { var a; return function (b) { void 0 === a && (a = new P); a.makeRotationX(b); this.applyMatrix(a); return this } } (), rotateY: function () { var a; return function (b) { void 0 === a && (a = new P); a.makeRotationY(b); this.applyMatrix(a); return this } } (), rotateZ: function () { var a; return function (b) { void 0 === a && (a = new P); a.makeRotationZ(b); this.applyMatrix(a); return this } } (), translate: function () { var a; return function (b, c, d) { void 0 === a && (a = new P); a.makeTranslation(b, c, d); this.applyMatrix(a); return this } } (), scale: function () { var a; return function (b, c, d) { void 0 === a && (a = new P); a.makeScale(b, c, d); this.applyMatrix(a); return this } } (), lookAt: function () { var a; return function (b) { void 0 === a && (a = new D); a.lookAt(b); a.updateMatrix(); this.applyMatrix(a.matrix) } } (), center: function () { this.computeBoundingBox(); var a = this.boundingBox.getCenter().negate(); this.translate(a.x, a.y, a.z); return a }, setFromObject: function (a) { var b = a.geometry; if (a && a.isPoints || a && a.isLine) { a = new ma(3 * b.vertices.length, 3); var c = new ma(3 * b.colors.length, 3); this.addAttribute("position", a.copyVector3sArray(b.vertices)); this.addAttribute("color", c.copyColorsArray(b.colors)); b.lineDistances && b.lineDistances.length === b.vertices.length && (a = new ma(b.lineDistances.length, 1), this.addAttribute("lineDistance", a.copyArray(b.lineDistances))); null !== b.boundingSphere && (this.boundingSphere = b.boundingSphere.clone()); null !== b.boundingBox && (this.boundingBox = b.boundingBox.clone()) } else a && a.isMesh && b && b.isGeometry && this.fromGeometry(b); return this }, updateFromObject: function (a) { var b = a.geometry; if (a && a.isMesh) { var c = b.__directGeometry; !0 === b.elementsNeedUpdate && (c = void 0, b.elementsNeedUpdate = !1); if (void 0 === c) return this.fromGeometry(b); c.verticesNeedUpdate = b.verticesNeedUpdate; c.normalsNeedUpdate = b.normalsNeedUpdate; c.colorsNeedUpdate = b.colorsNeedUpdate; c.uvsNeedUpdate = b.uvsNeedUpdate; c.groupsNeedUpdate = b.groupsNeedUpdate; b.verticesNeedUpdate = !1; b.normalsNeedUpdate = !1; b.colorsNeedUpdate = !1; b.uvsNeedUpdate = !1; b.groupsNeedUpdate = !1; b = c } !0 === b.verticesNeedUpdate && (c = this.attributes.position, void 0 !== c && (c.copyVector3sArray(b.vertices), c.needsUpdate = !0), b.verticesNeedUpdate = !1); !0 === b.normalsNeedUpdate && (c = this.attributes.normal, void 0 !== c && (c.copyVector3sArray(b.normals), c.needsUpdate = !0), b.normalsNeedUpdate = !1); !0 === b.colorsNeedUpdate && (c = this.attributes.color, void 0 !== c && (c.copyColorsArray(b.colors), c.needsUpdate = !0), b.colorsNeedUpdate = !1); b.uvsNeedUpdate && (c = this.attributes.uv, void 0 !== c && (c.copyVector2sArray(b.uvs), c.needsUpdate = !0), b.uvsNeedUpdate = !1); b.lineDistancesNeedUpdate && (c = this.attributes.lineDistance, void 0 !== c && (c.copyArray(b.lineDistances), c.needsUpdate = !0), b.lineDistancesNeedUpdate = !1); b.groupsNeedUpdate && (b.computeGroups(a.geometry), this.groups = b.groups, b.groupsNeedUpdate = !1); return this }, fromGeometry: function (a) { a.__directGeometry = (new de).fromGeometry(a); return this.fromDirectGeometry(a.__directGeometry) }, fromDirectGeometry: function (a) { var b = new Float32Array(3 * a.vertices.length); this.addAttribute("position", (new z(b, 3)).copyVector3sArray(a.vertices)); 0 < a.normals.length && (b = new Float32Array(3 * a.normals.length), this.addAttribute("normal", (new z(b, 3)).copyVector3sArray(a.normals))); 0 < a.colors.length && (b = new Float32Array(3 * a.colors.length), this.addAttribute("color", (new z(b, 3)).copyColorsArray(a.colors))); 0 < a.uvs.length && (b = new Float32Array(2 * a.uvs.length), this.addAttribute("uv", (new z(b, 2)).copyVector2sArray(a.uvs))); 0 < a.uvs2.length && (b = new Float32Array(2 * a.uvs2.length), this.addAttribute("uv2", (new z(b, 2)).copyVector2sArray(a.uvs2))); 0 < a.indices.length && (b = new(65535 < a.vertices.length ? Uint32Array : Uint16Array)(3 * a.indices.length), this.setIndex((new z(b, 1)).copyIndicesArray(a.indices))); this.groups = a.groups; for (var c in a.morphTargets) { for (var b = [], d = a.morphTargets[c], e = 0, f = d.length; e < f; e++) { var g = d[e], k = new ma(3 * g.length, 3); b.push(k.copyVector3sArray(g)) } this.morphAttributes[c] = b } 0 < a.skinIndices.length && (c = new ma(4 * a.skinIndices.length, 4), this.addAttribute("skinIndex", c.copyVector4sArray(a.skinIndices))); 0 < a.skinWeights.length && (c = new ma(4 * a.skinWeights.length, 4), this.addAttribute("skinWeight", c.copyVector4sArray(a.skinWeights))); null !== a.boundingSphere && (this.boundingSphere = a.boundingSphere.clone()); null !== a.boundingBox && (this.boundingBox = a.boundingBox.clone()); return this }, computeBoundingBox: function () { null === this.boundingBox && (this.boundingBox = new Ha); var a = this.attributes.position.array; void 0 !== a ? this.boundingBox.setFromArray(a) : this.boundingBox.makeEmpty(); (isNaN(this.boundingBox.min.x) || isNaN(this.boundingBox.min.y) || isNaN(this.boundingBox.min.z)) && console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.', this) }, computeBoundingSphere: function () { var a = new Ha, b = new q; return function () { null === this.boundingSphere && (this.boundingSphere = new Aa); var c = this.attributes.position; if (c) { var c = c.array, d = this.boundingSphere.center; a.setFromArray(c); a.getCenter(d); for (var e = 0, f = 0, g = c.length; f < g; f += 3) b.fromArray(c, f), e = Math.max(e, d.distanceToSquared(b)); this.boundingSphere.radius = Math.sqrt(e); isNaN(this.boundingSphere.radius) && console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this) } } } (), computeFaceNormals: function () {}, computeVertexNormals: function () { var a = this.index, b = this.attributes, c = this.groups; if (b.position) { var d = b.position.array; if (void 0 === b.normal) this.addAttribute("normal", new z(new Float32Array(d.length), 3)); else for (var e = b.normal.array, f = 0, g = e.length; f < g; f++) e[f] = 0; var e = b.normal.array, k, l, h, u = new q, p = new q, n = new q, r = new q, t = new q; if (a) { a = a.array; 0 === c.length && this.addGroup(0, a.length); for (var v = 0, A = c.length; v < A; ++v) for (f = c[v], g = f.start, k = f.count, f = g, g += k; f < g; f += 3) k = 3 * a[f + 0], l = 3 * a[f + 1], h = 3 * a[f + 2], u.fromArray(d, k), p.fromArray(d, l), n.fromArray(d, h), r.subVectors(n, p), t.subVectors(u, p), r.cross(t), e[k] += r.x, e[k + 1] += r.y, e[k + 2] += r.z, e[l] += r.x, e[l + 1] += r.y, e[l + 2] += r.z, e[h] += r.x, e[h + 1] += r.y, e[h + 2] += r.z } else for (f = 0, g = d.length; f < g; f += 9) u.fromArray(d, f), p.fromArray(d, f + 3), n.fromArray(d, f + 6), r.subVectors(n, p), t.subVectors(u, p), r.cross(t), e[f] = r.x, e[f + 1] = r.y, e[f + 2] = r.z, e[f + 3] = r.x, e[f + 4] = r.y, e[f + 5] = r.z, e[f + 6] = r.x, e[f + 7] = r.y, e[f + 8] = r.z; this.normalizeNormals(); b.normal.needsUpdate = !0 } }, merge: function (a, b) { if (!1 === (a && a.isBufferGeometry)) console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.", a); else { void 0 === b && (b = 0); var c = this.attributes, d; for (d in c) if (void 0 !== a.attributes[d]) for (var e = c[d].array, f = a.attributes[d], g = f.array, k = 0, f = f.itemSize * b; k < g.length; k++, f++) e[f] = g[k]; return this } }, normalizeNormals: function () { for (var a = this.attributes.normal.array, b, c, d, e = 0, f = a.length; e < f; e += 3) b = a[e], c = a[e + 1], d = a[e + 2], b = 1 / Math.sqrt(b * b + c * c + d * d), a[e] *= b, a[e + 1] *= b, a[e + 2] *= b }, toNonIndexed: function () { if (null === this.index) return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."), this; var a = new I, b = this.index.array, c = this.attributes, d; for (d in c) { for (var e = c[d], f = e.array, e = e.itemSize, g = new f.constructor(b.length * e), k, l = 0, h = 0, u = b.length; h < u; h++) { k = b[h] * e; for (var p = 0; p < e; p++) g[l++] = f[k++] } a.addAttribute(d, new z(g, e)) } return a }, toJSON: function () { var a = { metadata: { version: 4.4, type: "BufferGeometry", generator: "BufferGeometry.toJSON" } }; a.uuid = this.uuid; a.type = this.type; "" !== this.name && (a.name = this.name); if (void 0 !== this.parameters) { var b = this.parameters, c; for (c in b) void 0 !== b[c] && (a[c] = b[c]); return a } a.data = { attributes: {} }; var d = this.index; null !== d && (b = Array.prototype.slice.call(d.array), a.data.index = { type: d.array.constructor.name, array: b }); d = this.attributes; for (c in d) { var e = d[c], b = Array.prototype.slice.call(e.array); a.data.attributes[c] = { itemSize: e.itemSize, type: e.array.constructor.name, array: b, normalized: e.normalized } } c = this.groups; 0 < c.length && (a.data.groups = JSON.parse(JSON.stringify(c))); c = this.boundingSphere; null !== c && (a.data.boundingSphere = { center: c.center.toArray(), radius: c.radius }); return a }, clone: function () { return (new I).copy(this) }, copy: function (a) { var b = a.index; null !== b && this.setIndex(b.clone()); var b = a.attributes, c; for (c in b) this.addAttribute(c, b[c].clone()); a = a.groups; c = 0; for (b = a.length; c < b; c++) { var d = a[c]; this.addGroup(d.start, d.count, d.materialIndex) } return this }, dispose: function () { this.dispatchEvent({ type: "dispose" }) } }); I.MaxIndex = 65535; va.prototype = Object.assign(Object.create(D.prototype), { constructor: va, isMesh: !0, setDrawMode: function (a) { this.drawMode = a }, copy: function (a) { D.prototype.copy.call(this, a); this.drawMode = a.drawMode; return this }, updateMorphTargets: function () { var a = this.geometry.morphTargets; if (void 0 !== a && 0 < a.length) { this.morphTargetInfluences = []; this.morphTargetDictionary = {}; for (var b = 0, c = a.length; b < c; b++) this.morphTargetInfluences.push(0), this.morphTargetDictionary[a[b].name] = b } }, raycast: function () { function a(a, b, c, d, e, f, g) { Fa.barycoordFromPoint(a, b, c, d, v); e.multiplyScalar(v.x); f.multiplyScalar(v.y); g.multiplyScalar(v.z); e.add(f).add(g); return e.clone() } function b(a, b, c, d, e, f, g) { var k = a.material; if (null === (1 === k.side ? c.intersectTriangle(f, e, d, !0, g) : c.intersectTriangle(d, e, f, 2 !== k.side, g))) return null; w.copy(g); w.applyMatrix4(a.matrixWorld); c = b.ray.origin.distanceTo(w); return c < b.near || c > b.far ? null : { distance: c, point: w.clone(), object: a } } function c(c, d, e, f, m, p, u, q) { g.fromArray(f, 3 * p); k.fromArray(f, 3 * u); h.fromArray(f, 3 * q); if (c = b(c, d, e, g, k, h, A)) m && (n.fromArray(m, 2 * p), r.fromArray(m, 2 * u), t.fromArray(m, 2 * q), c.uv = a(A, g, k, h, n, r, t)), c.face = new ga(p, u, q, Fa.normal(g, k, h)), c.faceIndex = p; return c } var d = new P, e = new Wa, f = new Aa, g = new q, k = new q, h = new q, m = new q, u = new q, p = new q, n = new C, r = new C, t = new C, v = new q, A = new q, w = new q; return function (q, v) { var w = this.geometry, F = this.material, G = this.matrixWorld; if (void 0 !== F && (null === w.boundingSphere && w.computeBoundingSphere(), f.copy(w.boundingSphere), f.applyMatrix4(G), !1 !== q.ray.intersectsSphere(f) && (d.getInverse(G), e.copy(q.ray).applyMatrix4(d), null === w.boundingBox || !1 !== e.intersectsBox(w.boundingBox)))) { var E, J; if (w && w.isBufferGeometry) { var C, D, F = w.index, G = w.attributes, w = G.position.array; void 0 !== G.uv && (E = G.uv.array); if (null !== F) for (var G = F.array, z = 0, I = G.length; z < I; z += 3) { if (F = G[z], C = G[z + 1], D = G[z + 2], J = c(this, q, e, w, E, F, C, D)) J.faceIndex = Math.floor(z / 3), v.push(J) } else for (z = 0, I = w.length; z < I; z += 9) if (F = z / 3, C = F + 1, D = F + 2, J = c(this, q, e, w, E, F, C, D)) J.index = F, v.push(J) } else if (w && w.isGeometry) { var H, P, G = F && F.isMultiMaterial, z = !0 === G ? F.materials : null, I = w.vertices; C = w.faces; D = w.faceVertexUvs[0]; 0 < D.length && (E = D); for (var L = 0, M = C.length; L < M; L++) { var O = C[L]; J = !0 === G ? z[O.materialIndex] : F; if (void 0 !== J) { D = I[O.a]; H = I[O.b]; P = I[O.c]; if (!0 === J.morphTargets) { J = w.morphTargets; var Q = this.morphTargetInfluences; g.set(0, 0, 0); k.set(0, 0, 0); h.set(0, 0, 0); for (var S = 0, V = J.length; S < V; S++) { var W = Q[S]; if (0 !== W) { var K = J[S].vertices; g.addScaledVector(m.subVectors(K[O.a], D), W); k.addScaledVector(u.subVectors(K[O.b], H), W); h.addScaledVector(p.subVectors(K[O.c], P), W) } } g.add(D); k.add(H); h.add(P); D = g; H = k; P = h } if (J = b(this, q, e, D, H, P, A)) E && (Q = E[L], n.copy(Q[0]), r.copy(Q[1]), t.copy(Q[2]), J.uv = a(A, D, H, P, n, r, t)), J.face = O, J.faceIndex = L, v.push(J) } } } } } } (), clone: function () { return (new this.constructor(this.geometry, this.material)).copy(this) } }); db.prototype = Object.create(I.prototype); db.prototype.constructor = db; eb.prototype = Object.create(I.prototype); eb.prototype.constructor = eb; qa.prototype = Object.create(D.prototype); qa.prototype.constructor = qa; qa.prototype.isCamera = !0; qa.prototype.getWorldDirection = function () { var a = new ca; return function (b) { b = b || new q; this.getWorldQuaternion(a); return b.set(0, 0, -1).applyQuaternion(a) } } (); qa.prototype.lookAt = function () { var a = new P; return function (b) { a.lookAt(this.position, b, this.up); this.quaternion.setFromRotationMatrix(a) } } (); qa.prototype.clone = function () { return (new this.constructor).copy(this) }; qa.prototype.copy = function (a) { D.prototype.copy.call(this, a); this.matrixWorldInverse.copy(a.matrixWorldInverse); this.projectionMatrix.copy(a.projectionMatrix); return this }; Ca.prototype = Object.assign(Object.create(qa.prototype), { constructor: Ca, isPerspectiveCamera: !0, copy: function (a) { qa.prototype.copy.call(this, a); this.fov = a.fov; this.zoom = a.zoom; this.near = a.near; this.far = a.far; this.focus = a.focus; this.aspect = a.aspect; this.view = null === a.view ? null : Object.assign({}, a.view); this.filmGauge = a.filmGauge; this.filmOffset = a.filmOffset; return this }, setFocalLength: function (a) { a = .5 * this.getFilmHeight() / a; this.fov = 2 * h.Math.RAD2DEG * Math.atan(a); this.updateProjectionMatrix() }, getFocalLength: function () { var a = Math.tan(.5 * h.Math.DEG2RAD * this.fov); return .5 * this.getFilmHeight() / a }, getEffectiveFOV: function () { return 2 * h.Math.RAD2DEG * Math.atan(Math.tan(.5 * h.Math.DEG2RAD * this.fov) / this.zoom) }, getFilmWidth: function () { return this.filmGauge * Math.min(this.aspect, 1) }, getFilmHeight: function () { return this.filmGauge / Math.max(this.aspect, 1) }, setViewOffset: function (a, b, c, d, e, f) { this.aspect = a / b; this.view = { fullWidth: a, fullHeight: b, offsetX: c, offsetY: d, width: e, height: f }; this.updateProjectionMatrix() }, clearViewOffset: function () { this.view = null; this.updateProjectionMatrix() }, updateProjectionMatrix: function () { var a = this.near, b = a * Math.tan(.5 * h.Math.DEG2RAD * this.fov) / this.zoom, c = 2 * b, d = this.aspect * c, e = - .5 * d, f = this.view; if (null !== f) var g = f.fullWidth, k = f.fullHeight, e = e + f.offsetX * d / g, b = b - f.offsetY * c / k, d = f.width / g * d, c = f.height / k * c; f = this.filmOffset; 0 !== f && (e += a * f / this.getFilmWidth()); this.projectionMatrix.makeFrustum(e, e + d, b - c, b, a, this.far) }, toJSON: function (a) { a = D.prototype.toJSON.call(this, a); a.object.fov = this.fov; a.object.zoom = this.zoom; a.object.near = this.near; a.object.far = this.far; a.object.focus = this.focus; a.object.aspect = this.aspect; null !== this.view && (a.object.view = Object.assign({}, this.view)); a.object.filmGauge = this.filmGauge; a.object.filmOffset = this.filmOffset; return a } }); Db.prototype = Object.assign(Object.create(qa.prototype), { constructor: Db, isOrthographicCamera: !0, copy: function (a) { qa.prototype.copy.call(this, a); this.left = a.left; this.right = a.right; this.top = a.top; this.bottom = a.bottom; this.near = a.near; this.far = a.far; this.zoom = a.zoom; this.view = null === a.view ? null : Object.assign({}, a.view); return this }, setViewOffset: function (a, b, c, d, e, f) { this.view = { fullWidth: a, fullHeight: b, offsetX: c, offsetY: d, width: e, height: f }; this.updateProjectionMatrix() }, clearViewOffset: function () { this.view = null; this.updateProjectionMatrix() }, updateProjectionMatrix: function () { var a = (this.right - this.left) / (2 * this.zoom), b = (this.top - this.bottom) / (2 * this.zoom), c = (this.right + this.left) / 2, d = (this.top + this.bottom) / 2, e = c - a, c = c + a, a = d + b, b = d - b; if (null !== this.view) var c = this.zoom / (this.view.width / this.view.fullWidth), b = this.zoom / (this.view.height / this.view.fullHeight), f = (this.right - this.left) / this.view.width, d = (this.top - this.bottom) / this.view.height, e = e + this.view.offsetX / c * f, c = e + this.view.width / c * f, a = a - this.view.offsetY / b * d, b = a - this.view.height / b * d; this.projectionMatrix.makeOrthographic(e, c, a, b, this.near, this.far) }, toJSON: function (a) { a = D.prototype.toJSON.call(this, a); a.object.zoom = this.zoom; a.object.left = this.left; a.object.right = this.right; a.object.top = this.top; a.object.bottom = this.bottom; a.object.near = this.near; a.object.far = this.far; null !== this.view && (a.object.view = Object.assign({}, this.view)); return a } }); var bf = 0; Eb.prototype.isFogExp2 = !0; Eb.prototype.clone = function () { return new Eb(this.color.getHex(), this.density) }; Eb.prototype.toJSON = function (a) { return { type: "FogExp2", color: this.color.getHex(), density: this.density } }; Fb.prototype.isFog = !0; Fb.prototype.clone = function () { return new Fb(this.color.getHex(), this.near, this.far) }; Fb.prototype.toJSON = function (a) { return { type: "Fog", color: this.color.getHex(), near: this.near, far: this.far } }; fb.prototype = Object.create(D.prototype); fb.prototype.constructor = fb; fb.prototype.copy = function (a, b) { D.prototype.copy.call(this, a, b); null !== a.background && (this.background = a.background.clone()); null !== a.fog && (this.fog = a.fog.clone()); null !== a.overrideMaterial && (this.overrideMaterial = a.overrideMaterial.clone()); this.autoUpdate = a.autoUpdate; this.matrixAutoUpdate = a.matrixAutoUpdate; return this }; fb.prototype.toJSON = function (a) { var b = D.prototype.toJSON.call(this, a); null !== this.background && (b.object.background = this.background.toJSON(a)); null !== this.fog && (b.object.fog = this.fog.toJSON()); return b }; pd.prototype = Object.assign(Object.create(D.prototype), { constructor: pd, isLensFlare: !0, copy: function (a) { D.prototype.copy.call(this, a); this.positionScreen.copy(a.positionScreen); this.customUpdateCallback = a.customUpdateCallback; for (var b = 0, c = a.lensFlares.length; b < c; b++) this.lensFlares.push(a.lensFlares[b]); return this }, add: function (a, b, c, d, e, f) { void 0 === b && (b = -1); void 0 === c && (c = 0); void 0 === f && (f = 1); void 0 === e && (e = new H(16777215)); void 0 === d && (d = 1); c = Math.min(c, Math.max(0, c)); this.lensFlares.push({ texture: a, size: b, distance: c, x: 0, y: 0, z: 0, scale: 1, rotation: 0, opacity: f, color: e, blending: d }) }, updateLensFlares: function () { var a, b = this.lensFlares.length, c, d = 2 * -this.positionScreen.x, e = 2 * -this.positionScreen.y; for (a = 0; a < b; a++) c = this.lensFlares[a], c.x = this.positionScreen.x + d * c.distance, c.y = this.positionScreen.y + e * c.distance, c.wantedRotation = c.x * Math.PI * .25, c.rotation += .25 * (c.wantedRotation - c.rotation) } }); gb.prototype = Object.create(S.prototype); gb.prototype.constructor = gb; gb.prototype.copy = function (a) { S.prototype.copy.call(this, a); this.color.copy(a.color); this.map = a.map; this.rotation = a.rotation; return this }; fc.prototype = Object.assign(Object.create(D.prototype), { constructor: fc, isSprite: !0, raycast: function () { var a = new q; return function (b, c) { a.setFromMatrixPosition(this.matrixWorld); var d = b.ray.distanceSqToPoint(a); d > this.scale.x * this.scale.y / 4 || c.push({ distance: Math.sqrt(d), point: this.position, face: null, object: this }) } } (), clone: function () { return (new this.constructor(this.material)).copy(this) } }); gc.prototype = Object.assign(Object.create(D.prototype), { constructor: gc, copy: function (a) { D.prototype.copy.call(this, a, !1); a = a.levels; for (var b = 0, c = a.length; b < c; b++) { var d = a[b]; this.addLevel(d.object.clone(), d.distance) } return this }, addLevel: function (a, b) { void 0 === b && (b = 0); b = Math.abs(b); for (var c = this.levels, d = 0; d < c.length && !(b < c[d].distance); d++); c.splice(d, 0, { distance: b, object: a }); this.add(a) }, getObjectForDistance: function (a) { for (var b = this.levels, c = 1, d = b.length; c < d && !(a < b[c].distance); c++); return b[c - 1].object }, raycast: function () { var a = new q; return function (b, c) { a.setFromMatrixPosition(this.matrixWorld); var d = b.ray.origin.distanceTo(a); this.getObjectForDistance(d).raycast(b, c) } } (), update: function () { var a = new q, b = new q; return function (c) { var d = this.levels; if (1 < d.length) { a.setFromMatrixPosition(c.matrixWorld); b.setFromMatrixPosition(this.matrixWorld); c = a.distanceTo(b); d[0].object.visible = !0; for (var e = 1, f = d.length; e < f; e++) if (c >= d[e].distance) d[e - 1].object.visible = !1, d[e].object.visible = !0; else break; for (; e < f; e++) d[e].object.visible = !1 } } } (), toJSON: function (a) { a = D.prototype.toJSON.call(this, a); a.object.levels = []; for (var b = this.levels, c = 0, d = b.length; c < d; c++) { var e = b[c]; a.object.levels.push({ object: e.object.uuid, distance: e.distance }) } return a } }); hb.prototype = Object.create(ba.prototype); hb.prototype.constructor = hb; hb.prototype.isDataTexture = !0; Object.assign(Nc.prototype, { calculateInverses: function () { this.boneInverses = []; for (var a = 0, b = this.bones.length; a < b; a++) { var c = new P; this.bones[a] && c.getInverse(this.bones[a].matrixWorld); this.boneInverses.push(c) } }, pose: function () { for (var a, b = 0, c = this.bones.length; b < c; b++) (a = this.bones[b]) && a.matrixWorld.getInverse(this.boneInverses[b]); b = 0; for (c = this.bones.length; b < c; b++) if (a = this.bones[b]) a.parent && a.parent.isBone ? (a.matrix.getInverse(a.parent.matrixWorld), a.matrix.multiply(a.matrixWorld)) : a.matrix.copy(a.matrixWorld), a.matrix.decompose(a.position, a.quaternion, a.scale) }, update: function () { var a = new P; return function () { for (var b = 0, c = this.bones.length; b < c; b++) a.multiplyMatrices(this.bones[b] ? this.bones[b].matrixWorld : this.identityMatrix, this.boneInverses[b]), a.toArray(this.boneMatrices, 16 * b); this.useVertexTexture && (this.boneTexture.needsUpdate = !0) } } (), clone: function () { return new Nc(this.bones, this.boneInverses, this.useVertexTexture) } }); Oc.prototype = Object.assign(Object.create(D.prototype), { constructor: Oc, isBone: !0, copy: function (a) { D.prototype.copy.call(this, a); this.skin = a.skin; return this } }); Pc.prototype = Object.assign(Object.create(va.prototype), { constructor: Pc, isSkinnedMesh: !0, bind: function (a, b) { this.skeleton = a; void 0 === b && (this.updateMatrixWorld(!0), this.skeleton.calculateInverses(), b = this.matrixWorld); this.bindMatrix.copy(b); this.bindMatrixInverse.getInverse(b) }, pose: function () { this.skeleton.pose() }, normalizeSkinWeights: function () { if (this.geometry && this.geometry.isGeometry) for (var a = 0; a < this.geometry.skinWeights.length; a++) { var b = this.geometry.skinWeights[a], c = 1 / b.lengthManhattan(); Infinity !== c ? b.multiplyScalar(c) : b.set(1, 0, 0, 0) } else if (this.geometry && this.geometry.isBufferGeometry) for (var b = new da, d = this.geometry.attributes.skinWeight, a = 0; a < d.count; a++) b.x = d.getX(a), b.y = d.getY(a), b.z = d.getZ(a), b.w = d.getW(a), c = 1 / b.lengthManhattan(), Infinity !== c ? b.multiplyScalar(c) : b.set(1, 0, 0, 0), d.setXYZW(a, b.x, b.y, b.z, b.w) }, updateMatrixWorld: function (a) { va.prototype.updateMatrixWorld.call(this, !0); "attached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.matrixWorld) : "detached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.bindMatrix) : console.warn("THREE.SkinnedMesh unrecognized bindMode: " + this.bindMode) }, clone: function () { return (new this.constructor(this.geometry, this.material, this.skeleton.useVertexTexture)).copy(this) } }); na.prototype = Object.create(S.prototype); na.prototype.constructor = na; na.prototype.isLineBasicMaterial = !0; na.prototype.copy = function (a) { S.prototype.copy.call(this, a); this.color.copy(a.color); this.linewidth = a.linewidth; this.linecap = a.linecap; this.linejoin = a.linejoin; return this }; Pa.prototype = Object.assign(Object.create(D.prototype), { constructor: Pa, isLine: !0, raycast: function () { var a = new P, b = new Wa, c = new Aa; return function (d, e) { var f = d.linePrecision, f = f * f, g = this.geometry, k = this.matrixWorld; null === g.boundingSphere && g.computeBoundingSphere(); c.copy(g.boundingSphere); c.applyMatrix4(k); if (!1 !== d.ray.intersectsSphere(c)) { a.getInverse(k); b.copy(d.ray).applyMatrix4(a); var h = new q, m = new q, k = new q, u = new q, p = this && this.isLineSegments ? 2 : 1; if (g && g.isBufferGeometry) { var n = g.index, r = g.attributes.position.array; if (null !== n) for (var n = n.array, g = 0, t = n.length - 1; g < t; g += p) { var v = n[g + 1]; h.fromArray(r, 3 * n[g]); m.fromArray(r, 3 * v); v = b.distanceSqToSegment(h, m, u, k); v > f || (u.applyMatrix4(this.matrixWorld), v = d.ray.origin.distanceTo(u), v < d.near || v > d.far || e.push({ distance: v, point: k.clone().applyMatrix4(this.matrixWorld), index: g, face: null, faceIndex: null, object: this })) } else for (g = 0, t = r.length / 3 - 1; g < t; g += p) h.fromArray(r, 3 * g), m.fromArray(r, 3 * g + 3), v = b.distanceSqToSegment(h, m, u, k), v > f || (u.applyMatrix4(this.matrixWorld), v = d.ray.origin.distanceTo(u), v < d.near || v > d.far || e.push({ distance: v, point: k.clone().applyMatrix4(this.matrixWorld), index: g, face: null, faceIndex: null, object: this })) } else if (g && g.isGeometry) for (h = g.vertices, m = h.length, g = 0; g < m - 1; g += p) v = b.distanceSqToSegment(h[g], h[g + 1], u, k), v > f || (u.applyMatrix4(this.matrixWorld), v = d.ray.origin.distanceTo(u), v < d.near || v > d.far || e.push({ distance: v, point: k.clone().applyMatrix4(this.matrixWorld), index: g, face: null, faceIndex: null, object: this })) } } } (), clone: function () { return (new this.constructor(this.geometry, this.material)).copy(this) } }); ha.prototype = Object.assign(Object.create(Pa.prototype), { constructor: ha, isLineSegments: !0 }); Ja.prototype = Object.create(S.prototype); Ja.prototype.constructor = Ja; Ja.prototype.isPointsMaterial = !0; Ja.prototype.copy = function (a) { S.prototype.copy.call(this, a); this.color.copy(a.color); this.map = a.map; this.size = a.size; this.sizeAttenuation = a.sizeAttenuation; return this }; Gb.prototype = Object.assign(Object.create(D.prototype), { constructor: Gb, isPoints: !0, raycast: function () { var a = new P, b = new Wa, c = new Aa; return function (d, e) { function f(a, c) { var f = b.distanceSqToPoint(a); if (f < u) { var k = b.closestPointToPoint(a); k.applyMatrix4(h); var n = d.ray.origin.distanceTo(k); n < d.near || n > d.far || e.push({ distance: n, distanceToRay: Math.sqrt(f), point: k.clone(), index: c, face: null, object: g }) } } var g = this, k = this.geometry, h = this.matrixWorld, m = d.params.Points.threshold; null === k.boundingSphere && k.computeBoundingSphere(); c.copy(k.boundingSphere); c.applyMatrix4(h); if (!1 !== d.ray.intersectsSphere(c)) { a.getInverse(h); b.copy(d.ray).applyMatrix4(a); var m = m / ((this.scale.x + this.scale.y + this.scale.z) / 3), u = m * m, m = new q; if (k && k.isBufferGeometry) { var p = k.index, k = k.attributes.position.array; if (null !== p) for (var n = p.array, p = 0, r = n.length; p < r; p++) { var t = n[p]; m.fromArray(k, 3 * t); f(m, t) } else for (p = 0, n = k.length / 3; p < n; p++) m.fromArray(k, 3 * p), f(m, p) } else for (m = k.vertices, p = 0, n = m.length; p < n; p++) f(m[p], p) } } } (), clone: function () { return (new this.constructor(this.geometry, this.material)).copy(this) } }); hc.prototype = Object.assign(Object.create(D.prototype), { constructor: hc }); Qc.prototype = Object.create(ba.prototype); Qc.prototype.constructor = Qc; Hb.prototype = Object.create(ba.prototype); Hb.prototype.constructor = Hb; Hb.prototype.isCompressedTexture = !0; Rc.prototype = Object.create(ba.prototype); Rc.prototype.constructor = Rc; ic.prototype = Object.create(ba.prototype); ic.prototype.constructor = ic; ic.prototype.isDepthTexture = !0; Ib.prototype = Object.create(I.prototype); Ib.prototype.constructor = Ib; jc.prototype = Object.create(R.prototype); jc.prototype.constructor = jc; sa.prototype = Object.create(R.prototype); sa.prototype.constructor = sa; kc.prototype = Object.create(sa.prototype); kc.prototype.constructor = kc; lc.prototype = Object.create(sa.prototype); lc.prototype.constructor = lc; mc.prototype = Object.create(sa.prototype); mc.prototype.constructor = mc; nc.prototype = Object.create(sa.prototype); nc.prototype.constructor = nc; wa.prototype = Object.create(R.prototype); wa.prototype.constructor = wa; wa.NoTaper = function (a) { return 1 }; wa.SinusoidalTaper = function (a) { return Math.sin(Math.PI * a) }; wa.FrenetFrames = function (a, b, c) { var d = new q, e = [], f = [], g = [], k = new q, l = new P; b += 1; var m, u, p; this.tangents = e; this.normals = f; this.binormals = g; for (m = 0; m < b; m++) u = m / (b - 1), e[m] = a.getTangentAt(u), e[m].normalize(); f[0] = new q; g[0] = new q; a = Number.MAX_VALUE; m = Math.abs(e[0].x); u = Math.abs(e[0].y); p = Math.abs(e[0].z); m <= a && (a = m, d.set(1, 0, 0)); u <= a && (a = u, d.set(0, 1, 0)); p <= a && d.set(0, 0, 1); k.crossVectors(e[0], d).normalize(); f[0].crossVectors(e[0], k); g[0].crossVectors(e[0], f[0]); for (m = 1; m < b; m++) f[m] = f[m - 1].clone(), g[m] = g[m - 1].clone(), k.crossVectors(e[m - 1], e[m]), k.length() > Number.EPSILON && (k.normalize(), d = Math.acos(h.Math.clamp(e[m - 1].dot(e[m]), -1, 1)), f[m].applyMatrix4(l.makeRotationAxis(k, d))), g[m].crossVectors(e[m], f[m]); if (c) for (d = Math.acos(h.Math.clamp(f[0].dot(f[b - 1]), -1, 1)), d /= b - 1, 0 < e[0].dot(k.crossVectors(f[0], f[b - 1])) && (d = -d), m = 1; m < b; m++) f[m].applyMatrix4(l.makeRotationAxis(e[m], d * m)), g[m].crossVectors(e[m], f[m]) }; Jb.prototype = Object.create(I.prototype); Jb.prototype.constructor = Jb; oc.prototype = Object.create(R.prototype); oc.prototype.constructor = oc; Kb.prototype = Object.create(I.prototype); Kb.prototype.constructor = Kb; pc.prototype = Object.create(R.prototype); pc.prototype.constructor = pc; h.ShapeUtils = { area: function (a) { for (var b = a.length, c = 0, d = b - 1, e = 0; e < b; d = e++) c += a[d].x * a[e].y - a[e].x * a[d].y; return .5 * c }, triangulate: function () { return function (a, b) { var c = a.length; if (3 > c) return null; var d = [], e = [], f = [], g, k, l; if (0 < h.ShapeUtils.area(a)) for (k = 0; k < c; k++) e[k] = k; else for (k = 0; k < c; k++) e[k] = c - 1 - k; var m = 2 * c; for (k = c - 1; 2 < c; ) { if (0 >= m--) { console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()"); break } g = k; c <= g && (g = 0); k = g + 1; c <= k && (k = 0); l = k + 1; c <= l && (l = 0); var q; a: { var p, n, r, t, v, A, w, x; p = a[e[g]].x; n = a[e[g]].y; r = a[e[k]].x; t = a[e[k]].y; v = a[e[l]].x; A = a[e[l]].y; if (Number.EPSILON > (r - p) * (A - n) - (t - n) * (v - p)) q = !1; else { var C, y, F, G, E, J, D, z, I, H; C = v - r; y = A - t; F = p - v; G = n - A; E = r - p; J = t - n; for (q = 0; q < c; q++) if (w = a[e[q]].x, x = a[e[q]].y, !(w === p && x === n || w === r && x === t || w === v && x === A) && (D = w - p, z = x - n, I = w - r, H = x - t, w -= v, x -= A, I = C * H - y * I, D = E * z - J * D, z = F * x - G * w, I >= -Number.EPSILON && z >= -Number.EPSILON && D >= -Number.EPSILON)) { q = !1; break a } q = !0 } } if (q) { d.push([a[e[g]], a[e[k]], a[e[l]]]); f.push([e[g], e[k], e[l]]); g = k; for (l = k + 1; l < c; g++, l++) e[g] = e[l]; c--; m = 2 * c } } return b ? f : d } } (), triangulateShape: function (a, b) { function c(a) { var b = a.length; 2 < b && a[b - 1].equals(a[0]) && a.pop() } function d(a, b, c) { return a.x !== b.x ? a.x < b.x ? a.x <= c.x && c.x <= b.x : b.x <= c.x && c.x <= a.x : a.y < b.y ? a.y <= c.y && c.y <= b.y : b.y <= c.y && c.y <= a.y } function e(a, b, c, e, f) { var g = b.x - a.x, k = b.y - a.y, h = e.x - c.x, l = e.y - c.y, n = a.x - c.x, m = a.y - c.y, p = k * h - g * l, q = k * n - g * m; if (Math.abs(p) > Number.EPSILON) { if (0 < p) { if (0 > q || q > p) return []; h = l * n - h * m; if (0 > h || h > p) return [] } else { if (0 < q || q < p) return []; h = l * n - h * m; if (0 < h || h < p) return [] } if (0 === h) return !f || 0 !== q && q !== p ? [a] : []; if (h === p) return !f || 0 !== q && q !== p ? [b] : []; if (0 === q) return [c]; if (q === p) return [e]; f = h / p; return [{ x: a.x + f * g, y: a.y + f * k } ] } if (0 !== q || l * n !== h * m) return []; k = 0 === g && 0 === k; h = 0 === h && 0 === l; if (k && h) return a.x !== c.x || a.y !== c.y ? [] : [a]; if (k) return d(c, e, a) ? [a] : []; if (h) return d(a, b, c) ? [c] : []; 0 !== g ? (a.x < b.x ? (g = a, h = a.x, k = b, a = b.x) : (g = b, h = b.x, k = a, a = a.x), c.x < e.x ? (b = c, p = c.x, l = e, c = e.x) : (b = e, p = e.x, l = c, c = c.x)) : (a.y < b.y ? (g = a, h = a.y, k = b, a = b.y) : (g = b, h = b.y, k = a, a = a.y), c.y < e.y ? (b = c, p = c.y, l = e, c = e.y) : (b = e, p = e.y, l = c, c = c.y)); return h <= p ? a < p ? [] : a === p ? f ? [] : [b] : a <= c ? [b, k] : [b, l] : h > c ? [] : h === c ? f ? [] : [g] : a <= c ? [g, k] : [g, l] } function f(a, b, c, d) { var e = b.x - a.x, f = b.y - a.y; b = c.x - a.x; c = c.y - a.y; var g = d.x - a.x; d = d.y - a.y; a = e * c - f * b; e = e * d - f * g; return Math.abs(a) > Number.EPSILON ? (b = g * c - d * b, 0 < a ? 0 <= e && 0 <= b : 0 <= e || 0 <= b) : 0 < e } c(a); b.forEach(c); var g, k, l, m, q, p = {}; l = a.concat(); g = 0; for (k = b.length; g < k; g++) Array.prototype.push.apply(l, b[g]); g = 0; for (k = l.length; g < k; g++) q = l[g].x + ":" + l[g].y, void 0 !== p[q] && console.warn("THREE.ShapeUtils: Duplicate point", q, g), p[q] = g; g = function (a, b) { function c(a, b) { var d = k.length - 1, e = a - 1; 0 > e && (e = d); var g = a + 1; g > d && (g = 0); d = f(k[a], k[e], k[g], h[b]); if (!d) return !1; d = h.length - 1; e = b - 1; 0 > e && (e = d); g = b + 1; g > d && (g = 0); return (d = f(h[b], h[e], h[g], k[a])) ? !0 : !1 } function d(a, b) { var c, f; for (c = 0; c < k.length; c++) if (f = c + 1, f %= k.length, f = e(a, b, k[c], k[f], !0), 0 < f.length) return !0; return !1 } function g(a, c) { var d, f, k, h; for (d = 0; d < l.length; d++) for (f = b[l[d]], k = 0; k < f.length; k++) if (h = k + 1, h %= f.length, h = e(a, c, f[k], f[h], !0), 0 < h.length) return !0; return !1 } var k = a.concat(), h, l = [], n, m, p, q, u, C = [], D, z, I, H = 0; for (n = b.length; H < n; H++) l.push(H); D = 0; for (var L = 2 * l.length; 0 < l.length; ) { L--; if (0 > L) { console.log("Infinite Loop! Holes left:" + l.length + ", Probably Hole outside Shape!"); break } for (m = D; m < k.length; m++) { p = k[m]; n = -1; for (H = 0; H < l.length; H++) if (q = l[H], u = p.x + ":" + p.y + ":" + q, void 0 === C[u]) { h = b[q]; for (z = 0; z < h.length; z++) if (q = h[z], c(m, z) && !d(p, q) && !g(p, q)) { n = z; l.splice(H, 1); D = k.slice(0, m + 1); q = k.slice(m); z = h.slice(n); I = h.slice(0, n + 1); k = D.concat(z).concat(I).concat(q); D = m; break } if (0 <= n) break; C[u] = !0 } if (0 <= n) break } } return k } (a, b); var n = h.ShapeUtils.triangulate(g, !1); g = 0; for (k = n.length; g < k; g++) for (m = n[g], l = 0; 3 > l; l++) q = m[l].x + ":" + m[l].y, q = p[q], void 0 !== q && (m[l] = q); return n.concat() }, isClockWise: function (a) { return 0 > h.ShapeUtils.area(a) }, b2: function () { return function (a, b, c, d) { var e = 1 - a; return e * e * b + 2 * (1 - a) * a * c + a * a * d } } (), b3: function () { return function (a, b, c, d, e) { var f = 1 - a, g = 1 - a; return f * f * f * b + 3 * g * g * a * c + 3 * (1 - a) * a * a * d + a * a * a * e } } () }; ra.prototype = Object.create(R.prototype); ra.prototype.constructor = ra; ra.prototype.addShapeList = function (a, b) { for (var c = a.length, d = 0; d < c; d++) this.addShape(a[d], b) }; ra.prototype.addShape = function (a, b) { function c(a, b, c) { b || console.error("THREE.ExtrudeGeometry: vec does not exist"); return b.clone().multiplyScalar(c).add(a) } function d(a, b, c) { var d, e, f; e = a.x - b.x; f = a.y - b.y; d = c.x - a.x; var g = c.y - a.y, k = e * e + f * f; if (Math.abs(e * g - f * d) > Number.EPSILON) { var h = Math.sqrt(k), l = Math.sqrt(d * d + g * g), k = b.x - f / h; b = b.y + e / h; g = ((c.x - g / l - k) * g - (c.y + d / l - b) * d) / (e * g - f * d); d = k + e * g - a.x; e = b + f * g - a.y; f = d * d + e * e; if (2 >= f) return new C(d, e); f = Math.sqrt(f / 2) } else a = !1, e > Number.EPSILON ? d > Number.EPSILON && (a = !0) : e < -Number.EPSILON ? d < -Number.EPSILON && (a = !0) : Math.sign(f) === Math.sign(g) && (a = !0), a ? (d = -f, f = Math.sqrt(k)) : (d = e, e = f, f = Math.sqrt(k / 2)); return new C(d / f, e / f) } function e(a, b) { var c, d; for (K = a.length; 0 <= --K; ) { c = K; d = K - 1; 0 > d && (d = a.length - 1); var e, f = r + 2 * u; for (e = 0; e < f; e++) { var g = U * e, k = U * (e + 1), h = b + c + g, g = b + d + g, l = b + d + k, k = b + c + k, h = h + N, g = g + N, l = l + N, k = k + N; I.faces.push(new ga(h, g, k, null, null, 1)); I.faces.push(new ga(g, l, k, null, null, 1)); h = w.generateSideWallUV(I, h, g, l, k); I.faceVertexUvs[0].push([h[0], h[1], h[3]]); I.faceVertexUvs[0].push([h[1], h[2], h[3]]) } } } function f(a, b, c) { I.vertices.push(new q(a, b, c)) } function g(a, b, c) { a += N; b += N; c += N; I.faces.push(new ga(a, b, c, null, null, 0)); a = w.generateTopUV(I, a, b, c); I.faceVertexUvs[0].push(a) } var k = void 0 !== b.amount ? b.amount : 100, l = void 0 !== b.bevelThickness ? b.bevelThickness : 6, m = void 0 !== b.bevelSize ? b.bevelSize : l - 2, u = void 0 !== b.bevelSegments ? b.bevelSegments : 3, p = void 0 !== b.bevelEnabled ? b.bevelEnabled : !0, n = void 0 !== b.curveSegments ? b.curveSegments : 12, r = void 0 !== b.steps ? b.steps : 1, t = b.extrudePath, v, A = !1, w = void 0 !== b.UVGenerator ? b.UVGenerator : ra.WorldUVGenerator, x, D, y, F; t && (v = t.getSpacedPoints(r), A = !0, p = !1, x = void 0 !== b.frames ? b.frames : new wa.FrenetFrames(t, r, !1), D = new q, y = new q, F = new q); p || (m = l = u = 0); var G, E, z, I = this, N = this.vertices.length, t = a.extractPoints(n), n = t.shape, H = t.holes; if (t = !h.ShapeUtils.isClockWise(n)) { n = n.reverse(); E = 0; for (z = H.length; E < z; E++) G = H[E], h.ShapeUtils.isClockWise(G) && (H[E] = G.reverse()); t = !1 } var P = h.ShapeUtils.triangulateShape(n, H), S = n; E = 0; for (z = H.length; E < z; E++) G = H[E], n = n.concat(G); var R, L, M, O, Q, U = n.length, V, W = P.length, t = [], K = 0; M = S.length; R = M - 1; for (L = K + 1; K < M; K++, R++, L++) R === M && (R = 0), L === M && (L = 0), t[K] = d(S[K], S[R], S[L]); var Z = [], Y, ba = t.concat(); E = 0; for (z = H.length; E < z; E++) { G = H[E]; Y = []; K = 0; M = G.length; R = M - 1; for (L = K + 1; K < M; K++, R++, L++) R === M && (R = 0), L === M && (L = 0), Y[K] = d(G[K], G[R], G[L]); Z.push(Y); ba = ba.concat(Y) } for (R = 0; R < u; R++) { M = R / u; O = l * Math.cos(M * Math.PI / 2); L = m * Math.sin(M * Math.PI / 2); K = 0; for (M = S.length; K < M; K++) Q = c(S[K], t[K], L), f(Q.x, Q.y, -O); E = 0; for (z = H.length; E < z; E++) for (G = H[E], Y = Z[E], K = 0, M = G.length; K < M; K++) Q = c(G[K], Y[K], L), f(Q.x, Q.y, -O) } L = m; for (K = 0; K < U; K++) Q = p ? c(n[K], ba[K], L) : n[K], A ? (y.copy(x.normals[0]).multiplyScalar(Q.x), D.copy(x.binormals[0]).multiplyScalar(Q.y), F.copy(v[0]).add(y).add(D), f(F.x, F.y, F.z)) : f(Q.x, Q.y, 0); for (M = 1; M <= r; M++) for (K = 0; K < U; K++) Q = p ? c(n[K], ba[K], L) : n[K], A ? (y.copy(x.normals[M]).multiplyScalar(Q.x), D.copy(x.binormals[M]).multiplyScalar(Q.y), F.copy(v[M]).add(y).add(D), f(F.x, F.y, F.z)) : f(Q.x, Q.y, k / r * M); for (R = u - 1; 0 <= R; R--) { M = R / u; O = l * Math.cos(M * Math.PI / 2); L = m * Math.sin(M * Math.PI / 2); K = 0; for (M = S.length; K < M; K++) Q = c(S[K], t[K], L), f(Q.x, Q.y, k + O); E = 0; for (z = H.length; E < z; E++) for (G = H[E], Y = Z[E], K = 0, M = G.length; K < M; K++) Q = c(G[K], Y[K], L), A ? f(Q.x, Q.y + v[r - 1].y, v[r - 1].x + O) : f(Q.x, Q.y, k + O) } (function () { if (p) { var a = 0 * U; for (K = 0; K < W; K++) V = P[K], g(V[2] + a, V[1] + a, V[0] + a); a = U * (r + 2 * u); for (K = 0; K < W; K++) V = P[K], g(V[0] + a, V[1] + a, V[2] + a) } else { for (K = 0; K < W; K++) V = P[K], g(V[2], V[1], V[0]); for (K = 0; K < W; K++) V = P[K], g(V[0] + U * r, V[1] + U * r, V[2] + U * r) } })(); (function () { var a = 0; e(S, a); a += S.length; E = 0; for (z = H.length; E < z; E++) G = H[E], e(G, a), a += G.length })() }; ra.WorldUVGenerator = { generateTopUV: function (a, b, c, d) { a = a.vertices; b = a[b]; c = a[c]; d = a[d]; return [new C(b.x, b.y), new C(c.x, c.y), new C(d.x, d.y)] }, generateSideWallUV: function (a, b, c, d, e) { a = a.vertices; b = a[b]; c = a[c]; d = a[d]; e = a[e]; return .01 > Math.abs(b.y - c.y) ? [new C(b.x, 1 - b.z), new C(c.x, 1 - c.z), new C(d.x, 1 - d.z), new C(e.x, 1 - e.z)] : [new C(b.y, 1 - b.z), new C(c.y, 1 - c.z), new C(d.y, 1 - d.z), new C(e.y, 1 - e.z)] } }; qc.prototype = Object.create(ra.prototype); qc.prototype.constructor = qc; ib.prototype = Object.create(I.prototype); ib.prototype.constructor = ib; Lb.prototype = Object.create(R.prototype); Lb.prototype.constructor = Lb; Mb.prototype = Object.create(I.prototype); Mb.prototype.constructor = Mb; rc.prototype = Object.create(R.prototype); rc.prototype.constructor = rc; sc.prototype = Object.create(R.prototype); sc.prototype.constructor = sc; Nb.prototype = Object.create(I.prototype); Nb.prototype.constructor = Nb; tc.prototype = Object.create(R.prototype); tc.prototype.constructor = tc; Ya.prototype = Object.create(R.prototype); Ya.prototype.constructor = Ya; Ya.prototype.addShapeList = function (a, b) { for (var c = 0, d = a.length; c < d; c++) this.addShape(a[c], b); return this }; Ya.prototype.addShape = function (a, b) { void 0 === b && (b = {}); var c = b.material, d = void 0 === b.UVGenerator ? ra.WorldUVGenerator : b.UVGenerator, e, f, g, k = this.vertices.length; e = a.extractPoints(void 0 !== b.curveSegments ? b.curveSegments : 12); var l = e.shape, m = e.holes; if (!h.ShapeUtils.isClockWise(l)) for (l = l.reverse(), e = 0, f = m.length; e < f; e++) g = m[e], h.ShapeUtils.isClockWise(g) && (m[e] = g.reverse()); var u = h.ShapeUtils.triangulateShape(l, m); e = 0; for (f = m.length; e < f; e++) g = m[e], l = l.concat(g); m = l.length; f = u.length; for (e = 0; e < m; e++) g = l[e], this.vertices.push(new q(g.x, g.y, 0)); for (e = 0; e < f; e++) m = u[e], l = m[0] + k, g = m[1] + k, m = m[2] + k, this.faces.push(new ga(l, g, m, null, null, c)), this.faceVertexUvs[0].push(d.generateTopUV(this, l, g, m)) }; Ob.prototype = Object.create(I.prototype); Ob.prototype.constructor = Ob; Za.prototype = Object.create(I.prototype); Za.prototype.constructor = Za; jb.prototype = Object.create(R.prototype); jb.prototype.constructor = jb; uc.prototype = Object.create(jb.prototype); uc.prototype.constructor = uc; vc.prototype = Object.create(I.prototype); vc.prototype.constructor = vc; Pb.prototype = Object.create(I.prototype); Pb.prototype.constructor = Pb; wc.prototype = Object.create(R.prototype); wc.prototype.constructor = wc; kb.prototype = Object.create(R.prototype); kb.prototype.constructor = kb; var ua = Object.freeze({ WireframeGeometry: Ib, ParametricGeometry: jc, TetrahedronGeometry: kc, OctahedronGeometry: lc, IcosahedronGeometry: mc, DodecahedronGeometry: nc, PolyhedronGeometry: sa, TubeGeometry: wa, TorusKnotGeometry: oc, TorusKnotBufferGeometry: Jb, TorusGeometry: pc, TorusBufferGeometry: Kb, TextGeometry: qc, SphereBufferGeometry: ib, SphereGeometry: Lb, RingGeometry: rc, RingBufferGeometry: Mb, PlaneBufferGeometry: eb, PlaneGeometry: sc, LatheGeometry: tc, LatheBufferGeometry: Nb, ShapeGeometry: Ya, ExtrudeGeometry: ra, EdgesGeometry: Ob, ConeGeometry: uc, ConeBufferGeometry: vc, CylinderGeometry: jb, CylinderBufferGeometry: Za, CircleBufferGeometry: Pb, CircleGeometry: wc, BoxBufferGeometry: db, BoxGeometry: kb }); Qb.prototype = Object.create(Da.prototype); Qb.prototype.constructor = Qb; Qb.prototype.isShadowMaterial = !0; Rb.prototype = Object.create(Da.prototype); Rb.prototype.constructor = Rb; Rb.prototype.isRawShaderMaterial = !0; xc.prototype = { constructor: xc, isMultiMaterial: !0, toJSON: function (a) { for (var b = { metadata: { version: 4.2, type: "material", generator: "MaterialExporter" }, uuid: this.uuid, type: this.type, materials: [] }, c = this.materials, d = 0, e = c.length; d < e; d++) { var f = c[d].toJSON(a); delete f.metadata; b.materials.push(f) } b.visible = this.visible; return b }, clone: function () { for (var a = new this.constructor, b = 0; b < this.materials.length; b++) a.materials.push(this.materials[b].clone()); a.visible = this.visible; return a } }; Ka.prototype = Object.create(S.prototype); Ka.prototype.constructor = Ka; Ka.prototype.isMeshStandardMaterial = !0; Ka.prototype.copy = function (a) { S.prototype.copy.call(this, a); this.defines = { STANDARD: "" }; this.color.copy(a.color); this.roughness = a.roughness; this.metalness = a.metalness; this.map = a.map; this.lightMap = a.lightMap; this.lightMapIntensity = a.lightMapIntensity; this.aoMap = a.aoMap; this.aoMapIntensity = a.aoMapIntensity; this.emissive.copy(a.emissive); this.emissiveMap = a.emissiveMap; this.emissiveIntensity = a.emissiveIntensity; this.bumpMap = a.bumpMap; this.bumpScale = a.bumpScale; this.normalMap = a.normalMap; this.normalScale.copy(a.normalScale); this.displacementMap = a.displacementMap; this.displacementScale = a.displacementScale; this.displacementBias = a.displacementBias; this.roughnessMap = a.roughnessMap; this.metalnessMap = a.metalnessMap; this.alphaMap = a.alphaMap; this.envMap = a.envMap; this.envMapIntensity = a.envMapIntensity; this.refractionRatio = a.refractionRatio; this.wireframe = a.wireframe; this.wireframeLinewidth = a.wireframeLinewidth; this.wireframeLinecap = a.wireframeLinecap; this.wireframeLinejoin = a.wireframeLinejoin; this.skinning = a.skinning; this.morphTargets = a.morphTargets; this.morphNormals = a.morphNormals; return this }; lb.prototype = Object.create(Ka.prototype); lb.prototype.constructor = lb; lb.prototype.isMeshPhysicalMaterial = !0; lb.prototype.copy = function (a) { Ka.prototype.copy.call(this, a); this.defines = { PHYSICAL: "" }; this.reflectivity = a.reflectivity; this.clearCoat = a.clearCoat; this.clearCoatRoughness = a.clearCoatRoughness; return this }; $a.prototype = Object.create(S.prototype); $a.prototype.constructor = $a; $a.prototype.isMeshPhongMaterial = !0; $a.prototype.copy = function (a) { S.prototype.copy.call(this, a); this.color.copy(a.color); this.specular.copy(a.specular); this.shininess = a.shininess; this.map = a.map; this.lightMap = a.lightMap; this.lightMapIntensity = a.lightMapIntensity; this.aoMap = a.aoMap; this.aoMapIntensity = a.aoMapIntensity; this.emissive.copy(a.emissive); this.emissiveMap = a.emissiveMap; this.emissiveIntensity = a.emissiveIntensity; this.bumpMap = a.bumpMap; this.bumpScale = a.bumpScale; this.normalMap = a.normalMap; this.normalScale.copy(a.normalScale); this.displacementMap = a.displacementMap; this.displacementScale = a.displacementScale; this.displacementBias = a.displacementBias; this.specularMap = a.specularMap; this.alphaMap = a.alphaMap; this.envMap = a.envMap; this.combine = a.combine; this.reflectivity = a.reflectivity; this.refractionRatio = a.refractionRatio; this.wireframe = a.wireframe; this.wireframeLinewidth = a.wireframeLinewidth; this.wireframeLinecap = a.wireframeLinecap; this.wireframeLinejoin = a.wireframeLinejoin; this.skinning = a.skinning; this.morphTargets = a.morphTargets; this.morphNormals = a.morphNormals; return this }; mb.prototype = Object.create(S.prototype); mb.prototype.constructor = mb; mb.prototype.isMeshNormalMaterial = !0; mb.prototype.copy = function (a) { S.prototype.copy.call(this, a); this.wireframe = a.wireframe; this.wireframeLinewidth = a.wireframeLinewidth; return this }; nb.prototype = Object.create(S.prototype); nb.prototype.constructor = nb; nb.prototype.isMeshLambertMaterial = !0; nb.prototype.copy = function (a) { S.prototype.copy.call(this, a); this.color.copy(a.color); this.map = a.map; this.lightMap = a.lightMap; this.lightMapIntensity = a.lightMapIntensity; this.aoMap = a.aoMap; this.aoMapIntensity = a.aoMapIntensity; this.emissive.copy(a.emissive); this.emissiveMap = a.emissiveMap; this.emissiveIntensity = a.emissiveIntensity; this.specularMap = a.specularMap; this.alphaMap = a.alphaMap; this.envMap = a.envMap; this.combine = a.combine; this.reflectivity = a.reflectivity; this.refractionRatio = a.refractionRatio; this.wireframe = a.wireframe; this.wireframeLinewidth = a.wireframeLinewidth; this.wireframeLinecap = a.wireframeLinecap; this.wireframeLinejoin = a.wireframeLinejoin; this.skinning = a.skinning; this.morphTargets = a.morphTargets; this.morphNormals = a.morphNormals; return this }; ob.prototype = Object.create(S.prototype); ob.prototype.constructor = ob; ob.prototype.isLineDashedMaterial = !0; ob.prototype.copy = function (a) { S.prototype.copy.call(this, a); this.color.copy(a.color); this.linewidth = a.linewidth; this.scale = a.scale; this.dashSize = a.dashSize; this.gapSize = a.gapSize; return this }; var nf = Object.freeze({ ShadowMaterial: Qb, SpriteMaterial: gb, RawShaderMaterial: Rb, ShaderMaterial: Da, PointsMaterial: Ja, MultiMaterial: xc, MeshPhysicalMaterial: lb, MeshStandardMaterial: Ka, MeshPhongMaterial: $a, MeshNormalMaterial: mb, MeshLambertMaterial: nb, MeshDepthMaterial: Ua, MeshBasicMaterial: Ia, LineDashedMaterial: ob, LineBasicMaterial: na, Material: S }); h.Cache = { enabled: !1, files: {}, add: function (a, b) { !1 !== this.enabled && (this.files[a] = b) }, get: function (a) { if (!1 !== this.enabled) return this.files[a] }, remove: function (a) { delete this.files[a] }, clear: function () { this.files = {} } }; h.DefaultLoadingManager = new qd; Object.assign(za.prototype, { load: function (a, b, c, d) { void 0 !== this.path && (a = this.path + a); var e = this, f = h.Cache.get(a); if (void 0 !== f) return e.manager.itemStart(a), setTimeout(function () { b && b(f); e.manager.itemEnd(a) }, 0), f; var g = new XMLHttpRequest; g.open("GET", a, !0); g.addEventListener("load", function (c) { var f = c.target.response; h.Cache.add(a, f); 200 === this.status ? (b && b(f), e.manager.itemEnd(a)) : 0 === this.status ? (console.warn("THREE.XHRLoader: HTTP Status 0 received."), b && b(f), e.manager.itemEnd(a)) : (d && d(c), e.manager.itemError(a)) }, !1); void 0 !== c && g.addEventListener("progress", function (a) { c(a) }, !1); g.addEventListener("error", function (b) { d && d(b); e.manager.itemError(a) }, !1); void 0 !== this.responseType && (g.responseType = this.responseType); void 0 !== this.withCredentials && (g.withCredentials = this.withCredentials); g.overrideMimeType && g.overrideMimeType("text/plain"); g.send(null); e.manager.itemStart(a); return g }, setPath: function (a) { this.path = a; return this }, setResponseType: function (a) { this.responseType = a; return this }, setWithCredentials: function (a) { this.withCredentials = a; return this } }); Object.assign(ie.prototype, { load: function (a, b, c, d) { function e(e) { h.load(a[e], function (a) { a = f._parser(a, !0); g[e] = { width: a.width, height: a.height, format: a.format, mipmaps: a.mipmaps }; m += 1; 6 === m && (1 === a.mipmapCount && (k.minFilter = 1006), k.format = a.format, k.needsUpdate = !0, b && b(k)) }, c, d) } var f = this, g = [], k = new Hb; k.image = g; var h = new za(this.manager); h.setPath(this.path); h.setResponseType("arraybuffer"); if (Array.isArray(a)) for (var m = 0, q = 0, p = a.length; q < p; ++q) e(q); else h.load(a, function (a) { a = f._parser(a, !0); if (a.isCubemap) for (var c = a.mipmaps.length / a.mipmapCount, d = 0; d < c; d++) { g[d] = { mipmaps: [] }; for (var e = 0; e < a.mipmapCount; e++) g[d].mipmaps.push(a.mipmaps[d * a.mipmapCount + e]), g[d].format = a.format, g[d].width = a.width, g[d].height = a.height } else k.image.width = a.width, k.image.height = a.height, k.mipmaps = a.mipmaps; 1 === a.mipmapCount && (k.minFilter = 1006); k.format = a.format; k.needsUpdate = !0; b && b(k) }, c, d); return k }, setPath: function (a) { this.path = a; return this } }); Object.assign(rd.prototype, { load: function (a, b, c, d) { var e = this, f = new hb, g = new za(this.manager); g.setResponseType("arraybuffer"); g.load(a, function (a) { if (a = e._parser(a)) void 0 !== a.image ? f.image = a.image : void 0 !== a.data && (f.image.width = a.width, f.image.height = a.height, f.image.data = a.data), f.wrapS = void 0 !== a.wrapS ? a.wrapS : 1001, f.wrapT = void 0 !== a.wrapT ? a.wrapT : 1001, f.magFilter = void 0 !== a.magFilter ? a.magFilter : 1006, f.minFilter = void 0 !== a.minFilter ? a.minFilter : 1008, f.anisotropy = void 0 !== a.anisotropy ? a.anisotropy : 1, void 0 !== a.format && (f.format = a.format), void 0 !== a.type && (f.type = a.type), void 0 !== a.mipmaps && (f.mipmaps = a.mipmaps), 1 === a.mipmapCount && (f.minFilter = 1006), f.needsUpdate = !0, b && b(f, a) }, c, d); return f } }); Object.assign(yc.prototype, { load: function (a, b, c, d) { var e = this, f = document.createElementNS("http://www.w3.org/1999/xhtml", "img"); f.onload = function () { f.onload = null; URL.revokeObjectURL(f.src); b && b(f); e.manager.itemEnd(a) }; if (0 === a.indexOf("data:")) f.src = a; else { var g = new za; g.setPath(this.path); g.setResponseType("blob"); g.setWithCredentials(this.withCredentials); g.load(a, function (a) { f.src = URL.createObjectURL(a) }, c, d) } e.manager.itemStart(a); return f }, setCrossOrigin: function (a) { this.crossOrigin = a; return this }, setWithCredentials: function (a) { this.withCredentials = a; return this }, setPath: function (a) { this.path = a; return this } }); Object.assign(sd.prototype, { load: function (a, b, c, d) { function e(c) { g.load(a[c], function (a) { f.images[c] = a; k++; 6 === k && (f.needsUpdate = !0, b && b(f)) }, void 0, d) } var f = new Ta, g = new yc(this.manager); g.setCrossOrigin(this.crossOrigin); g.setPath(this.path); var k = 0; for (c = 0; c < a.length; ++c) e(c); return f }, setCrossOrigin: function (a) { this.crossOrigin = a; return this }, setPath: function (a) { this.path = a; return this } }); Object.assign(Sc.prototype, { load: function (a, b, c, d) { var e = new ba, f = new yc(this.manager); f.setCrossOrigin(this.crossOrigin); f.setWithCredentials(this.withCredentials); f.setPath(this.path); f.load(a, function (c) { var d = 0 < a.search(/\.(jpg|jpeg)$/) || 0 === a.search(/^data\:image\/jpeg/); e.format = d ? 1022 : 1023; e.image = c; e.needsUpdate = !0; void 0 !== b && b(e) }, c, d); return e }, setCrossOrigin: function (a) { this.crossOrigin = a; return this }, setWithCredentials: function (a) { this.withCredentials = a; return this }, setPath: function (a) { this.path = a; return this } }); oa.prototype = Object.assign(Object.create(D.prototype), { constructor: oa, isLight: !0, copy: function (a) { D.prototype.copy.call(this, a); this.color.copy(a.color); this.intensity = a.intensity; return this }, toJSON: function (a) { a = D.prototype.toJSON.call(this, a); a.object.color = this.color.getHex(); a.object.intensity = this.intensity; void 0 !== this.groundColor && (a.object.groundColor = this.groundColor.getHex()); void 0 !== this.distance && (a.object.distance = this.distance); void 0 !== this.angle && (a.object.angle = this.angle); void 0 !== this.decay && (a.object.decay = this.decay); void 0 !== this.penumbra && (a.object.penumbra = this.penumbra); void 0 !== this.shadow && (a.object.shadow = this.shadow.toJSON()); return a } }); Tc.prototype = Object.assign(Object.create(oa.prototype), { constructor: Tc, isHemisphereLight: !0, copy: function (a) { oa.prototype.copy.call(this, a); this.groundColor.copy(a.groundColor); return this } }); Object.assign(pb.prototype, { copy: function (a) { this.camera = a.camera.clone(); this.bias = a.bias; this.radius = a.radius; this.mapSize.copy(a.mapSize); return this }, clone: function () { return (new this.constructor).copy(this) }, toJSON: function () { var a = {}; 0 !== this.bias && (a.bias = this.bias); 1 !== this.radius && (a.radius = this.radius); if (512 !== this.mapSize.x || 512 !== this.mapSize.y) a.mapSize = this.mapSize.toArray(); a.camera = this.camera.toJSON(!1).object; delete a.camera.matrix; return a } }); Uc.prototype = Object.assign(Object.create(pb.prototype), { constructor: Uc, isSpotLightShadow: !0, update: function (a) { var b = 2 * h.Math.RAD2DEG * a.angle, c = this.mapSize.width / this.mapSize.height; a = a.distance || 500; var d = this.camera; if (b !== d.fov || c !== d.aspect || a !== d.far) d.fov = b, d.aspect = c, d.far = a, d.updateProjectionMatrix() } }); Vc.prototype = Object.assign(Object.create(oa.prototype), { constructor: Vc, isSpotLight: !0, copy: function (a) { oa.prototype.copy.call(this, a); this.distance = a.distance; this.angle = a.angle; this.penumbra = a.penumbra; this.decay = a.decay; this.target = a.target.clone(); this.shadow = a.shadow.clone(); return this } }); Wc.prototype = Object.assign(Object.create(oa.prototype), { constructor: Wc, isPointLight: !0, copy: function (a) { oa.prototype.copy.call(this, a); this.distance = a.distance; this.decay = a.decay; this.shadow = a.shadow.clone(); return this } }); Xc.prototype = Object.assign(Object.create(pb.prototype), { constructor: Xc }); Yc.prototype = Object.assign(Object.create(oa.prototype), { constructor: Yc, isDirectionalLight: !0, copy: function (a) { oa.prototype.copy.call(this, a); this.target = a.target.clone(); this.shadow = a.shadow.clone(); return this } }); Zc.prototype = Object.assign(Object.create(oa.prototype), { constructor: Zc, isAmbientLight: !0 }); h.AnimationUtils = { arraySlice: function (a, b, c) { return h.AnimationUtils.isTypedArray(a) ? new a.constructor(a.subarray(b, c)) : a.slice(b, c) }, convertArray: function (a, b, c) { return !a || !c && a.constructor === b ? a : "number" === typeof b.BYTES_PER_ELEMENT ? new b(a) : Array.prototype.slice.call(a) }, isTypedArray: function (a) { return ArrayBuffer.isView(a) && !(a instanceof DataView) }, getKeyframeOrder: function (a) { for (var b = a.length, c = Array(b), d = 0; d !== b; ++d) c[d] = d; c.sort(function (b, c) { return a[b] - a[c] }); return c }, sortedArray: function (a, b, c) { for (var d = a.length, e = new a.constructor(d), f = 0, g = 0; g !== d; ++f) for (var k = c[f] * b, h = 0; h !== b; ++h) e[g++] = a[k + h]; return e }, flattenJSON: function (a, b, c, d) { for (var e = 1, f = a[0]; void 0 !== f && void 0 === f[d]; ) f = a[e++]; if (void 0 !== f) { var g = f[d]; if (void 0 !== g) if (Array.isArray(g)) { do g = f[d], void 0 !== g && (b.push(f.time), c.push.apply(c, g)), f = a[e++]; while (void 0 !== f) } else if (void 0 !== g.toArray) { do g = f[d], void 0 !== g && (b.push(f.time), g.toArray(c, c.length)), f = a[e++]; while (void 0 !== f) } else { do g = f[d], void 0 !== g && (b.push(f.time), c.push(g)), f = a[e++]; while (void 0 !== f) } } } }; ja.prototype = { constructor: ja, evaluate: function (a) { var b = this.parameterPositions, c = this._cachedIndex, d = b[c], e = b[c - 1]; a: { b: { c: { d: if (!(a < d)) { for (var f = c + 2; ; ) { if (void 0 === d) { if (a < e) break d; this._cachedIndex = c = b.length; return this.afterEnd_(c - 1, a, e) } if (c === f) break; e = d; d = b[++c]; if (a < d) break b } d = b.length; break c } if (a >= e) break a; else { f = b[1]; a < f && (c = 2, e = f); for (f = c - 2; ; ) { if (void 0 === e) return this._cachedIndex = 0, this.beforeStart_(0, a, d); if (c === f) break; d = e; e = b[--c - 1]; if (a >= e) break b } d = c; c = 0 } } for (; c < d; ) e = c + d >>> 1, a < b[e] ? d = e : c = e + 1; d = b[c]; e = b[c - 1]; if (void 0 === e) return this._cachedIndex = 0, this.beforeStart_(0, a, d); if (void 0 === d) return this._cachedIndex = c = b.length, this.afterEnd_(c - 1, e, a) } this._cachedIndex = c; this.intervalChanged_(c, e, d) } return this.interpolate_(c, e, a, d) }, settings: null, DefaultSettings_: {}, getSettings_: function () { return this.settings || this.DefaultSettings_ }, copySampleValue_: function (a) { var b = this.resultBuffer, c = this.sampleValues, d = this.valueSize; a *= d; for (var e = 0; e !== d; ++e) b[e] = c[a + e]; return b }, interpolate_: function (a, b, c, d) { throw Error("call to abstract method"); }, intervalChanged_: function (a, b, c) {} }; Object.assign(ja.prototype, { beforeStart_: ja.prototype.copySampleValue_, afterEnd_: ja.prototype.copySampleValue_ }); $c.prototype = Object.assign(Object.create(ja.prototype), { constructor: $c, DefaultSettings_: { endingStart: 2400, endingEnd: 2400 }, intervalChanged_: function (a, b, c) { var d = this.parameterPositions, e = a - 2, f = a + 1, g = d[e], k = d[f]; if (void 0 === g) switch (this.getSettings_().endingStart) { case 2401: e = a; g = 2 * b - c; break; case 2402: e = d.length - 2; g = b + d[e] - d[e + 1]; break; default: e = a, g = c } if (void 0 === k) switch (this.getSettings_().endingEnd) { case 2401: f = a; k = 2 * c - b; break; case 2402: f = 1; k = c + d[1] - d[0]; break; default: f = a - 1, k = b } a = .5 * (c - b); d = this.valueSize; this._weightPrev = a / (b - g); this._weightNext = a / (k - c); this._offsetPrev = e * d; this._offsetNext = f * d }, interpolate_: function (a, b, c, d) { var e = this.resultBuffer, f = this.sampleValues, g = this.valueSize; a *= g; var k = a - g, h = this._offsetPrev, m = this._offsetNext, q = this._weightPrev, p = this._weightNext, n = (c - b) / (d - b); c = n * n; d = c * n; b = -q * d + 2 * q * c - q * n; q = (1 + q) * d + (-1.5 - 2 * q) * c + ( - .5 + q) * n + 1; n = (-1 - p) * d + (1.5 + p) * c + .5 * n; p = p * d - p * c; for (c = 0; c !== g; ++c) e[c] = b * f[h + c] + q * f[k + c] + n * f[a + c] + p * f[m + c]; return e } }); zc.prototype = Object.assign(Object.create(ja.prototype), { constructor: zc, interpolate_: function (a, b, c, d) { var e = this.resultBuffer, f = this.sampleValues, g = this.valueSize; a *= g; var k = a - g; b = (c - b) / (d - b); c = 1 - b; for (d = 0; d !== g; ++d) e[d] = f[k + d] * c + f[a + d] * b; return e } }); ad.prototype = Object.assign(Object.create(ja.prototype), { constructor: ad, interpolate_: function (a, b, c, d) { return this.copySampleValue_(a - 1) } }); var Sa; Sa = { TimeBufferType: Float32Array, ValueBufferType: Float32Array, DefaultInterpolation: 2301, InterpolantFactoryMethodDiscrete: function (a) { return new ad(this.times, this.values, this.getValueSize(), a) }, InterpolantFactoryMethodLinear: function (a) { return new zc(this.times, this.values, this.getValueSize(), a) }, InterpolantFactoryMethodSmooth: function (a) { return new $c(this.times, this.values, this.getValueSize(), a) }, setInterpolation: function (a) { var b; switch (a) { case 2300: b = this.InterpolantFactoryMethodDiscrete; break; case 2301: b = this.InterpolantFactoryMethodLinear; break; case 2302: b = this.InterpolantFactoryMethodSmooth } if (void 0 === b) { b = "unsupported interpolation for " + this.ValueTypeName + " keyframe track named " + this.name; if (void 0 === this.createInterpolant) if (a !== this.DefaultInterpolation) this.setInterpolation(this.DefaultInterpolation); else throw Error(b); console.warn(b) } else this.createInterpolant = b }, getInterpolation: function () { switch (this.createInterpolant) { case this.InterpolantFactoryMethodDiscrete: return 2300; case this.InterpolantFactoryMethodLinear: return 2301; case this.InterpolantFactoryMethodSmooth: return 2302 } }, getValueSize: function () { return this.values.length / this.times.length }, shift: function (a) { if (0 !== a) for (var b = this.times, c = 0, d = b.length; c !== d; ++c) b[c] += a; return this }, scale: function (a) { if (1 !== a) for (var b = this.times, c = 0, d = b.length; c !== d; ++c) b[c] *= a; return this }, trim: function (a, b) { for (var c = this.times, d = c.length, e = 0, f = d - 1; e !== d && c[e] < a; ) ++e; for (; -1 !== f && c[f] > b; ) --f; ++f; if (0 !== e || f !== d) e >= f && (f = Math.max(f, 1), e = f - 1), d = this.getValueSize(), this.times = h.AnimationUtils.arraySlice(c, e, f), this.values = h.AnimationUtils.arraySlice(this.values, e * d, f * d); return this }, validate: function () { var a = !0, b = this.getValueSize(); 0 !== b - Math.floor(b) && (console.error("invalid value size in track", this), a = !1); var c = this.times, b = this.values, d = c.length; 0 === d && (console.error("track is empty", this), a = !1); for (var e = null, f = 0; f !== d; f++) { var g = c[f]; if ("number" === typeof g && isNaN(g)) { console.error("time is not a valid number", this, f, g); a = !1; break } if (null !== e && e > g) { console.error("out of order keys", this, f, g, e); a = !1; break } e = g } if (void 0 !== b && h.AnimationUtils.isTypedArray(b)) for (f = 0, c = b.length; f !== c; ++f) if (d = b[f], isNaN(d)) { console.error("value is not a valid number", this, f, d); a = !1; break } return a }, optimize: function () { for (var a = this.times, b = this.values, c = this.getValueSize(), d = 2302 === this.getInterpolation(), e = 1, f = a.length - 1, g = 1; g < f; ++g) { var k = !1, l = a[g]; if (l !== a[g + 1] && (1 !== g || l !== l[0])) if (d) k = !0; else for (var m = g * c, q = m - c, p = m + c, l = 0; l !== c; ++l) { var n = b[m + l]; if (n !== b[q + l] || n !== b[p + l]) { k = !0; break } } if (k) { if (g !== e) for (a[e] = a[g], k = g * c, m = e * c, l = 0; l !== c; ++l) b[m + l] = b[k + l]; ++e } } if (0 < f) { a[e] = a[f]; k = f * c; m = e * c; for (l = 0; l !== c; ++l) b[m + l] = b[k + l]; ++e } e !== a.length && (this.times = h.AnimationUtils.arraySlice(a, 0, e), this.values = h.AnimationUtils.arraySlice(b, 0, e * c)); return this } }; Sb.prototype = Object.assign(Object.create(Sa), { constructor: Sb, ValueTypeName: "vector" }); bd.prototype = Object.assign(Object.create(ja.prototype), { constructor: bd, interpolate_: function (a, b, c, d) { var e = this.resultBuffer, f = this.sampleValues, g = this.valueSize; a *= g; b = (c - b) / (d - b); for (c = a + g; a !== c; a += 4) ca.slerpFlat(e, 0, f, a - g, f, a, b); return e } }); Ac.prototype = Object.assign(Object.create(Sa), { constructor: Ac, ValueTypeName: "quaternion", DefaultInterpolation: 2301, InterpolantFactoryMethodLinear: function (a) { return new bd(this.times, this.values, this.getValueSize(), a) }, InterpolantFactoryMethodSmooth: void 0 }); Tb.prototype = Object.assign(Object.create(Sa), { constructor: Tb, ValueTypeName: "number" }); cd.prototype = Object.assign(Object.create(Sa), { constructor: cd, ValueTypeName: "string", ValueBufferType: Array, DefaultInterpolation: 2300, InterpolantFactoryMethodLinear: void 0, InterpolantFactoryMethodSmooth: void 0 }); dd.prototype = Object.assign(Object.create(Sa), { constructor: dd, ValueTypeName: "bool", ValueBufferType: Array, DefaultInterpolation: 2300, InterpolantFactoryMethodLinear: void 0, InterpolantFactoryMethodSmooth: void 0 }); ed.prototype = Object.assign(Object.create(Sa), { constructor: ed, ValueTypeName: "color" }); rb.prototype = Sa; Sa.constructor = rb; Object.assign(rb, { parse: function (a) { if (void 0 === a.type) throw Error("track type undefined, can not parse"); var b = rb._getTrackTypeForValueTypeName(a.type); if (void 0 === a.times) { var c = [], d = []; h.AnimationUtils.flattenJSON(a.keys, c, d, "value"); a.times = c; a.values = d } return void 0 !== b.parse ? b.parse(a) : new b(a.name, a.times, a.values, a.interpolation) }, toJSON: function (a) { var b = a.constructor; if (void 0 !== b.toJSON) b = b.toJSON(a); else { var b = { name: a.name, times: h.AnimationUtils.convertArray(a.times, Array), values: h.AnimationUtils.convertArray(a.values, Array) }, c = a.getInterpolation(); c !== a.DefaultInterpolation && (b.interpolation = c) } b.type = a.ValueTypeName; return b }, _getTrackTypeForValueTypeName: function (a) { switch (a.toLowerCase()) { case "scalar": case "double": case "float": case "number": case "integer": return Tb; case "vector": case "vector2": case "vector3": case "vector4": return Sb; case "color": return ed; case "quaternion": return Ac; case "bool": case "boolean": return dd; case "string": return cd } throw Error("Unsupported typeName: " + a); } }); ta.prototype = { constructor: ta, resetDuration: function () { for (var a = 0, b = 0, c = this.tracks.length; b !== c; ++b) var d = this.tracks[b], a = Math.max(a, d.times[d.times.length - 1]); this.duration = a }, trim: function () { for (var a = 0; a < this.tracks.length; a++) this.tracks[a].trim(0, this.duration); return this }, optimize: function () { for (var a = 0; a < this.tracks.length; a++) this.tracks[a].optimize(); return this } }; Object.assign(ta, { parse: function (a) { for (var b = [], c = a.tracks, d = 1 / (a.fps || 1), e = 0, f = c.length; e !== f; ++e) b.push(rb.parse(c[e]).scale(d)); return new ta(a.name, a.duration, b) }, toJSON: function (a) { var b = [], c = a.tracks; a = { name: a.name, duration: a.duration, tracks: b }; for (var d = 0, e = c.length; d !== e; ++d) b.push(rb.toJSON(c[d])); return a }, CreateFromMorphTargetSequence: function (a, b, c, d) { for (var e = b.length, f = [], g = 0; g < e; g++) { var k = [], l = []; k.push((g + e - 1) % e, g, (g + 1) % e); l.push(0, 1, 0); var m = h.AnimationUtils.getKeyframeOrder(k), k = h.AnimationUtils.sortedArray(k, 1, m), l = h.AnimationUtils.sortedArray(l, 1, m); d || 0 !== k[0] || (k.push(e), l.push(l[0])); f.push((new Tb(".morphTargetInfluences[" + b[g].name + "]", k, l)).scale(1 / c)) } return new ta(a, -1, f) }, findByName: function (a, b) { var c = a; Array.isArray(a) || (c = a.geometry && a.geometry.animations || a.animations); for (var d = 0; d < c.length; d++) if (c[d].name === b) return c[d]; return null }, CreateClipsFromMorphTargetSequences: function (a, b, c) { for (var d = {}, e = /^([\w-]*?)([\d]+)$/, f = 0, g = a.length; f < g; f++) { var k = a[f], h = k.name.match(e); if (h && 1 < h.length) { var m = h[1]; (h = d[m]) || (d[m] = h = []); h.push(k) } } a = []; for (m in d) a.push(ta.CreateFromMorphTargetSequence(m, d[m], b, c)); return a }, parseAnimation: function (a, b) { if (!a) return console.error(" no animation in JSONLoader data"), null; for (var c = function (a, b, c, d, e) { if (0 !== c.length) { var f = [], g = []; h.AnimationUtils.flattenJSON(c, f, g, d); 0 !== f.length && e.push(new a(b, f, g)) } }, d = [], e = a.name || "default", f = a.length || -1, g = a.fps || 30, k = a.hierarchy || [], l = 0; l < k.length; l++) { var m = k[l].keys; if (m && 0 !== m.length) if (m[0].morphTargets) { for (var f = {}, q = 0; q < m.length; q++) if (m[q].morphTargets) for (var p = 0; p < m[q].morphTargets.length; p++) f[m[q].morphTargets[p]] = -1; for (var n in f) { for (var r = [], t = [], p = 0; p !== m[q].morphTargets.length; ++p) { var v = m[q]; r.push(v.time); t.push(v.morphTarget === n ? 1 : 0) } d.push(new Tb(".morphTargetInfluence[" + n + "]", r, t)) } f = f.length * (g || 1) } else q = ".bones[" + b[l].name + "]", c(Sb, q + ".position", m, "pos", d), c(Ac, q + ".quaternion", m, "rot", d), c(Sb, q + ".scale", m, "scl", d) } return 0 === d.length ? null : new ta(e, f, d) } }); Object.assign(fd.prototype, { load: function (a, b, c, d) { var e = this; (new za(e.manager)).load(a, function (a) { b(e.parse(JSON.parse(a))) }, c, d) }, setTextures: function (a) { this.textures = a }, parse: function (a) { function b(a) { void 0 === c[a] && console.warn("THREE.MaterialLoader: Undefined texture", a); return c[a] } var c = this.textures, d = new nf[a.type]; void 0 !== a.uuid && (d.uuid = a.uuid); void 0 !== a.name && (d.name = a.name); void 0 !== a.color && d.color.setHex(a.color); void 0 !== a.roughness && (d.roughness = a.roughness); void 0 !== a.metalness && (d.metalness = a.metalness); void 0 !== a.emissive && d.emissive.setHex(a.emissive); void 0 !== a.specular && d.specular.setHex(a.specular); void 0 !== a.shininess && (d.shininess = a.shininess); void 0 !== a.uniforms && (d.uniforms = a.uniforms); void 0 !== a.vertexShader && (d.vertexShader = a.vertexShader); void 0 !== a.fragmentShader && (d.fragmentShader = a.fragmentShader); void 0 !== a.vertexColors && (d.vertexColors = a.vertexColors); void 0 !== a.fog && (d.fog = a.fog); void 0 !== a.shading && (d.shading = a.shading); void 0 !== a.blending && (d.blending = a.blending); void 0 !== a.side && (d.side = a.side); void 0 !== a.opacity && (d.opacity = a.opacity); void 0 !== a.transparent && (d.transparent = a.transparent); void 0 !== a.alphaTest && (d.alphaTest = a.alphaTest); void 0 !== a.depthTest && (d.depthTest = a.depthTest); void 0 !== a.depthWrite && (d.depthWrite = a.depthWrite); void 0 !== a.colorWrite && (d.colorWrite = a.colorWrite); void 0 !== a.wireframe && (d.wireframe = a.wireframe); void 0 !== a.wireframeLinewidth && (d.wireframeLinewidth = a.wireframeLinewidth); void 0 !== a.wireframeLinecap && (d.wireframeLinecap = a.wireframeLinecap); void 0 !== a.wireframeLinejoin && (d.wireframeLinejoin = a.wireframeLinejoin); void 0 !== a.skinning && (d.skinning = a.skinning); void 0 !== a.morphTargets && (d.morphTargets = a.morphTargets); void 0 !== a.size && (d.size = a.size); void 0 !== a.sizeAttenuation && (d.sizeAttenuation = a.sizeAttenuation); void 0 !== a.map && (d.map = b(a.map)); void 0 !== a.alphaMap && (d.alphaMap = b(a.alphaMap), d.transparent = !0); void 0 !== a.bumpMap && (d.bumpMap = b(a.bumpMap)); void 0 !== a.bumpScale && (d.bumpScale = a.bumpScale); void 0 !== a.normalMap && (d.normalMap = b(a.normalMap)); if (void 0 !== a.normalScale) { var e = a.normalScale; !1 === Array.isArray(e) && (e = [e, e]); d.normalScale = (new C).fromArray(e) } void 0 !== a.displacementMap && (d.displacementMap = b(a.displacementMap)); void 0 !== a.displacementScale && (d.displacementScale = a.displacementScale); void 0 !== a.displacementBias && (d.displacementBias = a.displacementBias); void 0 !== a.roughnessMap && (d.roughnessMap = b(a.roughnessMap)); void 0 !== a.metalnessMap && (d.metalnessMap = b(a.metalnessMap)); void 0 !== a.emissiveMap && (d.emissiveMap = b(a.emissiveMap)); void 0 !== a.emissiveIntensity && (d.emissiveIntensity = a.emissiveIntensity); void 0 !== a.specularMap && (d.specularMap = b(a.specularMap)); void 0 !== a.envMap && (d.envMap = b(a.envMap)); void 0 !== a.reflectivity && (d.reflectivity = a.reflectivity); void 0 !== a.lightMap && (d.lightMap = b(a.lightMap)); void 0 !== a.lightMapIntensity && (d.lightMapIntensity = a.lightMapIntensity); void 0 !== a.aoMap && (d.aoMap = b(a.aoMap)); void 0 !== a.aoMapIntensity && (d.aoMapIntensity = a.aoMapIntensity); if (void 0 !== a.materials) for (var e = 0, f = a.materials.length; e < f; e++) d.materials.push(this.parse(a.materials[e])); return d } }); Object.assign(td.prototype, { load: function (a, b, c, d) { var e = this; (new za(e.manager)).load(a, function (a) { b(e.parse(JSON.parse(a))) }, c, d) }, parse: function (a) { var b = new I, c = a.data.index, d = { Int8Array: Int8Array, Uint8Array: Uint8Array, Uint8ClampedArray: Uint8ClampedArray, Int16Array: Int16Array, Uint16Array: Uint16Array, Int32Array: Int32Array, Uint32Array: Uint32Array, Float32Array: Float32Array, Float64Array: Float64Array }; void 0 !== c && (c = new d[c.type](c.array), b.setIndex(new z(c, 1))); var e = a.data.attributes, f; for (f in e) { var g = e[f], c = new d[g.type](g.array); b.addAttribute(f, new z(c, g.itemSize, g.normalized)) } d = a.data.groups || a.data.drawcalls || a.data.offsets; if (void 0 !== d) for (f = 0, c = d.length; f !== c; ++f) e = d[f], b.addGroup(e.start, e.count, e.materialIndex); a = a.data.boundingSphere; void 0 !== a && (d = new q, void 0 !== a.center && d.fromArray(a.center), b.boundingSphere = new Aa(d, a.radius)); return b } }); sb.prototype = { constructor: sb, crossOrigin: void 0, extractUrlBase: function (a) { a = a.split("/"); if (1 === a.length) return "./"; a.pop(); return a.join("/") + "/" }, initMaterials: function (a, b, c) { for (var d = [], e = 0; e < a.length; ++e) d[e] = this.createMaterial(a[e], b, c); return d }, createMaterial: function () { var a, b, c; return function (d, e, f) { function g(a, c, d, g, l) { a = e + a; var m = sb.Handlers.get(a); null !== m ? a = m.load(a) : (b.setCrossOrigin(f), a = b.load(a)); void 0 !== c && (a.repeat.fromArray(c), 1 !== c[0] && (a.wrapS = 1E3), 1 !== c[1] && (a.wrapT = 1E3)); void 0 !== d && a.offset.fromArray(d); void 0 !== g && ("repeat" === g[0] && (a.wrapS = 1E3), "mirror" === g[0] && (a.wrapS = 1002), "repeat" === g[1] && (a.wrapT = 1E3), "mirror" === g[1] && (a.wrapT = 1002)); void 0 !== l && (a.anisotropy = l); c = h.Math.generateUUID(); k[c] = a; return c } void 0 === a && (a = new H); void 0 === b && (b = new Sc); void 0 === c && (c = new fd); var k = {}, l = { uuid: h.Math.generateUUID(), type: "MeshLambertMaterial" }, m; for (m in d) { var q = d[m]; switch (m) { case "DbgColor": case "DbgIndex": case "opticalDensity": case "illumination": break; case "DbgName": l.name = q; break; case "blending": l.blending = qe[q]; break; case "colorAmbient": case "mapAmbient": console.warn("THREE.Loader.createMaterial:", m, "is no longer supported."); break; case "colorDiffuse": l.color = a.fromArray(q).getHex(); break; case "colorSpecular": l.specular = a.fromArray(q).getHex(); break; case "colorEmissive": l.emissive = a.fromArray(q).getHex(); break; case "specularCoef": l.shininess = q; break; case "shading": "basic" === q.toLowerCase() && (l.type = "MeshBasicMaterial"); "phong" === q.toLowerCase() && (l.type = "MeshPhongMaterial"); "standard" === q.toLowerCase() && (l.type = "MeshStandardMaterial"); break; case "mapDiffuse": l.map = g(q, d.mapDiffuseRepeat, d.mapDiffuseOffset, d.mapDiffuseWrap, d.mapDiffuseAnisotropy); break; case "mapDiffuseRepeat": case "mapDiffuseOffset": case "mapDiffuseWrap": case "mapDiffuseAnisotropy": break; case "mapEmissive": l.emissiveMap = g(q, d.mapEmissiveRepeat, d.mapEmissiveOffset, d.mapEmissiveWrap, d.mapEmissiveAnisotropy); break; case "mapEmissiveRepeat": case "mapEmissiveOffset": case "mapEmissiveWrap": case "mapEmissiveAnisotropy": break; case "mapLight": l.lightMap = g(q, d.mapLightRepeat, d.mapLightOffset, d.mapLightWrap, d.mapLightAnisotropy); break; case "mapLightRepeat": case "mapLightOffset": case "mapLightWrap": case "mapLightAnisotropy": break; case "mapAO": l.aoMap = g(q, d.mapAORepeat, d.mapAOOffset, d.mapAOWrap, d.mapAOAnisotropy); break; case "mapAORepeat": case "mapAOOffset": case "mapAOWrap": case "mapAOAnisotropy": break; case "mapBump": l.bumpMap = g(q, d.mapBumpRepeat, d.mapBumpOffset, d.mapBumpWrap, d.mapBumpAnisotropy); break; case "mapBumpScale": l.bumpScale = q; break; case "mapBumpRepeat": case "mapBumpOffset": case "mapBumpWrap": case "mapBumpAnisotropy": break; case "mapNormal": l.normalMap = g(q, d.mapNormalRepeat, d.mapNormalOffset, d.mapNormalWrap, d.mapNormalAnisotropy); break; case "mapNormalFactor": l.normalScale = [q, q]; break; case "mapNormalRepeat": case "mapNormalOffset": case "mapNormalWrap": case "mapNormalAnisotropy": break; case "mapSpecular": l.specularMap = g(q, d.mapSpecularRepeat, d.mapSpecularOffset, d.mapSpecularWrap, d.mapSpecularAnisotropy); break; case "mapSpecularRepeat": case "mapSpecularOffset": case "mapSpecularWrap": case "mapSpecularAnisotropy": break; case "mapMetalness": l.metalnessMap = g(q, d.mapMetalnessRepeat, d.mapMetalnessOffset, d.mapMetalnessWrap, d.mapMetalnessAnisotropy); break; case "mapMetalnessRepeat": case "mapMetalnessOffset": case "mapMetalnessWrap": case "mapMetalnessAnisotropy": break; case "mapRoughness": l.roughnessMap = g(q, d.mapRoughnessRepeat, d.mapRoughnessOffset, d.mapRoughnessWrap, d.mapRoughnessAnisotropy); break; case "mapRoughnessRepeat": case "mapRoughnessOffset": case "mapRoughnessWrap": case "mapRoughnessAnisotropy": break; case "mapAlpha": l.alphaMap = g(q, d.mapAlphaRepeat, d.mapAlphaOffset, d.mapAlphaWrap, d.mapAlphaAnisotropy); break; case "mapAlphaRepeat": case "mapAlphaOffset": case "mapAlphaWrap": case "mapAlphaAnisotropy": break; case "flipSided": l.side = 1; break; case "doubleSided": l.side = 2; break; case "transparency": console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"); l.opacity = q; break; case "depthTest": case "depthWrite": case "colorWrite": case "opacity": case "reflectivity": case "transparent": case "visible": case "wireframe": l[m] = q; break; case "vertexColors": !0 === q && (l.vertexColors = 2); "face" === q && (l.vertexColors = 1); break; default: console.error("THREE.Loader.createMaterial: Unsupported", m, q) } } "MeshBasicMaterial" === l.type && delete l.emissive; "MeshPhongMaterial" !== l.type && delete l.specular; 1 > l.opacity && (l.transparent = !0); c.setTextures(k); return c.parse(l) } } () }; sb.Handlers = { handlers: [], add: function (a, b) { this.handlers.push(a, b) }, get: function (a) { for (var b = this.handlers, c = 0, d = b.length; c < d; c += 2) { var e = b[c + 1]; if (b[c].test(a)) return e } return null } }; Object.assign(ud.prototype, { load: function (a, b, c, d) { var e = this, f = this.texturePath && "string" === typeof this.texturePath ? this.texturePath : sb.prototype.extractUrlBase(a), g = new za(this.manager); g.setWithCredentials(this.withCredentials); g.load(a, function (c) { c = JSON.parse(c); var d = c.metadata; if (void 0 !== d && (d = d.type, void 0 !== d)) { if ("object" === d.toLowerCase()) { console.error("THREE.JSONLoader: " + a + " should be loaded with THREE.ObjectLoader instead."); return } if ("scene" === d.toLowerCase()) { console.error("THREE.JSONLoader: " + a + " should be loaded with THREE.SceneLoader instead."); return } } c = e.parse(c, f); b(c.geometry, c.materials) }, c, d) }, setTexturePath: function (a) { this.texturePath = a }, parse: function (a, b) { var c = new R, d = void 0 !== a.scale ? 1 / a.scale : 1; (function (b) { var d, g, k, h, m, u, p, n, r, t, v, A, w, x = a.faces; u = a.vertices; var z = a.normals, y = a.colors, F = 0; if (void 0 !== a.uvs) { for (d = 0; d < a.uvs.length; d++) a.uvs[d].length && F++; for (d = 0; d < F; d++) c.faceVertexUvs[d] = [] } h = 0; for (m = u.length; h < m; ) d = new q, d.x = u[h++] * b, d.y = u[h++] * b, d.z = u[h++] * b, c.vertices.push(d); h = 0; for (m = x.length; h < m; ) if (b = x[h++], r = b & 1, k = b & 2, d = b & 8, p = b & 16, t = b & 32, u = b & 64, b &= 128, r) { r = new ga; r.a = x[h]; r.b = x[h + 1]; r.c = x[h + 3]; v = new ga; v.a = x[h + 1]; v.b = x[h + 2]; v.c = x[h + 3]; h += 4; k && (k = x[h++], r.materialIndex = k, v.materialIndex = k); k = c.faces.length; if (d) for (d = 0; d < F; d++) for (A = a.uvs[d], c.faceVertexUvs[d][k] = [], c.faceVertexUvs[d][k + 1] = [], g = 0; 4 > g; g++) n = x[h++], w = A[2 * n], n = A[2 * n + 1], w = new C(w, n), 2 !== g && c.faceVertexUvs[d][k].push(w), 0 !== g && c.faceVertexUvs[d][k + 1].push(w); p && (p = 3 * x[h++], r.normal.set(z[p++], z[p++], z[p]), v.normal.copy(r.normal)); if (t) for (d = 0; 4 > d; d++) p = 3 * x[h++], t = new q(z[p++], z[p++], z[p]), 2 !== d && r.vertexNormals.push(t), 0 !== d && v.vertexNormals.push(t); u && (u = x[h++], u = y[u], r.color.setHex(u), v.color.setHex(u)); if (b) for (d = 0; 4 > d; d++) u = x[h++], u = y[u], 2 !== d && r.vertexColors.push(new H(u)), 0 !== d && v.vertexColors.push(new H(u)); c.faces.push(r); c.faces.push(v) } else { r = new ga; r.a = x[h++]; r.b = x[h++]; r.c = x[h++]; k && (k = x[h++], r.materialIndex = k); k = c.faces.length; if (d) for (d = 0; d < F; d++) for (A = a.uvs[d], c.faceVertexUvs[d][k] = [], g = 0; 3 > g; g++) n = x[h++], w = A[2 * n], n = A[2 * n + 1], w = new C(w, n), c.faceVertexUvs[d][k].push(w); p && (p = 3 * x[h++], r.normal.set(z[p++], z[p++], z[p])); if (t) for (d = 0; 3 > d; d++) p = 3 * x[h++], t = new q(z[p++], z[p++], z[p]), r.vertexNormals.push(t); u && (u = x[h++], r.color.setHex(y[u])); if (b) for (d = 0; 3 > d; d++) u = x[h++], r.vertexColors.push(new H(y[u])); c.faces.push(r) } })(d); (function () { var b = void 0 !== a.influencesPerVertex ? a.influencesPerVertex : 2; if (a.skinWeights) for (var d = 0, g = a.skinWeights.length; d < g; d += b) c.skinWeights.push(new da(a.skinWeights[d], 1 < b ? a.skinWeights[d + 1] : 0, 2 < b ? a.skinWeights[d + 2] : 0, 3 < b ? a.skinWeights[d + 3] : 0)); if (a.skinIndices) for (d = 0, g = a.skinIndices.length; d < g; d += b) c.skinIndices.push(new da(a.skinIndices[d], 1 < b ? a.skinIndices[d + 1] : 0, 2 < b ? a.skinIndices[d + 2] : 0, 3 < b ? a.skinIndices[d + 3] : 0)); c.bones = a.bones; c.bones && 0 < c.bones.length && (c.skinWeights.length !== c.skinIndices.length || c.skinIndices.length !== c.vertices.length) && console.warn("When skinning, number of vertices (" + c.vertices.length + "), skinIndices (" + c.skinIndices.length + "), and skinWeights (" + c.skinWeights.length + ") should match.") })(); (function (b) { if (void 0 !== a.morphTargets) for (var d = 0, g = a.morphTargets.length; d < g; d++) { c.morphTargets[d] = {}; c.morphTargets[d].name = a.morphTargets[d].name; c.morphTargets[d].vertices = []; for (var k = c.morphTargets[d].vertices, h = a.morphTargets[d].vertices, m = 0, u = h.length; m < u; m += 3) { var p = new q; p.x = h[m] * b; p.y = h[m + 1] * b; p.z = h[m + 2] * b; k.push(p) } } if (void 0 !== a.morphColors && 0 < a.morphColors.length) for (console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.'), b = c.faces, k = a.morphColors[0].colors, d = 0, g = b.length; d < g; d++) b[d].color.fromArray(k, 3 * d) })(d); (function () { var b = [], d = []; void 0 !== a.animation && d.push(a.animation); void 0 !== a.animations && (a.animations.length ? d = d.concat(a.animations) : d.push(a.animations)); for (var g = 0; g < d.length; g++) { var k = ta.parseAnimation(d[g], c.bones); k && b.push(k) } c.morphTargets && (d = ta.CreateClipsFromMorphTargetSequences(c.morphTargets, 10), b = b.concat(d)); 0 < b.length && (c.animations = b) })(); c.computeFaceNormals(); c.computeBoundingSphere(); if (void 0 === a.materials || 0 === a.materials.length) return { geometry: c }; d = sb.prototype.initMaterials(a.materials, b, this.crossOrigin); return { geometry: c, materials: d } } }); Object.assign(je.prototype, { load: function (a, b, c, d) { "" === this.texturePath && (this.texturePath = a.substring(0, a.lastIndexOf("/") + 1)); var e = this; (new za(e.manager)).load(a, function (a) { e.parse(JSON.parse(a), b) }, c, d) }, setTexturePath: function (a) { this.texturePath = a }, setCrossOrigin: function (a) { this.crossOrigin = a }, parse: function (a, b) { var c = this.parseGeometries(a.geometries), d = this.parseImages(a.images, function () { void 0 !== b && b(e) }), d = this.parseTextures(a.textures, d), d = this.parseMaterials(a.materials, d), e = this.parseObject(a.object, c, d); a.animations && (e.animations = this.parseAnimations(a.animations)); void 0 !== a.images && 0 !== a.images.length || void 0 === b || b(e); return e }, parseGeometries: function (a) { var b = {}; if (void 0 !== a) for (var c = new ud, d = new td, e = 0, f = a.length; e < f; e++) { var g, k = a[e]; switch (k.type) { case "PlaneGeometry": case "PlaneBufferGeometry": g = new ua[k.type](k.width, k.height, k.widthSegments, k.heightSegments); break; case "BoxGeometry": case "BoxBufferGeometry": case "CubeGeometry": g = new ua[k.type](k.width, k.height, k.depth, k.widthSegments, k.heightSegments, k.depthSegments); break; case "CircleGeometry": case "CircleBufferGeometry": g = new ua[k.type](k.radius, k.segments, k.thetaStart, k.thetaLength); break; case "CylinderGeometry": case "CylinderBufferGeometry": g = new ua[k.type](k.radiusTop, k.radiusBottom, k.height, k.radialSegments, k.heightSegments, k.openEnded, k.thetaStart, k.thetaLength); break; case "ConeGeometry": case "ConeBufferGeometry": g = new ua[k.type](k.radius, k.height, k.radialSegments, k.heightSegments, k.openEnded, k.thetaStart, k.thetaLength); break; case "SphereGeometry": case "SphereBufferGeometry": g = new ua[k.type](k.radius, k.widthSegments, k.heightSegments, k.phiStart, k.phiLength, k.thetaStart, k.thetaLength); break; case "DodecahedronGeometry": case "IcosahedronGeometry": case "OctahedronGeometry": case "TetrahedronGeometry": g = new ua[k.type](k.radius, k.detail); break; case "RingGeometry": case "RingBufferGeometry": g = new ua[k.type](k.innerRadius, k.outerRadius, k.thetaSegments, k.phiSegments, k.thetaStart, k.thetaLength); break; case "TorusGeometry": case "TorusBufferGeometry": g = new ua[k.type](k.radius, k.tube, k.radialSegments, k.tubularSegments, k.arc); break; case "TorusKnotGeometry": case "TorusKnotBufferGeometry": g = new ua[k.type](k.radius, k.tube, k.tubularSegments, k.radialSegments, k.p, k.q); break; case "LatheGeometry": case "LatheBufferGeometry": g = new ua[k.type](k.points, k.segments, k.phiStart, k.phiLength); break; case "BufferGeometry": g = d.parse(k); break; case "Geometry": g = c.parse(k.data, this.texturePath).geometry; break; default: console.warn('THREE.ObjectLoader: Unsupported geometry type "' + k.type + '"'); continue } g.uuid = k.uuid; void 0 !== k.name && (g.name = k.name); b[k.uuid] = g } return b }, parseMaterials: function (a, b) { var c = {}; if (void 0 !== a) { var d = new fd; d.setTextures(b); for (var e = 0, f = a.length; e < f; e++) { var g = d.parse(a[e]); c[g.uuid] = g } } return c }, parseAnimations: function (a) { for (var b = [], c = 0; c < a.length; c++) { var d = ta.parse(a[c]); b.push(d) } return b }, parseImages: function (a, b) { function c(a) { d.manager.itemStart(a); return g.load(a, function () { d.manager.itemEnd(a) }, void 0, function () { d.manager.itemError(a) }) } var d = this, e = {}; if (void 0 !== a && 0 < a.length) { var f = new qd(b), g = new yc(f); g.setCrossOrigin(this.crossOrigin); for (var f = 0, k = a.length; f < k; f++) { var h = a[f], m = /^(\/\/)|([a-z]+:(\/\/)?)/i.test(h.url) ? h.url : d.texturePath + h.url; e[h.uuid] = c(m) } } return e }, parseTextures: function (a, b) { function c(a, b) { if ("number" === typeof a) return a; console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.", a); return b[a] } var d = {}; if (void 0 !== a) for (var e = 0, f = a.length; e < f; e++) { var g = a[e]; void 0 === g.image && console.warn('THREE.ObjectLoader: No "image" specified for', g.uuid); void 0 === b[g.image] && console.warn("THREE.ObjectLoader: Undefined image", g.image); var k = new ba(b[g.image]); k.needsUpdate = !0; k.uuid = g.uuid; void 0 !== g.name && (k.name = g.name); void 0 !== g.mapping && (k.mapping = c(g.mapping, re)); void 0 !== g.offset && k.offset.fromArray(g.offset); void 0 !== g.repeat && k.repeat.fromArray(g.repeat); void 0 !== g.wrap && (k.wrapS = c(g.wrap[0], Md), k.wrapT = c(g.wrap[1], Md)); void 0 !== g.minFilter && (k.minFilter = c(g.minFilter, Nd)); void 0 !== g.magFilter && (k.magFilter = c(g.magFilter, Nd)); void 0 !== g.anisotropy && (k.anisotropy = g.anisotropy); void 0 !== g.flipY && (k.flipY = g.flipY); d[g.uuid] = k } return d }, parseObject: function () { var a = new P; return function (b, c, d) { function e(a) { void 0 === c[a] && console.warn("THREE.ObjectLoader: Undefined geometry", a); return c[a] } function f(a) { if (void 0 !== a) return void 0 === d[a] && console.warn("THREE.ObjectLoader: Undefined material", a), d[a] } var g; switch (b.type) { case "Scene": g = new fb; void 0 !== b.background && Number.isInteger(b.background) && (g.background = new H(b.background)); void 0 !== b.fog && ("Fog" === b.fog.type ? g.fog = new Fb(b.fog.color, b.fog.near, b.fog.far) : "FogExp2" === b.fog.type && (g.fog = new Eb(b.fog.color, b.fog.density))); break; case "PerspectiveCamera": g = new Ca(b.fov, b.aspect, b.near, b.far); void 0 !== b.focus && (g.focus = b.focus); void 0 !== b.zoom && (g.zoom = b.zoom); void 0 !== b.filmGauge && (g.filmGauge = b.filmGauge); void 0 !== b.filmOffset && (g.filmOffset = b.filmOffset); void 0 !== b.view && (g.view = Object.assign({}, b.view)); break; case "OrthographicCamera": g = new Db(b.left, b.right, b.top, b.bottom, b.near, b.far); break; case "AmbientLight": g = new Zc(b.color, b.intensity); break; case "DirectionalLight": g = new Yc(b.color, b.intensity); break; case "PointLight": g = new Wc(b.color, b.intensity, b.distance, b.decay); break; case "SpotLight": g = new Vc(b.color, b.intensity, b.distance, b.angle, b.penumbra, b.decay); break; case "HemisphereLight": g = new Tc(b.color, b.groundColor, b.intensity); break; case "Mesh": g = e(b.geometry); var k = f(b.material); g = g.bones && 0 < g.bones.length ? new Pc(g, k) : new va(g, k); break; case "LOD": g = new gc; break; case "Line": g = new Pa(e(b.geometry), f(b.material), b.mode); break; case "LineSegments": g = new ha(e(b.geometry), f(b.material)); break; case "PointCloud": case "Points": g = new Gb(e(b.geometry), f(b.material)); break; case "Sprite": g = new fc(f(b.material)); break; case "Group": g = new hc; break; default: g = new D } g.uuid = b.uuid; void 0 !== b.name && (g.name = b.name); void 0 !== b.matrix ? (a.fromArray(b.matrix), a.decompose(g.position, g.quaternion, g.scale)) : (void 0 !== b.position && g.position.fromArray(b.position), void 0 !== b.rotation && g.rotation.fromArray(b.rotation), void 0 !== b.quaternion && g.quaternion.fromArray(b.quaternion), void 0 !== b.scale && g.scale.fromArray(b.scale)); void 0 !== b.castShadow && (g.castShadow = b.castShadow); void 0 !== b.receiveShadow && (g.receiveShadow = b.receiveShadow); b.shadow && (void 0 !== b.shadow.bias && (g.shadow.bias = b.shadow.bias), void 0 !== b.shadow.radius && (g.shadow.radius = b.shadow.radius), void 0 !== b.shadow.mapSize && g.shadow.mapSize.fromArray(b.shadow.mapSize), void 0 !== b.shadow.camera && (g.shadow.camera = this.parseObject(b.shadow.camera))); void 0 !== b.visible && (g.visible = b.visible); void 0 !== b.userData && (g.userData = b.userData); if (void 0 !== b.children) for (var h in b.children) g.add(this.parseObject(b.children[h], c, d)); if ("LOD" === b.type) for (b = b.levels, k = 0; k < b.length; k++) { var m = b[k]; h = g.getObjectByProperty("uuid", m.object); void 0 !== h && g.addLevel(h, m.distance) } return g } } () }); Y.prototype = { constructor: Y, getPoint: function (a) { console.warn("THREE.Curve: Warning, getPoint() not implemented!"); return null }, getPointAt: function (a) { a = this.getUtoTmapping(a); return this.getPoint(a) }, getPoints: function (a) { a || (a = 5); for (var b = [], c = 0; c <= a; c++) b.push(this.getPoint(c / a)); return b }, getSpacedPoints: function (a) { a || (a = 5); for (var b = [], c = 0; c <= a; c++) b.push(this.getPointAt(c / a)); return b }, getLength: function () { var a = this.getLengths(); return a[a.length - 1] }, getLengths: function (a) { a || (a = this.__arcLengthDivisions ? this.__arcLengthDivisions : 200); if (this.cacheArcLengths && this.cacheArcLengths.length === a + 1 && !this.needsUpdate) return this.cacheArcLengths; this.needsUpdate = !1; var b = [], c, d = this.getPoint(0), e, f = 0; b.push(0); for (e = 1; e <= a; e++) c = this.getPoint(e / a), f += c.distanceTo(d), b.push(f), d = c; return this.cacheArcLengths = b }, updateArcLengths: function () { this.needsUpdate = !0; this.getLengths() }, getUtoTmapping: function (a, b) { var c = this.getLengths(), d, e = c.length, f; f = b ? b : a * c[e - 1]; for (var g = 0, k = e - 1, h; g <= k; ) if (d = Math.floor(g + (k - g) / 2), h = c[d] - f, 0 > h) g = d + 1; else if (0 < h) k = d - 1; else { k = d; break } d = k; if (c[d] === f) return d / (e - 1); g = c[d]; return (d + (f - g) / (c[d + 1] - g)) / (e - 1) }, getTangent: function (a) { var b = a - 1E-4; a += 1E-4; 0 > b && (b = 0); 1 < a && (a = 1); b = this.getPoint(b); return this.getPoint(a).clone().sub(b).normalize() }, getTangentAt: function (a) { a = this.getUtoTmapping(a); return this.getTangent(a) } }; Y.create = function (a, b) { a.prototype = Object.create(Y.prototype); a.prototype.constructor = a; a.prototype.getPoint = b; return a }; La.prototype = Object.create(Y.prototype); La.prototype.constructor = La; La.prototype.isLineCurve = !0; La.prototype.getPoint = function (a) { if (1 === a) return this.v2.clone(); var b = this.v2.clone().sub(this.v1); b.multiplyScalar(a).add(this.v1); return b }; La.prototype.getPointAt = function (a) { return this.getPoint(a) }; La.prototype.getTangent = function (a) { return this.v2.clone().sub(this.v1).normalize() }; Bc.prototype = Object.assign(Object.create(Y.prototype), { constructor: Bc, add: function (a) { this.curves.push(a) }, closePath: function () { var a = this.curves[0].getPoint(0), b = this.curves[this.curves.length - 1].getPoint(1); a.equals(b) || this.curves.push(new La(b, a)) }, getPoint: function (a) { var b = a * this.getLength(), c = this.getCurveLengths(); for (a = 0; a < c.length; ) { if (c[a] >= b) return b = c[a] - b, a = this.curves[a], c = a.getLength(), a.getPointAt(0 === c ? 0 : 1 - b / c); a++ } return null }, getLength: function () { var a = this.getCurveLengths(); return a[a.length - 1] }, updateArcLengths: function () { this.needsUpdate = !0; this.cacheLengths = null; this.getLengths() }, getCurveLengths: function () { if (this.cacheLengths && this.cacheLengths.length === this.curves.length) return this.cacheLengths; for (var a = [], b = 0, c = 0, d = this.curves.length; c < d; c++) b += this.curves[c].getLength(), a.push(b); return this.cacheLengths = a }, getSpacedPoints: function (a) { a || (a = 40); for (var b = [], c = 0; c <= a; c++) b.push(this.getPoint(c / a)); this.autoClose && b.push(b[0]); return b }, getPoints: function (a) { a = a || 12; for (var b = [], c, d = 0, e = this.curves; d < e.length; d++) for (var f = e[d], f = f.getPoints(f && f.isEllipseCurve ? 2 * a : f && f.isLineCurve ? 1 : f && f.isSplineCurve ? a * f.points.length : a), g = 0; g < f.length; g++) { var k = f[g]; c && c.equals(k) || (b.push(k), c = k) } this.autoClose && 1 < b.length && !b[b.length - 1].equals(b[0]) && b.push(b[0]); return b }, createPointsGeometry: function (a) { a = this.getPoints(a); return this.createGeometry(a) }, createSpacedPointsGeometry: function (a) { a = this.getSpacedPoints(a); return this.createGeometry(a) }, createGeometry: function (a) { for (var b = new R, c = 0, d = a.length; c < d; c++) { var e = a[c]; b.vertices.push(new q(e.x, e.y, e.z || 0)) } return b } }); Ra.prototype = Object.create(Y.prototype); Ra.prototype.constructor = Ra; Ra.prototype.isEllipseCurve = !0; Ra.prototype.getPoint = function (a) { for (var b = 2 * Math.PI, c = this.aEndAngle - this.aStartAngle, d = Math.abs(c) < Number.EPSILON; 0 > c; ) c += b; for (; c > b; ) c -= b; c < Number.EPSILON && (c = d ? 0 : b); !0 !== this.aClockwise || d || (c = c === b ? -b : c - b); b = this.aStartAngle + a * c; a = this.aX + this.xRadius * Math.cos(b); var e = this.aY + this.yRadius * Math.sin(b); 0 !== this.aRotation && (b = Math.cos(this.aRotation), c = Math.sin(this.aRotation), d = a - this.aX, e -= this.aY, a = d * b - e * c + this.aX, e = d * c + e * b + this.aY); return new C(a, e) }; h.CurveUtils = { tangentQuadraticBezier: function (a, b, c, d) { return 2 * (1 - a) * (c - b) + 2 * a * (d - c) }, tangentCubicBezier: function (a, b, c, d, e) { return -3 * b * (1 - a) * (1 - a) + 3 * c * (1 - a) * (1 - a) - 6 * a * c * (1 - a) + 6 * a * d * (1 - a) - 3 * a * a * d + 3 * a * a * e }, tangentSpline: function (a, b, c, d, e) { return 6 * a * a - 6 * a + (3 * a * a - 4 * a + 1) + (-6 * a * a + 6 * a) + (3 * a * a - 2 * a) }, interpolate: function (a, b, c, d, e) { a = .5 * (c - a); d = .5 * (d - b); var f = e * e; return (2 * b - 2 * c + a + d) * e * f + (-3 * b + 3 * c - 2 * a - d) * f + a * e + b } }; tb.prototype = Object.create(Y.prototype); tb.prototype.constructor = tb; tb.prototype.isSplineCurve = !0; tb.prototype.getPoint = function (a) { var b = this.points; a *= b.length - 1; var c = Math.floor(a); a -= c; var d = b[0 === c ? c : c - 1], e = b[c], f = b[c > b.length - 2 ? b.length - 1 : c + 1], b = b[c > b.length - 3 ? b.length - 1 : c + 2], c = h.CurveUtils.interpolate; return new C(c(d.x, e.x, f.x, b.x, a), c(d.y, e.y, f.y, b.y, a)) }; ub.prototype = Object.create(Y.prototype); ub.prototype.constructor = ub; ub.prototype.getPoint = function (a) { var b = h.ShapeUtils.b3; return new C(b(a, this.v0.x, this.v1.x, this.v2.x, this.v3.x), b(a, this.v0.y, this.v1.y, this.v2.y, this.v3.y)) }; ub.prototype.getTangent = function (a) { var b = h.CurveUtils.tangentCubicBezier; return (new C(b(a, this.v0.x, this.v1.x, this.v2.x, this.v3.x), b(a, this.v0.y, this.v1.y, this.v2.y, this.v3.y))).normalize() }; vb.prototype = Object.create(Y.prototype); vb.prototype.constructor = vb; vb.prototype.getPoint = function (a) { var b = h.ShapeUtils.b2; return new C(b(a, this.v0.x, this.v1.x, this.v2.x), b(a, this.v0.y, this.v1.y, this.v2.y)) }; vb.prototype.getTangent = function (a) { var b = h.CurveUtils.tangentQuadraticBezier; return (new C(b(a, this.v0.x, this.v1.x, this.v2.x), b(a, this.v0.y, this.v1.y, this.v2.y))).normalize() }; var Od = Object.assign(Object.create(Bc.prototype), { fromPoints: function (a) { this.moveTo(a[0].x, a[0].y); for (var b = 1, c = a.length; b < c; b++) this.lineTo(a[b].x, a[b].y) }, moveTo: function (a, b) { this.currentPoint.set(a, b) }, lineTo: function (a, b) { var c = new La(this.currentPoint.clone(), new C(a, b)); this.curves.push(c); this.currentPoint.set(a, b) }, quadraticCurveTo: function (a, b, c, d) { a = new vb(this.currentPoint.clone(), new C(a, b), new C(c, d)); this.curves.push(a); this.currentPoint.set(c, d) }, bezierCurveTo: function (a, b, c, d, e, f) { a = new ub(this.currentPoint.clone(), new C(a, b), new C(c, d), new C(e, f)); this.curves.push(a); this.currentPoint.set(e, f) }, splineThru: function (a) { var b = [this.currentPoint.clone()].concat(a), b = new tb(b); this.curves.push(b); this.currentPoint.copy(a[a.length - 1]) }, arc: function (a, b, c, d, e, f) { this.absarc(a + this.currentPoint.x, b + this.currentPoint.y, c, d, e, f) }, absarc: function (a, b, c, d, e, f) { this.absellipse(a, b, c, c, d, e, f) }, ellipse: function (a, b, c, d, e, f, g, k) { this.absellipse(a + this.currentPoint.x, b + this.currentPoint.y, c, d, e, f, g, k) }, absellipse: function (a, b, c, d, e, f, g, k) { a = new Ra(a, b, c, d, e, f, g, k); 0 < this.curves.length && (b = a.getPoint(0), b.equals(this.currentPoint) || this.lineTo(b.x, b.y)); this.curves.push(a); a = a.getPoint(1); this.currentPoint.copy(a) } }); wb.prototype = Object.assign(Object.create(Od), { constructor: wb, getPointsHoles: function (a) { for (var b = [], c = 0, d = this.holes.length; c < d; c++) b[c] = this.holes[c].getPoints(a); return b }, extractAllPoints: function (a) { return { shape: this.getPoints(a), holes: this.getPointsHoles(a) } }, extractPoints: function (a) { return this.extractAllPoints(a) } }); Cc.prototype = Od; Od.constructor = Cc; vd.prototype = { moveTo: function (a, b) { this.currentPath = new Cc; this.subPaths.push(this.currentPath); this.currentPath.moveTo(a, b) }, lineTo: function (a, b) { this.currentPath.lineTo(a, b) }, quadraticCurveTo: function (a, b, c, d) { this.currentPath.quadraticCurveTo(a, b, c, d) }, bezierCurveTo: function (a, b, c, d, e, f) { this.currentPath.bezierCurveTo(a, b, c, d, e, f) }, splineThru: function (a) { this.currentPath.splineThru(a) }, toShapes: function (a, b) { function c(a) { for (var b = [], c = 0, d = a.length; c < d; c++) { var e = a[c], f = new wb; f.curves = e.curves; b.push(f) } return b } function d(a, b) { for (var c = b.length, d = !1, e = c - 1, f = 0; f < c; e = f++) { var g = b[e], k = b[f], h = k.x - g.x, l = k.y - g.y; if (Math.abs(l) > Number.EPSILON) { if (0 > l && (g = b[f], h = -h, k = b[e], l = -l), !(a.y < g.y || a.y > k.y)) if (a.y === g.y) { if (a.x === g.x) return !0 } else { e = l * (a.x - g.x) - h * (a.y - g.y); if (0 === e) return !0; 0 > e || (d = !d) } } else if (a.y === g.y && (k.x <= a.x && a.x <= g.x || g.x <= a.x && a.x <= k.x)) return !0 } return d } var e = h.ShapeUtils.isClockWise, f = this.subPaths; if (0 === f.length) return []; if (!0 === b) return c(f); var g, k, l, m = []; if (1 === f.length) return k = f[0], l = new wb, l.curves = k.curves, m.push(l), m; var q = !e(f[0].getPoints()), q = a ? !q : q; l = []; var p = [], n = [], r = 0, t; p[r] = void 0; n[r] = []; for (var v = 0, A = f.length; v < A; v++) k = f[v], t = k.getPoints(), g = e(t), (g = a ? !g : g) ? (!q && p[r] && r++, p[r] = { s: new wb, p: t }, p[r].s.curves = k.curves, q && r++, n[r] = []) : n[r].push({ h: k, p: t[0] }); if (!p[0]) return c(f); if (1 < p.length) { v = !1; k = []; e = 0; for (f = p.length; e < f; e++) l[e] = []; e = 0; for (f = p.length; e < f; e++) for (g = n[e], q = 0; q < g.length; q++) { r = g[q]; t = !0; for (A = 0; A < p.length; A++) d(r.p, p[A].p) && (e !== A && k.push({ froms: e, tos: A, hole: q }), t ? (t = !1, l[A].push(r)) : v = !0); t && l[e].push(r) } 0 < k.length && (v || (n = l)) } v = 0; for (e = p.length; v < e; v++) for (l = p[v].s, m.push(l), k = n[v], f = 0, g = k.length; f < g; f++) l.holes.push(k[f].h); return m } }; Object.assign(wd.prototype, { isFont: !0, generateShapes: function (a, b, c) { void 0 === b && (b = 100); void 0 === c && (c = 4); var d = this.data; a = String(a).split(""); var e = b / d.resolution, f = 0; b = []; for (var g = 0; g < a.length; g++) { var k; k = e; var l = f, m = d.glyphs[a[g]] || d.glyphs["?"]; if (m) { var q = new vd, p = [], n = h.ShapeUtils.b2, r = h.ShapeUtils.b3, t, v, A, w, x, z, y, C; if (m.o) for (var D = m._cachedOutline || (m._cachedOutline = m.o.split(" ")), E = 0, J = D.length; E < J; ) switch (D[E++]) { case "m": t = D[E++] * k + l; v = D[E++] * k; q.moveTo(t, v); break; case "l": t = D[E++] * k + l; v = D[E++] * k; q.lineTo(t, v); break; case "q": t = D[E++] * k + l; v = D[E++] * k; x = D[E++] * k + l; z = D[E++] * k; q.quadraticCurveTo(x, z, t, v); if (w = p[p.length - 1]) { A = w.x; w = w.y; for (var H = 1; H <= c; H++) { var I = H / c; n(I, A, x, t); n(I, w, z, v) } } break; case "b": if (t = D[E++] * k + l, v = D[E++] * k, x = D[E++] * k + l, z = D[E++] * k, y = D[E++] * k + l, C = D[E++] * k, q.bezierCurveTo(x, z, y, C, t, v), w = p[p.length - 1]) for (A = w.x, w = w.y, H = 1; H <= c; H++) I = H / c, r(I, A, x, y, t), r(I, w, z, C, v) } k = { offset: m.ha * k, path: q } } else k = void 0; f += k.offset; b.push(k.path) } c = []; d = 0; for (a = b.length; d < a; d++) Array.prototype.push.apply(c, b[d].toShapes()); return c } }); Object.assign(ke.prototype, { load: function (a, b, c, d) { var e = this; (new za(this.manager)).load(a, function (a) { var c; try { c = JSON.parse(a) } catch (d) { console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."), c = JSON.parse(a.substring(65, a.length - 2)) } a = e.parse(c); b && b(a) }, c, d) }, parse: function (a) { return new wd(a) } }); var yd; Object.assign(zd.prototype, { load: function (a, b, c, d) { var e = new za(this.manager); e.setResponseType("arraybuffer"); e.load(a, function (a) { xd().decodeAudioData(a, function (a) { b(a) }) }, c, d) } }); Object.assign(le.prototype, { update: function () { var a, b, c, d, e, f, g, k = new P, l = new P; return function (m) { if (a !== this || b !== m.focus || c !== m.fov || d !== m.aspect * this.aspect || e !== m.near || f !== m.far || g !== m.zoom) { a = this; b = m.focus; c = m.fov; d = m.aspect * this.aspect; e = m.near; f = m.far; g = m.zoom; var q = m.projectionMatrix.clone(), p = this.eyeSep / 2, n = p * e / b, r = e * Math.tan(h.Math.DEG2RAD * c * .5) / g, t; l.elements[12] = -p; k.elements[12] = p; p = -r * d + n; t = r * d + n; q.elements[0] = 2 * e / (t - p); q.elements[8] = (t + p) / (t - p); this.cameraL.projectionMatrix.copy(q); p = -r * d - n; t = r * d - n; q.elements[0] = 2 * e / (t - p); q.elements[8] = (t + p) / (t - p); this.cameraR.projectionMatrix.copy(q) } this.cameraL.matrixWorld.copy(m.matrixWorld).multiply(l); this.cameraR.matrixWorld.copy(m.matrixWorld).multiply(k) } } () }); gd.prototype = Object.create(D.prototype); gd.prototype.constructor = gd; Ad.prototype = Object.assign(Object.create(D.prototype), { constructor: Ad, getInput: function () { return this.gain }, removeFilter: function () { null !== this.filter && (this.gain.disconnect(this.filter), this.filter.disconnect(this.context.destination), this.gain.connect(this.context.destination), this.filter = null) }, getFilter: function () { return this.filter }, setFilter: function (a) { null !== this.filter ? (this.gain.disconnect(this.filter), this.filter.disconnect(this.context.destination)) : this.gain.disconnect(this.context.destination); this.filter = a; this.gain.connect(this.filter); this.filter.connect(this.context.destination) }, getMasterVolume: function () { return this.gain.gain.value }, setMasterVolume: function (a) { this.gain.gain.value = a }, updateMatrixWorld: function () { var a = new q, b = new ca, c = new q, d = new q; return function (e) { D.prototype.updateMatrixWorld.call(this, e); e = this.context.listener; var f = this.up; this.matrixWorld.decompose(a, b, c); d.set(0, 0, -1).applyQuaternion(b); e.setPosition(a.x, a.y, a.z); e.setOrientation(d.x, d.y, d.z, f.x, f.y, f.z) } } () }); Ub.prototype = Object.assign(Object.create(D.prototype), { constructor: Ub, getOutput: function () { return this.gain }, setNodeSource: function (a) { this.hasPlaybackControl = !1; this.sourceType = "audioNode"; this.source = a; this.connect(); return this }, setBuffer: function (a) { this.source.buffer = a; this.sourceType = "buffer"; this.autoplay && this.play(); return this }, play: function () { if (!0 === this.isPlaying) console.warn("THREE.Audio: Audio is already playing."); else if (!1 === this.hasPlaybackControl) console.warn("THREE.Audio: this Audio has no playback control."); else { var a = this.context.createBufferSource(); a.buffer = this.source.buffer; a.loop = this.source.loop; a.onended = this.source.onended; a.start(0, this.startTime); a.playbackRate.value = this.playbackRate; this.isPlaying = !0; this.source = a; return this.connect() } }, pause: function () { if (!1 === this.hasPlaybackControl) console.warn("THREE.Audio: this Audio has no playback control."); else return this.source.stop(), this.startTime = this.context.currentTime, this.isPlaying = !1, this }, stop: function () { if (!1 === this.hasPlaybackControl) console.warn("THREE.Audio: this Audio has no playback control."); else return this.source.stop(), this.startTime = 0, this.isPlaying = !1, this }, connect: function () { if (0 < this.filters.length) { this.source.connect(this.filters[0]); for (var a = 1, b = this.filters.length; a < b; a++) this.filters[a - 1].connect(this.filters[a]); this.filters[this.filters.length - 1].connect(this.getOutput()) } else this.source.connect(this.getOutput()); return this }, disconnect: function () { if (0 < this.filters.length) { this.source.disconnect(this.filters[0]); for (var a = 1, b = this.filters.length; a < b; a++) this.filters[a - 1].disconnect(this.filters[a]); this.filters[this.filters.length - 1].disconnect(this.getOutput()) } else this.source.disconnect(this.getOutput()); return this }, getFilters: function () { return this.filters }, setFilters: function (a) { a || (a = []); !0 === this.isPlaying ? (this.disconnect(), this.filters = a, this.connect()) : this.filters = a; return this }, getFilter: function () { return this.getFilters()[0] }, setFilter: function (a) { return this.setFilters(a ? [a] : []) }, setPlaybackRate: function (a) { if (!1 === this.hasPlaybackControl) console.warn("THREE.Audio: this Audio has no playback control."); else return this.playbackRate = a, !0 === this.isPlaying && (this.source.playbackRate.value = this.playbackRate), this }, getPlaybackRate: function () { return this.playbackRate }, onEnded: function () { this.isPlaying = !1 }, getLoop: function () { return !1 === this.hasPlaybackControl ? (console.warn("THREE.Audio: this Audio has no playback control."), !1) : this.source.loop }, setLoop: function (a) { !1 === this.hasPlaybackControl ? console.warn("THREE.Audio: this Audio has no playback control.") : this.source.loop = a }, getVolume: function () { return this.gain.gain.value }, setVolume: function (a) { this.gain.gain.value = a; return this } }); Bd.prototype = Object.assign(Object.create(Ub.prototype), { constructor: Bd, getOutput: function () { return this.panner }, getRefDistance: function () { return this.panner.refDistance }, setRefDistance: function (a) { this.panner.refDistance = a }, getRolloffFactor: function () { return this.panner.rolloffFactor }, setRolloffFactor: function (a) { this.panner.rolloffFactor = a }, getDistanceModel: function () { return this.panner.distanceModel }, setDistanceModel: function (a) { this.panner.distanceModel = a }, getMaxDistance: function () { return this.panner.maxDistance }, setMaxDistance: function (a) { this.panner.maxDistance = a }, updateMatrixWorld: function () { var a = new q; return function (b) { D.prototype.updateMatrixWorld.call(this, b); a.setFromMatrixPosition(this.matrixWorld); this.panner.setPosition(a.x, a.y, a.z) } } () }); Object.assign(Cd.prototype, { getFrequencyData: function () { this.analyser.getByteFrequencyData(this.data); return this.data }, getAverageFrequency: function () { for (var a = 0, b = this.getFrequencyData(), c = 0; c < b.length; c++) a += b[c]; return a / b.length } }); hd.prototype = { constructor: hd, accumulate: function (a, b) { var c = this.buffer, d = this.valueSize, e = a * d + d, f = this.cumulativeWeight; if (0 === f) { for (f = 0; f !== d; ++f) c[e + f] = c[f]; f = b } else f += b, this._mixBufferRegion(c, e, 0, b / f, d); this.cumulativeWeight = f }, apply: function (a) { var b = this.valueSize, c = this.buffer; a = a * b + b; var d = this.cumulativeWeight, e = this.binding; this.cumulativeWeight = 0; 1 > d && this._mixBufferRegion(c, a, 3 * b, 1 - d, b); for (var d = b, f = b + b; d !== f; ++d) if (c[d] !== c[d + b]) { e.setValue(c, a); break } }, saveOriginalState: function () { var a = this.buffer, b = this.valueSize, c = 3 * b; this.binding.getValue(a, c); for (var d = b; d !== c; ++d) a[d] = a[c + d % b]; this.cumulativeWeight = 0 }, restoreOriginalState: function () { this.binding.setValue(this.buffer, 3 * this.valueSize) }, _select: function (a, b, c, d, e) { if (.5 <= d) for (d = 0; d !== e; ++d) a[b + d] = a[c + d] }, _slerp: function (a, b, c, d, e) { ca.slerpFlat(a, b, a, b, a, c, d) }, _lerp: function (a, b, c, d, e) { for (var f = 1 - d, g = 0; g !== e; ++g) { var k = b + g; a[k] = a[k] * f + a[c + g] * d } } }; ka.prototype = { constructor: ka, getValue: function (a, b) { this.bind(); this.getValue(a, b) }, setValue: function (a, b) { this.bind(); this.setValue(a, b) }, bind: function () { var a = this.node, b = this.parsedPath, c = b.objectName, d = b.propertyName, e = b.propertyIndex; a || (this.node = a = ka.findNode(this.rootNode, b.nodeName) || this.rootNode); this.getValue = this._getValue_unavailable; this.setValue = this._setValue_unavailable; if (a) { if (c) { var f = b.objectIndex; switch (c) { case "materials": if (!a.material) { console.error(" can not bind to material as node does not have a material", this); return } if (!a.material.materials) { console.error(" can not bind to material.materials as node.material does not have a materials array", this); return } a = a.material.materials; break; case "bones": if (!a.skeleton) { console.error(" can not bind to bones as node does not have a skeleton", this); return } a = a.skeleton.bones; for (c = 0; c < a.length; c++) if (a[c].name === f) { f = c; break } break; default: if (void 0 === a[c]) { console.error(" can not bind to objectName of node, undefined", this); return } a = a[c] } if (void 0 !== f) { if (void 0 === a[f]) { console.error(" trying to bind to objectIndex of objectName, but is undefined:", this, a); return } a = a[f] } } f = a[d]; if (void 0 === f) console.error(" trying to update property for track: " + b.nodeName + "." + d + " but it wasn't found.", a); else { b = this.Versioning.None; void 0 !== a.needsUpdate ? (b = this.Versioning.NeedsUpdate, this.targetObject = a) : void 0 !== a.matrixWorldNeedsUpdate && (b = this.Versioning.MatrixWorldNeedsUpdate, this.targetObject = a); c = this.BindingType.Direct; if (void 0 !== e) { if ("morphTargetInfluences" === d) { if (!a.geometry) { console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry", this); return } if (!a.geometry.morphTargets) { console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry.morphTargets", this); return } for (c = 0; c < this.node.geometry.morphTargets.length; c++) if (a.geometry.morphTargets[c].name === e) { e = c; break } } c = this.BindingType.ArrayElement; this.resolvedProperty = f; this.propertyIndex = e } else void 0 !== f.fromArray && void 0 !== f.toArray ? (c = this.BindingType.HasFromToArray, this.resolvedProperty = f) : void 0 !== f.length ? (c = this.BindingType.EntireArray, this.resolvedProperty = f) : this.propertyName = d; this.getValue = this.GetterByBindingType[c]; this.setValue = this.SetterByBindingTypeAndVersioning[c][b] } } else console.error(" trying to update node for track: " + this.path + " but it wasn't found.") }, unbind: function () { this.node = null; this.getValue = this._getValue_unbound; this.setValue = this._setValue_unbound } }; Object.assign(ka.prototype, { _getValue_unavailable: function () {}, _setValue_unavailable: function () {}, _getValue_unbound: ka.prototype.getValue, _setValue_unbound: ka.prototype.setValue, BindingType: { Direct: 0, EntireArray: 1, ArrayElement: 2, HasFromToArray: 3 }, Versioning: { None: 0, NeedsUpdate: 1, MatrixWorldNeedsUpdate: 2 }, GetterByBindingType: [function (a, b) { a[b] = this.node[this.propertyName] }, function (a, b) { for (var c = this.resolvedProperty, d = 0, e = c.length; d !== e; ++d) a[b++] = c[d] }, function (a, b) { a[b] = this.resolvedProperty[this.propertyIndex] }, function (a, b) { this.resolvedProperty.toArray(a, b) } ], SetterByBindingTypeAndVersioning: [[function (a, b) { this.node[this.propertyName] = a[b] }, function (a, b) { this.node[this.propertyName] = a[b]; this.targetObject.needsUpdate = !0 }, function (a, b) { this.node[this.propertyName] = a[b]; this.targetObject.matrixWorldNeedsUpdate = !0 } ], [function (a, b) { for (var c = this.resolvedProperty, d = 0, e = c.length; d !== e; ++d) c[d] = a[b++] }, function (a, b) { for (var c = this.resolvedProperty, d = 0, e = c.length; d !== e; ++d) c[d] = a[b++]; this.targetObject.needsUpdate = !0 }, function (a, b) { for (var c = this.resolvedProperty, d = 0, e = c.length; d !== e; ++d) c[d] = a[b++]; this.targetObject.matrixWorldNeedsUpdate = !0 } ], [function (a, b) { this.resolvedProperty[this.propertyIndex] = a[b] }, function (a, b) { this.resolvedProperty[this.propertyIndex] = a[b]; this.targetObject.needsUpdate = !0 }, function (a, b) { this.resolvedProperty[this.propertyIndex] = a[b]; this.targetObject.matrixWorldNeedsUpdate = !0 } ], [function (a, b) { this.resolvedProperty.fromArray(a, b) }, function (a, b) { this.resolvedProperty.fromArray(a, b); this.targetObject.needsUpdate = !0 }, function (a, b) { this.resolvedProperty.fromArray(a, b); this.targetObject.matrixWorldNeedsUpdate = !0 } ]] }); ka.Composite = function (a, b, c) { c = c || ka.parseTrackName(b); this._targetGroup = a; this._bindings = a.subscribe_(b, c) }; ka.Composite.prototype = { constructor: ka.Composite, getValue: function (a, b) { this.bind(); var c = this._bindings[this._targetGroup.nCachedObjects_]; void 0 !== c && c.getValue(a, b) }, setValue: function (a, b) { for (var c = this._bindings, d = this._targetGroup.nCachedObjects_, e = c.length; d !== e; ++d) c[d].setValue(a, b) }, bind: function () { for (var a = this._bindings, b = this._targetGroup.nCachedObjects_, c = a.length; b !== c; ++b) a[b].bind() }, unbind: function () { for (var a = this._bindings, b = this._targetGroup.nCachedObjects_, c = a.length; b !== c; ++b) a[b].unbind() } }; ka.create = function (a, b, c) { return a && a.isAnimationObjectGroup ? new ka.Composite(a, b, c) : new ka(a, b, c) }; ka.parseTrackName = function (a) { var b = /^((?:\w+[\/:])*)(\w+)?(?:\.(\w+)(?:\[(.+)\])?)?\.(\w+)(?:\[(.+)\])?$/.exec(a); if (!b) throw Error("cannot parse trackName at all: " + a); b = { nodeName: b[2], objectName: b[3], objectIndex: b[4], propertyName: b[5], propertyIndex: b[6] }; if (null === b.propertyName || 0 === b.propertyName.length) throw Error("can not parse propertyName from trackName: " + a); return b }; ka.findNode = function (a, b) { if (!b || "" === b || "root" === b || "." === b || -1 === b || b === a.name || b === a.uuid) return a; if (a.skeleton) { var c = function (a) { for (var c = 0; c < a.bones.length; c++) { var d = a.bones[c]; if (d.name === b) return d } return null } (a.skeleton); if (c) return c } if (a.children) { var d = function (a) { for (var c = 0; c < a.length; c++) { var g = a[c]; if (g.name === b || g.uuid === b || (g = d(g.children))) return g } return null }; if (c = d(a.children)) return c } return null }; Dd.prototype = { constructor: Dd, isAnimationObjectGroup: !0, add: function (a) { for (var b = this._objects, c = b.length, d = this.nCachedObjects_, e = this._indicesByUUID, f = this._paths, g = this._parsedPaths, k = this._bindings, h = k.length, m = 0, q = arguments.length; m !== q; ++m) { var p = arguments[m], n = p.uuid, r = e[n]; if (void 0 === r) { r = c++; e[n] = r; b.push(p); for (var n = 0, t = h; n !== t; ++n) k[n].push(new ka(p, f[n], g[n])) } else if (r < d) { var v = b[r], A = --d, t = b[A]; e[t.uuid] = r; b[r] = t; e[n] = A; b[A] = p; n = 0; for (t = h; n !== t; ++n) { var w = k[n], x = w[r]; w[r] = w[A]; void 0 === x && (x = new ka(p, f[n], g[n])); w[A] = x } } else b[r] !== v && console.error("Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes...") } this.nCachedObjects_ = d }, remove: function (a) { for (var b = this._objects, c = this.nCachedObjects_, d = this._indicesByUUID, e = this._bindings, f = e.length, g = 0, k = arguments.length; g !== k; ++g) { var h = arguments[g], m = h.uuid, q = d[m]; if (void 0 !== q && q >= c) { var p = c++, n = b[p]; d[n.uuid] = q; b[q] = n; d[m] = p; b[p] = h; h = 0; for (m = f; h !== m; ++h) { var n = e[h], r = n[q]; n[q] = n[p]; n[p] = r } } } this.nCachedObjects_ = c }, uncache: function (a) { for (var b = this._objects, c = b.length, d = this.nCachedObjects_, e = this._indicesByUUID, f = this._bindings, g = f.length, k = 0, h = arguments.length; k !== h; ++k) { var m = arguments[k].uuid, q = e[m]; if (void 0 !== q) if (delete e[m], q < d) { var m = --d, p = b[m], n = --c, r = b[n]; e[p.uuid] = q; b[q] = p; e[r.uuid] = m; b[m] = r; b.pop(); p = 0; for (r = g; p !== r; ++p) { var t = f[p], v = t[n]; t[q] = t[m]; t[m] = v; t.pop() } } else for (n = --c, r = b[n], e[r.uuid] = q, b[q] = r, b.pop(), p = 0, r = g; p !== r; ++p) t = f[p], t[q] = t[n], t.pop() } this.nCachedObjects_ = d }, subscribe_: function (a, b) { var c = this._bindingsIndicesByPath, d = c[a], e = this._bindings; if (void 0 !== d) return e[d]; var f = this._paths, g = this._parsedPaths, k = this._objects, h = this.nCachedObjects_, m = Array(k.length), d = e.length; c[a] = d; f.push(a); g.push(b); e.push(m); c = h; for (d = k.length; c !== d; ++c) m[c] = new ka(k[c], a, b); return m }, unsubscribe_: function (a) { var b = this._bindingsIndicesByPath, c = b[a]; if (void 0 !== c) { var d = this._paths, e = this._parsedPaths, f = this._bindings, g = f.length - 1, k = f[g]; b[a[g]] = c; f[c] = k; f.pop(); e[c] = e[g]; e.pop(); d[c] = d[g]; d.pop() } } }; Ed.prototype = { constructor: Ed, play: function () { this._mixer._activateAction(this); return this }, stop: function () { this._mixer._deactivateAction(this); return this.reset() }, reset: function () { this.paused = !1; this.enabled = !0; this.time = 0; this._loopCount = -1; this._startTime = null; return this.stopFading().stopWarping() }, isRunning: function () { return this.enabled && !this.paused && 0 !== this.timeScale && null === this._startTime && this._mixer._isActiveAction(this) }, isScheduled: function () { return this._mixer._isActiveAction(this) }, startAt: function (a) { this._startTime = a; return this }, setLoop: function (a, b) { this.loop = a; this.repetitions = b; return this }, setEffectiveWeight: function (a) { this.weight = a; this._effectiveWeight = this.enabled ? a : 0; return this.stopFading() }, getEffectiveWeight: function () { return this._effectiveWeight }, fadeIn: function (a) { return this._scheduleFading(a, 0, 1) }, fadeOut: function (a) { return this._scheduleFading(a, 1, 0) }, crossFadeFrom: function (a, b, c) { a.fadeOut(b); this.fadeIn(b); if (c) { c = this._clip.duration; var d = a._clip.duration, e = c / d; a.warp(1, d / c, b); this.warp(e, 1, b) } return this }, crossFadeTo: function (a, b, c) { return a.crossFadeFrom(this, b, c) }, stopFading: function () { var a = this._weightInterpolant; null !== a && (this._weightInterpolant = null, this._mixer._takeBackControlInterpolant(a)); return this }, setEffectiveTimeScale: function (a) { this.timeScale = a; this._effectiveTimeScale = this.paused ? 0 : a; return this.stopWarping() }, getEffectiveTimeScale: function () { return this._effectiveTimeScale }, setDuration: function (a) { this.timeScale = this._clip.duration / a; return this.stopWarping() }, syncWith: function (a) { this.time = a.time; this.timeScale = a.timeScale; return this.stopWarping() }, halt: function (a) { return this.warp(this._effectiveTimeScale, 0, a) }, warp: function (a, b, c) { var d = this._mixer, e = d.time, f = this._timeScaleInterpolant, g = this.timeScale; null === f && (this._timeScaleInterpolant = f = d._lendControlInterpolant()); d = f.parameterPositions; f = f.sampleValues; d[0] = e; d[1] = e + c; f[0] = a / g; f[1] = b / g; return this }, stopWarping: function () { var a = this._timeScaleInterpolant; null !== a && (this._timeScaleInterpolant = null, this._mixer._takeBackControlInterpolant(a)); return this }, getMixer: function () { return this._mixer }, getClip: function () { return this._clip }, getRoot: function () { return this._localRoot || this._mixer._root }, _update: function (a, b, c, d) { var e = this._startTime; if (null !== e) { b = (a - e) * c; if (0 > b || 0 === c) return; this._startTime = null; b *= c } b *= this._updateTimeScale(a); c = this._updateTime(b); a = this._updateWeight(a); if (0 < a) { b = this._interpolants; for (var e = this._propertyBindings, f = 0, g = b.length; f !== g; ++f) b[f].evaluate(c), e[f].accumulate(d, a) } }, _updateWeight: function (a) { var b = 0; if (this.enabled) { var b = this.weight, c = this._weightInterpolant; if (null !== c) { var d = c.evaluate(a)[0], b = b * d; a > c.parameterPositions[1] && (this.stopFading(), 0 === d && (this.enabled = !1)) } } return this._effectiveWeight = b }, _updateTimeScale: function (a) { var b = 0; if (!this.paused) { var b = this.timeScale, c = this._timeScaleInterpolant; if (null !== c) { var d = c.evaluate(a)[0], b = b * d; a > c.parameterPositions[1] && (this.stopWarping(), 0 === b ? this.paused = !0 : this.timeScale = b) } } return this._effectiveTimeScale = b }, _updateTime: function (a) { var b = this.time + a; if (0 === a) return b; var c = this._clip.duration, d = this.loop, e = this._loopCount; if (2200 === d) a: { if (-1 === e && (this.loopCount = 0, this._setEndings(!0, !0, !1)), b >= c) b = c; else if (0 > b) b = 0; else break a; this.clampWhenFinished ? this.paused = !0 : this.enabled = !1; this._mixer.dispatchEvent({ type: "finished", action: this, direction: 0 > a ? -1 : 1 }) } else { d = 2202 === d; -1 === e && (0 <= a ? (e = 0, this._setEndings(!0, 0 === this.repetitions, d)) : this._setEndings(0 === this.repetitions, !0, d)); if (b >= c || 0 > b) { var f = Math.floor(b / c), b = b - c * f, e = e + Math.abs(f), g = this.repetitions - e; 0 > g ? (this.clampWhenFinished ? this.paused = !0 : this.enabled = !1, b = 0 < a ? c : 0, this._mixer.dispatchEvent({ type: "finished", action: this, direction: 0 < a ? 1 : -1 })) : (0 === g ? (a = 0 > a, this._setEndings(a, !a, d)) : this._setEndings(!1, !1, d), this._loopCount = e, this._mixer.dispatchEvent({ type: "loop", action: this, loopDelta: f })) } if (d && 1 === (e & 1)) return this.time = b, c - b } return this.time = b }, _setEndings: function (a, b, c) { var d = this._interpolantSettings; c ? (d.endingStart = 2401, d.endingEnd = 2401) : (d.endingStart = a ? this.zeroSlopeAtStart ? 2401 : 2400 : 2402, d.endingEnd = b ? this.zeroSlopeAtEnd ? 2401 : 2400 : 2402) }, _scheduleFading: function (a, b, c) { var d = this._mixer, e = d.time, f = this._weightInterpolant; null === f && (this._weightInterpolant = f = d._lendControlInterpolant()); d = f.parameterPositions; f = f.sampleValues; d[0] = e; f[0] = b; d[1] = e + a; f[1] = c; return this } }; Object.assign(Fd.prototype, pa.prototype, { clipAction: function (a, b) { var c = b || this._root, d = c.uuid, e = "string" === typeof a ? ta.findByName(c, a) : a, c = null !== e ? e.uuid : a, f = this._actionsByClip[c], g = null; if (void 0 !== f) { g = f.actionByRoot[d]; if (void 0 !== g) return g; g = f.knownActions[0]; null === e && (e = g._clip) } if (null === e) return null; e = new Ed(this, e, b); this._bindAction(e, g); this._addInactiveAction(e, c, d); return e }, existingAction: function (a, b) { var c = b || this._root, d = c.uuid, c = "string" === typeof a ? ta.findByName(c, a) : a, c = this._actionsByClip[c ? c.uuid : a]; return void 0 !== c ? c.actionByRoot[d] || null : null }, stopAllAction: function () { for (var a = this._actions, b = this._nActiveActions, c = this._bindings, d = this._nActiveBindings, e = this._nActiveBindings = this._nActiveActions = 0; e !== b; ++e) a[e].reset(); for (e = 0; e !== d; ++e) c[e].useCount = 0; return this }, update: function (a) { a *= this.timeScale; for (var b = this._actions, c = this._nActiveActions, d = this.time += a, e = Math.sign(a), f = this._accuIndex ^= 1, g = 0; g !== c; ++g) { var k = b[g]; k.enabled && k._update(d, a, e, f) } a = this._bindings; b = this._nActiveBindings; for (g = 0; g !== b; ++g) a[g].apply(f); return this }, getRoot: function () { return this._root }, uncacheClip: function (a) { var b = this._actions; a = a.uuid; var c = this._actionsByClip, d = c[a]; if (void 0 !== d) { for (var d = d.knownActions, e = 0, f = d.length; e !== f; ++e) { var g = d[e]; this._deactivateAction(g); var k = g._cacheIndex, h = b[b.length - 1]; g._cacheIndex = null; g._byClipCacheIndex = null; h._cacheIndex = k; b[k] = h; b.pop(); this._removeInactiveBindingsForAction(g) } delete c[a] } }, uncacheRoot: function (a) { a = a.uuid; var b = this._actionsByClip, c; for (c in b) { var d = b[c].actionByRoot[a]; void 0 !== d && (this._deactivateAction(d), this._removeInactiveAction(d)) } c = this._bindingsByRootAndName[a]; if (void 0 !== c) for (var e in c) a = c[e], a.restoreOriginalState(), this._removeInactiveBinding(a) }, uncacheAction: function (a, b) { var c = this.existingAction(a, b); null !== c && (this._deactivateAction(c), this._removeInactiveAction(c)) } }); Object.assign(Fd.prototype, { _bindAction: function (a, b) { var c = a._localRoot || this._root, d = a._clip.tracks, e = d.length, f = a._propertyBindings, g = a._interpolants, k = c.uuid, h = this._bindingsByRootAndName, m = h[k]; void 0 === m && (m = {}, h[k] = m); for (h = 0; h !== e; ++h) { var q = d[h], p = q.name, n = m[p]; if (void 0 === n) { n = f[h]; if (void 0 !== n) { null === n._cacheIndex && (++n.referenceCount, this._addInactiveBinding(n, k, p)); continue } n = new hd(ka.create(c, p, b && b._propertyBindings[h].binding.parsedPath), q.ValueTypeName, q.getValueSize()); ++n.referenceCount; this._addInactiveBinding(n, k, p) } f[h] = n; g[h].resultBuffer = n.buffer } }, _activateAction: function (a) { if (!this._isActiveAction(a)) { if (null === a._cacheIndex) { var b = (a._localRoot || this._root).uuid, c = a._clip.uuid, d = this._actionsByClip[c]; this._bindAction(a, d && d.knownActions[0]); this._addInactiveAction(a, c, b) } b = a._propertyBindings; c = 0; for (d = b.length; c !== d; ++c) { var e = b[c]; 0 === e.useCount++ && (this._lendBinding(e), e.saveOriginalState()) } this._lendAction(a) } }, _deactivateAction: function (a) { if (this._isActiveAction(a)) { for (var b = a._propertyBindings, c = 0, d = b.length; c !== d; ++c) { var e = b[c]; 0 === --e.useCount && (e.restoreOriginalState(), this._takeBackBinding(e)) } this._takeBackAction(a) } }, _initMemoryManager: function () { this._actions = []; this._nActiveActions = 0; this._actionsByClip = {}; this._bindings = []; this._nActiveBindings = 0; this._bindingsByRootAndName = {}; this._controlInterpolants = []; this._nActiveControlInterpolants = 0; var a = this; this.stats = { actions: { get total() { return a._actions.length }, get inUse() { return a._nActiveActions } }, bindings: { get total() { return a._bindings.length }, get inUse() { return a._nActiveBindings } }, controlInterpolants: { get total() { return a._controlInterpolants.length }, get inUse() { return a._nActiveControlInterpolants } } } }, _isActiveAction: function (a) { a = a._cacheIndex; return null !== a && a < this._nActiveActions }, _addInactiveAction: function (a, b, c) { var d = this._actions, e = this._actionsByClip, f = e[b]; void 0 === f ? (f = { knownActions: [a], actionByRoot: {} }, a._byClipCacheIndex = 0, e[b] = f) : (b = f.knownActions, a._byClipCacheIndex = b.length, b.push(a)); a._cacheIndex = d.length; d.push(a); f.actionByRoot[c] = a }, _removeInactiveAction: function (a) { var b = this._actions, c = b[b.length - 1], d = a._cacheIndex; c._cacheIndex = d; b[d] = c; b.pop(); a._cacheIndex = null; var c = a._clip.uuid, d = this._actionsByClip, e = d[c], f = e.knownActions, g = f[f.length - 1], k = a._byClipCacheIndex; g._byClipCacheIndex = k; f[k] = g; f.pop(); a._byClipCacheIndex = null; delete e.actionByRoot[(b._localRoot || this._root).uuid]; 0 === f.length && delete d[c]; this._removeInactiveBindingsForAction(a) }, _removeInactiveBindingsForAction: function (a) { a = a._propertyBindings; for (var b = 0, c = a.length; b !== c; ++b) { var d = a[b]; 0 === --d.referenceCount && this._removeInactiveBinding(d) } }, _lendAction: function (a) { var b = this._actions, c = a._cacheIndex, d = this._nActiveActions++, e = b[d]; a._cacheIndex = d; b[d] = a; e._cacheIndex = c; b[c] = e }, _takeBackAction: function (a) { var b = this._actions, c = a._cacheIndex, d = --this._nActiveActions, e = b[d]; a._cacheIndex = d; b[d] = a; e._cacheIndex = c; b[c] = e }, _addInactiveBinding: function (a, b, c) { var d = this._bindingsByRootAndName, e = d[b], f = this._bindings; void 0 === e && (e = {}, d[b] = e); e[c] = a; a._cacheIndex = f.length; f.push(a) }, _removeInactiveBinding: function (a) { var b = this._bindings, c = a.binding, d = c.rootNode.uuid, c = c.path, e = this._bindingsByRootAndName, f = e[d], g = b[b.length - 1]; a = a._cacheIndex; g._cacheIndex = a; b[a] = g; b.pop(); delete f[c]; a: { for (var k in f) break a; delete e[d] } }, _lendBinding: function (a) { var b = this._bindings, c = a._cacheIndex, d = this._nActiveBindings++, e = b[d]; a._cacheIndex = d; b[d] = a; e._cacheIndex = c; b[c] = e }, _takeBackBinding: function (a) { var b = this._bindings, c = a._cacheIndex, d = --this._nActiveBindings, e = b[d]; a._cacheIndex = d; b[d] = a; e._cacheIndex = c; b[c] = e }, _lendControlInterpolant: function () { var a = this._controlInterpolants, b = this._nActiveControlInterpolants++, c = a[b]; void 0 === c && (c = new zc(new Float32Array(2), new Float32Array(2), 1, this._controlInterpolantsResultBuffer), c.__cacheIndex = b, a[b] = c); return c }, _takeBackControlInterpolant: function (a) { var b = this._controlInterpolants, c = a.__cacheIndex, d = --this._nActiveControlInterpolants, e = b[d]; a.__cacheIndex = d; b[d] = a; e.__cacheIndex = c; b[c] = e }, _controlInterpolantsResultBuffer: new Float32Array(1) }); Gd.prototype = { constructor: Gd, onUpdate: function (a) { this.dynamic = !0; this.onUpdateCallback = a; return this } }; xb.prototype = Object.create(I.prototype); xb.prototype.constructor = xb; xb.prototype.isInstancedBufferGeometry = !0; xb.prototype.addGroup = function (a, b, c) { this.groups.push({ start: a, count: b, instances: c }) }; xb.prototype.copy = function (a) { var b = a.index; null !== b && this.setIndex(b.clone()); var b = a.attributes, c; for (c in b) this.addAttribute(c, b[c].clone()); a = a.groups; c = 0; for (b = a.length; c < b; c++) { var d = a[c]; this.addGroup(d.start, d.count, d.instances) } return this }; Hd.prototype = { constructor: Hd, isInterleavedBufferAttribute: !0, get count() { return this.data.count }, get array() { return this.data.array }, setX: function (a, b) { this.data.array[a * this.data.stride + this.offset] = b; return this }, setY: function (a, b) { this.data.array[a * this.data.stride + this.offset + 1] = b; return this }, setZ: function (a, b) { this.data.array[a * this.data.stride + this.offset + 2] = b; return this }, setW: function (a, b) { this.data.array[a * this.data.stride + this.offset + 3] = b; return this }, getX: function (a) { return this.data.array[a * this.data.stride + this.offset] }, getY: function (a) { return this.data.array[a * this.data.stride + this.offset + 1] }, getZ: function (a) { return this.data.array[a * this.data.stride + this.offset + 2] }, getW: function (a) { return this.data.array[a * this.data.stride + this.offset + 3] }, setXY: function (a, b, c) { a = a * this.data.stride + this.offset; this.data.array[a + 0] = b; this.data.array[a + 1] = c; return this }, setXYZ: function (a, b, c, d) { a = a * this.data.stride + this.offset; this.data.array[a + 0] = b; this.data.array[a + 1] = c; this.data.array[a + 2] = d; return this }, setXYZW: function (a, b, c, d, e) { a = a * this.data.stride + this.offset; this.data.array[a + 0] = b; this.data.array[a + 1] = c; this.data.array[a + 2] = d; this.data.array[a + 3] = e; return this } }; Vb.prototype = { constructor: Vb, isInterleavedBuffer: !0, set needsUpdate(a) { !0 === a && this.version++ }, setDynamic: function (a) { this.dynamic = a; return this }, copy: function (a) { this.array = new a.array.constructor(a.array); this.count = a.count; this.stride = a.stride; this.dynamic = a.dynamic; return this }, copyAt: function (a, b, c) { a *= this.stride; c *= b.stride; for (var d = 0, e = this.stride; d < e; d++) this.array[a + d] = b.array[c + d]; return this }, set: function (a, b) { void 0 === b && (b = 0); this.array.set(a, b); return this }, clone: function () { return (new this.constructor).copy(this) } }; Wb.prototype = Object.create(Vb.prototype); Wb.prototype.constructor = Wb; Wb.prototype.isInstancedInterleavedBuffer = !0; Wb.prototype.copy = function (a) { Vb.prototype.copy.call(this, a); this.meshPerAttribute = a.meshPerAttribute; return this }; Xb.prototype = Object.create(z.prototype); Xb.prototype.constructor = Xb; Xb.prototype.isInstancedBufferAttribute = !0; Xb.prototype.copy = function (a) { z.prototype.copy.call(this, a); this.meshPerAttribute = a.meshPerAttribute; return this }; Id.prototype = { constructor: Id, linePrecision: 1, set: function (a, b) { this.ray.set(a, b) }, setFromCamera: function (a, b) { b && b.isPerspectiveCamera ? (this.ray.origin.setFromMatrixPosition(b.matrixWorld), this.ray.direction.set(a.x, a.y, .5).unproject(b).sub(this.ray.origin).normalize()) : b && b.isOrthographicCamera ? (this.ray.origin.set(a.x, a.y, (b.near + b.far) / (b.near - b.far)).unproject(b), this.ray.direction.set(0, 0, -1).transformDirection(b.matrixWorld)) : console.error("THREE.Raycaster: Unsupported camera type.") }, intersectObject: function (a, b) { var c = []; Jd(a, this, c, b); c.sort(me); return c }, intersectObjects: function (a, b) { var c = []; if (!1 === Array.isArray(a)) return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."), c; for (var d = 0, e = a.length; d < e; d++) Jd(a[d], this, c, b); c.sort(me); return c } }; Kd.prototype = { constructor: Kd, start: function () { this.oldTime = this.startTime = (performance || Date).now(); this.running = !0 }, stop: function () { this.getElapsedTime(); this.running = !1 }, getElapsedTime: function () { this.getDelta(); return this.elapsedTime }, getDelta: function () { var a = 0; this.autoStart && !this.running && this.start(); if (this.running) { var b = (performance || Date).now(), a = (b - this.oldTime) / 1E3; this.oldTime = b; this.elapsedTime += a } return a } }; Ld.prototype = { constructor: Ld, set: function (a, b, c) { this.radius = a; this.phi = b; this.theta = c; return this }, clone: function () { return (new this.constructor).copy(this) }, copy: function (a) { this.radius.copy(a.radius); this.phi.copy(a.phi); this.theta.copy(a.theta); return this }, makeSafe: function () { this.phi = Math.max(1E-6, Math.min(Math.PI - 1E-6, this.phi)); return this }, setFromVector3: function (a) { this.radius = a.length(); 0 === this.radius ? this.phi = this.theta = 0 : (this.theta = Math.atan2(a.x, a.z), this.phi = Math.acos(h.Math.clamp(a.y / this.radius, -1, 1))); return this } }; la.prototype = Object.create(va.prototype); la.prototype.constructor = la; la.prototype.createAnimation = function (a, b, c, d) { b = { start: b, end: c, length: c - b + 1, fps: d, duration: (c - b) / d, lastFrame: 0, currentFrame: 0, active: !1, time: 0, direction: 1, weight: 1, directionBackwards: !1, mirroredLoop: !1 }; this.animationsMap[a] = b; this.animationsList.push(b) }; la.prototype.autoCreateAnimations = function (a) { for (var b = /([a-z]+)_?(\d+)/i, c, d = {}, e = this.geometry, f = 0, g = e.morphTargets.length; f < g; f++) { var k = e.morphTargets[f].name.match(b); if (k && 1 < k.length) { var h = k[1]; d[h] || (d[h] = { start: Infinity, end: -Infinity }); k = d[h]; f < k.start && (k.start = f); f > k.end && (k.end = f); c || (c = h) } } for (h in d) k = d[h], this.createAnimation(h, k.start, k.end, a); this.firstAnimation = c }; la.prototype.setAnimationDirectionForward = function (a) { if (a = this.animationsMap[a]) a.direction = 1, a.directionBackwards = !1 }; la.prototype.setAnimationDirectionBackward = function (a) { if (a = this.animationsMap[a]) a.direction = -1, a.directionBackwards = !0 }; la.prototype.setAnimationFPS = function (a, b) { var c = this.animationsMap[a]; c && (c.fps = b, c.duration = (c.end - c.start) / c.fps) }; la.prototype.setAnimationDuration = function (a, b) { var c = this.animationsMap[a]; c && (c.duration = b, c.fps = (c.end - c.start) / c.duration) }; la.prototype.setAnimationWeight = function (a, b) { var c = this.animationsMap[a]; c && (c.weight = b) }; la.prototype.setAnimationTime = function (a, b) { var c = this.animationsMap[a]; c && (c.time = b) }; la.prototype.getAnimationTime = function (a) { var b = 0; if (a = this.animationsMap[a]) b = a.time; return b }; la.prototype.getAnimationDuration = function (a) { var b = -1; if (a = this.animationsMap[a]) b = a.duration; return b }; la.prototype.playAnimation = function (a) { var b = this.animationsMap[a]; b ? (b.time = 0, b.active = !0) : console.warn("THREE.MorphBlendMesh: animation[" + a + "] undefined in .playAnimation()") }; la.prototype.stopAnimation = function (a) { if (a = this.animationsMap[a]) a.active = !1 }; la.prototype.update = function (a) { for (var b = 0, c = this.animationsList.length; b < c; b++) { var d = this.animationsList[b]; if (d.active) { var e = d.duration / d.length; d.time += d.direction * a; if (d.mirroredLoop) { if (d.time > d.duration || 0 > d.time) d.direction *= -1, d.time > d.duration && (d.time = d.duration, d.directionBackwards = !0), 0 > d.time && (d.time = 0, d.directionBackwards = !1) } else d.time %= d.duration, 0 > d.time && (d.time += d.duration); var f = d.start + h.Math.clamp(Math.floor(d.time / e), 0, d.length - 1), g = d.weight; f !== d.currentFrame && (this.morphTargetInfluences[d.lastFrame] = 0, this.morphTargetInfluences[d.currentFrame] = 1 * g, this.morphTargetInfluences[f] = 0, d.lastFrame = d.currentFrame, d.currentFrame = f); e = d.time % e / e; d.directionBackwards && (e = 1 - e); d.currentFrame !== d.lastFrame ? (this.morphTargetInfluences[d.currentFrame] = e * g, this.morphTargetInfluences[d.lastFrame] = (1 - e) * g) : this.morphTargetInfluences[d.currentFrame] = g } } }; Dc.prototype = Object.create(D.prototype); Dc.prototype.constructor = Dc; Dc.prototype.isImmediateRenderObject = !0; Ec.prototype = Object.create(ha.prototype); Ec.prototype.constructor = Ec; Ec.prototype.update = function () { var a = new q, b = new q, c = new ya; return function () { var d = ["a", "b", "c"]; this.object.updateMatrixWorld(!0); c.getNormalMatrix(this.object.matrixWorld); var e = this.object.matrixWorld, f = this.geometry.attributes.position, g = this.object.geometry; if (g && g.isGeometry) for (var k = g.vertices, h = g.faces, m = g = 0, q = h.length; m < q; m++) for (var p = h[m], n = 0, r = p.vertexNormals.length; n < r; n++) { var t = p.vertexNormals[n]; a.copy(k[p[d[n]]]).applyMatrix4(e); b.copy(t).applyMatrix3(c).normalize().multiplyScalar(this.size).add(a); f.setXYZ(g, a.x, a.y, a.z); g += 1; f.setXYZ(g, b.x, b.y, b.z); g += 1 } else if (g && g.isBufferGeometry) for (d = g.attributes.position, k = g.attributes.normal, n = g = 0, r = d.count; n < r; n++) a.set(d.getX(n), d.getY(n), d.getZ(n)).applyMatrix4(e), b.set(k.getX(n), k.getY(n), k.getZ(n)), b.applyMatrix3(c).normalize().multiplyScalar(this.size).add(a), f.setXYZ(g, a.x, a.y, a.z), g += 1, f.setXYZ(g, b.x, b.y, b.z), g += 1; f.needsUpdate = !0; return this } } (); Yb.prototype = Object.create(D.prototype); Yb.prototype.constructor = Yb; Yb.prototype.dispose = function () { this.cone.geometry.dispose(); this.cone.material.dispose() }; Yb.prototype.update = function () { var a = new q, b = new q; return function () { var c = this.light.distance ? this.light.distance : 1E3, d = c * Math.tan(this.light.angle); this.cone.scale.set(d, d, c); a.setFromMatrixPosition(this.light.matrixWorld); b.setFromMatrixPosition(this.light.target.matrixWorld); this.cone.lookAt(b.sub(a)); this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity) } } (); Zb.prototype = Object.create(ha.prototype); Zb.prototype.constructor = Zb; Zb.prototype.getBoneList = function (a) { var b = []; a && a.isBone && b.push(a); for (var c = 0; c < a.children.length; c++) b.push.apply(b, this.getBoneList(a.children[c])); return b }; Zb.prototype.update = function () { for (var a = this.geometry, b = (new P).getInverse(this.root.matrixWorld), c = new P, d = 0, e = 0; e < this.bones.length; e++) { var f = this.bones[e]; f.parent && f.parent.isBone && (c.multiplyMatrices(b, f.matrixWorld), a.vertices[d].setFromMatrixPosition(c), c.multiplyMatrices(b, f.parent.matrixWorld), a.vertices[d + 1].setFromMatrixPosition(c), d += 2) } a.verticesNeedUpdate = !0; a.computeBoundingSphere() }; $b.prototype = Object.create(va.prototype); $b.prototype.constructor = $b; $b.prototype.dispose = function () { this.geometry.dispose(); this.material.dispose() }; $b.prototype.update = function () { this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity) }; ac.prototype = Object.create(D.prototype); ac.prototype.constructor = ac; ac.prototype.dispose = function () { this.lightSphere.geometry.dispose(); this.lightSphere.material.dispose() }; ac.prototype.update = function () { var a = new q; return function () { this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity); this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity); this.lightSphere.lookAt(a.setFromMatrixPosition(this.light.matrixWorld).negate()); this.lightSphere.geometry.colorsNeedUpdate = !0 } } (); Fc.prototype = Object.create(ha.prototype); Fc.prototype.constructor = Fc; Fc.prototype.setColors = function () { console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.") }; Gc.prototype = Object.create(ha.prototype); Gc.prototype.constructor = Gc; Gc.prototype.update = function () { var a = new q, b = new q, c = new ya; return function () { this.object.updateMatrixWorld(!0); c.getNormalMatrix(this.object.matrixWorld); for (var d = this.object.matrixWorld, e = this.geometry.attributes.position, f = this.object.geometry, g = f.vertices, f = f.faces, k = 0, h = 0, m = f.length; h < m; h++) { var q = f[h], p = q.normal; a.copy(g[q.a]).add(g[q.b]).add(g[q.c]).divideScalar(3).applyMatrix4(d); b.copy(p).applyMatrix3(c).normalize().multiplyScalar(this.size).add(a); e.setXYZ(k, a.x, a.y, a.z); k += 1; e.setXYZ(k, b.x, b.y, b.z); k += 1 } e.needsUpdate = !0; return this } } (); bc.prototype = Object.create(D.prototype); bc.prototype.constructor = bc; bc.prototype.dispose = function () { var a = this.children[0], b = this.children[1]; a.geometry.dispose(); a.material.dispose(); b.geometry.dispose(); b.material.dispose() }; bc.prototype.update = function () { var a = new q, b = new q, c = new q; return function () { a.setFromMatrixPosition(this.light.matrixWorld); b.setFromMatrixPosition(this.light.target.matrixWorld); c.subVectors(b, a); var d = this.children[0], e = this.children[1]; d.lookAt(c); d.material.color.copy(this.light.color).multiplyScalar(this.light.intensity); e.lookAt(c); e.scale.z = c.length() } } (); Hc.prototype = Object.create(ha.prototype); Hc.prototype.constructor = Hc; Hc.prototype.update = function () { function a(a, g, k, h) { d.set(g, k, h).unproject(e); a = c[a]; if (void 0 !== a) for (g = 0, k = a.length; g < k; g++) b.vertices[a[g]].copy(d) } var b, c, d = new q, e = new qa; return function () { b = this.geometry; c = this.pointMap; e.projectionMatrix.copy(this.camera.projectionMatrix); a("c", 0, 0, -1); a("t", 0, 0, 1); a("n1", -1, -1, -1); a("n2", 1, -1, -1); a("n3", -1, 1, -1); a("n4", 1, 1, -1); a("f1", -1, -1, 1); a("f2", 1, -1, 1); a("f3", -1, 1, 1); a("f4", 1, 1, 1); a("u1", .7, 1.1, -1); a("u2", - .7, 1.1, -1); a("u3", 0, 2, -1); a("cf1", -1, 0, 1); a("cf2", 1, 0, 1); a("cf3", 0, -1, 1); a("cf4", 0, 1, 1); a("cn1", -1, 0, -1); a("cn2", 1, 0, -1); a("cn3", 0, -1, -1); a("cn4", 0, 1, -1); b.verticesNeedUpdate = !0 } } (); Ic.prototype = Object.create(va.prototype); Ic.prototype.constructor = Ic; Ic.prototype.update = function () { this.box.setFromObject(this.object); this.box.size(this.scale); this.box.getCenter(this.position) }; Jc.prototype = Object.create(ha.prototype); Jc.prototype.constructor = Jc; Jc.prototype.update = function () { var a = new Ha; return function (b) { b && b.isBox3 ? a.copy(b) : a.setFromObject(b); if (!a.isEmpty()) { b = a.min; var c = a.max, d = this.geometry.attributes.position, e = d.array; e[0] = c.x; e[1] = c.y; e[2] = c.z; e[3] = b.x; e[4] = c.y; e[5] = c.z; e[6] = b.x; e[7] = b.y; e[8] = c.z; e[9] = c.x; e[10] = b.y; e[11] = c.z; e[12] = c.x; e[13] = c.y; e[14] = b.z; e[15] = b.x; e[16] = c.y; e[17] = b.z; e[18] = b.x; e[19] = b.y; e[20] = b.z; e[21] = c.x; e[22] = b.y; e[23] = b.z; d.needsUpdate = !0; this.geometry.computeBoundingSphere() } } } (); var ne = new I; ne.addAttribute("position", new ma([0, 0, 0, 0, 1, 0], 3)); var oe = new Za(0, .5, 1, 5, 1); oe.translate(0, - .5, 0); yb.prototype = Object.create(D.prototype); yb.prototype.constructor = yb; yb.prototype.setDirection = function () { var a = new q, b; return function (c) { .99999 < c.y ? this.quaternion.set(0, 0, 0, 1) : - .99999 > c.y ? this.quaternion.set(1, 0, 0, 0) : (a.set(c.z, 0, -c.x).normalize(), b = Math.acos(c.y), this.quaternion.setFromAxisAngle(a, b)) } } (); yb.prototype.setLength = function (a, b, c) { void 0 === b && (b = .2 * a); void 0 === c && (c = .2 * b); this.line.scale.set(1, Math.max(0, a - b), 1); this.line.updateMatrix(); this.cone.scale.set(c, b, c); this.cone.position.y = a; this.cone.updateMatrix() }; yb.prototype.setColor = function (a) { this.line.material.color.copy(a); this.cone.material.color.copy(a) }; id.prototype = Object.create(ha.prototype); id.prototype.constructor = id; h.CatmullRomCurve3 = function () { function a() {} var b = new q, c = new a, d = new a, e = new a; a.prototype.init = function (a, b, c, d) { this.c0 = a; this.c1 = c; this.c2 = -3 * a + 3 * b - 2 * c - d; this.c3 = 2 * a - 2 * b + c + d }; a.prototype.initNonuniformCatmullRom = function (a, b, c, d, e, h, p) { this.init(b, c, ((b - a) / e - (c - a) / (e + h) + (c - b) / h) * h, ((c - b) / h - (d - b) / (h + p) + (d - c) / p) * h) }; a.prototype.initCatmullRom = function (a, b, c, d, e) { this.init(b, c, e * (c - a), e * (d - b)) }; a.prototype.calc = function (a) { var b = a * a; return this.c0 + this.c1 * a + this.c2 * b + this.c3 * b * a }; return Y.create(function (a) { this.points = a || []; this.closed = !1 }, function (a) { var g = this.points, k, h; h = g.length; 2 > h && console.log("duh, you need at least 2 points"); a *= h - (this.closed ? 0 : 1); k = Math.floor(a); a -= k; this.closed ? k += 0 < k ? 0 : (Math.floor(Math.abs(k) / g.length) + 1) * g.length : 0 === a && k === h - 1 && (k = h - 2, a = 1); var m, u, p; this.closed || 0 < k ? m = g[(k - 1) % h] : (b.subVectors(g[0], g[1]).add(g[0]), m = b); u = g[k % h]; p = g[(k + 1) % h]; this.closed || k + 2 < h ? g = g[(k + 2) % h] : (b.subVectors(g[h - 1], g[h - 2]).add(g[h - 1]), g = b); if (void 0 === this.type || "centripetal" === this.type || "chordal" === this.type) { var n = "chordal" === this.type ? .5 : .25; h = Math.pow(m.distanceToSquared(u), n); k = Math.pow(u.distanceToSquared(p), n); n = Math.pow(p.distanceToSquared(g), n); 1E-4 > k && (k = 1); 1E-4 > h && (h = k); 1E-4 > n && (n = k); c.initNonuniformCatmullRom(m.x, u.x, p.x, g.x, h, k, n); d.initNonuniformCatmullRom(m.y, u.y, p.y, g.y, h, k, n); e.initNonuniformCatmullRom(m.z, u.z, p.z, g.z, h, k, n) } else "catmullrom" === this.type && (h = void 0 !== this.tension ? this.tension : .5, c.initCatmullRom(m.x, u.x, p.x, g.x, h), d.initCatmullRom(m.y, u.y, p.y, g.y, h), e.initCatmullRom(m.z, u.z, p.z, g.z, h)); return new q(c.calc(a), d.calc(a), e.calc(a)) }) } (); pe.prototype = Object.create(h.CatmullRomCurve3.prototype); var of = Y.create(function (a) { console.warn("THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3"); this.points = void 0 === a ? [] : a }, function (a) { var b = this.points; a *= b.length - 1; var c = Math.floor(a); a -= c; var d = b[0 == c ? c : c - 1], e = b[c], f = b[c > b.length - 2 ? b.length - 1 : c + 1], b = b[c > b.length - 3 ? b.length - 1 : c + 2], c = h.CurveUtils.interpolate; return new q(c(d.x, e.x, f.x, b.x, a), c(d.y, e.y, f.y, b.y, a), c(d.z, e.z, f.z, b.z, a)) }); h.CubicBezierCurve3 = Y.create(function (a, b, c, d) { this.v0 = a; this.v1 = b; this.v2 = c; this.v3 = d }, function (a) { var b = h.ShapeUtils.b3; return new q(b(a, this.v0.x, this.v1.x, this.v2.x, this.v3.x), b(a, this.v0.y, this.v1.y, this.v2.y, this.v3.y), b(a, this.v0.z, this.v1.z, this.v2.z, this.v3.z)) }); h.QuadraticBezierCurve3 = Y.create(function (a, b, c) { this.v0 = a; this.v1 = b; this.v2 = c }, function (a) { var b = h.ShapeUtils.b2; return new q(b(a, this.v0.x, this.v1.x, this.v2.x), b(a, this.v0.y, this.v1.y, this.v2.y), b(a, this.v0.z, this.v1.z, this.v2.z)) }); h.LineCurve3 = Y.create(function (a, b) { this.v1 = a; this.v2 = b }, function (a) { if (1 === a) return this.v2.clone(); var b = new q; b.subVectors(this.v2, this.v1); b.multiplyScalar(a); b.add(this.v1); return b }); jd.prototype = Object.create(Ra.prototype); jd.prototype.constructor = jd; h.SceneUtils = { createMultiMaterialObject: function (a, b) { for (var c = new hc, d = 0, e = b.length; d < e; d++) c.add(new va(a, b[d])); return c }, detach: function (a, b, c) { a.applyMatrix(b.matrixWorld); b.remove(a); c.add(a) }, attach: function (a, b, c) { var d = new P; d.getInverse(c.matrixWorld); a.applyMatrix(d); b.remove(a); c.add(a) } }; Object.assign(cc.prototype, { center: function (a) { console.warn("THREE.Box2: .center() has been renamed to .getCenter()."); return this.getCenter(a) }, empty: function () { console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."); return this.isEmpty() }, isIntersectionBox: function (a) { console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."); return this.intersectsBox(a) }, size: function (a) { console.warn("THREE.Box2: .size() has been renamed to .getSize()."); return this.getSize(a) } }); Object.assign(Ha.prototype, { center: function (a) { console.warn("THREE.Box3: .center() has been renamed to .getCenter()."); return this.getCenter(a) }, empty: function () { console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."); return this.isEmpty() }, isIntersectionBox: function (a) { console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."); return this.intersectsBox(a) }, isIntersectionSphere: function (a) { console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."); return this.intersectsSphere(a) }, size: function (a) { console.warn("THREE.Box3: .size() has been renamed to .getSize()."); return this.getSize(a) } }); Object.assign(cb.prototype, { center: function (a) { console.warn("THREE.Line3: .center() has been renamed to .getCenter()."); return this.getCenter(a) } }); Object.assign(ya.prototype, { multiplyVector3: function (a) { console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."); return a.applyMatrix3(this) }, multiplyVector3Array: function (a) { console.warn("THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."); return this.applyToVector3Array(a) } }); Object.assign(P.prototype, { extractPosition: function (a) { console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."); return this.copyPosition(a) }, setRotationFromQuaternion: function (a) { console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."); return this.makeRotationFromQuaternion(a) }, multiplyVector3: function (a) { console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead."); return a.applyProjection(this) }, multiplyVector4: function (a) { console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."); return a.applyMatrix4(this) }, multiplyVector3Array: function (a) { console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."); return this.applyToVector3Array(a) }, rotateAxis: function (a) { console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."); a.transformDirection(this) }, crossVector: function (a) { console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."); return a.applyMatrix4(this) }, translate: function (a) { console.error("THREE.Matrix4: .translate() has been removed.") }, rotateX: function (a) { console.error("THREE.Matrix4: .rotateX() has been removed.") }, rotateY: function (a) { console.error("THREE.Matrix4: .rotateY() has been removed.") }, rotateZ: function (a) { console.error("THREE.Matrix4: .rotateZ() has been removed.") }, rotateByAxis: function (a, b) { console.error("THREE.Matrix4: .rotateByAxis() has been removed.") } }); Object.assign(fa.prototype, { isIntersectionLine: function (a) { console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."); return this.intersectsLine(a) } }); Object.assign(ca.prototype, { multiplyVector3: function (a) { console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."); return a.applyQuaternion(this) } }); Object.assign(Wa.prototype, { isIntersectionBox: function (a) { console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."); return this.intersectsBox(a) }, isIntersectionPlane: function (a) { console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."); return this.intersectsPlane(a) }, isIntersectionSphere: function (a) { console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."); return this.intersectsSphere(a) } }); Object.assign(wb.prototype, { extrude: function (a) { console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."); return new ra(this, a) }, makeGeometry: function (a) { console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."); return new Ya(this, a) } }); Object.assign(q.prototype, { setEulerFromRotationMatrix: function () { console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.") }, setEulerFromQuaternion: function () { console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.") }, getPositionFromMatrix: function (a) { console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."); return this.setFromMatrixPosition(a) }, getScaleFromMatrix: function (a) { console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."); return this.setFromMatrixScale(a) }, getColumnFromMatrix: function (a, b) { console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."); return this.setFromMatrixColumn(b, a) } }); Object.assign(D.prototype, { getChildByName: function (a) { console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."); return this.getObjectByName(a) }, renderDepth: function (a) { console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.") }, translate: function (a, b) { console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."); return this.translateOnAxis(b, a) } }); Object.defineProperties(D.prototype, { eulerOrder: { get: function () { console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."); return this.rotation.order }, set: function (a) { console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."); this.rotation.order = a } }, useQuaternion: { get: function () { console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.") }, set: function (a) { console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.") } } }); Object.defineProperties(gc.prototype, { objects: { get: function () { console.warn("THREE.LOD: .objects has been renamed to .levels."); return this.levels } } }); Ca.prototype.setLens = function (a, b) { console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."); void 0 !== b && (this.filmGauge = b); this.setFocalLength(a) }; Object.defineProperties(oa.prototype, { onlyShadow: { set: function (a) { console.warn("THREE.Light: .onlyShadow has been removed.") } }, shadowCameraFov: { set: function (a) { console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."); this.shadow.camera.fov = a } }, shadowCameraLeft: { set: function (a) { console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."); this.shadow.camera.left = a } }, shadowCameraRight: { set: function (a) { console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."); this.shadow.camera.right = a } }, shadowCameraTop: { set: function (a) { console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."); this.shadow.camera.top = a } }, shadowCameraBottom: { set: function (a) { console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."); this.shadow.camera.bottom = a } }, shadowCameraNear: { set: function (a) { console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."); this.shadow.camera.near = a } }, shadowCameraFar: { set: function (a) { console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."); this.shadow.camera.far = a } }, shadowCameraVisible: { set: function (a) { console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.") } }, shadowBias: { set: function (a) { console.warn("THREE.Light: .shadowBias is now .shadow.bias."); this.shadow.bias = a } }, shadowDarkness: { set: function (a) { console.warn("THREE.Light: .shadowDarkness has been removed.") } }, shadowMapWidth: { set: function (a) { console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."); this.shadow.mapSize.width = a } }, shadowMapHeight: { set: function (a) { console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."); this.shadow.mapSize.height = a } } }); Object.defineProperties(z.prototype, { length: { get: function () { console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."); return this.array.length } } }); Object.assign(I.prototype, { addIndex: function (a) { console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."); this.setIndex(a) }, addDrawCall: function (a, b, c) { void 0 !== c && console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."); console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."); this.addGroup(a, b) }, clearDrawCalls: function () { console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."); this.clearGroups() }, computeTangents: function () { console.warn("THREE.BufferGeometry: .computeTangents() has been removed.") }, computeOffsets: function () { console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.") } }); Object.defineProperties(I.prototype, { drawcalls: { get: function () { console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."); return this.groups } }, offsets: { get: function () { console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."); return this.groups } } }); Object.defineProperties(S.prototype, { wrapAround: { get: function () { console.warn("THREE." + this.type + ": .wrapAround has been removed.") }, set: function (a) { console.warn("THREE." + this.type + ": .wrapAround has been removed.") } }, wrapRGB: { get: function () { console.warn("THREE." + this.type + ": .wrapRGB has been removed."); return new H } } }); Object.defineProperties($a.prototype, { metal: { get: function () { console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."); return !1 }, set: function (a) { console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead") } } }); Object.defineProperties(Da.prototype, { derivatives: { get: function () { console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."); return this.extensions.derivatives }, set: function (a) { console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."); this.extensions.derivatives = a } } }); pa.prototype = Object.assign(Object.create({ constructor: pa, apply: function (a) { console.warn("THREE.EventDispatcher: .apply is deprecated, just inherit or Object.assign the prototype to mix-in."); Object.assign(a, this) } }), pa.prototype); Object.assign(od.prototype, { supportsFloatTextures: function () { console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."); return this.extensions.get("OES_texture_float") }, supportsHalfFloatTextures: function () { console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."); return this.extensions.get("OES_texture_half_float") }, supportsStandardDerivatives: function () { console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."); return this.extensions.get("OES_standard_derivatives") }, supportsCompressedTextureS3TC: function () { console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."); return this.extensions.get("WEBGL_compressed_texture_s3tc") }, supportsCompressedTexturePVRTC: function () { console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."); return this.extensions.get("WEBGL_compressed_texture_pvrtc") }, supportsBlendMinMax: function () { console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."); return this.extensions.get("EXT_blend_minmax") }, supportsVertexTextures: function () { return this.capabilities.vertexTextures }, supportsInstancedArrays: function () { console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."); return this.extensions.get("ANGLE_instanced_arrays") }, enableScissorTest: function (a) { console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."); this.setScissorTest(a) }, initMaterial: function () { console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.") }, addPrePlugin: function () { console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.") }, addPostPlugin: function () { console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.") }, updateShadowMap: function () { console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.") } }); Object.defineProperties(od.prototype, { shadowMapEnabled: { get: function () { return this.shadowMap.enabled }, set: function (a) { console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."); this.shadowMap.enabled = a } }, shadowMapType: { get: function () { return this.shadowMap.type }, set: function (a) { console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."); this.shadowMap.type = a } }, shadowMapCullFace: { get: function () { return this.shadowMap.cullFace }, set: function (a) { console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace."); this.shadowMap.cullFace = a } } }); Object.defineProperties($d.prototype, { cullFace: { get: function () { return this.renderReverseSided ? 2 : 1 }, set: function (a) { a = 1 !== a; console.warn("WebGLRenderer: .shadowMap.cullFace is deprecated. Set .shadowMap.renderReverseSided to " + a + "."); this.renderReverseSided = a } } }); Object.defineProperties(zb.prototype, { wrapS: { get: function () { console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."); return this.texture.wrapS }, set: function (a) { console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."); this.texture.wrapS = a } }, wrapT: { get: function () { console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."); return this.texture.wrapT }, set: function (a) { console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."); this.texture.wrapT = a } }, magFilter: { get: function () { console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."); return this.texture.magFilter }, set: function (a) { console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."); this.texture.magFilter = a } }, minFilter: { get: function () { console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."); return this.texture.minFilter }, set: function (a) { console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."); this.texture.minFilter = a } }, anisotropy: { get: function () { console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."); return this.texture.anisotropy }, set: function (a) { console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."); this.texture.anisotropy = a } }, offset: { get: function () { console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."); return this.texture.offset }, set: function (a) { console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."); this.texture.offset = a } }, repeat: { get: function () { console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."); return this.texture.repeat }, set: function (a) { console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."); this.texture.repeat = a } }, format: { get: function () { console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."); return this.texture.format }, set: function (a) { console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."); this.texture.format = a } }, type: { get: function () { console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."); return this.texture.type }, set: function (a) { console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."); this.texture.type = a } }, generateMipmaps: { get: function () { console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."); return this.texture.generateMipmaps }, set: function (a) { console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."); this.texture.generateMipmaps = a } } }); Object.assign(Ub.prototype, { load: function (a) { console.warn("THREE.Audio: .load has been deprecated. Please use THREE.AudioLoader."); var b = this; (new zd).load(a, function (a) { b.setBuffer(a) }); return this } }); Object.assign(Cd.prototype, { getData: function (a) { console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."); return this.getFrequencyData() } }); Object.defineProperty(h, "AudioContext", { get: function () { return h.getAudioContext() } }); h.WebGLRenderTargetCube = Ab; h.WebGLRenderTarget = zb; h.WebGLRenderer = od; h.ShaderLib = Cb; h.UniformsLib = U; h.ShaderChunk = Z; h.FogExp2 = Eb; h.Fog = Fb; h.Scene = fb; h.LensFlare = pd; h.Sprite = fc; h.LOD = gc; h.SkinnedMesh = Pc; h.Skeleton = Nc; h.Bone = Oc; h.Mesh = va; h.LineSegments = ha; h.Line = Pa; h.Points = Gb; h.Group = hc; h.VideoTexture = Qc; h.DataTexture = hb; h.CompressedTexture = Hb; h.CubeTexture = Ta; h.CanvasTexture = Rc; h.DepthTexture = ic; h.TextureIdCount = function () { return Pd++ }; h.Texture = ba; h.MaterialIdCount = function () { return Zd++ }; h.CompressedTextureLoader = ie; h.BinaryTextureLoader = rd; h.DataTextureLoader = rd; h.CubeTextureLoader = sd; h.TextureLoader = Sc; h.ObjectLoader = je; h.MaterialLoader = fd; h.BufferGeometryLoader = td; h.LoadingManager = qd; h.JSONLoader = ud; h.ImageLoader = yc; h.FontLoader = ke; h.XHRLoader = za; h.Loader = sb; h.AudioLoader = zd; h.SpotLightShadow = Uc; h.SpotLight = Vc; h.PointLight = Wc; h.HemisphereLight = Tc; h.DirectionalLightShadow = Xc; h.DirectionalLight = Yc; h.AmbientLight = Zc; h.LightShadow = pb; h.Light = oa; h.StereoCamera = le; h.PerspectiveCamera = Ca; h.OrthographicCamera = Db; h.CubeCamera = gd; h.Camera = qa; h.AudioListener = Ad; h.PositionalAudio = Bd; h.getAudioContext = xd; h.AudioAnalyser = Cd; h.Audio = Ub; h.VectorKeyframeTrack = Sb; h.StringKeyframeTrack = cd; h.QuaternionKeyframeTrack = Ac; h.NumberKeyframeTrack = Tb; h.ColorKeyframeTrack = ed; h.BooleanKeyframeTrack = dd; h.PropertyMixer = hd; h.PropertyBinding = ka; h.KeyframeTrack = rb; h.AnimationObjectGroup = Dd; h.AnimationMixer = Fd; h.AnimationClip = ta; h.Uniform = Gd; h.InstancedBufferGeometry = xb; h.BufferGeometry = I; h.GeometryIdCount = function () { return Lc++ }; h.Geometry = R; h.InterleavedBufferAttribute = Hd; h.InstancedInterleavedBuffer = Wb; h.InterleavedBuffer = Vb; h.InstancedBufferAttribute = Xb; h.DynamicBufferAttribute = function (a, b) { console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."); return (new z(a, b)).setDynamic(!0) }; h.Float64Attribute = function (a, b) { return new z(new Float64Array(a), b) }; h.Float32Attribute = ma; h.Uint32Attribute = ce; h.Int32Attribute = function (a, b) { return new z(new Int32Array(a), b) }; h.Uint16Attribute = be; h.Int16Attribute = function (a, b) { return new z(new Int16Array(a), b) }; h.Uint8ClampedAttribute = function (a, b) { return new z(new Uint8ClampedArray(a), b) }; h.Uint8Attribute = function (a, b) { return new z(new Uint8Array(a), b) }; h.Int8Attribute = function (a, b) { return new z(new Int8Array(a), b) }; h.BufferAttribute = z; h.Face3 = ga; h.Object3DIdCount = function () { return ae++ }; h.Object3D = D; h.Raycaster = Id; h.Layers = Kc; h.EventDispatcher = pa; h.Clock = Kd; h.QuaternionLinearInterpolant = bd; h.LinearInterpolant = zc; h.DiscreteInterpolant = ad; h.CubicInterpolant = $c; h.Interpolant = ja; h.Triangle = Fa; h.Spline = function (a) { function b(a, b, c, d, e, f, g) { a = .5 * (c - a); d = .5 * (d - b); return (2 * (b - c) + a + d) * g + (-3 * (b - c) - 2 * a - d) * f + a * e + b } this.points = a; var c = [], d = { x: 0, y: 0, z: 0 }, e, f, g, h, l, m, u, p, n; this.initFromArray = function (a) { this.points = []; for (var b = 0; b < a.length; b++) this.points[b] = { x: a[b][0], y: a[b][1], z: a[b][2] } }; this.getPoint = function (a) { e = (this.points.length - 1) * a; f = Math.floor(e); g = e - f; c[0] = 0 === f ? f : f - 1; c[1] = f; c[2] = f > this.points.length - 2 ? this.points.length - 1 : f + 1; c[3] = f > this.points.length - 3 ? this.points.length - 1 : f + 2; m = this.points[c[0]]; u = this.points[c[1]]; p = this.points[c[2]]; n = this.points[c[3]]; h = g * g; l = g * h; d.x = b(m.x, u.x, p.x, n.x, g, h, l); d.y = b(m.y, u.y, p.y, n.y, g, h, l); d.z = b(m.z, u.z, p.z, n.z, g, h, l); return d }; this.getControlPointsArray = function () { var a, b, c = this.points.length, d = []; for (a = 0; a < c; a++) b = this.points[a], d[a] = [b.x, b.y, b.z]; return d }; this.getLength = function (a) { var b, c, d, e = 0, f = new q, g = new q, h = [], k = 0; h[0] = 0; a || (a = 100); c = this.points.length * a; f.copy(this.points[0]); for (a = 1; a < c; a++) b = a / c, d = this.getPoint(b), g.copy(d), k += g.distanceTo(f), f.copy(d), b *= this.points.length - 1, b = Math.floor(b), b !== e && (h[b] = k, e = b); h[h.length] = k; return { chunks: h, total: k } }; this.reparametrizeByArcLength = function (a) { var b, c, d, e, f, g, h = [], k = new q, l = this.getLength(); h.push(k.copy(this.points[0]).clone()); for (b = 1; b < this.points.length; b++) { c = l.chunks[b] - l.chunks[b - 1]; g = Math.ceil(a * c / l.total); e = (b - 1) / (this.points.length - 1); f = b / (this.points.length - 1); for (c = 1; c < g - 1; c++) d = e + 1 / g * c * (f - e), d = this.getPoint(d), h.push(k.copy(d).clone()); h.push(k.copy(this.points[b]).clone()) } this.points = h } }; h.Spherical = Ld; h.Plane = fa; h.Frustum = dc; h.Sphere = Aa; h.Ray = Wa; h.Matrix4 = P; h.Matrix3 = ya; h.Box3 = Ha; h.Box2 = cc; h.Line3 = cb; h.Euler = Xa; h.Vector4 = da; h.Vector3 = q; h.Vector2 = C; h.Quaternion = ca; h.Color = H; h.MorphBlendMesh = la; h.ImmediateRenderObject = Dc; h.VertexNormalsHelper = Ec; h.SpotLightHelper = Yb; h.SkeletonHelper = Zb; h.PointLightHelper = $b; h.HemisphereLightHelper = ac; h.GridHelper = Fc; h.FaceNormalsHelper = Gc; h.DirectionalLightHelper = bc; h.CameraHelper = Hc; h.BoundingBoxHelper = Ic; h.BoxHelper = Jc; h.ArrowHelper = yb; h.AxisHelper = id; h.ClosedSplineCurve3 = pe; h.SplineCurve3 = of; h.ArcCurve = jd; h.EllipseCurve = Ra; h.SplineCurve = tb; h.CubicBezierCurve = ub; h.QuadraticBezierCurve = vb; h.LineCurve = La; h.Shape = wb; h.ShapePath = vd; h.Path = Cc; h.Font = wd; h.CurvePath = Bc; h.Curve = Y; h.WireframeGeometry = Ib; h.ParametricGeometry = jc; h.TetrahedronGeometry = kc; h.OctahedronGeometry = lc; h.IcosahedronGeometry = mc; h.DodecahedronGeometry = nc; h.PolyhedronGeometry = sa; h.TubeGeometry = wa; h.TorusKnotGeometry = oc; h.TorusKnotBufferGeometry = Jb; h.TorusGeometry = pc; h.TorusBufferGeometry = Kb; h.TextGeometry = qc; h.SphereBufferGeometry = ib; h.SphereGeometry = Lb; h.RingGeometry = rc; h.RingBufferGeometry = Mb; h.PlaneBufferGeometry = eb; h.PlaneGeometry = sc; h.LatheGeometry = tc; h.LatheBufferGeometry = Nb; h.ShapeGeometry = Ya; h.ExtrudeGeometry = ra; h.EdgesGeometry = Ob; h.ConeGeometry = uc; h.ConeBufferGeometry = vc; h.CylinderGeometry = jb; h.CylinderBufferGeometry = Za; h.CircleBufferGeometry = Pb; h.CircleGeometry = wc; h.BoxBufferGeometry = db; h.BoxGeometry = kb; h.ShadowMaterial = Qb; h.SpriteMaterial = gb; h.RawShaderMaterial = Rb; h.ShaderMaterial = Da; h.PointsMaterial = Ja; h.MultiMaterial = xc; h.MeshPhysicalMaterial = lb; h.MeshStandardMaterial = Ka; h.MeshPhongMaterial = $a; h.MeshNormalMaterial = mb; h.MeshLambertMaterial = nb; h.MeshDepthMaterial = Ua; h.MeshBasicMaterial = Ia; h.LineDashedMaterial = ob; h.LineBasicMaterial = na; h.Material = S; h.REVISION = "81"; h.MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2 }; h.CullFaceNone = 0; h.CullFaceBack = 1; h.CullFaceFront = 2; h.CullFaceFrontBack = 3; h.FrontFaceDirectionCW = 0; h.FrontFaceDirectionCCW = 1; h.BasicShadowMap = 0; h.PCFShadowMap = 1; h.PCFSoftShadowMap = 2; h.FrontSide = 0; h.BackSide = 1; h.DoubleSide = 2; h.FlatShading = 1; h.SmoothShading = 2; h.NoColors = 0; h.FaceColors = 1; h.VertexColors = 2; h.NoBlending = 0; h.NormalBlending = 1; h.AdditiveBlending = 2; h.SubtractiveBlending = 3; h.MultiplyBlending = 4; h.CustomBlending = 5; h.BlendingMode = qe; h.AddEquation = 100; h.SubtractEquation = 101; h.ReverseSubtractEquation = 102; h.MinEquation = 103; h.MaxEquation = 104; h.ZeroFactor = 200; h.OneFactor = 201; h.SrcColorFactor = 202; h.OneMinusSrcColorFactor = 203; h.SrcAlphaFactor = 204; h.OneMinusSrcAlphaFactor = 205; h.DstAlphaFactor = 206; h.OneMinusDstAlphaFactor = 207; h.DstColorFactor = 208; h.OneMinusDstColorFactor = 209; h.SrcAlphaSaturateFactor = 210; h.NeverDepth = 0; h.AlwaysDepth = 1; h.LessDepth = 2; h.LessEqualDepth = 3; h.EqualDepth = 4; h.GreaterEqualDepth = 5; h.GreaterDepth = 6; h.NotEqualDepth = 7; h.MultiplyOperation = 0; h.MixOperation = 1; h.AddOperation = 2; h.NoToneMapping = 0; h.LinearToneMapping = 1; h.ReinhardToneMapping = 2; h.Uncharted2ToneMapping = 3; h.CineonToneMapping = 4; h.UVMapping = 300; h.CubeReflectionMapping = 301; h.CubeRefractionMapping = 302; h.EquirectangularReflectionMapping = 303; h.EquirectangularRefractionMapping = 304; h.SphericalReflectionMapping = 305; h.CubeUVReflectionMapping = 306; h.CubeUVRefractionMapping = 307; h.TextureMapping = re; h.RepeatWrapping = 1E3; h.ClampToEdgeWrapping = 1001; h.MirroredRepeatWrapping = 1002; h.TextureWrapping = Md; h.NearestFilter = 1003; h.NearestMipMapNearestFilter = 1004; h.NearestMipMapLinearFilter = 1005; h.LinearFilter = 1006; h.LinearMipMapNearestFilter = 1007; h.LinearMipMapLinearFilter = 1008; h.TextureFilter = Nd; h.UnsignedByteType = 1009; h.ByteType = 1010; h.ShortType = 1011; h.UnsignedShortType = 1012; h.IntType = 1013; h.UnsignedIntType = 1014; h.FloatType = 1015; h.HalfFloatType = 1016; h.UnsignedShort4444Type = 1017; h.UnsignedShort5551Type = 1018; h.UnsignedShort565Type = 1019; h.UnsignedInt248Type = 1020; h.AlphaFormat = 1021; h.RGBFormat = 1022; h.RGBAFormat = 1023; h.LuminanceFormat = 1024; h.LuminanceAlphaFormat = 1025; h.RGBEFormat = 1023; h.DepthFormat = 1026; h.DepthStencilFormat = 1027; h.RGB_S3TC_DXT1_Format = 2001; h.RGBA_S3TC_DXT1_Format = 2002; h.RGBA_S3TC_DXT3_Format = 2003; h.RGBA_S3TC_DXT5_Format = 2004; h.RGB_PVRTC_4BPPV1_Format = 2100; h.RGB_PVRTC_2BPPV1_Format = 2101; h.RGBA_PVRTC_4BPPV1_Format = 2102; h.RGBA_PVRTC_2BPPV1_Format = 2103; h.RGB_ETC1_Format = 2151; h.LoopOnce = 2200; h.LoopRepeat = 2201; h.LoopPingPong = 2202; h.InterpolateDiscrete = 2300; h.InterpolateLinear = 2301; h.InterpolateSmooth = 2302; h.ZeroCurvatureEnding = 2400; h.ZeroSlopeEnding = 2401; h.WrapAroundEnding = 2402; h.TrianglesDrawMode = 0; h.TriangleStripDrawMode = 1; h.TriangleFanDrawMode = 2; h.LinearEncoding = 3E3; h.sRGBEncoding = 3001; h.GammaEncoding = 3007; h.RGBEEncoding = 3002; h.LogLuvEncoding = 3003; h.RGBM7Encoding = 3004; h.RGBM16Encoding = 3005; h.RGBDEncoding = 3006; h.BasicDepthPacking = 3200; h.RGBADepthPacking = 3201; h.CubeGeometry = kb; h.Face4 = function (a, b, c, d, e, f, g) { console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."); return new ga(a, b, c, e, f, g) }; h.LineStrip = 0; h.LinePieces = 1; h.MeshFaceMaterial = xc; h.PointCloud = function (a, b) { console.warn("THREE.PointCloud has been renamed to THREE.Points."); return new Gb(a, b) }; h.Particle = fc; h.ParticleSystem = function (a, b) { console.warn("THREE.ParticleSystem has been renamed to THREE.Points."); return new Gb(a, b) }; h.PointCloudMaterial = function (a) { console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."); return new Ja(a) }; h.ParticleBasicMaterial = function (a) { console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."); return new Ja(a) }; h.ParticleSystemMaterial = function (a) { console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."); return new Ja(a) }; h.Vertex = function (a, b, c) { console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."); return new q(a, b, c) }; h.EdgesHelper = function (a, b) { console.warn("THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead."); return new ha(new Ob(a.geometry), new na({ color: void 0 !== b ? b : 16777215 })) }; h.WireframeHelper = function (a, b) { console.warn("THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead."); return new ha(new Ib(a.geometry), new na({ color: void 0 !== b ? b : 16777215 })) }; h.GeometryUtils = { merge: function (a, b, c) { console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead."); var d; b.isMesh && (b.matrixAutoUpdate && b.updateMatrix(), d = b.matrix, b = b.geometry); a.merge(b, d, c) }, center: function (a) { console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."); return a.center() } }; h.ImageUtils = { crossOrigin: void 0, loadTexture: function (a, b, c, d) { console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead."); var e = new Sc; e.setCrossOrigin(this.crossOrigin); a = e.load(a, c, void 0, d); b && (a.mapping = b); return a }, loadTextureCube: function (a, b, c, d) { console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead."); var e = new sd; e.setCrossOrigin(this.crossOrigin); a = e.load(a, c, void 0, d); b && (a.mapping = b); return a }, loadCompressedTexture: function () { console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.") }, loadCompressedTextureCube: function () { console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.") } }; h.Projector = function () { console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."); this.projectVector = function (a, b) { console.warn("THREE.Projector: .projectVector() is now vector.project()."); a.project(b) }; this.unprojectVector = function (a, b) { console.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."); a.unproject(b) }; this.pickingRay = function (a, b) { console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().") } }; h.CanvasRenderer = function () { console.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"); this.domElement = document.createElementNS("http://www.w3.org/1999/xhtml", "canvas"); this.clear = function () {}; this.render = function () {}; this.setClearColor = function () {}; this.setSize = function () {} }; Object.defineProperty(h, "__esModule", { value: !0 }) }); /* (c) Jonathan Gotti - licence: https://github.com/malko/d.js/LICENCE.txt @version 0.7.5*/ !function (a) { "use strict"; function b(a) { l(function () { throw a }) } function c(b) { return this.then(b, a) } function d(b) { return this.then(a, b) } function e(b, c) { return this.then(function (a) { return m(b) ? b.apply(null, n(a) ? a : [a]) : v.onlyFuncs ? a : b }, c || a) } function f(a) { function b() { a() } return this.then(b, b), this } function g(a) { return this.then(function (b) { return m(a) ? a.apply(null, n(b) ? b.splice(0, 0, void 0) && b : [void 0, b]) : v.onlyFuncs ? b : a }, function (b) { return a(b) }) } function h(c) { return this.then(a, c ? function (a) { throw c(a), a } : b) } function i(a, b) { var c = q(a); if (1 === c.length && n(c[0])) { if (!c[0].length) return v.fulfilled([]); c = c[0] } var d = [], e = v(), f = c.length; if (f) for (var g = function (a) { c[a] = v.promisify(c[a]), c[a].then(function (g) { d[a] = b ? c[a] : g, --f || e.resolve(d) }, function (g) { b ? (d[a] = c[a], --f || e.resolve(d)) : e.reject(g) }) }, h = 0, i = f; i > h; h++) g(h); else e.resolve(d); return e.promise } function j(a, b) { return a.then(m(b) ? b : function () { return b }) } function k(a) { var b = q(a); 1 === b.length && n(b[0]) && (b = b[0]); for (var c = v(), d = 0, e = b.length, f = v.resolved(); e > d; d++) f = j(f, b[d]); return c.resolve(f), c.promise } var l, m = function (a) { return "function" == typeof a }, n = function (a) { return Array.isArray ? Array.isArray(a) : a instanceof Array }, o = function (a) { return !(!a || !(typeof a).match(/function|object/)) }, p = function (b) { return b === !1 || b === a || null === b }, q = function (a, b) { return [].slice.call(a, b) }, r = "undefined", s = typeof TypeError === r ? Error : TypeError; if (typeof process !== r && process.nextTick) l = process.nextTick; else if (typeof MessageChannel !== r) { var t = new MessageChannel, u = []; t.port1.onmessage = function () { u.length && u.shift()() }, l = function (a) { u.push(a), t.port2.postMessage(0) } } else l = function (a) { setTimeout(a, 0) }; var v = function (b) { function i() { if (0 !== r) { var a, b = t, c = 0, d = b.length, e = ~r ? 0 : 1; for (t = []; d > c; c++) (a = b[c][e]) && a(n) } } function j(a) { function b(a) { return function (b) { return c ? void 0 : (c = !0, a(b)) } } var c = !1; if (r) return this; try { var d = o(a) && a.then; if (m(d)) { if (a === u) throw new s("Promise can't resolve itself"); return d.call(a, b(j), b(k)), this } } catch (e) { return b(k)(e), this } return q(function () { n = a, r = 1, i() }), this } function k(a) { return r || q(function () { try { throw a } catch (b) { n = b } r = -1, i() }), this } var n, q = (a !== b ? b : v.alwaysAsync) ? l : function (a) { a() }, r = 0, t = [], u = { then: function (a, b) { var c = v(); return t.push([function (b) { try { p(a) ? c.resolve(b) : c.resolve(m(a) ? a(b) : v.onlyFuncs ? b : a) } catch (d) { c.reject(d) } }, function (a) { if ((p(b) || !m(b) && v.onlyFuncs) && c.reject(a), b) try { c.resolve(m(b) ? b(a) : b) } catch (d) { c.reject(d) } } ]), 0 !== r && q(i), c.promise }, success: c, error: d, otherwise: d, apply: e, spread: e, ensure: f, nodify: g, rethrow: h, isPending: function () { return 0 === r }, getStatus: function () { return r } }; return u.toSource = u.toString = u.valueOf = function () { return n === a ? this : n }, { promise: u, resolve: j, fulfill: j, reject: k } }; if (v.deferred = v.defer = v, v.nextTick = l, v.alwaysAsync = !0, v.onlyFuncs = !0, v.resolve = v.resolved = v.fulfilled = function (a) { return v(!0).resolve(a).promise }, v.reject = v.rejected = function (a) { return v(!0).reject(a).promise }, v.wait = function (a) { var b = v(); return setTimeout(b.resolve, a || 0), b.promise }, v.delay = function (a, b) { var c = v(); return setTimeout(function () { try { c.resolve(m(a) ? a.apply(null) : a) } catch (b) { c.reject(b) } }, b || 0), c.promise }, v.promisify = function (a) { return a && m(a.then) ? a : v.resolved(a) }, v.all = function () { return i(arguments, !1) }, v.resolveAll = function () { return i(arguments, !0) }, v.sequence = function () { return k(arguments) }, v.nodeCapsule = function (a, b) { return b || (b = a, a = void 0), function () { var c = v(), d = q(arguments); d.push(function (a, b) { a ? c.reject(a) : c.resolve(arguments.length > 2 ? q(arguments, 1) : b) }); try { b.apply(a, d) } catch (e) { c.reject(e) } return c.promise } }, "function" == typeof define && define.amd) define("D.js", [], function () { return v }); else if (typeof module !== r && module.exports) module.exports = v; else if (typeof window !== r) { var w = window.D; v.noConflict = function () { return window.D = w, v }, window.D = v } } (); /*! * uEvent 1.0.0 - to make any js object an event emitter * Copyright 2011 Jerome Etienne (http://jetienne.com) * Copyright 2015-2016 Damien "Mistic" Sorel (http://www.strangeplanet.fr) * Licensed under MIT (http://opensource.org/licenses/MIT) */ !function (a, b) { "undefined" != typeof module && module.exports ? module.exports = b() : "function" == typeof define && define.amd ? define([], b) : a.uEvent = b() } (this, function () { "use strict"; var a = function () { return !0 }, b = function () { return !1 }, c = function () {}; return c.Event = function (a, b) { var c = a, d = b; Object.defineProperties(this, { type: { get: function () { return c }, set: function (a) {}, enumerable: !0 }, args: { get: function () { return d }, set: function (a) {}, enumerable: !0 } }) }, c.Event.prototype = { constructor: c.Event, isDefaultPrevented: b, isPropagationStopped: b, preventDefault: function () { this.isDefaultPrevented = a }, stopPropagation: function () { this.isPropagationStopped = a } }, c.prototype = { constructor: c, on: function (a, b) { if (this.__events = this.__events || {}, "object" == typeof a) for (var c in a) a.hasOwnProperty(c) && (this.__events[c] = this.__events[c] || [], this.__events[c].push(a[c])); else a.split(" ").forEach(function (a) { this.__events[a] = this.__events[a] || [], this.__events[a].push(b) }, this); return this }, off: function (a, b) { if (this.__events = this.__events || {}, "object" == typeof a) { for (var c in a) if (a.hasOwnProperty(c) && c in this.__events) { var d = this.__events[c].indexOf(a[c]); -1 !== d && this.__events[c].splice(d, 1) } } else a ? a.split(" ").forEach(function (a) { if (a in this.__events) if (b) { var c = this.__events[a].indexOf(b); -1 !== c && this.__events[a].splice(c, 1) } else this.__events[a].length = 0 }, this) : this.__events = {}; return this }, once: function (a, b) { if (this.__once = this.__once || {}, "object" == typeof a) for (var c in a) a.hasOwnProperty(c) && (this.__once[c] = this.__once[c] || [], this.__once[c].push(a[c])); else a.split(" ").forEach(function (a) { this.__once[a] = this.__once[a] || [], this.__once[a].push(b) }, this); return this }, trigger: function (a) { var b, d, e, f = Array.prototype.slice.call(arguments, 1), g = new c.Event(a, f); if (f.push(g), this.__events && a in this.__events) for (b = 0, d = this.__events[a].length; d > b; b++) if (e = this.__events[a][b], "object" == typeof e ? e.handleEvent(g) : e.apply(this, f), g.isPropagationStopped()) return g; if (this.__once && a in this.__once) { for (b = 0, d = this.__once[a].length; d > b; b++) if (e = this.__once[a][b], "object" == typeof e ? e.handleEvent(g) : e.apply(this, f), g.isPropagationStopped()) return delete this.__once[a], g; delete this.__once[a] } return g }, change: function (a, b) { var d, e, f, g = Array.prototype.slice.call(arguments, 1), h = new c.Event(a, g); if (g.push(h), this.__events && a in this.__events) for (d = 0, e = this.__events[a].length; e > d; d++) if (g[0] = b, f = this.__events[a][d], b = "object" == typeof f ? f.handleEvent(h) : f.apply(this, g), h.isPropagationStopped()) return b; return b } }, c.mixin = function (a, b) { b = b || {}, a = "function" == typeof a ? a.prototype : a, ["on", "off", "once", "trigger", "change"].forEach(function (d) { var e = b[d] || d; a[e] = c.prototype[d] }), Object.defineProperties(a, { __events: { value: null, writable: !0 }, __once: { value: null, writable: !0 } }) }, c }); /* Laura Doktorova https://github.com/olado/doT */ (function () { function p(b, a, d) { return ("string" === typeof a ? a : a.toString()).replace(b.define || h, function (a, c, e, g) { 0 === c.indexOf("def.") && (c = c.substring(4)); c in d || (":" === e ? (b.defineParams && g.replace(b.defineParams, function (a, b, l) { d[c] = { arg: b, text: l } }), c in d || (d[c] = g)) : (new Function("def", "def['" + c + "']=" + g))(d)); return "" }).replace(b.use || h, function (a, c) { b.useParams && (c = c.replace(b.useParams, function (a, b, c, l) { if (d[c] && d[c].arg && l) return a = (c + ":" + l).replace(/'|\\/g, "_"), d.__exp = d.__exp || {}, d.__exp[a] = d[c].text.replace(new RegExp("(^|[^\\w$])" + d[c].arg + "([^\\w$])", "g"), "$1" + l + "$2"), b + "def.__exp['" + a + "']" })); var e = (new Function("def", "return " + c))(d); return e ? p(b, e, d) : e }) } function k(b) { return b.replace(/\\('|\\)/g, "$1").replace(/[\r\t\n]/g, " ") } var f = { version: "1.0.3", templateSettings: { evaluate: /\{\{([\s\S]+?(\}?)+)\}\}/g, interpolate: /\{\{=([\s\S]+?)\}\}/g, encode: /\{\{!([\s\S]+?)\}\}/g, use: /\{\{#([\s\S]+?)\}\}/g, useParams: /(^|[^\w$])def(?:\.|\[[\'\"])([\w$\.]+)(?:[\'\"]\])?\s*\:\s*([\w$\.]+|\"[^\"]+\"|\'[^\']+\'|\{[^\}]+\})/g, define: /\{\{##\s*([\w\.$]+)\s*(\:|=)([\s\S]+?)#\}\}/g, defineParams: /^\s*([\w$]+):([\s\S]+)/, conditional: /\{\{\?(\?)?\s*([\s\S]*?)\s*\}\}/g, iterate: /\{\{~\s*(?:\}\}|([\s\S]+?)\s*\:\s*([\w$]+)\s*(?:\:\s*([\w$]+))?\s*\}\})/g, varname: "it", strip: !0, append: !0, selfcontained: !1, doNotSkipEncoded: !1 }, template: void 0, compile: void 0 }, m; f.encodeHTMLSource = function (b) { var a = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'", "/": "/" }, d = b ? /[&<>"'\/]/g : /&(?!#?\w+;)|<|>|"|'|\//g; return function (b) { return b ? b.toString().replace(d, function (b) { return a[b] || b }) : "" } }; m = function () { return this || (0, eval)("this") } (); "undefined" !== typeof module && module.exports ? module.exports = f : "function" === typeof define && define.amd ? define(function () { return f }) : m.doT = f; var r = { start: "'+(", end: ")+'", startencode: "'+encodeHTML(" }, s = { start: "';out+=(", end: ");out+='", startencode: "';out+=encodeHTML(" }, h = /$^/; f.template = function (b, a, d) { a = a || f.templateSettings; var n = a.append ? r : s, c, e = 0, g; b = a.use || a.define ? p(a, b, d || {}) : b; b = ("var out='" + (a.strip ? b.replace(/(^|\r|\n)\t* +| +\t*(\r|\n|$)/g, " ").replace(/\r|\n|\t|\/\*[\s\S]*?\*\//g, "") : b).replace(/'|\\/g, "\\$&").replace(a.interpolate || h, function (b, a) { return n.start + k(a) + n.end }).replace(a.encode || h, function (b, a) { c = !0; return n.startencode + k(a) + n.end }).replace(a.conditional || h, function (b, a, c) { return a ? c ? "';}else if(" + k(c) + "){out+='" : "';}else{out+='" : c ? "';if(" + k(c) + "){out+='" : "';}out+='" }).replace(a.iterate || h, function (b, a, c, d) { if (!a) return "';} } out+='"; e += 1; g = d || "i" + e; a = k(a); return "';var arr" + e + "=" + a + ";if(arr" + e + "){var " + c + "," + g + "=-1,l" + e + "=arr" + e + ".length-1;while(" + g + " 0) { setBlending(THREE.NormalBlending); setOpacity(1); setFillStyle('rgba(' + Math.floor(_clearColor.r * 255) + ',' + Math.floor(_clearColor.g * 255) + ',' + Math.floor(_clearColor.b * 255) + ',' + _clearAlpha + ')'); _context.fillRect( _clearBox.min.x | 0, _clearBox.max.y | 0, (_clearBox.max.x - _clearBox.min.x) | 0, (_clearBox.min.y - _clearBox.max.y) | 0); } _clearBox.makeEmpty(); } }; // compatibility this.clearColor = function () {}; this.clearDepth = function () {}; this.clearStencil = function () {}; this.render = function (scene, camera) { if (camera instanceof THREE.Camera === false) { console.error('THREE.CanvasRenderer.render: camera is not an instance of THREE.Camera.'); return; } if (this.autoClear === true) this.clear(); _this.info.render.vertices = 0; _this.info.render.faces = 0; _context.setTransform(_viewportWidth / _canvasWidth, 0, 0, - _viewportHeight / _canvasHeight, _viewportX, _canvasHeight - _viewportY); _context.translate(_canvasWidthHalf, _canvasHeightHalf); _renderData = _projector.projectScene(scene, camera, this.sortObjects, this.sortElements); _elements = _renderData.elements; _lights = _renderData.lights; _camera = camera; _normalViewMatrix.getNormalMatrix(camera.matrixWorldInverse); /* DEBUG setFillStyle( 'rgba( 0, 255, 255, 0.5 )' ); _context.fillRect( _clipBox.min.x, _clipBox.min.y, _clipBox.max.x - _clipBox.min.x, _clipBox.max.y - _clipBox.min.y ); */ calculateLights(); for (var e = 0, el = _elements.length; e < el; e++) { var element = _elements[e]; var material = element.material; if (material === undefined || material.opacity === 0) continue; _elemBox.makeEmpty(); if (element instanceof THREE.RenderableSprite) { _v1 = element; _v1.x *= _canvasWidthHalf; _v1.y *= _canvasHeightHalf; renderSprite(_v1, element, material); } else if (element instanceof THREE.RenderableLine) { _v1 = element.v1; _v2 = element.v2; _v1.positionScreen.x *= _canvasWidthHalf; _v1.positionScreen.y *= _canvasHeightHalf; _v2.positionScreen.x *= _canvasWidthHalf; _v2.positionScreen.y *= _canvasHeightHalf; _elemBox.setFromPoints([ _v1.positionScreen, _v2.positionScreen ]); if (_clipBox.intersectsBox(_elemBox) === true) { renderLine(_v1, _v2, element, material); } } else if (element instanceof THREE.RenderableFace) { _v1 = element.v1; _v2 = element.v2; _v3 = element.v3; if (_v1.positionScreen.z < - 1 || _v1.positionScreen.z > 1) continue; if (_v2.positionScreen.z < - 1 || _v2.positionScreen.z > 1) continue; if (_v3.positionScreen.z < - 1 || _v3.positionScreen.z > 1) continue; _v1.positionScreen.x *= _canvasWidthHalf; _v1.positionScreen.y *= _canvasHeightHalf; _v2.positionScreen.x *= _canvasWidthHalf; _v2.positionScreen.y *= _canvasHeightHalf; _v3.positionScreen.x *= _canvasWidthHalf; _v3.positionScreen.y *= _canvasHeightHalf; if (material.overdraw > 0) { expand(_v1.positionScreen, _v2.positionScreen, material.overdraw); expand(_v2.positionScreen, _v3.positionScreen, material.overdraw); expand(_v3.positionScreen, _v1.positionScreen, material.overdraw); } _elemBox.setFromPoints([ _v1.positionScreen, _v2.positionScreen, _v3.positionScreen ]); if (_clipBox.intersectsBox(_elemBox) === true) { renderFace3(_v1, _v2, _v3, 0, 1, 2, element, material); } } /* DEBUG setLineWidth( 1 ); setStrokeStyle( 'rgba( 0, 255, 0, 0.5 )' ); _context.strokeRect( _elemBox.min.x, _elemBox.min.y, _elemBox.max.x - _elemBox.min.x, _elemBox.max.y - _elemBox.min.y ); */ _clearBox.union(_elemBox); } /* DEBUG setLineWidth( 1 ); setStrokeStyle( 'rgba( 255, 0, 0, 0.5 )' ); _context.strokeRect( _clearBox.min.x, _clearBox.min.y, _clearBox.max.x - _clearBox.min.x, _clearBox.max.y - _clearBox.min.y ); */ _context.setTransform(1, 0, 0, 1, 0, 0); }; // function calculateLights() { _ambientLight.setRGB(0, 0, 0); _directionalLights.setRGB(0, 0, 0); _pointLights.setRGB(0, 0, 0); for (var l = 0, ll = _lights.length; l < ll; l++) { var light = _lights[l]; var lightColor = light.color; if (light instanceof THREE.AmbientLight) { _ambientLight.add(lightColor); } else if (light instanceof THREE.DirectionalLight) { // for sprites _directionalLights.add(lightColor); } else if (light instanceof THREE.PointLight) { // for sprites _pointLights.add(lightColor); } } } function calculateLight(position, normal, color) { for (var l = 0, ll = _lights.length; l < ll; l++) { var light = _lights[l]; _lightColor.copy(light.color); if (light instanceof THREE.DirectionalLight) { var lightPosition = _vector3.setFromMatrixPosition(light.matrixWorld).normalize(); var amount = normal.dot(lightPosition); if (amount <= 0) continue; amount *= light.intensity; color.add(_lightColor.multiplyScalar(amount)); } else if (light instanceof THREE.PointLight) { var lightPosition = _vector3.setFromMatrixPosition(light.matrixWorld); var amount = normal.dot(_vector3.subVectors(lightPosition, position).normalize()); if (amount <= 0) continue; amount *= light.distance == 0 ? 1 : 1 - Math.min(position.distanceTo(lightPosition) / light.distance, 1); if (amount == 0) continue; amount *= light.intensity; color.add(_lightColor.multiplyScalar(amount)); } } } function renderSprite(v1, element, material) { setOpacity(material.opacity); setBlending(material.blending); var scaleX = element.scale.x * _canvasWidthHalf; var scaleY = element.scale.y * _canvasHeightHalf; var dist = 0.5 * Math.sqrt(scaleX * scaleX + scaleY * scaleY); // allow for rotated sprite _elemBox.min.set(v1.x - dist, v1.y - dist); _elemBox.max.set(v1.x + dist, v1.y + dist); if (material instanceof THREE.SpriteMaterial) { var texture = material.map; if (texture !== null) { var pattern = _patterns[texture.id]; if (pattern === undefined || pattern.version !== texture.version) { pattern = textureToPattern(texture); _patterns[texture.id] = pattern; } if (pattern.canvas !== undefined) { setFillStyle(pattern.canvas); var bitmap = texture.image; var ox = bitmap.width * texture.offset.x; var oy = bitmap.height * texture.offset.y; var sx = bitmap.width * texture.repeat.x; var sy = bitmap.height * texture.repeat.y; var cx = scaleX / sx; var cy = scaleY / sy; _context.save(); _context.translate(v1.x, v1.y); if (material.rotation !== 0) _context.rotate(material.rotation); _context.translate( - scaleX / 2, - scaleY / 2); _context.scale(cx, cy); _context.translate( - ox, - oy); _context.fillRect(ox, oy, sx, sy); _context.restore(); } } else { // no texture setFillStyle(material.color.getStyle()); _context.save(); _context.translate(v1.x, v1.y); if (material.rotation !== 0) _context.rotate(material.rotation); _context.scale(scaleX, - scaleY); _context.fillRect( - 0.5, - 0.5, 1, 1); _context.restore(); } } else if (material instanceof THREE.SpriteCanvasMaterial) { setStrokeStyle(material.color.getStyle()); setFillStyle(material.color.getStyle()); _context.save(); _context.translate(v1.x, v1.y); if (material.rotation !== 0) _context.rotate(material.rotation); _context.scale(scaleX, scaleY); material.program(_context); _context.restore(); } /* DEBUG setStrokeStyle( 'rgb(255,255,0)' ); _context.beginPath(); _context.moveTo( v1.x - 10, v1.y ); _context.lineTo( v1.x + 10, v1.y ); _context.moveTo( v1.x, v1.y - 10 ); _context.lineTo( v1.x, v1.y + 10 ); _context.stroke(); */ } function renderLine(v1, v2, element, material) { setOpacity(material.opacity); setBlending(material.blending); _context.beginPath(); _context.moveTo(v1.positionScreen.x, v1.positionScreen.y); _context.lineTo(v2.positionScreen.x, v2.positionScreen.y); if (material instanceof THREE.LineBasicMaterial) { setLineWidth(material.linewidth); setLineCap(material.linecap); setLineJoin(material.linejoin); if (material.vertexColors !== THREE.VertexColors) { setStrokeStyle(material.color.getStyle()); } else { var colorStyle1 = element.vertexColors[0].getStyle(); var colorStyle2 = element.vertexColors[1].getStyle(); if (colorStyle1 === colorStyle2) { setStrokeStyle(colorStyle1); } else { try { var grad = _context.createLinearGradient( v1.positionScreen.x, v1.positionScreen.y, v2.positionScreen.x, v2.positionScreen.y); grad.addColorStop(0, colorStyle1); grad.addColorStop(1, colorStyle2); } catch (exception) { grad = colorStyle1; } setStrokeStyle(grad); } } _context.stroke(); _elemBox.expandByScalar(material.linewidth * 2); } else if (material instanceof THREE.LineDashedMaterial) { setLineWidth(material.linewidth); setLineCap(material.linecap); setLineJoin(material.linejoin); setStrokeStyle(material.color.getStyle()); setLineDash([material.dashSize, material.gapSize]); _context.stroke(); _elemBox.expandByScalar(material.linewidth * 2); setLineDash([]); } } function renderFace3(v1, v2, v3, uv1, uv2, uv3, element, material) { _this.info.render.vertices += 3; _this.info.render.faces++; setOpacity(material.opacity); setBlending(material.blending); _v1x = v1.positionScreen.x; _v1y = v1.positionScreen.y; _v2x = v2.positionScreen.x; _v2y = v2.positionScreen.y; _v3x = v3.positionScreen.x; _v3y = v3.positionScreen.y; drawTriangle(_v1x, _v1y, _v2x, _v2y, _v3x, _v3y); if ((material instanceof THREE.MeshLambertMaterial || material instanceof THREE.MeshPhongMaterial) && material.map === null) { _diffuseColor.copy(material.color); _emissiveColor.copy(material.emissive); if (material.vertexColors === THREE.FaceColors) { _diffuseColor.multiply(element.color); } _color.copy(_ambientLight); _centroid.copy(v1.positionWorld).add(v2.positionWorld).add(v3.positionWorld).divideScalar(3); calculateLight(_centroid, element.normalModel, _color); _color.multiply(_diffuseColor).add(_emissiveColor); material.wireframe === true ? strokePath(_color, material.wireframeLinewidth, material.wireframeLinecap, material.wireframeLinejoin) : fillPath(_color); } else if (material instanceof THREE.MeshBasicMaterial || material instanceof THREE.MeshLambertMaterial || material instanceof THREE.MeshPhongMaterial) { if (material.map !== null) { var mapping = material.map.mapping; if (mapping === THREE.UVMapping) { _uvs = element.uvs; patternPath(_v1x, _v1y, _v2x, _v2y, _v3x, _v3y, _uvs[uv1].x, _uvs[uv1].y, _uvs[uv2].x, _uvs[uv2].y, _uvs[uv3].x, _uvs[uv3].y, material.map); } } else if (material.envMap !== null) { if (material.envMap.mapping === THREE.SphericalReflectionMapping) { _normal.copy(element.vertexNormalsModel[uv1]).applyMatrix3(_normalViewMatrix); _uv1x = 0.5 * _normal.x + 0.5; _uv1y = 0.5 * _normal.y + 0.5; _normal.copy(element.vertexNormalsModel[uv2]).applyMatrix3(_normalViewMatrix); _uv2x = 0.5 * _normal.x + 0.5; _uv2y = 0.5 * _normal.y + 0.5; _normal.copy(element.vertexNormalsModel[uv3]).applyMatrix3(_normalViewMatrix); _uv3x = 0.5 * _normal.x + 0.5; _uv3y = 0.5 * _normal.y + 0.5; patternPath(_v1x, _v1y, _v2x, _v2y, _v3x, _v3y, _uv1x, _uv1y, _uv2x, _uv2y, _uv3x, _uv3y, material.envMap); } } else { _color.copy(material.color); if (material.vertexColors === THREE.FaceColors) { _color.multiply(element.color); } material.wireframe === true ? strokePath(_color, material.wireframeLinewidth, material.wireframeLinecap, material.wireframeLinejoin) : fillPath(_color); } } else if (material instanceof THREE.MeshNormalMaterial) { _normal.copy(element.normalModel).applyMatrix3(_normalViewMatrix); _color.setRGB(_normal.x, _normal.y, _normal.z).multiplyScalar(0.5).addScalar(0.5); material.wireframe === true ? strokePath(_color, material.wireframeLinewidth, material.wireframeLinecap, material.wireframeLinejoin) : fillPath(_color); } else { _color.setRGB(1, 1, 1); material.wireframe === true ? strokePath(_color, material.wireframeLinewidth, material.wireframeLinecap, material.wireframeLinejoin) : fillPath(_color); } } // function drawTriangle(x0, y0, x1, y1, x2, y2) { _context.beginPath(); _context.moveTo(x0, y0); _context.lineTo(x1, y1); _context.lineTo(x2, y2); _context.closePath(); } function strokePath(color, linewidth, linecap, linejoin) { setLineWidth(linewidth); setLineCap(linecap); setLineJoin(linejoin); setStrokeStyle(color.getStyle()); _context.stroke(); _elemBox.expandByScalar(linewidth * 2); } function fillPath(color) { setFillStyle(color.getStyle()); _context.fill(); } function textureToPattern(texture) { if (texture.version === 0 || texture instanceof THREE.CompressedTexture || texture instanceof THREE.DataTexture) { return { canvas: undefined, version: texture.version }; } var image = texture.image; if (image.complete === false) { return { canvas: undefined, version: 0 }; } var canvas = document.createElement('canvas'); canvas.width = image.width; canvas.height = image.height; var context = canvas.getContext('2d'); context.setTransform(1, 0, 0, - 1, 0, image.height); context.drawImage(image, 0, 0); var repeatX = texture.wrapS === THREE.RepeatWrapping; var repeatY = texture.wrapT === THREE.RepeatWrapping; var repeat = 'no-repeat'; if (repeatX === true && repeatY === true) { repeat = 'repeat'; } else if (repeatX === true) { repeat = 'repeat-x'; } else if (repeatY === true) { repeat = 'repeat-y'; } var pattern = _context.createPattern(canvas, repeat); if (texture.onUpdate) texture.onUpdate(texture); return { canvas: pattern, version: texture.version }; } function patternPath(x0, y0, x1, y1, x2, y2, u0, v0, u1, v1, u2, v2, texture) { var pattern = _patterns[texture.id]; if (pattern === undefined || pattern.version !== texture.version) { pattern = textureToPattern(texture); _patterns[texture.id] = pattern; } if (pattern.canvas !== undefined) { setFillStyle(pattern.canvas); } else { setFillStyle('rgba( 0, 0, 0, 1)'); _context.fill(); return; } // http://extremelysatisfactorytotalitarianism.com/blog/?p=2120 var a, b, c, d, e, f, det, idet, offsetX = texture.offset.x / texture.repeat.x, offsetY = texture.offset.y / texture.repeat.y, width = texture.image.width * texture.repeat.x, height = texture.image.height * texture.repeat.y; u0 = (u0 + offsetX) * width; v0 = (v0 + offsetY) * height; u1 = (u1 + offsetX) * width; v1 = (v1 + offsetY) * height; u2 = (u2 + offsetX) * width; v2 = (v2 + offsetY) * height; x1 -= x0; y1 -= y0; x2 -= x0; y2 -= y0; u1 -= u0; v1 -= v0; u2 -= u0; v2 -= v0; det = u1 * v2 - u2 * v1; if (det === 0) return; idet = 1 / det; a = (v2 * x1 - v1 * x2) * idet; b = (v2 * y1 - v1 * y2) * idet; c = (u1 * x2 - u2 * x1) * idet; d = (u1 * y2 - u2 * y1) * idet; e = x0 - a * u0 - c * v0; f = y0 - b * u0 - d * v0; _context.save(); _context.transform(a, b, c, d, e, f); _context.fill(); _context.restore(); } function clipImage(x0, y0, x1, y1, x2, y2, u0, v0, u1, v1, u2, v2, image) { // http://extremelysatisfactorytotalitarianism.com/blog/?p=2120 var a, b, c, d, e, f, det, idet, width = image.width - 1, height = image.height - 1; u0 *= width; v0 *= height; u1 *= width; v1 *= height; u2 *= width; v2 *= height; x1 -= x0; y1 -= y0; x2 -= x0; y2 -= y0; u1 -= u0; v1 -= v0; u2 -= u0; v2 -= v0; det = u1 * v2 - u2 * v1; idet = 1 / det; a = (v2 * x1 - v1 * x2) * idet; b = (v2 * y1 - v1 * y2) * idet; c = (u1 * x2 - u2 * x1) * idet; d = (u1 * y2 - u2 * y1) * idet; e = x0 - a * u0 - c * v0; f = y0 - b * u0 - d * v0; _context.save(); _context.transform(a, b, c, d, e, f); _context.clip(); _context.drawImage(image, 0, 0); _context.restore(); } // Hide anti-alias gaps function expand(v1, v2, pixels) { var x = v2.x - v1.x, y = v2.y - v1.y, det = x * x + y * y, idet; if (det === 0) return; idet = pixels / Math.sqrt(det); x *= idet; y *= idet; v2.x += x; v2.y += y; v1.x -= x; v1.y -= y; } // Context cached methods. function setOpacity(value) { if (_contextGlobalAlpha !== value) { _context.globalAlpha = value; _contextGlobalAlpha = value; } } function setBlending(value) { if (_contextGlobalCompositeOperation !== value) { if (value === THREE.NormalBlending) { _context.globalCompositeOperation = 'source-over'; } else if (value === THREE.AdditiveBlending) { _context.globalCompositeOperation = 'lighter'; } else if (value === THREE.SubtractiveBlending) { _context.globalCompositeOperation = 'darker'; } else if (value === THREE.MultiplyBlending) { _context.globalCompositeOperation = 'multiply'; } _contextGlobalCompositeOperation = value; } } function setLineWidth(value) { if (_contextLineWidth !== value) { _context.lineWidth = value; _contextLineWidth = value; } } function setLineCap(value) { // "butt", "round", "square" if (_contextLineCap !== value) { _context.lineCap = value; _contextLineCap = value; } } function setLineJoin(value) { // "round", "bevel", "miter" if (_contextLineJoin !== value) { _context.lineJoin = value; _contextLineJoin = value; } } function setStrokeStyle(value) { if (_contextStrokeStyle !== value) { _context.strokeStyle = value; _contextStrokeStyle = value; } } function setFillStyle(value) { if (_contextFillStyle !== value) { _context.fillStyle = value; _contextFillStyle = value; } } function setLineDash(value) { if (_contextLineDash.length !== value.length) { _context.setLineDash(value); _contextLineDash = value; } } }; /** * @author mrdoob / http://mrdoob.com/ * @author supereggbert / http://www.paulbrunt.co.uk/ * @author julianwa / https://github.com/julianwa */ THREE.RenderableObject = function () { this.id = 0; this.object = null; this.z = 0; this.renderOrder = 0; }; // THREE.RenderableFace = function () { this.id = 0; this.v1 = new THREE.RenderableVertex(); this.v2 = new THREE.RenderableVertex(); this.v3 = new THREE.RenderableVertex(); this.normalModel = new THREE.Vector3(); this.vertexNormalsModel = [new THREE.Vector3(), new THREE.Vector3(), new THREE.Vector3()]; this.vertexNormalsLength = 0; this.color = new THREE.Color(); this.material = null; this.uvs = [new THREE.Vector2(), new THREE.Vector2(), new THREE.Vector2()]; this.z = 0; this.renderOrder = 0; }; // THREE.RenderableVertex = function () { this.position = new THREE.Vector3(); this.positionWorld = new THREE.Vector3(); this.positionScreen = new THREE.Vector4(); this.visible = true; }; THREE.RenderableVertex.prototype.copy = function (vertex) { this.positionWorld.copy(vertex.positionWorld); this.positionScreen.copy(vertex.positionScreen); }; // THREE.RenderableLine = function () { this.id = 0; this.v1 = new THREE.RenderableVertex(); this.v2 = new THREE.RenderableVertex(); this.vertexColors = [new THREE.Color(), new THREE.Color()]; this.material = null; this.z = 0; this.renderOrder = 0; }; // THREE.RenderableSprite = function () { this.id = 0; this.object = null; this.x = 0; this.y = 0; this.z = 0; this.rotation = 0; this.scale = new THREE.Vector2(); this.material = null; this.renderOrder = 0; }; // THREE.Projector = function () { var _object, _objectCount, _objectPool = [], _objectPoolLength = 0, _vertex, _vertexCount, _vertexPool = [], _vertexPoolLength = 0, _face, _faceCount, _facePool = [], _facePoolLength = 0, _line, _lineCount, _linePool = [], _linePoolLength = 0, _sprite, _spriteCount, _spritePool = [], _spritePoolLength = 0, _renderData = { objects: [], lights: [], elements: [] }, _vector3 = new THREE.Vector3(), _vector4 = new THREE.Vector4(), _clipBox = new THREE.Box3(new THREE.Vector3( - 1, - 1, - 1), new THREE.Vector3(1, 1, 1)), _boundingBox = new THREE.Box3(), _points3 = new Array(3), _points4 = new Array(4), _viewMatrix = new THREE.Matrix4(), _viewProjectionMatrix = new THREE.Matrix4(), _modelMatrix, _modelViewProjectionMatrix = new THREE.Matrix4(), _normalMatrix = new THREE.Matrix3(), _frustum = new THREE.Frustum(), _clippedVertex1PositionScreen = new THREE.Vector4(), _clippedVertex2PositionScreen = new THREE.Vector4(); // this.projectVector = function (vector, camera) { console.warn('THREE.Projector: .projectVector() is now vector.project().'); vector.project(camera); }; this.unprojectVector = function (vector, camera) { console.warn('THREE.Projector: .unprojectVector() is now vector.unproject().'); vector.unproject(camera); }; this.pickingRay = function (vector, camera) { console.error('THREE.Projector: .pickingRay() is now raycaster.setFromCamera().'); }; // var RenderList = function () { var normals = []; var uvs = []; var object = null; var material = null; var normalMatrix = new THREE.Matrix3(); function setObject(value) { object = value; material = object.material; normalMatrix.getNormalMatrix(object.matrixWorld); normals.length = 0; uvs.length = 0; } function projectVertex(vertex) { var position = vertex.position; var positionWorld = vertex.positionWorld; var positionScreen = vertex.positionScreen; positionWorld.copy(position).applyMatrix4(_modelMatrix); positionScreen.copy(positionWorld).applyMatrix4(_viewProjectionMatrix); var invW = 1 / positionScreen.w; positionScreen.x *= invW; positionScreen.y *= invW; positionScreen.z *= invW; vertex.visible = positionScreen.x >= - 1 && positionScreen.x <= 1 && positionScreen.y >= - 1 && positionScreen.y <= 1 && positionScreen.z >= - 1 && positionScreen.z <= 1; } function pushVertex(x, y, z) { _vertex = getNextVertexInPool(); _vertex.position.set(x, y, z); projectVertex(_vertex); } function pushNormal(x, y, z) { normals.push(x, y, z); } function pushUv(x, y) { uvs.push(x, y); } function checkTriangleVisibility(v1, v2, v3) { if (v1.visible === true || v2.visible === true || v3.visible === true) return true; _points3[0] = v1.positionScreen; _points3[1] = v2.positionScreen; _points3[2] = v3.positionScreen; return _clipBox.intersectsBox(_boundingBox.setFromPoints(_points3)); } function checkBackfaceCulling(v1, v2, v3) { return ((v3.positionScreen.x - v1.positionScreen.x) * (v2.positionScreen.y - v1.positionScreen.y) - (v3.positionScreen.y - v1.positionScreen.y) * (v2.positionScreen.x - v1.positionScreen.x)) < 0; } function pushLine(a, b) { var v1 = _vertexPool[a]; var v2 = _vertexPool[b]; _line = getNextLineInPool(); _line.id = object.id; _line.v1.copy(v1); _line.v2.copy(v2); _line.z = (v1.positionScreen.z + v2.positionScreen.z) / 2; _line.renderOrder = object.renderOrder; _line.material = object.material; _renderData.elements.push(_line); } function pushTriangle(a, b, c) { var v1 = _vertexPool[a]; var v2 = _vertexPool[b]; var v3 = _vertexPool[c]; if (checkTriangleVisibility(v1, v2, v3) === false) return; if (material.side === THREE.DoubleSide || checkBackfaceCulling(v1, v2, v3) === true) { _face = getNextFaceInPool(); _face.id = object.id; _face.v1.copy(v1); _face.v2.copy(v2); _face.v3.copy(v3); _face.z = (v1.positionScreen.z + v2.positionScreen.z + v3.positionScreen.z) / 3; _face.renderOrder = object.renderOrder; // use first vertex normal as face normal _face.normalModel.fromArray(normals, a * 3); _face.normalModel.applyMatrix3(normalMatrix).normalize(); for (var i = 0; i < 3; i++) { var normal = _face.vertexNormalsModel[i]; normal.fromArray(normals, arguments[i] * 3); normal.applyMatrix3(normalMatrix).normalize(); var uv = _face.uvs[i]; uv.fromArray(uvs, arguments[i] * 2); } _face.vertexNormalsLength = 3; _face.material = object.material; _renderData.elements.push(_face); } } return { setObject: setObject, projectVertex: projectVertex, checkTriangleVisibility: checkTriangleVisibility, checkBackfaceCulling: checkBackfaceCulling, pushVertex: pushVertex, pushNormal: pushNormal, pushUv: pushUv, pushLine: pushLine, pushTriangle: pushTriangle } }; var renderList = new RenderList(); this.projectScene = function (scene, camera, sortObjects, sortElements) { _faceCount = 0; _lineCount = 0; _spriteCount = 0; _renderData.elements.length = 0; if (scene.autoUpdate === true) scene.updateMatrixWorld(); if (camera.parent === null) camera.updateMatrixWorld(); _viewMatrix.copy(camera.matrixWorldInverse.getInverse(camera.matrixWorld)); _viewProjectionMatrix.multiplyMatrices(camera.projectionMatrix, _viewMatrix); _frustum.setFromMatrix(_viewProjectionMatrix); // _objectCount = 0; _renderData.objects.length = 0; _renderData.lights.length = 0; function addObject(object) { _object = getNextObjectInPool(); _object.id = object.id; _object.object = object; _vector3.setFromMatrixPosition(object.matrixWorld); _vector3.applyProjection(_viewProjectionMatrix); _object.z = _vector3.z; _object.renderOrder = object.renderOrder; _renderData.objects.push(_object); } scene.traverseVisible(function (object) { if (object instanceof THREE.Light) { _renderData.lights.push(object); } else if (object instanceof THREE.Mesh || object instanceof THREE.Line) { if (object.material.visible === false) return; if (object.frustumCulled === true && _frustum.intersectsObject(object) === false) return; addObject(object); } else if (object instanceof THREE.Sprite) { if (object.material.visible === false) return; if (object.frustumCulled === true && _frustum.intersectsSprite(object) === false) return; addObject(object); } }); if (sortObjects === true) { _renderData.objects.sort(painterSort); } // for (var o = 0, ol = _renderData.objects.length; o < ol; o++) { var object = _renderData.objects[o].object; var geometry = object.geometry; renderList.setObject(object); _modelMatrix = object.matrixWorld; _vertexCount = 0; if (object instanceof THREE.Mesh) { if (geometry instanceof THREE.BufferGeometry) { var attributes = geometry.attributes; var groups = geometry.groups; if (attributes.position === undefined) continue; var positions = attributes.position.array; for (var i = 0, l = positions.length; i < l; i += 3) { renderList.pushVertex(positions[i], positions[i + 1], positions[i + 2]); } if (attributes.normal !== undefined) { var normals = attributes.normal.array; for (var i = 0, l = normals.length; i < l; i += 3) { renderList.pushNormal(normals[i], normals[i + 1], normals[i + 2]); } } if (attributes.uv !== undefined) { var uvs = attributes.uv.array; for (var i = 0, l = uvs.length; i < l; i += 2) { renderList.pushUv(uvs[i], uvs[i + 1]); } } if (geometry.index !== null) { var indices = geometry.index.array; if (groups.length > 0) { for (var o = 0; o < groups.length; o++) { var group = groups[o]; for (var i = group.start, l = group.start + group.count; i < l; i += 3) { renderList.pushTriangle(indices[i], indices[i + 1], indices[i + 2]); } } } else { for (var i = 0, l = indices.length; i < l; i += 3) { renderList.pushTriangle(indices[i], indices[i + 1], indices[i + 2]); } } } else { for (var i = 0, l = positions.length / 3; i < l; i += 3) { renderList.pushTriangle(i, i + 1, i + 2); } } } else if (geometry instanceof THREE.Geometry) { var vertices = geometry.vertices; var faces = geometry.faces; var faceVertexUvs = geometry.faceVertexUvs[0]; _normalMatrix.getNormalMatrix(_modelMatrix); var material = object.material; var isFaceMaterial = material instanceof THREE.MultiMaterial; var objectMaterials = isFaceMaterial === true ? object.material : null; for (var v = 0, vl = vertices.length; v < vl; v++) { var vertex = vertices[v]; _vector3.copy(vertex); if (material.morphTargets === true) { var morphTargets = geometry.morphTargets; var morphInfluences = object.morphTargetInfluences; for (var t = 0, tl = morphTargets.length; t < tl; t++) { var influence = morphInfluences[t]; if (influence === 0) continue; var target = morphTargets[t]; var targetVertex = target.vertices[v]; _vector3.x += (targetVertex.x - vertex.x) * influence; _vector3.y += (targetVertex.y - vertex.y) * influence; _vector3.z += (targetVertex.z - vertex.z) * influence; } } renderList.pushVertex(_vector3.x, _vector3.y, _vector3.z); } for (var f = 0, fl = faces.length; f < fl; f++) { var face = faces[f]; material = isFaceMaterial === true ? objectMaterials.materials[face.materialIndex] : object.material; if (material === undefined) continue; var side = material.side; var v1 = _vertexPool[face.a]; var v2 = _vertexPool[face.b]; var v3 = _vertexPool[face.c]; if (renderList.checkTriangleVisibility(v1, v2, v3) === false) continue; var visible = renderList.checkBackfaceCulling(v1, v2, v3); if (side !== THREE.DoubleSide) { if (side === THREE.FrontSide && visible === false) continue; if (side === THREE.BackSide && visible === true) continue; } _face = getNextFaceInPool(); _face.id = object.id; _face.v1.copy(v1); _face.v2.copy(v2); _face.v3.copy(v3); _face.normalModel.copy(face.normal); if (visible === false && (side === THREE.BackSide || side === THREE.DoubleSide)) { _face.normalModel.negate(); } _face.normalModel.applyMatrix3(_normalMatrix).normalize(); var faceVertexNormals = face.vertexNormals; for (var n = 0, nl = Math.min(faceVertexNormals.length, 3); n < nl; n++) { var normalModel = _face.vertexNormalsModel[n]; normalModel.copy(faceVertexNormals[n]); if (visible === false && (side === THREE.BackSide || side === THREE.DoubleSide)) { normalModel.negate(); } normalModel.applyMatrix3(_normalMatrix).normalize(); } _face.vertexNormalsLength = faceVertexNormals.length; var vertexUvs = faceVertexUvs[f]; if (vertexUvs !== undefined) { for (var u = 0; u < 3; u++) { _face.uvs[u].copy(vertexUvs[u]); } } _face.color = face.color; _face.material = material; _face.z = (v1.positionScreen.z + v2.positionScreen.z + v3.positionScreen.z) / 3; _face.renderOrder = object.renderOrder; _renderData.elements.push(_face); } } } else if (object instanceof THREE.Line) { if (geometry instanceof THREE.BufferGeometry) { var attributes = geometry.attributes; if (attributes.position !== undefined) { var positions = attributes.position.array; for (var i = 0, l = positions.length; i < l; i += 3) { renderList.pushVertex(positions[i], positions[i + 1], positions[i + 2]); } if (geometry.index !== null) { var indices = geometry.index.array; for (var i = 0, l = indices.length; i < l; i += 2) { renderList.pushLine(indices[i], indices[i + 1]); } } else { var step = object instanceof THREE.LineSegments ? 2 : 1; for (var i = 0, l = (positions.length / 3) - 1; i < l; i += step) { renderList.pushLine(i, i + 1); } } } } else if (geometry instanceof THREE.Geometry) { _modelViewProjectionMatrix.multiplyMatrices(_viewProjectionMatrix, _modelMatrix); var vertices = object.geometry.vertices; if (vertices.length === 0) continue; v1 = getNextVertexInPool(); v1.positionScreen.copy(vertices[0]).applyMatrix4(_modelViewProjectionMatrix); var step = object instanceof THREE.LineSegments ? 2 : 1; for (var v = 1, vl = vertices.length; v < vl; v++) { v1 = getNextVertexInPool(); v1.positionScreen.copy(vertices[v]).applyMatrix4(_modelViewProjectionMatrix); if ((v + 1) % step > 0) continue; v2 = _vertexPool[_vertexCount - 2]; _clippedVertex1PositionScreen.copy(v1.positionScreen); _clippedVertex2PositionScreen.copy(v2.positionScreen); if (clipLine(_clippedVertex1PositionScreen, _clippedVertex2PositionScreen) === true) { // Perform the perspective divide _clippedVertex1PositionScreen.multiplyScalar(1 / _clippedVertex1PositionScreen.w); _clippedVertex2PositionScreen.multiplyScalar(1 / _clippedVertex2PositionScreen.w); _line = getNextLineInPool(); _line.id = object.id; _line.v1.positionScreen.copy(_clippedVertex1PositionScreen); _line.v2.positionScreen.copy(_clippedVertex2PositionScreen); _line.z = Math.max(_clippedVertex1PositionScreen.z, _clippedVertex2PositionScreen.z); _line.renderOrder = object.renderOrder; _line.material = object.material; if (object.material.vertexColors === THREE.VertexColors) { _line.vertexColors[0].copy(object.geometry.colors[v]); _line.vertexColors[1].copy(object.geometry.colors[v - 1]); } _renderData.elements.push(_line); } } } } else if (object instanceof THREE.Sprite) { _vector4.set(_modelMatrix.elements[12], _modelMatrix.elements[13], _modelMatrix.elements[14], 1); _vector4.applyMatrix4(_viewProjectionMatrix); var invW = 1 / _vector4.w; _vector4.z *= invW; if (_vector4.z >= - 1 && _vector4.z <= 1) { _sprite = getNextSpriteInPool(); _sprite.id = object.id; _sprite.x = _vector4.x * invW; _sprite.y = _vector4.y * invW; _sprite.z = _vector4.z; _sprite.renderOrder = object.renderOrder; _sprite.object = object; _sprite.rotation = object.rotation; _sprite.scale.x = object.scale.x * Math.abs(_sprite.x - (_vector4.x + camera.projectionMatrix.elements[0]) / (_vector4.w + camera.projectionMatrix.elements[12])); _sprite.scale.y = object.scale.y * Math.abs(_sprite.y - (_vector4.y + camera.projectionMatrix.elements[5]) / (_vector4.w + camera.projectionMatrix.elements[13])); _sprite.material = object.material; _renderData.elements.push(_sprite); } } } if (sortElements === true) { _renderData.elements.sort(painterSort); } return _renderData; }; // Pools function getNextObjectInPool() { if (_objectCount === _objectPoolLength) { var object = new THREE.RenderableObject(); _objectPool.push(object); _objectPoolLength++; _objectCount++; return object; } return _objectPool[_objectCount++]; } function getNextVertexInPool() { if (_vertexCount === _vertexPoolLength) { var vertex = new THREE.RenderableVertex(); _vertexPool.push(vertex); _vertexPoolLength++; _vertexCount++; return vertex; } return _vertexPool[_vertexCount++]; } function getNextFaceInPool() { if (_faceCount === _facePoolLength) { var face = new THREE.RenderableFace(); _facePool.push(face); _facePoolLength++; _faceCount++; return face; } return _facePool[_faceCount++]; } function getNextLineInPool() { if (_lineCount === _linePoolLength) { var line = new THREE.RenderableLine(); _linePool.push(line); _linePoolLength++; _lineCount++; return line; } return _linePool[_lineCount++]; } function getNextSpriteInPool() { if (_spriteCount === _spritePoolLength) { var sprite = new THREE.RenderableSprite(); _spritePool.push(sprite); _spritePoolLength++; _spriteCount++; return sprite; } return _spritePool[_spriteCount++]; } // function painterSort(a, b) { if (a.renderOrder !== b.renderOrder) { return a.renderOrder - b.renderOrder; } else if (a.z !== b.z) { return b.z - a.z; } else if (a.id !== b.id) { return a.id - b.id; } else { return 0; } } function clipLine(s1, s2) { var alpha1 = 0, alpha2 = 1, // Calculate the boundary coordinate of each vertex for the near and far clip planes, // Z = -1 and Z = +1, respectively. bc1near = s1.z + s1.w, bc2near = s2.z + s2.w, bc1far = - s1.z + s1.w, bc2far = - s2.z + s2.w; if (bc1near >= 0 && bc2near >= 0 && bc1far >= 0 && bc2far >= 0) { // Both vertices lie entirely within all clip planes. return true; } else if ((bc1near < 0 && bc2near < 0) || (bc1far < 0 && bc2far < 0)) { // Both vertices lie entirely outside one of the clip planes. return false; } else { // The line segment spans at least one clip plane. if (bc1near < 0) { // v1 lies outside the near plane, v2 inside alpha1 = Math.max(alpha1, bc1near / (bc1near - bc2near)); } else if (bc2near < 0) { // v2 lies outside the near plane, v1 inside alpha2 = Math.min(alpha2, bc1near / (bc1near - bc2near)); } if (bc1far < 0) { // v1 lies outside the far plane, v2 inside alpha1 = Math.max(alpha1, bc1far / (bc1far - bc2far)); } else if (bc2far < 0) { // v2 lies outside the far plane, v2 inside alpha2 = Math.min(alpha2, bc1far / (bc1far - bc2far)); } if (alpha2 < alpha1) { // The line segment spans two boundaries, but is outside both of them. // (This can't happen when we're only clipping against just near/far but good // to leave the check here for future usage if other clip planes are added.) return false; } else { // Update the s1 and s2 vertices to match the clipped line segment. s1.lerp(s2, alpha1); s2.lerp(s1, 1 - alpha2); return true; } } } }; /** * @author alteredq / http://alteredqualia.com/ */ THREE.EffectComposer = function (renderer, renderTarget) { this.renderer = renderer; if (renderTarget === undefined) { var parameters = { minFilter: THREE.LinearFilter, magFilter: THREE.LinearFilter, format: THREE.RGBAFormat, stencilBuffer: false }; var size = renderer.getSize(); renderTarget = new THREE.WebGLRenderTarget(size.width, size.height, parameters); } this.renderTarget1 = renderTarget; this.renderTarget2 = renderTarget.clone(); this.writeBuffer = this.renderTarget1; this.readBuffer = this.renderTarget2; this.passes = []; if (THREE.CopyShader === undefined) console.error("THREE.EffectComposer relies on THREE.CopyShader"); this.copyPass = new THREE.ShaderPass(THREE.CopyShader); }; Object.assign(THREE.EffectComposer.prototype, { swapBuffers: function () { var tmp = this.readBuffer; this.readBuffer = this.writeBuffer; this.writeBuffer = tmp; }, addPass: function (pass) { this.passes.push(pass); var size = this.renderer.getSize(); pass.setSize(size.width, size.height); }, insertPass: function (pass, index) { this.passes.splice(index, 0, pass); }, render: function (delta) { var maskActive = false; var pass, i, il = this.passes.length; for (i = 0; i < il; i++) { pass = this.passes[i]; if (pass.enabled === false) continue; pass.render(this.renderer, this.writeBuffer, this.readBuffer, delta, maskActive); if (pass.needsSwap) { if (maskActive) { var context = this.renderer.context; context.stencilFunc(context.NOTEQUAL, 1, 0xffffffff); this.copyPass.render(this.renderer, this.writeBuffer, this.readBuffer, delta); context.stencilFunc(context.EQUAL, 1, 0xffffffff); } this.swapBuffers(); } if (THREE.MaskPass !== undefined) { if (pass instanceof THREE.MaskPass) { maskActive = true; } else if (pass instanceof THREE.ClearMaskPass) { maskActive = false; } } } }, reset: function (renderTarget) { if (renderTarget === undefined) { var size = this.renderer.getSize(); renderTarget = this.renderTarget1.clone(); renderTarget.setSize(size.width, size.height); } this.renderTarget1.dispose(); this.renderTarget2.dispose(); this.renderTarget1 = renderTarget; this.renderTarget2 = renderTarget.clone(); this.writeBuffer = this.renderTarget1; this.readBuffer = this.renderTarget2; }, setSize: function (width, height) { this.renderTarget1.setSize(width, height); this.renderTarget2.setSize(width, height); for (var i = 0; i < this.passes.length; i++) { this.passes[i].setSize(width, height); } } }); THREE.Pass = function () { // if set to true, the pass is processed by the composer this.enabled = true; // if set to true, the pass indicates to swap read and write buffer after rendering this.needsSwap = true; // if set to true, the pass clears its buffer before rendering this.clear = false; // if set to true, the result of the pass is rendered to screen this.renderToScreen = false; }; Object.assign(THREE.Pass.prototype, { setSize: function (width, height) {}, render: function (renderer, writeBuffer, readBuffer, delta, maskActive) { console.error("THREE.Pass: .render() must be implemented in derived pass."); } }); /** * @author alteredq / http://alteredqualia.com/ */ THREE.RenderPass = function (scene, camera, overrideMaterial, clearColor, clearAlpha) { THREE.Pass.call(this); this.scene = scene; this.camera = camera; this.overrideMaterial = overrideMaterial; this.clearColor = clearColor; this.clearAlpha = (clearAlpha !== undefined) ? clearAlpha : 0; this.clear = true; this.needsSwap = false; }; THREE.RenderPass.prototype = Object.assign(Object.create(THREE.Pass.prototype), { constructor: THREE.RenderPass, render: function (renderer, writeBuffer, readBuffer, delta, maskActive) { var oldAutoClear = renderer.autoClear; renderer.autoClear = false; this.scene.overrideMaterial = this.overrideMaterial; var oldClearColor, oldClearAlpha; if (this.clearColor) { oldClearColor = renderer.getClearColor().getHex(); oldClearAlpha = renderer.getClearAlpha(); renderer.setClearColor(this.clearColor, this.clearAlpha); } renderer.render(this.scene, this.camera, this.renderToScreen ? null : readBuffer, this.clear); if (this.clearColor) { renderer.setClearColor(oldClearColor, oldClearAlpha); } this.scene.overrideMaterial = null; renderer.autoClear = oldAutoClear; } }); /** * @author alteredq / http://alteredqualia.com/ */ THREE.ShaderPass = function (shader, textureID) { THREE.Pass.call(this); this.textureID = (textureID !== undefined) ? textureID : "tDiffuse"; if (shader instanceof THREE.ShaderMaterial) { this.uniforms = shader.uniforms; this.material = shader; } else if (shader) { this.uniforms = THREE.UniformsUtils.clone(shader.uniforms); this.material = new THREE.ShaderMaterial({ defines: shader.defines || {}, uniforms: this.uniforms, vertexShader: shader.vertexShader, fragmentShader: shader.fragmentShader }); } this.camera = new THREE.OrthographicCamera( - 1, 1, 1, - 1, 0, 1); this.scene = new THREE.Scene(); this.quad = new THREE.Mesh(new THREE.PlaneBufferGeometry(2, 2), null); this.scene.add(this.quad); }; THREE.ShaderPass.prototype = Object.assign(Object.create(THREE.Pass.prototype), { constructor: THREE.ShaderPass, render: function (renderer, writeBuffer, readBuffer, delta, maskActive) { if (this.uniforms[this.textureID]) { this.uniforms[this.textureID].value = readBuffer.texture; } this.quad.material = this.material; if (this.renderToScreen) { renderer.render(this.scene, this.camera); } else { renderer.render(this.scene, this.camera, writeBuffer, this.clear); } } }); /** * @author alteredq / http://alteredqualia.com/ */ THREE.MaskPass = function (scene, camera) { THREE.Pass.call(this); this.scene = scene; this.camera = camera; this.clear = true; this.needsSwap = false; this.inverse = false; }; THREE.MaskPass.prototype = Object.assign(Object.create(THREE.Pass.prototype), { constructor: THREE.MaskPass, render: function (renderer, writeBuffer, readBuffer, delta, maskActive) { var context = renderer.context; var state = renderer.state; // don't update color or depth state.buffers.color.setMask(false); state.buffers.depth.setMask(false); // lock buffers state.buffers.color.setLocked(true); state.buffers.depth.setLocked(true); // set up stencil var writeValue, clearValue; if (this.inverse) { writeValue = 0; clearValue = 1; } else { writeValue = 1; clearValue = 0; } state.buffers.stencil.setTest(true); state.buffers.stencil.setOp(context.REPLACE, context.REPLACE, context.REPLACE); state.buffers.stencil.setFunc(context.ALWAYS, writeValue, 0xffffffff); state.buffers.stencil.setClear(clearValue); // draw into the stencil buffer renderer.render(this.scene, this.camera, readBuffer, this.clear); renderer.render(this.scene, this.camera, writeBuffer, this.clear); // unlock color and depth buffer for subsequent rendering state.buffers.color.setLocked(false); state.buffers.depth.setLocked(false); // only render where stencil is set to 1 state.buffers.stencil.setFunc(context.EQUAL, 1, 0xffffffff); // draw if == 1 state.buffers.stencil.setOp(context.KEEP, context.KEEP, context.KEEP); } }); THREE.ClearMaskPass = function () { THREE.Pass.call(this); this.needsSwap = false; }; THREE.ClearMaskPass.prototype = Object.create(THREE.Pass.prototype); Object.assign(THREE.ClearMaskPass.prototype, { render: function (renderer, writeBuffer, readBuffer, delta, maskActive) { renderer.state.buffers.stencil.setTest(false); } }); /** * @author alteredq / http://alteredqualia.com/ * * Full-screen textured quad shader */ THREE.CopyShader = { uniforms: { "tDiffuse": { value: null }, "opacity": { value: 1.0 } }, vertexShader: [ "varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}" ].join("\n"), fragmentShader: [ "uniform float opacity;", "uniform sampler2D tDiffuse;", "varying vec2 vUv;", "void main() {", "vec4 texel = texture2D( tDiffuse, vUv );", "gl_FragColor = opacity * texel;", "}" ].join("\n") }; /** * @author richt / http://richt.me * @author WestLangley / http://github.com/WestLangley * * W3C Device Orientation control (http://w3c.github.io/deviceorientation/spec-source-orientation.html) */ THREE.DeviceOrientationControls = function (object) { var scope = this; this.object = object; this.object.rotation.reorder("YXZ"); this.enabled = true; this.deviceOrientation = {}; this.screenOrientation = 0; this.alpha = 0; this.alphaOffsetAngle = 0; var onDeviceOrientationChangeEvent = function (event) { scope.deviceOrientation = event; }; var onScreenOrientationChangeEvent = function () { scope.screenOrientation = window.orientation || 0; }; // The angles alpha, beta and gamma form a set of intrinsic Tait-Bryan angles of type Z-X'-Y'' var setObjectQuaternion = function () { var zee = new THREE.Vector3(0, 0, 1); var euler = new THREE.Euler(); var q0 = new THREE.Quaternion(); var q1 = new THREE.Quaternion( - Math.sqrt(0.5), 0, 0, Math.sqrt(0.5)); // - PI/2 around the x-axis return function (quaternion, alpha, beta, gamma, orient) { euler.set(beta, alpha, - gamma, 'YXZ'); // 'ZXY' for the device, but 'YXZ' for us quaternion.setFromEuler(euler); // orient the device quaternion.multiply(q1); // camera looks out the back of the device, not the top quaternion.multiply(q0.setFromAxisAngle(zee, - orient)); // adjust for screen orientation } } (); this.connect = function () { onScreenOrientationChangeEvent(); // run once on load window.addEventListener('orientationchange', onScreenOrientationChangeEvent, false); window.addEventListener('deviceorientation', onDeviceOrientationChangeEvent, false); scope.enabled = true; }; this.disconnect = function () { window.removeEventListener('orientationchange', onScreenOrientationChangeEvent, false); window.removeEventListener('deviceorientation', onDeviceOrientationChangeEvent, false); scope.enabled = false; }; this.update = function () { if (scope.enabled === false) return; var alpha = scope.deviceOrientation.alpha ? THREE.Math.degToRad(scope.deviceOrientation.alpha) + this.alphaOffsetAngle : 0; // Z var beta = scope.deviceOrientation.beta ? THREE.Math.degToRad(scope.deviceOrientation.beta) : 0; // X' var gamma = scope.deviceOrientation.gamma ? THREE.Math.degToRad(scope.deviceOrientation.gamma) : 0; // Y'' var orient = scope.screenOrientation ? THREE.Math.degToRad(scope.screenOrientation) : 0; // O setObjectQuaternion(scope.object.quaternion, alpha, beta, gamma, orient); this.alpha = alpha; }; this.updateAlphaOffsetAngle = function (angle) { this.alphaOffsetAngle = angle; this.update(); }; this.dispose = function () { this.disconnect(); }; this.connect(); }; //3.2.3 "document" in self && ("classList" in document.createElement("_") && (!document.createElementNS || "classList" in document.createElementNS("http://www.w3.org/2000/svg", "g")) || !function (t) { "use strict"; if ("Element" in t) { var e = "classList", n = "prototype", i = t.Element[n], s = Object, r = String[n].trim || function () { return this.replace(/^\s+|\s+$/g, "") }, o = Array[n].indexOf || function (t) { for (var e = 0, n = this.length; n > e; e++) if (e in this && this[e] === t) return e; return -1 }, a = function (t, e) { this.name = t, this.code = DOMException[t], this.message = e }, c = function (t, e) { if ("" === e) throw new a("SYNTAX_ERR", "An invalid or illegal string was specified"); if (/\s/.test(e)) throw new a("INVALID_CHARACTER_ERR", "String contains an invalid character"); return o.call(t, e) }, l = function (t) { for (var e = r.call(t.getAttribute("class") || ""), n = e ? e.split(/\s+/) : [], i = 0, s = n.length; s > i; i++) this.push(n[i]); this._updateClassName = function () { t.setAttribute("class", "" + this) } }, u = l[n] = [], h = function () { return new l(this) }; if (a[n] = Error[n], u.item = function (t) { return this[t] || null }, u.contains = function (t) { return t += "", -1 !== c(this, t) }, u.add = function () { var t, e = arguments, n = 0, i = e.length, s = !1; do t = e[n] + "", -1 === c(this, t) && (this.push(t), s = !0); while (++n < i); s && this._updateClassName() }, u.remove = function () { var t, e, n = arguments, i = 0, s = n.length, r = !1; do for (t = n[i] + "", e = c(this, t); -1 !== e; ) this.splice(e, 1) , r = !0, e = c(this, t); while (++i < s); r && this._updateClassName() }, u.toggle = function (t, e) { t += ""; var n = this.contains(t), i = n ? e !== !0 && "remove" : e !== !1 && "add"; return i && this[i](t), e === !0 || e === !1 ? e : !n }, u.toString = function () { return this.join(" ") }, s.defineProperty) { var f = { get: h, enumerable: !0, configurable: !0 }; try { s.defineProperty(i, e, f) } catch (g) { (void 0 === g.number || -2146823252 === g.number) && (f.enumerable = !1, s.defineProperty(i, e, f)) } } else s[n].__defineGetter__ && i.__defineGetter__(e, h) } } (self), function () { "use strict"; var t = document.createElement("_"); if (t.classList.add("c1", "c2"), !t.classList.contains("c2")) { var e = function (t) { var e = DOMTokenList.prototype[t]; DOMTokenList.prototype[t] = function (t) { var n, i = arguments.length; for (n = 0; i > n; n++) t = arguments[n], e.call(this, t) } }; e("add"), e("remove") } if (t.classList.toggle("c3", !1), t.classList.contains("c3")) { var n = DOMTokenList.prototype.toggle; DOMTokenList.prototype.toggle = function (t, e) { return 1 in arguments && !this.contains(t) == !e ? e : n.call(this, t) } } t = null } ()); !function (a, b) { "function" == typeof define && define.amd ? define(["three", "D.js", "uevent", "doT"], b) : "object" == typeof module && module.exports ? module.exports = b(require("three"), require("d.js"), require("uevent"), require("dot")) : a.PhotoSphereViewer = b(a.THREE, a.D, a.uEvent, a.doT) } (this, function (a, b, c, d) { "use strict"; function e(b) { if (!(this instanceof e)) return new e(b); if (e.SYSTEM.loaded || e._loadSystem(), this.config = x.clone(e.DEFAULTS), x.deepmerge(this.config, b), !b.container) throw new v("No value given for container."); if (!e.SYSTEM.isCanvasSupported) throw new v("Canvas is not supported."); if (!(e.SYSTEM.isWebGLSupported && this.config.webgl || x.checkTHREE("CanvasRenderer", "Projector"))) throw new v("Missing Three.js components: CanvasRenderer, Projector. Get them from three.js-examples package."); if (this.config.longitude_range && 2 !== this.config.longitude_range.length && (this.config.longitude_range = null, console.warn("PhotoSphereViewer: longitude_range must have exactly two elements.")), this.config.latitude_range ? 2 !== this.config.latitude_range.length ? (this.config.latitude_range = null, console.warn("PhotoSphereViewer: latitude_range must have exactly two elements.")) : this.config.latitude_range[0] > this.config.latitude_range[1] && (this.config.latitude_range = [this.config.latitude_range[1], this.config.latitude_range[0]], console.warn("PhotoSphereViewer: latitude_range values must be ordered.")) : void 0 === this.config.tilt_up_max && void 0 === this.config.tilt_down_max || (this.config.latitude_range = [void 0 !== this.config.tilt_down_max ? this.config.tilt_down_max - Math.PI / 4 : -x.HalfPI, void 0 !== this.config.tilt_up_max ? this.config.tilt_up_max + Math.PI / 4 : x.HalfPI], console.warn("PhotoSphereViewer: tilt_up_max and tilt_down_max are deprecated, use latitude_range instead.")), this.config.max_fov < this.config.min_fov) { var c = this.config.max_fov; this.config.max_fov = this.config.min_fov, this.config.min_fov = c, console.warn("PhotoSphereViewer: max_fov cannot be lower than min_fov.") } this.config.cache_texture && (!x.isInteger(this.config.cache_texture) || this.config.cache_texture < 0) && (this.config.cache_texture = e.DEFAULTS.cache_texture, console.warn("PhotoSphreViewer: invalid valud for cache_texture")), this.config.min_fov = x.bound(this.config.min_fov, 1, 179), this.config.max_fov = x.bound(this.config.max_fov, 1, 179), null === this.config.default_fov ? this.config.default_fov = this.config.max_fov / 2 + this.config.min_fov / 2 : this.config.default_fov = x.bound(this.config.default_fov, this.config.min_fov, this.config.max_fov), this.config.default_long = x.parseAngle(this.config.default_long), this.config.default_lat = x.parseAngle(this.config.default_lat, -Math.PI), this.config.default_lat = x.bound(this.config.default_lat, -x.HalfPI, x.HalfPI), null === this.config.anim_lat ? this.config.anim_lat = this.config.default_lat : (this.config.anim_lat = x.parseAngle(this.config.anim_lat, -Math.PI), this.config.anim_lat = x.bound(this.config.anim_lat, -x.HalfPI, x.HalfPI)), this.config.longitude_range && (this.config.longitude_range = this.config.longitude_range.map(function (a) { return x.parseAngle(a) })), this.config.latitude_range && (this.config.latitude_range = this.config.latitude_range.map(function (a) { return a = x.parseAngle(a, -Math.PI), x.bound(a, -x.HalfPI, x.HalfPI) })), this.config.anim_speed = x.parseSpeed(this.config.anim_speed), this.config.caption && !this.config.navbar && (this.config.navbar = ["caption"]), this.config.fisheye === !0 ? this.config.fisheye = 1 : this.config.fisheye === !1 && (this.config.fisheye = 0), this.parent = "string" == typeof b.container ? document.getElementById(b.container) : b.container, this.container = null, this.loader = null, this.navbar = null, this.hud = null, this.panel = null, this.tooltip = null, this.canvas_container = null, this.renderer = null, this.scene = null, this.camera = null, this.mesh = null, this.raycaster = null, this.doControls = null, this.prop = { isCubemap: void 0, longitude: 0, latitude: 0, direction: null, anim_speed: 0, zoom_lvl: 0, vFov: 0, hFov: 0, aspect: 0, move_speed: .1, moving: !1, zooming: !1, start_mouse_x: 0, start_mouse_y: 0, mouse_x: 0, mouse_y: 0, mouse_history: [], pinch_dist: 0, orientation_reqid: null, autorotate_reqid: null, animation_promise: null, loading_promise: null, start_timeout: null, dblclick_data: null, dblclick_timeout: null, cache: [], size: { width: 0, height: 0 }, pano_data: { full_width: 0, full_height: 0, cropped_width: 0, cropped_height: 0, cropped_x: 0, cropped_y: 0 } }, Object.keys(e.TEMPLATES).forEach(function (a) { this.config.templates[a] || (this.config.templates[a] = e.TEMPLATES[a]), "string" == typeof this.config.templates[a] && (this.config.templates[a] = d.template(this.config.templates[a])) }, this), this.parent.photoSphereViewer = this, this.container = document.createElement("div"), this.container.classList.add("psv-container"), this.parent.appendChild(this.container), null !== this.config.size && this._setViewerSize(this.config.size), this._onResize(); var f = Math.round((this.config.default_fov - this.config.min_fov) / (this.config.max_fov - this.config.min_fov) * 100); this.zoom(f - 2 * (f - 50), !1), this.prop.move_speed = a.Math.degToRad(this.config.move_speed / e.SYSTEM.pixelRatio), this.rotate({ longitude: this.config.default_long, latitude: this.config.default_lat }, !1), this.loader = new h(this), this.loader.hide(), this.navbar = new i(this), this.navbar.hide(), this.hud = new g(this), this.hud.hide(), this.panel = new l(this), this.tooltip = new m(this.hud), this._bindEvents(), this.config.autoload && this.load(), this.once("render", function () { this.config.navbar && (this.container.classList.add("psv-container--has-navbar"), this.navbar.show()), this.hud.show(), this.config.markers && (this.config.markers.forEach(function (a) { this.hud.addMarker(a, !1) }, this), this.hud.renderMarkers()), this.config.time_anim !== !1 && (this.prop.start_timeout = window.setTimeout(this.startAutorotate.bind(this), this.config.time_anim)), this.trigger("ready") } .bind(this)) } function f(a) { this.psv = a instanceof e ? a : a.psv, this.parent = a, this.container = null, this.constructor.publicMethods && this.constructor.publicMethods.forEach(function (a) { this.psv[a] = this[a].bind(this) }, this) } function g(a) { f.call(this, a), this.svgContainer = null, this.markers = {}, this.currentMarker = null, this.hoveringMarker = null, this.prop = { panelOpened: !1, panelOpening: !1, markersButton: this.psv.navbar.getNavbarButton("markers") }, this.create() } function h(a) { f.call(this, a), this.canvas = null, this.loader = null, this.create() } function i(a) { if (f.call(this, a), this.config = this.psv.config.navbar, this.items = [], this.config === !0) this.config = x.clone(e.DEFAULTS.navbar); else if ("string" == typeof this.config) this.config = this.config.split(" "); else if (!Array.isArray(this.config)) { console.warn('PhotoSphereViewer: hashmap form of "navbar" is deprecated, use an array instead.'); var b = this.config; this.config = []; for (var c in b) b[c] && this.config.push(c); this.config.sort(function (a, b) { return e.DEFAULTS.navbar.indexOf(a) - e.DEFAULTS.navbar.indexOf(b) }) } this.create() } function j(a, b) { f.call(this, a), this.create(), this.setCaption(b) } function k(a, b) { f.call(this, a), this.weight = b || 5, this.create(), this.container.classList.add("psv-spacer--weight-" + this.weight) } function l(a) { f.call(this, a), this.content = null, this.prop = { mouse_x: 0, mouse_y: 0, mousedown: !1, opened: !1 }, this.create() } function m(a) { f.call(this, a), this.config = this.psv.config.tooltip, this.prop = { timeout: null }, this.create() } function n(a) { f.call(this, a), this.id = void 0, this.constructor.id && (this.id = this.constructor.id), this.enabled = !0 } function o(a) { n.call(this, a), this.create() } function p(a, b) { n.call(this, a), this.config = b, this.config.id && (this.id = this.config.id), this.create() } function q(a) { n.call(this, a), this.create() } function r(a) { n.call(this, a), this.create() } function s(a) { n.call(this, a), this.create() } function t(a) { n.call(this, a), this.create() } function u(a) { n.call(this, a), this.zoom_range = null, this.zoom_value = null, this.prop = { mousedown: !1, buttondown: !1, longPressInterval: null }, this.create() } function v(a) { this.message = a, "captureStackTrace" in Error ? Error.captureStackTrace(this, v) : this.stack = (new Error).stack } function w(a, b) { if (!a.id) throw new v("missing marker id"); if (a.image && (!a.width || !a.height)) throw new v("missing marker width/height"); if ((a.image || a.html) && !(a.hasOwnProperty("x") && a.hasOwnProperty("y") || a.hasOwnProperty("latitude") && a.hasOwnProperty("longitude"))) throw new v("missing marker position, latitude/longitude or x/y"); this.psv = b, this.visible = !0, this._dynamicSize = !1; var c, d = a.id, e = w.getType(a, !1); Object.defineProperties(this, { id: { configurable: !1, enumerable: !0, get: function () { return d }, set: function (a) {} }, type: { configurable: !1, enumerable: !0, get: function () { return e }, set: function (a) {} }, $el: { configurable: !1, enumerable: !0, get: function () { return c }, set: function (a) {} }, _def: { configurable: !1, enumerable: !0, get: function () { return this[e] }, set: function (a) { this[e] = a } } }), c = this.isNormal() ? document.createElement("div") : this.isPolygon() ? document.createElementNS(x.svgNS, "polygon") : document.createElementNS(x.svgNS, this.type), c.id = "psv-marker-" + this.id, c.psvMarker = this, this.update(a) } c.mixin(e), e.prototype._loadXMP = function (a) { if (!this.config.usexmpdata) return b.resolved(null); var c = b(), d = new XMLHttpRequest, e = this, f = 0; return d.onreadystatechange = function () { if (4 === d.readyState) { if (200 !== d.status && 201 !== d.status && 202 !== d.status && 0 !== d.status) throw e.container.textContent = "Cannot load image", new v("Cannot load image"); e.loader.setProgress(100); var a = d.responseText, b = a.indexOf(""), h = a.substring(b, g); if (b === -1 || g === -1 || h.indexOf("GPano:") === -1) c.resolve(null); else { var i = { full_width: parseInt(x.getXMPValue(h, "FullPanoWidthPixels")), full_height: parseInt(x.getXMPValue(h, "FullPanoHeightPixels")), cropped_width: parseInt(x.getXMPValue(h, "CroppedAreaImageWidthPixels")), cropped_height: parseInt(x.getXMPValue(h, "CroppedAreaImageHeightPixels")), cropped_x: parseInt(x.getXMPValue(h, "CroppedAreaLeftPixels")), cropped_y: parseInt(x.getXMPValue(h, "CroppedAreaTopPixels")) }; i.full_width && i.full_height && i.cropped_width && i.cropped_height ? c.resolve(i) : (console.warn("PhotoSphereViewer: invalid XMP data"), c.resolve(null)) } } else 3 === d.readyState && e.loader.setProgress(f += 10) }, d.onprogress = function (a) { if (a.lengthComputable) { var b = parseInt(a.loaded / a.total * 100); b > f && (f = b, e.loader.setProgress(f)) } }, d.onerror = function () { throw e.container.textContent = "Cannot load image", new v("Cannot load image") }, d.open("GET", a, !0), d.send(null), c.promise }, e.prototype._loadTexture = function (a) { var b = []; if (Array.isArray(a)) { if (6 !== a.length) throw new v("Must provide exactly 6 image paths when using cubemap."); for (var c = 0; c < 6; c++) b[c] = a[e.CUBE_MAP[c]]; a = b } else if ("object" == typeof a) { if (!e.CUBE_HASHMAP.every(function (b) { return !!a[b] })) throw new v("Must provide exactly left, front, right, back, top, bottom when using cubemap."); e.CUBE_HASHMAP.forEach(function (c, d) { b[d] = a[c] }), a = b } if (Array.isArray(a)) { if (this.prop.isCubemap === !1) throw new v("The viewer was initialized with an equirectangular panorama, cannot switch to cubemap."); return this.config.fisheye && console.warn("PhotoSphereViewer: fisheye effect with cubemap texture can generate distorsions."), this.config.cache_texture === e.DEFAULTS.cache_texture && (this.config.cache_texture *= 6), this.prop.isCubemap = !0, this._loadCubemapTexture(a) } if (this.prop.isCubemap === !0) throw new v("The viewer was initialized with an cubemap, cannot switch to equirectangular panorama."); return this.prop.isCubemap = !1, this._loadEquirectangularTexture(a) }, e.prototype._loadEquirectangularTexture = function (c) { if (this.config.cache_texture) { var d = this.getPanoramaCache(c); if (d) return this.prop.pano_data = d.pano_data, b.resolved(d.image) } return this._loadXMP(c).then(function (d) { var f = b(), g = new a.ImageLoader, h = d ? 100 : 0; g.setCrossOrigin("anonymous"); var i = function (b) { h = 100, this.loader.setProgress(h), this.trigger("panorama-load-progress", c, h), !d && this.config.pano_data && (d = x.clone(this.config.pano_data)), d || (d = { full_width: b.width, full_height: b.height, cropped_width: b.width, cropped_height: b.height, cropped_x: 0, cropped_y: 0 }), this.prop.pano_data = d; var g, i = Math.min(d.full_width, e.SYSTEM.maxTextureWidth) / d.full_width; if (1 !== i || d.cropped_width != d.full_width || d.cropped_height != d.full_height) { var j = x.clone(d); j.full_width *= i, j.full_height *= i, j.cropped_width *= i, j.cropped_height *= i, j.cropped_x *= i, j.cropped_y *= i, b.width = j.cropped_width, b.height = j.cropped_height; var k = document.createElement("canvas"); k.width = j.full_width, k.height = j.full_height; var l = k.getContext("2d"); l.drawImage(b, j.cropped_x, j.cropped_y, j.cropped_width, j.cropped_height), g = new a.Texture(k) } else g = new a.Texture(b); g.needsUpdate = !0, g.minFilter = a.LinearFilter, g.generateMipmaps = !1, this.config.cache_texture && this._putPanoramaCache({ panorama: c, image: g, pano_data: d }), f.resolve(g) }, j = function (a) { if (a.lengthComputable) { var b = parseInt(a.loaded / a.total * 100); b > h && (h = b, this.loader.setProgress(h), this.trigger("panorama-load-progress", c, h)) } }, k = function (a) { throw this.container.textContent = "Cannot load image", f.reject(a), new v("Cannot load image") }; return g.load(c, i.bind(this), j.bind(this), k.bind(this)), f.promise } .bind(this)) }, e.prototype._loadCubemapTexture = function (c) { var d = b(), f = new a.ImageLoader, g = [0, 0, 0, 0, 0, 0], h = [], i = 0; f.setCrossOrigin("anonymous"); for (var j = function () { h.forEach(function (b) { b.needsUpdate = !0, b.minFilter = a.LinearFilter, b.generateMipmaps = !1 }), d.resolve(h) }, k = function (b, d) { i++, g[b] = 100, this.loader.setProgress(x.sum(g) / 6), this.trigger("panorama-load-progress", c[b], g[b]); var f = Math.min(d.width, e.SYSTEM.maxTextureWidth / 2) / d.width; if (1 !== f) { var k = document.createElement("canvas"); k.width = d.width * f, k.height = d.height * f; var l = k.getContext("2d"); l.drawImage(d, 0, 0, k.width, k.height), h[b] = new a.Texture(k) } else h[b] = new a.Texture(d); this.config.cache_texture && this._putPanoramaCache({ panorama: c[b], image: h[b] }), 6 === i && j() }, l = function (a, b) { if (b.lengthComputable) { var d = parseInt(b.loaded / b.total * 100); d > g[a] && (g[a] = d, this.loader.setProgress(x.sum(g) / 6), this.trigger("panorama-load-progress", c[a], g[a])) } }, m = function (a, b) { throw this.container.textContent = "Cannot load image", d.reject(b), new v("Cannot load image " + a) }, n = 0; n < 6; n++) { if (this.config.cache_texture) { var o = this.getPanoramaCache(c[n]); if (o) { i++, g[n] = 100, h[n] = o.image; continue } } f.load(c[n], k.bind(this, n), l.bind(this, n), m.bind(this, n)) } return 6 === i && d.resolve(h), d.promise }, e.prototype._setTexture = function (a) { if (this.scene || this._createScene(), this.prop.isCubemap) for (var b = 0; b < 6; b++) this.mesh.material.materials[b].map && this.mesh.material.materials[b].map.dispose(), this.mesh.material.materials[b].map = a[b]; else this.mesh.material.map && this.mesh.material.map.dispose(), this.mesh.material.map = a; this.trigger("panorama-loaded"), this.render() }, e.prototype._createScene = function () { this.raycaster = new a.Raycaster, this.renderer = e.SYSTEM.isWebGLSupported && this.config.webgl ? new a.WebGLRenderer : new a.CanvasRenderer, this.renderer.setSize(this.prop.size.width, this.prop.size.height), this.renderer.setPixelRatio(e.SYSTEM.pixelRatio); var b = e.SPHERE_RADIUS; this.prop.isCubemap && (b *= Math.sqrt(3)), this.config.fisheye && (b += e.SPHERE_RADIUS), this.camera = new a.PerspectiveCamera(this.config.default_fov, this.prop.size.width / this.prop.size.height, 1, b), this.camera.position.set(0, 0, 0), this.config.gyroscope && x.checkTHREE("DeviceOrientationControls") && (this.doControls = new a.DeviceOrientationControls(this.camera)), this.scene = new a.Scene, this.scene.add(this.camera), this.prop.isCubemap ? this._createCubemap() : this._createSphere(), this.canvas_container = document.createElement("div"), this.canvas_container.className = "psv-canvas-container", this.renderer.domElement.className = "psv-canvas", this.container.appendChild(this.canvas_container), this.canvas_container.appendChild(this.renderer.domElement) }, e.prototype._createSphere = function () { var b = new a.SphereGeometry(e.SPHERE_RADIUS, e.SPHERE_VERTICES, e.SPHERE_VERTICES, (-x.HalfPI)), c = new a.MeshBasicMaterial({ side: a.DoubleSide, overdraw: e.SYSTEM.isWebGLSupported && this.config.webgl ? 0 : 1 }); this.mesh = new a.Mesh(b, c), this.mesh.scale.x = -1, this.mesh.rotation.x = this.config.initRotationVector.x, this.mesh.rotation.y = this.config.initRotationVector.y, this.mesh.rotation.z = this.config.initRotationVector.z, this.scene.add(this.mesh) }, e.prototype._createCubemap = function () { for (var b = new a.BoxGeometry(2 * e.SPHERE_RADIUS, 2 * e.SPHERE_RADIUS, 2 * e.SPHERE_RADIUS, e.CUBE_VERTICES, e.CUBE_VERTICES, e.CUBE_VERTICES), c = [], d = 0; d < 6; d++) c.push(new a.MeshBasicMaterial({ overdraw: e.SYSTEM.isWebGLSupported && this.config.webgl ? 0 : 1 })); this.mesh = new a.Mesh(b, new a.MultiMaterial(c)), this.mesh.position.x -= e.SPHERE_RADIUS, this.mesh.position.y -= e.SPHERE_RADIUS, this.mesh.position.z -= e.SPHERE_RADIUS, this.mesh.applyMatrix((new a.Matrix4).makeScale(1, 1, -1)), this.scene.add(this.mesh); var f = new a.MeshBasicMaterial({ side: a.BackSide, visible: !1 }), g = new a.Mesh(b, f); this.scene.add(g) }, e.prototype._transition = function (b, c) { if (this.prop.isCubemap) throw new v("Transition is not available with cubemap."); var d = this, f = new a.SphereGeometry(.9 * e.SPHERE_RADIUS, e.SPHERE_VERTICES, e.SPHERE_VERTICES, (-x.HalfPI)), g = new a.MeshBasicMaterial({ side: a.DoubleSide, overdraw: e.SYSTEM.isWebGLSupported && this.config.webgl ? 0 : 1, map: b, transparent: !0, opacity: 0 }), h = new a.Mesh(f, g); if (h.scale.x = -1, c) { h.rotateY(c.longitude - this.prop.longitude); var i = new a.Vector3(0, 1, 0).cross(this.camera.getWorldDirection()).normalize(), j = (new a.Quaternion).setFromAxisAngle(i, c.latitude - this.prop.latitude); h.quaternion.multiplyQuaternions(j, h.quaternion) } return this.scene.add(h), this.render(), x.animation({ properties: { opacity: { start: 0, end: 1 } }, duration: d.config.transition.duration, easing: "outCubic", onTick: function (a) { g.opacity = a.opacity, d.render() } }).then(function () { d.mesh.material.map.dispose(), d.mesh.material.map = b, d.scene.remove(h), h.geometry.dispose(), h.geometry = null, h.material.dispose(), h.material = null, c ? ((d.config.latitude_range || d.config.longitude_range) && (d.config.longitude_range = d.config.latitude_range = null, console.warn("PhotoSphereViewer: trying to perform transition with longitude_range and/or latitude_range, ranges cleared.")), d.rotate(c)) : d.render() }) }, e.prototype._reverseAutorotate = function () { var a = this, b = -this.config.anim_speed, c = this.config.longitude_range; this.config.longitude_range = null, x.animation({ properties: { speed: { start: this.config.anim_speed, end: 0 } }, duration: 300, easing: "inSine", onTick: function (b) { a.config.anim_speed = b.speed } }).then(function () { return x.animation({ properties: { speed: { start: 0, end: b } }, duration: 300, easing: "outSine", onTick: function (b) { a.config.anim_speed = b.speed } }) }).then(function () { a.config.longitude_range = c, a.config.anim_speed = b }) }, e.prototype._putPanoramaCache = function (a) { if (!this.config.cache_texture) throw new v("Cannot add panorama to cache, cache_texture is disabled"); var b = this.getPanoramaCache(a.panorama); b ? (b.image = a.image, b.pano_data = a.pano_data) : (this.prop.cache = this.prop.cache.slice(0, this.config.cache_texture - 1), this.prop.cache.unshift(a)), this.trigger("panorama-cached", a.panorama) }, e.prototype._stopAll = function () { this.stopAutorotate(), this.stopAnimation(), this.stopGyroscopeControl() }, e.MOVE_THRESHOLD = 4, e.DBLCLICK_DELAY = 300, e.INERTIA_WINDOW = 300, e.SPHERE_RADIUS = 100, e.SPHERE_VERTICES = 64, e.CUBE_VERTICES = 8, e.CUBE_MAP = [0, 2, 4, 5, 3, 1], e.CUBE_HASHMAP = ["left", "right", "top", "bottom", "back", "front"], e.KEYMAP = { 33: "PageUp", 34: "PageDown", 37: "ArrowLeft", 38: "ArrowUp", 39: "ArrowRight", 40: "ArrowDown", 107: "+", 109: "-" }, e.SYSTEM = { loaded: !1, pixelRatio: 1, isWebGLSupported: !1, isCanvasSupported: !1, deviceOrientationSupported: null, maxTextureWidth: 0, mouseWheelEvent: null, fullscreenEvent: null }, e.ICONS = {}, e.DEFAULTS = { panorama: null, container: null, caption: null, autoload: !0, usexmpdata: !0, pano_data: null, webgl: !0, min_fov: 30, max_fov: 90, default_fov: null, default_long: 0, default_lat: 0, longitude_range: null, latitude_range: null, move_speed: 1, time_anim: 2e3, anim_speed: "2rpm", anim_lat: null, fisheye: !1, navbar: ["autorotate", "zoom", "download", "markers", "caption", "gyroscope", "fullscreen"], tooltip: { offset: 5, arrow_size: 7, delay: 100 }, lang: { autorotate: "Automatic rotation", zoom: "Zoom", zoomOut: "Zoom out", zoomIn: "Zoom in", download: "Download", fullscreen: "Fullscreen", markers: "Markers", gyroscope: "Gyroscope" }, mousewheel: !0, mousemove: !0, keyboard: !0, gyroscope: !1, move_inertia: !0, click_event_on_marker: !1, transition: { duration: 1500, loader: !0 }, loading_img: null, loading_txt: "Loading...", size: null, cache_texture: 5, templates: {}, markers: [] }, e.TEMPLATES = { markersList: '

    {{= it.config.lang.markers }}

      {{~ it.markers: marker }}
    • {{? marker.image }}{{?}}

      {{? marker.tooltip }}{{= marker.tooltip.content }}{{?? marker.html }}{{= marker.html }}{{??}}{{= marker.id }}{{?}}

    • {{~}}
    ' }, e.prototype._bindEvents = function () { window.addEventListener("resize", this), this.config.mousemove && (this.hud.container.style.cursor = "move", this.hud.container.addEventListener("mousedown", this), this.hud.container.addEventListener("touchstart", this), window.addEventListener("mouseup", this), window.addEventListener("touchend", this), this.hud.container.addEventListener("mousemove", this), this.hud.container.addEventListener("touchmove", this)), e.SYSTEM.fullscreenEvent && document.addEventListener(e.SYSTEM.fullscreenEvent, this), this.config.mousewheel && this.hud.container.addEventListener(e.SYSTEM.mouseWheelEvent, this), this.on("_side-reached", function (a) { this.isAutorotateEnabled() && ("left" !== a && "right" !== a || this._reverseAutorotate()) }) }, e.prototype.handleEvent = function (a) { switch (a.type) { case "resize": x.throttle(this._onResize(), 50); break; case "keydown": this._onKeyDown(a); break; case "mousedown": this._onMouseDown(a); break; case "touchstart": this._onTouchStart(a); break; case "mouseup": this._onMouseUp(a); break; case "touchend": this._onTouchEnd(a); break; case "mousemove": this._onMouseMove(a); break; case "touchmove": this._onTouchMove(a); break; case e.SYSTEM.fullscreenEvent: this._fullscreenToggled(); break; case e.SYSTEM.mouseWheelEvent: this._onMouseWheel(a) } }, e.prototype._onResize = function () { this.container.clientWidth == this.prop.size.width && this.container.clientHeight == this.prop.size.height || (this.prop.size.width = parseInt(this.container.clientWidth), this.prop.size.height = parseInt(this.container.clientHeight), this.prop.aspect = this.prop.size.width / this.prop.size.height, this.renderer && (this.renderer.setSize(this.prop.size.width, this.prop.size.height), this.composer && this.composer.reset(new a.WebGLRenderTarget(this.prop.size.width, this.prop.size.height)), this.render()), this.trigger("size-updated", this.getSize())) }, e.prototype._onKeyDown = function (a) { var b = 0, c = 0, d = 0, f = a.key || e.KEYMAP[a.keyCode || a.which]; switch (f) { case "ArrowUp": c = .01; break; case "ArrowDown": c = - .01; break; case "ArrowRight": b = .01; break; case "ArrowLeft": b = - .01; break; case "PageUp": case "+": d = 1; break; case "PageDown": case "-": d = -1 } 0 !== d ? this.zoom(this.prop.zoom_lvl + d) : 0 === c && 0 === b || this.rotate({ longitude: this.prop.longitude + b * this.prop.move_speed * this.prop.hFov, latitude: this.prop.latitude + c * this.prop.move_speed * this.prop.vFov }) }, e.prototype._onMouseDown = function (a) { this._startMove(a) }, e.prototype._onMouseUp = function (a) { this._stopMove(a) }, e.prototype._onMouseMove = function (a) { 0 !== a.buttons && (a.preventDefault(), this._move(a)) }, e.prototype._onTouchStart = function (a) { 1 === a.touches.length ? this._startMove(a.touches[0]) : 2 === a.touches.length && this._startZoom(a) }, e.prototype._onTouchEnd = function (a) { this._stopMove(a.changedTouches[0]) }, e.prototype._onTouchMove = function (a) { 1 === a.touches.length ? (a.preventDefault(), this._move(a.touches[0])) : 2 === a.touches.length && (a.preventDefault(), this._zoom(a)) }, e.prototype._startMove = function (a) { this.isGyroscopeEnabled() || (this._stopAll(), this.prop.mouse_x = this.prop.start_mouse_x = parseInt(a.clientX), this.prop.mouse_y = this.prop.start_mouse_y = parseInt(a.clientY), this.prop.moving = !0, this.prop.zooming = !1, this.prop.mouse_history.length = 0, this._logMouseMove(a)) }, e.prototype._startZoom = function (a) { var b = [{ x: parseInt(a.touches[0].clientX), y: parseInt(a.touches[0].clientY) }, { x: parseInt(a.touches[1].clientX), y: parseInt(a.touches[1].clientY) } ]; this.prop.pinch_dist = Math.sqrt(Math.pow(b[0].x - b[1].x, 2) + Math.pow(b[0].y - b[1].y, 2)), this.prop.moving = !1, this.prop.zooming = !0 }, e.prototype._stopMove = function (a) { return this.isGyroscopeEnabled() ? void this._click(a) : (this.prop.moving && (Math.abs(a.clientX - this.prop.start_mouse_x) < e.MOVE_THRESHOLD && Math.abs(a.clientY - this.prop.start_mouse_y) < e.MOVE_THRESHOLD ? (this._click(a), this.prop.moving = !1) : this.config.move_inertia ? (this._logMouseMove(a), this._stopMoveInertia(a)) : this.prop.moving = !1), this.prop.mouse_history.length = 0, void(this.prop.zooming = !1)) }, e.prototype._stopMoveInertia = function (a) { var b = this, c = { x: a.clientX - this.prop.mouse_history[0][1], y: a.clientY - this.prop.mouse_history[0][2] }, d = Math.sqrt(c.x * c.x + c.y * c.y); this.prop.animation_promise = x.animation({ properties: { clientX: { start: a.clientX, end: a.clientX + c.x }, clientY: { start: a.clientY, end: a.clientY + c.y } }, duration: d * e.INERTIA_WINDOW / 100, easing: "outCirc", onTick: function (a) { b._move(a, !1) } }).ensure(function () { b.prop.moving = !1 }) }, e.prototype._click = function (a) { var b = this.container.getBoundingClientRect(), c = { target: a.target, client_x: a.clientX, client_y: a.clientY, viewer_x: parseInt(a.clientX - b.left), viewer_y: parseInt(a.clientY - b.top) }, d = this.viewerCoordsToVector3({ x: c.viewer_x, y: c.viewer_y }); if (d) { var f = this.vector3ToSphericalCoords(d); if (c.longitude = f.longitude, c.latitude = f.latitude, !this.prop.isCubemap) { var g = this.sphericalCoordsToTextureCoords({ longitude: c.longitude, latitude: c.latitude }); c.texture_x = g.x, c.texture_y = g.y } this.prop.dblclick_timeout ? (Math.abs(this.prop.dblclick_data.client_x - c.client_x) < e.MOVE_THRESHOLD && Math.abs(this.prop.dblclick_data.client_y - c.client_y) < e.MOVE_THRESHOLD && this.trigger("dblclick", this.prop.dblclick_data), clearTimeout(this.prop.dblclick_timeout), this.prop.dblclick_timeout = null, this.prop.dblclick_data = null) : (this.trigger("click", c), this.prop.dblclick_data = x.clone(c), this.prop.dblclick_timeout = setTimeout(function () { this.prop.dblclick_timeout = null, this.prop.dblclick_data = null } .bind(this), e.DBLCLICK_DELAY)) } }, e.prototype._move = function (a, b) { if (this.prop.moving) { var c = parseInt(a.clientX), d = parseInt(a.clientY); this.rotate({ longitude: this.prop.longitude - (c - this.prop.mouse_x) / this.prop.size.width * this.prop.move_speed * this.prop.hFov, latitude: this.prop.latitude + (d - this.prop.mouse_y) / this.prop.size.height * this.prop.move_speed * this.prop.vFov }), this.prop.mouse_x = c, this.prop.mouse_y = d, b !== !1 && this._logMouseMove(a) } }, e.prototype._zoom = function (a) { if (this.prop.zooming) { var b = [{ x: parseInt(a.touches[0].clientX), y: parseInt(a.touches[0].clientY) }, { x: parseInt(a.touches[1].clientX), y: parseInt(a.touches[1].clientY) } ], c = Math.sqrt(Math.pow(b[0].x - b[1].x, 2) + Math.pow(b[0].y - b[1].y, 2)), d = 80 * (c - this.prop.pinch_dist) / this.prop.size.width; this.zoom(this.prop.zoom_lvl + d), this.prop.pinch_dist = c } }, e.prototype._onMouseWheel = function (a) { a.preventDefault(), a.stopPropagation(); var b = void 0 !== a.deltaY ? -a.deltaY : void 0 !== a.wheelDelta ? a.wheelDelta : -a.detail; if (0 !== b) { var c = parseInt(b / Math.abs(b)); this.zoom(this.prop.zoom_lvl + c) } }, e.prototype._fullscreenToggled = function () { var a = this.isFullscreenEnabled(); this.config.keyboard && (a ? this.startKeyboardControl() : this.stopKeyboardControl()), this.trigger("fullscreen-updated", a) }, e.prototype._logMouseMove = function (a) { var b = Date.now(); this.prop.mouse_history.push([b, a.clientX, a.clientY]); for (var c = null, d = 0; d < this.prop.mouse_history.length; ) this.prop.mouse_history[0][d] < b - e.INERTIA_WINDOW ? this.prop.mouse_history.splice(d, 1) : c && this.prop.mouse_history[0][d] - c > e.INERTIA_WINDOW / 10 ? (this.prop.mouse_history.splice(0, d), d = 0, c = this.prop.mouse_history[0][d]) : (d++, c = this.prop.mouse_history[0][d]) }, e.prototype.load = function () { if (!this.config.panorama) throw new v("No value given for panorama."); return this.setPanorama(this.config.panorama, !1) }, e.prototype.getPosition = function () { return { longitude: this.prop.longitude, latitude: this.prop.latitude } }, e.prototype.getZoomLevel = function () { return this.prop.zoom_lvl }, e.prototype.getSize = function () { return { width: this.prop.size.width, height: this.prop.size.height } }, e.prototype.isAutorotateEnabled = function () { return !!this.prop.autorotate_reqid }, e.prototype.isGyroscopeEnabled = function () { return !!this.prop.orientation_reqid }, e.prototype.isFullscreenEnabled = function () { return x.isFullscreenEnabled(this.container) }, e.prototype.render = function (a) { a !== !1 && (this.prop.direction = this.sphericalCoordsToVector3(this.prop), this.camera.position.set(0, 0, 0), this.camera.lookAt(this.prop.direction)), this.config.fisheye && this.camera.position.copy(this.prop.direction).multiplyScalar(this.config.fisheye / 2).negate(), this.camera.aspect = this.prop.aspect, this.camera.fov = this.prop.vFov, this.camera.updateProjectionMatrix(), this.composer ? this.composer.render() : this.renderer.render(this.scene, this.camera), this.trigger("render") }, e.prototype.destroy = function () { this._stopAll(), this.stopKeyboardControl(), this.isFullscreenEnabled() && x.exitFullscreen(), window.removeEventListener("resize", this), this.config.mousemove && (this.hud.container.removeEventListener("mousedown", this), this.hud.container.removeEventListener("touchstart", this), window.removeEventListener("mouseup", this), window.removeEventListener("touchend", this), this.hud.container.removeEventListener("mousemove", this), this.hud.container.removeEventListener("touchmove", this)), e.SYSTEM.fullscreenEvent && document.removeEventListener(e.SYSTEM.fullscreenEvent, this), this.config.mousewheel && this.hud.container.removeEventListener(e.SYSTEM.mouseWheelEvent, this), this.tooltip && this.tooltip.destroy(), this.hud && this.hud.destroy(), this.loader && this.loader.destroy(), this.navbar && this.navbar.destroy(), this.panel && this.panel.destroy(), this.doControls && this.doControls.disconnect(), this.scene && x.cleanTHREEScene(this.scene), this.canvas_container && this.container.removeChild(this.canvas_container), this.parent.removeChild(this.container), delete this.parent.photoSphereViewer, delete this.parent, delete this.container, delete this.loader, delete this.navbar, delete this.hud, delete this.panel, delete this.tooltip, delete this.canvas_container, delete this.renderer, delete this.composer, delete this.scene, delete this.camera, delete this.mesh, delete this.doControls, delete this.raycaster, delete this.passes, delete this.config, this.prop.cache.length = 0 }, e.prototype.setPanorama = function (a, b, c) { if (null !== this.prop.loading_promise) throw new v("Loading already in progress"); if ("boolean" == typeof b && (c = b, b = void 0), c && this.prop.isCubemap) throw new v("Transition is not available with cubemap."); b && (this.cleanPosition(b), this._stopAll()), this.config.panorama = a; var d = this; return c && this.config.transition && this.scene ? (this.config.transition.loader && this.loader.show(), this.prop.loading_promise = this._loadTexture(this.config.panorama).then(function (a) { return d.loader.hide(), d._transition(a, b) }).ensure(function () { d.loader.hide(), d.prop.loading_promise = null }).rethrow()) : (this.loader.show(), this.canvas_container && (this.canvas_container.style.opacity = 0), this.prop.loading_promise = this._loadTexture(this.config.panorama).then(function (a) { d._setTexture(a), b && d.rotate(b) }).ensure(function () { d.loader.hide(), d.canvas_container.style.opacity = 1, d.prop.loading_promise = null }).rethrow()), this.prop.loading_promise }, e.prototype.startAutorotate = function () { this._stopAll(); var a = this, b = null, c = null; !function d(e) { e && (c = null === b ? 0 : e - b, b = e, a.rotate({ longitude: a.prop.longitude + a.config.anim_speed * c / 1e3, latitude: a.prop.latitude - (a.prop.latitude - a.config.anim_lat) / 200 })), a.prop.autorotate_reqid = window.requestAnimationFrame(d) } (null), this.trigger("autorotate", !0) }, e.prototype.stopAutorotate = function () { this.prop.start_timeout && (window.clearTimeout(this.prop.start_timeout), this.prop.start_timeout = null), this.prop.autorotate_reqid && (window.cancelAnimationFrame(this.prop.autorotate_reqid), this.prop.autorotate_reqid = null, this.trigger("autorotate", !1)) }, e.prototype.toggleAutorotate = function () { this.isAutorotateEnabled() ? this.stopAutorotate() : this.startAutorotate() }, e.prototype.startGyroscopeControl = function () { if (!this.doControls || !this.doControls.enabled || !this.doControls.deviceOrientation) return void console.warn("PhotoSphereViewer: gyroscope disabled"); this._stopAll(); var a = this; !function b() { a.doControls.update(), a.prop.direction = a.camera.getWorldDirection(); var c = a.vector3ToSphericalCoords(a.prop.direction); a.prop.longitude = c.longitude, a.prop.latitude = c.latitude, a.render(!1), a.prop.orientation_reqid = window.requestAnimationFrame(b) } (), this.trigger("gyroscope-updated", !0) }, e.prototype.stopGyroscopeControl = function () { this.prop.orientation_reqid && (window.cancelAnimationFrame(this.prop.orientation_reqid), this.prop.orientation_reqid = null, this.trigger("gyroscope-updated", !1), this.render()) }, e.prototype.toggleGyroscopeControl = function () { this.isGyroscopeEnabled() ? this.stopGyroscopeControl() : this.startGyroscopeControl() }, e.prototype.rotate = function (a, b) { this.cleanPosition(a), this.applyRanges(a).forEach(this.trigger.bind(this, "_side-reached")), this.prop.longitude = a.longitude, this.prop.latitude = a.latitude, b !== !1 && this.renderer && (this.render(), this.trigger("position-updated", this.getPosition())) }, e.prototype.animate = function (a, c) { if (this._stopAll(), !c) return this.rotate(a), b.resolved(); if (this.cleanPosition(a), this.applyRanges(a).forEach(this.trigger.bind(this, "_side-reached")), !c && "number" != typeof c) { c = c ? x.parseSpeed(c) : this.config.anim_speed; var d = Math.acos(Math.cos(this.prop.latitude) * Math.cos(a.latitude) * Math.cos(this.prop.longitude - a.longitude) + Math.sin(this.prop.latitude) * Math.sin(a.latitude)); c = d / c * 1e3 } var e = x.getShortestArc(this.prop.longitude, a.longitude); return this.prop.animation_promise = x.animation({ properties: { longitude: { start: this.prop.longitude, end: this.prop.longitude + e }, latitude: { start: this.prop.latitude, end: a.latitude } }, duration: c, easing: "inOutSine", onTick: this.rotate.bind(this) }), this.prop.animation_promise }, e.prototype.stopAnimation = function () { this.prop.animation_promise && (this.prop.animation_promise.cancel(), this.prop.animation_promise = null) }, e.prototype.zoom = function (b, c) { this.prop.zoom_lvl = x.bound(Math.round(b), 0, 100), this.prop.vFov = this.config.max_fov + this.prop.zoom_lvl / 100 * (this.config.min_fov - this.config.max_fov), this.prop.hFov = a.Math.radToDeg(2 * Math.atan(Math.tan(a.Math.degToRad(this.prop.vFov) / 2) * this.prop.aspect)), c !== !1 && this.renderer && (this.render(), this.trigger("zoom-updated", this.getZoomLevel())) }, e.prototype.zoomIn = function () { this.prop.zoom_lvl < 100 && this.zoom(this.prop.zoom_lvl + 1) }, e.prototype.zoomOut = function () { this.prop.zoom_lvl > 0 && this.zoom(this.prop.zoom_lvl - 1) }, e.prototype.toggleFullscreen = function () { this.isFullscreenEnabled() ? x.exitFullscreen() : x.requestFullscreen(this.container) }, e.prototype.startKeyboardControl = function () { window.addEventListener("keydown", this) }, e.prototype.stopKeyboardControl = function () { window.removeEventListener("keydown", this) }, e.prototype.preloadPanorama = function (a) { if (!this.config.cache_texture) throw new v("Cannot preload panorama, cache_texture is disabled"); return this._loadTexture(a) }, e.prototype.clearPanoramaCache = function (a) { if (!this.config.cache_texture) throw new v("Cannot clear cache, cache_texture is disabled"); if (a) { for (var b = 0, c = this.prop.cache.length; b < c; b++) if (this.prop.cache[b].panorama === a) { this.prop.cache.splice(b, 1); break } } else this.prop.cache.length = 0 }, e.prototype.getPanoramaCache = function (a) { if (!this.config.cache_texture) throw new v("Cannot query cache, cache_texture is disabled"); return this.prop.cache.filter(function (b) { return b.panorama === a }).shift() }, e._loadSystem = function () { var a = e.SYSTEM; a.loaded = !0, a.pixelRatio = window.devicePixelRatio || 1, a.isWebGLSupported = x.isWebGLSupported(), a.isCanvasSupported = x.isCanvasSupported(), a.maxTextureWidth = a.isWebGLSupported ? x.getMaxTextureWidth() : 4096, a.mouseWheelEvent = x.mouseWheelEvent(), a.fullscreenEvent = x.fullscreenEvent(), a.deviceOrientationSupported = b(), "DeviceOrientationEvent" in window ? window.addEventListener("deviceorientation", e._deviceOrientationListener, !1) : a.deviceOrientationSupported.reject() }, e._deviceOrientationListener = function (a) { null === a.alpha || isNaN(a.alpha) ? e.SYSTEM.deviceOrientationSupported.reject() : e.SYSTEM.deviceOrientationSupported.resolve(), window.removeEventListener("deviceorientation", e._deviceOrientationListener) }, e.prototype._setViewerSize = function (a) { ["width", "height"].forEach(function (b) { a[b] && (/^[0-9.]+$/.test(a[b]) && (a[b] += "px"), this.parent.style[b] = a[b]) }, this) }, e.prototype.textureCoordsToSphericalCoords = function (a) { if (this.prop.isCubemap) throw new v("Unable to use texture coords with cubemap."); var b = (a.x + this.prop.pano_data.cropped_x) / this.prop.pano_data.full_width * x.TwoPI, c = (a.y + this.prop.pano_data.cropped_y) / this.prop.pano_data.full_height * Math.PI; return { longitude: b >= Math.PI ? b - Math.PI : b + Math.PI, latitude: x.HalfPI - c } }, e.prototype.sphericalCoordsToTextureCoords = function (a) { if (this.prop.isCubemap) throw new v("Unable to use texture coords with cubemap."); var b = a.longitude / x.TwoPI * this.prop.pano_data.full_width, c = a.latitude / Math.PI * this.prop.pano_data.full_height; return { x: parseInt(a.longitude < Math.PI ? b + this.prop.pano_data.full_width / 2 : b - this.prop.pano_data.full_width / 2) - this.prop.pano_data.cropped_x, y: parseInt(this.prop.pano_data.full_height / 2 - c) - this.prop.pano_data.cropped_y } }, e.prototype.sphericalCoordsToVector3 = function (b) { return new a.Vector3(e.SPHERE_RADIUS * -Math.cos(b.latitude) * Math.sin(b.longitude), e.SPHERE_RADIUS * Math.sin(b.latitude), e.SPHERE_RADIUS * Math.cos(b.latitude) * Math.cos(b.longitude)) }, e.prototype.vector3ToSphericalCoords = function (a) { var b = Math.acos(a.y / Math.sqrt(a.x * a.x + a.y * a.y + a.z * a.z)), c = Math.atan2(a.x, a.z); return { longitude: c < 0 ? -c : x.TwoPI - c, latitude: x.HalfPI - b } }, e.prototype.viewerCoordsToVector3 = function (b) { var c = new a.Vector2(2 * b.x / this.prop.size.width - 1, -2 * b.y / this.prop.size.height + 1); this.raycaster.setFromCamera(c, this.camera); var d = this.raycaster.intersectObjects(this.scene.children); return 1 === d.length ? d[0].point : null }, e.prototype.vector3ToViewerCoords = function (a) { return a = a.clone(), a.project(this.camera), { x: parseInt((a.x + 1) / 2 * this.prop.size.width), y: parseInt((1 - a.y) / 2 * this.prop.size.height) } }, e.prototype.cleanPosition = function (a) { a.hasOwnProperty("x") && a.hasOwnProperty("y") && x.deepmerge(a, this.textureCoordsToSphericalCoords(a)), a.longitude = x.parseAngle(a.longitude), a.latitude = x.bound(x.parseAngle(a.latitude, -Math.PI), -x.HalfPI, x.HalfPI) }, e.prototype.applyRanges = function (b) { var c, d, e = []; return this.config.longitude_range && (c = x.clone(this.config.longitude_range), d = a.Math.degToRad(this.prop.hFov) / 2, c[0] = x.parseAngle(c[0] + d), c[1] = x.parseAngle(c[1] - d), c[0] > c[1] ? b.longitude > c[1] && b.longitude < c[0] && (b.longitude > c[0] / 2 + c[1] / 2 ? (b.longitude = c[0], e.push("left")) : (b.longitude = c[1], e.push("right"))) : b.longitude < c[0] ? (b.longitude = c[0], e.push("left")) : b.longitude > c[1] && (b.longitude = c[1], e.push("right"))), this.config.latitude_range && (c = x.clone(this.config.latitude_range), d = a.Math.degToRad(this.prop.vFov) / 2, c[0] = x.parseAngle(Math.min(c[0] + d, c[1]), -Math.PI), c[1] = x.parseAngle(Math.max(c[1] - d, c[0]), -Math.PI), b.latitude < c[0] ? (b.latitude = c[0], e.push("bottom")) : b.latitude > c[1] && (b.latitude = c[1], e.push("top"))), e }, f.className = null, f.publicMethods = [], f.prototype.create = function () { this.container = document.createElement("div"), this.constructor.className && (this.container.className = this.constructor.className), this.parent.container.appendChild(this.container) }, f.prototype.destroy = function () { this.parent.container.removeChild(this.container), this.constructor.publicMethods && this.constructor.publicMethods.forEach(function (a) { delete this.psv[a] }, this), delete this.container, delete this.psv, delete this.parent }, f.prototype.hide = function () { this.container.style.display = "none" }, f.prototype.show = function () { this.container.style.display = "" }, g.prototype = Object.create(f.prototype), g.prototype.constructor = g, g.className = "psv-hud", g.publicMethods = ["addMarker", "removeMarker", "updateMarker", "clearMarkers", "getMarker", "getCurrentMarker", "gotoMarker", "hideMarker", "showMarker", "toggleMarker", "toggleMarkersList", "showMarkersList", "hideMarkersList"], g.prototype.create = function () { f.prototype.create.call(this), this.svgContainer = document.createElementNS(x.svgNS, "svg"), this.svgContainer.setAttribute("class", "psv-hud-svg-container"), this.container.appendChild(this.svgContainer), this.container.addEventListener("mouseenter", this, !0), this.container.addEventListener("mouseleave", this, !0), this.container.addEventListener("mousemove", this, !0), this.psv.on("click", this), this.psv.on("dblclick", this), this.psv.on("render", this), this.psv.on("open-panel", this), this.psv.on("close-panel", this) }, g.prototype.destroy = function () { this.clearMarkers(!1), this.container.removeEventListener("mouseenter", this), this.container.removeEventListener("mouseleave", this), this.container.removeEventListener("mousemove", this), this.psv.off("click", this), this.psv.off("dblclick", this), this.psv.off("render", this), this.psv.off("open-panel", this), this.psv.off("close-panel", this), delete this.svgContainer, f.prototype.destroy.call(this) }, g.prototype.handleEvent = function (a) { switch (a.type) { case "mouseenter": this._onMouseEnter(a); break; case "mouseleave": this._onMouseLeave(a); break; case "mousemove": this._onMouseMove(a); break; case "click": this._onClick(a.args[0], a, !1); break; case "dblclick": this._onClick(a.args[0], a, !0); break; case "render": this.renderMarkers(); break; case "open-panel": this._onPanelOpened(); break; case "close-panel": this._onPanelClosed() } }, g.prototype.addMarker = function (a, b) { if (!a.id) throw new v("missing marker id"); if (this.markers[a.id]) throw new v('marker "' + a.id + '" already exists'); var c = new w(a, this.psv); return c.isNormal() ? this.container.appendChild(c.$el) : this.svgContainer.appendChild(c.$el), this.markers[c.id] = c, b !== !1 && this.renderMarkers(), c }, g.prototype.getMarker = function (a) { var b = "object" == typeof a ? a.id : a; if (!this.markers[b]) throw new v('cannot find marker "' + b + '"'); return this.markers[b] }, g.prototype.getCurrentMarker = function () { return this.currentMarker }, g.prototype.updateMarker = function (a, b) { var c = this.getMarker(a); return c.update(a), b !== !1 && this.renderMarkers(), c }, g.prototype.removeMarker = function (a, b) { a = this.getMarker(a), a.isNormal() ? this.container.removeChild(a.$el) : this.svgContainer.removeChild(a.$el), this.hoveringMarker == a && this.psv.tooltip.hideTooltip(), a.destroy(), delete this.markers[a.id], b !== !1 && this.renderMarkers() }, g.prototype.clearMarkers = function (a) { Object.keys(this.markers).forEach(function (a) { this.removeMarker(a, !1) }, this), a !== !1 && this.renderMarkers() }, g.prototype.gotoMarker = function (a, b) { return a = this.getMarker(a), this.psv.animate(a, b) }, g.prototype.hideMarker = function (a) { this.getMarker(a).visible = !1, this.renderMarkers() }, g.prototype.showMarker = function (a) { this.getMarker(a).visible = !0, this.renderMarkers() }, g.prototype.toggleMarker = function (a) { this.getMarker(a).visible ^= !0, this.renderMarkers() }, g.prototype.toggleMarkersList = function () { this.prop.panelOpened ? this.hideMarkersList() : this.showMarkersList() }, g.prototype.showMarkersList = function () { var a = []; for (var b in this.markers) a.push(this.markers[b]); var c = this.psv.config.templates.markersList({ markers: this.psv.change("render-markers-list", a), config: this.psv.config }); this.prop.panelOpening = !0, this.psv.panel.showPanel(c, !0), this.psv.panel.container.querySelector(".psv-markers-list").addEventListener("click", this._onClickItem.bind(this)) }, g.prototype.hideMarkersList = function () { this.prop.panelOpened && this.psv.panel.hidePanel() }, g.prototype.renderMarkers = function () { var b = this.psv.isGyroscopeEnabled() ? a.Math.radToDeg(this.psv.camera.rotation.z) : 0; for (var c in this.markers) { var d = this.markers[c], e = d.visible; if (e && d.isPolygon()) { var f = this._getPolygonPositions(d); if (e = f.length > 2) { d.position2D = this._getPolygonDimensions(d, f); var g = ""; f.forEach(function (a) { g += a.x + "," + a.y + " " }), d.$el.setAttributeNS(null, "points", g) } } else if (e) { var h = this._getMarkerPosition(d); e = this._isMarkerVisible(d, h), e && (d.position2D = h, d.$el instanceof SVGElement ? d.$el.setAttribute("transform", "translate(" + h.x + " " + h.y + ")" + (!d.lockRotation && b ? " rotate(" + b + " " + d.anchor.left * d.width + " " + d.anchor.top * d.height + ")" : "")) : (d.$el.style.transform = "translate3D(" + h.x + "px, " + h.y + "px, 0px)" + (!d.lockRotation && b ? " rotateZ(" + b + "deg)" : ""), d.$el.style.transformOrigin = 100 * d.anchor.left + "% " + 100 * d.anchor.top + "%")) } x.toggleClass(d.$el, "psv-marker--visible", e) } }, g.prototype._isMarkerVisible = function (a, b) { return a.position3D.dot(this.psv.prop.direction) > 0 && b.x + a.width >= 0 && b.x - a.width <= this.psv.prop.size.width && b.y + a.height >= 0 && b.y - a.height <= this.psv.prop.size.height }, g.prototype._getMarkerPosition = function (a) { if (a._dynamicSize) { x.toggleClass(a.$el, "psv-marker--transparent", !0); var b = a.$el.getBoundingClientRect(); x.toggleClass(a.$el, "psv-marker--transparent", !1), a.width = b.right - b.left, a.height = b.bottom - b.top } var c = this.psv.vector3ToViewerCoords(a.position3D); return c.x -= a.width * a.anchor.left, c.y -= a.height * a.anchor.top, c }, g.prototype._getPolygonPositions = function (a) { var b = a.positions3D.length, c = a.positions3D.map(function (a) { return { vector: a, visible: a.dot(this.psv.prop.direction) > 0 } }, this), d = []; return c.forEach(function (a, e) { if (!a.visible) { var f = [0 === e ? c[b - 1] : c[e - 1], e === b - 1 ? c[0] : c[e + 1]]; f.forEach(function (b) { b.visible && d.push({ visible: b, invisible: a, index: e }) }) } }), d.reverse().forEach(function (a) { c.splice(a.index, 0, { vector: this._getPolygonIntermediaryPoint(a.visible.vector, a.invisible.vector), visible: !0 }) }, this), c.filter(function (a) { return a.visible }).map(function (a) { return this.psv.vector3ToViewerCoords(a.vector) }, this) }, g.prototype._getPolygonIntermediaryPoint = function (b, c) { var d = this.psv.prop.direction.clone().normalize(), f = (new a.Vector3).crossVectors(b, c).normalize(), g = (new a.Vector3).crossVectors(f, b).normalize(), h = (new a.Vector3).addVectors(b.clone().multiplyScalar(-d.dot(g)), g.clone().multiplyScalar(d.dot(b))).normalize(), i = (new a.Vector3).crossVectors(h, d); return h.applyAxisAngle(i, .01).multiplyScalar(e.SPHERE_RADIUS) }, g.prototype._getPolygonDimensions = function (a, b) { var c = + (1 / 0), d = + (1 / 0), e = - (1 / 0), f = - (1 / 0); return b.forEach(function (a) { c = Math.min(c, a.x), d = Math.min(d, a.y), e = Math.max(e, a.x), f = Math.max(f, a.y) }), a.width = e - c, a.height = f - d, { x: c, y: d } }, g.prototype._onMouseEnter = function (a) { var b; a.target && (b = a.target.psvMarker) && !b.isPolygon() && (this.hoveringMarker = b, this.psv.trigger("over-marker", b), b.tooltip && this.psv.tooltip.showTooltip({ content: b.tooltip.content, position: b.tooltip.position, left: b.position2D.x, top: b.position2D.y, box: { width: b.width, height: b.height } })) }, g.prototype._onMouseLeave = function (a) { var b; if (a.target && (b = a.target.psvMarker)) { if (b.isPolygon() && a.relatedTarget && x.hasParent(a.relatedTarget, this.psv.tooltip.container)) return; this.psv.trigger("leave-marker", b), this.hoveringMarker = null, this.psv.tooltip.hideTooltip() } }, g.prototype._onMouseMove = function (a) { if (!this.psv.prop.moving) { var b; if (a.target && (b = a.target.psvMarker) && b.isPolygon() || a.target && x.hasParent(a.target, this.psv.tooltip.container) && (b = this.hoveringMarker)) { this.hoveringMarker || (this.psv.trigger("over-marker", b), this.hoveringMarker = b); var c = this.psv.container.getBoundingClientRect(); b.tooltip && this.psv.tooltip.showTooltip({ content: b.tooltip.content, position: b.tooltip.position, top: a.clientY - c.top - this.psv.config.tooltip.arrow_size / 2, left: a.clientX - c.left - this.psv.config.tooltip.arrow_size, box: { width: 2 * this.psv.config.tooltip.arrow_size, height: 2 * this.psv.config.tooltip.arrow_size } }) } else this.hoveringMarker && this.hoveringMarker.isPolygon() && (this.psv.trigger("leave-marker", b), this.hoveringMarker = null, this.psv.tooltip.hideTooltip()) } }, g.prototype._onClick = function (a, b, c) { var d; a.target && (d = x.getClosest(a.target, ".psv-marker")) && d.psvMarker ? (this.currentMarker = d.psvMarker, this.psv.trigger("select-marker", this.currentMarker, c), this.psv.config.click_event_on_marker ? a.marker = d.psvMarker : b.stopPropagation()) : this.currentMarker && (this.psv.trigger("unselect-marker", this.currentMarker), this.currentMarker = null), d && d.psvMarker && d.psvMarker.content ? this.psv.panel.showPanel(d.psvMarker.content) : this.psv.panel.prop.opened && (b.stopPropagation(), this.psv.panel.hidePanel()) }, g.prototype._onClickItem = function (a) { var b; a.target && (b = x.getClosest(a.target, "li")) && b.dataset.psvMarker && (this.gotoMarker(b.dataset.psvMarker, 1e3), this.psv.panel.hidePanel()) }, g.prototype._onPanelOpened = function () { this.prop.panelOpening ? (this.prop.panelOpening = !1, this.prop.panelOpened = !0) : this.prop.panelOpened = !1, this.prop.markersButton && this.prop.markersButton.toggleActive(this.prop.panelOpened) }, g.prototype._onPanelClosed = function () { this.prop.panelOpened = !1, this.prop.panelOpening = !1, this.prop.markersButton && this.prop.markersButton.toggleActive(!1) }, h.prototype = Object.create(f.prototype), h.prototype.constructor = h, h.className = "psv-loader-container", h.prototype.create = function () { f.prototype.create.call(this), this.loader = document.createElement("div"), this.loader.className = "psv-loader", this.container.appendChild(this.loader), this.canvas = document.createElement("canvas"), this.canvas.className = "psv-loader-canvas", this.canvas.width = this.loader.clientWidth, this.canvas.height = this.loader.clientWidth, this.loader.appendChild(this.canvas), this.tickness = (this.loader.offsetWidth - this.loader.clientWidth) / 2; var a; if (this.psv.config.loading_img ? (a = document.createElement("img"), a.className = "psv-loader-image", a.src = this.psv.config.loading_img) : this.psv.config.loading_txt && (a = document.createElement("div"), a.className = "psv-loader-text", a.innerHTML = this.psv.config.loading_txt), a) { var b = Math.round(Math.sqrt(2 * Math.pow(this.canvas.width / 2 - this.tickness / 2, 2))); a.style.maxWidth = b + "px", a.style.maxHeight = b + "px", this.loader.appendChild(a) } }, h.prototype.destroy = function () { delete this.loader, delete this.canvas, f.prototype.destroy.call(this) }, h.prototype.setProgress = function (a) { var b = this.canvas.getContext("2d"); b.clearRect(0, 0, this.canvas.width, this.canvas.height), b.lineWidth = this.tickness, b.strokeStyle = x.getStyle(this.loader, "color"), b.beginPath(), b.arc(this.canvas.width / 2, this.canvas.height / 2, this.canvas.width / 2 - this.tickness / 2, -Math.PI / 2, a / 100 * 2 * Math.PI - Math.PI / 2), b.stroke() }, i.prototype = Object.create(f.prototype), i.prototype.constructor = i, i.className = "psv-navbar psv-navbar--open", i.publicMethods = ["showNavbar", "hideNavbar", "toggleNavbar", "getNavbarButton"], i.prototype.create = function () { f.prototype.create.call(this), this.config.forEach(function (a) { if ("object" == typeof a) this.items.push(new p(this, a)); else switch (a) { case o.id: this.items.push(new o(this)); break; case u.id: this.items.push(new u(this)); break; case q.id: this.items.push(new q(this)); break; case t.id: this.items.push(new t(this)); break; case r.id: this.items.push(new r(this)); break; case s.id: this.psv.config.gyroscope && this.items.push(new s(this)); break; case "caption": this.items.push(new j(this, this.psv.config.caption)); break; case "spacer": a = "spacer-5"; default: var b = a.match(/^spacer\-([0-9]+)$/); if (null === b) throw new v("Unknown button " + a); this.items.push(new k(this, b[1])) } }, this) }, i.prototype.destroy = function () { this.items.forEach(function (a) { a.destroy() }), delete this.items, delete this.config, f.prototype.destroy.call(this) }, i.prototype.getNavbarButton = function (a) { var b = null; return this.items.some(function (c) { if (c.id === a) return b = c, !0 }), b || console.warn('PhotoSphereViewer: button "' + a + '" not found in the navbar.'), b }, i.prototype.showNavbar = function () { this.toggleNavbar(!0) }, i.prototype.hideNavbar = function () { this.toggleNavbar(!1) }, i.prototype.toggleNavbar = function (a) { x.toggleClass(this.container, "psv-navbar--open", a) }, j.prototype = Object.create(f.prototype), j.prototype.constructor = j, j.className = "psv-caption", j.publicMethods = ["setCaption"], j.prototype.setCaption = function (a) { a ? this.container.innerHTML = a : this.container.innerHTML = "" }, k.prototype = Object.create(f.prototype), k.prototype.constructor = k, k.className = "psv-spacer", l.prototype = Object.create(f.prototype), l.prototype.constructor = l, l.className = "psv-panel", l.publicMethods = ["showPanel", "hidePanel"], l.prototype.create = function () { f.prototype.create.call(this), this.container.innerHTML = '
    ', this.content = this.container.querySelector(".psv-panel-content"); var a = this.container.querySelector(".psv-panel-close-button"); a.addEventListener("click", this.hidePanel.bind(this)), this.psv.config.mousewheel && this.container.addEventListener(e.SYSTEM.mouseWheelEvent, function (a) { a.stopPropagation() }); var b = this.container.querySelector(".psv-panel-resizer"); b.addEventListener("mousedown", this), b.addEventListener("touchstart", this), this.psv.container.addEventListener("mouseup", this), this.psv.container.addEventListener("touchend", this), this.psv.container.addEventListener("mousemove", this), this.psv.container.addEventListener("touchmove", this) }, l.prototype.destroy = function () { this.psv.container.removeEventListener("mousemove", this), this.psv.container.removeEventListener("touchmove", this), this.psv.container.removeEventListener("mouseup", this), this.psv.container.removeEventListener("touchend", this), delete this.prop, delete this.content, f.prototype.destroy.call(this) }, l.prototype.handleEvent = function (a) { switch (a.type) { case "mousedown": this._onMouseDown(a); break; case "touchstart": this._onTouchStart(a); break; case "mousemove": this._onMouseMove(a); break; case "touchmove": this._onTouchMove(a); break; case "mouseup": this._onMouseUp(a); break; case "touchend": this._onMouseUp(a) } }, l.prototype.showPanel = function (a, b) { this.content.innerHTML = a, this.content.scrollTop = 0, this.container.classList.add("psv-panel--open"), x.toggleClass(this.content, "psv-panel-content--no-margin", !!b), this.prop.opened = !0, this.psv.trigger("open-panel") }, l.prototype.hidePanel = function () { this.content.innerHTML = null, this.prop.opened = !1, this.container.classList.remove("psv-panel--open"), this.psv.trigger("close-panel") }, l.prototype._onMouseDown = function (a) { a.stopPropagation(), this._startResize(a) }, l.prototype._onTouchStart = function (a) { a.stopPropagation(), this._startResize(a.changedTouches[0]) }, l.prototype._onMouseUp = function (a) { this.prop.mousedown && (a.stopPropagation(), this.prop.mousedown = !1, this.content.classList.remove("psv-panel-content--no-interaction")) }, l.prototype._onMouseMove = function (a) { this.prop.mousedown && (a.stopPropagation(), this._resize(a)) }, l.prototype._onTouchMove = function (a) { this.prop.mousedown && (a.stopPropagation(), this._resize(a.touches[0])) }, l.prototype._startResize = function (a) { this.prop.mouse_x = parseInt(a.clientX), this.prop.mouse_y = parseInt(a.clientY), this.prop.mousedown = !0, this.content.classList.add("psv-panel-content--no-interaction") }, l.prototype._resize = function (a) { var b = parseInt(a.clientX), c = parseInt(a.clientY); this.container.style.width = this.container.offsetWidth - (b - this.prop.mouse_x) + "px", this.prop.mouse_x = b, this.prop.mouse_y = c }, m.prototype = Object.create(f.prototype), m.prototype.constructor = m, m.className = "psv-tooltip", m.publicMethods = ["showTooltip", "hideTooltip", "isTooltipVisible"], m.leftMap = { 0: "left", .5: "center", 1: "right" }, m.topMap = { 0: "top", .5: "center", 1: "bottom" }, m.prototype.create = function () { f.prototype.create.call(this), this.container.innerHTML = '
    ', this.container.style.top = "-1000px", this.container.style.left = "-1000px", this.content = this.container.querySelector(".psv-tooltip-content"), this.arrow = this.container.querySelector(".psv-tooltip-arrow"), this.psv.on("render", this) }, m.prototype.destroy = function () { this.psv.off("render", this), delete this.config, delete this.prop, f.prototype.destroy.call(this) }, m.prototype.handleEvent = function (a) { switch (a.type) { case "render": this.hideTooltip() } }, m.prototype.isTooltipVisible = function () { return this.container.classList.contains("psv-tooltip--visible") }, m.prototype.showTooltip = function (a) { this.prop.timeout && (window.clearTimeout(this.prop.timeout), this.prop.timeout = null); var b = this.isTooltipVisible(), c = this.container, d = this.content, e = this.arrow; if (a.position || (a.position = ["top", "center"]), a.box || (a.box = { width: 0, height: 0 }), "string" == typeof a.position) { var f = x.parsePosition(a.position); if (!(f.left in m.leftMap && f.top in m.topMap)) throw new v('unable to parse tooltip position "' + tooltip.position + '"'); a.position = [m.topMap[f.top], m.leftMap[f.left]] } if ("center" == a.position[0] && "center" == a.position[1]) throw new v('unable to parse tooltip position "center center"'); if (b) for (var g = c.classList.length - 1; g >= 0; g--) { var h = c.classList.item(g); "psv-tooltip" != h && "psv-tooltip--visible" != h && c.classList.remove(h) } else c.className = "psv-tooltip"; a.className && x.addClasses(c, a.className), d.innerHTML = a.content, c.style.top = "0px", c.style.left = "0px"; var i = c.getBoundingClientRect(), j = { posClass: a.position.slice(), width: i.right - i.left, height: i.bottom - i.top, top: 0, left: 0, arrow_top: 0, arrow_left: 0 }; this._computeTooltipPosition(j, a); var k = !1; if (j.top < this.config.offset ? (j.posClass[0] = "bottom", k = !0) : j.top + j.height > this.psv.prop.size.height - this.config.offset && (j.posClass[0] = "top", k = !0), j.left < this.config.offset ? (j.posClass[1] = "right", k = !0) : j.left + j.width > this.psv.prop.size.width - this.config.offset && (j.posClass[1] = "left", k = !0), k && this._computeTooltipPosition(j, a), c.style.top = j.top + "px", c.style.left = j.left + "px", e.style.top = j.arrow_top + "px", e.style.left = j.arrow_left + "px", c.classList.add("psv-tooltip--" + j.posClass.join("-")), !b) { var l = this; this.prop.timeout = window.setTimeout(function () { c.classList.add("psv-tooltip--visible"), l.prop.timeout = null, l.psv.trigger("show-tooltip") }, this.config.delay) } }, m.prototype.hideTooltip = function () { if (this.prop.timeout && (window.clearTimeout(this.prop.timeout), this.prop.timeout = null), this.isTooltipVisible()) { this.container.classList.remove("psv-tooltip--visible"); var a = this; this.prop.timeout = window.setTimeout(function () { a.content.innerHTML = null, a.container.style.top = "-1000px", a.container.style.left = "-1000px", a.prop.timeout = null }, this.config.delay), this.psv.trigger("hide-tooltip") } }, m.prototype._computeTooltipPosition = function (a, b) { var c = !1; switch (a.posClass[0]) { case "bottom": a.top = b.top + b.box.height + this.config.offset + this.config.arrow_size, a.arrow_top = 2 * -this.config.arrow_size, c = !0; break; case "center": a.top = b.top + b.box.height / 2 - a.height / 2, a.arrow_top = a.height / 2 - this.config.arrow_size; break; case "top": a.top = b.top - a.height - this.config.offset - this.config.arrow_size, a.arrow_top = a.height, c = !0 } switch (a.posClass[1]) { case "right": c ? (a.left = b.left + b.box.width / 2 - this.config.offset - this.config.arrow_size, a.arrow_left = this.config.offset) : (a.left = b.left + b.box.width + this.config.offset + this.config.arrow_size, a.arrow_left = 2 * -this.config.arrow_size); break; case "center": a.left = b.left + b.box.width / 2 - a.width / 2, a.arrow_left = a.width / 2 - this.config.arrow_size; break; case "left": c ? (a.left = b.left - a.width + b.box.width / 2 + this.config.offset + this.config.arrow_size, a.arrow_left = a.width - this.config.offset - 2 * this.config.arrow_size) : (a.left = b.left - a.width - this.config.offset - this.config.arrow_size, a.arrow_left = a.width) } }, n.prototype = Object.create(f.prototype), n.prototype.constructor = n, n.id = null, n.icon = null, n.iconActive = null, n.prototype.create = function () { f.prototype.create.call(this), this.constructor.icon && this._setIcon(this.constructor.icon), this.id && this.psv.config.lang[this.id] && (this.container.title = this.psv.config.lang[this.id]), this.container.addEventListener("click", function (a) { this.enabled && this._onClick(), a.stopPropagation() } .bind(this)) }, n.prototype.destroy = function () { f.prototype.destroy.call(this) }, n.prototype.toggleActive = function (a) { x.toggleClass(this.container, "psv-button--active", a), this.constructor.iconActive && this._setIcon(a ? this.constructor.iconActive : this.constructor.icon) }, n.prototype.disable = function () { this.container.classList.add("psv-button--disabled"), this.enabled = !1 }, n.prototype.enable = function () { this.container.classList.remove("psv-button--disabled"), this.enabled = !0 }, n.prototype._setIcon = function (a, b) { b || (b = this.container), a ? (b.innerHTML = e.ICONS[a], b.querySelector("svg").setAttribute("class", "psv-button-svg")) : b.innerHTML = "" }, n.prototype._onClick = function () {}, o.prototype = Object.create(n.prototype), o.prototype.constructor = o, o.id = "autorotate", o.className = "psv-button psv-button--hover-scale psv-autorotate-button", o.icon = "play.svg", o.iconActive = "play-active.svg", o.prototype.create = function () { n.prototype.create.call(this), this.psv.on("autorotate", this) }, o.prototype.destroy = function () { this.psv.off("autorotate", this), n.prototype.destroy.call(this) }, o.prototype.handleEvent = function (a) { switch (a.type) { case "autorotate": this.toggleActive(a.args[0]) } }, o.prototype._onClick = function () { this.psv.toggleAutorotate() }, p.prototype = Object.create(n.prototype), p.prototype.constructor = p, p.className = "psv-button psv-custom-button", p.prototype.create = function () { n.prototype.create.call(this), this.config.className && x.addClasses(this.container, this.config.className), this.config.title && (this.container.title = this.config.title), this.config.content && (this.container.innerHTML = this.config.content), this.config.enabled !== !1 && this.config.disabled !== !0 || this.disable(), this.config.visible !== !1 && this.config.hidden !== !0 || this.hide() }, p.prototype.destroy = function () { delete this.config, n.prototype.destroy.call(this) }, p.prototype._onClick = function () { this.config.onClick && this.config.onClick.apply(this.psv) }, q.prototype = Object.create(n.prototype), q.prototype.constructor = q, q.id = "download", q.className = "psv-button psv-button--hover-scale psv-download-button", q.icon = "download.svg", q.prototype._onClick = function () { var a = document.createElement("a"); a.href = this.psv.config.panorama, a.download = this.psv.config.panorama, this.psv.container.appendChild(a), a.click() }, r.prototype = Object.create(n.prototype), r.prototype.constructor = r, r.id = "fullscreen", r.className = "psv-button psv-button--hover-scale psv-fullscreen-button", r.icon = "fullscreen-in.svg", r.iconActive = "fullscreen-out.svg", r.prototype.create = function () { n.prototype.create.call(this), e.SYSTEM.fullscreenEvent || (this.hide(), console.warn("PhotoSphereViewer: fullscreen not supported.")), this.psv.on("fullscreen-updated", this) }, r.prototype.destroy = function () { this.psv.off("fullscreen-updated", this), n.prototype.destroy.call(this) }, r.prototype.handleEvent = function (a) { switch (a.type) { case "fullscreen-updated": this.toggleActive(a.args[0]) } }, r.prototype._onClick = function () { this.psv.toggleFullscreen() }, s.prototype = Object.create(n.prototype), s.prototype.constructor = s, s.id = "gyroscope", s.className = "psv-button psv-button--hover-scale psv-gyroscope-button", s.icon = "compass.svg", s.prototype.create = function () { n.prototype.create.call(this), e.SYSTEM.deviceOrientationSupported.promise.then(this._onAvailabilityChange.bind(this, !0), this._onAvailabilityChange.bind(this, !1)), this.hide(), this.psv.on("gyroscope-updated", this) }, s.prototype.destroy = function () { this.psv.off("gyroscope-updated", this), n.prototype.destroy.call(this) }, s.prototype.handleEvent = function (a) { switch (a.type) { case "gyroscope-updated": this.toggleActive(a.args[0]) } }, s.prototype._onClick = function () { this.psv.toggleGyroscopeControl() }, s.prototype._onAvailabilityChange = function (a) { if (a) { if (!x.checkTHREE("DeviceOrientationControls")) throw new v("Missing Three.js components: DeviceOrientationControls. Get them from three.js-examples package."); this.show() } }, t.prototype = Object.create(n.prototype), t.prototype.constructor = t, t.id = "markers", t.className = "psv-button psv-button--hover-scale psv-markers-button", t.icon = "pin.svg", t.prototype._onClick = function () { this.psv.hud.toggleMarkersList() }, u.prototype = Object.create(n.prototype), u.prototype.constructor = u, u.id = "zoom", u.className = "psv-button psv-zoom-button", u.prototype.create = function () { n.prototype.create.call(this); var a = document.createElement("div"); a.className = "psv-zoom-button-minus", a.title = this.psv.config.lang.zoomOut, this._setIcon("zoom-out.svg", a), this.container.appendChild(a); var b = document.createElement("div"); b.className = "psv-zoom-button-range", this.container.appendChild(b), this.zoom_range = document.createElement("div"), this.zoom_range.className = "psv-zoom-button-line", b.appendChild(this.zoom_range), this.zoom_value = document.createElement("div"), this.zoom_value.className = "psv-zoom-button-handle", this.zoom_range.appendChild(this.zoom_value); var c = document.createElement("div"); c.className = "psv-zoom-button-plus", c.title = this.psv.config.lang.zoomIn, this._setIcon("zoom-in.svg", c), this.container.appendChild(c), this.zoom_range.addEventListener("mousedown", this), this.zoom_range.addEventListener("touchstart", this), this.psv.container.addEventListener("mousemove", this), this.psv.container.addEventListener("touchmove", this), this.psv.container.addEventListener("mouseup", this), this.psv.container.addEventListener("touchend", this), a.addEventListener("mousedown", this._zoomOut.bind(this)), c.addEventListener("mousedown", this._zoomIn.bind(this)), this.psv.on("zoom-updated", this), this.psv.once("ready", function () { this._moveZoomValue(this.psv.prop.zoom_lvl) } .bind(this)) }, u.prototype.destroy = function () { this.psv.container.removeEventListener("mousemove", this), this.psv.container.removeEventListener("touchmove", this), this.psv.container.removeEventListener("mouseup", this), this.psv.container.removeEventListener("touchend", this), delete this.zoom_range, delete this.zoom_value, this.psv.off("zoom-updated", this), n.prototype.destroy.call(this) }, u.prototype.handleEvent = function (a) { switch (a.type) { case "mousedown": this._initZoomChangeWithMouse(a); break; case "touchstart": this._initZoomChangeByTouch(a); break; case "mousemove": this._changeZoomWithMouse(a); break; case "touchmove": this._changeZoomByTouch(a); break; case "mouseup": this._stopZoomChange(a); break; case "touchend": this._stopZoomChange(a); break; case "zoom-updated": this._moveZoomValue(a.args[0]) } }, u.prototype._moveZoomValue = function (a) { this.zoom_value.style.left = a / 100 * this.zoom_range.offsetWidth - this.zoom_value.offsetWidth / 2 + "px" }, u.prototype._initZoomChangeWithMouse = function (a) { this.enabled && (this.prop.mousedown = !0, this._changeZoom(a.clientX)) }, u.prototype._initZoomChangeByTouch = function (a) { this.enabled && (this.prop.mousedown = !0, this._changeZoom(a.changedTouches[0].clientX)) }, u.prototype._zoomIn = function () { this.enabled && (this.prop.buttondown = !0, this.psv.zoomIn(), window.setTimeout(this._startLongPressInterval.bind(this, 1), 200)) }, u.prototype._zoomOut = function () { this.enabled && (this.prop.buttondown = !0, this.psv.zoomOut(), window.setTimeout(this._startLongPressInterval.bind(this, -1), 200)) }, u.prototype._startLongPressInterval = function (a) { this.prop.buttondown && (this.prop.longPressInterval = window.setInterval(function () { this.psv.zoom(this.psv.prop.zoom_lvl + a) } .bind(this), 50)) }, u.prototype._stopZoomChange = function () { this.enabled && (window.clearInterval(this.prop.longPressInterval), this.prop.longPressInterval = null, this.prop.mousedown = !1, this.prop.buttondown = !1) }, u.prototype._changeZoomWithMouse = function (a) { this.enabled && (a.preventDefault(), this._changeZoom(a.clientX)) }, u.prototype._changeZoomByTouch = function (a) { this.enabled && (a.preventDefault(), this._changeZoom(a.changedTouches[0].clientX)) }, u.prototype._changeZoom = function (a) { if (this.prop.mousedown) { var b = parseInt(a) - this.zoom_range.getBoundingClientRect().left, c = b / this.zoom_range.offsetWidth * 100; this.psv.zoom(c) } }, v.prototype = Object.create(Error.prototype), v.prototype.name = "PSVError", v.prototype.constructor = v, e.Error = v, w.types = ["image", "html", "polygon_px", "polygon_rad", "rect", "circle", "ellipse", "path"], w.getType = function (a, b) { var c = []; if (w.types.forEach(function (b) { a[b] && c.push(b) }), 0 === c.length && !b) throw new v("missing marker content, either " + w.types.join(", ")); if (c.length > 1) throw new v("multiple marker content, either " + w.types.join(", ")); return c[0] }, w.prototype.destroy = function () { delete this.$el.psvMarker }, w.prototype.isNormal = function () { return "image" == this.type || "html" == this.type }, w.prototype.isPolygon = function () { return "polygon_px" == this.type || "polygon_rad" == this.type }, w.prototype.isSvg = function () { return "rect" == this.type || "circle" == this.type || "ellipse" == this.type || "path" == this.type }, w.prototype.update = function (a) { if (a && a !== this) { var b = w.getType(a, !0); if (void 0 !== b && b !== this.type) throw new v("cannot change marker type"); x.deepmerge(this, a) } this.isNormal() ? this.$el.setAttribute("class", "psv-marker psv-marker--normal") : this.$el.setAttribute("class", "psv-marker psv-marker--svg"), this.className && x.addClasses(this.$el, this.className), this.tooltip && (x.addClasses(this.$el, "has-tooltip"), "string" == typeof this.tooltip && (this.tooltip = { content: this.tooltip })), this.style && x.deepmerge(this.$el.style, this.style), this.anchor = x.parsePosition(this.anchor), this.isNormal() ? this._updateNormal() : this.isPolygon() ? this._updatePolygon() : this._updateSvg() }, w.prototype._updateNormal = function () { this.width && this.height ? (this.$el.style.width = this.width + "px", this.$el.style.height = this.height + "px", this._dynamicSize = !1) : this._dynamicSize = !0, this.image ? this.$el.style.backgroundImage = "url(" + this.image + ")" : this.$el.innerHTML = this.html, this.psv.cleanPosition(this), this.position3D = this.psv.sphericalCoordsToVector3(this) }, w.prototype._updateSvg = function () { switch (this._dynamicSize = !0, this.type) { case "rect": "number" == typeof this._def ? this._def = { x: 0, y: 0, width: this._def, height: this._def } : Array.isArray(this._def) ? this._def = { x: 0, y: 0, width: this._def[0], height: this._def[1] } : this._def.x = this._def.y = 0; break; case "circle": "number" == typeof this._def ? this._def = { cx: this._def, cy: this._def, r: this._def } : Array.isArray(this._def) ? this._def = { cx: this._def[0], cy: this._def[0], r: this._def[0] } : this._def.cx = this._def.cy = this._def.r; break; case "ellipse": "number" == typeof this._def ? this._def = { cx: this._def, cy: this._def, rx: this._def, ry: this._def } : Array.isArray(this._def) ? this._def = { cx: this._def[0], cy: this._def[1], rx: this._def[0], ry: this._def[1] } : (this._def.cx = this._def.rx, this._def.cy = this._def.ry); break; case "path": "string" == typeof this._def && (this._def = { d: this._def }) } Object.getOwnPropertyNames(this._def).forEach(function (a) { this.$el.setAttributeNS(null, a, this._def[a]) }, this), this.svgStyle ? Object.getOwnPropertyNames(this.svgStyle).forEach(function (a) { this.$el.setAttributeNS(null, a, this.svgStyle[a]) }, this) : this.$el.setAttributeNS(null, "fill", "rgba(0,0,0,0.5)"), this.psv.cleanPosition(this), this.position3D = this.psv.sphericalCoordsToVector3(this) }, w.prototype._updatePolygon = function () { this._dynamicSize = !0, this.svgStyle ? Object.getOwnPropertyNames(this.svgStyle).forEach(function (a) { this.$el.setAttributeNS(null, a, this.svgStyle[a]) }, this) : this.$el.setAttributeNS(null, "fill", "rgba(0,0,0,0.5)"), [this.polygon_rad, this.polygon_px].forEach(function (a) { if (a && "object" != typeof a[0]) for (var b = 0; b < a.length; b++) a.splice(b, 2, [a[b], a[b + 1]]) }), this.polygon_px ? this.polygon_rad = this.polygon_px.map(function (a) { var b = this.psv.textureCoordsToSphericalCoords({ x: a[0], y: a[1] }); return [b.longitude, b.latitude] }, this) : this.polygon_rad = this.polygon_rad.map(function (a) { return [x.parseAngle(a[0]), x.bound(x.parseAngle(a[1], -Math.PI), -x.HalfPI, x.HalfPI)] }), this.longitude = this.polygon_rad[0][0], this.latitude = this.polygon_rad[0][1], this.positions3D = this.polygon_rad.map(function (a) { return this.psv.sphericalCoordsToVector3({ longitude: a[0], latitude: a[1] }) }, this) }; var x = {}; return e.Utils = x, x.TwoPI = 2 * Math.PI, x.HalfPI = Math.PI / 2, x.svgNS = "http://www.w3.org/2000/svg", x.checkTHREE = function (b) { for (var c = 0, d = arguments.length; c < d; c++) if (!(arguments[c]in a)) return !1; return !0 }, x.isCanvasSupported = function () { var a = document.createElement("canvas"); return !(!a.getContext || !a.getContext("2d")) }, x.getWebGLCtx = function () { var a = document.createElement("canvas"), b = ["webgl", "experimental-webgl", "moz-webgl", "webkit-3d"], c = null; return a.getContext && b.some(function (b) { try { return c = a.getContext(b), c && "function" == typeof c.getParameter } catch (d) { return !1 } }) ? c : null }, x.isWebGLSupported = function () { return !!window.WebGLRenderingContext && null !== x.getWebGLCtx() }, x.getMaxTextureWidth = function () { var a = x.getWebGLCtx(); if (null !== a) return a.getParameter(a.MAX_TEXTURE_SIZE) }, x.toggleClass = function (a, b, c) { if (a.classList) void 0 === c ? a.classList.toggle(b) : c && !a.classList.contains(b) ? a.classList.add(b) : c || a.classList.remove(b); else { var d = a.getAttribute("class") || "", e = d.indexOf(b) !== -1, f = new RegExp("(?:^|\\s)" + b + "(?:\\s|$)"); void 0 !== c && !c || e ? c || (d = d.replace(f, " ")) : d += d.length > 0 ? " " + b : b, a.setAttribute("class", d) } }, x.addClasses = function (a, b) { b && b.split(" ").forEach(function (b) { x.toggleClass(a, b, !0) }) }, x.removeClasses = function (a, b) { b && b.split(" ").forEach(function (b) { x.toggleClass(a, b, !1) }) }, x.hasParent = function (a, b) { do if (a === b) return !0; while (a = a.parentNode); return !1 }, x.getClosest = function (a, b) { var c = a.matches || a.msMatchesSelector; do if (c.bind(a)(b)) return a; while (a = a.parentElement); return null }, x.mouseWheelEvent = function () { return "onwheel" in document.createElement("div") ? "wheel" : void 0 !== document.onmousewheel ? "mousewheel" : "DOMMouseScroll" }, x.fullscreenEvent = function () { var a = { exitFullscreen: "fullscreenchange", webkitExitFullscreen: "webkitfullscreenchange", mozCancelFullScreen: "mozfullscreenchange", msExitFullscreen: "msFullscreenEnabled" }; for (var b in a) if (b in document) return a[b] }, x.bound = function (a, b, c) { return Math.max(b, Math.min(c, a)) }, x.isInteger = Number.isInteger || function (a) { return "number" == typeof a && isFinite(a) && Math.floor(a) === a }, x.sum = function (a) { return a.reduce(function (a, b) { return a + b }, 0) }, x.getXMPValue = function (a, b) { var c; return null !== (c = a.match("(.*)")) ? c[1] : null !== (c = a.match("GPano:" + b + '="(.*?)"')) ? c[1] : null }, x.isFullscreenEnabled = function (a) { return (document.fullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement) === a }, x.requestFullscreen = function (a) { (a.requestFullscreen || a.mozRequestFullScreen || a.webkitRequestFullscreen || a.msRequestFullscreen).call(a) }, x.exitFullscreen = function () { (document.exitFullscreen || document.mozCancelFullScreen || document.webkitExitFullscreen || document.msExitFullscreen).call(document) }, x.getStyle = function (a, b) { return window.getComputedStyle(a, null)[b] }, x.getShortestArc = function (a, b) { var c = [0, x.TwoPI, -x.TwoPI]; return c.reduce(function (c, d) { return d = b - a + d, Math.abs(d) < Math.abs(c) ? d : c }, 1 / 0) }, x.parsePosition = function (a) { if (!a) return { top: .5, left: .5 }; if ("object" == typeof a) return a; var b = a.toLocaleLowerCase().split(" ").slice(0, 2); 1 === b.length && (b = void 0 !== x.parsePosition.positions[b[0]] ? [b[0], "center"] : [b[0], b[0]]); var c = "left" != b[1] && "right" != b[1] && "top" != b[0] && "bottom" != b[0]; b = b.map(function (a) { return x.parsePosition.positions[a] || a }), c || b.reverse(); var d = b.join(" ").match(/^([0-9.]+)% ([0-9.]+)%$/); return d ? { left: d[1] / 100, top: d[2] / 100 } : { top: .5, left: .5 } }, x.parsePosition.positions = { top: "0%", bottom: "100%", left: "0%", right: "100%", center: "50%" }, x.parseSpeed = function (b) { if ("string" == typeof b) { b = b.toString().trim(); var c = parseFloat(b.replace(/^(-?[0-9]+(?:\.[0-9]*)?).*$/, "$1")), d = b.replace(/^-?[0-9]+(?:\.[0-9]*)?(.*)$/, "$1").trim(); switch (d.match(/(pm|per minute)$/) && (c /= 60), d) { case "dpm": case "degrees per minute": case "dps": case "degrees per second": b = a.Math.degToRad(c); break; case "radians per minute": case "radians per second": b = c; break; case "rpm": case "revolutions per minute": case "rps": case "revolutions per second": b = c * x.TwoPI; break; default: throw new v('unknown speed unit "' + d + '"') } } return b }, x.parseAngle = function (b, c) { if ("string" == typeof b) { var d = b.toLowerCase().trim().match(/^(-?[0-9]+(?:\.[0-9]*)?)(.*)$/); if (!d) throw new v('unknown angle "' + b + '"'); var e = parseFloat(d[1]), f = d[2]; if (f) switch (f) { case "deg": case "degs": b = a.Math.degToRad(e); break; case "rad": case "rads": b = e; break; default: throw new v('unknown angle unit "' + f + '"') } } return c !== !1 && (void 0 === c && (c = 0), b = (b - c) % x.TwoPI, b < 0 && (b = x.TwoPI + b), b += c), b }, x.cleanTHREEScene = function (b) { b.children.forEach(function (b) { b instanceof a.Mesh && (b.geometry && (b.geometry.dispose(), b.geometry = null), b.material && (b.material.materials ? (b.material.materials.forEach(function (a) { a.map && (a.map.dispose(), a.map = null), a.dispose() }), b.material.materials.length = 0) : (b.material.map && (b.material.map.dispose(), b.material.map = null), b.material.dispose()), b.material = null)) }), b.children.length = 0 }, x.animation = function (a) { function c(b) { if (d.promise.getStatus() !== -1) { null === e && (e = b); var f, g = (b - e) / a.duration, h = {}; if (g < 1) { for (f in a.properties) h[f] = a.properties[f].start + (a.properties[f].end - a.properties[f].start) * a.easing(g); a.onTick(h, g), window.requestAnimationFrame(c) } else { for (f in a.properties) h[f] = a.properties[f].end; a.onTick(h, 1), window.requestAnimationFrame(function () { d.resolve() }) } } } var d = b(!1), e = null; a.easing && "string" != typeof a.easing || (a.easing = x.animation.easings[a.easing || "linear"]), void 0 !== a.delay ? window.setTimeout(function () { window.requestAnimationFrame(c) }, a.delay) : window.requestAnimationFrame(c); var f = d.promise; return f.cancel = function () { d.reject() }, f }, x.animation.easings = { linear: function (a) { return a }, inQuad: function (a) { return a * a }, outQuad: function (a) { return a * (2 - a) }, inOutQuad: function (a) { return a < .5 ? 2 * a * a : -1 + (4 - 2 * a) * a }, inCubic: function (a) { return a * a * a }, outCubic: function (a) { return --a * a * a + 1 }, inOutCubic: function (a) { return a < .5 ? 4 * a * a * a : (a - 1) * (2 * a - 2) * (2 * a - 2) + 1 }, inQuart: function (a) { return a * a * a * a }, outQuart: function (a) { return 1 - --a * a * a * a }, inOutQuart: function (a) { return a < .5 ? 8 * a * a * a * a : 1 - 8 * --a * a * a * a }, inQuint: function (a) { return a * a * a * a * a }, outQuint: function (a) { return 1 + --a * a * a * a * a }, inOutQuint: function (a) { return a < .5 ? 16 * a * a * a * a * a : 1 + 16 * --a * a * a * a * a }, inSine: function (a) { return 1 - Math.cos(a * (Math.PI / 2)) }, outSine: function (a) { return Math.sin(a * (Math.PI / 2)) }, inOutSine: function (a) { return .5 - .5 * Math.cos(Math.PI * a) }, inExpo: function (a) { return Math.pow(2, 10 * (a - 1)) }, outExpo: function (a) { return 1 - Math.pow(2, -10 * a) }, inOutExpo: function (a) { return a = 2 * a - 1, a < 0 ? .5 * Math.pow(2, 10 * a) : 1 - .5 * Math.pow(2, -10 * a) }, inCirc: function (a) { return 1 - Math.sqrt(1 - a * a) }, outCirc: function (a) { return a--, Math.sqrt(1 - a * a) }, inOutCirc: function (a) { return a *= 2, a < 1 ? .5 - .5 * Math.sqrt(1 - a * a) : .5 + .5 * Math.sqrt(1 - (a -= 2) * a) } }, x.throttle = function (a, b) { var c, d, e, f = null, g = 0, h = function () { g = Date.now(), f = null, e = a.apply(c, d), f || (c = d = null) }; return function () { var i = Date.now(); g || (g = i); var j = b - (i - g); return c = this, d = arguments, j <= 0 || j > b ? (f && (clearTimeout(f), f = null), g = i, e = a.apply(c, d), f || (c = d = null)) : f || (f = setTimeout(h, j)), e } }, x.isPlainObject = function (a) { if ("object" == typeof a && null !== a) { if ("function" == typeof Object.getPrototypeOf) { var b = Object.getPrototypeOf(a); return b === Object.prototype || null === b } return "[object Object]" == Object.prototype.toString.call(a) } return !1 }, x.deepmerge = function (a, b) { var c = b; return function d(a, b) { return Array.isArray(b) ? (a && Array.isArray(a) ? a.length = 0 : a = [], b.forEach(function (b, c) { a[c] = d(null, b) })) : "object" == typeof b ? (a && !Array.isArray(a) || (a = {}), Object.keys(b).forEach(function (e) { "object" == typeof b[e] && b[e] && x.isPlainObject(b[e]) ? b[e] != c && (a[e] ? d(a[e], b[e]) : a[e] = d(null, b[e])) : a[e] = b[e] })) : a = b, a } (a, b) }, x.clone = function (a) { return x.deepmerge(null, a) }, function (a) { if (a.requestAnimationFrame = a.requestAnimationFrame || a.mozRequestAnimationFrame || a.webkitRequestAnimationFrame || a.msRequestAnimationFrame, a.cancelAnimationFrame = a.cancelAnimationFrame || a.mozCancelAnimationFrame || a.webkitCancelAnimationFrame || a.msCancelAnimationFrame, !a.requestAnimationFrame) { var b, c = [], d = [], e = 0; a.requestAnimationFrame = function (a) { return c.push([++e, a]), b || (b = setInterval(function () { if (c.length) { var a = +new Date, e = d; for (d = c, c = e; d.length; ) d.shift()[1](a) } else clearInterval(b), b = void 0 }, 20)), e }, a.cancelAnimationFrame = function (a) { var b, e; for (b = 0, e = c.length; b < e; b += 1) if (c[b][0] === a) return void c.splice(b, 1); for (b = 0, e = d.length; b < e; b += 1) if (d[b][0] === a) return void d.splice(b, 1) } } } (window), e.ICONS["compass.svg"] = '', e.ICONS["download.svg"] = '', e.ICONS["fullscreen-in.svg"] = '', e.ICONS["fullscreen-out.svg"] = '', e.ICONS["pin.svg"] = '', e.ICONS["play-active.svg"] = '', e.ICONS["play.svg"] = '', e.ICONS["zoom-in.svg"] = '', e.ICONS["zoom-out.svg"] = '', e }); /* * qTip2 - Pretty powerful tooltips - v3.0.3 * http://qtip2.com * * Copyright (c) 2016 * Released under the MIT licenses * http://jquery.org/license * * Date: Wed May 11 2016 10:31 GMT+0100+0100 * Plugins: tips modal viewport svg imagemap ie6 * Styles: core basic css3 */ /*global window: false, jQuery: false, console: false, define: false */ /* Cache window, document, undefined */ (function($, window, document, undefined ) { jQuery=$; // Uses AMD or browser globals to create a jQuery plugin. (function( factory ) { "use strict"; if(typeof define === 'function' && define.amd) { define(['jquery'], factory); } else if(jQuery && !jQuery.fn.qtip) { factory(jQuery); } } (function($) { "use strict"; // Enable ECMAScript "strict" operation for this function. See more: http://ejohn.org/blog/ecmascript-5-strict-mode-json-and-more/ ;// Munge the primitives - Paul Irish tip var TRUE = true, FALSE = false, NULL = null, // Common variables X = 'x', Y = 'y', WIDTH = 'width', HEIGHT = 'height', // Positioning sides TOP = 'top', LEFT = 'left', BOTTOM = 'bottom', RIGHT = 'right', CENTER = 'center', // Position adjustment types FLIP = 'flip', FLIPINVERT = 'flipinvert', SHIFT = 'shift', // Shortcut vars QTIP, PROTOTYPE, CORNER, CHECKS, PLUGINS = {}, NAMESPACE = 'qtip', ATTR_HAS = 'data-hasqtip', ATTR_ID = 'data-qtip-id', WIDGET = ['ui-widget', 'ui-tooltip'], SELECTOR = '.'+NAMESPACE, INACTIVE_EVENTS = 'click dblclick mousedown mouseup mousemove mouseleave mouseenter'.split(' '), CLASS_FIXED = NAMESPACE+'-fixed', CLASS_DEFAULT = NAMESPACE + '-default', CLASS_FOCUS = NAMESPACE + '-focus', CLASS_HOVER = NAMESPACE + '-hover', CLASS_DISABLED = NAMESPACE+'-disabled', replaceSuffix = '_replacedByqTip', oldtitle = 'oldtitle', trackingBound, // Browser detection BROWSER = { /* * IE version detection * * Adapted from: http://ajaxian.com/archives/attack-of-the-ie-conditional-comment * Credit to James Padolsey for the original implemntation! */ ie: (function() { /* eslint-disable no-empty */ var v, i; for ( v = 4, i = document.createElement('div'); (i.innerHTML = '') && i.getElementsByTagName('i')[0]; v+=1 ) {} return v > 4 ? v : NaN; /* eslint-enable no-empty */ })(), /* * iOS version detection */ iOS: parseFloat( ('' + (/CPU.*OS ([0-9_]{1,5})|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent) || [0,''])[1]) .replace('undefined', '3_2').replace('_', '.').replace('_', '') ) || FALSE }; ;function QTip(target, options, id, attr) { // Elements and ID this.id = id; this.target = target; this.tooltip = NULL; this.elements = { target: target }; // Internal constructs this._id = NAMESPACE + '-' + id; this.timers = { img: {} }; this.options = options; this.plugins = {}; // Cache object this.cache = { event: {}, target: $(), disabled: FALSE, attr: attr, onTooltip: FALSE, lastClass: '' }; // Set the initial flags this.rendered = this.destroyed = this.disabled = this.waiting = this.hiddenDuringWait = this.positioning = this.triggering = FALSE; } PROTOTYPE = QTip.prototype; PROTOTYPE._when = function(deferreds) { return $.when.apply($, deferreds); }; PROTOTYPE.render = function(show) { if(this.rendered || this.destroyed) { return this; } // If tooltip has already been rendered, exit var self = this, options = this.options, cache = this.cache, elements = this.elements, text = options.content.text, title = options.content.title, button = options.content.button, posOptions = options.position, deferreds = []; // Add ARIA attributes to target $.attr(this.target[0], 'aria-describedby', this._id); // Create public position object that tracks current position corners cache.posClass = this._createPosClass( (this.position = { my: posOptions.my, at: posOptions.at }).my ); // Create tooltip element this.tooltip = elements.tooltip = $('
    ', { 'id': this._id, 'class': [ NAMESPACE, CLASS_DEFAULT, options.style.classes, cache.posClass ].join(' '), 'width': options.style.width || '', 'height': options.style.height || '', 'tracking': posOptions.target === 'mouse' && posOptions.adjust.mouse, /* ARIA specific attributes */ 'role': 'alert', 'aria-live': 'polite', 'aria-atomic': FALSE, 'aria-describedby': this._id + '-content', 'aria-hidden': TRUE }) .toggleClass(CLASS_DISABLED, this.disabled) .attr(ATTR_ID, this.id) .data(NAMESPACE, this) .appendTo(posOptions.container) .append( // Create content element elements.content = $('
    ', { 'class': NAMESPACE + '-content', 'id': this._id + '-content', 'aria-atomic': TRUE }) ); // Set rendered flag and prevent redundant reposition calls for now this.rendered = -1; this.positioning = TRUE; // Create title... if(title) { this._createTitle(); // Update title only if its not a callback (called in toggle if so) if(!$.isFunction(title)) { deferreds.push( this._updateTitle(title, FALSE) ); } } // Create button if(button) { this._createButton(); } // Set proper rendered flag and update content if not a callback function (called in toggle) if(!$.isFunction(text)) { deferreds.push( this._updateContent(text, FALSE) ); } this.rendered = TRUE; // Setup widget classes this._setWidget(); // Initialize 'render' plugins $.each(PLUGINS, function(name) { var instance; if(this.initialize === 'render' && (instance = this(self))) { self.plugins[name] = instance; } }); // Unassign initial events and assign proper events this._unassignEvents(); this._assignEvents(); // When deferreds have completed this._when(deferreds).then(function() { // tooltiprender event self._trigger('render'); // Reset flags self.positioning = FALSE; // Show tooltip if not hidden during wait period if(!self.hiddenDuringWait && (options.show.ready || show)) { self.toggle(TRUE, cache.event, FALSE); } self.hiddenDuringWait = FALSE; }); // Expose API QTIP.api[this.id] = this; return this; }; PROTOTYPE.destroy = function(immediate) { // Set flag the signify destroy is taking place to plugins // and ensure it only gets destroyed once! if(this.destroyed) { return this.target; } function process() { if(this.destroyed) { return; } this.destroyed = TRUE; var target = this.target, title = target.attr(oldtitle), timer; // Destroy tooltip if rendered if(this.rendered) { this.tooltip.stop(1,0).find('*').remove().end().remove(); } // Destroy all plugins $.each(this.plugins, function() { this.destroy && this.destroy(); }); // Clear timers for (timer in this.timers) { if (this.timers.hasOwnProperty(timer)) { clearTimeout(this.timers[timer]); } } // Remove api object and ARIA attributes target.removeData(NAMESPACE) .removeAttr(ATTR_ID) .removeAttr(ATTR_HAS) .removeAttr('aria-describedby'); // Reset old title attribute if removed if(this.options.suppress && title) { target.attr('title', title).removeAttr(oldtitle); } // Remove qTip events associated with this API this._unassignEvents(); // Remove ID from used id objects, and delete object references // for better garbage collection and leak protection this.options = this.elements = this.cache = this.timers = this.plugins = this.mouse = NULL; // Delete epoxsed API object delete QTIP.api[this.id]; } // If an immediate destroy is needed if((immediate !== TRUE || this.triggering === 'hide') && this.rendered) { this.tooltip.one('tooltiphidden', $.proxy(process, this)); !this.triggering && this.hide(); } // If we're not in the process of hiding... process else { process.call(this); } return this.target; }; ;function invalidOpt(a) { return a === NULL || $.type(a) !== 'object'; } function invalidContent(c) { return !($.isFunction(c) || c && c.attr || c.length || $.type(c) === 'object' && (c.jquery || c.then)); } // Option object sanitizer function sanitizeOptions(opts) { var content, text, ajax, once; if(invalidOpt(opts)) { return FALSE; } if(invalidOpt(opts.metadata)) { opts.metadata = { type: opts.metadata }; } if('content' in opts) { content = opts.content; if(invalidOpt(content) || content.jquery || content.done) { text = invalidContent(content) ? FALSE : content; content = opts.content = { text: text }; } else { text = content.text; } // DEPRECATED - Old content.ajax plugin functionality // Converts it into the proper Deferred syntax if('ajax' in content) { ajax = content.ajax; once = ajax && ajax.once !== FALSE; delete content.ajax; content.text = function(event, api) { var loading = text || $(this).attr(api.options.content.attr) || 'Loading...', deferred = $.ajax( $.extend({}, ajax, { context: api }) ) .then(ajax.success, NULL, ajax.error) .then(function(newContent) { if(newContent && once) { api.set('content.text', newContent); } return newContent; }, function(xhr, status, error) { if(api.destroyed || xhr.status === 0) { return; } api.set('content.text', status + ': ' + error); }); return !once ? (api.set('content.text', loading), deferred) : loading; }; } if('title' in content) { if($.isPlainObject(content.title)) { content.button = content.title.button; content.title = content.title.text; } if(invalidContent(content.title || FALSE)) { content.title = FALSE; } } } if('position' in opts && invalidOpt(opts.position)) { opts.position = { my: opts.position, at: opts.position }; } if('show' in opts && invalidOpt(opts.show)) { opts.show = opts.show.jquery ? { target: opts.show } : opts.show === TRUE ? { ready: TRUE } : { event: opts.show }; } if('hide' in opts && invalidOpt(opts.hide)) { opts.hide = opts.hide.jquery ? { target: opts.hide } : { event: opts.hide }; } if('style' in opts && invalidOpt(opts.style)) { opts.style = { classes: opts.style }; } // Sanitize plugin options $.each(PLUGINS, function() { this.sanitize && this.sanitize(opts); }); return opts; } // Setup builtin .set() option checks CHECKS = PROTOTYPE.checks = { builtin: { // Core checks '^id$': function(obj, o, v, prev) { var id = v === TRUE ? QTIP.nextid : v, newId = NAMESPACE + '-' + id; if(id !== FALSE && id.length > 0 && !$('#'+newId).length) { this._id = newId; if(this.rendered) { this.tooltip[0].id = this._id; this.elements.content[0].id = this._id + '-content'; this.elements.title[0].id = this._id + '-title'; } } else { obj[o] = prev; } }, '^prerender': function(obj, o, v) { v && !this.rendered && this.render(this.options.show.ready); }, // Content checks '^content.text$': function(obj, o, v) { this._updateContent(v); }, '^content.attr$': function(obj, o, v, prev) { if(this.options.content.text === this.target.attr(prev)) { this._updateContent( this.target.attr(v) ); } }, '^content.title$': function(obj, o, v) { // Remove title if content is null if(!v) { return this._removeTitle(); } // If title isn't already created, create it now and update v && !this.elements.title && this._createTitle(); this._updateTitle(v); }, '^content.button$': function(obj, o, v) { this._updateButton(v); }, '^content.title.(text|button)$': function(obj, o, v) { this.set('content.'+o, v); // Backwards title.text/button compat }, // Position checks '^position.(my|at)$': function(obj, o, v){ if('string' === typeof v) { this.position[o] = obj[o] = new CORNER(v, o === 'at'); } }, '^position.container$': function(obj, o, v){ this.rendered && this.tooltip.appendTo(v); }, // Show checks '^show.ready$': function(obj, o, v) { v && (!this.rendered && this.render(TRUE) || this.toggle(TRUE)); }, // Style checks '^style.classes$': function(obj, o, v, p) { this.rendered && this.tooltip.removeClass(p).addClass(v); }, '^style.(width|height)': function(obj, o, v) { this.rendered && this.tooltip.css(o, v); }, '^style.widget|content.title': function() { this.rendered && this._setWidget(); }, '^style.def': function(obj, o, v) { this.rendered && this.tooltip.toggleClass(CLASS_DEFAULT, !!v); }, // Events check '^events.(render|show|move|hide|focus|blur)$': function(obj, o, v) { this.rendered && this.tooltip[($.isFunction(v) ? '' : 'un') + 'bind']('tooltip'+o, v); }, // Properties which require event reassignment '^(show|hide|position).(event|target|fixed|inactive|leave|distance|viewport|adjust)': function() { if(!this.rendered) { return; } // Set tracking flag var posOptions = this.options.position; this.tooltip.attr('tracking', posOptions.target === 'mouse' && posOptions.adjust.mouse); // Reassign events this._unassignEvents(); this._assignEvents(); } } }; // Dot notation converter function convertNotation(options, notation) { var i = 0, obj, option = options, // Split notation into array levels = notation.split('.'); // Loop through while(option = option[ levels[i++] ]) { if(i < levels.length) { obj = option; } } return [obj || options, levels.pop()]; } PROTOTYPE.get = function(notation) { if(this.destroyed) { return this; } var o = convertNotation(this.options, notation.toLowerCase()), result = o[0][ o[1] ]; return result.precedance ? result.string() : result; }; function setCallback(notation, args) { var category, rule, match; for(category in this.checks) { if (!this.checks.hasOwnProperty(category)) { continue; } for(rule in this.checks[category]) { if (!this.checks[category].hasOwnProperty(rule)) { continue; } if(match = (new RegExp(rule, 'i')).exec(notation)) { args.push(match); if(category === 'builtin' || this.plugins[category]) { this.checks[category][rule].apply( this.plugins[category] || this, args ); } } } } } var rmove = /^position\.(my|at|adjust|target|container|viewport)|style|content|show\.ready/i, rrender = /^prerender|show\.ready/i; PROTOTYPE.set = function(option, value) { if(this.destroyed) { return this; } var rendered = this.rendered, reposition = FALSE, options = this.options, name; // Convert singular option/value pair into object form if('string' === typeof option) { name = option; option = {}; option[name] = value; } else { option = $.extend({}, option); } // Set all of the defined options to their new values $.each(option, function(notation, val) { if(rendered && rrender.test(notation)) { delete option[notation]; return; } // Set new obj value var obj = convertNotation(options, notation.toLowerCase()), previous; previous = obj[0][ obj[1] ]; obj[0][ obj[1] ] = val && val.nodeType ? $(val) : val; // Also check if we need to reposition reposition = rmove.test(notation) || reposition; // Set the new params for the callback option[notation] = [obj[0], obj[1], val, previous]; }); // Re-sanitize options sanitizeOptions(options); /* * Execute any valid callbacks for the set options * Also set positioning flag so we don't get loads of redundant repositioning calls. */ this.positioning = TRUE; $.each(option, $.proxy(setCallback, this)); this.positioning = FALSE; // Update position if needed if(this.rendered && this.tooltip[0].offsetWidth > 0 && reposition) { this.reposition( options.position.target === 'mouse' ? NULL : this.cache.event ); } return this; }; ;PROTOTYPE._update = function(content, element) { var self = this, cache = this.cache; // Make sure tooltip is rendered and content is defined. If not return if(!this.rendered || !content) { return FALSE; } // Use function to parse content if($.isFunction(content)) { content = content.call(this.elements.target, cache.event, this) || ''; } // Handle deferred content if($.isFunction(content.then)) { cache.waiting = TRUE; return content.then(function(c) { cache.waiting = FALSE; return self._update(c, element); }, NULL, function(e) { return self._update(e, element); }); } // If content is null... return false if(content === FALSE || !content && content !== '') { return FALSE; } // Append new content if its a DOM array and show it if hidden if(content.jquery && content.length > 0) { element.empty().append( content.css({ display: 'block', visibility: 'visible' }) ); } // Content is a regular string, insert the new content else { element.html(content); } // Wait for content to be loaded, and reposition return this._waitForContent(element).then(function(images) { if(self.rendered && self.tooltip[0].offsetWidth > 0) { self.reposition(cache.event, !images.length); } }); }; PROTOTYPE._waitForContent = function(element) { var cache = this.cache; // Set flag cache.waiting = TRUE; // If imagesLoaded is included, ensure images have loaded and return promise return ( $.fn.imagesLoaded ? element.imagesLoaded() : new $.Deferred().resolve([]) ) .done(function() { cache.waiting = FALSE; }) .promise(); }; PROTOTYPE._updateContent = function(content, reposition) { this._update(content, this.elements.content, reposition); }; PROTOTYPE._updateTitle = function(content, reposition) { if(this._update(content, this.elements.title, reposition) === FALSE) { this._removeTitle(FALSE); } }; PROTOTYPE._createTitle = function() { var elements = this.elements, id = this._id+'-title'; // Destroy previous title element, if present if(elements.titlebar) { this._removeTitle(); } // Create title bar and title elements elements.titlebar = $('
    ', { 'class': NAMESPACE + '-titlebar ' + (this.options.style.widget ? createWidgetClass('header') : '') }) .append( elements.title = $('
    ', { 'id': id, 'class': NAMESPACE + '-title', 'aria-atomic': TRUE }) ) .insertBefore(elements.content) // Button-specific events .delegate('.qtip-close', 'mousedown keydown mouseup keyup mouseout', function(event) { $(this).toggleClass('ui-state-active ui-state-focus', event.type.substr(-4) === 'down'); }) .delegate('.qtip-close', 'mouseover mouseout', function(event){ $(this).toggleClass('ui-state-hover', event.type === 'mouseover'); }); // Create button if enabled if(this.options.content.button) { this._createButton(); } }; PROTOTYPE._removeTitle = function(reposition) { var elements = this.elements; if(elements.title) { elements.titlebar.remove(); elements.titlebar = elements.title = elements.button = NULL; // Reposition if enabled if(reposition !== FALSE) { this.reposition(); } } }; ;PROTOTYPE._createPosClass = function(my) { return NAMESPACE + '-pos-' + (my || this.options.position.my).abbrev(); }; PROTOTYPE.reposition = function(event, effect) { if(!this.rendered || this.positioning || this.destroyed) { return this; } // Set positioning flag this.positioning = TRUE; var cache = this.cache, tooltip = this.tooltip, posOptions = this.options.position, target = posOptions.target, my = posOptions.my, at = posOptions.at, viewport = posOptions.viewport, container = posOptions.container, adjust = posOptions.adjust, method = adjust.method.split(' '), tooltipWidth = tooltip.outerWidth(FALSE), tooltipHeight = tooltip.outerHeight(FALSE), targetWidth = 0, targetHeight = 0, type = tooltip.css('position'), position = { left: 0, top: 0 }, visible = tooltip[0].offsetWidth > 0, isScroll = event && event.type === 'scroll', win = $(window), doc = container[0].ownerDocument, mouse = this.mouse, pluginCalculations, offset, adjusted, newClass; // Check if absolute position was passed if($.isArray(target) && target.length === 2) { // Force left top and set position at = { x: LEFT, y: TOP }; position = { left: target[0], top: target[1] }; } // Check if mouse was the target else if(target === 'mouse') { // Force left top to allow flipping at = { x: LEFT, y: TOP }; // Use the mouse origin that caused the show event, if distance hiding is enabled if((!adjust.mouse || this.options.hide.distance) && cache.origin && cache.origin.pageX) { event = cache.origin; } // Use cached event for resize/scroll events else if(!event || event && (event.type === 'resize' || event.type === 'scroll')) { event = cache.event; } // Otherwise, use the cached mouse coordinates if available else if(mouse && mouse.pageX) { event = mouse; } // Calculate body and container offset and take them into account below if(type !== 'static') { position = container.offset(); } if(doc.body.offsetWidth !== (window.innerWidth || doc.documentElement.clientWidth)) { offset = $(document.body).offset(); } // Use event coordinates for position position = { left: event.pageX - position.left + (offset && offset.left || 0), top: event.pageY - position.top + (offset && offset.top || 0) }; // Scroll events are a pain, some browsers if(adjust.mouse && isScroll && mouse) { position.left -= (mouse.scrollX || 0) - win.scrollLeft(); position.top -= (mouse.scrollY || 0) - win.scrollTop(); } } // Target wasn't mouse or absolute... else { // Check if event targetting is being used if(target === 'event') { if(event && event.target && event.type !== 'scroll' && event.type !== 'resize') { cache.target = $(event.target); } else if(!event.target) { cache.target = this.elements.target; } } else if(target !== 'event'){ cache.target = $(target.jquery ? target : this.elements.target); } target = cache.target; // Parse the target into a jQuery object and make sure there's an element present target = $(target).eq(0); if(target.length === 0) { return this; } // Check if window or document is the target else if(target[0] === document || target[0] === window) { targetWidth = BROWSER.iOS ? window.innerWidth : target.width(); targetHeight = BROWSER.iOS ? window.innerHeight : target.height(); if(target[0] === window) { position = { top: (viewport || target).scrollTop(), left: (viewport || target).scrollLeft() }; } } // Check if the target is an element else if(PLUGINS.imagemap && target.is('area')) { pluginCalculations = PLUGINS.imagemap(this, target, at, PLUGINS.viewport ? method : FALSE); } // Check if the target is an SVG element else if(PLUGINS.svg && target && target[0].ownerSVGElement) { pluginCalculations = PLUGINS.svg(this, target, at, PLUGINS.viewport ? method : FALSE); } // Otherwise use regular jQuery methods else { targetWidth = target.outerWidth(FALSE); targetHeight = target.outerHeight(FALSE); position = target.offset(); } // Parse returned plugin values into proper variables if(pluginCalculations) { targetWidth = pluginCalculations.width; targetHeight = pluginCalculations.height; offset = pluginCalculations.offset; position = pluginCalculations.position; } // Adjust position to take into account offset parents position = this.reposition.offset(target, position, container); // Adjust for position.fixed tooltips (and also iOS scroll bug in v3.2-4.0 & v4.3-4.3.2) if(BROWSER.iOS > 3.1 && BROWSER.iOS < 4.1 || BROWSER.iOS >= 4.3 && BROWSER.iOS < 4.33 || !BROWSER.iOS && type === 'fixed' ){ position.left -= win.scrollLeft(); position.top -= win.scrollTop(); } // Adjust position relative to target if(!pluginCalculations || pluginCalculations && pluginCalculations.adjustable !== FALSE) { position.left += at.x === RIGHT ? targetWidth : at.x === CENTER ? targetWidth / 2 : 0; position.top += at.y === BOTTOM ? targetHeight : at.y === CENTER ? targetHeight / 2 : 0; } } // Adjust position relative to tooltip position.left += adjust.x + (my.x === RIGHT ? -tooltipWidth : my.x === CENTER ? -tooltipWidth / 2 : 0); position.top += adjust.y + (my.y === BOTTOM ? -tooltipHeight : my.y === CENTER ? -tooltipHeight / 2 : 0); // Use viewport adjustment plugin if enabled if(PLUGINS.viewport) { adjusted = position.adjusted = PLUGINS.viewport( this, position, posOptions, targetWidth, targetHeight, tooltipWidth, tooltipHeight ); // Apply offsets supplied by positioning plugin (if used) if(offset && adjusted.left) { position.left += offset.left; } if(offset && adjusted.top) { position.top += offset.top; } // Apply any new 'my' position if(adjusted.my) { this.position.my = adjusted.my; } } // Viewport adjustment is disabled, set values to zero else { position.adjusted = { left: 0, top: 0 }; } // Set tooltip position class if it's changed if(cache.posClass !== (newClass = this._createPosClass(this.position.my))) { cache.posClass = newClass; tooltip.removeClass(cache.posClass).addClass(newClass); } // tooltipmove event if(!this._trigger('move', [position, viewport.elem || viewport], event)) { return this; } delete position.adjusted; // If effect is disabled, target it mouse, no animation is defined or positioning gives NaN out, set CSS directly if(effect === FALSE || !visible || isNaN(position.left) || isNaN(position.top) || target === 'mouse' || !$.isFunction(posOptions.effect)) { tooltip.css(position); } // Use custom function if provided else if($.isFunction(posOptions.effect)) { posOptions.effect.call(tooltip, this, $.extend({}, position)); tooltip.queue(function(next) { // Reset attributes to avoid cross-browser rendering bugs $(this).css({ opacity: '', height: '' }); if(BROWSER.ie) { this.style.removeAttribute('filter'); } next(); }); } // Set positioning flag this.positioning = FALSE; return this; }; // Custom (more correct for qTip!) offset calculator PROTOTYPE.reposition.offset = function(elem, pos, container) { if(!container[0]) { return pos; } var ownerDocument = $(elem[0].ownerDocument), quirks = !!BROWSER.ie && document.compatMode !== 'CSS1Compat', parent = container[0], scrolled, position, parentOffset, overflow; function scroll(e, i) { pos.left += i * e.scrollLeft(); pos.top += i * e.scrollTop(); } // Compensate for non-static containers offset do { if((position = $.css(parent, 'position')) !== 'static') { if(position === 'fixed') { parentOffset = parent.getBoundingClientRect(); scroll(ownerDocument, -1); } else { parentOffset = $(parent).position(); parentOffset.left += parseFloat($.css(parent, 'borderLeftWidth')) || 0; parentOffset.top += parseFloat($.css(parent, 'borderTopWidth')) || 0; } pos.left -= parentOffset.left + (parseFloat($.css(parent, 'marginLeft')) || 0); pos.top -= parentOffset.top + (parseFloat($.css(parent, 'marginTop')) || 0); // If this is the first parent element with an overflow of "scroll" or "auto", store it if(!scrolled && (overflow = $.css(parent, 'overflow')) !== 'hidden' && overflow !== 'visible') { scrolled = $(parent); } } } while(parent = parent.offsetParent); // Compensate for containers scroll if it also has an offsetParent (or in IE quirks mode) if(scrolled && (scrolled[0] !== ownerDocument[0] || quirks)) { scroll(scrolled, 1); } return pos; }; // Corner class var C = (CORNER = PROTOTYPE.reposition.Corner = function(corner, forceY) { corner = ('' + corner).replace(/([A-Z])/, ' $1').replace(/middle/gi, CENTER).toLowerCase(); this.x = (corner.match(/left|right/i) || corner.match(/center/) || ['inherit'])[0].toLowerCase(); this.y = (corner.match(/top|bottom|center/i) || ['inherit'])[0].toLowerCase(); this.forceY = !!forceY; var f = corner.charAt(0); this.precedance = f === 't' || f === 'b' ? Y : X; }).prototype; C.invert = function(z, center) { this[z] = this[z] === LEFT ? RIGHT : this[z] === RIGHT ? LEFT : center || this[z]; }; C.string = function(join) { var x = this.x, y = this.y; var result = x !== y ? x === 'center' || y !== 'center' && (this.precedance === Y || this.forceY) ? [y,x] : [x,y] : [x]; return join !== false ? result.join(' ') : result; }; C.abbrev = function() { var result = this.string(false); return result[0].charAt(0) + (result[1] && result[1].charAt(0) || ''); }; C.clone = function() { return new CORNER( this.string(), this.forceY ); }; ; PROTOTYPE.toggle = function(state, event) { var cache = this.cache, options = this.options, tooltip = this.tooltip; // Try to prevent flickering when tooltip overlaps show element if(event) { if((/over|enter/).test(event.type) && cache.event && (/out|leave/).test(cache.event.type) && options.show.target.add(event.target).length === options.show.target.length && tooltip.has(event.relatedTarget).length) { return this; } // Cache event cache.event = $.event.fix(event); } // If we're currently waiting and we've just hidden... stop it this.waiting && !state && (this.hiddenDuringWait = TRUE); // Render the tooltip if showing and it isn't already if(!this.rendered) { return state ? this.render(1) : this; } else if(this.destroyed || this.disabled) { return this; } var type = state ? 'show' : 'hide', opts = this.options[type], posOptions = this.options.position, contentOptions = this.options.content, width = this.tooltip.css('width'), visible = this.tooltip.is(':visible'), animate = state || opts.target.length === 1, sameTarget = !event || opts.target.length < 2 || cache.target[0] === event.target, identicalState, allow, after; // Detect state if valid one isn't provided if((typeof state).search('boolean|number')) { state = !visible; } // Check if the tooltip is in an identical state to the new would-be state identicalState = !tooltip.is(':animated') && visible === state && sameTarget; // Fire tooltip(show/hide) event and check if destroyed allow = !identicalState ? !!this._trigger(type, [90]) : NULL; // Check to make sure the tooltip wasn't destroyed in the callback if(this.destroyed) { return this; } // If the user didn't stop the method prematurely and we're showing the tooltip, focus it if(allow !== FALSE && state) { this.focus(event); } // If the state hasn't changed or the user stopped it, return early if(!allow || identicalState) { return this; } // Set ARIA hidden attribute $.attr(tooltip[0], 'aria-hidden', !!!state); // Execute state specific properties if(state) { // Store show origin coordinates this.mouse && (cache.origin = $.event.fix(this.mouse)); // Update tooltip content & title if it's a dynamic function if($.isFunction(contentOptions.text)) { this._updateContent(contentOptions.text, FALSE); } if($.isFunction(contentOptions.title)) { this._updateTitle(contentOptions.title, FALSE); } // Cache mousemove events for positioning purposes (if not already tracking) if(!trackingBound && posOptions.target === 'mouse' && posOptions.adjust.mouse) { $(document).bind('mousemove.'+NAMESPACE, this._storeMouse); trackingBound = TRUE; } // Update the tooltip position (set width first to prevent viewport/max-width issues) if(!width) { tooltip.css('width', tooltip.outerWidth(FALSE)); } this.reposition(event, arguments[2]); if(!width) { tooltip.css('width', ''); } // Hide other tooltips if tooltip is solo if(!!opts.solo) { (typeof opts.solo === 'string' ? $(opts.solo) : $(SELECTOR, opts.solo)) .not(tooltip).not(opts.target).qtip('hide', new $.Event('tooltipsolo')); } } else { // Clear show timer if we're hiding clearTimeout(this.timers.show); // Remove cached origin on hide delete cache.origin; // Remove mouse tracking event if not needed (all tracking qTips are hidden) if(trackingBound && !$(SELECTOR+'[tracking="true"]:visible', opts.solo).not(tooltip).length) { $(document).unbind('mousemove.'+NAMESPACE); trackingBound = FALSE; } // Blur the tooltip this.blur(event); } // Define post-animation, state specific properties after = $.proxy(function() { if(state) { // Prevent antialias from disappearing in IE by removing filter if(BROWSER.ie) { tooltip[0].style.removeAttribute('filter'); } // Remove overflow setting to prevent tip bugs tooltip.css('overflow', ''); // Autofocus elements if enabled if('string' === typeof opts.autofocus) { $(this.options.show.autofocus, tooltip).focus(); } // If set, hide tooltip when inactive for delay period this.options.show.target.trigger('qtip-'+this.id+'-inactive'); } else { // Reset CSS states tooltip.css({ display: '', visibility: '', opacity: '', left: '', top: '' }); } // tooltipvisible/tooltiphidden events this._trigger(state ? 'visible' : 'hidden'); }, this); // If no effect type is supplied, use a simple toggle if(opts.effect === FALSE || animate === FALSE) { tooltip[ type ](); after(); } // Use custom function if provided else if($.isFunction(opts.effect)) { tooltip.stop(1, 1); opts.effect.call(tooltip, this); tooltip.queue('fx', function(n) { after(); n(); }); } // Use basic fade function by default else { tooltip.fadeTo(90, state ? 1 : 0, after); } // If inactive hide method is set, active it if(state) { opts.target.trigger('qtip-'+this.id+'-inactive'); } return this; }; PROTOTYPE.show = function(event) { return this.toggle(TRUE, event); }; PROTOTYPE.hide = function(event) { return this.toggle(FALSE, event); }; ;PROTOTYPE.focus = function(event) { if(!this.rendered || this.destroyed) { return this; } var qtips = $(SELECTOR), tooltip = this.tooltip, curIndex = parseInt(tooltip[0].style.zIndex, 10), newIndex = QTIP.zindex + qtips.length; // Only update the z-index if it has changed and tooltip is not already focused if(!tooltip.hasClass(CLASS_FOCUS)) { // tooltipfocus event if(this._trigger('focus', [newIndex], event)) { // Only update z-index's if they've changed if(curIndex !== newIndex) { // Reduce our z-index's and keep them properly ordered qtips.each(function() { if(this.style.zIndex > curIndex) { this.style.zIndex = this.style.zIndex - 1; } }); // Fire blur event for focused tooltip qtips.filter('.' + CLASS_FOCUS).qtip('blur', event); } // Set the new z-index tooltip.addClass(CLASS_FOCUS)[0].style.zIndex = newIndex; } } return this; }; PROTOTYPE.blur = function(event) { if(!this.rendered || this.destroyed) { return this; } // Set focused status to FALSE this.tooltip.removeClass(CLASS_FOCUS); // tooltipblur event this._trigger('blur', [ this.tooltip.css('zIndex') ], event); return this; }; ;PROTOTYPE.disable = function(state) { if(this.destroyed) { return this; } // If 'toggle' is passed, toggle the current state if(state === 'toggle') { state = !(this.rendered ? this.tooltip.hasClass(CLASS_DISABLED) : this.disabled); } // Disable if no state passed else if('boolean' !== typeof state) { state = TRUE; } if(this.rendered) { this.tooltip.toggleClass(CLASS_DISABLED, state) .attr('aria-disabled', state); } this.disabled = !!state; return this; }; PROTOTYPE.enable = function() { return this.disable(FALSE); }; ;PROTOTYPE._createButton = function() { var self = this, elements = this.elements, tooltip = elements.tooltip, button = this.options.content.button, isString = typeof button === 'string', close = isString ? button : 'Close tooltip'; if(elements.button) { elements.button.remove(); } // Use custom button if one was supplied by user, else use default if(button.jquery) { elements.button = button; } else { elements.button = $('', { 'class': 'qtip-close ' + (this.options.style.widget ? '' : NAMESPACE+'-icon'), 'title': close, 'aria-label': close }) .prepend( $('', { 'class': 'ui-icon ui-icon-close', 'html': '×' }) ); } // Create button and setup attributes elements.button.appendTo(elements.titlebar || tooltip) .attr('role', 'button') .click(function(event) { if(!tooltip.hasClass(CLASS_DISABLED)) { self.hide(event); } return FALSE; }); }; PROTOTYPE._updateButton = function(button) { // Make sure tooltip is rendered and if not, return if(!this.rendered) { return FALSE; } var elem = this.elements.button; if(button) { this._createButton(); } else { elem.remove(); } }; ;// Widget class creator function createWidgetClass(cls) { return WIDGET.concat('').join(cls ? '-'+cls+' ' : ' '); } // Widget class setter method PROTOTYPE._setWidget = function() { var on = this.options.style.widget, elements = this.elements, tooltip = elements.tooltip, disabled = tooltip.hasClass(CLASS_DISABLED); tooltip.removeClass(CLASS_DISABLED); CLASS_DISABLED = on ? 'ui-state-disabled' : 'qtip-disabled'; tooltip.toggleClass(CLASS_DISABLED, disabled); tooltip.toggleClass('ui-helper-reset '+createWidgetClass(), on).toggleClass(CLASS_DEFAULT, this.options.style.def && !on); if(elements.content) { elements.content.toggleClass( createWidgetClass('content'), on); } if(elements.titlebar) { elements.titlebar.toggleClass( createWidgetClass('header'), on); } if(elements.button) { elements.button.toggleClass(NAMESPACE+'-icon', !on); } }; ;function delay(callback, duration) { // If tooltip has displayed, start hide timer if(duration > 0) { return setTimeout( $.proxy(callback, this), duration ); } else{ callback.call(this); } } function showMethod(event) { if(this.tooltip.hasClass(CLASS_DISABLED)) { return; } // Clear hide timers clearTimeout(this.timers.show); clearTimeout(this.timers.hide); // Start show timer this.timers.show = delay.call(this, function() { this.toggle(TRUE, event); }, this.options.show.delay ); } function hideMethod(event) { if(this.tooltip.hasClass(CLASS_DISABLED) || this.destroyed) { return; } // Check if new target was actually the tooltip element var relatedTarget = $(event.relatedTarget), ontoTooltip = relatedTarget.closest(SELECTOR)[0] === this.tooltip[0], ontoTarget = relatedTarget[0] === this.options.show.target[0]; // Clear timers and stop animation queue clearTimeout(this.timers.show); clearTimeout(this.timers.hide); // Prevent hiding if tooltip is fixed and event target is the tooltip. // Or if mouse positioning is enabled and cursor momentarily overlaps if(this !== relatedTarget[0] && (this.options.position.target === 'mouse' && ontoTooltip) || this.options.hide.fixed && ( (/mouse(out|leave|move)/).test(event.type) && (ontoTooltip || ontoTarget)) ) { /* eslint-disable no-empty */ try { event.preventDefault(); event.stopImmediatePropagation(); } catch(e) {} /* eslint-enable no-empty */ return; } // If tooltip has displayed, start hide timer this.timers.hide = delay.call(this, function() { this.toggle(FALSE, event); }, this.options.hide.delay, this ); } function inactiveMethod(event) { if(this.tooltip.hasClass(CLASS_DISABLED) || !this.options.hide.inactive) { return; } // Clear timer clearTimeout(this.timers.inactive); this.timers.inactive = delay.call(this, function(){ this.hide(event); }, this.options.hide.inactive ); } function repositionMethod(event) { if(this.rendered && this.tooltip[0].offsetWidth > 0) { this.reposition(event); } } // Store mouse coordinates PROTOTYPE._storeMouse = function(event) { (this.mouse = $.event.fix(event)).type = 'mousemove'; return this; }; // Bind events PROTOTYPE._bind = function(targets, events, method, suffix, context) { if(!targets || !method || !events.length) { return; } var ns = '.' + this._id + (suffix ? '-'+suffix : ''); $(targets).bind( (events.split ? events : events.join(ns + ' ')) + ns, $.proxy(method, context || this) ); return this; }; PROTOTYPE._unbind = function(targets, suffix) { targets && $(targets).unbind('.' + this._id + (suffix ? '-'+suffix : '')); return this; }; // Global delegation helper function delegate(selector, events, method) { $(document.body).delegate(selector, (events.split ? events : events.join('.'+NAMESPACE + ' ')) + '.'+NAMESPACE, function() { var api = QTIP.api[ $.attr(this, ATTR_ID) ]; api && !api.disabled && method.apply(api, arguments); } ); } // Event trigger PROTOTYPE._trigger = function(type, args, event) { var callback = new $.Event('tooltip'+type); callback.originalEvent = event && $.extend({}, event) || this.cache.event || NULL; this.triggering = type; this.tooltip.trigger(callback, [this].concat(args || [])); this.triggering = FALSE; return !callback.isDefaultPrevented(); }; PROTOTYPE._bindEvents = function(showEvents, hideEvents, showTargets, hideTargets, showCallback, hideCallback) { // Get tasrgets that lye within both var similarTargets = showTargets.filter( hideTargets ).add( hideTargets.filter(showTargets) ), toggleEvents = []; // If hide and show targets are the same... if(similarTargets.length) { // Filter identical show/hide events $.each(hideEvents, function(i, type) { var showIndex = $.inArray(type, showEvents); // Both events are identical, remove from both hide and show events // and append to toggleEvents showIndex > -1 && toggleEvents.push( showEvents.splice( showIndex, 1 )[0] ); }); // Toggle events are special case of identical show/hide events, which happen in sequence if(toggleEvents.length) { // Bind toggle events to the similar targets this._bind(similarTargets, toggleEvents, function(event) { var state = this.rendered ? this.tooltip[0].offsetWidth > 0 : false; (state ? hideCallback : showCallback).call(this, event); }); // Remove the similar targets from the regular show/hide bindings showTargets = showTargets.not(similarTargets); hideTargets = hideTargets.not(similarTargets); } } // Apply show/hide/toggle events this._bind(showTargets, showEvents, showCallback); this._bind(hideTargets, hideEvents, hideCallback); }; PROTOTYPE._assignInitialEvents = function(event) { var options = this.options, showTarget = options.show.target, hideTarget = options.hide.target, showEvents = options.show.event ? $.trim('' + options.show.event).split(' ') : [], hideEvents = options.hide.event ? $.trim('' + options.hide.event).split(' ') : []; // Catch remove/removeqtip events on target element to destroy redundant tooltips this._bind(this.elements.target, ['remove', 'removeqtip'], function() { this.destroy(true); }, 'destroy'); /* * Make sure hoverIntent functions properly by using mouseleave as a hide event if * mouseenter/mouseout is used for show.event, even if it isn't in the users options. */ if(/mouse(over|enter)/i.test(options.show.event) && !/mouse(out|leave)/i.test(options.hide.event)) { hideEvents.push('mouseleave'); } /* * Also make sure initial mouse targetting works correctly by caching mousemove coords * on show targets before the tooltip has rendered. Also set onTarget when triggered to * keep mouse tracking working. */ this._bind(showTarget, 'mousemove', function(moveEvent) { this._storeMouse(moveEvent); this.cache.onTarget = TRUE; }); // Define hoverIntent function function hoverIntent(hoverEvent) { // Only continue if tooltip isn't disabled if(this.disabled || this.destroyed) { return FALSE; } // Cache the event data this.cache.event = hoverEvent && $.event.fix(hoverEvent); this.cache.target = hoverEvent && $(hoverEvent.target); // Start the event sequence clearTimeout(this.timers.show); this.timers.show = delay.call(this, function() { this.render(typeof hoverEvent === 'object' || options.show.ready); }, options.prerender ? 0 : options.show.delay ); } // Filter and bind events this._bindEvents(showEvents, hideEvents, showTarget, hideTarget, hoverIntent, function() { if(!this.timers) { return FALSE; } clearTimeout(this.timers.show); }); // Prerendering is enabled, create tooltip now if(options.show.ready || options.prerender) { hoverIntent.call(this, event); } }; // Event assignment method PROTOTYPE._assignEvents = function() { var self = this, options = this.options, posOptions = options.position, tooltip = this.tooltip, showTarget = options.show.target, hideTarget = options.hide.target, containerTarget = posOptions.container, viewportTarget = posOptions.viewport, documentTarget = $(document), windowTarget = $(window), showEvents = options.show.event ? $.trim('' + options.show.event).split(' ') : [], hideEvents = options.hide.event ? $.trim('' + options.hide.event).split(' ') : []; // Assign passed event callbacks $.each(options.events, function(name, callback) { self._bind(tooltip, name === 'toggle' ? ['tooltipshow','tooltiphide'] : ['tooltip'+name], callback, null, tooltip); }); // Hide tooltips when leaving current window/frame (but not select/option elements) if(/mouse(out|leave)/i.test(options.hide.event) && options.hide.leave === 'window') { this._bind(documentTarget, ['mouseout', 'blur'], function(event) { if(!/select|option/.test(event.target.nodeName) && !event.relatedTarget) { this.hide(event); } }); } // Enable hide.fixed by adding appropriate class if(options.hide.fixed) { hideTarget = hideTarget.add( tooltip.addClass(CLASS_FIXED) ); } /* * Make sure hoverIntent functions properly by using mouseleave to clear show timer if * mouseenter/mouseout is used for show.event, even if it isn't in the users options. */ else if(/mouse(over|enter)/i.test(options.show.event)) { this._bind(hideTarget, 'mouseleave', function() { clearTimeout(this.timers.show); }); } // Hide tooltip on document mousedown if unfocus events are enabled if(('' + options.hide.event).indexOf('unfocus') > -1) { this._bind(containerTarget.closest('html'), ['mousedown', 'touchstart'], function(event) { var elem = $(event.target), enabled = this.rendered && !this.tooltip.hasClass(CLASS_DISABLED) && this.tooltip[0].offsetWidth > 0, isAncestor = elem.parents(SELECTOR).filter(this.tooltip[0]).length > 0; if(elem[0] !== this.target[0] && elem[0] !== this.tooltip[0] && !isAncestor && !this.target.has(elem[0]).length && enabled ) { this.hide(event); } }); } // Check if the tooltip hides when inactive if('number' === typeof options.hide.inactive) { // Bind inactive method to show target(s) as a custom event this._bind(showTarget, 'qtip-'+this.id+'-inactive', inactiveMethod, 'inactive'); // Define events which reset the 'inactive' event handler this._bind(hideTarget.add(tooltip), QTIP.inactiveEvents, inactiveMethod); } // Filter and bind events this._bindEvents(showEvents, hideEvents, showTarget, hideTarget, showMethod, hideMethod); // Mouse movement bindings this._bind(showTarget.add(tooltip), 'mousemove', function(event) { // Check if the tooltip hides when mouse is moved a certain distance if('number' === typeof options.hide.distance) { var origin = this.cache.origin || {}, limit = this.options.hide.distance, abs = Math.abs; // Check if the movement has gone beyond the limit, and hide it if so if(abs(event.pageX - origin.pageX) >= limit || abs(event.pageY - origin.pageY) >= limit) { this.hide(event); } } // Cache mousemove coords on show targets this._storeMouse(event); }); // Mouse positioning events if(posOptions.target === 'mouse') { // If mouse adjustment is on... if(posOptions.adjust.mouse) { // Apply a mouseleave event so we don't get problems with overlapping if(options.hide.event) { // Track if we're on the target or not this._bind(showTarget, ['mouseenter', 'mouseleave'], function(event) { if(!this.cache) {return FALSE; } this.cache.onTarget = event.type === 'mouseenter'; }); } // Update tooltip position on mousemove this._bind(documentTarget, 'mousemove', function(event) { // Update the tooltip position only if the tooltip is visible and adjustment is enabled if(this.rendered && this.cache.onTarget && !this.tooltip.hasClass(CLASS_DISABLED) && this.tooltip[0].offsetWidth > 0) { this.reposition(event); } }); } } // Adjust positions of the tooltip on window resize if enabled if(posOptions.adjust.resize || viewportTarget.length) { this._bind( $.event.special.resize ? viewportTarget : windowTarget, 'resize', repositionMethod ); } // Adjust tooltip position on scroll of the window or viewport element if present if(posOptions.adjust.scroll) { this._bind( windowTarget.add(posOptions.container), 'scroll', repositionMethod ); } }; // Un-assignment method PROTOTYPE._unassignEvents = function() { var options = this.options, showTargets = options.show.target, hideTargets = options.hide.target, targets = $.grep([ this.elements.target[0], this.rendered && this.tooltip[0], options.position.container[0], options.position.viewport[0], options.position.container.closest('html')[0], // unfocus window, document ], function(i) { return typeof i === 'object'; }); // Add show and hide targets if they're valid if(showTargets && showTargets.toArray) { targets = targets.concat(showTargets.toArray()); } if(hideTargets && hideTargets.toArray) { targets = targets.concat(hideTargets.toArray()); } // Unbind the events this._unbind(targets) ._unbind(targets, 'destroy') ._unbind(targets, 'inactive'); }; // Apply common event handlers using delegate (avoids excessive .bind calls!) $(function() { delegate(SELECTOR, ['mouseenter', 'mouseleave'], function(event) { var state = event.type === 'mouseenter', tooltip = $(event.currentTarget), target = $(event.relatedTarget || event.target), options = this.options; // On mouseenter... if(state) { // Focus the tooltip on mouseenter (z-index stacking) this.focus(event); // Clear hide timer on tooltip hover to prevent it from closing tooltip.hasClass(CLASS_FIXED) && !tooltip.hasClass(CLASS_DISABLED) && clearTimeout(this.timers.hide); } // On mouseleave... else { // When mouse tracking is enabled, hide when we leave the tooltip and not onto the show target (if a hide event is set) if(options.position.target === 'mouse' && options.position.adjust.mouse && options.hide.event && options.show.target && !target.closest(options.show.target[0]).length) { this.hide(event); } } // Add hover class tooltip.toggleClass(CLASS_HOVER, state); }); // Define events which reset the 'inactive' event handler delegate('['+ATTR_ID+']', INACTIVE_EVENTS, inactiveMethod); }); ;// Initialization method function init(elem, id, opts) { var obj, posOptions, attr, config, title, // Setup element references docBody = $(document.body), // Use document body instead of document element if needed newTarget = elem[0] === document ? docBody : elem, // Grab metadata from element if plugin is present metadata = elem.metadata ? elem.metadata(opts.metadata) : NULL, // If metadata type if HTML5, grab 'name' from the object instead, or use the regular data object otherwise metadata5 = opts.metadata.type === 'html5' && metadata ? metadata[opts.metadata.name] : NULL, // Grab data from metadata.name (or data-qtipopts as fallback) using .data() method, html5 = elem.data(opts.metadata.name || 'qtipopts'); // If we don't get an object returned attempt to parse it manualyl without parseJSON /* eslint-disable no-empty */ try { html5 = typeof html5 === 'string' ? $.parseJSON(html5) : html5; } catch(e) {} /* eslint-enable no-empty */ // Merge in and sanitize metadata config = $.extend(TRUE, {}, QTIP.defaults, opts, typeof html5 === 'object' ? sanitizeOptions(html5) : NULL, sanitizeOptions(metadata5 || metadata)); // Re-grab our positioning options now we've merged our metadata and set id to passed value posOptions = config.position; config.id = id; // Setup missing content if none is detected if('boolean' === typeof config.content.text) { attr = elem.attr(config.content.attr); // Grab from supplied attribute if available if(config.content.attr !== FALSE && attr) { config.content.text = attr; } // No valid content was found, abort render else { return FALSE; } } // Setup target options if(!posOptions.container.length) { posOptions.container = docBody; } if(posOptions.target === FALSE) { posOptions.target = newTarget; } if(config.show.target === FALSE) { config.show.target = newTarget; } if(config.show.solo === TRUE) { config.show.solo = posOptions.container.closest('body'); } if(config.hide.target === FALSE) { config.hide.target = newTarget; } if(config.position.viewport === TRUE) { config.position.viewport = posOptions.container; } // Ensure we only use a single container posOptions.container = posOptions.container.eq(0); // Convert position corner values into x and y strings posOptions.at = new CORNER(posOptions.at, TRUE); posOptions.my = new CORNER(posOptions.my); // Destroy previous tooltip if overwrite is enabled, or skip element if not if(elem.data(NAMESPACE)) { if(config.overwrite) { elem.qtip('destroy', true); } else if(config.overwrite === FALSE) { return FALSE; } } // Add has-qtip attribute elem.attr(ATTR_HAS, id); // Remove title attribute and store it if present if(config.suppress && (title = elem.attr('title'))) { // Final attr call fixes event delegatiom and IE default tooltip showing problem elem.removeAttr('title').attr(oldtitle, title).attr('title', ''); } // Initialize the tooltip and add API reference obj = new QTip(elem, config, id, !!attr); elem.data(NAMESPACE, obj); return obj; } // jQuery $.fn extension method QTIP = $.fn.qtip = function(options, notation, newValue) { var command = ('' + options).toLowerCase(), // Parse command returned = NULL, args = $.makeArray(arguments).slice(1), event = args[args.length - 1], opts = this[0] ? $.data(this[0], NAMESPACE) : NULL; // Check for API request if(!arguments.length && opts || command === 'api') { return opts; } // Execute API command if present else if('string' === typeof options) { this.each(function() { var api = $.data(this, NAMESPACE); if(!api) { return TRUE; } // Cache the event if possible if(event && event.timeStamp) { api.cache.event = event; } // Check for specific API commands if(notation && (command === 'option' || command === 'options')) { if(newValue !== undefined || $.isPlainObject(notation)) { api.set(notation, newValue); } else { returned = api.get(notation); return FALSE; } } // Execute API command else if(api[command]) { api[command].apply(api, args); } }); return returned !== NULL ? returned : this; } // No API commands. validate provided options and setup qTips else if('object' === typeof options || !arguments.length) { // Sanitize options first opts = sanitizeOptions($.extend(TRUE, {}, options)); return this.each(function(i) { var api, id; // Find next available ID, or use custom ID if provided id = $.isArray(opts.id) ? opts.id[i] : opts.id; id = !id || id === FALSE || id.length < 1 || QTIP.api[id] ? QTIP.nextid++ : id; // Initialize the qTip and re-grab newly sanitized options api = init($(this), id, opts); if(api === FALSE) { return TRUE; } else { QTIP.api[id] = api; } // Initialize plugins $.each(PLUGINS, function() { if(this.initialize === 'initialize') { this(api); } }); // Assign initial pre-render events api._assignInitialEvents(event); }); } }; // Expose class $.qtip = QTip; // Populated in render method QTIP.api = {}; ;$.each({ /* Allow other plugins to successfully retrieve the title of an element with a qTip applied */ attr: function(attr, val) { if(this.length) { var self = this[0], title = 'title', api = $.data(self, 'qtip'); if(attr === title && api && api.options && 'object' === typeof api && 'object' === typeof api.options && api.options.suppress) { if(arguments.length < 2) { return $.attr(self, oldtitle); } // If qTip is rendered and title was originally used as content, update it if(api && api.options.content.attr === title && api.cache.attr) { api.set('content.text', val); } // Use the regular attr method to set, then cache the result return this.attr(oldtitle, val); } } return $.fn['attr'+replaceSuffix].apply(this, arguments); }, /* Allow clone to correctly retrieve cached title attributes */ clone: function(keepData) { // Clone our element using the real clone method var elems = $.fn['clone'+replaceSuffix].apply(this, arguments); // Grab all elements with an oldtitle set, and change it to regular title attribute, if keepData is false if(!keepData) { elems.filter('['+oldtitle+']').attr('title', function() { return $.attr(this, oldtitle); }) .removeAttr(oldtitle); } return elems; } }, function(name, func) { if(!func || $.fn[name+replaceSuffix]) { return TRUE; } var old = $.fn[name+replaceSuffix] = $.fn[name]; $.fn[name] = function() { return func.apply(this, arguments) || old.apply(this, arguments); }; }); /* Fire off 'removeqtip' handler in $.cleanData if jQuery UI not present (it already does similar). * This snippet is taken directly from jQuery UI source code found here: * http://code.jquery.com/ui/jquery-ui-git.js */ if(!$.ui) { $['cleanData'+replaceSuffix] = $.cleanData; $.cleanData = function( elems ) { for(var i = 0, elem; (elem = $( elems[i] )).length; i++) { if(elem.attr(ATTR_HAS)) { /* eslint-disable no-empty */ try { elem.triggerHandler('removeqtip'); } catch( e ) {} /* eslint-enable no-empty */ } } $['cleanData'+replaceSuffix].apply(this, arguments); }; } ;// qTip version QTIP.version = '3.0.3'; // Base ID for all qTips QTIP.nextid = 0; // Inactive events array QTIP.inactiveEvents = INACTIVE_EVENTS; // Base z-index for all qTips QTIP.zindex = 15000; // Define configuration defaults QTIP.defaults = { prerender: FALSE, id: FALSE, overwrite: TRUE, suppress: TRUE, content: { text: TRUE, attr: 'title', title: FALSE, button: FALSE }, position: { my: 'top left', at: 'bottom right', target: FALSE, container: FALSE, viewport: FALSE, adjust: { x: 0, y: 0, mouse: TRUE, scroll: TRUE, resize: TRUE, method: 'flipinvert flipinvert' }, effect: function(api, pos) { $(this).animate(pos, { duration: 200, queue: FALSE }); } }, show: { target: FALSE, event: 'mouseenter', effect: TRUE, delay: 90, solo: FALSE, ready: FALSE, autofocus: FALSE }, hide: { target: FALSE, event: 'mouseleave', effect: TRUE, delay: 0, fixed: FALSE, inactive: FALSE, leave: 'window', distance: FALSE }, style: { classes: '', widget: FALSE, width: FALSE, height: FALSE, def: TRUE }, events: { render: NULL, move: NULL, show: NULL, hide: NULL, toggle: NULL, visible: NULL, hidden: NULL, focus: NULL, blur: NULL } }; ;var TIP, createVML, SCALE, PIXEL_RATIO, BACKING_STORE_RATIO, // Common CSS strings MARGIN = 'margin', BORDER = 'border', COLOR = 'color', BG_COLOR = 'background-color', TRANSPARENT = 'transparent', IMPORTANT = ' !important', // Check if the browser supports elements HASCANVAS = !!document.createElement('canvas').getContext, // Invalid colour values used in parseColours() INVALID = /rgba?\(0, 0, 0(, 0)?\)|transparent|#123456/i; // Camel-case method, taken from jQuery source // http://code.jquery.com/jquery-1.8.0.js function camel(s) { return s.charAt(0).toUpperCase() + s.slice(1); } /* * Modified from Modernizr's testPropsAll() * http://modernizr.com/downloads/modernizr-latest.js */ var cssProps = {}, cssPrefixes = ['Webkit', 'O', 'Moz', 'ms']; function vendorCss(elem, prop) { var ucProp = prop.charAt(0).toUpperCase() + prop.slice(1), props = (prop + ' ' + cssPrefixes.join(ucProp + ' ') + ucProp).split(' '), cur, val, i = 0; // If the property has already been mapped... if(cssProps[prop]) { return elem.css(cssProps[prop]); } while(cur = props[i++]) { if((val = elem.css(cur)) !== undefined) { cssProps[prop] = cur; return val; } } } // Parse a given elements CSS property into an int function intCss(elem, prop) { return Math.ceil(parseFloat(vendorCss(elem, prop))); } // VML creation (for IE only) if(!HASCANVAS) { createVML = function(tag, props, style) { return ''; }; } // Canvas only definitions else { PIXEL_RATIO = window.devicePixelRatio || 1; BACKING_STORE_RATIO = (function() { var context = document.createElement('canvas').getContext('2d'); return context.backingStorePixelRatio || context.webkitBackingStorePixelRatio || context.mozBackingStorePixelRatio || context.msBackingStorePixelRatio || context.oBackingStorePixelRatio || 1; })(); SCALE = PIXEL_RATIO / BACKING_STORE_RATIO; } function Tip(qtip, options) { this._ns = 'tip'; this.options = options; this.offset = options.offset; this.size = [ options.width, options.height ]; // Initialize this.qtip = qtip; this.init(qtip); } $.extend(Tip.prototype, { init: function(qtip) { var context, tip; // Create tip element and prepend to the tooltip tip = this.element = qtip.elements.tip = $('
    ', { 'class': NAMESPACE+'-tip' }).prependTo(qtip.tooltip); // Create tip drawing element(s) if(HASCANVAS) { // save() as soon as we create the canvas element so FF2 doesn't bork on our first restore()! context = $('').appendTo(this.element)[0].getContext('2d'); // Setup constant parameters context.lineJoin = 'miter'; context.miterLimit = 100000; context.save(); } else { context = createVML('shape', 'coordorigin="0,0"', 'position:absolute;'); this.element.html(context + context); // Prevent mousing down on the tip since it causes problems with .live() handling in IE due to VML qtip._bind( $('*', tip).add(tip), ['click', 'mousedown'], function(event) { event.stopPropagation(); }, this._ns); } // Bind update events qtip._bind(qtip.tooltip, 'tooltipmove', this.reposition, this._ns, this); // Create it this.create(); }, _swapDimensions: function() { this.size[0] = this.options.height; this.size[1] = this.options.width; }, _resetDimensions: function() { this.size[0] = this.options.width; this.size[1] = this.options.height; }, _useTitle: function(corner) { var titlebar = this.qtip.elements.titlebar; return titlebar && ( corner.y === TOP || corner.y === CENTER && this.element.position().top + this.size[1] / 2 + this.options.offset < titlebar.outerHeight(TRUE) ); }, _parseCorner: function(corner) { var my = this.qtip.options.position.my; // Detect corner and mimic properties if(corner === FALSE || my === FALSE) { corner = FALSE; } else if(corner === TRUE) { corner = new CORNER( my.string() ); } else if(!corner.string) { corner = new CORNER(corner); corner.fixed = TRUE; } return corner; }, _parseWidth: function(corner, side, use) { var elements = this.qtip.elements, prop = BORDER + camel(side) + 'Width'; return (use ? intCss(use, prop) : intCss(elements.content, prop) || intCss(this._useTitle(corner) && elements.titlebar || elements.content, prop) || intCss(elements.tooltip, prop) ) || 0; }, _parseRadius: function(corner) { var elements = this.qtip.elements, prop = BORDER + camel(corner.y) + camel(corner.x) + 'Radius'; return BROWSER.ie < 9 ? 0 : intCss(this._useTitle(corner) && elements.titlebar || elements.content, prop) || intCss(elements.tooltip, prop) || 0; }, _invalidColour: function(elem, prop, compare) { var val = elem.css(prop); return !val || compare && val === elem.css(compare) || INVALID.test(val) ? FALSE : val; }, _parseColours: function(corner) { var elements = this.qtip.elements, tip = this.element.css('cssText', ''), borderSide = BORDER + camel(corner[ corner.precedance ]) + camel(COLOR), colorElem = this._useTitle(corner) && elements.titlebar || elements.content, css = this._invalidColour, color = []; // Attempt to detect the background colour from various elements, left-to-right precedance color[0] = css(tip, BG_COLOR) || css(colorElem, BG_COLOR) || css(elements.content, BG_COLOR) || css(elements.tooltip, BG_COLOR) || tip.css(BG_COLOR); // Attempt to detect the correct border side colour from various elements, left-to-right precedance color[1] = css(tip, borderSide, COLOR) || css(colorElem, borderSide, COLOR) || css(elements.content, borderSide, COLOR) || css(elements.tooltip, borderSide, COLOR) || elements.tooltip.css(borderSide); // Reset background and border colours $('*', tip).add(tip).css('cssText', BG_COLOR+':'+TRANSPARENT+IMPORTANT+';'+BORDER+':0'+IMPORTANT+';'); return color; }, _calculateSize: function(corner) { var y = corner.precedance === Y, width = this.options.width, height = this.options.height, isCenter = corner.abbrev() === 'c', base = (y ? width: height) * (isCenter ? 0.5 : 1), pow = Math.pow, round = Math.round, bigHyp, ratio, result, smallHyp = Math.sqrt( pow(base, 2) + pow(height, 2) ), hyp = [ this.border / base * smallHyp, this.border / height * smallHyp ]; hyp[2] = Math.sqrt( pow(hyp[0], 2) - pow(this.border, 2) ); hyp[3] = Math.sqrt( pow(hyp[1], 2) - pow(this.border, 2) ); bigHyp = smallHyp + hyp[2] + hyp[3] + (isCenter ? 0 : hyp[0]); ratio = bigHyp / smallHyp; result = [ round(ratio * width), round(ratio * height) ]; return y ? result : result.reverse(); }, // Tip coordinates calculator _calculateTip: function(corner, size, scale) { scale = scale || 1; size = size || this.size; var width = size[0] * scale, height = size[1] * scale, width2 = Math.ceil(width / 2), height2 = Math.ceil(height / 2), // Define tip coordinates in terms of height and width values tips = { br: [0,0, width,height, width,0], bl: [0,0, width,0, 0,height], tr: [0,height, width,0, width,height], tl: [0,0, 0,height, width,height], tc: [0,height, width2,0, width,height], bc: [0,0, width,0, width2,height], rc: [0,0, width,height2, 0,height], lc: [width,0, width,height, 0,height2] }; // Set common side shapes tips.lt = tips.br; tips.rt = tips.bl; tips.lb = tips.tr; tips.rb = tips.tl; return tips[ corner.abbrev() ]; }, // Tip coordinates drawer (canvas) _drawCoords: function(context, coords) { context.beginPath(); context.moveTo(coords[0], coords[1]); context.lineTo(coords[2], coords[3]); context.lineTo(coords[4], coords[5]); context.closePath(); }, create: function() { // Determine tip corner var c = this.corner = (HASCANVAS || BROWSER.ie) && this._parseCorner(this.options.corner); // If we have a tip corner... this.enabled = !!this.corner && this.corner.abbrev() !== 'c'; if(this.enabled) { // Cache it this.qtip.cache.corner = c.clone(); // Create it this.update(); } // Toggle tip element this.element.toggle(this.enabled); return this.corner; }, update: function(corner, position) { if(!this.enabled) { return this; } var elements = this.qtip.elements, tip = this.element, inner = tip.children(), options = this.options, curSize = this.size, mimic = options.mimic, round = Math.round, color, precedance, context, coords, bigCoords, translate, newSize, border; // Re-determine tip if not already set if(!corner) { corner = this.qtip.cache.corner || this.corner; } // Use corner property if we detect an invalid mimic value if(mimic === FALSE) { mimic = corner; } // Otherwise inherit mimic properties from the corner object as necessary else { mimic = new CORNER(mimic); mimic.precedance = corner.precedance; if(mimic.x === 'inherit') { mimic.x = corner.x; } else if(mimic.y === 'inherit') { mimic.y = corner.y; } else if(mimic.x === mimic.y) { mimic[ corner.precedance ] = corner[ corner.precedance ]; } } precedance = mimic.precedance; // Ensure the tip width.height are relative to the tip position if(corner.precedance === X) { this._swapDimensions(); } else { this._resetDimensions(); } // Update our colours color = this.color = this._parseColours(corner); // Detect border width, taking into account colours if(color[1] !== TRANSPARENT) { // Grab border width border = this.border = this._parseWidth(corner, corner[corner.precedance]); // If border width isn't zero, use border color as fill if it's not invalid (1.0 style tips) if(options.border && border < 1 && !INVALID.test(color[1])) { color[0] = color[1]; } // Set border width (use detected border width if options.border is true) this.border = border = options.border !== TRUE ? options.border : border; } // Border colour was invalid, set border to zero else { this.border = border = 0; } // Determine tip size newSize = this.size = this._calculateSize(corner); tip.css({ width: newSize[0], height: newSize[1], lineHeight: newSize[1]+'px' }); // Calculate tip translation if(corner.precedance === Y) { translate = [ round(mimic.x === LEFT ? border : mimic.x === RIGHT ? newSize[0] - curSize[0] - border : (newSize[0] - curSize[0]) / 2), round(mimic.y === TOP ? newSize[1] - curSize[1] : 0) ]; } else { translate = [ round(mimic.x === LEFT ? newSize[0] - curSize[0] : 0), round(mimic.y === TOP ? border : mimic.y === BOTTOM ? newSize[1] - curSize[1] - border : (newSize[1] - curSize[1]) / 2) ]; } // Canvas drawing implementation if(HASCANVAS) { // Grab canvas context and clear/save it context = inner[0].getContext('2d'); context.restore(); context.save(); context.clearRect(0,0,6000,6000); // Calculate coordinates coords = this._calculateTip(mimic, curSize, SCALE); bigCoords = this._calculateTip(mimic, this.size, SCALE); // Set the canvas size using calculated size inner.attr(WIDTH, newSize[0] * SCALE).attr(HEIGHT, newSize[1] * SCALE); inner.css(WIDTH, newSize[0]).css(HEIGHT, newSize[1]); // Draw the outer-stroke tip this._drawCoords(context, bigCoords); context.fillStyle = color[1]; context.fill(); // Draw the actual tip context.translate(translate[0] * SCALE, translate[1] * SCALE); this._drawCoords(context, coords); context.fillStyle = color[0]; context.fill(); } // VML (IE Proprietary implementation) else { // Calculate coordinates coords = this._calculateTip(mimic); // Setup coordinates string coords = 'm' + coords[0] + ',' + coords[1] + ' l' + coords[2] + ',' + coords[3] + ' ' + coords[4] + ',' + coords[5] + ' xe'; // Setup VML-specific offset for pixel-perfection translate[2] = border && /^(r|b)/i.test(corner.string()) ? BROWSER.ie === 8 ? 2 : 1 : 0; // Set initial CSS inner.css({ coordsize: newSize[0]+border + ' ' + newSize[1]+border, antialias: ''+(mimic.string().indexOf(CENTER) > -1), left: translate[0] - translate[2] * Number(precedance === X), top: translate[1] - translate[2] * Number(precedance === Y), width: newSize[0] + border, height: newSize[1] + border }) .each(function(i) { var $this = $(this); // Set shape specific attributes $this[ $this.prop ? 'prop' : 'attr' ]({ coordsize: newSize[0]+border + ' ' + newSize[1]+border, path: coords, fillcolor: color[0], filled: !!i, stroked: !i }) .toggle(!!(border || i)); // Check if border is enabled and add stroke element !i && $this.html( createVML( 'stroke', 'weight="'+border*2+'px" color="'+color[1]+'" miterlimit="1000" joinstyle="miter"' ) ); }); } // Opera bug #357 - Incorrect tip position // https://github.com/Craga89/qTip2/issues/367 window.opera && setTimeout(function() { elements.tip.css({ display: 'inline-block', visibility: 'visible' }); }, 1); // Position if needed if(position !== FALSE) { this.calculate(corner, newSize); } }, calculate: function(corner, size) { if(!this.enabled) { return FALSE; } var self = this, elements = this.qtip.elements, tip = this.element, userOffset = this.options.offset, position = {}, precedance, corners; // Inherit corner if not provided corner = corner || this.corner; precedance = corner.precedance; // Determine which tip dimension to use for adjustment size = size || this._calculateSize(corner); // Setup corners and offset array corners = [ corner.x, corner.y ]; if(precedance === X) { corners.reverse(); } // Calculate tip position $.each(corners, function(i, side) { var b, bc, br; if(side === CENTER) { b = precedance === Y ? LEFT : TOP; position[ b ] = '50%'; position[MARGIN+'-' + b] = -Math.round(size[ precedance === Y ? 0 : 1 ] / 2) + userOffset; } else { b = self._parseWidth(corner, side, elements.tooltip); bc = self._parseWidth(corner, side, elements.content); br = self._parseRadius(corner); position[ side ] = Math.max(-self.border, i ? bc : userOffset + (br > b ? br : -b)); } }); // Adjust for tip size position[ corner[precedance] ] -= size[ precedance === X ? 0 : 1 ]; // Set and return new position tip.css({ margin: '', top: '', bottom: '', left: '', right: '' }).css(position); return position; }, reposition: function(event, api, pos) { if(!this.enabled) { return; } var cache = api.cache, newCorner = this.corner.clone(), adjust = pos.adjusted, method = api.options.position.adjust.method.split(' '), horizontal = method[0], vertical = method[1] || method[0], shift = { left: FALSE, top: FALSE, x: 0, y: 0 }, offset, css = {}, props; function shiftflip(direction, precedance, popposite, side, opposite) { // Horizontal - Shift or flip method if(direction === SHIFT && newCorner.precedance === precedance && adjust[side] && newCorner[popposite] !== CENTER) { newCorner.precedance = newCorner.precedance === X ? Y : X; } else if(direction !== SHIFT && adjust[side]){ newCorner[precedance] = newCorner[precedance] === CENTER ? adjust[side] > 0 ? side : opposite : newCorner[precedance] === side ? opposite : side; } } function shiftonly(xy, side, opposite) { if(newCorner[xy] === CENTER) { css[MARGIN+'-'+side] = shift[xy] = offset[MARGIN+'-'+side] - adjust[side]; } else { props = offset[opposite] !== undefined ? [ adjust[side], -offset[side] ] : [ -adjust[side], offset[side] ]; if( (shift[xy] = Math.max(props[0], props[1])) > props[0] ) { pos[side] -= adjust[side]; shift[side] = FALSE; } css[ offset[opposite] !== undefined ? opposite : side ] = shift[xy]; } } // If our tip position isn't fixed e.g. doesn't adjust with viewport... if(this.corner.fixed !== TRUE) { // Perform shift/flip adjustments shiftflip(horizontal, X, Y, LEFT, RIGHT); shiftflip(vertical, Y, X, TOP, BOTTOM); // Update and redraw the tip if needed (check cached details of last drawn tip) if(newCorner.string() !== cache.corner.string() || cache.cornerTop !== adjust.top || cache.cornerLeft !== adjust.left) { this.update(newCorner, FALSE); } } // Setup tip offset properties offset = this.calculate(newCorner); // Readjust offset object to make it left/top if(offset.right !== undefined) { offset.left = -offset.right; } if(offset.bottom !== undefined) { offset.top = -offset.bottom; } offset.user = this.offset; // Perform shift adjustments shift.left = horizontal === SHIFT && !!adjust.left; if(shift.left) { shiftonly(X, LEFT, RIGHT); } shift.top = vertical === SHIFT && !!adjust.top; if(shift.top) { shiftonly(Y, TOP, BOTTOM); } /* * If the tip is adjusted in both dimensions, or in a * direction that would cause it to be anywhere but the * outer border, hide it! */ this.element.css(css).toggle( !(shift.x && shift.y || newCorner.x === CENTER && shift.y || newCorner.y === CENTER && shift.x) ); // Adjust position to accomodate tip dimensions pos.left -= offset.left.charAt ? offset.user : horizontal !== SHIFT || shift.top || !shift.left && !shift.top ? offset.left + this.border : 0; pos.top -= offset.top.charAt ? offset.user : vertical !== SHIFT || shift.left || !shift.left && !shift.top ? offset.top + this.border : 0; // Cache details cache.cornerLeft = adjust.left; cache.cornerTop = adjust.top; cache.corner = newCorner.clone(); }, destroy: function() { // Unbind events this.qtip._unbind(this.qtip.tooltip, this._ns); // Remove the tip element(s) if(this.qtip.elements.tip) { this.qtip.elements.tip.find('*') .remove().end().remove(); } } }); TIP = PLUGINS.tip = function(api) { return new Tip(api, api.options.style.tip); }; // Initialize tip on render TIP.initialize = 'render'; // Setup plugin sanitization options TIP.sanitize = function(options) { if(options.style && 'tip' in options.style) { var opts = options.style.tip; if(typeof opts !== 'object') { opts = options.style.tip = { corner: opts }; } if(!(/string|boolean/i).test(typeof opts.corner)) { opts.corner = TRUE; } } }; // Add new option checks for the plugin CHECKS.tip = { '^position.my|style.tip.(corner|mimic|border)$': function() { // Make sure a tip can be drawn this.create(); // Reposition the tooltip this.qtip.reposition(); }, '^style.tip.(height|width)$': function(obj) { // Re-set dimensions and redraw the tip this.size = [ obj.width, obj.height ]; this.update(); // Reposition the tooltip this.qtip.reposition(); }, '^content.title|style.(classes|widget)$': function() { this.update(); } }; // Extend original qTip defaults $.extend(TRUE, QTIP.defaults, { style: { tip: { corner: TRUE, mimic: FALSE, width: 6, height: 6, border: TRUE, offset: 0 } } }); ;var MODAL, OVERLAY, MODALCLASS = 'qtip-modal', MODALSELECTOR = '.'+MODALCLASS; OVERLAY = function() { var self = this, focusableElems = {}, current, prevState, elem; // Modified code from jQuery UI 1.10.0 source // http://code.jquery.com/ui/1.10.0/jquery-ui.js function focusable(element) { // Use the defined focusable checker when possible if($.expr[':'].focusable) { return $.expr[':'].focusable; } var isTabIndexNotNaN = !isNaN($.attr(element, 'tabindex')), nodeName = element.nodeName && element.nodeName.toLowerCase(), map, mapName, img; if('area' === nodeName) { map = element.parentNode; mapName = map.name; if(!element.href || !mapName || map.nodeName.toLowerCase() !== 'map') { return false; } img = $('img[usemap=#' + mapName + ']')[0]; return !!img && img.is(':visible'); } return /input|select|textarea|button|object/.test( nodeName ) ? !element.disabled : 'a' === nodeName ? element.href || isTabIndexNotNaN : isTabIndexNotNaN ; } // Focus inputs using cached focusable elements (see update()) function focusInputs(blurElems) { // Blurring body element in IE causes window.open windows to unfocus! if(focusableElems.length < 1 && blurElems.length) { blurElems.not('body').blur(); } // Focus the inputs else { focusableElems.first().focus(); } } // Steal focus from elements outside tooltip function stealFocus(event) { if(!elem.is(':visible')) { return; } var target = $(event.target), tooltip = current.tooltip, container = target.closest(SELECTOR), targetOnTop; // Determine if input container target is above this targetOnTop = container.length < 1 ? FALSE : parseInt(container[0].style.zIndex, 10) > parseInt(tooltip[0].style.zIndex, 10); // If we're showing a modal, but focus has landed on an input below // this modal, divert focus to the first visible input in this modal // or if we can't find one... the tooltip itself if(!targetOnTop && target.closest(SELECTOR)[0] !== tooltip[0]) { focusInputs(target); } } $.extend(self, { init: function() { // Create document overlay elem = self.elem = $('
    ', { id: 'qtip-overlay', html: '
    ', mousedown: function() { return FALSE; } }) .hide(); // Make sure we can't focus anything outside the tooltip $(document.body).bind('focusin'+MODALSELECTOR, stealFocus); // Apply keyboard "Escape key" close handler $(document).bind('keydown'+MODALSELECTOR, function(event) { if(current && current.options.show.modal.escape && event.keyCode === 27) { current.hide(event); } }); // Apply click handler for blur option elem.bind('click'+MODALSELECTOR, function(event) { if(current && current.options.show.modal.blur) { current.hide(event); } }); return self; }, update: function(api) { // Update current API reference current = api; // Update focusable elements if enabled if(api.options.show.modal.stealfocus !== FALSE) { focusableElems = api.tooltip.find('*').filter(function() { return focusable(this); }); } else { focusableElems = []; } }, toggle: function(api, state, duration) { var tooltip = api.tooltip, options = api.options.show.modal, effect = options.effect, type = state ? 'show': 'hide', visible = elem.is(':visible'), visibleModals = $(MODALSELECTOR).filter(':visible:not(:animated)').not(tooltip); // Set active tooltip API reference self.update(api); // If the modal can steal the focus... // Blur the current item and focus anything in the modal we an if(state && options.stealfocus !== FALSE) { focusInputs( $(':focus') ); } // Toggle backdrop cursor style on show elem.toggleClass('blurs', options.blur); // Append to body on show if(state) { elem.appendTo(document.body); } // Prevent modal from conflicting with show.solo, and don't hide backdrop is other modals are visible if(elem.is(':animated') && visible === state && prevState !== FALSE || !state && visibleModals.length) { return self; } // Stop all animations elem.stop(TRUE, FALSE); // Use custom function if provided if($.isFunction(effect)) { effect.call(elem, state); } // If no effect type is supplied, use a simple toggle else if(effect === FALSE) { elem[ type ](); } // Use basic fade function else { elem.fadeTo( parseInt(duration, 10) || 90, state ? 1 : 0, function() { if(!state) { elem.hide(); } }); } // Reset position and detach from body on hide if(!state) { elem.queue(function(next) { elem.css({ left: '', top: '' }); if(!$(MODALSELECTOR).length) { elem.detach(); } next(); }); } // Cache the state prevState = state; // If the tooltip is destroyed, set reference to null if(current.destroyed) { current = NULL; } return self; } }); self.init(); }; OVERLAY = new OVERLAY(); function Modal(api, options) { this.options = options; this._ns = '-modal'; this.qtip = api; this.init(api); } $.extend(Modal.prototype, { init: function(qtip) { var tooltip = qtip.tooltip; // If modal is disabled... return if(!this.options.on) { return this; } // Set overlay reference qtip.elements.overlay = OVERLAY.elem; // Add unique attribute so we can grab modal tooltips easily via a SELECTOR, and set z-index tooltip.addClass(MODALCLASS).css('z-index', QTIP.modal_zindex + $(MODALSELECTOR).length); // Apply our show/hide/focus modal events qtip._bind(tooltip, ['tooltipshow', 'tooltiphide'], function(event, api, duration) { var oEvent = event.originalEvent; // Make sure mouseout doesn't trigger a hide when showing the modal and mousing onto backdrop if(event.target === tooltip[0]) { if(oEvent && event.type === 'tooltiphide' && /mouse(leave|enter)/.test(oEvent.type) && $(oEvent.relatedTarget).closest(OVERLAY.elem[0]).length) { /* eslint-disable no-empty */ try { event.preventDefault(); } catch(e) {} /* eslint-enable no-empty */ } else if(!oEvent || oEvent && oEvent.type !== 'tooltipsolo') { this.toggle(event, event.type === 'tooltipshow', duration); } } }, this._ns, this); // Adjust modal z-index on tooltip focus qtip._bind(tooltip, 'tooltipfocus', function(event, api) { // If focus was cancelled before it reached us, don't do anything if(event.isDefaultPrevented() || event.target !== tooltip[0]) { return; } var qtips = $(MODALSELECTOR), // Keep the modal's lower than other, regular qtips newIndex = QTIP.modal_zindex + qtips.length, curIndex = parseInt(tooltip[0].style.zIndex, 10); // Set overlay z-index OVERLAY.elem[0].style.zIndex = newIndex - 1; // Reduce modal z-index's and keep them properly ordered qtips.each(function() { if(this.style.zIndex > curIndex) { this.style.zIndex -= 1; } }); // Fire blur event for focused tooltip qtips.filter('.' + CLASS_FOCUS).qtip('blur', event.originalEvent); // Set the new z-index tooltip.addClass(CLASS_FOCUS)[0].style.zIndex = newIndex; // Set current OVERLAY.update(api); // Prevent default handling /* eslint-disable no-empty */ try { event.preventDefault(); } catch(e) {} /* eslint-enable no-empty */ }, this._ns, this); // Focus any other visible modals when this one hides qtip._bind(tooltip, 'tooltiphide', function(event) { if(event.target === tooltip[0]) { $(MODALSELECTOR).filter(':visible').not(tooltip).last().qtip('focus', event); } }, this._ns, this); }, toggle: function(event, state, duration) { // Make sure default event hasn't been prevented if(event && event.isDefaultPrevented()) { return this; } // Toggle it OVERLAY.toggle(this.qtip, !!state, duration); }, destroy: function() { // Remove modal class this.qtip.tooltip.removeClass(MODALCLASS); // Remove bound events this.qtip._unbind(this.qtip.tooltip, this._ns); // Delete element reference OVERLAY.toggle(this.qtip, FALSE); delete this.qtip.elements.overlay; } }); MODAL = PLUGINS.modal = function(api) { return new Modal(api, api.options.show.modal); }; // Setup sanitiztion rules MODAL.sanitize = function(opts) { if(opts.show) { if(typeof opts.show.modal !== 'object') { opts.show.modal = { on: !!opts.show.modal }; } else if(typeof opts.show.modal.on === 'undefined') { opts.show.modal.on = TRUE; } } }; // Base z-index for all modal tooltips (use qTip core z-index as a base) /* eslint-disable camelcase */ QTIP.modal_zindex = QTIP.zindex - 200; /* eslint-enable camelcase */ // Plugin needs to be initialized on render MODAL.initialize = 'render'; // Setup option set checks CHECKS.modal = { '^show.modal.(on|blur)$': function() { // Initialise this.destroy(); this.init(); // Show the modal if not visible already and tooltip is visible this.qtip.elems.overlay.toggle( this.qtip.tooltip[0].offsetWidth > 0 ); } }; // Extend original api defaults $.extend(TRUE, QTIP.defaults, { show: { modal: { on: FALSE, effect: TRUE, blur: TRUE, stealfocus: TRUE, escape: TRUE } } }); ;PLUGINS.viewport = function(api, position, posOptions, targetWidth, targetHeight, elemWidth, elemHeight) { var target = posOptions.target, tooltip = api.elements.tooltip, my = posOptions.my, at = posOptions.at, adjust = posOptions.adjust, method = adjust.method.split(' '), methodX = method[0], methodY = method[1] || method[0], viewport = posOptions.viewport, container = posOptions.container, adjusted = { left: 0, top: 0 }, fixed, newMy, containerOffset, containerStatic, viewportWidth, viewportHeight, viewportScroll, viewportOffset; // If viewport is not a jQuery element, or it's the window/document, or no adjustment method is used... return if(!viewport.jquery || target[0] === window || target[0] === document.body || adjust.method === 'none') { return adjusted; } // Cach container details containerOffset = container.offset() || adjusted; containerStatic = container.css('position') === 'static'; // Cache our viewport details fixed = tooltip.css('position') === 'fixed'; viewportWidth = viewport[0] === window ? viewport.width() : viewport.outerWidth(FALSE); viewportHeight = viewport[0] === window ? viewport.height() : viewport.outerHeight(FALSE); viewportScroll = { left: fixed ? 0 : viewport.scrollLeft(), top: fixed ? 0 : viewport.scrollTop() }; viewportOffset = viewport.offset() || adjusted; // Generic calculation method function calculate(side, otherSide, type, adjustment, side1, side2, lengthName, targetLength, elemLength) { var initialPos = position[side1], mySide = my[side], atSide = at[side], isShift = type === SHIFT, myLength = mySide === side1 ? elemLength : mySide === side2 ? -elemLength : -elemLength / 2, atLength = atSide === side1 ? targetLength : atSide === side2 ? -targetLength : -targetLength / 2, sideOffset = viewportScroll[side1] + viewportOffset[side1] - (containerStatic ? 0 : containerOffset[side1]), overflow1 = sideOffset - initialPos, overflow2 = initialPos + elemLength - (lengthName === WIDTH ? viewportWidth : viewportHeight) - sideOffset, offset = myLength - (my.precedance === side || mySide === my[otherSide] ? atLength : 0) - (atSide === CENTER ? targetLength / 2 : 0); // shift if(isShift) { offset = (mySide === side1 ? 1 : -1) * myLength; // Adjust position but keep it within viewport dimensions position[side1] += overflow1 > 0 ? overflow1 : overflow2 > 0 ? -overflow2 : 0; position[side1] = Math.max( -containerOffset[side1] + viewportOffset[side1], initialPos - offset, Math.min( Math.max( -containerOffset[side1] + viewportOffset[side1] + (lengthName === WIDTH ? viewportWidth : viewportHeight), initialPos + offset ), position[side1], // Make sure we don't adjust complete off the element when using 'center' mySide === 'center' ? initialPos - myLength : 1E9 ) ); } // flip/flipinvert else { // Update adjustment amount depending on if using flipinvert or flip adjustment *= type === FLIPINVERT ? 2 : 0; // Check for overflow on the left/top if(overflow1 > 0 && (mySide !== side1 || overflow2 > 0)) { position[side1] -= offset + adjustment; newMy.invert(side, side1); } // Check for overflow on the bottom/right else if(overflow2 > 0 && (mySide !== side2 || overflow1 > 0) ) { position[side1] -= (mySide === CENTER ? -offset : offset) + adjustment; newMy.invert(side, side2); } // Make sure we haven't made things worse with the adjustment and reset if so if(position[side1] < viewportScroll[side1] && -position[side1] > overflow2) { position[side1] = initialPos; newMy = my.clone(); } } return position[side1] - initialPos; } // Set newMy if using flip or flipinvert methods if(methodX !== 'shift' || methodY !== 'shift') { newMy = my.clone(); } // Adjust position based onviewport and adjustment options adjusted = { left: methodX !== 'none' ? calculate( X, Y, methodX, adjust.x, LEFT, RIGHT, WIDTH, targetWidth, elemWidth ) : 0, top: methodY !== 'none' ? calculate( Y, X, methodY, adjust.y, TOP, BOTTOM, HEIGHT, targetHeight, elemHeight ) : 0, my: newMy }; return adjusted; }; ;PLUGINS.polys = { // POLY area coordinate calculator // Special thanks to Ed Cradock for helping out with this. // Uses a binary search algorithm to find suitable coordinates. polygon: function(baseCoords, corner) { var result = { width: 0, height: 0, position: { top: 1e10, right: 0, bottom: 0, left: 1e10 }, adjustable: FALSE }, i = 0, next, coords = [], compareX = 1, compareY = 1, realX = 0, realY = 0, newWidth, newHeight; // First pass, sanitize coords and determine outer edges i = baseCoords.length; while(i--) { next = [ parseInt(baseCoords[--i], 10), parseInt(baseCoords[i+1], 10) ]; if(next[0] > result.position.right){ result.position.right = next[0]; } if(next[0] < result.position.left){ result.position.left = next[0]; } if(next[1] > result.position.bottom){ result.position.bottom = next[1]; } if(next[1] < result.position.top){ result.position.top = next[1]; } coords.push(next); } // Calculate height and width from outer edges newWidth = result.width = Math.abs(result.position.right - result.position.left); newHeight = result.height = Math.abs(result.position.bottom - result.position.top); // If it's the center corner... if(corner.abbrev() === 'c') { result.position = { left: result.position.left + result.width / 2, top: result.position.top + result.height / 2 }; } else { // Second pass, use a binary search algorithm to locate most suitable coordinate while(newWidth > 0 && newHeight > 0 && compareX > 0 && compareY > 0) { newWidth = Math.floor(newWidth / 2); newHeight = Math.floor(newHeight / 2); if(corner.x === LEFT){ compareX = newWidth; } else if(corner.x === RIGHT){ compareX = result.width - newWidth; } else{ compareX += Math.floor(newWidth / 2); } if(corner.y === TOP){ compareY = newHeight; } else if(corner.y === BOTTOM){ compareY = result.height - newHeight; } else{ compareY += Math.floor(newHeight / 2); } i = coords.length; while(i--) { if(coords.length < 2){ break; } realX = coords[i][0] - result.position.left; realY = coords[i][1] - result.position.top; if( corner.x === LEFT && realX >= compareX || corner.x === RIGHT && realX <= compareX || corner.x === CENTER && (realX < compareX || realX > result.width - compareX) || corner.y === TOP && realY >= compareY || corner.y === BOTTOM && realY <= compareY || corner.y === CENTER && (realY < compareY || realY > result.height - compareY)) { coords.splice(i, 1); } } } result.position = { left: coords[0][0], top: coords[0][1] }; } return result; }, rect: function(ax, ay, bx, by) { return { width: Math.abs(bx - ax), height: Math.abs(by - ay), position: { left: Math.min(ax, bx), top: Math.min(ay, by) } }; }, _angles: { tc: 3 / 2, tr: 7 / 4, tl: 5 / 4, bc: 1 / 2, br: 1 / 4, bl: 3 / 4, rc: 2, lc: 1, c: 0 }, ellipse: function(cx, cy, rx, ry, corner) { var c = PLUGINS.polys._angles[ corner.abbrev() ], rxc = c === 0 ? 0 : rx * Math.cos( c * Math.PI ), rys = ry * Math.sin( c * Math.PI ); return { width: rx * 2 - Math.abs(rxc), height: ry * 2 - Math.abs(rys), position: { left: cx + rxc, top: cy + rys }, adjustable: FALSE }; }, circle: function(cx, cy, r, corner) { return PLUGINS.polys.ellipse(cx, cy, r, r, corner); } }; ;PLUGINS.svg = function(api, svg, corner) { var elem = svg[0], root = $(elem.ownerSVGElement), ownerDocument = elem.ownerDocument, strokeWidth2 = (parseInt(svg.css('stroke-width'), 10) || 0) / 2, frameOffset, mtx, transformed, len, next, i, points, result, position; // Ascend the parentNode chain until we find an element with getBBox() while(!elem.getBBox) { elem = elem.parentNode; } if(!elem.getBBox || !elem.parentNode) { return FALSE; } // Determine which shape calculation to use switch(elem.nodeName) { case 'ellipse': case 'circle': result = PLUGINS.polys.ellipse( elem.cx.baseVal.value, elem.cy.baseVal.value, (elem.rx || elem.r).baseVal.value + strokeWidth2, (elem.ry || elem.r).baseVal.value + strokeWidth2, corner ); break; case 'line': case 'polygon': case 'polyline': // Determine points object (line has none, so mimic using array) points = elem.points || [ { x: elem.x1.baseVal.value, y: elem.y1.baseVal.value }, { x: elem.x2.baseVal.value, y: elem.y2.baseVal.value } ]; for(result = [], i = -1, len = points.numberOfItems || points.length; ++i < len;) { next = points.getItem ? points.getItem(i) : points[i]; result.push.apply(result, [next.x, next.y]); } result = PLUGINS.polys.polygon(result, corner); break; // Unknown shape or rectangle? Use bounding box default: result = elem.getBBox(); result = { width: result.width, height: result.height, position: { left: result.x, top: result.y } }; break; } // Shortcut assignments position = result.position; root = root[0]; // Convert position into a pixel value if(root.createSVGPoint) { mtx = elem.getScreenCTM(); points = root.createSVGPoint(); points.x = position.left; points.y = position.top; transformed = points.matrixTransform( mtx ); position.left = transformed.x; position.top = transformed.y; } // Check the element is not in a child document, and if so, adjust for frame elements offset if(ownerDocument !== document && api.position.target !== 'mouse') { frameOffset = $((ownerDocument.defaultView || ownerDocument.parentWindow).frameElement).offset(); if(frameOffset) { position.left += frameOffset.left; position.top += frameOffset.top; } } // Adjust by scroll offset of owner document ownerDocument = $(ownerDocument); position.left += ownerDocument.scrollLeft(); position.top += ownerDocument.scrollTop(); return result; }; ;PLUGINS.imagemap = function(api, area, corner) { if(!area.jquery) { area = $(area); } var shape = (area.attr('shape') || 'rect').toLowerCase().replace('poly', 'polygon'), image = $('img[usemap="#'+area.parent('map').attr('name')+'"]'), coordsString = $.trim(area.attr('coords')), coordsArray = coordsString.replace(/,$/, '').split(','), imageOffset, coords, i, result, len; // If we can't find the image using the map... if(!image.length) { return FALSE; } // Pass coordinates string if polygon if(shape === 'polygon') { result = PLUGINS.polys.polygon(coordsArray, corner); } // Otherwise parse the coordinates and pass them as arguments else if(PLUGINS.polys[shape]) { for(i = -1, len = coordsArray.length, coords = []; ++i < len;) { coords.push( parseInt(coordsArray[i], 10) ); } result = PLUGINS.polys[shape].apply( this, coords.concat(corner) ); } // If no shapre calculation method was found, return false else { return FALSE; } // Make sure we account for padding and borders on the image imageOffset = image.offset(); imageOffset.left += Math.ceil((image.outerWidth(FALSE) - image.width()) / 2); imageOffset.top += Math.ceil((image.outerHeight(FALSE) - image.height()) / 2); // Add image position to offset coordinates result.position.left += imageOffset.left; result.position.top += imageOffset.top; return result; }; ;var IE6, /* * BGIFrame adaption (http://plugins.jquery.com/project/bgiframe) * Special thanks to Brandon Aaron */ BGIFRAME = ''; function Ie6(api) { this._ns = 'ie6'; this.qtip = api; this.init(api); } $.extend(Ie6.prototype, { _scroll : function() { var overlay = this.qtip.elements.overlay; overlay && (overlay[0].style.top = $(window).scrollTop() + 'px'); }, init: function(qtip) { var tooltip = qtip.tooltip; // Create the BGIFrame element if needed if($('select, object').length < 1) { this.bgiframe = qtip.elements.bgiframe = $(BGIFRAME).appendTo(tooltip); // Update BGIFrame on tooltip move qtip._bind(tooltip, 'tooltipmove', this.adjustBGIFrame, this._ns, this); } // redraw() container for width/height calculations this.redrawContainer = $('
    ', { id: NAMESPACE+'-rcontainer' }) .appendTo(document.body); // Fixup modal plugin if present too if( qtip.elements.overlay && qtip.elements.overlay.addClass('qtipmodal-ie6fix') ) { qtip._bind(window, ['scroll', 'resize'], this._scroll, this._ns, this); qtip._bind(tooltip, ['tooltipshow'], this._scroll, this._ns, this); } // Set dimensions this.redraw(); }, adjustBGIFrame: function() { var tooltip = this.qtip.tooltip, dimensions = { height: tooltip.outerHeight(FALSE), width: tooltip.outerWidth(FALSE) }, plugin = this.qtip.plugins.tip, tip = this.qtip.elements.tip, tipAdjust, offset; // Adjust border offset offset = parseInt(tooltip.css('borderLeftWidth'), 10) || 0; offset = { left: -offset, top: -offset }; // Adjust for tips plugin if(plugin && tip) { tipAdjust = plugin.corner.precedance === 'x' ? [WIDTH, LEFT] : [HEIGHT, TOP]; offset[ tipAdjust[1] ] -= tip[ tipAdjust[0] ](); } // Update bgiframe this.bgiframe.css(offset).css(dimensions); }, // Max/min width simulator function redraw: function() { if(this.qtip.rendered < 1 || this.drawing) { return this; } var tooltip = this.qtip.tooltip, style = this.qtip.options.style, container = this.qtip.options.position.container, perc, width, max, min; // Set drawing flag this.qtip.drawing = 1; // If tooltip has a set height/width, just set it... like a boss! if(style.height) { tooltip.css(HEIGHT, style.height); } if(style.width) { tooltip.css(WIDTH, style.width); } // Simulate max/min width if not set width present... else { // Reset width and add fluid class tooltip.css(WIDTH, '').appendTo(this.redrawContainer); // Grab our tooltip width (add 1 if odd so we don't get wrapping problems.. huzzah!) width = tooltip.width(); if(width % 2 < 1) { width += 1; } // Grab our max/min properties max = tooltip.css('maxWidth') || ''; min = tooltip.css('minWidth') || ''; // Parse into proper pixel values perc = (max + min).indexOf('%') > -1 ? container.width() / 100 : 0; max = (max.indexOf('%') > -1 ? perc : 1 * parseInt(max, 10)) || width; min = (min.indexOf('%') > -1 ? perc : 1 * parseInt(min, 10)) || 0; // Determine new dimension size based on max/min/current values width = max + min ? Math.min(Math.max(width, min), max) : width; // Set the newly calculated width and remvoe fluid class tooltip.css(WIDTH, Math.round(width)).appendTo(container); } // Set drawing flag this.drawing = 0; return this; }, destroy: function() { // Remove iframe this.bgiframe && this.bgiframe.remove(); // Remove bound events this.qtip._unbind([window, this.qtip.tooltip], this._ns); } }); IE6 = PLUGINS.ie6 = function(api) { // Proceed only if the browser is IE6 return BROWSER.ie === 6 ? new Ie6(api) : FALSE; }; IE6.initialize = 'render'; CHECKS.ie6 = { '^content|style$': function() { this.redraw(); } }; ;})); }( losjqisafe,window, document )); //})(losjqisafe); function setToolTip(itemSelector,itemText){ losjqisafe(itemSelector).qtip({ content: { text: itemText }, position:{ at:'bottom center' }, style: { tip: { corner: true, width: 24 } } }); } !function (a, b, c) { "use strict"; !function (b) { "function" == typeof define && define.amd ? define(["jquery"], b) : "object" == typeof exports ? module.exports = b(require("jquery")) : b(a.losjqisafe) } (function (d) { function e(a, b) { return this.$element = d(a), b && ("string" === d.type(b.delay) || "number" === d.type(b.delay)) && (b.delay = { show: b.delay, hide: b.delay }), this.options = d.extend({}, i, b), this._defaults = i, this._name = f, this._targetclick = !1, this.init(), k.push(this.$element), this } var f = "webuiPopover", g = "webui-popover", h = "webui.popover", i = { placement: "auto", container: null, width: "auto", height: "auto", trigger: "click", style: "", selector: !1, delay: { show: null, hide: 300 }, async: { type: "GET", before: null, success: null, error: null }, cache: !0, multi: !1, arrow: !0, title: "", content: "", closeable: !1, padding: !0, url: "", type: "html", direction: "", animation: null, template: '

     

    ', backdrop: !1, dismissible: !0, onShow: null, onHide: null, abortXHR: !0, autoHide: !1, offsetTop: 0, offsetLeft: 0, iframeOptions: { frameborder: "0", allowtransparency: "true", id: "", name: "", scrolling: "", onload: "", height: "", width: "" }, hideEmpty: !1 }, j = g + "-rtl", k = [], l = d('
    '), m = 0, n = !1, o = -2e3, p = d(b), q = function (a, b) { return isNaN(a) ? b || 0 : Number(a) }, r = function (a) { return a.data("plugin_" + f) }, s = function () { for (var a = null, b = 0; b < k.length; b++) a = r(k[b]), a && a.hide(!0); p.trigger("hiddenAll." + h) }, t = function (a) { for (var b = null, c = 0; c < k.length; c++) b = r(k[c]), b && b.id !== a.id && b.hide(!0); p.trigger("hiddenAll." + h) }, u = "ontouchstart" in b.documentElement && /Mobi/.test(navigator.userAgent), v = function (a) { var b = { x: 0, y: 0 }; if ("touchstart" === a.type || "touchmove" === a.type || "touchend" === a.type || "touchcancel" === a.type) { var c = a.originalEvent.touches[0] || a.originalEvent.changedTouches[0]; b.x = c.pageX, b.y = c.pageY } else ("mousedown" === a.type || "mouseup" === a.type || "click" === a.type) && (b.x = a.pageX, b.y = a.pageY); return b }; e.prototype = { init: function () { if (this.$element[0]instanceof b.constructor && !this.options.selector) throw new Error("`selector` option must be specified when initializing " + this.type + " on the window.document object!"); "manual" !== this.getTrigger() && ("click" === this.getTrigger() || u ? this.$element.off("click touchend", this.options.selector).on("click touchend", this.options.selector, d.proxy(this.toggle, this)) : "hover" === this.getTrigger() && this.$element.off("mouseenter mouseleave click", this.options.selector).on("mouseenter", this.options.selector, d.proxy(this.mouseenterHandler, this)).on("mouseleave", this.options.selector, d.proxy(this.mouseleaveHandler, this))), this._poped = !1, this._inited = !0, this._opened = !1, this._idSeed = m, this.id = f + this._idSeed, this.options.container = d(this.options.container || b.body).first(), this.options.backdrop && l.appendTo(this.options.container).hide(), m++, "sticky" === this.getTrigger() && this.show(), this.options.selector && (this._options = d.extend({}, this.options, { selector: "" })) }, destroy: function () { for (var a = -1, b = 0; b < k.length; b++) if (k[b] === this.$element) { a = b; break } k.splice(a, 1), this.hide(), this.$element.data("plugin_" + f, null), "click" === this.getTrigger() ? this.$element.off("click") : "hover" === this.getTrigger() && this.$element.off("mouseenter mouseleave"), this.$target && this.$target.remove() }, getDelegateOptions: function () { var a = {}; return this._options && d.each(this._options, function (b, c) { i[b] !== c && (a[b] = c) }), a }, hide: function (a, b) { if ((a || "sticky" !== this.getTrigger()) && this._opened) { b && (b.preventDefault(), b.stopPropagation()), this.xhr && this.options.abortXHR === !0 && (this.xhr.abort(), this.xhr = null); var c = d.Event("hide." + h); if (this.$element.trigger(c, [this.$target]), this.$target) { this.$target.removeClass("in").addClass(this.getHideAnimation()); var e = this; setTimeout(function () { e.$target.hide(), e.getCache() || e.$target.remove() }, e.getHideDelay()) } this.options.backdrop && l.hide(), this._opened = !1, this.$element.trigger("hidden." + h, [this.$target]), this.options.onHide && this.options.onHide(this.$target) } }, resetAutoHide: function () { var a = this, b = a.getAutoHide(); b && (a.autoHideHandler && clearTimeout(a.autoHideHandler), a.autoHideHandler = setTimeout(function () { a.hide() }, b)) }, delegate: function (a) { var b = d(a).data("plugin_" + f); return b || (b = new e(a, this.getDelegateOptions()), d(a).data("plugin_" + f, b)), b }, toggle: function (a) { var b = this; a && (a.preventDefault(), a.stopPropagation(), this.options.selector && (b = this.delegate(a.currentTarget))), b[b.getTarget().hasClass("in") ? "hide" : "show"]() }, hideAll: function () { s() }, hideOthers: function () { t(this) }, show: function () { if (!this._opened) { var a = this.getTarget().removeClass().addClass(g).addClass(this._customTargetClass); if (this.options.multi || this.hideOthers(), !this.getCache() || !this._poped || "" === this.content) { if (this.content = "", this.setTitle(this.getTitle()), this.options.closeable || a.find(".close").off("click").remove(), this.isAsync() ? this.setContentASync(this.options.content) : this.setContent(this.getContent()), this.canEmptyHide() && "" === this.content) return; a.show() } this.displayContent(), this.options.onShow && this.options.onShow(a), this.bindBodyEvents(), this.options.backdrop && l.show(), this._opened = !0, this.resetAutoHide() } }, displayContent: function () { var a = this.getElementPosition(), b = this.getTarget().removeClass().addClass(g).addClass(this._customTargetClass), c = this.getContentElement(), e = b[0].offsetWidth, f = b[0].offsetHeight, i = "bottom", k = d.Event("show." + h); if (this.canEmptyHide()) { var l = c.children().html(); if (null !== l && 0 === l.trim().length) return } this.$element.trigger(k, [b]); var m = this.$element.data("width") || this.options.width; "" === m && (m = this._defaults.width), "auto" !== m && b.width(m); var n = this.$element.data("height") || this.options.height; "" === n && (n = this._defaults.height), "auto" !== n && c.height(n), this.options.style && this.$target.addClass(g + "-" + this.options.style), "rtl" !== this.options.direction || c.hasClass(j) || c.addClass(j), this.options.arrow || b.find(".webui-arrow").remove(), b.detach().css({ top: o, left: o, display: "block" }), this.getAnimation() && b.addClass(this.getAnimation()), b.appendTo(this.options.container), i = this.getPlacement(a), this.$element.trigger("added." + h), this.initTargetEvents(), this.options.padding || ("auto" !== this.options.height && c.css("height", c.outerHeight()), this.$target.addClass("webui-no-padding")), this.options.maxHeight && c.css("maxHeight", this.options.maxHeight), this.options.maxWidth && c.css("maxWidth", this.options.maxWidth), e = b[0].offsetWidth, f = b[0].offsetHeight; if (!this._opened && f < 250) { f += 250; } var p = this.getTargetPositin(a, i, e, f); if (this.$target.css(p.position).addClass(i).addClass("in"), "iframe" === this.options.type) { var q = b.find("iframe"), r = b.width(), s = q.parent().height(); "" !== this.options.iframeOptions.width && "auto" !== this.options.iframeOptions.width && (r = this.options.iframeOptions.width), "" !== this.options.iframeOptions.height && "auto" !== this.options.iframeOptions.height && (s = this.options.iframeOptions.height), q.width(r).height(s) } if (this.options.arrow || this.$target.css({ margin: 0 }), this.options.arrow) { var t = this.$target.find(".webui-arrow"); t.removeAttr("style"), "left" === i || "right" === i ? t.css({ top: this.$target.height() / 2 }) : ("top" === i || "bottom" === i) && t.css({ left: this.$target.width() / 2 }), p.arrowOffset && (-1 === p.arrowOffset.left || -1 === p.arrowOffset.top ? t.hide() : t.css(p.arrowOffset)) } this._poped = !0, this.$element.trigger("shown." + h, [this.$target]) }, isTargetLoaded: function () { return 0 === this.getTarget().find("i.glyphicon-refresh").length }, getTriggerElement: function () { return this.$element }, getTarget: function () { if (!this.$target) { var a = f + this._idSeed; this.$target = d(this.options.template).attr("id", a), this._customTargetClass = this.$target.attr("class") !== g ? this.$target.attr("class") : null, this.getTriggerElement().attr("data-target", a) } return this.$target.data("trigger-element") || this.$target.data("trigger-element", this.getTriggerElement()), this.$target }, removeTarget: function () { this.$target.remove(), this.$target = null, this.$contentElement = null }, getTitleElement: function () { return this.getTarget().find("." + g + "-title") }, getContentElement: function () { return this.$contentElement || (this.$contentElement = this.getTarget().find("." + g + "-content")), this.$contentElement }, getTitle: function () { return this.$element.attr("data-title") || this.options.title || this.$element.attr("title") }, getUrl: function () { return this.$element.attr("data-url") || this.options.url }, getAutoHide: function () { return this.$element.attr("data-auto-hide") || this.options.autoHide }, getOffsetTop: function () { return q(this.$element.attr("data-offset-top")) || this.options.offsetTop }, getOffsetLeft: function () { return q(this.$element.attr("data-offset-left")) || this.options.offsetLeft }, getCache: function () { var a = this.$element.attr("data-cache"); if ("undefined" != typeof a) switch (a.toLowerCase()) { case "true": case "yes": case "1": return !0; case "false": case "no": case "0": return !1 } return this.options.cache }, getTrigger: function () { return this.$element.attr("data-trigger") || this.options.trigger }, getDelayShow: function () { var a = this.$element.attr("data-delay-show"); return "undefined" != typeof a ? a : 0 === this.options.delay.show ? 0 : this.options.delay.show || 100 }, getHideDelay: function () { var a = this.$element.attr("data-delay-hide"); return "undefined" != typeof a ? a : 0 === this.options.delay.hide ? 0 : this.options.delay.hide || 100 }, getAnimation: function () { var a = this.$element.attr("data-animation"); return a || this.options.animation }, getHideAnimation: function () { var a = this.getAnimation(); return a ? a + "-out" : "out" }, setTitle: function (a) { var b = this.getTitleElement(); a ? ("rtl" !== this.options.direction || b.hasClass(j) || b.addClass(j), b.html(a)) : b.remove() }, hasContent: function () { return this.getContent() }, canEmptyHide: function () { return this.options.hideEmpty && "html" === this.options.type }, getIframe: function () { var a = d("").attr("src", this.getUrl()), b = this; return d.each(this._defaults.iframeOptions, function (c) { "undefined" != typeof b.options.iframeOptions[c] && a.attr(c, b.options.iframeOptions[c]) }), a }, getContent: function () { if (this.getUrl()) switch (this.options.type) { case "iframe": this.content = this.getIframe(); break; case "html": try { this.content = d(this.getUrl()), this.content.is(":visible") || this.content.show() } catch (a) { throw new Error("Unable to get popover content. Invalid selector specified.") } } else if (!this.content) { var b = ""; if (b = d.isFunction(this.options.content) ? this.options.content.apply(this.$element[0], [this]) : this.options.content, this.content = this.$element.attr("data-content") || b, !this.content) { var c = this.$element.next(); c && c.hasClass(g + "-content") && (this.content = c) } } return this.content }, setContent: function (a) { var b = this.getTarget(), c = this.getContentElement(); "string" == typeof a ? c.html(a) : a instanceof d && (c.html(""), this.options.cache ? a.removeClass(g + "-content").appendTo(c) : a.clone(!0, !0).removeClass(g + "-content").appendTo(c)), this.$target = b }, isAsync: function () { return "async" === this.options.type }, setContentASync: function (a) { var b = this; this.xhr || (this.xhr = d.ajax({ url: this.getUrl(), type: this.options.async.type, cache: this.getCache(), beforeSend: function (a) { b.options.async.before && b.options.async.before(b, a) }, success: function (c) { b.bindBodyEvents(), a && d.isFunction(a) ? b.content = a.apply(b.$element[0], [c]) : b.content = c, b.setContent(b.content); var e = b.getContentElement(); e.removeAttr("style"), b.displayContent(), b.options.async.success && b.options.async.success(b, c) }, complete: function () { b.xhr = null }, error: function (a, c) { b.options.async.error && b.options.async.error(b, a, c) } })) }, bindBodyEvents: function () { n || (this.options.dismissible && "click" === this.getTrigger() ? (p.off("keyup.webui-popover").on("keyup.webui-popover", d.proxy(this.escapeHandler, this)), p.off("click.webui-popover touchend.webui-popover").on("click.webui-popover touchend.webui-popover", d.proxy(this.bodyClickHandler, this))) : "hover" === this.getTrigger() && p.off("touchend.webui-popover").on("touchend.webui-popover", d.proxy(this.bodyClickHandler, this))) }, mouseenterHandler: function (a) { var b = this; a && this.options.selector && (b = this.delegate(a.currentTarget)), b._timeout && clearTimeout(b._timeout), b._enterTimeout = setTimeout(function () { b.getTarget().is(":visible") || b.show() }, this.getDelayShow()) }, mouseleaveHandler: function () { var a = this; clearTimeout(a._enterTimeout), a._timeout = setTimeout(function () { a.hide() }, this.getHideDelay()) }, escapeHandler: function (a) { 27 === a.keyCode && this.hideAll() }, bodyClickHandler: function (a) { n = !0; for (var b = !0, c = 0; c < k.length; c++) { var d = r(k[c]); if (d && d._opened) { var e = d.getTarget().offset(), f = e.left, g = e.top, h = e.left + d.getTarget().width(), i = e.top + d.getTarget().height(), j = v(a), l = j.x >= f && j.x <= h && j.y >= g && j.y <= i; if (l) { b = !1; break } } } b && s() }, initTargetEvents: function () { "hover" === this.getTrigger() && this.$target.off("mouseenter mouseleave").on("mouseenter", d.proxy(this.mouseenterHandler, this)).on("mouseleave", d.proxy(this.mouseleaveHandler, this)), this.$target.find(".close").off("click").on("click", d.proxy(this.hide, this, !0)) }, getPlacement: function (a) { var b, c = this.options.container, d = c.innerWidth(), e = c.innerHeight(), f = c.scrollTop(), g = c.scrollLeft(), h = Math.max(0, a.left - g), i = Math.max(0, a.top - f); b = "function" == typeof this.options.placement ? this.options.placement.call(this, this.getTarget()[0], this.$element[0]) : this.$element.data("placement") || this.options.placement; var j = "horizontal" === b, k = "vertical" === b, l = "auto" === b || j || k; return l ? b = d / 3 > h ? e / 3 > i ? j ? "right-bottom" : "bottom-right" : 2 * e / 3 > i ? k ? e / 2 >= i ? "bottom-right" : "top-right" : "right" : j ? "right-top" : "top-right" : 2 * d / 3 > h ? e / 3 > i ? j ? d / 2 >= h ? "right-bottom" : "left-bottom" : "bottom" : 2 * e / 3 > i ? j ? d / 2 >= h ? "right" : "left" : e / 2 >= i ? "bottom" : "top" : j ? d / 2 >= h ? "right-top" : "left-top" : "top" : e / 3 > i ? j ? "left-bottom" : "bottom-left" : 2 * e / 3 > i ? k ? e / 2 >= i ? "bottom-left" : "top-left" : "left" : j ? "left-top" : "top-left" : "auto-top" === b ? b = d / 3 > h ? "top-right" : 2 * d / 3 > h ? "top" : "top-left" : "auto-bottom" === b ? b = d / 3 > h ? "bottom-right" : 2 * d / 3 > h ? "bottom" : "bottom-left" : "auto-left" === b ? b = e / 3 > i ? "left-top" : 2 * e / 3 > i ? "left" : "left-bottom" : "auto-right" === b && (b = e / 3 > i ? "right-bottom" : 2 * e / 3 > i ? "right" : "right-top"), b }, getElementPosition: function () { var a = this.$element[0].getBoundingClientRect(), c = this.options.container, e = c.css("position"); if (c.is(b.body) || "static" === e) return d.extend({}, this.$element.offset(), { width: this.$element[0].offsetWidth || a.width, height: this.$element[0].offsetHeight || a.height }); if ("fixed" === e) { var f = c[0].getBoundingClientRect(); return { top: a.top - f.top + c.scrollTop(), left: a.left - f.left + c.scrollLeft(), width: a.width, height: a.height } } return "relative" === e ? { top: this.$element.offset().top - c.offset().top, left: this.$element.offset().left - c.offset().left, width: this.$element[0].offsetWidth || a.width, height: this.$element[0].offsetHeight || a.height } : void 0 }, getTargetPositin: function (a, c, d, e) { var f = a, g = this.options.container, h = this.$element.outerWidth(), i = this.$element.outerHeight(), j = b.documentElement.scrollTop + g.scrollTop(), k = b.documentElement.scrollLeft + g.scrollLeft(), l = {}, m = null, n = this.options.arrow ? 20 : 0, p = 10, q = n + p > h ? n : 0, r = n + p > i ? n : 0, s = 0, t = b.documentElement.clientHeight + j, u = b.documentElement.clientWidth + k, v = f.left + f.width / 2 - q > 0, w = f.left + f.width / 2 + q < u, x = f.top + f.height / 2 - r > 0, y = f.top + f.height / 2 + r < t; switch (c) { case "bottom": l = { top: f.top + f.height, left: f.left + f.width / 2 - d / 2 }; break; case "top": l = { top: f.top - e, left: f.left + f.width / 2 - d / 2 }; break; case "left": l = { top: f.top + f.height / 2 - e / 2, left: f.left - d }; break; case "right": l = { top: f.top + f.height / 2 - e / 2, left: f.left + f.width }; break; case "top-right": l = { top: f.top - e, left: v ? f.left - q : p }, m = { left: v ? Math.min(h, d) / 2 + q : o }; break; case "top-left": s = w ? q : -p, l = { top: f.top - e, left: f.left - d + f.width + s }, m = { left: w ? d - Math.min(h, d) / 2 - q : o }; break; case "bottom-right": l = { top: f.top + f.height, left: v ? f.left - q : p }, m = { left: v ? Math.min(h, d) / 2 + q : o }; break; case "bottom-left": s = w ? q : -p, l = { top: f.top + f.height, left: f.left - d + f.width + s }, m = { left: w ? d - Math.min(h, d) / 2 - q : o }; break; case "right-top": s = y ? r : -p, l = { top: f.top - e + f.height + s, left: f.left + f.width }, m = { top: y ? e - Math.min(i, e) / 2 - r : o }; break; case "right-bottom": l = { top: x ? f.top - r : p, left: f.left + f.width }, m = { top: x ? Math.min(i, e) / 2 + r : o }; break; case "left-top": s = y ? r : -p, l = { top: f.top - e + f.height + s, left: f.left - d }, m = { top: y ? e - Math.min(i, e) / 2 - r : o }; break; case "left-bottom": l = { top: x ? f.top - r : p, left: f.left - d }, m = { top: x ? Math.min(i, e) / 2 + r : o } } return l.top += this.getOffsetTop(), l.left += this.getOffsetLeft(), { position: l, arrowOffset: m } } }, d.fn[f] = function (a, b) { var c = [], g = this.each(function () { var g = d.data(this, "plugin_" + f); g ? "destroy" === a ? g.destroy() : "string" == typeof a && c.push(g[a]()) : (a ? "string" == typeof a ? "destroy" !== a && (b || (g = new e(this, null), c.push(g[a]()))) : "object" == typeof a && (g = new e(this, a)) : g = new e(this, null), d.data(this, "plugin_" + f, g)) }); return c.length ? c : g }; var w = function () { var a = function () { s() }, b = function (a, b) { b = b || {}, d(a).webuiPopover(b) }, e = function (a) { var b = !0; return d(a).each(function (a, e) { b = b && d(e).data("plugin_" + f) !== c }), b }, g = function (a, b) { b ? d(a).webuiPopover(b).webuiPopover("show") : d(a).webuiPopover("show") }, h = function (a) { d(a).webuiPopover("hide") }, j = function (a) { i = d.extend({}, i, a) }, k = function (a, b) { var c = d(a).data("plugin_" + f); if (c) { var e = c.getCache(); c.options.cache = !1, c.options.content = b, c._opened ? (c._opened = !1, c.show()) : c.isAsync() ? c.setContentASync(b) : c.setContent(b), c.options.cache = e } }, l = function (a, b) { var c = d(a).data("plugin_" + f); if (c) { var e = c.getCache(), g = c.options.type; c.options.cache = !1, c.options.url = b, c._opened ? (c._opened = !1, c.show()) : (c.options.type = "async", c.setContentASync(c.content)), c.options.cache = e, c.options.type = g } }; return { show: g, hide: h, create: b, isCreated: e, hideAll: a, updateContent: k, updateContentAsync: l, setDefaultOptions: j } } (); a.WebuiPopovers = w }) } (window, document); window.mobilecheck = function () { var check = false; (function (a) { if (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|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|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(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|yas\-|your|zeto|zte\-/i.test(a.substr(0, 4))) check = true; })(navigator.userAgent || navigator.vendor || window.opera); return check; }; function TagManager() { this.config = {}; this.tags = []; this.tagContainer; }; TagManager.prototype = { constructor: TagManager, damageTagImage: "http://eu.cdn.autosonshow.tv/images/hazard.png", featureTagImage: "http://eu.cdn.autosonshow.tv/images/target.png", quadrants: [{ minX: 0, maxX: 0.333, minY: 0, maxY: 0.33, anchor: "bottom-right" }, { minX: 0.333, maxX: 0.667, minY: 0, maxY: 0.33, anchor: "bottom" }, { minX: 0.667, maxX: 1, minY: 0, maxY: 0.33, anchor: "bottom-left" }, { minX: 0, maxX: 0.333, minY: 0.333, maxY: 0.667, anchor: "right" }, { minX: 0.333, maxX: 0.667, minY: 0.333, maxY: 0.667, anchor: "bottom" }, { minX: 0.667, maxX: 1, minY: 0.333, maxY: 0.667, anchor: "left" }, { minX: 0, maxX: 0.333, minY: 0.667, maxY: 1, anchor: "top-right" }, { minX: 0.333, maxX: 0.667, minY: 0.667, maxY: 1, anchor: "top" }, { minX: 0.667, maxX: 1, minY: 0.667, maxY: 1, anchor: "top-left" } ], importTags: function (config) { for (var i = 0; i < config.length; i++) { var imageTagArray = this.config[config[i].parentMedia]; if (!imageTagArray) { imageTagArray = this.config[config[i].parentMedia] = []; } if (config[i].associatedMedia) { config[i].associatedMedia = config[i].associatedMedia; } imageTagArray.push(config[i]); } console.log(this.imageTagArray); }, loadTagsForImage: function (src, container) { this.clearTags(); this.container = container; console.log("TagManager:loadTagsForImg:" + src); var filename = src; //.substring(src.lastIndexOf('/')+1); console.log(" FILE NAME " + filename); console.log(this.config); console.log(this.config[filename]); var imageTags = this.config[filename]; console.log(imageTags); console.log("IMAGE TAGS " + imageTags); console.log("CHECIGN TAGS "); if (!imageTags) return; console.log(" GOT TAGS"); var tag; var config; for (var i = 0; i < imageTags.length; i++) { config = imageTags[i]; if (config.context === "damage") { config.tagImage = this.damageTagImage; } else { config.tagImage = this.featureTagImage; } tag = new Tag(imageTags[i]); this.container.appendChild(tag.element); var anchor; for (var j = 0; j < this.quadrants.length; j++) { if (this.quadrants[j].minX <= config.x && this.quadrants[j].maxX >= config.x && this.quadrants[j].minY <= config.y && this.quadrants[j].maxY >= config.y) { anchor = this.quadrants[j].anchor; } } var popoverConfig = { title: config.title, animation: 'pop', closeable: true, placement: "auto", arrow: false, container: this.container }; var imgWidth; if (window.mobilecheck()) { popoverConfig.style = "mobile"; popoverConfig.placement = "top"; imgWidth = "100%"; } else { imgWidth = "480px"; } popoverConfig.content = ""; if (config.associatedMedia !== "") { popoverConfig.content += ""; } if (config.associatedInformation !== "") { popoverConfig.content += "
    " + config.associatedInformation; } losjqisafe(tag.element).webuiPopover(popoverConfig); this.tags.push(tag); } }, clearTags: function () { console.log("TagManager:clearTags"); var tag; for (var i = 0; i < this.tags.length; i++) { tag = this.tags[i]; tag.element.parentNode.removeChild(tag.element); tag = null; } this.tags = []; }, refreshTags: function () { console.log("TagManager:refreshTags"); }, showTags: function () { for (var i = 0; i < this.tags.length; i++) { tag = this.tags[i]; tag.show(500); } }, hideTags: function () { for (var i = 0; i < this.tags.length; i++) { tag = this.tags[i]; tag.hide(); } } }; function Tag(config) { var base = this; this.config = config; console.log("Tag:constructor"); this.open = function () { console.log("Tag:open"); }; this.close = function () { console.log("Tag:close"); }; this.show = function (d) { setTimeout(function () { base.element.className = "aosTag pop in"; }, d); }; this.hide = function () { base.element.className = "aosTag pop pop-out"; }; var img = new Image(); img.style.marginLeft = "-50%"; img.style.marginTop = "-50%"; img.style.width = "100%"; img.src = config.tagImage; this.element = document.createElement("div"); this.element.style.top = (config.y * 100) + "%"; this.element.style.left = (config.x * 100) + "%"; this.element.className = "aosTag pop"; this.element.appendChild(img); this.show(500); return this; }; Tag.prototype = { constructor: Tag };