" + a + "
"; v.load.style.display = "none"; q.load.box.style.display = "none"; q.errorMsg.style.display = "table"; Na = !0; G = p; M.style.display = "none"; B("error", a) } function ja(a) { var b = Q(a); fa.style.left = b.x + "px"; fa.style.top = b.y + "px"; clearTimeout(ja.t1); clearTimeout(ja.t2); fa.style.display = "block"; fa.style.opacity = 1; ja.t1 = setTimeout(function () { fa.style.opacity = 0 }, 2E3); ja.t2 = setTimeout(function () { fa.style.display = "none" }, 2500); a.preventDefault() } function Q(a) { var b = s.getBoundingClientRect(), n = {}; n.x = (a.clientX || a.pageX) - b.left; n.y = (a.clientY || a.pageY) - b.top; return n } function ka(a) { a.preventDefault(); s.focus(); if (G && b.draggable) { var f = Q(a); if (b.hotSpotDebug) { var n = ta(a); console.log("Pitch: " + n[0] + ", Yaw: " + n[1] + ", Center Pitch: " + b.pitch + ", Center Yaw: " + b.yaw + ", HFOV: " + b.hfov) } t(); Da(); b.roll = 0; w.hfov = 0; ha = !0; N = Date.now(); xa = f.x; ya = f.y; Oa = b.yaw; Pa = b.pitch; J.classList.add("pnlm-grabbing"); J.classList.remove("pnlm-grab"); B("mousedown", a); F() } } function Ja(a) { b.minHfov === b.hfov ? da.setHfov(ra, 1E3) : (a = ta(a), da.lookAt(a[0], a[1], b.minHfov, 1E3)) } function ta(a) { var f = Q(a); a = C.getCanvas(); var n = a.clientWidth, c = a.clientHeight; a = f.x / n * 2 - 1; var c = (1 - f.y / c * 2) * c / n, e = 1 / Math.tan(b.hfov * Math.PI / 360), d = Math.sin(b.pitch * Math.PI / 180), g = Math.cos(b.pitch * Math.PI / 180), f = e * g - c * d, n = Math.sqrt(a * a + f * f), c = 180 * Math.atan((c * g + e * d) / n) / Math.PI; a = 180 * Math.atan2(a / n, f / n) / Math.PI + b.yaw; -180 > a && (a += 360); 180 < a && (a -= 360); return [c, a] } function ua(a) { if (ha && G) { N = Date.now(); var f = C.getCanvas(), n = f.clientWidth, f = f.clientHeight; a = Q(a); var c = 180 * (Math.atan(xa / n * 2 - 1) - Math.atan(a.x / n * 2 - 1)) / Math.PI * b.hfov / 90 + Oa; w.yaw = (c - b.yaw) % 360 * 0.2; b.yaw = c; n = 360 * Math.atan(Math.tan(b.hfov / 360 * Math.PI) * f / n) / Math.PI; n = 180 * (Math.atan(a.y / f * 2 - 1) - Math.atan(ya / f * 2 - 1)) / Math.PI * n / 90 + Pa; w.pitch = 0.2 * (n - b.pitch); b.pitch = n } } function ma(a) { ha && (ha = !1, 15 < Date.now() - N && (w.pitch = w.yaw = 0), J.classList.add("pnlm-grab"), J.classList.remove("pnlm-grabbing"), N = Date.now(), B("mouseup", a)) } function Ka(a) { if (G && b.draggable) { t(); Da(); b.roll = 0; w.hfov = 0; var f = Q(a.targetTouches[0]); xa = f.x; ya = f.y; if (2 == a.targetTouches.length) { var n = Q(a.targetTouches[1]); xa += 0.5 * (n.x - f.x); ya += 0.5 * (n.y - f.y); Ha = Math.sqrt((f.x - n.x) * (f.x - n.x) + (f.y - n.y) * (f.y - n.y)) } ha = !0; N = Date.now(); Oa = b.yaw; Pa = b.pitch; B("touchstart", a); F() } } function la(a) { if (b.draggable && (a.preventDefault(), G && (N = Date.now()), ha && G)) { var f = Q(a.targetTouches[0]), n = f.x, c = f.y; 2 == a.targetTouches.length && -1 != Ha && (a = Q(a.targetTouches[1]), n += 0.5 * (a.x - f.x), c += 0.5 * (a.y - f.y), f = Math.sqrt((f.x - a.x) * (f.x - a.x) + (f.y - a.y) * (f.y - a.y)), x(b.hfov + 0.1 * (Ha - f)), Ha = f); f = b.hfov / 360 * b.touchPanSpeedCoeffFactor; n = (xa - n) * f + Oa; w.yaw = (n - b.yaw) % 360 * 0.2; b.yaw = n; c = (c - ya) * f + Pa; w.pitch = 0.2 * (c - b.pitch); b.pitch = c } } function Ea() { ha = !1; 150 < Date.now() - N && (w.pitch = w.yaw = 0); Ha = -1; N = Date.now(); B("touchend", event) } function A(a) { "touch" == a.pointerType && G && b.draggable && (ia.push(a.pointerId), za.push({ clientX: a.clientX, clientY: a.clientY }), a.targetTouches = za, Ka(a), a.preventDefault()) } function c(a) { if ("touch" == a.pointerType && b.draggable) for (var f = 0; f < ia.length; f++) if (a.pointerId == ia[f]) { za[f].clientX = a.clientX; za[f].clientY = a.clientY; a.targetTouches = za; la(a); a.preventDefault(); break } } function a(a) { if ("touch" == a.pointerType) { for (var b = !1, n = 0; n < ia.length; n++) a.pointerId == ia[n] && (ia[n] = p), ia[n] && (b = !0); b || (ia = [], za = [], Ea()); a.preventDefault() } } function U(a) { G && ("fullscreenonly" != b.mouseZoom || Aa) && (a.preventDefault(), t(), N = Date.now(), a.wheelDeltaY ? (x(b.hfov - 0.05 * a.wheelDeltaY), w.hfov = 0 > a.wheelDelta ? 1 : -1) : a.wheelDelta ? (x(b.hfov - 0.05 * a.wheelDelta), w.hfov = 0 > a.wheelDelta ? 1 : -1) : a.detail && (x(b.hfov + 1.5 * a.detail), w.hfov = 0 < a.detail ? 1 : -1), F()) } function V(a) { t(); N = Date.now(); Da(); b.roll = 0; var f = a.which || a.keycode; 0 > b.capturedKeyNumbers.indexOf(f) || (a.preventDefault(), 27 == f ? Aa && h() : wa(f, !0)) } function $() { for (var a = 0; 10 > a; a++) r[a] = !1 } function R(a) { var f = a.which || a.keycode; 0 > b.capturedKeyNumbers.indexOf(f) || (a.preventDefault(), wa(f, !1)) } function wa(a, b) { var n = !1; switch (a) { case 109: case 189: case 17: case 173: r[0] != b && (n = !0); r[0] = b; break; case 107: case 187: case 16: case 61: r[1] != b && (n = !0); r[1] = b; break; case 38: r[2] != b && (n = !0); r[2] = b; break; case 87: r[6] != b && (n = !0); r[6] = b; break; case 40: r[3] != b && (n = !0); r[3] = b; break; case 83: r[7] != b && (n = !0); r[7] = b; break; case 37: r[4] != b && (n = !0); r[4] = b; break; case 65: r[8] != b && (n = !0); r[8] = b; break; case 39: r[5] != b && (n = !0); r[5] = b; break; case 68: r[9] != b && (n = !0), r[9] = b } n && b && (ba = "undefined" !== typeof performance && performance.now() ? performance.now() : Date.now(), F()) } function ga() { if (G) { var a = !1, f = b.pitch, n = b.yaw, c = b.hfov, e; e = "undefined" !== typeof performance && performance.now() ? performance.now() : Date.now(); ba === p && (ba = e); var d = (e - ba) * b.hfov / 1700, d = Math.min(d, 1); r[0] && !0 === b.keyboardZoom && (x(b.hfov + (0.8 * w.hfov + 0.5) * d), a = !0); r[1] && !0 === b.keyboardZoom && (x(b.hfov + (0.8 * w.hfov - 0.2) * d), a = !0); if (r[2] || r[6]) b.pitch += (0.8 * w.pitch + 0.2) * d, a = !0; if (r[3] || r[7]) b.pitch += (0.8 * w.pitch - 0.2) * d, a = !0; if (r[4] || r[8]) b.yaw += (0.8 * w.yaw - 0.2) * d, a = !0; if (r[5] || r[9]) b.yaw += (0.8 * w.yaw + 0.2) * d, a = !0; a && (N = Date.now()); if (b.autoRotate) { if (0.001 < e - ba) { var a = (e - ba) / 1E3, g = (w.yaw / a * d - 0.2 * b.autoRotate) * a, g = (0 < -b.autoRotate ? 1 : -1) * Math.min(Math.abs(b.autoRotate * a), Math.abs(g)); b.yaw += g } b.autoRotateStopDelay && (b.autoRotateStopDelay -= e - ba, 0 >= b.autoRotateStopDelay && (b.autoRotateStopDelay = !1, Z = b.autoRotate, b.autoRotate = 0)) } O.pitch && (m("pitch"), f = b.pitch); O.yaw && (m("yaw"), n = b.yaw); O.hfov && (m("hfov"), c = b.hfov); 0 < d && !b.autoRotate && (a = 1 - b.friction, r[4] || r[5] || r[8] || r[9] || O.yaw || (b.yaw += w.yaw * d * a), r[2] || r[3] || r[6] || r[7] || O.pitch || (b.pitch += w.pitch * d * a), r[0] || r[1] || O.hfov || x(b.hfov + w.hfov * d * a)); ba = e; 0 < d && (w.yaw = 0.8 * w.yaw + (b.yaw - n) / d * 0.2, w.pitch = 0.8 * w.pitch + (b.pitch - f) / d * 0.2, w.hfov = 0.8 * w.hfov + (b.hfov - c) / d * 0.2, f = b.autoRotate ? Math.abs(b.autoRotate) : 5, w.yaw = Math.min(f, Math.max(w.yaw, -f)), w.pitch = Math.min(f, Math.max(w.pitch, -f)), w.hfov = Math.min(f, Math.max(w.hfov, -f))); r[0] && r[1] && (w.hfov = 0); (r[2] || r[6]) && (r[3] || r[7]) && (w.pitch = 0); (r[4] || r[8]) && (r[5] || r[9]) && (w.yaw = 0) } } function m(a) { var f = O[a], n = Math.min(1, Math.max((Date.now() - f.startTime) / 1E3 / (f.duration / 1E3), 0)), n = f.startPosition + b.animationTimingFunction(n) * (f.endPosition - f.startPosition); if (f.endPosition > f.startPosition && n >= f.endPosition || f.endPosition < f.startPosition && n <= f.endPosition || f.endPosition === f.startPosition) n = f.endPosition, w[a] = 0, delete O[a]; b[a] = n } function z() { d("resize") } function F() { Ta || (Ta = !0, ca()) } function ca() { if (!Za) if (Fa(), Qa && clearTimeout(Qa), ha || !0 === X) requestAnimationFrame(ca); else if (r[0] || r[1] || r[2] || r[3] || r[4] || r[5] || r[6] || r[7] || r[8] || r[9] || b.autoRotate || O.pitch || O.yaw || O.hfov || 0.01 < Math.abs(w.yaw) || 0.01 < Math.abs(w.pitch) || 0.01 < Math.abs(w.hfov)) ga(), 0 <= b.autoRotateInactivityDelay && Z && Date.now() - N > b.autoRotateInactivityDelay && !b.autoRotate && (b.autoRotate = Z, da.lookAt(Ga, p, ra, 3E3)), requestAnimationFrame(ca); else if (C && (C.isLoading() || !0 === b.dynamic && Ma)) requestAnimationFrame(ca); else { B("animatefinished", {pitch: da.getPitch(), yaw: da.getYaw(), hfov: da.getHfov()}); Ta = !1; ba = p; var a = b.autoRotateInactivityDelay - (Date.now() - N); 0 < a ? Qa = setTimeout(function () { b.autoRotate = Z; da.lookAt(Ga, p, ra, 3E3); F() }, a) : 0 <= b.autoRotateInactivityDelay && Z && (b.autoRotate = Z, da.lookAt(Ga, p, ra, 3E3), F()) } } function Fa() { var a; if (G) { var f = C.getCanvas(); !1 !== b.autoRotate && (360 < b.yaw ? b.yaw -= 360 : -360 > b.yaw && (b.yaw += 360)); a = b.yaw; var n = 0; if (b.avoidShowingBackground) { var c = b.hfov / 2, d = 180 * Math.atan2(Math.tan(c / 180 * Math.PI), f.width / f.height) / Math.PI; b.vaov > b.haov ? Math.min(Math.cos((b.pitch - c) / 180 * Math.PI), Math.cos((b.pitch + c) / 180 * Math.PI)) : n = c * (1 - Math.min(Math.cos((b.pitch - d) / 180 * Math.PI), Math.cos((b.pitch + d) / 180 * Math.PI))) } var c = b.maxYaw - b.minYaw, d = -180, e = 180; 360 > c && (d = b.minYaw + b.hfov / 2 + n, e = b.maxYaw - b.hfov / 2 - n, c < b.hfov && (d = e = (d + e) / 2), b.yaw = Math.max(d, Math.min(e, b.yaw))); !1 === b.autoRotate && (360 < b.yaw ? b.yaw -= 360 : -360 > b.yaw && (b.yaw += 360)); !1 !== b.autoRotate && a != b.yaw && ba !== p && (b.autoRotate *= -1); a = 2 * Math.atan(Math.tan(b.hfov / 180 * Math.PI * 0.5) / (f.width / f.height)) / Math.PI * 180; f = b.minPitch + a / 2; n = b.maxPitch - a / 2; b.maxPitch - b.minPitch < a && (f = n = (f + n) / 2); isNaN(f) && (f = -90); isNaN(n) && (n = 90); b.pitch = Math.max(f, Math.min(n, b.pitch)); C.render(b.pitch * Math.PI / 180, b.yaw * Math.PI / 180, b.hfov * Math.PI / 180, {roll: b.roll * Math.PI / 180}); b.hotSpots.forEach(Ca); b.compass && (Ia.style.transform = "rotate(" + (-b.yaw - b.northOffset) + "deg)", Ia.style.webkitTransform = "rotate(" + (-b.yaw - b.northOffset) + "deg)") } } function Y(a, b, c, d) { this.w = a; this.x = b; this.y = c; this.z = d } function na(a) { var f; f = a.alpha; var c = a.beta; a = a.gamma; c = [c ? c * Math.PI / 180 / 2 : 0, a ? a * Math.PI / 180 / 2 : 0, f ? f * Math.PI / 180 / 2 : 0]; f = [Math.cos(c[0]), Math.cos(c[1]), Math.cos(c[2])]; c = [Math.sin(c[0]), Math.sin(c[1]), Math.sin(c[2])]; f = new Y(f[0] * f[1] * f[2] - c[0] * c[1] * c[2], c[0] * f[1] * f[2] - f[0] * c[1] * c[2], f[0] * c[1] * f[2] + c[0] * f[1] * c[2], f[0] * f[1] * c[2] + c[0] * c[1] * f[2]); f = f.multiply(new Y(Math.sqrt(0.5), -Math.sqrt(0.5), 0, 0)); c = E.orientation ? -E.orientation * Math.PI / 180 / 2 : 0; f = f.multiply(new Y(Math.cos(c), 0, -Math.sin(c), 0)).toEulerAngles(); "number" == typeof X && 10 > X ? X += 1 : 10 === X ? ($a = f[2] / Math.PI * 180 + b.yaw, X = !0, requestAnimationFrame(ca)) : (b.pitch = f[0] / Math.PI * 180, b.roll = -f[1] / Math.PI * 180, b.yaw = -f[2] / Math.PI * 180 + $a) } function va() { try { var a = {}; b.horizonPitch !== p && (a.horizonPitch = b.horizonPitch * Math.PI / 180); b.horizonRoll !== p && (a.horizonRoll = b.horizonRoll * Math.PI / 180); b.backgroundColor !== p && (a.backgroundColor = b.backgroundColor); C.init(P, b.type, b.dynamic, b.haov * Math.PI / 180, b.vaov * Math.PI / 180, b.vOffset * Math.PI / 180, S, a); !0 !== b.dynamic && (P = p) } catch (f) { if ("webgl error" == f.type || "no webgl" == f.type) K(); else if ("webgl size error" == f.type) K(b.strings.textureSizeError.replace("%s", f.width).replace("%s", f.maxWidth)); else throw K(b.strings.unknownError), f; } } function S() { if (b.sceneFadeDuration && C.fadeImg !== p) { C.fadeImg.style.opacity = 0; var a = C.fadeImg; delete C.fadeImg; setTimeout(function () { M.removeChild(a); B("scenechangefadedone") }, b.sceneFadeDuration) } Ia.style.display = b.compass ? "inline" : "none"; L(); q.load.box.style.display = "none"; sa !== p && (M.removeChild(sa), sa = p); G = !0; B("load"); F() } function La(a) { a.pitch = Number(a.pitch) || 0; a.yaw = Number(a.yaw) || 0; var f = g.createElement("div"); f.className = "pnlm-hotspot-base"; f.className = a.cssClass ? f.className + (" " + a.cssClass) : f.className + (" pnlm-hotspot pnlm-sprite pnlm-" + D(a.type)); var c = g.createElement("span"); a.text && (c.innerHTML = D(a.text)); var d; if (a.video) { d = g.createElement("video"); var e = a.video; b.basePath && !qa(e) && (e = b.basePath + e); d.src = I(e); d.controls = !0; d.style.width = a.width + "px"; M.appendChild(f); c.appendChild(d) } else if (a.image) { e = a.image; b.basePath && !qa(e) && (e = b.basePath + e); d = g.createElement("a"); d.href = I(a.URL ? a.URL : e, !0); d.target = "_blank"; c.appendChild(d); var h = g.createElement("img"); h.src = I(e); h.style.width = a.width + "px"; h.style.paddingTop = "5px"; M.appendChild(f); d.appendChild(h); c.style.maxWidth = "initial" } else if (a.URL) { d = g.createElement("a"); d.href = I(a.URL, !0); if (a.attributes) for (e in a.attributes) d.setAttribute(e, a.attributes[e]); else d.target = "_blank"; M.appendChild(d); f.className += " pnlm-pointer"; c.className += " pnlm-pointer"; d.appendChild(f) } else a.sceneId && (f.onclick = f.ontouchend = function () { f.clicked || (f.clicked = !0, y(a.sceneId, a.targetPitch, a.targetYaw, a.targetHfov)); return !1 }, f.className += " pnlm-pointer", c.className += " pnlm-pointer"), M.appendChild(f); if (a.createTooltipFunc) a.createTooltipFunc(f, a.createTooltipArgs); else if (a.text || a.video || a.image) f.classList.add("pnlm-tooltip"), f.appendChild(c), c.style.width = c.scrollWidth - 20 + "px", c.style.marginLeft = -(c.scrollWidth - f.offsetWidth) / 2 + "px", c.style.marginTop = -c.scrollHeight - 12 + "px"; a.clickHandlerFunc && (f.addEventListener("click", function (b) { a.clickHandlerFunc(b, a.clickHandlerArgs) }, "false"), f.className += " pnlm-pointer", c.className += " pnlm-pointer"); a.div = f } function L() { Ua || (b.hotSpots ? (b.hotSpots = b.hotSpots.sort(function (a, b) { return a.pitch < b.pitch }), b.hotSpots.forEach(La)) : b.hotSpots = [], Ua = !0, b.hotSpots.forEach(Ca)) } function e() { var a = b.hotSpots; Ua = !1; delete b.hotSpots; if (a) for (var f = 0; f < a.length; f++) { var c = a[f].div; if (c) { for (; c.parentNode && c.parentNode != M;) c = c.parentNode; M.removeChild(c) } delete a[f].div } } function Ca(a) { var f = Math.sin(a.pitch * Math.PI / 180), c = Math.cos(a.pitch * Math.PI / 180), d = Math.sin(b.pitch * Math.PI / 180), e = Math.cos(b.pitch * Math.PI / 180), g = Math.cos((-a.yaw + b.yaw) * Math.PI / 180), h = f * d + c * g * e; if (90 >= a.yaw && -90 < a.yaw && 0 >= h || (90 < a.yaw || -90 >= a.yaw) && 0 >= h) a.div.style.visibility = "hidden"; else { var l = Math.sin((-a.yaw + b.yaw) * Math.PI / 180), k = Math.tan(b.hfov * Math.PI / 360); a.div.style.visibility = "visible"; var m = C.getCanvas(), p = m.clientWidth, m = m.clientHeight, f = [-p / k * l * c / h / 2, -p / k * (f * e - c * g * d) / h / 2], c = Math.sin(b.roll * Math.PI / 180), d = Math.cos(b.roll * Math.PI / 180), f = [f[0] * d - f[1] * c, f[0] * c + f[1] * d]; f[0] += (p - a.div.offsetWidth) / 2; f[1] += (m - a.div.offsetHeight) / 2; p = "translate(" + f[0] + "px, " + f[1] + "px) translateZ(9999px) rotate(" + b.roll + "deg)"; a.scale && (p += " scale(" + ra / b.hfov / h + ")"); a.div.style.webkitTransform = p; a.div.style.MozTransform = p; a.div.style.transform = p } } function H(a) { b = {}; var f, c, d = "haov vaov vOffset northOffset horizonPitch horizonRoll".split(" "); aa = []; for (f in Va) Va.hasOwnProperty(f) && (b[f] = Va[f]); for (f in k.default) if (k.default.hasOwnProperty(f)) if ("strings" == f) for (c in k.default.strings) k.default.strings.hasOwnProperty(c) && (b.strings[c] = D(k.default.strings[c])); else b[f] = k.default[f], 0 <= d.indexOf(f) && aa.push(f); if (null !== a && "" !== a && k.scenes && k.scenes[a]) { var e = k.scenes[a]; for (f in e) if (e.hasOwnProperty(f)) if ("strings" == f) for (c in e.strings) e.strings.hasOwnProperty(c) && (b.strings[c] = D(e.strings[c])); else b[f] = e[f], 0 <= d.indexOf(f) && aa.push(f); b.scene = a } for (f in k) if (k.hasOwnProperty(f)) if ("strings" == f) for (c in k.strings) k.strings.hasOwnProperty(c) && (b.strings[c] = D(k.strings[c])); else b[f] = k[f], 0 <= d.indexOf(f) && aa.push(f) } function l(a) { if ((a = a ? a : !1) && "preview" in b) { var c = b.preview; b.basePath && !qa(c) && (c = b.basePath + c); sa = g.createElement("div"); sa.className = "pnlm-preview-img"; sa.style.backgroundImage = "url('" + I(c).replace(/"/g, "%22").replace(/'/g, "%27") + "')"; M.appendChild(sa) } var c = b.title, d = b.author; a && ("previewTitle" in b && (b.title = b.previewTitle), "previewAuthor" in b && (b.author = b.previewAuthor)); b.hasOwnProperty("title") || (q.title.innerHTML = ""); b.hasOwnProperty("author") || (q.author.innerHTML = ""); b.hasOwnProperty("title") || b.hasOwnProperty("author") || (q.container.style.display = "none"); v.load.innerHTML = "" + b.strings.loadButtonLabel + "
"; q.load.boxp.innerHTML = b.strings.loadingLabel; for (var e in b) if (b.hasOwnProperty(e)) switch (e) { case "title": q.title.innerHTML = D(b[e]); q.container.style.display = "inline"; break; case "author": var h = D(b[e]); b.authorURL && (h = g.createElement("a"), h.href = I(b.authorURL, !0), h.target = "_blank", h.innerHTML = D(b[e]), h = h.outerHTML); q.author.innerHTML = b.strings.bylineLabel.replace("%s", h); q.container.style.display = "inline"; break; case "fallback": h = g.createElement("a"); h.href = I(b[e], !0); h.target = "_blank"; h.textContent = "Click here to view this panorama in an alternative viewer."; var k = g.createElement("p"); k.textContent = "Your browser does not support WebGL."; k.appendChild(g.createElement("br")); k.appendChild(h); q.errorMsg.innerHTML = ""; q.errorMsg.appendChild(k); break; case "hfov": x(Number(b[e])); break; case "autoLoad": !0 === b[e] && C === p && (q.load.box.style.display = "inline", v.load.style.display = "none", oa()); break; case "showZoomCtrl": v.zoom.style.display = b[e] && !1 != b.showControls ? "block" : "none"; break; case "showFullscreenCtrl": v.fullscreen.style.display = b[e] && !1 != b.showControls && ("fullscreen" in g || "mozFullScreen" in g || "webkitIsFullScreen" in g || "msFullscreenElement" in g) ? "block" : "none"; break; case "hotSpotDebug": Wa.style.display = b[e] ? "block" : "none"; break; case "showControls": b[e] || (v.orientation.style.display = "none", v.zoom.style.display = "none", v.fullscreen.style.display = "none"); break; case "orientationOnByDefault": b[e] && Ra() } a && (c ? b.title = c : delete b.title, d ? b.author = d : delete b.author) } function h() { if (G && !Na) if (Aa) g.exitFullscreen ? g.exitFullscreen() : g.mozCancelFullScreen ? g.mozCancelFullScreen() : g.webkitCancelFullScreen ? g.webkitCancelFullScreen() : g.msExitFullscreen && g.msExitFullscreen(); else try { s.requestFullscreen ? s.requestFullscreen() : s.mozRequestFullScreen ? s.mozRequestFullScreen() : s.msRequestFullscreen ? s.msRequestFullscreen() : s.webkitRequestFullScreen() } catch (a) { } } function d(a) { g.fullscreenElement || g.fullscreen || g.mozFullScreen || g.webkitIsFullScreen || g.msFullscreenElement ? (v.fullscreen.classList.add("pnlm-fullscreen-toggle-button-active"), Aa = !0) : (v.fullscreen.classList.remove("pnlm-fullscreen-toggle-button-active"), Aa = !1); "resize" !== a && B("fullscreenchange", Aa); C.resize(); x(b.hfov); F() } function u(a) { var c = b.minHfov; "multires" == b.type && C && !b.multiResMinHfov && (c = Math.min(c, C.getCanvas().width / (b.multiRes.cubeResolution / 90 * 0.9))); if (c > b.maxHfov) return console.log("HFOV bounds do not make sense (minHfov > maxHfov)."), b.hfov; var d = b.hfov, d = a < c ? c : a > b.maxHfov ? b.maxHfov : a; b.avoidShowingBackground && C && (a = C.getCanvas(), d = Math.min(d, 360 * Math.atan(Math.tan((b.maxPitch - b.minPitch) / 360 * Math.PI) / a.height * a.width) / Math.PI)); return d } function x(a) { b.hfov = u(a); B("zoomchange", b.hfov) } function t() { O = {}; Z = b.autoRotate ? b.autoRotate : Z; b.autoRotate = !1 } function Ya() { Na && (q.load.box.style.display = "none", q.errorMsg.style.display = "none", Na = !1, M.style.display = "block", B("errorcleared")); G = !1; v.load.style.display = "none"; q.load.box.style.display = "inline"; oa() } function y(a, c, d, h, g) { G || (g = !0); G = !1; O = {}; var m, q; if (b.sceneFadeDuration && !g && (m = C.render(b.pitch * Math.PI / 180, b.yaw * Math.PI / 180, b.hfov * Math.PI / 180, {returnImage: !0}), m !== p)) { g = new Image; g.className = "pnlm-fade-img"; g.style.transition = "opacity " + b.sceneFadeDuration / 1E3 + "s"; g.style.width = "100%"; g.style.height = "100%"; g.onload = function () { y(a, c, d, h, !0) }; g.src = m; M.appendChild(g); C.fadeImg = g; return } g = "same" === c ? b.pitch : c; m = "same" === d ? b.yaw : "sameAzimuth" === d ? b.yaw + (b.northOffset || 0) - (k.scenes[a].northOffset || 0) : d; q = "same" === h ? b.hfov : h; e(); H(a); w.yaw = w.pitch = w.hfov = 0; l(); g !== p && (b.pitch = g); m !== p && (b.yaw = m); q !== p && (b.hfov = q); B("scenechange", a); Ya() } function Da() { E.removeEventListener("deviceorientation", na); v.orientation.classList.remove("pnlm-orientation-button-active"); X = !1 } function Ra() { "function" === typeof DeviceMotionEvent.requestPermission ? DeviceOrientationEvent.requestPermission().then(function (a) { "granted" == a && (X = 1, E.addEventListener("deviceorientation", na), v.orientation.classList.add("pnlm-orientation-button-active")) }) : (X = 1, E.addEventListener("deviceorientation", na), v.orientation.classList.add("pnlm-orientation-button-active")) } function D(a) { return k.escapeHTML ? String(a).split(/&/g).join("&").split('"').join(""").split("'").join("'").split("<").join("<").split(">").join(">").split("/").join("/").split("\n").join("