/*! For license information please see HOUSEPLAY.js.LICENSE.txt */ ! function(t, e) { "object" == typeof exports && "object" == typeof module ? module.exports = e() : "function" == typeof define && define.amd ? define([], e) : "object" == typeof exports ? exports.HOUSEPLAY = e() : t.HOUSEPLAY = e() }(window, (function() { return function(t) { var e = {}; function i(n) { if (e[n]) return e[n].exports; var r = e[n] = { i: n, l: !1, exports: {} }; return t[n].call(r.exports, r, r.exports, i), r.l = !0, r.exports } return i.m = t, i.c = e, i.d = function(t, e, n) { i.o(t, e) || Object.defineProperty(t, e, { enumerable: !0, get: n }) }, i.r = function(t) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t, "__esModule", { value: !0 }) }, i.t = function(t, e) { if (1 & e && (t = i(t)), 8 & e) return t; if (4 & e && "object" == typeof t && t && t.__esModule) return t; var n = Object.create(null); if (i.r(n), Object.defineProperty(n, "default", { enumerable: !0, value: t }), 2 & e && "string" != typeof t) for (var r in t) i.d(n, r, function(e) { return t[e] }.bind(null, r)); return n }, i.n = function(t) { var e = t && t.__esModule ? function() { return t.default } : function() { return t }; return i.d(e, "a", e), e }, i.o = function(t, e) { return Object.prototype.hasOwnProperty.call(t, e) }, i.p = "", i(i.s = 77) }([function(t, e, i) { "use strict"; // threejs }, function(t, e, i) { var n = i(0), r = i(3), o = i(5), a = i(101), s = i(102), l = i(24), u = i(15), h = i(7), c = i(25), d = i(26), p = { delBK: !0, delBKEdit: !1, isNewServerPreviewVersion: !1, isNewEditVersion: !1, isCleanUI: 0, jfedit: !1, screenshot: !1, unit_type: 0, unit_conversion_value: 1, unit_name: "m", unit_sq_name: "m²", debug: !1, isLocalVersion: !1, vrDebug: !1, fpsOn: !1, adjustCompass: !1, adjustColor: !1, newbarrage: !0, wscdn: !0, thirdCustomer: -1, version: "2.11.9-0-ga9537d5", pageTitle: "众趣科技", authorizationHeader: c.getAuthorizationHeader(), autoplay: r.valueFromHash("play", !0), logLevel: r.valueFromHash("log", 2), showLog: r.valueFromHash("db", 0), skyboxRadius: 250, modelBoundsPadding: 5, showNeighbors: !1, brand: r.valueFromHash("brand", !0), mls: r.valueFromHash("mls", 0), showHighlights: r.valueFromHash("hhl", !0), startHighlights: r.valueFromHash("hl", !1), specialEdition: r.valueFromHash("bn", 0), showTitleContainer: r.valueFromHash("title", !0), useWheel: r.valueFromHash("wh", !0), crossOrigin: "anonymous", fancierTransition: !0, wireframe: !0, skyboxWireframe: !0, modelAlpha: 1, highlightPanoSelection: !1, showSweeps: !0, showSkyboxes: !0, showMesh: !0, showFloors: !0, showFloorDuration: 300, showFloorDelay: 300, hideFloorDuration: 300, hideFloorDelay: 0, reticuleOpacityTransitionTime: 250, reticuleColor: s.yellow, markerOpacityTransitionTime: 500, guiAnimationSpeed: 250, highlightAnimationDuration: 500, barfadeAnimationDuration: 300, modelComponentLoadSpinnerDelay: 150, captureErrors: !1, maxMobileTextures: 10, startupFlyinDelay: 3e3, dollhouseDefault: { minDistance: 5, maxDistance: 50, minPolarAngle: n.Math.degToRad(10), maxPolarAngle: n.Math.degToRad(65) }, hideReticuleTimeout: 1e3, titletagMaxdistance: 5, analytics: { inactivityThreshold: 30, sessionTrackingRate: .15, maxTrackedErrors: 20, sessionDurationPingFrequency: 10, sessionDurationTimeout: 15 }, flydown: { movementEasing: "easeInOutQuad", movementDelay: .001, rotationEasing: "easeInOutQuad", rotationDelay: .5, modelTextureDelay: .75, skyboxDelay: .75 }, transition: { flySpeed: .01, flyTime: 800, flytimeMaxDistanceThreshold: 5, flytimeDistanceMultiplier: 150, aimTime: 1150, aimSlowFactor: 1.5, blur: .2, movementEasing: "easeInOutQuad", blendEasing: "easeInOutQuad", fastForwardFactor: 1 }, show360Views: { enabled: !0, transitionTime: 1e3 }, quickstart: { enabled: 1 === r.valueFromHash("qs", 0), animation: 1e3, showTextDelay: 500, fadeOutDelay: 1e3, fovChange: 10 }, vr: { enabled: !1, option: r.valueFromHash("vr", a.CONTEXTUAL) }, mattertags: { enabled: !0, enableLinking: !0, enablePanoSize: !0, startup: { hideUntilStart: !1, fadeInDuration: 500, fadeInDelay: 100 }, visibility: { anyDistance: !0, visibleDistance: 8, cameraClearance: .1, alphaTestLevel: .05, hideViaFloor: !0, hideOffScreenDisc: !1, hideOffScreenObject: !1 }, disc: { opacity: .9, disabledOpacity: .5, scale: { nearBound: 1.5, farBound: 4.8, linkFarBound: !1, linkPercent: 40, maxSize: 80, minSize: 40, baseViewportSize: 800, buildingViewportSize: 300, responsiveness: 100 } }, pole: { enabled: !0, height: .5, width: 2, opacity: .5, color: "white" }, animation: { hoverOnClosing: !1, animInDelay: 100, animOutDelay: 50, animInTime: 200, animOutTime: 100 }, boardScale: { billboardScale: 1, scaleToDisc: !0, boardToDiscRatio: 1.2 }, navigate: { nearestPano: !0, lineOfSight: !0, reactivate: !0, aimAt: "disc", tiltTolerance: 25, rotateSpeedFactor: .6 } }, path: { color: s.white, colorUp: s._desat(s.white, .5), colorDown: s._darken(s.white, .35), opacity: .5, style: "ribbon", height: .025, ribbonWidth: .24, outsideHeight: .5, waypointRadius: .5, waypointIndoorRadius: .24, waypointPulse: 1e3, typ: l.BLACK, meshFree: r.valueFromHash("mf", 0), mapGuides: r.valueFromHash("guides", !0), fadeInTime: 400, fadeOutTime: 300 }, warp: { nearPanoDist: .1, matchCam: !1, blur: .33, fastTime: 1500, teleportTime: 1500, outsideTime: 2e3, lookAheadMax: .3, lookAheadDist: 2.5, softPushDist: .37, softPushEnd: .3, softBendAngle: 8, softBendTilt: 4, softBendEnd: .3, doBurns: r.valueFromHash("kb", !0), burnsAngle: 15, minBurnsAngle: 6, minDownAngle: -35, maxTurnPerSec: 280, maxAimPerSec: 45, minRotation: 12, maxAimRotation: 33.2, turnFriction: .2, flySpeed: .01, minWarpTime: 1200, warpInterruptionRedirectTime: 500, tourStepDelay: r.valueFromHash("st", 5e3), walkDelay: 0, walkMaxDist: 50, walkSlideShowThreshhold: 3e3, walkExtraPanosDistance: .4, timePerMeter: 800, motionLeadTime: 500, movementEasing: "easeInOutQuad", blendEasing: "easeInOutQuad", showBunny: !1, loop: r.valueFromHash("lp", !0), auto: r.valueFromHash("ts", -1), eOrder: "YXZ", stepFactor: .25, brakeStrength: 2, minBrakeAngle: .1, maxBrakeAngle: 1.8, climbEffort: 4, waitMultiplier1: 4, waitMultiplier2: 4 }, rotationFriction: .06, rotationAccelerationInside: 4.5, rotationAccelerationOutside: .15, rotationAfterMoveMultiplier: 60, rotationAfterMoveHistoryCount: 5, panFriction: .09, panAccelerationOutside: 60, onload: r.valueFromHash("onload", o.PANORAMA), zoomNearLimit: .1, zoomFarLimit: 10, navigation: { panoScores: !1, mouseDirection: !0, filterStrictness: .75, angleFactor: -30, directionFactor: 10, distanceFactor: -1, optionalityFactor: 3 }, secretPanelWord: [38, 38, 40, 40, 37, 39, 37, 39, 66, 65], console: r.valueFromHash("console", !1), noMeshFloorPositionOffset: new n.Vector3(0, -1.2, 0), panoramaNeighbourMaxDistance: 5, panoFloorClickRadius: .7, showScreenshotLocations: !1, showAxis: !0, showNeighbourRaycasts: !1, colorMarkerOnLoad: !1, colorMarkerByFloor: !1, tiling: { panoPreRenderRepeatDelay: 2500, panoPreRenderDelay: 500, preRenderTourPanos: r.valueFromHash("tileprerender", 0), tilingFlagNames: ["usetiles", "tiles"], maxNavPanoQuality: r.valueFromHash("maxtileq", null), maxZoomPanoQuality: r.valueFromHash("maxztileq", null), overlayStyle: r.valueFromHash("tileoverlay", 0), uploadIntervalDelay: r.valueFromHash("tileupdelay", 10), initialIntervalDelay: r.valueFromHash("itiledelay", 0), maxNonBaseUploadsPerFrame: r.valueFromHash("maxnbtpf", 2), maxBaseUploadsPerFrame: r.valueFromHash("maxbtpf", 6), customCompression: r.valueFromHash("tilecustcomp", 0), mobileHighQualityOverride: !1, allowUltraHighResolution: !1 }, zoom: { enabled: !0, max: r.valueFromHash("maxzoom", 8), min: r.valueFromHash("minzoom", 1), transitionStyle: r.valueFromHash("zoomtrans", 1), restoreTime: 500, activationThreshold: 1.1 }, panoramaSettings: { loading_2k: !1, screenshot_2k: !1, loading_fov82: !1, screenshot_fov82: !1 } }; (p = h.deepExtend(p, d, { panorama: { transitionTime: 1300, modelAlpha: 0, modelAlphaDelay: p.flydown.modelTextureDelay, modelAlphaLength: 1, skyboxOpacity: 1, skyboxOpacityDelay: p.flydown.skyboxDelay, skyboxOpacityLength: .9, fovLength: 1, fovDelay: 0, cameraMatrixDuration: .8, cameraMatrixDelay: 0, cameraMatrixEase: u.easeInCubic, reticuleOpacity: 1, markerOpacity: .6, markerOpacityOnHover: 1 }, dollhouse: { transitionTime: 1200, modelAlpha: 1, modelAlphaDelay: 0, modelAlphaLength: 1 - p.flydown.modelTextureDelay, skyboxOpacity: 0, skyboxOpacityDelay: 0, skyboxOpacityLength: 1 - p.flydown.skyboxDelay, fovLength: 1, fovDelay: 0, cameraMatrixDuration: .8, cameraMatrixDelay: .3, cameraMatrixEase: u.easeInCubic, reticuleOpacity: 1, markerOpacity: 0, markerOpacityOnHover: 0 }, floorplan: { transitionTime: 1e3, modelAlpha: 1, modelAlphaDelay: 0, modelAlphaLength: 1 - p.flydown.modelTextureDelay, skyboxOpacity: 0, skyboxOpacityDelay: 0, skyboxOpacityLength: 1 - p.flydown.skyboxDelay, fovLength: 1, fovDelay: 0, cameraMatrixDuration: .5, cameraMatrixDelay: 0, cameraMatrixEase: u.easeOutCubic, reticuleOpacity: 1, markerOpacity: 0, markerOpacityOnHover: 0 }, transitioning: { reticuleOpacity: 0 }, "floorplan-dollhouse": { rotationDelay: 0, rotationDuration: 1 }, "floorplan-panorama": { rotationDelay: .5, rotationDuration: 1 }, "dollhouse-panorama": { rotationDelay: .6, rotationDuration: 1 }, "dollhouse-floorplan": { rotationDelay: 0, rotationDuration: 1, cameraMatrixDuration: 1.05, cameraMatrixDelay: .5 }, "panorama-dollhouse": { rotationDelay: 0, rotationDuration: .4 }, "panorama-floorplan": { transitionTime: 1500, rotationDelay: 0, rotationDuration: .5 } })) .path.meshFree && (p.path.typ = l.WALK), t.exports = p }, function(t, e, i) { (function(e) { var i = window.Raven; function n(t) { var r, o, a, s, l = t.split("/"), u = "[" + l[l.length - 1].replace(".js", "") + "]", h = {}; if (n.consoleEnabled) { var c = function(t) { e("#debug-console") .append("

" + t + "

"), e("#debug-console")[0].scrollTop = e("#debug-console")[0].scrollHeight }; r = function(t) { c(Array.prototype.slice.call(arguments) .join(" ")) }, o = function(t) { c(Array.prototype.slice.call(arguments) .join(" ")) }, a = function(t) { c("WARN: " + Array.prototype.slice.call(arguments) .join(" ")) }, s = function(t) { c("ERROR: " + Array.prototype.slice.call(arguments) .join(" ")) } } else console.debug ? (r = console.debug, o = console.info ? console.info : console.debug, a = console.warn ? console.warn : console.debug, s = console.error ? console.error : console.debug) : r = o = a = s = function() {}; var d = function(t) { return [u, n.timestamp()].concat(Array.prototype.slice.call(t)) }, p = function(e, r) { if (i) { var o = Array.prototype.slice.call(e) .join(" "); i.captureMessage(o, { level: r, path: t, timestamp: n.timestamp() }) } }, f = function(e, r) { if (i) { var o = Array.prototype.slice.call(e) .join(" "); i.captureException(new Error(o), { level: r, path: t, timestamp: n.timestamp() }) } }; return { debug: function() { n.level >= n.levels.debug && r.appply(console, d(arguments)) }, info: function() { n.level >= n.levels.info && o.apply(console, d(arguments)) }, warn: function() { p(arguments, "warn"), n.level >= n.levels.warn && a.apply(console, d(arguments)) }, error: function() { f(arguments, "error"), n.level >= n.levels.error && s.apply(console, d(arguments)) }, v3str: function(t, e) { var i = void 0 === e ? 2 : e; return "(" + t.x.toPrecision(i) + ", " + t.y.toPrecision(i) + ", " + t.z.toPrecision(i) + ")" }, eulstr: function(t, e) { var i = void 0 === e ? 2 : e; return "(" + THREE.Math.radToDeg(t.x) .toPrecision(i) + ", " + THREE.Math.radToDeg(t.y) .toPrecision(i) + ", " + THREE.Math.radToDeg(t.z) .toPrecision(i) + ' "' + t.order + '")' }, time: function(t) { n.level >= n.levels.debug && (h[t] = Date.now()) }, timeEnd: function(t) { if (n.level >= n.levels.debug) { var e = h[t]; if (!e) return; var i = (Date.now() - e) / 1e3; this.debug(t, i + "s") } } } } n.timestamp = function() { return (Date.now() - window.navigationStart) / 1e3 + "s" }, n.levels = { debug: 3, info: 2, warn: 1, error: 0 }, n.level = n.levels.info, t.exports = n }) .call(this, i(6)) }, function(t, e, i) { (function(e) { function n(t, e) { var i = window.navigator.userAgent.match(t); return i = i ? i[1].split(e) : [], { major: parseInt(i[0]) || 0, minor: parseInt(i[1]) || 0, patch: parseInt(i[2]) || 0 } } var r = i(99); t.exports = { isFullscreen: function() { return document.fullscreenElement || document.mozFullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement }, supportsFullscreen: function() { return document.fullscreenEnabled || document.mozFullscreenEnabled || document.mozFullScreenEnabled || document.webkitFullscreenEnabled || document.msFullscreenEnabled }, isPointerLocked: function() { return document.pointerLockElement || document.mozPointerLockElement || document.webkitPointerLockElement }, requestFullscreen: function(t, i) { t.requestFullscreen ? t.requestFullscreen() : t.mozRequestFullScreen ? t.mozRequestFullScreen() : t.webkitRequestFullscreen ? t.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT) : t.msRequestFullscreen && t.msRequestFullscreen(), i && e(document) .on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", browser.requestPointerLock) }, requestPointerLock: function() { var t; if (document.fullscreenElement) t = document.fullscreenElement(); else if (document.mozFullscreenElement) t = document.mozFullscreenElement(); else if (document.mozFullScreenElement) t = document.mozFullScreenElement(); else { if (!document.webkitFullscreenElement) return; t = document.webkitFullscreenElement() } t.requestPointerLock = t.requestPointerLock || t.mozRequestPointerLock || t.webkitRequestPointerLock, t.requestPointerLock(), e(document) .off("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", this) }, exitPointerLock: function() { document.exitPointerLock = document.exitPointerLock || document.mozExitPointerLock || document.webkitExitPointerLock, document.exitPointerLock() }, exitFullscreen: function() { document.exitFullscreen ? document.exitFullscreen() : document.msExitFullscreen ? document.msExitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.webkitExitFullscreen && document.webkitExitFullscreen() }, details: function() { var t = navigator.userAgent.match("(Firefox|Chrome|Safari)/([\\d]+)"); return t ? { name: t[1], version: parseInt(t[2]), platform: navigator.platform } : {} }, is: function(t) { return this.details() && this.details() .name === t }, inIframe: function() { return window.parent !== window }, aspectRatio: function() { var t = (window.renderWidth || window.innerWidth) / (window.renderHeight || window.innerHeight); return isFinite(t) ? t : 0 }, userAgent: function() { return window.navigator.userAgent }, isMobile: function() { var t = navigator.userAgent || navigator.vendor || window.opera; return /(android|bb\d+|meego).+mobile|android|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od|ad)|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(t) || /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(t.substr(0, 4)) }, isWeixin: function() { return "micromessenger" == navigator.userAgent.toLowerCase() .match(/MicroMessenger/i) }, isSmallScreen: function() { return screen.width / window.devicePixelRatio < 240 }, detectIE: function() { return -1 !== window.navigator.userAgent.indexOf("MSIE ") || !!navigator.userAgent.match(/Trident.*rv\:11\./) }, detectSafari: function() { return -1 !== window.navigator.userAgent.indexOf("Safari") && !this.detectChrome() }, detectFirefox: function() { return -1 !== window.navigator.userAgent.indexOf("Firefox") }, detectChrome: function() { return -1 !== window.navigator.userAgent.indexOf("Chrome") && !this.detectOpera() }, detectOpera: function() { return -1 !== window.navigator.userAgent.indexOf("OPR") }, detectIOS: function() { var t = window.navigator.userAgent; return /iPad|iPhone|iPod/.test(t) }, detectAndroid: function() { return -1 !== window.navigator.userAgent.indexOf("Android") }, detectAndroidMobile: function() { var t = window.navigator.userAgent; return this.detectAndroid() && -1 !== t.indexOf("Mobile") }, detectSamsungNative: function() { var t = window.navigator.userAgent; return -1 !== t.indexOf("SM-G900H") || -1 !== t.indexOf("GT-I9500") || -1 !== t.indexOf("SM-N900") }, detectSamsungS6: function() { return -1 !== window.navigator.userAgent.indexOf("SM-G92") }, detectHUAWEI5X: function() { return -1 !== window.navigator.userAgent.indexOf("KIW-TL00H") }, iosVersion: function() { if (!this.detectIOS()) throw new r("Did not detect an iDevice"); return n(/((?:\d+\_?){1,3}) like Mac OS/, "_") }, androidVersion: function() { if (!this.detectAndroid()) throw new r("Did not detect an Android based device"); return n(/Android ((?:\d+\.?){1,3})/, ".") }, valueFromCookie: function(t, e) { var i = new RegExp(t + "=([0-9a-f]+)(; ?|$)") .exec(document.cookie); if (!i) return e; var n = i[1]; return "boolean" == typeof e ? "true" === n || "1" === n : "number" == typeof e ? parseFloat(n) : n }, valueFromHash: function(t, e) { var i = new RegExp("[#&?]" + t + "=([^#&?]*)") .exec(window.location.href); if (!i) return e; var n = i[1]; return "boolean" == typeof e ? "true" === n || "1" === n : "number" == typeof e ? parseFloat(n) : window.decodeURIComponent(n) }, getAllValueFromSearch: function() { var t = window.location.search, e = {}; if (-1 !== t.indexOf("?")) for (var i = t.substr(1) .split("&"), n = "", r = 0; r < i.length; r++) e[(n = i[r].split("="))[0]] = unescape(n[1]); return e }, getQueryString: function(t) { var e = new RegExp("(^|&)" + t + "=([^&]*)(&|$)", "i"), i = window.location.search.substr(1) .match(e); return null != i ? decodeURI(i[2]) : null }, is_weixin: function() { return !!(-1 != navigator.userAgent.toLowerCase() .indexOf("micromessenger")) }, getUuid: function() { function t() { return (65536 * (1 + Math.random()) | 0) .toString(16) .substring(1) } return t() + t() + "-" + t() + "-" + t() + "-" + t() + "-" + t() + t() + t() }, changeURLArg: function(t, e, i) { var n = e + "=([^&]*)", r = e + "=" + i; if (t.match(n)) { var o = "(" + e + "=)([^&]*)", a = new RegExp(o, "gi"); return o = t.replace(a, r) } return t.match("[?]") ? t + "&" + r : t + "?" + r } } }) .call(this, i(6)) }, function(t, e, i) { "use strict"; var n, r = "object" == typeof Reflect ? Reflect : null, o = r && "function" == typeof r.apply ? r.apply : function(t, e, i) { return Function.prototype.apply.call(t, e, i) }; n = r && "function" == typeof r.ownKeys ? r.ownKeys : Object.getOwnPropertySymbols ? function(t) { return Object.getOwnPropertyNames(t) .concat(Object.getOwnPropertySymbols(t)) } : function(t) { return Object.getOwnPropertyNames(t) }; var a = Number.isNaN || function(t) { return t != t }; function s() { s.init.call(this) } t.exports = s, t.exports.once = function(t, e) { return new Promise((function(i, n) { function r(i) { t.removeListener(e, o), n(i) } function o() { "function" == typeof t.removeListener && t.removeListener("error", r), i([].slice.call(arguments)) } v(t, e, o, { once: !0 }), "error" !== e && function(t, e, i) { "function" == typeof t.on && v(t, "error", e, i) }(t, r, { once: !0 }) })) }, s.EventEmitter = s, s.prototype._events = void 0, s.prototype._eventsCount = 0, s.prototype._maxListeners = void 0; var l = 10; function u(t) { if ("function" != typeof t) throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof t) } function h(t) { return void 0 === t._maxListeners ? s.defaultMaxListeners : t._maxListeners } function c(t, e, i, n) { var r, o, a; if (u(i), void 0 === (o = t._events) ? (o = t._events = Object.create(null), t._eventsCount = 0) : (void 0 !== o.newListener && (t.emit("newListener", e, i.listener ? i.listener : i), o = t._events), a = o[e]), void 0 === a) a = o[e] = i, ++t._eventsCount; else if ("function" == typeof a ? a = o[e] = n ? [i, a] : [a, i] : n ? a.unshift(i) : a.push(i), (r = h(t)) > 0 && a.length > r && !a.warned) { a.warned = !0; var s = new Error("Possible EventEmitter memory leak detected. " + a.length + " " + String(e) + " listeners added. Use emitter.setMaxListeners() to increase limit"); s.name = "MaxListenersExceededWarning", s.emitter = t, s.type = e, s.count = a.length, console && console.warn } return t } function d() { if (!this.fired) return this.target.removeListener(this.type, this.wrapFn), this.fired = !0, 0 === arguments.length ? this.listener.call(this.target) : this.listener.apply(this.target, arguments) } function p(t, e, i) { var n = { fired: !1, wrapFn: void 0, target: t, type: e, listener: i }, r = d.bind(n); return r.listener = i, n.wrapFn = r, r } function f(t, e, i) { var n = t._events; if (void 0 === n) return []; var r = n[e]; return void 0 === r ? [] : "function" == typeof r ? i ? [r.listener || r] : [r] : i ? function(t) { for (var e = new Array(t.length), i = 0; i < e.length; ++i) e[i] = t[i].listener || t[i]; return e }(r) : g(r, r.length) } function m(t) { var e = this._events; if (void 0 !== e) { var i = e[t]; if ("function" == typeof i) return 1; if (void 0 !== i) return i.length } return 0 } function g(t, e) { for (var i = new Array(e), n = 0; n < e; ++n) i[n] = t[n]; return i } function v(t, e, i, n) { if ("function" == typeof t.on) n.once ? t.once(e, i) : t.on(e, i); else { if ("function" != typeof t.addEventListener) throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof t); t.addEventListener(e, (function r(o) { n.once && t.removeEventListener(e, r), i(o) })) } } Object.defineProperty(s, "defaultMaxListeners", { enumerable: !0, get: function() { return l }, set: function(t) { if ("number" != typeof t || t < 0 || a(t)) throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + t + "."); l = t } }), s.init = function() { void 0 !== this._events && this._events !== Object.getPrototypeOf(this) ._events || (this._events = Object.create(null), this._eventsCount = 0), this._maxListeners = this._maxListeners || void 0 }, s.prototype.setMaxListeners = function(t) { if ("number" != typeof t || t < 0 || a(t)) throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + t + "."); return this._maxListeners = t, this }, s.prototype.getMaxListeners = function() { return h(this) }, s.prototype.emit = function(t) { for (var e = [], i = 1; i < arguments.length; i++) e.push(arguments[i]); var n = "error" === t, r = this._events; if (void 0 !== r) n = n && void 0 === r.error; else if (!n) return !1; if (n) { var a; if (e.length > 0 && (a = e[0]), a instanceof Error) throw a; var s = new Error("Unhandled error." + (a ? " (" + a.message + ")" : "")); throw s.context = a, s } var l = r[t]; if (void 0 === l) return !1; if ("function" == typeof l) o(l, this, e); else { var u = l.length, h = g(l, u); for (i = 0; i < u; ++i) o(h[i], this, e) } return !0 }, s.prototype.addListener = function(t, e) { return c(this, t, e, !1) }, s.prototype.on = s.prototype.addListener, s.prototype.prependListener = function(t, e) { return c(this, t, e, !0) }, s.prototype.once = function(t, e) { return u(e), this.on(t, p(this, t, e)), this }, s.prototype.prependOnceListener = function(t, e) { return u(e), this.prependListener(t, p(this, t, e)), this }, s.prototype.removeListener = function(t, e) { var i, n, r, o, a; if (u(e), void 0 === (n = this._events)) return this; if (void 0 === (i = n[t])) return this; if (i === e || i.listener === e) 0 == --this._eventsCount ? this._events = Object.create(null) : (delete n[t], n.removeListener && this.emit("removeListener", t, i.listener || e)); else if ("function" != typeof i) { for (r = -1, o = i.length - 1; o >= 0; o--) if (i[o] === e || i[o].listener === e) { a = i[o].listener, r = o; break } if (r < 0) return this; 0 === r ? i.shift() : function(t, e) { for (; e + 1 < t.length; e++) t[e] = t[e + 1]; t.pop() }(i, r), 1 === i.length && (n[t] = i[0]), void 0 !== n.removeListener && this.emit("removeListener", t, a || e) } return this }, s.prototype.off = s.prototype.removeListener, s.prototype.removeAllListeners = function(t) { var e, i, n; if (void 0 === (i = this._events)) return this; if (void 0 === i.removeListener) return 0 === arguments.length ? (this._events = Object.create(null), this._eventsCount = 0) : void 0 !== i[t] && (0 == --this._eventsCount ? this._events = Object.create(null) : delete i[t]), this; if (0 === arguments.length) { var r, o = Object.keys(i); for (n = 0; n < o.length; ++n) "removeListener" !== (r = o[n]) && this.removeAllListeners(r); return this.removeAllListeners("removeListener"), this._events = Object.create(null), this._eventsCount = 0, this } if ("function" == typeof(e = i[t])) this.removeListener(t, e); else if (void 0 !== e) for (n = e.length - 1; n >= 0; n--) this.removeListener(t, e[n]); return this }, s.prototype.listeners = function(t) { return f(this, t, !0) }, s.prototype.rawListeners = function(t) { return f(this, t, !1) }, s.listenerCount = function(t, e) { return "function" == typeof t.listenerCount ? t.listenerCount(e) : m.call(t, e) }, s.prototype.listenerCount = m, s.prototype.eventNames = function() { return this._eventsCount > 0 ? n(this._events) : [] } }, function(t, e, i) { var n = i(100); t.exports = { PANORAMA: "panorama", DOLLHOUSE: "dollhouse", FLOORPLAN: "floorplan", MESH: "mesh", OUTDOOR: "outdoor", TRANSITIONING: "transitioning", toInt: function(t) { switch (t) { case this.PANORAMA: return 1; case this.DOLLHOUSE: return 2; case this.FLOORPLAN: return 3; case this.OUTDOOR: return 4; case this.TRANSITIONING: return -1 } throw new n("No known conversion for Viewmode to int for mode: " + t) }, fromInt: function(t) { switch (t) { case "1": case 1: return this.PANORAMA; case "2": case 2: return this.DOLLHOUSE; case "3": case 3: return this.FLOORPLAN; case "4": case 4: return this.OUTDOOR } throw new n("No known conversion for int to viewmode for int: " + t) }, convertWorkshopModeInt: function(t) { switch (t) { case "0": case 0: return this.PANORAMA; case "1": case 1: return this.FLOORPLAN; case "2": case 2: return this.DOLLHOUSE; case "3": case 3: return this.MESH } throw new n("No known conversion for Workshop int to viewmode for int: " + t) } } }, function(t, e, i) { // jquery 3.7.0 }, function(t, e, i) { var n = i(0); t.exports = { normalizeUrl: function(t) { return t.replace("https://", "http://") }, domainFromUrl: function(t) { var e = /^([^:]*:\/\/)?(www\.)?([^\/]+)/.exec(t); return e ? e[3] : t }, average: function(t, e) { if (0 === t.length) return null; for (var i = 0, n = 0, r = 0; r < t.length; r++) { i += e ? t[r][e] : t[r], n++ } return i / n }, countUnique: function(t) { for (var e = {}, i = 0; i < t.length; i++) e[t[i]] = 1 + (e[t[i]] || 0); return Object.keys(e) .length }, averageVectors: function(t, e) { var i = new n.Vector3; if (0 === t.length) return i; for (var r = 0, o = 0; o < t.length; o++) { var a = e ? t[o][e] : t[o]; i.add(a), r++ } return i.divideScalar(r) }, equalLists: function(t, e) { if (t.length !== e.length) return !1; for (var i = 0; i < t.length; i++) if (t[i] !== e[i]) return !1; return !0 }, lowerMedian: function(t, e) { return 0 === t.length ? null : (e = e || 2, t.sort((function(t, e) { return t - e })), t[Math.floor(t.length / e)]) }, stableSort: function(t, e) { return t.map((function(t, e) { return { value: t, index: e } })) .sort((function(t, i) { var n = e(t.value, i.value); return 0 !== n ? n : t.index - i.index })) .map((function(t) { return t.value })) }, filterAll: function(t, e) { return t.filter((function(t) { return e.every((function(e) { return e(t) })) })) }, formatDate: function(t) { return [t.getFullYear(), t.getMonth() + 1, t.getDate()].join("-") }, formatDatetime: function(t) { return [t.getFullYear(), t.getMonth() + 1, t.getDate(), t.getHours(), t.getMinutes()].join("-") }, randomString: function(t) { for (var e = "", i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", n = 0; n < t; n++) e += i.charAt(Math.floor(Math.random() * i.length)); return e }, nth: function(t) { return 1 == (t %= 10) ? t + "st" : 2 == t ? t + "nd" : 3 == t ? t + "rd" : t + "th" }, extendObject: function(t, e) { return Object.keys(e) .forEach((function(i) { t[i] = e[i] })), t }, deepExtend: function t(e) { e = e || {}; for (var i = 1; i < arguments.length; i++) { var n = arguments[i]; if (n) for (var r in n) n.hasOwnProperty(r) && ("object" == typeof n[r] ? e[r] = t(e[r], n[r]) : e[r] = n[r]) } return e }, inherit: function(t, e) { t.prototype = Object.create(e.prototype), t.prototype.constructor = t }, extend: function(t, e) { for (var i in e.prototype) t.prototype[i] = e.prototype[i] } }, Math.sign = function(t) { return t < 0 ? -1 : 1 } }, function(t, e, i) { var n = i(15); t.exports = { globalDone: null, funcs: [], counter: 0, uniqueID: 0, start: function(t, e, i, r, o, a, s) { return r = r || 0, this.funcs.push({ func: t, current: -r * Math.abs(e), duration: (1 - Math.max(r, 0)) * Math.abs(e), done: i, easing: o || n.linearTween, cycling: e < 0, running: !0, debug: r < 0, name: a || "T" + this.counter, id: void 0 === s ? this.counter : s, paused: !1 }), t(0, 16), this.counter += 1, t }, trigger: function(t) { var e = void 0 === t.delayRatio ? 0 : t.delayRatio, i = t.func || function() {}, r = void 0 === t.duration ? 0 : t.duration; void 0 !== t.cycling && t.cycling && (r = -Math.abs(r)); var o = t.done || null, a = t.easing || n.linearTween, s = t.name || "R" + this.counter, l = void 0 === t.id ? this.counter : t.id; return this.start(i, r, o, e, a, s, l) }, setTimeout: function(t, e, i) { var n = void 0 === i ? this.counter : i; return this.trigger({ done: t, duration: void 0 === e ? 0 : e, name: "O" + this.counter, id: n }) }, pause: function() { this.paused = !0 }, resume: function() { this.paused = !1 }, update: function(t) { this.funcs.forEach((function(e) { if (!(e.paused || (e.current += 1e3 * t, e.current < 0))) if (e.current >= e.duration && !e.cycling) { var i = e.easing(1, 0, 1, 1); e.func(i, 1e3 * t), e.done && e.done(), e.running = !1 } else { var n = e.easing(e.current % e.duration / e.duration, 0, 1, 1); (e.func(n, 1e3 * t) || !1) && (e.done && e.done(), e.running = !1) } })); var e = this.funcs.length; this.funcs = this.funcs.filter((function(t) { return t.running })); var i = this.funcs.length; if (e > 0 && 0 === i && this.globalDone) { var n = this.globalDone; this.globalDone = null, n() } }, adjustSpeed: function(t, e) { var i = this.get(t); i && (i.duration /= e, i.current /= e) }, getById: function(t) { return this.funcs.filter((function(e) { return t === e.id })) }, get: function(t) { for (var e = 0; e < this.funcs.length; e += 1) if (this.funcs[e].func == t) return this.funcs[e]; return null }, isRunning: function(t) { var e = this.get(t); return null !== e && e.running }, countActive: function() { for (var t = 0, e = 0; e < this.funcs.length; e += 1) t += this.funcs[e].running; return t }, listActive: function() { for (var t = [], e = 0; e < this.funcs.length; e += 1) this.funcs[e].running && t.push(this.funcs[e].name); return t }, done: function(t) { this.globalDone = t }, cancelById: function(t) { var e = void 0 === t ? 0 : t; this.funcs = this.funcs.filter((function(t) { return t.id !== e })) }, cancel: function(t) { this.funcs = this.funcs.filter((function(e) { return e.func !== t })) }, getUniqueId: function() { return this.uniqueID -= 1, this.uniqueID } } }, function(t, e, i) { var n = i(0); t.exports = { convertVisionVector: function(t) { return new n.Vector3(t.x, t.z, -t.y) }, convertVisionQuaternion: function(t) { return new n.Quaternion(t.x, t.z, -t.y, t.w) .multiply((new n.Quaternion) .setFromAxisAngle(new n.Vector3(0, 1, 0), n.Math.degToRad(90))) }, convertVisionQuaternionAutoScene: function(t) { return new n.Quaternion(t.x, t.y, t.z, t.w) .multiply((new n.Quaternion) .setFromAxisAngle(new n.Vector3(0, 1, 0), n.Math.degToRad(-90))) }, convertWorkshopVector: function(t) { return new n.Vector3(-t.x, t.y, t.z) }, convertWorkshopQuaternion: function(t) { return new n.Quaternion(-t.x, t.y, t.z, -t.w) .multiply(new n.Quaternion(Math.sqrt(2) / 2, Math.sqrt(2) / 2, 0, 0)) }, convertWorkshopPanoramaQuaternion: function(t) { return new n.Quaternion(t.x, -t.y, -t.z, t.w) .normalize() .multiply((new n.Quaternion) .setFromAxisAngle(new n.Vector3(0, 1, 0), n.Math.degToRad(270))) }, convertWorkshopOrthoZoom: function(t) { return -1 === t ? -1 : t / 4 }, toPrecision: function(t, e) { var i = Math.pow(10, e); return Math.round(t * i) / i }, projectPositionToCanvas: function(t, e, i) { (i = i || new n.Vector3) .copy(t); var r = .5 * (window.renderWidth || window.innerWidth), o = .5 * (window.renderHeight || window.innerHeight); return i.project(e), i.x = i.x * r + r, i.y = -i.y * o + o, i }, convertScreenPositionToNDC: function(t, e, i) { return (i = i || new n.Vector2) .x = t / (window.renderWidth || window.innerWidth) * 2 - 1, i.y = -e / (window.renderHeight || window.innerHeight) * 2 + 1, i }, constrainedTurn: function(t) { var e = t % (2 * Math.PI); return e > Math.PI ? e -= 2 * Math.PI : e < -Math.PI ? e += 2 * Math.PI : e }, getFOVDotThreshold: function(t) { return Math.cos(n.Math.degToRad(t / 2)) }, compareFloats: function(t, e) { return Math.abs(t - e) < Number.EPSILON * Math.pow(2, 45) }, convertWorldPositionToScreen: function(t, e) { var i = t.clone() .project(e), n = (window.renderWidth || window.innerWidth) / 2, r = (window.renderHeight || window.innerHeight) / 2; return { x: ~~(i.x * n + n), y: ~~(-i.y * r + r) } }, getVerticesOfItemSize: function(t) { for (var e = t.attributes.position, i = e.itemSize, r = [], o = {}, a = 0, s = e.array.length; a < s; a += i) { var l = e.array[a], u = e.array[a + 1], h = e.array[a + 2], c = "k_" + l + "_" + u + "_" + h; void 0 === o[c] && (r.push(new n.Vector3(l, u, h)), o[c] = 1) } return r }, computeWorldPositionOutCamera: function(t, e) { var i = (t = t.clone()) .applyMatrix4(e.matrixWorldInverse) .applyMatrix4(e.projectionMatrix), n = Math.abs(i.x) > 1, r = Math.abs(i.y) > 1, o = Math.abs(i.z) > 1; return !!(n || r || o) }, hexToRGB: function(t) { return "rgb(" + ((t = t.replace("#", "0x")) >> 16) + "," + (t >> 8 & 255) + "," + (255 & t) + ")" }, RGBToHex: function(t) { var e = t.split(/[^\d]+/); return "#" + (e[1] << 16 | e[2] << 8 | e[3]) .toString(16) }, toFixed: function(t, e) { var i = (t += "") .indexOf("."); return t = -1 !== i ? t.substring(0, e + i + 1) : t.substring(0), parseFloat(t) .toFixed(e) } } }, function(t, e) { t.exports = { vector: function(t, e) { var i = t.clone(); return e = e.clone(), function(n) { t.set(i.x * (1 - n) + e.x * n, i.y * (1 - n) + e.y * n, i.z * (1 - n) + e.z * n) } }, quaternion: function(t, e) { var i = t.clone(); return function(n) { t.copy(i) .slerp(e, n) } }, property: function(t, e, i, n) { var r = t[e]; return function(o) { t[e] = r * (1 - o) + i * o, n && n(t[e]) } }, uniform: function(t, e, i) { var n = t.material.uniforms[e].value; return function(r) { t.material.uniforms[e] && (t.material.uniforms[e].value = n * (1 - r) + i * r) } }, matrix4: function(t, e) { var i = t.clone(); return function(n) { for (var r = t.elements, o = i.elements, a = e.elements, s = 0; s < 16; s++) r[s] = o[s] * (1 - n) + a[s] * n } }, allUniforms: function(t, e, i) { var n = t.map(function(t) { return this.uniform(t, e, i) }.bind(this)); return function(t) { n.forEach((function(e) { e(t) })) } } } }, function(t, e, i) { (function(e) { (function(n) { function r(t, i, n) { function a() { o.warn("Retrying ", i), r(t, i, n) .done(l.resolve.bind(l)) .progress(l.notify.bind(l)) .fail(l.reject.bind(l)) } var s = function(t, e, i) { var n = new XMLHttpRequest; if (i && "withCredentials" in n) n.open(t, e, i); else if ("undefined" != typeof XDomainRequest)(n = new XDomainRequest) .open(t, e); else { if (i) throw "Browser does not support CORS!"; n.open(t, e) } return n }(t, i, !1); if ((n = n || {}) .retries = void 0 !== n.retries ? n.retries : 0, n.retry = void 0 !== n.retry ? n.retry : "get" === t.toLowerCase(), n.responseType) if (["arraybuffer", "text", "json"].indexOf(n.responseType) > -1) s.responseType = n.responseType; else { if ("image/jpeg" !== n.responseType) throw new Error('reponseType can only be one of "arraybuffer", "text" or "json", "image/jpeg"'); s.responseType = "arraybuffer" } "json" === n.responseType && s.setRequestHeader("Accept", "application/json"), n.auth && s.setRequestHeader("Authorization", n.auth), "object" == typeof n.data && (n.data = JSON.stringify(n.data), s.setRequestHeader("Content-Type", "application/json")); var l = e.Deferred(); return s.onreadystatechange = function(t) { if (4 == this.readyState) if (this.status >= 500 && this.status <= 600 && n.retry && n.retries < 3) n.retries++, setTimeout(a, 1e3); else if (200 == this.status) { var e = function(t, e) { var i = t.response; if ("json" === e && "object" != typeof i) try { i = JSON.parse(t.responseText) } catch (t) { return void l.reject({ error: "Failed parsing JSON" }) } else if ("image/jpeg" === e) { var n = new Uint8Array(t.response), r = new Blob([n], { type: "image/jpeg" }), o = URL.createObjectURL(r); (i = new Image) .src = o, i.crossOrigin = "Anonymous", i.onload = function() { URL.revokeObjectURL(o) } } return i }(this, n.responseType); l.resolve(e) } else l.reject(this) }, s.onprogress = function(t) { l.notify(t) }, s.send(n.data), l.promise() } var o = new(i(2))(n); window.URL = window.URL || window.webkitURL, window.REQUEST_CACHE = window.REQUEST_CACHE || {}, G.basic = window.PREFETCHED_MODELDATA, window.PREFETCHED_MODELDATA = window.PREFETCHED_MODELDATA || {}, setTimeout((function() { window.REQUEST_CACHE = null, window.PREFETCHED_MODELDATA = {} }), 6e4), window.onpageshow = function(t) { t.persisted && (window.REQUEST_CACHE = null, window.PREFETCHED_MODELDATA = {}) }, t.exports = { get: function(t, i) { var n, o; if (s = void 0 === (i = i || {}) .cache || i.cache) { var a = (n = t, window.REQUEST_CACHE ? window.REQUEST_CACHE[n] : null); if (a) return a } var s = i.fetchNum; return o = 1 === i.fetchNum && i.prefetchFrom && window.PREFETCHED_MODELDATA[i.prefetchFrom] ? e.when(window.PREFETCHED_MODELDATA[i.prefetchFrom]) : 2 === i.fetchNum && i.prefetchFrom && window.PREFETCHED_MODELDATA[i.prefetchFrom][i.prefetchFrom2] ? e.when(window.PREFETCHED_MODELDATA[i.prefetchFrom][i.prefetchFrom2]) : 3 === i.fetchNum && i.prefetchFrom && window.PREFETCHED_MODELDATA[i.prefetchFrom][i.prefetchFrom2][i.prefetchFrom3] ? e.when(window.PREFETCHED_MODELDATA[i.prefetchFrom][i.prefetchFrom2][i.prefetchFrom3]) : r("GET", t, i), s && function(t, e) { window.REQUEST_CACHE && (window.REQUEST_CACHE[t] = e) }(t, o), o }, post: function(t, e) { return r("POST", t, e) }, patch: function(t, e) { return r("PATCH", t, e) }, getImage: function(t, i) { function n() { o.warn("Retrying ", t), s.getImage(t, i - 1) .done(r.resolve.bind(r)) .progress(r.notify.bind(r)) .fail(r.reject.bind(r)) } var r = e.Deferred(), a = new Image, s = this; return null != i || (i = 3), a.onerror = function() { i > 0 ? setTimeout(n, 1e3) : r.reject() }, a.onload = function() { r.resolve(a) }, a.crossOrigin = "anonymous", a.src = t, r } } }) .call(this, "/js/util/ajax.js") }) .call(this, i(6)) }, function(t, e, i) { "use strict"; var n = i(0), r = i(1), o = "precision highp float;\nprecision highp int;\n\nuniform mat4 modelMatrix;\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nuniform vec3 cameraPosition;\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec2 uv;\n", a = "precision highp float;\nprecision highp int;\n\nuniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n"; t.exports = { basicTextured: { uniforms: { tDiffuse: { type: "t", value: null }, alpha: { type: "f", value: 1 } }, vertexShader: "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}", fragmentShader: "varying vec2 vUv;\nuniform float alpha;\nuniform sampler2D tDiffuse;\nvoid main() {\n vec4 texColor = texture2D(tDiffuse, vUv);\n gl_FragColor = vec4(texColor.rgb, texColor.a * alpha);\n}" }, copyCubeMap: { uniforms: { tDiffuse: { type: "t", value: null }, alpha: { type: "f", value: 1 } }, vertexShader: "varying vec3 vWorldPos;\nvoid main() {\n vWorldPos = vec3(-position.x, -position.y, position.z);\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}", fragmentShader: "varying vec3 vWorldPos;\nuniform float alpha;\nuniform samplerCube tDiffuse;\nvoid main() {\n vec4 texColor = textureCube(tDiffuse, vWorldPos);\n gl_FragColor = vec4(texColor.rgb, texColor.a * alpha);\n}" }, cube: { uniforms: { map: { type: "t", value: null }, opacity: { type: "f", value: 1 } }, vertexShader: o + "varying vec3 vWorldPosition;\n\nvoid main() {\n vWorldPosition = position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n", fragmentShader: a + "uniform samplerCube map;\nuniform float opacity;\n\nvarying vec3 vWorldPosition;\n\nvoid main() {\n vec4 color = textureCube( map, vec3( -vWorldPosition.x, vWorldPosition.yz ) );\n gl_FragColor = vec4(color.rgb, opacity);\n}\n" }, model: { uniforms: { map: { type: "t", value: null }, modelAlpha: { type: "f", value: r.modelAlpha }, opacity: { type: "f", value: 1 }, progress: { type: "f", value: 0 }, blackout: { type: "i", value: 0 }, pano0Map: { type: "t", value: null }, pano0Position: { type: "v3", value: new n.Vector3 }, pano0Matrix: { type: "m4", value: new n.Matrix4 }, pano1Map: { type: "t", value: null }, pano1Position: { type: "v3", value: new n.Vector3 }, pano1Matrix: { type: "m4", value: new n.Matrix4 }, measureMode: { type: "i", value: 0 }, mouseAPosition: { type: "v2", value: new n.Vector2 }, centerT: { type: "v3", value: new n.Vector3 }, centerB: { type: "v3", value: new n.Vector3 }, virtualCameraAngle: { type: "f", value: 0 } }, vertexShader: o + ["uniform vec3 pano0Position;", "uniform mat4 pano0Matrix;", "uniform vec3 pano1Position;", "uniform mat4 pano1Matrix;", "varying vec2 vUv;", "varying vec3 vWorldPosition;", "varying vec3 vWorldPosition0;", "varying vec3 vWorldPosition1;", "void main() {", "vUv = uv;", "vec4 worldPosition = modelMatrix * vec4(position, 1.0);", "vec3 positionLocalToPanoCenter0 = worldPosition.xyz - pano0Position;", "vec3 positionLocalToPanoCenter1 = worldPosition.xyz - pano1Position;", "vWorldPosition = position.xyz;", "vWorldPosition0 = (vec4(positionLocalToPanoCenter0, 1.0) * pano0Matrix).xyz;", "vWorldPosition0.x *= -1.0;", "vWorldPosition1 = (vec4(positionLocalToPanoCenter1, 1.0) * pano1Matrix).xyz;", "vWorldPosition1.x *= -1.0;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"), fragmentShader: a + ["uniform sampler2D map;", "uniform float modelAlpha;", "uniform float opacity;", "uniform float progress;", "uniform int blackout;", "uniform vec3 pano0Position;", "uniform samplerCube pano0Map;", "uniform vec3 pano1Position;", "uniform samplerCube pano1Map;", "uniform vec2 mouseAPosition;", "uniform vec2 mousePosition;\nuniform bool measureMode;\nuniform vec3 centerT;", "uniform vec3 centerB;", "uniform float virtualCameraAngle;", "varying vec2 vUv;", "varying vec3 vWorldPosition;", "varying vec3 vWorldPosition0;", "varying vec3 vWorldPosition1;", "void main() {", "const vec4 BLACK = vec4(0.0, 0.0, 0.0, 1.0);", "const vec4 GREY = vec4(0.5, 0.5, 0.5, 1.0);", "const vec4 GREEN = vec4(0.0, 1.0, 0.0, 1.0);", "vec4 colorFromPanos;", "vec4 colorFromPano0 = textureCube( pano0Map, vWorldPosition0.xyz);", "vec4 colorFromPano1 = textureCube( pano1Map, vWorldPosition1.xyz);", "vec4 colorFromTexture = texture2D( map, vUv );", "if (blackout == 0) {", "colorFromPanos = mix(colorFromPano0, colorFromPano1, progress);", "} else if (blackout == 1) {", "colorFromPanos = mix(colorFromPano0, BLACK, min(1.0, progress*2.0));", "colorFromPanos = mix(colorFromPanos, colorFromPano1, max(0.0, progress * 2.0 - 1.0));", "} else if (blackout == 2) {", "colorFromPanos = mix(colorFromPano0, BLACK, progress);", "} else if (blackout == 3) {", "colorFromPanos = mix(BLACK, colorFromPano1, max(0.0, progress * 2.0 - 1.0));", "}", "if (measureMode && distance(mouseAPosition, gl_FragCoord.xy) < 80.0) {", "colorFromPanos = mix(colorFromPanos, colorFromTexture, 1.0);", "} else {", "colorFromPanos = mix(colorFromPanos, colorFromTexture, modelAlpha);", "}", "vec3 centerT_vW = normalize(vec3(vWorldPosition.x - centerT.x, vWorldPosition.y - centerT.y, vWorldPosition.z - centerT.z));", "vec3 centerT_B = normalize(vec3(centerB.x - centerT.x, centerB.y - centerT.y, centerB.z - centerT.z ));", "float angle = acos(dot(centerT_vW, centerT_B));", "float cosine = cos(virtualCameraAngle);", "float cosineV = distance(centerT, centerB) / distance(centerT, vWorldPosition);", "bool condition1 = (angle < virtualCameraAngle);", "bool condition2 = (cosineV >= cosine && cosineV <= 1.0);", "if ( condition1 ) {", "colorFromPanos = mix(GREEN, colorFromPanos, 0.8);", "}", "float whiteness = 1.0 - smoothstep(0.1, 0.2, opacity);", "colorFromPanos = mix(colorFromPanos, GREY, whiteness);", "gl_FragColor = vec4(colorFromPanos.rgb, opacity);", "}"].join("\n") }, model2: { uniforms: { map: { type: "t", value: null }, modelAlpha: { type: "f", value: r.modelAlpha }, opacity: { type: "f", value: 1 }, progress: { type: "f", value: 0 }, blackout: { type: "i", value: 0 }, pano0Map: { type: "t", value: null }, pano0Position: { type: "v3", value: new n.Vector3 }, pano0Matrix: { type: "m4", value: new n.Matrix4 }, pano1Map: { type: "t", value: null }, pano1Position: { type: "v3", value: new n.Vector3 }, pano1Matrix: { type: "m4", value: new n.Matrix4 }, hue0: { type: "f", value: 0 }, saturation0: { type: "f", value: 0 }, brightness0: { type: "f", value: 0 }, contrast0: { type: "f", value: 0 }, gamma0: { type: "f", value: 1 }, vibrance0: { type: "f", value: 0 }, balance0: { type: "v3", value: new n.Vector3 }, hue1: { type: "f", value: 0 }, saturation1: { type: "f", value: 0 }, brightness1: { type: "f", value: 0 }, contrast1: { type: "f", value: 0 }, gamma1: { type: "f", value: 1 }, vibrance1: { type: "f", value: 0 }, balance1: { type: "v3", value: new n.Vector3 }, base: { type: "f", value: 2 }, measureMode: { type: "i", value: 0 }, mouseAPosition: { type: "v2", value: new n.Vector2 } }, vertexShader: o + "uniform vec3 pano0Position;\nuniform mat4 pano0Matrix;\n\nuniform vec3 pano1Position;\nuniform mat4 pano1Matrix;\n\nvarying vec2 vUv;\nvarying vec3 vWorldPosition0;\nvarying vec3 vWorldPosition1;\n\nvoid main() {\n\n vUv = uv;\n vec4 worldPosition = modelMatrix * vec4(position, 1.0);\n\n vec3 positionLocalToPanoCenter0 = worldPosition.xyz - pano0Position;\n vWorldPosition0 = (vec4(positionLocalToPanoCenter0, 1.0) * pano0Matrix).xyz;\n vWorldPosition0.x *= -1.0;\n\n vec3 positionLocalToPanoCenter1 = worldPosition.xyz - pano1Position;\n vWorldPosition1 = (vec4(positionLocalToPanoCenter1, 1.0) * pano1Matrix).xyz;\n vWorldPosition1.x *= -1.0;\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n", fragmentShader: a + "uniform sampler2D map;\nuniform float modelAlpha;\nuniform float opacity;\nuniform float progress;\nuniform int blackout;\n\nuniform vec3 pano0Position;\nuniform samplerCube pano0Map;\n\nuniform vec3 pano1Position;\nuniform samplerCube pano1Map;\n\nvarying vec2 vUv;\nvarying vec3 vWorldPosition0;\nvarying vec3 vWorldPosition1;\nuniform vec2 mousePosition;\nuniform int isEditVersion;\nuniform float hue0;\nuniform float saturation0;\nuniform float brightness0;\nuniform float contrast0;\nuniform float gamma0;\nuniform float vibrance0;\nuniform float hue1;\nuniform vec3 balance0;\nuniform float saturation1;\nuniform float brightness1;\nuniform float contrast1;\nuniform float gamma1;\nuniform float vibrance1;\nuniform vec3 balance1;\nuniform float base;\n\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n return vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );\n}\n\nfloat bcolor( in float value, in float b ) {\n\treturn max(min(value * pow(base, b), 1.0), 0.0);\n}\n\nvoid main() {\n\tconst vec4 BLACK = vec4(0.0, 0.0, 0.0, 1.0);\n\tconst vec4 GREY = vec4(0.5, 0.5, 0.5, 1.0);\n\n\tvec4 colorFromPanos;\n\tvec4 colorFromPano0 = textureCube( pano0Map, vWorldPosition0.xyz);\n\tvec4 colorFromPano1 = textureCube( pano1Map, vWorldPosition1.xyz);\n\n\tif (blackout == 0) {\n\t\tcolorFromPanos = mix(colorFromPano0, colorFromPano1, progress);\n\t} else if (blackout == 1) {\n\t\tcolorFromPanos = mix(colorFromPano0, BLACK, min(1.0, progress*2.0));\n\t\tcolorFromPanos = mix(colorFromPanos, colorFromPano1, max(0.0, progress * 2.0 - 1.0));\n\t} else if (blackout == 2) {\n\t\tcolorFromPanos = mix(colorFromPano0, BLACK, progress);\n\t} else if (blackout == 3) {\n\t\tcolorFromPanos = mix(BLACK, colorFromPano1, max(0.0, progress * 2.0 - 1.0));\n\t}\n\n\tvec4 colorFromTexture = texture2D( map, vUv );\n\tcolorFromPanos = mix(colorFromPanos, colorFromTexture, modelAlpha);\n\n\tfloat whiteness = 1.0 - smoothstep(0.1, 0.2, opacity);\n\tcolorFromPanos = mix(colorFromPanos, GREY, whiteness);\n\tgl_FragColor = vec4(colorFromPanos.rgb, opacity);\n\tfloat hue = mix(hue0, hue1, progress);\n\tfloat gamma = mix(gamma0, gamma1, progress);\n\tfloat brightness = mix(brightness0, brightness1, progress);\n\tfloat contrast = mix(contrast0, contrast1, progress);\n\tfloat saturation = mix(saturation0, saturation1, progress);\n\tfloat vibrance = mix(vibrance0, vibrance1, progress);\n\tvec3 balance = mix(balance0, balance1, progress);\n\tgl_FragColor.r = bcolor(gl_FragColor.r, balance.x);\n\tgl_FragColor.g = bcolor(gl_FragColor.g, balance.y);\n\tgl_FragColor.b = bcolor(gl_FragColor.b, balance.z);\n\tif (hue!=0.0){\n float angle = hue * 3.14159265;\n float s = sin(angle), c = cos(angle);\n vec3 weights = (vec3(2.0 * c, -sqrt(3.0) * s - c, sqrt(3.0) * s - c) + 1.0) / 3.0;\n float len = length(gl_FragColor.rgb);\n gl_FragColor.rgb = vec3(\n dot(gl_FragColor.rgb, weights.xyz),\n dot(gl_FragColor.rgb, weights.zxy),\n dot(gl_FragColor.rgb, weights.yzx)\n );\n }\n if (saturation!=0.0){\n float average = (gl_FragColor.r + gl_FragColor.g + gl_FragColor.b) / 3.0;\n if (saturation > 0.0) {\n gl_FragColor.rgb += (average - gl_FragColor.rgb) * (1.0 - 1.0 / (1.001 - saturation));\n } else {\n gl_FragColor.rgb += (average - gl_FragColor.rgb) * (-saturation);\n }\n\t}\n gl_FragColor.rgb += brightness;\n if (contrast!=0.0){\n if (contrast > 0.0) {\n gl_FragColor.rgb = (gl_FragColor.rgb - 0.5) / (1.0 - contrast) + 0.5;\n } else {\n gl_FragColor.rgb = (gl_FragColor.rgb - 0.5) * (1.0 + contrast) + 0.5;\n }\n\t}\n if (vibrance!=0.0){\n float average = (gl_FragColor.r + gl_FragColor.g + gl_FragColor.b) / 3.0;\n float mx = max(gl_FragColor.r, max(gl_FragColor.g, gl_FragColor.b));\n float amt = (mx - average) * (-vibrance * 3.0);\n gl_FragColor.rgb = mix(gl_FragColor.rgb, vec3(mx), amt);\n }\n if (gamma!=1.0){\n gl_FragColor = LinearToGamma( gl_FragColor, float( gamma ) );\n }\n}\n" }, modelOutside: { uniforms: { map: { type: "t", value: null }, opacity: { type: "f", value: 1 }, brightness: { type: "f", value: 0 } }, vertexShader: o + "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n", fragmentShader: a + "uniform sampler2D map;\nuniform float opacity;\nuniform float brightness;\nvarying vec2 vUv;\n\nvec4 white = vec4(0.5, 0.5, 0.5, 1.0);\n\nvoid main() {\n\n vec4 colorFromTexture = texture2D( map, vUv );\n float whiteness = 1.0 - smoothstep(0.1, 0.2, opacity);\n colorFromTexture = mix(colorFromTexture, white, whiteness);\n gl_FragColor = vec4(colorFromTexture.rgb, opacity);\n\n}\n" }, ribbon: { uniforms: { map: { type: "t", value: null }, opacity: { type: "f", value: 1 }, color: { type: "c", value: new n.Color(r.path.color) } }, vertexShader: o + "varying vec2 vUv;\nvarying vec3 vN;\nvarying vec4 vP;\n\nvoid main() {\n\n vUv = uv;\n vN= normalMatrix * normal;\n vP = modelViewMatrix * vec4( position, 1.0 );\n gl_Position = projectionMatrix * vP;\n}\n", fragmentShader: a + "uniform sampler2D map;\nuniform float opacity;\nvarying vec2 vUv;\nuniform vec3 color;\nvarying vec3 vN; // show-1182\nvarying vec4 vP; // show-1182\n\nvoid main() {\n\t// TODO add scroll-in and pulsing behaviors\n\tvec3 vNn = normalize(vN);\n\tvec3 vPn = normalize(vP.xyz);\n\tfloat f = pow(1.0-abs(dot(vNn,vPn)),0.2);\n vec4 colorFromTexture = texture2D( map, vUv );\n colorFromTexture.a *= f;\n gl_FragColor = vec4((color.rgb*colorFromTexture.rgb),\n \t\t\t\t\t\t(opacity*colorFromTexture.a));\n}\n" }, waypoint: { uniforms: { map: { type: "t", value: null }, opacity: { type: "f", value: 1 }, pulse: { type: "f", value: 1 }, nearFade: { type: "v2", value: new n.Vector2(2 * r.insideNear, 2 * r.path.waypointIndoorRadius) }, color: { type: "c", value: new n.Color(r.reticuleColor) } }, vertexShader: o + "varying vec2 vUv;\nvarying vec4 vPointView;\n\nvoid main() {\n\n vUv = uv;\n vPointView = modelViewMatrix * vec4( position, 1.0 );\n gl_Position = projectionMatrix * vPointView;\n\n}\n", fragmentShader: a + "uniform sampler2D map;\nuniform float opacity;\nuniform float pulse; // another opacity, with a different clock\nuniform vec2 nearFade;\nvarying vec2 vUv;\nvarying vec4 vPointView;\nuniform vec3 color;\n\nvoid main() {\n\t// TODO add scroll-in and pulsing behaviors\n\tfloat depthFade = min(1.0, (abs(vPointView.z)-nearFade.x)/(nearFade.y-nearFade.x));\n vec4 colorFromTexture = texture2D( map, vUv );\t\t// we only use the alpha!\n gl_FragColor = vec4(color.rgb,\n \t\t\t\t\t\t(pulse*opacity*colorFromTexture.a * depthFade));\n}\n" }, modelDebug: { uniforms: { map: { type: "t", value: null }, modelAlpha: { type: "f", value: r.modelAlpha }, depthmapRatio: { type: "f", value: 0 }, opacity: { type: "f", value: 1 }, progress: { type: "f", value: 0 }, considerOcclusion: { type: "i", value: r.fancierTransition }, highlightPanoSelection: { type: "i", value: 0 }, useThirdPano: { type: "i", value: r.useThirdPano }, pano0Map: { type: "t", value: null }, pano0Depth: { type: "t", value: null }, pano0Position: { type: "v3", value: new n.Vector3 }, pano0Matrix: { type: "m4", value: new n.Matrix4 }, pano0Weight: { type: "f", value: r.transition.pano0Weight }, pano1Map: { type: "t", value: null }, pano1Depth: { type: "t", value: null }, pano1Position: { type: "v3", value: new n.Vector3 }, pano1Matrix: { type: "m4", value: new n.Matrix4 }, pano1Weight: { type: "f", value: r.transition.pano1Weight }, pano2Map: { type: "t", value: null }, pano2Depth: { type: "t", value: null }, pano2Position: { type: "v3", value: new n.Vector3 }, pano2Matrix: { type: "m4", value: new n.Matrix4 }, pano2Weight: { type: "f", value: r.transition.pano2Weight } }, vertexShader: o + "uniform vec3 pano0Position;\nuniform mat4 pano0Matrix;\n\nuniform vec3 pano1Position;\nuniform mat4 pano1Matrix;\n\nuniform vec3 pano2Position;\nuniform mat4 pano2Matrix;\n\nvarying vec2 vUv;\nvarying vec3 vWorldPosition0;\nvarying vec3 vWorldPosition1;\nvarying vec3 vWorldPosition2;\n\nvarying vec4 worldPosition;\n\nvoid main() {\n\n vUv = uv;\n worldPosition = modelMatrix * vec4(position, 1.0);\n\n vec3 positionLocalToPanoCenter0 = worldPosition.xyz - pano0Position;\n vWorldPosition0 = (vec4(positionLocalToPanoCenter0, 1.0) * pano0Matrix).xyz;\n vWorldPosition0.x *= -1.0;\n\n vec3 positionLocalToPanoCenter1 = worldPosition.xyz - pano1Position;\n vWorldPosition1 = (vec4(positionLocalToPanoCenter1, 1.0) * pano1Matrix).xyz;\n vWorldPosition1.x *= -1.0;\n\n vec3 positionLocalToPanoCenter2 = worldPosition.xyz - pano2Position;\n vWorldPosition2 = (vec4(positionLocalToPanoCenter2, 2.0) * pano2Matrix).xyz;\n vWorldPosition2.x *= -1.0;\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n", fragmentShader: a + "uniform sampler2D map;\nuniform float depthmapRatio;\nuniform float modelAlpha;\nuniform float opacity;\nuniform float progress;\nuniform int considerOcclusion;\nuniform int highlightPanoSelection;\nuniform int useThirdPano;\n\nuniform vec3 pano0Position;\nuniform samplerCube pano0Map;\nuniform samplerCube pano0Depth;\nuniform float pano0Weight;\n\nuniform vec3 pano1Position;\nuniform samplerCube pano1Map;\nuniform samplerCube pano1Depth;\nuniform float pano1Weight;\n\nuniform vec3 pano2Position;\nuniform samplerCube pano2Map;\nuniform samplerCube pano2Depth;\nuniform float pano2Weight;\n\nvarying vec2 vUv;\nvarying vec3 vWorldPosition0;\nvarying vec3 vWorldPosition1;\nvarying vec3 vWorldPosition2;\n\nvarying vec4 worldPosition;\n\nvoid main() {\n\n vec4 depthFromPano0 = textureCube( pano0Depth, vWorldPosition0.xyz );\n vec4 depthFromPano1 = textureCube( pano1Depth, vWorldPosition1.xyz );\n vec4 depthFromPano2 = textureCube( pano2Depth, vWorldPosition2.xyz );\n\n vec4 colorFromPano0 = textureCube( pano0Map, vWorldPosition0.xyz );\n vec4 colorFromPano1 = textureCube( pano1Map, vWorldPosition1.xyz );\n vec4 colorFromPano2 = textureCube( pano2Map, vWorldPosition2.xyz );\n\n float distanceToPano0 = distance(worldPosition.xyz, pano0Position);\n float distanceToPano1 = distance(worldPosition.xyz, pano1Position);\n float distanceToPano2 = distance(worldPosition.xyz, pano2Position);\n\n float cameraToPano0 = distance(cameraPosition.xyz, pano0Position);\n float cameraToPano1 = distance(cameraPosition.xyz, pano1Position);\n float cameraToPano2 = distance(cameraPosition.xyz, pano2Position);\n\n float contributionFromPano0 = cameraToPano0 == 0.0 ? 1000.0 : pano0Weight / cameraToPano0;\n float contributionFromPano1 = cameraToPano1 == 0.0 ? 1000.0 : pano1Weight / cameraToPano1;\n float contributionFromPano2 = cameraToPano2 == 0.0 ? 1000.0 : pano2Weight / cameraToPano2;\n\n contributionFromPano0 *= 1.0 / distanceToPano0;\n contributionFromPano1 *= 1.0 / distanceToPano1;\n contributionFromPano2 *= 1.0 / distanceToPano2;\n\n if(considerOcclusion == 1) {\n bool occludedFromPano0 = distanceToPano0 / 10.0 > 1.01 - depthFromPano0.x;\n bool occludedFromPano1 = distanceToPano1 / 10.0 > 1.01 - depthFromPano1.x;\n bool occludedFromPano2 = distanceToPano2 / 10.0 > 1.01 - depthFromPano2.x;\n\n if(occludedFromPano0){contributionFromPano0 *= 0.1;}\n if(occludedFromPano1){contributionFromPano1 *= 0.1;}\n if(occludedFromPano2){contributionFromPano2 *= 0.1;}\n //if(occludedFromPano0 && occludedFromPano1 && !occludedFromPano2) { contributionFromPano2 += 0.5; }\n }\n\n float contributionSum = contributionFromPano0 + contributionFromPano1 + contributionFromPano2;\n contributionFromPano0 /= contributionSum;\n contributionFromPano1 /= contributionSum;\n contributionFromPano2 /= contributionSum;\n\n vec4 colorFromPanos = colorFromPano0 * contributionFromPano0;\n colorFromPanos += colorFromPano1 * contributionFromPano1;\n colorFromPanos += colorFromPano2 * contributionFromPano2;\n\n vec4 depthFromPanos = depthFromPano0 * contributionFromPano0;\n depthFromPanos += depthFromPano1 * contributionFromPano1;\n depthFromPanos += depthFromPano2 * contributionFromPano2;\n\n vec4 colorFromTexture = texture2D( map, vUv );\n colorFromPanos = mix(colorFromPanos, colorFromTexture, modelAlpha);\n\n if(highlightPanoSelection == 1) {\n colorFromPanos.r = contributionFromPano0;\n colorFromPanos.g = contributionFromPano1;\n colorFromPanos.b = contributionFromPano2;\n }\n\n gl_FragColor = vec4(mix(colorFromPanos, depthFromPanos, depthmapRatio).rgb, opacity);\n\n}\n" }, customDepth: { uniforms: { panoPosition: { type: "v3", value: new n.Vector3 } }, vertexShader: o + "varying vec4 worldPosition;\n\nvoid main() {\n\n worldPosition = modelMatrix * vec4(position, 1.0);\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n", fragmentShader: a + "uniform vec3 panoPosition;\nvarying vec4 worldPosition;\n\nvoid main() {\n\n float depth = distance(worldPosition.xyz, panoPosition);\n float color = 1.0 - depth / 10.0;\n gl_FragColor = vec4(color, color, color, 1.0);\n\n}\n" }, skysphere: { uniforms: { radius: { type: "f", value: 0 } }, vertexShader: o + "varying vec4 worldPosition;\n\nvoid main() {\n\n worldPosition = modelMatrix * vec4(position, 1.0);\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n", fragmentShader: a + "varying vec4 worldPosition;\nuniform float radius;\n\nvoid main() {\n\n vec4 topColor = vec4(0.094, 0.102, 0.11, 1.0);\n vec4 bottomColor = vec4(0.2, 0.216, 0.235, 1.0);\n float normalizedHeight = (worldPosition.y + radius) / (radius * 2.0);\n float ratio = smoothstep(0.0, 0.5, normalizedHeight);\n gl_FragColor = mix(bottomColor, topColor, ratio);\n\n}\n" }, tagDisc: { uniforms: { opacity: { type: "f", value: 0 }, color: { type: "c", value: new n.Color }, bg: { type: "t", value: null }, mask: { type: "t", value: null } }, vertexShader: o + "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}", fragmentShader: a + "uniform float opacity;\nuniform vec3 color;\nuniform sampler2D bg;\nuniform sampler2D mask;\n\nvarying vec2 vUv;\n\nvoid main() {\n vec4 maskColor = texture2D(mask, vUv);\n vec4 bgColor = texture2D(bg, vUv);\n vec3 mappedColor = mix(bgColor.rgb, color, maskColor.a);\n gl_FragColor = vec4(mappedColor, bgColor.a * opacity);\n}\n" } } }, function(t, e, i) { "use strict"; var n = i(0), r = i(9), o = []; t.exports = { drawLine: function(t, e, i) { var r = new n.Geometry; r.vertices.push(t.clone()), r.vertices.push(e.clone()); var o = new n.LineBasicMaterial({ color: i }); return new n.Line(r, o, n.LineSegments) }, initCanvasLabel: function(t, e, i) { var r = document.createElement("canvas"), o = r.getContext("2d"); o.font = t.fontSize + "px " + t.fontFace; var a = o.measureText(t.text) .width + t.fontSize, s = t.fontSize + t.fontSize, l = s / 10; r.width = a, r.height = s, o.lineWidth = 2, o.strokeStyle = e, o.fillStyle = e, function(t, e, i, n, r, o) { t.beginPath(), t.moveTo(e, i + o), t.lineTo(e, i + r - o), t.quadraticCurveTo(e, i + r, e + o, i + r), t.lineTo(e + n - o, i + r), t.quadraticCurveTo(e + n, i + r, e + n, i + r - o), t.lineTo(e + n, i + o), t.quadraticCurveTo(e + n, i, e + n - o, i), t.lineTo(e + o, i), t.quadraticCurveTo(e, i, e, i + o), t.stroke(), t.fill(), t.closePath() }(o, 2, 2, a - 4, s - 4, l), function(t, e) { t.fillStyle = i, t.font = e.fontSize + "px " + e.fontFace, t.textAlign = "center", t.textBaseline = "middle", t.fillText(e.text, a / 2, s / 2 + 2), t.fillText(e.text, a / 2, s / 2 + 2) }(o, t); var u = new n.CanvasTexture(r); return u.minFilter = n.LinearFilter, u.magFilter = n.LinearFilter, u.needsUpdate = !0, { texture: u, canvas: r } }, drawBoxHelperOfLine2: function(t, e, i) { for (var o = r.getVerticesOfItemSize(t.geometry), a = {}, s = 0; s < o.length; ++s) { var l = o[s]; a["v" + s] = [l.x, l.y, l.z] } var u = new n.LineMaterial({ color: e, linewidth: 2, resolution: new n.Vector2(i.width, i.height) }), h = [a.v0.concat(a.v1) .concat(a.v5) .concat(a.v4) .concat(a.v0), a.v2.concat(a.v3) .concat(a.v7) .concat(a.v6) .concat(a.v2), a.v0.concat(a.v3), a.v1.concat(a.v2), a.v5.concat(a.v6), a.v4.concat(a.v7) ], c = new n.Group; for (s = 0; s < h.length; ++s) { var d = new n.LineGeometry; d.setPositions(h[s]); var p = new n.Line2(d, u); c.add(p) } return c }, drawFatLine: function(t, e, i, r) { var o = new n.LineGeometry; o.setPositions([t.x, t.y, t.z, e.x, e.y, e.z]); var a = new n.LineMaterial({ color: i, linewidth: r, resolution: new n.Vector2((window.renderWidth || window.innerWidth), (window.renderHeight || window.innerHeight)) }), s = new n.Line2(o, a); return s.computeLineDistances(), s.renderOrder = 99, s.scale.set(1, 1, 1), s }, triggerLimit: function(t) { o.push(Date.now() || (new Date) .getTime()); return 2 === o.length && (o[1] - o[0] < t ? (o.pop(), !0) : (o.shift(), !1)) } } }, function(t, e) { t.exports = function(t) { this.message = t } }, function(t, e) { var i = { linearTween: function(t, e, i, n) { return i * t / n + e }, easeInQuad: function(t, e, i, n) { return i * (t /= n) * t + e }, easeOutQuad: function(t, e, i, n) { return -i * (t /= n) * (t - 2) + e }, easeInOutQuad: function(t, e, i, n) { return (t /= n / 2) < 1 ? i / 2 * t * t + e : -i / 2 * (--t * (t - 2) - 1) + e }, easeInCubic: function(t, e, i, n) { return i * (t /= n) * t * t + e }, easeOutCubic: function(t, e, i, n) { return t /= n, i * (--t * t * t + 1) + e }, easeInOutCubic: function(t, e, i, n) { return (t /= n / 2) < 1 ? i / 2 * t * t * t + e : i / 2 * ((t -= 2) * t * t + 2) + e }, easeInQuart: function(t, e, i, n) { return i * (t /= n) * t * t * t + e }, easeOutQuart: function(t, e, i, n) { return t /= n, -i * (--t * t * t * t - 1) + e }, easeInOutQuart: function(t, e, i, n) { return (t /= n / 2) < 1 ? i / 2 * t * t * t * t + e : -i / 2 * ((t -= 2) * t * t * t - 2) + e }, easeInQuint: function(t, e, i, n) { return i * (t /= n) * t * t * t * t + e }, easeOutQuint: function(t, e, i, n) { return t /= n, i * (--t * t * t * t * t + 1) + e }, easeInOutQuint: function(t, e, i, n) { return (t /= n / 2) < 1 ? i / 2 * t * t * t * t * t + e : i / 2 * ((t -= 2) * t * t * t * t + 2) + e }, easeInSine: function(t, e, i, n) { return -i * Math.cos(t / n * (Math.PI / 2)) + i + e }, easeOutSine: function(t, e, i, n) { return i * Math.sin(t / n * (Math.PI / 2)) + e }, easeInOutSine: function(t, e, i, n) { return -i / 2 * (Math.cos(Math.PI * t / n) - 1) + e }, easeInExpo: function(t, e, i, n) { return i * Math.pow(2, 10 * (t / n - 1)) + e }, easeOutExpo: function(t, e, i, n) { return i * (1 - Math.pow(2, -10 * t / n)) + e }, easeInOutExpo: function(t, e, i, n) { return (t /= n / 2) < 1 ? i / 2 * Math.pow(2, 10 * (t - 1)) + e : (t--, i / 2 * (2 - Math.pow(2, -10 * t)) + e) }, easeInCirc: function(t, e, i, n) { return t /= n, -i * (Math.sqrt(1 - t * t) - 1) + e }, easeOutCirc: function(t, e, i, n) { return t /= n, t--, i * Math.sqrt(1 - t * t) + e }, easeInOutCirc: function(t, e, i, n) { return (t /= n / 2) < 1 ? -i / 2 * (Math.sqrt(1 - t * t) - 1) + e : (t -= 2, i / 2 * (Math.sqrt(1 - t * t) + 1) + e) }, easeInElastic: function(t, e, i, n) { var r = 1.70158, o = 0, a = i; return 0 === t ? e : 1 == (t /= n) ? e + i : (o || (o = .3 * n), a < Math.abs(i) ? (a = i, r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a), -a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * n - r) * (2 * Math.PI) / o) + e) }, easeOutElastic: function(t, e, i, n) { var r = 1.70158, o = 0, a = i; return 0 === t ? e : 1 == (t /= n) ? e + i : (o || (o = .3 * n), a < Math.abs(i) ? (a = i, r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a), a * Math.pow(2, -10 * t) * Math.sin((t * n - r) * (2 * Math.PI) / o) + i + e) }, easeInOutElastic: function(t, e, i, n) { var r = 1.70158, o = 0, a = i; return 0 === t ? e : 2 == (t /= n / 2) ? e + i : (o || (o = n * (.3 * 1.5)), a < Math.abs(i) ? (a = i, r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a), t < 1 ? a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * n - r) * (2 * Math.PI) / o) * -.5 + e : a * Math.pow(2, -10 * (t -= 1)) * Math.sin((t * n - r) * (2 * Math.PI) / o) * .5 + i + e) }, easeInBack: function(t, e, i, n, r) { return void 0 === r && (r = 1.70158), i * (t /= n) * t * ((r + 1) * t - r) + e }, easeOutBack: function(t, e, i, n, r) { return void 0 === r && (r = 1.70158), i * ((t = t / n - 1) * t * ((r + 1) * t + r) + 1) + e }, easeInOutBack: function(t, e, i, n, r) { return void 0 === r && (r = 1.70158), (t /= n / 2) < 1 ? i / 2 * (t * t * ((1 + (r *= 1.525)) * t - r)) + e : i / 2 * ((t -= 2) * t * ((1 + (r *= 1.525)) * t + r) + 2) + e }, easeOutBounce: function(t, e, i, n) { return (t /= n) < 1 / 2.75 ? i * (7.5625 * t * t) + e : t < 2 / 2.75 ? i * (7.5625 * (t -= 1.5 / 2.75) * t + .75) + e : t < 2.5 / 2.75 ? i * (7.5625 * (t -= 2.25 / 2.75) * t + .9375) + e : i * (7.5625 * (t -= 2.625 / 2.75) * t + .984375) + e }, easeInBounce: function(t, e, i, r) { return i - n.easeOutBounce(r - t, 0, i, r) + e }, easeInOutBounce: function(t, e, i, r) { return t < r / 2 ? .5 * n.easeInBounce(2 * t, 0, i, r) + e : .5 * n.easeOutBounce(x, 2 * t - r, 0, i, r) + .5 * i + e } }; t.exports = i }, function(t, e, i) { var n = i(11), r = i(0), o = {}; t.exports = { load: function(t, e, i) { var a = o[t]; return a ? (e && setTimeout((function() { e(a) }), 1), a) : ((a = new r.Texture) .sourceFile = t, o[t] = a, n.getImage(t) .then((function(t) { a.image = t, a.needsUpdate = !0, e && e(a) })) .fail(i), a) }, loadBase64: function(t, e) { e = e || "png"; var i = new r.Texture; return i.image = document.createElement("img"), i.image.setAttribute("src", "data:image/" + e + ";base64," + t), i.needsUpdate = !0, i }, loadurl: function(t) { var e = new r.TextureLoader; return e.setCrossOrigin(!0), e.load(t) }, loadCanvas: function(t) { var e = t.replace(/\s*/g, ""), i = new RegExp("^[a-zA-Z]+$"), n = "rgba(0,0,0,.4)", o = "rgba(0,0,0,.4)"; (l = (s = document.createElement("canvas")) .getContext("2d")) .font = "100px Arial"; var a, s, l, u = l.measureText(t), h = (a = i.test(e) ? 1.05 * u.width + 120 : u.width + 60) + 4; (l = (s = document.createElement("canvas")) .getContext("2d")) .canvas.width = h, l.canvas.height = 144, l.font = "Bold 100px Arial", function(t, e, i, r, a, s) { t.beginPath(), t.moveTo(e + s, i), t.lineWidth = 1, t.strokeStyle = o, t.fillStyle = n, t.arcTo(e + r, i, e + r, i + a, s), t.arcTo(e + r, i + a, e, i + a, s), t.arcTo(e, i + a, e, i, s), t.arcTo(e, i, e + r, i, s), t.stroke(), t.fill(), t.closePath() }(l, 1, 1, a + 2, 142, 30), l.fillStyle = "rgba(255,255,255, .85)", i.test(e) ? l.fillText(t, 62, 102) : l.fillText(t, 32, 102); var c = new r.Texture(s); return c.minFilter = r.LinearFilter, c.magFilter = r.LinearFilter, c.needsUpdate = !0, c }, loadCanvasRe: function(t, e) { t.replace(/\s*/g, ""), new RegExp("^[a-zA-Z]+$"); t = t || "", e = e || "Center"; var i = document.createElement("canvas"), n = i.getContext("2d"); i.width = 256, i.height = 256; n.font = "bold 54px Arial"; var o = n.measureText(t) .width; ! function(t, e, i, r, o, a, s, l) { n.beginPath(), n.moveTo(t + o, e), n.lineWidth = a, n.strokeStyle = s, n.fillStyle = l, n.arcTo(t + i, e, t + i, e + r, o), n.arcTo(t + i, e + r, t, e + r, o), n.arcTo(t, e + r, t, e, o), n.arcTo(t, e, t + i, e, o), n.stroke(), n.fill(), n.closePath() }(5, 87, 246, 100, 30, 0, "rgba(0,0,0,.4)", "rgba(0,0,0,.4)"), n.fillStyle = "rgba(255,255,255,.85)", n.fillText(t, (i.width - o) / 2, (i.height + 54) / 2); var a = new r.Texture(i); return a.needsUpdate = !0, a }, loadCanvasIn: function(t) { var e = 255, i = 255, n = 255, o = .85, a = "rgba(0,0,0,.4)", s = "rgba(0,0,0,.4)"; (u = (l = document.createElement("canvas")) .getContext("2d")) .font = "100px Arial"; var l, u, h = u.measureText(t) .width + 60, c = h + 4; (u = (l = document.createElement("canvas")) .getContext("2d")) .canvas.width = c, u.canvas.height = 144, u.font = "Bold 100px Arial", function(t, e, i, n, r, o) { t.beginPath(), t.moveTo(e + o, i), t.lineWidth = 1, t.strokeStyle = s, t.fillStyle = a, t.arcTo(e + n, i, e + n, i + r, o), t.arcTo(e + n, i + r, e, i + r, o), t.arcTo(e, i + r, e, i, o), t.arcTo(e, i, e + n, i, o), t.stroke(), t.fill(), t.closePath() }(u, 1, 1, h + 2, 142, 30), u.fillStyle = "rgba(" + e + "," + i + "," + n + "," + o + ")", u.fillText(t, 32, 102); var d = new r.Texture(l); return d.minFilter = r.LinearFilter, d.magFilter = r.LinearFilter, d.needsUpdate = !0, d }, isLoaded: function(t) { return !!o[t] } } }, function(t, e) { t.exports = { visibleFloor: 1, ghostFloor: 3, boundingSkybox: 1, panoMarker: 2, reticule: 3, mattertagDisc: 1, mattertagCutout: 2, mattertagStem: 3, ribbon: 100 } }, function(t, e, i) { var n = i(0); t.exports = { UP: new n.Vector3(0, 1, 0), DOWN: new n.Vector3(0, -1, 0), LEFT: new n.Vector3(-1, 0, 0), RIGHT: new n.Vector3(1, 0, 0), FORWARD: new n.Vector3(0, 0, -1), BACK: new n.Vector3(0, 0, 1) } }, function(t, e, i) { "use strict"; (function(e) { var n, r = i(22), o = i(3), a = i(0), s = i(2), l = i(1), u = i(17), h = i(106), c = i(8), d = i(10), p = i(11), f = i(16), m = i(36), g = i(107), v = i(55), y = i(23), b = i(14), w = i(30), x = i(4) .EventEmitter, M = new s("/js/objects/Panorama.js"), T = new a.SphereBufferGeometry(.1), S = new a.PlaneBufferGeometry(.2, .2, 1, 1), _ = f.loadurl(r.splitUrl("./images/texture/location/location_512x512.png")), A = f.loadurl(r.splitUrl("./images/texture/location/disable_512x512.png")), P = parseInt(o.getQueryString("reticule")); function C(t, e, i, n) { if (this.model = t, this.enable = i.enable, this.id = e, this.alignmentType = i.alignmentType || h.ALIGNED, this.u = i.u || 0, this.v = i.v || 0, this.roomid = i.roomid, this.neighbourUUIDs = i.neighbours || null, this.neighbourPanos = null, this.floor = null, this.floorIndex = i.floor, this.failedLoadingAt = 0, this.maxLoadRetries = 4, this.adjustAngleEnable = i.angle_enable, this.adjustTAngleX = 0, this.adjustTAngleY = 0, this.adjustTAngleZ = 0, this.adjustAngleX = i.angle_x, this.adjustAngleY = i.angle_y, this.adjustAngleZ = i.angle_z, this.color = { brightness: i.color.brightness, contrast: i.color.contrast, gamma: i.color.gamma, hue: i.color.hue, saturation: i.color.saturation, vibrance: i.color.vibrance, balance: i.color.balance }, this.origin = i.position.clone(), this.originPosition = i.position.clone(), this.position = this.alignmentType === h.UNALIGNED ? new a.Vector3(0, -5, 0) : i.position.clone(), this.quaternion = i.quaternion.clone(), this.quaternionAutoScene = i.quaternionAutoScene.clone(), this.skyboxMesh = new a.Mesh(T), this.skyboxMesh.position.copy(this.position), this.skyboxMesh.quaternion.copy(this.quaternion), this.skyboxMesh.name = "skybox", this.skyboxMesh.visible = !1, this.skyboxMesh.updateMatrix(), this.marker = null, this.isAligned()) { var o = this.enable ? _ : A; this.marker = new a.Mesh(S, new a.MeshBasicMaterial({ map: o, side: a.DoubleSide, opacity: 1, transparent: !0, depthWrite: !1 })), this.marker.renderOrder = u.panoMarker, this.marker.name = "marker", this.marker.pano = this, this.marker.userData.postils = {}, this.marker.userData.default_texture = o, l.colorMarkerOnLoad && this.on("load", (function() { this.marker.material.color.set(65280) })) } this.debugColor = (new a.Color) .setHSL(.06 + .53 * Math.random(), .8 + .2 * Math.random(), .5 + .2 * Math.random()), this.floorPosition = i.puck ? i.puck.clone() : null, this.tiled = n, this.tiled ? this.solidSkybox = null : (this.solidSkybox = new a.Texture([null, null, null, null, null, null]), this.solidSkybox.flipY = !1, l.minimalMemoryMode && (this.solidSkybox.minFilter = a.LinearFilter, this.solidSkybox.magFilter = a.LinearFilter, this.solidSkybox.generateMipmaps = !1)), this.zoomed = !1, this.panoRenderer = null, this.qualityManager = null, this.tileDownloader = null, this.tiledPanoRenderTarget = null, this.minimumTiledPanoLoaded = !1, this.highestPartialTileRenderOpCompleted = 0, this.highestFullTileRenderOpCompleted = 0, this.shouldRedrawOnBaseLoaded = !1, this.lockUntilRenderingComplete = !1, l.colorMarkerOnLoad && this.on("load", (function() { this.marker.material.color.set(65280) })), 1 === P && this.marker && this.marker.visible && (this.marker.visible = !1); var s = new a.TextureLoader; s.setCrossOrigin(!0); var c = s.load(r.splitUrl("./images/texture.jpg")); if (this.vrMarker = new a.Mesh(new a.OctahedronGeometry(.1, 0), new a.MeshLambertMaterial({ color: 16777215, transparent: !0, opacity: .75, map: c })), this.vrMarker.boluoType = "vr", this.vrMarker.position.z = 1, this.vrMarker.enabled = !0, this.vrMarker.visible = !1, window.vrMarkers = window.vrMarkers || [], window.vrMarkers.push(this.vrMarker), this.marker && this.marker.add(this.vrMarker), l.showAxis && (this.skyboxMesh.add(new a.ArrowHelper(new a.Vector3(0, 1, 0), new a.Vector3(0, 0, 0), 1, 255)), this.skyboxMesh.add(new a.ArrowHelper(new a.Vector3(0, 0, 1), new a.Vector3(0, 0, 0), 1, 16711680)), this.skyboxMesh.add(new a.ArrowHelper(new a.Vector3(1, 0, 0), new a.Vector3(0, 0, 0), 1, 65280))), this.adjustAngleEnable) { var d = new a.Quaternion; d.setFromAxisAngle(new a.Vector3(1, 0, 0), this.adjustAngleX), this.skyboxMesh.quaternion.multiply(d); var p = new a.Quaternion; p.setFromAxisAngle(new a.Vector3(0, 1, 0), this.adjustAngleY), this.skyboxMesh.quaternion.multiply(p); var f = new a.Quaternion; f.setFromAxisAngle(new a.Vector3(0, 0, 1), this.adjustAngleZ), this.skyboxMesh.quaternion.multiply(f), this.skyboxMesh.updateMatrix(), this.skyboxMesh.updateMatrixWorld(), this.model.updateProjectedPanos() } if (t.rooms_real) { var m = t.rooms_real.findIndex((function(t) { return i.roomid == t.roomidx })); - 1 !== m && (m = t.rooms_real[m], this.areaName = m.roomname, this.areasPoints = JSON.parse(m.kpoints), this.areaSize = m.area) } } C.prototype = Object.create(x.prototype), C.prototype.enter = function() { this.emit("enter") }, C.prototype.exit = function() { this.tiled ? (this.clearWaitDeferreds(), this.minimumTiledPanoLoaded = !1, this.tiledPanoRenderTarget = null, this.setZoomed(!1), this.panoRenderer.deactivateTiledPano(this), this.highestPartialTileRenderOpCompleted = 0, this.highestFullTileRenderOpCompleted = 0) : (this.solidSkybox.dispose(), this.solidSkybox.loaded = !1, this.solidSkybox.version = 0), this.emit("exit") }, C.prototype.hoverOn = function(t) { this.marker && (c.start(d.property(this.marker.material, "opacity", l[t].markerOpacityOnHover), 250), l.navigation.panoScores & l.navigation.mouseDirection && this.addTextSprite("HIT", 12525854)) }, C.prototype.hoverOff = function(t) { this.marker && c.start(d.property(this.marker.material, "opacity", l[t].markerOpacity), 250) }, C.prototype.build1 = function() { this.floor = this.floor || this.model.floors.get(this.floorIndex) || this.raycastToFindFloor() || this.model.getFloorAtPoint(this.position), this.floor.addPano(this), this.floorPosition = this.floorPosition || this.raycastFloorPosition(), this.neighbourPanos = this.neighbourPanos || this.findNeighourPanos(), l.colorMarkerByFloor && this.marker && this.marker.material.color.set(this.floor.debugColor) }, C.prototype.build2 = function() { this.floorPosition = this.floorPosition || this.interpolateFloorPosition(), this.height = this.position.distanceTo(this.floorPosition), this.placeMarker() }, C.prototype.updateAngleDisplay = function() {}, C.prototype.updateColorDisplay = function() {}, C.prototype.changeColor = function(t, e, i) { "balance_R" === e ? this.color.balance.x = i / 100 : "balance_G" === e ? this.color.balance.y = i / 100 : "balance_B" === e ? this.color.balance.z = i / 100 : this.color[e] = i / 100, t.setProjectedPanos(this, this, !1) }, C.prototype.resetColor = function(t) { this.color.brightness = 0, this.color.contrast = 0, this.color.gamma = 1, this.color.hue = 0, this.color.saturation = 0, this.color.vibrance = 0, this.color.balance = new a.Vector3, this.updateColorDisplay(), t.setProjectedPanos(this, this, !1) }, C.prototype.applyAllColor = function(t) { for (var e = 0; e < t.panos.list.length; e++) t.panos.list[e].color.brightness = this.color.brightness, t.panos.list[e].color.contrast = this.color.contrast, t.panos.list[e].color.gamma = this.color.gamma, t.panos.list[e].color.hue = this.color.hue, t.panos.list[e].color.saturation = this.color.saturation, t.panos.list[e].color.vibrance = this.color.vibrance, t.panos.list[e].color.balance.copy(this.color.balance) }, C.prototype.updateTAngleDisplay = function() {}, C.prototype.updateAngle = function(t, e) { function i(t) { var e = parseFloat(t); if (!isNaN(e)) return e = Math.round(1e3 * t) / 1e3 } if ("x" == t) { var n = new a.Vector3(1, 0, 0); if (0 == e)(r = new a.Quaternion) .setFromAxisAngle(n, -this.adjustAngleX), this.skyboxMesh.quaternion.multiply(r), this.adjustAngleX = 0; else if (1 == e) { var r = new a.Quaternion; null == this.adjustAngleX && (this.adjustAngleX = 0), this.adjustAngleX += .005, this.adjustAngleX = i(this.adjustAngleX), r.setFromAxisAngle(n, .005), this.skyboxMesh.quaternion.multiply(r) } else if (2 == e) { r = new a.Quaternion; null == this.adjustAngleX && (this.adjustAngleX = 0), this.adjustAngleX -= .005, this.adjustAngleX = i(this.adjustAngleX), r.setFromAxisAngle(n, -.005), this.skyboxMesh.quaternion.multiply(r) } } else if ("y" == t) { n = new a.Vector3(0, 1, 0); if (0 == e)(r = new a.Quaternion) .setFromAxisAngle(n, -this.adjustAngleY), this.skyboxMesh.quaternion.multiply(r), this.adjustAngleY = 0; else if (1 == e) { r = new a.Quaternion; null == this.adjustAngleY && (this.adjustAngleY = 0), this.adjustAngleY += .005, this.adjustAngleY = i(this.adjustAngleY), r.setFromAxisAngle(n, .005), this.skyboxMesh.quaternion.multiply(r) } else if (2 == e) { r = new a.Quaternion; null == this.adjustAngleY && (this.adjustAngleY = 0), this.adjustAngleY -= .005, this.adjustAngleY = i(this.adjustAngleY), r.setFromAxisAngle(n, -.005), this.skyboxMesh.quaternion.multiply(r) } } else if ("z" == t) { n = new a.Vector3(0, 0, 1); if (0 == e)(r = new a.Quaternion) .setFromAxisAngle(n, -this.adjustAngleZ), this.skyboxMesh.quaternion.multiply(r), this.adjustAngleZ = 0; else if (1 == e) { r = new a.Quaternion; null == this.adjustAngleZ && (this.adjustAngleZ = 0), this.adjustAngleZ += .005, this.adjustAngleZ = i(this.adjustAngleZ), r.setFromAxisAngle(n, .005), this.skyboxMesh.quaternion.multiply(r) } else if (2 == e) { r = new a.Quaternion; null == this.adjustAngleZ && (this.adjustAngleZ = 0), this.adjustAngleZ -= .005, this.adjustAngleZ = i(this.adjustAngleZ), r.setFromAxisAngle(n, -.005), this.skyboxMesh.quaternion.multiply(r) } } this.skyboxMesh.updateMatrix(), this.skyboxMesh.updateMatrixWorld(), this.model.updateProjectedPanos() }, C.prototype.updateTAngle = function(t, e) { function i(t) { var e = parseFloat(t); if (!isNaN(e)) return e = Math.round(1e3 * t) / 1e3 } if ("" !== e) { if ("y" == t) { var n = new a.Vector4(0, i(e), 0, 0); n.applyMatrix4(this.skyboxMesh.matrix), this.adjustTAngleY = i(e), this.position.setX(this.originPosition.x + n.x), this.position.setY(this.originPosition.y + n.y), this.position.setZ(this.originPosition.z + n.z), this.skyboxMesh.position.copy(this.position) } this.skyboxMesh.updateMatrix(), this.skyboxMesh.updateMatrixWorld(), this.model.updateProjectedPanos(), this.position.setFromMatrixPosition(this.skyboxMesh.matrixWorld) } }, C.prototype.update = function(t) { this.skyboxMesh.updateMatrixWorld() }, C.prototype.interpolateFloorPosition = function() { var t = this.model.panos.filter(C.filters.isNeighbourPanoTo(this)) .filter((function(t) { return !!t.floorPosition })) .sort(function(t, e) { return t.position.distanceTo(this.position) - e.position.distanceTo(this.position) }.bind(this)), e = this.position.clone(); return t.length >= 2 ? e.y = (t[0].floorPosition.y + t[1].floorPosition.y) / 2 : e.add(l.noMeshFloorPositionOffset), e }, C.prototype.raycastFloorPosition = function() { M.warn("Performance warning: Raycasting to find floor position"); var t = new a.Raycaster(this.position, new a.Vector3(0, -1, 0)) .intersectObjects(this.model.colliders); return t.length ? t[0].point : null }, C.prototype.raycastToFindFloor = (n = [new a.Vector3(0, -1, 0), new a.Vector3(1, -1, 0), new a.Vector3(0, -1, 1), new a.Vector3(-1, -1, 0), new a.Vector3(0, -1, -1), new a.Vector3(1, 0, 0), new a.Vector3(0, 0, 1), new a.Vector3(-1, 0, 0), new a.Vector3(0, 0, -1)], function() { for (var t = 0; t < n.length; t++) { var e = new a.Raycaster(this.position.clone(), n[t].clone()) .intersectObjects(this.model.colliders); if (e.length) return e[0].object.parent.parent } return null }), C.prototype.placeMarker = function() { this.marker && (this.marker.position.copy(this.floorPosition), this.marker.position.y += .05, this.marker.lookAt(new a.Vector3(0, 1, 0) .add(this.marker.position))) }, C.prototype.findClosestMidtpointPanoTo = function(t) { return (new a.Vector3) .addVectors(this.position, t.position) .divideScalar(2), this.model.panos.find([C.filters.notIn([this, t])], [C.sortFunctions.distanceToPoint(point)]) }, C.prototype.attachToPanoRenderer = function(t) { this.panoRenderer = t, this.panoRenderer.on(v.TileRenderSuccess, this.onTileRendered.bind(this)), this.panoRenderer.on(v.PanoRenderComplete, this.onPanoRendered.bind(this)), this.panoRenderer.on(v.TileRenderFailure, this.onTileRenderFail.bind(this)), this.panoRenderer.on(v.UploadAttemptedForAllTiles, this.onUploadAttemptedForAllTiles.bind(this)) }; var E = {}; C.prototype.getWaitDeferred = function(t) { var i = E[this.id]; i || (i = {}, E[this.id] = i); var n = i[t]; return n || (n = { deferred: e.Deferred(), active: !1 }, i[t] = n), n }, C.prototype.resetWaitDeferred = function(t) { var i = this.getWaitDeferred(t); i.active = !1, i.deferred = e.Deferred() }, C.prototype.clearWaitDeferreds = function() { var t = E[this.id]; for (var i in t || (t = {}, E[this.id] = t), t) if (t.hasOwnProperty(i)) { var n = t[i]; n.active = !1, n.deferred = e.Deferred() } }, C.prototype.loadTiledPano = function() { var t = [], e = []; return function(i, n, r, o, a, s) { null != o || (o = !0), null != a || (a = !0); var l = this.getWaitDeferred(i), u = l.deferred, h = null, c = null; if (r && ("number" == typeof r ? h = r : (h = r.hFov, c = r.vFov)), !this.isLoaded(i)) { if (!l.active) { if (l.active = !0, r) { var d = w.matchingTilesInDirection(this, i, n, h, c); t[this.id + ":" + i] = { tileCount: 0, targetTileCount: d }, M.info("Loading partial pano: " + this.id + " with " + d + " tiles") } e[this.id] || (e[this.id] = !0, this.on(g.LoadComplete, function(t, e) { var i = this.getWaitDeferred(t) .deferred; i && "pending" === i.state() && this.highestPartialTileRenderOpCompleted >= t && (i.resolve(t, e), this.resetWaitDeferred(t)) }.bind(this)), this.on(g.LoadFailed, function(t) { var e = this.getWaitDeferred(t) .deferred; e && "pending" === e.state() && this.highestPartialTileRenderOpCompleted >= t && (e.reject(t), this.resetWaitDeferred(t)) }.bind(this)), this.on(g.TileLoaded, function(e, i, n) { this.id == window.firstPanoId && 512 == e && window.loadingCount++; var r = this.getWaitDeferred(e) .deferred; if (r && "pending" === r.state()) { r.notify(e, i, n); var o = t[this.id + ":" + e]; o && (o.tileCount++, o.tileCount === o.targetTileCount && (this.onPanoRendered(this.id, e, n, !0), r.resolve(e, n), this.resetWaitDeferred(e))) } }.bind(this))) } this.tileDownloader.forceQueueTilesForPano(this, i, n, h, c, s), this.tiledPanoRenderTarget = this.panoRenderer.activateTiledPano(this, this.qualityManager.getMaxPanoSize(), o, a), this.panoRenderer.renderPanoTiles(this.id, n, a) } return u.promise() } }(), C.prototype.onUploadAttemptedForAllTiles = function(t, e, i) { o.isMobile() || t === this.id && e === this.qualityManager.getPanoSize(y.BASE) && this.shouldRedrawOnBaseLoaded && (this.shouldRedrawOnBaseLoaded = !1, this.panoRenderer.resetRenderStatus(t), this.panoRenderer.renderPanoTiles(this.id, null, !0, !0)) }, C.prototype.onTileRendered = function(t, e, i, n) { t === this.id && this.emit(g.TileLoaded, e, i, n) }, C.prototype.onPanoRendered = function(t, e, i, n) { t === this.id && (this.minimumTiledPanoLoaded = !0, this.skybox = this.tiledPanoRenderTarget.texture, e > this.highestPartialTileRenderOpCompleted && (this.highestPartialTileRenderOpCompleted = e), !n && e > this.highestFullTileRenderOpCompleted && (this.highestFullTileRenderOpCompleted = e), this.emit("load", e), this.model.emit("load", this), this.emit(g.LoadComplete, e, i)) }, C.prototype.onTileRenderFail = function(t, e, i) { t === this.id && this.emit(g.LoadFailed, e) }, C.prototype.getSkyboxTexture = function() { return this.tiled ? this.minimumTiledPanoLoaded ? this.zoomed ? this.panoRenderer.zoomRenderTarget.texture : this.tiledPanoRenderTarget.texture : null : this.solidSkybox }, C.prototype.isLoaded = function(t) { if (this.tiled) { if (t && "string" == typeof t) throw new b("Wrong panoSize given to Panorama.isLoaded(); a tiled pano uses PanoSizeClass"); return !!this.minimumTiledPanoLoaded && (!t || this.highestPartialTileRenderOpCompleted >= t) } if (t && "number" == typeof t) throw new b("Wrong panoSize given to Panorama.isLoaded(); a non-tiled pano uses high/low."); return !!this.solidSkybox.high || t in this.solidSkybox }, C.prototype.getAjustedColors = function() { return this.color }, C.prototype.loadCube = function(t) { if (this.isLoaded(t)) return M.info("Skipping load of pano, already loaded"), e.when(); this.emit("loading", t), this.model.emit("loading", this); var i = m.getCubemapUrls(this.model.urls, this.id, t), n = i.filter((function(t) { return !t })); "low" === t && n.length > 0 && (M.info("Pano", this.id, "not available in low res, loading high res right away"), t = "high", i = m.getCubemapUrls(this.model.urls, this.id, t)); var r = 0, o = [0, 1, 2, 3, 4, 5].map(function(t, e, n) { return p.getImage(i[e]) }.bind(this)), a = t; return e.when(o[0], o[1], o[2], o[3], o[4], o[5]) .then(function(t, e, i, n, r, o) { return this.solidSkybox[a] = [t, e, i, n, r, o], "high" !== a && this.solidSkybox.high || (this.solidSkybox.image = this.solidSkybox[a], this.solidSkybox.low = null), this.solidSkybox.needsUpdate = !0, this.emit("load", a), this.model.emit("load", this), this }.bind(this), function() { I.error("Downloading cubemap for pano", this.id, "failed"), this.failedLoadingAt = Date.now() }.bind(this), (function() { return e.when(++r, 6) })) }, C.raycastsSkipped = 0, C.raycastsDone = 0, C.prototype.findNeighourPanos = function() { return this.model.panos.setNeighbour(this.id, this.id, !1), this.model.panos.forEach(function(t) { if (t !== this && (!this.model.panos.neighbourMap[this.id] || void 0 === this.model.panos.neighbourMap[this.id][t.id])) { var e = this.position.distanceTo(t.position); if (e > l.panoramaNeighbourMaxDistance) return this.model.panos.setNeighbour(this, t, !1), void C.raycastsSkipped++; var i = t.position.clone() .sub(this.position) .normalize(), n = new a.Raycaster(this.position, i.clone(), 0, e) .intersectObjects(this.model.colliders); C.raycastsDone++, this.model.panos.setNeighbour(this, t, 0 === n.length), l.showNeighbourRaycasts && (n.length ? this.floor.model.add(new a.ArrowHelper(i, this.position, n[0].distance, 16711680)) : this.floor.model.add(new a.ArrowHelper(i, this.position, e, 16777215, 0, 0))) } }.bind(this)), this.model.panos.neighbourMap[this.id] }, C.prototype.worldPosition = function() { return this.position }, C.prototype.addTextSprite = function(t, e) { this.removeTextSprite(); var i = document.createElement("canvas"), n = i.getContext("2d"); i.width = 256, i.height = 256; n.font = "bold 60px Arial", n.fillStyle = "white"; var r = n.measureText(t) .width; n.fillText(t, (i.width - r) / 2, (i.height + 60) / 2); var o = new a.Texture(i); o.needsUpdate = !0; var s = new a.SpriteMaterial({ map: o, color: e || 16428055 }); this.text3d = new a.Sprite(s), this.text3d.position.copy(this.skyboxMesh.position), this.floor.add(this.text3d) }, C.prototype.removeTextSprite = function() { this.text3d && (this.floor.remove(this.text3d), this.text3d = null) }, C.prototype.removeLocationTextSprite = function() { this.locationText && (this.floor.remove(this.locationText), this.locationText = null) }, C.prototype.isAligned = function() { return this.alignmentType === h.ALIGNED }, C.filters = { inDirection: function(t, e, i) { return function(n) { return n.position.clone() .sub(t) .normalize() .dot(e) > i } }, inFloorDirection: function(t, e, i) { return function(n) { return n.floorPosition.clone() .sub(t) .normalize() .dot(e) > i } }, inPanoDirection: function(t, e, i) { return i = l.navigation.panoScores ? l.navigation.filterStrictness : i, function(n) { var r = n.floorPosition.clone() .sub(t) .normalize(), o = n.position.clone() .sub(t) .normalize(); return r.dot(e) > i || o.dot(e) > i } }, atFloor: function(t) { return function(e) { return !t || e.floor === t } }, not: function(t) { return function(e) { return e != t } }, notIn: function(t) { return function(e) { return -1 === t.indexOf(e) } }, isLoaded: function() { return function(t) { return t.isLoaded() } }, isNotLoaded: function() { return function(t) { return !t.isLoaded() } }, isCloseEnoughTo: function(t, e) { return function(i) { return t.distanceTo(i.floorPosition) < e } }, hasMinimumHeightDifferenceTo: function(t, e) { return function(i) { return Math.abs(i.position.y - t.y) > e } }, isNotBehindNormal: function(t, e) { var i = new a.Vector3; return e = e.clone(), function(n) { return i.copy(n.position) .sub(t) .normalize() .dot(e) > 0 } }, isNeighbourPanoTo: function(t) { return function(e) { return !t || !t.neighbourPanos || !!t.neighbourPanos[e.id] } }, isNeighbourOfNeighbourTo: function(t) { return function(e) { return !!t.neighbourPanos[e.id] || t.neighbourUUIDs.some((function(i) { var n = t.model.panos.get(i); return !!n && n.neighbourPanos[e.id] })) } }, isNotRecentlyFailed: function(t) { return function(e) { return Date.now() - e.failedLoadingAt > t } }, isOnVisibleFloor: function() { return function(t) { return !t.floor.hidden } }, isPanoAligned: function() { return function(t) { return t.isAligned() } } }, C.sortFunctions = { distanceToPoint: function(t) { return function(e, i) { return e.position.distanceTo(t) - i.position.distanceTo(t) } }, floorDistanceToPoint: function(t) { return function(e, i) { return e.floorPosition.distanceTo(t) - i.floorPosition.distanceTo(t) } }, choose: function(t) { return function(e, i) { return t.id === e.id ? -1 : t.id === i.id ? 1 : 0 } } }, C.scoreFunctions = { distance: function(t, e) { return e = e || l.navigation.distanceFactor, function(i) { return t ? t.position.distanceTo(i.position) * e : 0 } }, distanceSquared: function(t, e) { return e = e || l.navigation.distanceFactor, function(i) { return t ? t.position.distanceToSquared(i.position) * e : 0 } }, direction: function(t, e) { return function(i) { return i.position.clone() .sub(t) .normalize() .dot(e) * l.navigation.directionFactor } }, angle: function(t, e) { return function(i) { return i.position.clone() .sub(t) .normalize() .angleTo(e) * l.navigation.angleFactor } }, inFieldOfView: function(t, e) { return function(i) { return i.position.clone() .sub(t) .normalize() .dot(e) > .75 ? 10 : -1 } }, optionality: function(t) { return function(e) { return e.neighbourUUIDs.filter((function(e) { return !(e in t.neighbourUUIDs) && e !== t.id })) .length * l.navigation.optionalityFactor } }, penalizeHeightDifferenceUnder: function(t, e) { return function(i) { return t.y - i.position.y < e ? -20 : 0 } } }, C.prototype.setZoomed = function(t) { this.zoomed = t, this.updateSkyboxForZoomLevel() }, C.prototype.updateSkyboxForZoomLevel = function() { this.minimumTiledPanoLoaded && this.model.updateProjectedPanos() }, C.prototype.ensureSkyboxReadyForRender = function() { this.tiled || (this.solidSkybox.loaded || (this.solidSkybox.needsUpdate = !0), this.solidSkybox.loaded = !0) }, t.exports = C }) .call(this, i(6)) }, function(t, e) { t.exports = { Move: "move", MoveComplete: "move.complete", ModeChanged: "mode.changed", ModeChanging: "mode.changing", RulersMove: "rulers.move", PanoChosen: "pano.chosen", warpTravelBlack: "warp.travel.black", ClosestPanoChanging: "closest.pano.changing", WarpStarted: "warp.started", WarpInterrupted: "warp.interrupted", WarpEnded: "warp.ended", FlyingStarted: "flying.started", FlyingInterrupted: "flying.interrupted", FlyingEnded: "flying.ended", Ready: "ready", StartInside: "start.inside", StartOutside: "start.outside", ViewChanged: "view.changed", WarpInterruptedWithFlyTo: "warp.interrupted.flyto", InputStart: "input.start", EditAddTagHighlight: "edit.add.taghighlight", ClickTag: "clickTag" } }, function(t, e) { t.exports = { ModelAdded: "model-added", ActiveModelChanged: "active-model-changed" } }, function(t, e, i) { var n = i(1); t.exports.splitUrl = function(t) { if (n.isLocalVersion) { return t.split("/common/")[1] ? window.location.origin + window.location.pathname.split("index.html")[0] + "/" + t.split("/common/")[1] : window.location.origin + window.location.pathname.split("index.html")[0] + "/" + t.split("/common/")[0] } return t }, t.exports.splitComUrl = function(t) { return n.isLocalVersion ? t.split("/common/")[1] : t } }, function(t, e) { t.exports = { BASE: 1, STANDARD: 2, HIGH: 3, ULTRAHIGH: 4 } }, function(t, e, i) { "use strict"; t.exports = { BLACK: "black", STD: "std", WALK: "walk" } }, function(t, e, i) { var n, o = i(3), a = new(i(2))("js/utils/showcase"); t.exports = { getAuthorizationHeader: function() { var t = o.valueFromHash("auth"); if (t) return t.replace(",", " "); var e = o.valueFromCookie("token"); return e ? "Token " + e : null }, parseModelid: function(t) { var e, i; return t = t || "", i = (e = window.location.protocol + "//" + window.location.host) + "/api/player/models/" + t, { baseurl: window.location.protocol + "//" + window.location.host, playdir: "play", dataroot: "data", modelid: t, versiondir: "", locationpics: "", urlBase: e, urlModel: i, urlFiles: i + (i.match(/\/$/) ? "files" : "/files"), urlThumb: i + (i.match(/\/$/) ? "thumb" : "/thumb") } }, getModelIDFromQueryString: function() { return o.valueFromHash("model") || o.valueFromHash("m") }, normalizeModeldata: function(t, e) { return (t = JSON.parse(JSON.stringify(t))) .scenes.forEach((function(t) { if (t._camera && "string" == typeof t._camera) try { t._camera = JSON.parse(t._camera) } catch (e) { a.warn("Unable to parse scene camera"), t._camera = null } else "object" == typeof t._camera && a.debug("scene.camera already a JSON object"); t._camera && (t._camera._rotation && (t._camera._rotation = e.convertWorkshopQuaternion(t._camera._rotation)), t._camera._viewpoint && (t._camera._viewpoint = e.convertWorkshopVector(t._camera._viewpoint)), t._camera._zoom = e.convertWorkshopOrthoZoom(t._camera._zoom)) })), t }, visionVersionToInt: (n = new RegExp(["(?:[0-9.]+\\.){1,4}", "([0-9]+)", "[^\\.]*$"].join("")), function(t) { if (!t) throw new Error("Vision version is required"); var e = n.exec(t); if (null === e) throw new Error("String is not a vision version: " + t); return parseInt(e[1]) }), modelDataPromisesTiles: function(t) { if (t.vision_version) try { return l.visionVersionToInt(t.vision_version) >= l.visionVersionToInt(r.visionTilingStartVersion) } catch (e) { s.warn("Invalid vision version: " + t.vision_version) } var e = t.created ? new Date(t.created) : null; return e && e >= r.visionTilingStartDate } } }, function(t, e) { t.exports = { signedUrlDefaultExpireTime: 24e4, signedUrlCheckInterval: 1e4, signedUrlRefreshBuffer: 15e3, dollhouseFOV: 70, dollhouseNear: 1, dollhouseFar: 5e3, insideFOV: 70, insideNear: .1, insideFar: 5e3, insideLookSpeed: .12, insideLookLimitUp: 50, insideLookLimitDown: -50, orthoNear: 1, orthoFar: 5e3, orthoBase: 10, narrowLandscapeHeight: 290, reallyNarrowLandscapeHeight: 250, visionTilingStartDate: new Date("8/26/2016"), visionTilingStartVersion: "1.1.407.13667", windowHeightHighQualityThreshold: 1200, tourStepDelayDefault: 3500, tourStepDelaySlideShow: 5e3, workshopApsect: 9 / 16, highQualityMaxZoom: 2, ultraHighQualityMaxZoom: 1.5 } }, function(t, e) { t.exports = { Move: "move", InteractionDirect: "interaction.direct", InteractionKey: "interaction.key", InteractionGui: "interaction.gui", FlyInDirection: "fly.direction", InputStart: "input.start", Pinch: "input.pinch", Scroll: "input.scroll", HideEvent: "panorama.move", RulersMove: "rulers.move", RulersWalk: "rulers.walk", TtagsMove: "titletag.move", PanoramaMove: "camera.move", PanoramaMoveStop: "camera.move.stop" } }, function(t, e, i) { (function(e) { var n, r, o, a = i(4) .EventEmitter, s = i(104); function l() { this.uuid = "", this.sendOperationFalg = !1, this.initState = !1, this.signalState = !1, this.busyState = !1, this.busySended = !1, this.voiceFlag = !1, this.sync = !1; var t = !1; this.remoteControl = !1, this.syncInitState = !1, this.handelCallTimeOut = null, this.hangupType = "timeout", this.lookInstance = null; var e = this; Object.defineProperty(this, "busy", { get: function() { return t }, set: function(i) { if (i) { if (e.remoteControl) return void e.emit("remote_busy"); t = !0, this.sync = !1, this.sendBusy() } else t = !1, this.cancelBusy() } }), this.showTip = function() {}, this.getCurrentState = function() {}, this._handleMessage = this._handleMessage.bind(this), this._handleCall = this._handleCall.bind(this), this.callTimeHandle = null, this.userInfo = { identity: "4", customer: { state: !1, nickName: "客户", phoneNum: "15311496327", identity: "4", headImg: "", accid: "" }, bussiness: { state: !1, nickName: "经纪人", phoneNum: "18911926367", identity: "1", headImg: "", accid: "" } } } l.prototype = Object.create(a.prototype), l.prototype.constructor = l, l.prototype.init = function() { var t = this, e = ""; if (e = "4" === this.userInfo.identity ? this.userInfo.bussiness.accid : this.userInfo.customer.accid, this.lookInstance = new s({ remoteAccid: e }), "platform-error" === this.lookInstance.init()) throw new Error("platform-error"); return this.lookInstance.on("onData", this._handleMessage), this.lookInstance.on("onCall", this._handleCall), this.lookInstance.on("refuse", (function() { t.emit("bussiness_busy") })), this.lookInstance.on("hangup", (function() { "timeout" !== t.hangupType && ("4" === t.userInfo.identity ? t.userInfo.bussiness.state = !1 : t.userInfo.customer.state = !1, t.emit("close_connect", t.userInfo), t.destory()) })), this.lookInstance.on("busy", (function() { this.lookInstance.hangup() })), this.signalState = !0, this.emit("init_done"), this.initState = !0, this.sendState({ type: "connectState", state: "initdone" }), "4" === this.userInfo.identity ? t.userInfo.customer.state = !0 : t.userInfo.bussiness.state = !0, !0 }, l.prototype._getUserinfoType = function(t, e) { var i = t[e]; return { nickName: i[e + "Nickname"], headImg: i[e + "HeadImage"], identity: i[e + "Identity"], accid: i[e + "Accid"] } }, l.prototype.joinChannel = function(t, e, i) { if (this.emit("init"), this.getCurrentState = e, t) { var n = this._getUserinfoType(t, "bussiness"), r = this._getUserinfoType(t, "customer"); this.userInfo.identity = t.currentIdentity, this.userInfo.bussiness = n, this.userInfo.customer = r } this.init() }, l.prototype._handleCall = function() { "4" === this.userInfo.identity ? this.userInfo.bussiness.state = !0 : this.userInfo.customer.state = !0, this.emit("identity", this.userInfo), this.emit("callsuccess"), this.emit("user_connected"), this.hangupType = "hangup", this.voiceFlag = !0 }, l.prototype._handleMessage = function(t) { var e = JSON.parse(t); switch (e.type) { case "state": this._handleState(e); break; case "operation": this._handleOpertation(e); break; case "busy": this._handleBusy(e) } }, l.prototype.setBusy = (n = null, function() { var t = this; null !== n ? (clearTimeout(n), n = null) : (this.sync = !1, this.sendState({ type: "busyState", state: "busy" }), this.busySended = !0), n = setTimeout((function() { t.sendState({ type: "busyState", state: "nobusy" }), n = null, t.busySended = !1 }), 400) }), l.prototype.sendBusy = function() { this.busySended || (this.sync = !1, this.sendState({ type: "busyState", state: "busy" }), this.busySended = !0) }, l.prototype.cancelBusy = (r = null, function() { var t = this; null !== r && clearTimeout(r), r = setTimeout((function() { t.sendState({ type: "busyState", state: "nobusy" }), t.busySended = !1 }), 2500) }), l.prototype.getSyncState = function() { return this.remoteControl ? (this.emit("remote_busy"), !1) : (this.sync = !1, !0) }, l.prototype._handleBusy = function(t) { "busy" === t.state ? (this.remoteControl = !0, this.sync = !0) : this.remoteControl = !1 }, l.prototype._handleState = function(t) { var e = t.data; switch (e.type) { case "connectState": this._handleConnectState(e); break; case "busyState": this._handleBusy(e) } }, l.prototype.startVoiceLink = function() { "4" === this.userInfo.identity && this.lookInstance.call() }, l.prototype.setStateDone = function() { this.syncInitState && (this.sendState({ type: "connectState", state: "initstatedone" }), "4" !== this.userInfo.identity && (this.userInfo.customer.state = !0, this.lookInstance.accept()), this.emit("identity", this.userInfo), this.sendOperationFalg = !0) }, l.prototype._handleConnectState = function(t) { switch (t.state) { case "initdone": var e = this.getCurrentState(); this.sendState({ type: "connectState", state: "initstate", data: e }); break; case "initstate": this.handelCallTimeOut && clearTimeout(this.handelCallTimeOut), this.syncInitState = !0, this.emit("changestate", t.data); break; case "initstatedone": this.sendOperationFalg = !0, "4" === this.userInfo.identity ? this.userInfo.bussiness.state = !0 : this.userInfo.customer.state = !0, this.emit("identity", this.userInfo) } }, l.prototype.setMute = function(t) { this.sendOperationFalg && (t ? this.lookInstance.mute() : this.lookInstance.unmute()) }, l.prototype._handleOpertation = function(t) { if (this.voiceFlag) { this.sync = !0; var e = t.data; this.emit("operation", e) } }, l.prototype.sendMessage = function(t) { this.signalState && this.lookInstance.sendData(JSON.stringify(t)) }, l.prototype.sendState = function(t) { var e = { type: "state", data: t }; this.sendMessage(e) }, l.prototype.sendOperationasdf = (o = null, function(t) { var e = this; null !== o && clearTimeout(o), o = setTimeout((function() { e.sendOperation2remote(t) }), 15) }), l.prototype.sendOperation = function(t) { if ((this.sendOperationFalg || this.voiceFlag) && "uichange" !== t.type) { var e = { type: "operation", data: t }; this.sendMessage(e) } }, l.prototype.destory = function() { this.lookInstance && this.lookInstance.hangup(), this.sendOperationFalg = !1, this.busyState = !1, this.sync = !1, this.remoteControl = !1, e("#customer-info") .find(".voice-button") .removeClass("mute") .addClass("unmute"), e("#proxy-info") .find(".voice-button") .removeClass("mute") .addClass("unmute") }; var u, h = (u = null, function(t) { return null === u && (u = new l(t)), u }); t.exports = h }) .call(this, i(6)) }, function(t, e) { t.exports = { GL_TEXTURE_CUBE_MAP_POSITIVE_X: 0, GL_TEXTURE_CUBE_MAP_NEGATIVE_X: 1, GL_TEXTURE_CUBE_MAP_POSITIVE_Y: 2, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: 3, GL_TEXTURE_CUBE_MAP_POSITIVE_Z: 4, GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: 5 } }, function(t, e, i) { var n, r, o = i(29), a = i(56), s = {}; s.TILE_SIZE = 512, s.FACES_PER_PANO = 6, s.LocationOnTile = { Center: 0, UpperLeft: 1, UpperRight: 2, LowerRight: 3, LowerLeft: 4 }, s.getTileVector = function(t, e, i, n, r, l, u, h) { var c = t / e, d = e / t * 2, p = d / 2, f = n / c * 2 - 1 + p, m = (r = c - 1 - r) / c * 2 - 1 + p; switch (l = l || s.LocationOnTile.Center) { case s.LocationOnTile.UpperLeft: f -= p, m += p, f += u * d; break; case s.LocationOnTile.UpperRight: f += p, m += p, m -= u * d; break; case s.LocationOnTile.LowerRight: f += p, m -= p, f -= u * d; break; case s.LocationOnTile.LowerLeft: f -= p, m -= p, m += u * d; break; case s.LocationOnTile.Center: } switch (i) { case o.GL_TEXTURE_CUBE_MAP_POSITIVE_X: a.setVector(h, -1, m, -f); break; case o.GL_TEXTURE_CUBE_MAP_NEGATIVE_X: a.setVector(h, 1, m, f); break; case o.GL_TEXTURE_CUBE_MAP_POSITIVE_Y: a.setVector(h, -f, 1, -m); break; case o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: a.setVector(h, -f, -1, m); break; case o.GL_TEXTURE_CUBE_MAP_POSITIVE_Z: a.setVector(h, -f, m, 1); break; case o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: a.setVector(h, f, m, -1) } a.normalize(h) }, s.getFaceForTile = function(t, e) { var i = s.TILE_SIZE; t < s.TILE_SIZE && (i = t); var n = Math.floor(t / i), r = n * n; return Math.floor(e / r) }, s.getTileLocation = function(t, e, i) { var n = s.TILE_SIZE; t < s.TILE_SIZE && (n = t); var r = s.getFaceForTile(t, e), o = Math.floor(t / n), a = e - r * (o * o); i.tileX = a % o, i.tileY = Math.floor(a / o), i.face = r, i.faceTileIndex = a }, s.getTileCountForSize = function(t) { if (t <= s.TILE_SIZE) return s.FACES_PER_PANO; var e = Math.floor(t / s.TILE_SIZE); return e * e * s.FACES_PER_PANO }, s.getRelativeDirection = (n = new a.Matrix4, r = new a.Quaternion, function(t, e) { r.copy(t), r.inverse(), n.makeRotationFromQuaternion(r), n.applyToVector3(e), a.normalize(e) }), s.matchingTilesInDirection = function() { var t = new a.Vector3, e = new a.Vector3(0, 0, -1), i = new a.Quaternion, n = function(t, e) { t.push({ face: e.face, faceTileIndex: e.faceTileIndex, tileX: e.tileX, tileY: e.tileY }) }, r = function() { var t = { face: -1, faceTileIndex: -1, tileX: -1, tileY: -1 }; return function(e, i, r) { for (var o = s.getTileCountForSize(e), a = 0, l = 0; l < o; l++) s.getTileLocation(e, l, t), i && !i(t) || (a++, r && n(r, t)); return a } }(); return function(n, o, l, u, h, c) { var d = o < s.TILE_SIZE ? o : s.TILE_SIZE; if (s.getTileCountForSize(o), !u && !h) return r(o, null, c); var p = !!h; if (h = h || u, h = Math.max(0, Math.min(h, 360)), u = Math.max(0, Math.min(u, 360)), a.copyVector(l, t), s.getRelativeDirection(n.quaternion, t), p) { i.setFromUnitVectors(t, e); return r(o, (function(t) { return s.isTileWithinFrustum(o, d, t.face, t.tileX, t.tileY, i, u, h) }), c) } return r(o, (function(e) { return s.isTileWithinFOV(o, d, e.face, e.tileX, e.tileY, t, u) }), c) } }(), s.isTileWithinFrustum = function() { var t = new a.Vector3; return function(e, i, n, r, o, l, u, h) { for (var c = Math.tan(.5 * h * a.RADIANS_PER_DEGREE), d = -c, p = Math.tan(.5 * u * a.RADIANS_PER_DEGREE), f = -p, m = s.mapFaceToCubemapFace(n), g = 0, v = 0, y = 0, b = 0, w = 0, x = s.LocationOnTile.Center; x <= s.LocationOnTile.LowerLeft; x++) if (s.getTileVector(e, i, m, r, o, x, 0, t), a.applyQuaternionToVector(l, t), t.z >= -1e-5) 0; else { var M = -1 / t.z, T = t.x * M, S = t.y * M; S > c ? g++ : S < d && v++, T > p ? y++ : T < f && b++, w++ } return v !== w && g !== w && y !== w && b !== w } }(), s.isTileWithinFOV = function() { var t = new a.Vector3, e = new a.Vector3(0, 1, 0), i = new a.Vector3(1, 0, 0); return function(n, r, o, l, u, h, c) { var d = s.mapFaceToCubemapFace(o); if (a.cross(h, e, i), s.getTileVector(n, r, d, l, u, s.LocationOnTile.Center, 0, t), s.isWithinFOV(t, h, c, null)) return !0; for (var p = c / 360, f = Math.floor(1 / p), m = 0, g = 0; g < f; g++) { for (var v = s.LocationOnTile.UpperLeft; v <= s.LocationOnTile.LowerLeft; v++) if (s.getTileVector(n, r, d, l, u, v, m, t), s.isWithinFOV(t, h, c, null)) return !0; m += p } return !1 } }(), s.isWithinFOV = function() { var t = new a.Vector3, e = new a.Vector3; return function(i, n, r, o) { if (a.copyVector(i, e), o) { a.copyVector(o, t), a.normalize(t); var s = a.dot(t, i); t.x *= s, t.y *= s, t.z *= s, a.subVector(e, t) } var l = r / 2 * a.RADIANS_PER_DEGREE, u = Math.cos(l); return a.dot(e, n) >= u } }(), s.mapFaceToCubemapFace = function() { var t = { 0: o.GL_TEXTURE_CUBE_MAP_POSITIVE_Y, 1: o.GL_TEXTURE_CUBE_MAP_POSITIVE_Z, 2: o.GL_TEXTURE_CUBE_MAP_POSITIVE_X, 3: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z, 4: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_X, 5: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y }; return function(e) { return t[e] } }(), s.getDirectionalFov = function() { var t = document.documentElement.clientWidth; return t > 0 && t < 512 ? 60 : t >= 512 && t < 1024 ? 80 : t >= 1024 && t < 2048 ? 100 : t >= 2048 && t < 4096 ? 120 : t >= 4096 ? 180 : 60 }, t.exports = s }, function(t, e) { t.exports = { NONE: 0, MIDDLE: 1, END: 2, BEGINNING: 3, FADEIN: 4 } }, function(t, e) { t.exports = { ZERO: 48, ONE: 49, TWO: 50, THREE: 51, FOUR: 52, FIVE: 53, SIX: 54, SEVEN: 55, EIGHT: 56, NINE: 57, LEFTARROW: 37, UPARROW: 38, RIGHTARROW: 39, DOWNARROW: 40, A: 65, B: 66, C: 67, D: 68, E: 69, F: 70, G: 71, H: 72, I: 73, J: 74, K: 75, L: 76, M: 77, N: 78, O: 79, P: 80, Q: 81, R: 82, S: 83, T: 84, U: 85, V: 86, W: 87, X: 88, Y: 89, Z: 90, SPACE: 32, RETURN: 13, PLUSEQUALS: 187, DASHUNDERSCORE: 189, OPENBRACKET: 219, ESC: 27, DELETE: 46 } }, function(t, e, i) { function n() { this.list = [], this.index = {}, Object.defineProperty(this, "length", { get: function() { return this.list.length } }) } new(i(2))("/js/util/IndexedCollection.js"), n.prototype.forEach = function(t) { this.list.forEach(t) }, n.prototype.add = function(t) { this.list.push(t), this.index[this.getIndex(t)] = t }, n.prototype.getIndex = function(t) { throw new Error("IndexedCollection.getIndex not implemented in subclass.") }, n.prototype.extend = function(t) { for (var e = 0; e < t.length; e++) this.add(t[e]) }, n.prototype.get = function(t) { return this.index[t] }, n.prototype.first = function() { return this.list[0] }, n.prototype.last = function() { return this.list[this.list.length - 1] }, n.prototype.reIndex = function() { this.index = {}; var t = this; this.forEach((function(e) { t.index[t.getIndex(e)] = e })) }, n.prototype.filter = function(t) { var e = this.list.filter(t); return this.reIndex(), e }, n.prototype.reduce = function(t, e) { return this.list.reduce(t, e) }, n.prototype.sort = function(t) { return this.list.sort(t) }, n.prototype.indexOf = function(t) { for (var e = 0; e < this.list.length; ++e) if (this.list[e] === t) return e; return -1 }, n.prototype.getLength = function() { return this.list.length }, t.exports = n }, function(t, e) {}, function(t, e, i) { "use strict"; (function(e) { var n, r, o, a, s, l, u = i(0), h = (i(2), i(1)), c = i(7), d = i(9), p = i(18), f = i(32), m = i(27), g = i(4) .EventEmitter, v = i(28), y = i(3), b = !1, w = !0; function x(t) { this.camera = t, this.camera.controls = this, this.target = new u.Vector3(0, 0, 0), this.lookVector = new u.Vector3, this.lookSpeed = .05, this.rotationAcc = new u.Vector2, this.rotationSpeed = new u.Vector2, this.lat = 0, this.lon = 0, this.phi = 0, this.theta = 0, this.enabled = !1, this.locked = !1, this.pointer = new u.Vector2(0, 0), this.rotationHistory = [], this.rotationDifference = new u.Vector2, this.pointerDragStart = new u.Vector2(0, 0), this.pinchDistance = 0, this.moveStart = new u.Vector2, this.moveTolerance = .01, this.pointersLimit = 2, this.pointers = [], this.euler = new u.Euler, this.el = new u.Euler, this.q0 = new u.Quaternion, this.q1 = new u.Quaternion(-Math.sqrt(.5), 0, 0, Math.sqrt(.5)), this.up = new u.Vector3(0, 1, 0), this.right = new u.Vector3(0, 0, 1), this.v = new u.Vector3, this.offsetLon = 0, this.offsetLat = 0, this.q3 = new u.Quaternion, G.panoStill = !0, this.s_rotationSpeed = new u.Vector2, this.s_rotationDifference = new u.Vector3, this.s_lat = 0, this.s_lon = 0, this.handleOperation = this.handleOperation.bind(this), this.connect = v(), this.connect.on("operation", this.handleOperation), this.lockedRotationFrom = !1, this.lockedMouseWheel = !1, this.disableKeyMove = !1, this.disableKeyRotate = !1; var e = this, i = !1; Object.defineProperty(this, "pointerDragOn", { get: function() { return i }, set: function(t) { i = t, e.connect.busy = t } }) } function M() { G.conf.isCleanUI || (G.d.tourIsPlaying && G.d.stopTour(), clearTimeout(n), n = null, b || (b = !0)) } function T() { G.conf.isCleanUI } function S(t) { t && function(t) { t && (t.preventDefault(), t.stopPropagation()) }(t) } x.prototype = Object.create(g.prototype), x.prototype.bindEvents = function(t) { t.addEventListener("mousemove", this.onMouseMove.bind(this)), t.addEventListener("mousedown", this.onMouseDown.bind(this)), t.addEventListener("mouseup", this.onMouseUp.bind(this)), t.addEventListener("mouseover", function(t) { !this.pointerDragOn || 0 !== t.which && 0 !== t.buttons || this.onMouseUp(t) }.bind(this)), t.addEventListener("touchstart", this.onTouchStart.bind(this)), t.addEventListener("touchmove", this.onTouchMove.bind(this)), t.addEventListener("touchend", this.onTouchEnd.bind(this)), t.addEventListener("contextmenu", (function(t) { t.preventDefault() })), t.addEventListener("pointerdown", this.onPointerDown.bind(this)), t.addEventListener("pointerup", this.onPointerUp.bind(this)), t.addEventListener("pointerout", this.onPointerUp.bind(this)), t.addEventListener("pointercancel", this.onPointerUp.bind(this)), t.addEventListener("pointermove", this.onPointerMove.bind(this)), t.addEventListener("keydown", this.onKeyDown.bind(this)), t.addEventListener("keyup", this.onKeyUp.bind(this)), h.useWheel && (t.addEventListener("mousewheel", this.onMouseWheel.bind(this)), t.addEventListener("DOMMouseScroll", this.onMouseWheel.bind(this))) }, x.prototype.usable = function() { return !G.ori.flag && (h.quickstart.enabled ? this.enabled : this.enabled && !this.locked) }, x.prototype.lookAt = function(t) { 0 == t.x && -5 == t.y && 0 == t.z && (t.z = -1); var e = this.camera.position.clone() .sub(t), i = 0; 0 == e.x && 0 == e.y && 0 == e.z && (e.z = 1), i = Math.atan(e.z / e.x), i += e.x < 0 ? Math.PI : 0, i += e.x > 0 && e.z < 0 ? 2 * Math.PI : 0, this.lon = u.Math.radToDeg(i) + 180; var n = Math.sqrt(e.x * e.x + e.z * e.z); i = 0, i = Math.atan(e.y / n), this.lat = -u.Math.radToDeg(i) }, x.prototype.play = function(t) { w && (this.lon = t.lon, this.lat = t.lat) }, x.prototype.record = function() { !G.R.rtime || G.R.time.getElapsedTime() - G.R.rtime > .15 ? G.R.rtime = G.R.save({ tap: "panorama", panoid: G.player.currentPano.id, action: "rotate", lon: parseFloat(this.lon.toFixed(5)), lat: parseFloat(this.lat.toFixed(5)) }) : G.R.last = { tap: "panorama", panoid: G.player.currentPano.id, action: "rotate", lon: this.lon, lat: this.lat, time: G.R.time.getElapsedTime() } }, x.prototype.startRotationFrom = function(t, e) { this.lockedRotationFrom || (d.convertScreenPositionToNDC(t, e, this.pointer), this.pointerDragOn = !0, this.pointerDragStart.copy(this.pointer), this.moveStart.copy(this.pointer), this.rotationHistory = [], this.rotationSpeed.set(0, 0), this.disableOri()) }, x.prototype.disableOri = function() { G.ori.timeoutID && clearTimeout(G.ori.timeoutID), G.ori.enable = !1 }, x.prototype.onTouchStart = function(t) { if (this.usable()) { switch (w = !1, M(), S(t), t.preventDefault(), t.stopPropagation(), t.touches.length) { case 1: this.startRotationFrom(t.touches[0].clientX, t.touches[0].clientY); break; case 2: var e = (t.touches[0].clientX - t.touches[1].clientX) / (window.renderWidth || window.innerWidth), i = (t.touches[0].clientY - t.touches[1].clientY) / (window.renderHeight || window.innerHeight); this.pinchDistance = Math.sqrt(e * e + i * i) } this.emit(m.InputStart, "touch") } }, x.prototype.onPointerDown = function(t) { this.usable() && "touch" === t.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({ id: t.pointerId, clientX: t.clientX, clientY: t.clientY }), t.touches = this.pointers, this.onTouchStart(t), this.emit(m.InputStart, "pointer")) }, x.prototype.onMouseDown = function(t) { this.usable() && (w = !1, S(), M(), 0 === t.button && this.startRotationFrom(t.clientX, t.clientY), this.emit(m.InputStart, "mouse")) }, x.prototype.updateRotation = function() { if (this.usable() && this.pointerDragOn) { this.camera.matrix.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this.camera.matrixWorld.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); var t = new u.Vector3(this.pointerDragStart.x, this.pointerDragStart.y, -1) .unproject(this.camera), e = new u.Vector3(this.pointer.x, this.pointer.y, -1) .unproject(this.camera), i = Math.sqrt(t.x * t.x + t.z * t.z), n = Math.sqrt(e.x * e.x + e.z * e.z), r = Math.atan2(t.y, i), o = Math.atan2(e.y, n); this.rotationDifference.y = u.Math.radToDeg(r - o), t.y = 0, e.y = 0; var a = Math.acos(t.dot(e) / t.length() / e.length()); isNaN(a) || (this.rotationDifference.x = u.Math.radToDeg(a), this.pointerDragStart.x < this.pointer.x && (this.rotationDifference.x *= -1)), this.pointerDragStart.copy(this.pointer) } }, x.prototype.onMouseMove = function(t) { this.usable() && (d.convertScreenPositionToNDC(t.clientX, t.clientY, this.pointer), this.pointerDragOn && (Math.abs(this.pointer.x - this.moveStart.x) > this.moveTolerance || Math.abs(this.pointer.y - this.moveStart.y) > this.moveTolerance) && this.emit(m.Move, "mouse")) }, x.prototype.onTouchMove = function(t) { if (this.usable()) { switch (t.touches.length) { case 1: d.convertScreenPositionToNDC(t.touches[0].clientX, t.touches[0].clientY, this.pointer), this.disableOri(); break; case 2: var e = (t.touches[0].clientX - t.touches[1].clientX) / (window.renderWidth || window.innerWidth), i = (t.touches[0].clientY - t.touches[1].clientY) / (window.renderHeight || window.innerHeight), n = this.pinchDistance - Math.sqrt(e * e + i * i); Math.abs(n) > .01 && (this.emit(m.InteractionDirect), this.emit(m.Pinch, n), this.pinchDistance -= n) } this.emit(m.Move, "touch") } }, x.prototype.onPointerMove = function(t) { this.usable() && "touch" === t.pointerType && (this.pointers.forEach((function(e) { t.pointerId === e.id && (e.clientX = t.clientX, e.clientY = t.clientY) })), t.touches = this.pointers, this.onTouchMove(t)) }, x.prototype.endRotation = function() { this.pointerDragOn = !1; var t = c.averageVectors(this.rotationHistory); this.rotationSpeed.set(t.x * h.rotationAfterMoveMultiplier, t.y * h.rotationAfterMoveMultiplier) }, x.prototype.onTouchEnd = function(t) { this.usable() && (T(), w = !0, t.preventDefault(), t.stopPropagation(), this.endRotation()) }, x.prototype.onMouseUp = function(t) { this.usable() && (T(), w = !0, t.preventDefault(), t.stopPropagation(), this.endRotation()) }, x.prototype.onPointerUp = function(t) { this.usable() && "touch" === t.pointerType && (this.pointers.forEach(function(e, i) { t.pointerId === e.id && this.pointers.splice(i, 1) }.bind(this)), t.touches = this.pointers, this.onTouchEnd(t)) }, x.prototype.update = function(t) { if (null != G.frameRate && (G.frameRate < 12 ? h.rotationFriction = .6 : h.rotationFriction = .06), y.isMobile() && (t = .016, 0 != this.rotationSpeed.x && Math.abs(this.rotationSpeed.x) < 6 && (this.rotationSpeed.x = 0), 0 != this.rotationSpeed.y && Math.abs(this.rotationSpeed.y) < 6 && (this.rotationSpeed.y = 0), 0 == this.rotationSpeed.x && 0 == this.rotationSpeed.y ? G.panoStill = !0 : G.panoStill = !1), !G.R.playing) for (this.updateRotation(), this.rotationHistory.push(this.rotationDifference.clone()); this.rotationHistory.length > h.rotationAfterMoveHistoryCount;) this.rotationHistory.shift(); var i = this.lon, n = this.lat; if (G.ori.flag ? (this.offsetLon += this.rotationDifference.x, this.offsetLat += this.rotationDifference.y, this.rotationSpeed.x = this.rotationSpeed.x * (1 - h.rotationFriction) + this.rotationAcc.x * h.rotationAccelerationInside, this.rotationSpeed.y = this.rotationSpeed.y * (1 - h.rotationFriction) + this.rotationAcc.y * h.rotationAccelerationInside, this.offsetLon += this.rotationSpeed.x * t, this.offsetLat += this.rotationSpeed.y * t, this.offsetLat = Math.max(h.insideLookLimitDown, Math.min(h.insideLookLimitUp, this.offsetLat)), G.ori.enable && !G.playing && (this.euler.set(G.ori.beta, G.ori.alpha, -G.ori.gamma, "YXZ"), this.q3 = this.camera.quaternion.clone(), this.q3.setFromEuler(this.euler) .multiply(this.q1), this.q3.multiply(this.q0.setFromAxisAngle(this.right, -G.ori.orient)), this.v.set(0, 0, 1) .applyQuaternion(this.q3), this.lat = u.Math.radToDeg(this.v.angleTo(this.up) - Math.PI / 2), this.v.set(1, 0, 0) .applyQuaternion(this.q3), this.v.clone() .cross(this.right) .y > 0 ? this.lon = 360 + u.Math.radToDeg(this.v.angleTo(this.right)) : this.lon = 360 - u.Math.radToDeg(this.v.angleTo(this.right))), this.phi = u.Math.degToRad(90 - (this.lat + this.offsetLat)), this.theta = u.Math.degToRad(this.lon + this.offsetLon), this.lookVector.x = Math.sin(this.phi) * Math.cos(this.theta), this.lookVector.y = Math.cos(this.phi), this.lookVector.z = Math.sin(this.phi) * Math.sin(this.theta), this.target.copy(this.lookVector) .add(this.camera.position), this.camera.lookAt(this.target), G.ori.enable = !0) : (t || (t = 1 / 60), this.rotationSpeed.x = this.rotationSpeed.x * (1 - h.rotationFriction) + this.rotationAcc.x * h.rotationAccelerationInside, this.rotationSpeed.y = this.rotationSpeed.y * (1 - h.rotationFriction) + this.rotationAcc.y * h.rotationAccelerationInside, this.connect.remoteControl || this.connect.sync || (this.lon += this.rotationDifference.x, this.lat += this.rotationDifference.y, this.lon += this.rotationSpeed.x * t, this.lat += this.rotationSpeed.y * t, this.sendFrameData(t), this.rotationDifference.set(0, 0)), this.lat = Math.max(h.insideLookLimitDown, Math.min(h.insideLookLimitUp, this.lat)), this.updateCamera(this.lon, this.lat)), this.rotationDifference.set(0, 0), G.R.recording && this.record(), d.compareFloats(i, this.lon) && d.compareFloats(n, this.lat) ? this.emit(m.PanoramaMoveStop) : (this.emit(m.RulersMove), this.emit(m.PanoramaMove)), "open" === e("#size-button") .attr("openflag")) var r = this.lon, o = this.lat; if (G.player.mattertagManager && G.player.mattertagManager.showtitletags) { r = this.lon, o = this.lat; G.player.mattertagManager && (!G.player.mattertagManager.ttflying && d.compareFloats(i, r) && d.compareFloats(n, o) || this.emit(m.TtagsMove)) } }, x.prototype.sendFrameData = (a = 0, s = new u.Vector2, l = new u.Vector2, function(t) { (a += t) < h.connectDelay || (a = 0, Math.abs(r - this.lon) < .001 && Math.abs(o - this.lat) < .001 || (this.connect.sendOperation({ type: "pano", lon: this.lon, lat: this.lat, time: Date.now(), rotationDifference: this.rotationDifference.toArray(), rotationSpeed: this.rotationSpeed.toArray() }), r = this.lon, o = this.lat, s.copy(this.rotationSpeed), l.copy(this.rotationDifference))) }); var _ = 0; x.prototype.updateCamera = function(t, e) { _++, this.phi = u.Math.degToRad(90 - e), this.theta = u.Math.degToRad(t), this.lookVector.x = Math.sin(this.phi) * Math.cos(this.theta), this.lookVector.y = Math.cos(this.phi), this.lookVector.z = Math.sin(this.phi) * Math.sin(this.theta), this.target.copy(this.lookVector) .add(this.camera.position), this.camera.lookAt(this.target), 0 == _ % 6 && (_ = 0) }, x.prototype._progressNumber = function(t, e, i) { return t + (e - t) * i }, x.prototype._progressRad = function(t, e, i) { var n = 2 * Math.PI, r = Math.PI, o = function(t) { return (t % n + n) % n }; return t = o(t), (e = o(e)) - t > r ? this._progressNumber(t + n, e, i) : t - e > r ? this._progressNumber(t - n, e, i) : this._progressNumber(t, e, i) }, x.prototype.handleOperation = function(t) { var e = this; if ("pano" === t.type) { var i = t.lon, n = t.lat; Date.now(), t.time; this.s_lon = i, this.s_lat = n, this.lonTweenProcess = null, this.latTweenProcess = null, this.tweenProgress && (this.tweenProgress.stop(), this.tweenProgress = null); var r = this.lon, o = this.lat; h.connectDelay; this.tweenProgress = new TWEEN.Tween({ progress: 0 }) .to({ progress: 1 }, h.animationDelay) .easing(TWEEN.Easing.Linear.None) .start(), this.tweenProgress.onUpdate((function(t) { null === i && 0 === i || (e.lon = e._progressNumber(r, i, this.progress)), null === n && 0 === i || (e.lat = e._progressNumber(o, n, this.progress)) })), this.tweenProgress.onComplete((function() { this.tweenProgress = null })), this.s_time = t.time, this.s_rotationDifference.fromArray(t.rotationDifference), this.s_rotationSpeed.fromArray(t.rotationSpeed), this.rotationSpeed.copy(this.s_rotationSpeed) } }, x.prototype.onMouseWheel = function(t) { if (!this.lockedMouseWheel && this.usable() && !G.R.playing) { var e = t.wheelDelta || -t.detail; this.emit(m.InteractionDirect), this.emit(m.Scroll, e) } }, x.prototype.onKeyDown = function(t) { this.usable() && (t.metaKey || t.ctrlKey || (t.preventDefault(), this.handleKeyDown(t.which))) }, x.prototype.handleKeyDown = function(t) { var e = function(t) { this.disableKeyMove || this.flyDirection(t) }.bind(this), i = function(t, e) { this.disableKeyRotate || (this.rotationAcc[t] = e) }.bind(this); this.emit(m.InteractionKey); var n = !0; switch (t) { case f.UPARROW: case f.W: e(p.FORWARD); break; case f.DOWNARROW: case f.S: e(p.BACK); break; case f.A: e(p.LEFT); break; case f.D: e(p.RIGHT); break; case f.LEFTARROW: case f.J: i("x", -1); break; case f.RIGHTARROW: case f.L: i("x", 1); break; case f.I: i("y", 1); break; case f.K: i("y", -1); break; default: n = !1 } n && this.emit(m.Move, "key") }, x.prototype.onKeyUp = function(t) { this.usable() && (t.preventDefault(), t.stopPropagation(), this.handleKeyUp(t.which)) }, x.prototype.handleKeyUp = function(t) { switch (t) { case f.LEFTARROW: case f.J: case f.RIGHTARROW: case f.L: this.rotationAcc.x = 0; break; case f.I: case f.K: this.rotationAcc.y = 0; break; case f.ESC: } }, x.prototype.reset = function() { this.pointerDragOn = !1, this.rotationAcc.set(0, 0), this.rotationSpeed.set(0, 0), this.pointers = [] }, x.prototype.flyDirection = function(t) { this.emit(m.FlyInDirection, t.clone()) }, x.prototype.copy = function(t) { this.target.copy(t.target), this.lookVector.copy(t.lookVector), this.lookSpeed = t.lookSpeed, this.rotationAcc.copy(t.rotationAcc), this.rotationSpeed.copy(t.rotationSpeed), this.lat = t.lat, this.lon = t.lon, this.phi = t.phi, this.theta = t.theta, this.enabled = t.enabled, this.locked = t.locked, this.pointer.copy(t.pointer), this.rotationHistory = t.rotationHistory.slice(), this.rotationDifference.copy(t.rotationDifference), this.pointerDragOn = t.pointerDragOn, this.pointerDragStart.copy(t.pointerDragStart), this.pinchDistance = t.pinchDistance, this.moveStart.copy(t.moveStart), this.moveTolerance = t.moveTolerance, this.pointersLimit = t.pointersLimit, this.pointers = t.pointers.slice() }, x.prototype.toJSON = function() { return { _viewpoint: { x: d.toPrecision(this.camera.position.x, 4), y: d.toPrecision(this.camera.position.y, 4), z: d.toPrecision(this.camera.position.z, 4) }, _rotation: { x: d.toPrecision(this.camera.quaternion.x, 4), y: d.toPrecision(this.camera.quaternion.y, 4), z: d.toPrecision(this.camera.quaternion.z, 4), w: d.toPrecision(this.camera.quaternion.w, 4) } } }, x.prototype.setStateFromJSON = function(t) { this.camera.position.copy(t._viewpoint), this.camera.quaternion.copy(t._rotation) }, t.exports = x }) .call(this, i(6)) }, function(t, e, i) { var n = i(3); function r(t) { return s[t] } var o = i(29), a = [0, 1, 2, 3, 4, 5], s = { 0: o.GL_TEXTURE_CUBE_MAP_POSITIVE_Y, 1: o.GL_TEXTURE_CUBE_MAP_POSITIVE_Z, 2: o.GL_TEXTURE_CUBE_MAP_POSITIVE_X, 3: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z, 4: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_X, 5: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y }; t.exports = { mapFaceToCubemapFace: r, getCubemapUrls: function(t, e, i) { return a.map(function(t, o) { var a = n.isMobile() ? "mobile" : "pc"; return G.url.model + "/locations/" + a + "/" + i + "/" + e + "_" + r(t) + ".jpg" }.bind(this)) } } }, function(t, e, i) { var n = i(0), r = i(1); function o() { n.PerspectiveCamera.call(this, r.insideFOV, (window.renderWidth || window.innerWidth) / (window.renderHeight || window.innerHeight), r.insideNear, r.insideFar), this.controls = null } o.prototype = Object.create(n.PerspectiveCamera.prototype), o.prototype.updateAspect = function(t) { this.aspect = t, this.updateProjectionMatrix() }, t.exports = o }, function(t, e, i) { (function(e) { i(3); function n(t, e, i, r, o) { this.qualityManager = t, this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(), this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize(), this.baseSize = e, this.standardSize = i, this.highSize = r, this.ultraHighSize = o, this.priorityCriteria = new n.PriorityCriteria(null, new l.Vector3(0, 0, 0), new l.Vector3(0, 0, -1), new l.Vector3(0, 0, -1)), this.directional_fov = this.getDirectionalFov() } var r, o, a, s, l = i(0), u = (i(5), i(1), i(19)), h = i(2), c = (i(18), i(23), i(21), i(29), i(65)), d = (i(3), i(30)), p = i(9), f = (i(4) .EventEmitter, new h(e), Object.freeze({ None: 0, DirectionalFOV: 1 })); n.PriorityCriteria = function(t, e, i, n, r) { this.pano = t, this.cameraPosition = (new l.Vector3) .copy(e), this.cameraDir = (new l.Vector3) .copy(i), this.panoSpaceDir = (new l.Vector3) .copy(n), this.upcomingPanos = r, this.copy = function(t) { this.pano = t.pano, this.cameraPosition.copy(t.cameraPosition), this.cameraDir.copy(t.cameraDir), this.panoSpaceDir.copy(t.panoSpaceDir), this.upcomingPanos = r }, this.zoomingActive = !1 }, n.DIRECTIONAL_FOV_NARROW = 10, n.MAX_SCORED_PANOS_TOCONSIDER = 6, n.MAX_SCORED_PANOS_TOADD = 2, n.MAX_UPCOMING_PANOS_TOADD = 3, n.DIRECTION_SCORE_STRICTNESS = .75, n.appendQueue = function(t, e) { if (t && e) for (var i = 0; i < e.length; i++) t.push(e[i]) }, n.prototype.getDirectionalFov = function() { var t = document.documentElement.clientWidth; return t > 0 && t < 512 ? 60 : t >= 512 && t < 1024 ? 80 : t >= 1024 && t < 2048 ? 100 : t >= 2048 && t < 4096 ? 120 : t >= 4096 ? 180 : 60 }, n.prototype.updateCriteria = function(t, e, i, n) { this.priorityCriteria.pano = t, this.priorityCriteria.cameraPosition.copy(e), this.priorityCriteria.cameraDir.copy(i), this.priorityCriteria.upcomingPanos = n, this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(), this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize() }, n.prototype.filterAndPrioritize = (o = [], a = [], s = [], function(t, e, i) { this.populateNeighborPanos(this.priorityCriteria.pano, e, o), this.populateScoredPanos(this.priorityCriteria.pano, e, a, this.priorityCriteria.cameraDir, n.MAX_SCORED_PANOS_TOCONSIDER); var r = this.baseSize, l = this.standardSize, u = this.highSize, h = this.ultraHighSize; this.queueTilesForPano(t, i, this.priorityCriteria.pano, r), this.priorityCriteria.upcomingPanos && this.queueTilesForPanos(t, this.priorityCriteria.upcomingPanos, i, r, n.MAX_UPCOMING_PANOS_TOADD), s.length = 0, this.canDownloadSize(l) && this.queueTilesInDirectionForPano(s, i, this.priorityCriteria.pano, l, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW), n.sortPanoTiles(s, this.priorityCriteria.pano, this.priorityCriteria.cameraDir), n.appendQueue(t, s), this.queueTilesForPanos(t, a, i, r, n.MAX_SCORED_PANOS_TOADD), s.length = 0, this.canDownloadSize(u) && this.queueTilesInDirectionForPano(s, i, this.priorityCriteria.pano, u, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW), this.canDownloadSize(h) && this.queueTilesInDirectionForPano(s, i, this.priorityCriteria.pano, h, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW), n.sortPanoTiles(s, this.priorityCriteria.pano, this.priorityCriteria.cameraDir), n.appendQueue(t, s), s.length = 0, this.canDownloadSize(l) && this.queueTilesInDirectionForPano(s, i, this.priorityCriteria.pano, l, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, this.directional_fov), this.canDownloadSize(u) && this.queueTilesInDirectionForPano(s, i, this.priorityCriteria.pano, u, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, this.directional_fov), this.canDownloadSize(h) && this.queueTilesInDirectionForPano(s, i, this.priorityCriteria.pano, h, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, this.directional_fov), n.sortPanoTiles(s, this.priorityCriteria.pano, this.priorityCriteria.cameraDir), n.appendQueue(t, s), this.queueTilesForPanos(t, o, i, r) }), n.prototype.canDownloadSize = function(t) { return this.maxNavQuality >= t || this.maxZoomQuality >= t && this.zoomingActive }, n.prototype.populateNeighborPanos = function(t, e, i) { (i = i || []) .length = 0; var n = e.getNeighbours(t), r = 0; for (var o in n) if (n.hasOwnProperty(o)) { var a = e.get(o); if (t.id !== a.id && (i.push(a), 1 == ++r)) break } return i }, n.prototype.populateScoredPanos = function(t, e, i, r, o) { (i = i || []) .length = 0; var a = [u.filters.inPanoDirection(t.position, r, n.DIRECTION_SCORE_STRICTNESS), u.filters.not(t)], s = [u.scoreFunctions.distanceSquared(t), u.scoreFunctions.direction(t.position, r)], l = e.sortByScore(a, s); if (l) for (var h = 0; h < l.length && h < o; h++) { var c = l[h].pano; i.push(c) } return i }, n.prototype.queueTilesForPanos = function(t, e, i, n, r) { for (var o = 0, a = 0; a < e.length; a++) { var s = e[a]; if (o += this.queueTilesForPano(t, i, s, n) > 0 ? 1 : 0, r && o >= r) break } return o }, n.prototype.queueTilesForPano = (r = { filter: f.None }, function(t, e, i, n) { return this.filterAndQueueTileDownloadDescriptors(t, e, i, n, r) }), n.prototype.queueTilesForPanosInDirection = function() { var t = new l.Vector3; return function(e, i, n, r, o, a, s, l) { for (var u = 0, h = 0; h < n.length; h++) { var c = n[h]; if (t.copy(c.position), t.sub(o), t.normalize(), Math.max(Math.min(a.dot(t), 1), -1) >= p.getFOVDotThreshold(s)) if (u += this.queueTilesInDirectionForPano(e, i, c, r, o, a, s) > 0 ? 1 : 0, l && u >= l) break } return u } }(), n.prototype.queueTilesInDirectionForPanos = function(t, e, i, n, r, o, a, s) { for (var l = 0, u = 0; u < i.length; u++) { var h = i[u]; if (l += this.queueTilesInDirectionForPano(t, e, h, n, o, a) > 0 ? 1 : 0, s && l >= s) break } return l }, n.prototype.queueTilesInDirectionForPano = function() { var t = { filter: f.DirectionalFOV, direction: new l.Vector3, fov: 60 }, e = new l.Vector3; return function(i, n, r, o, a, s, l) { return e.copy(s), d.getRelativeDirection(r.quaternion, e), t.direction.copy(e), t.fov = l, this.filterAndQueueTileDownloadDescriptors(i, n, r, o, t) } }(), n.prototype.filterAndQueueTileDownloadDescriptors = function() { var t = []; return function(e, i, n, r, o) { var a = i.getTileDownloadDescriptors(n, r); t.length = 0, this.filterTileDownloadDescriptors(n, a, t, o); for (var s = 0, l = 0; l < t.length; l++) { var u = t[l]; u && (e.push(u), s++) } return s } }(), n.prototype.filterTileDownloadDescriptors = (new l.Vector3, function(t, e, i, n) { var r, o; switch (n.filter) { case f.DirectionalFOV: for (r = 0; r < e.length; r++) o = e[r], d.isTileWithinFOV(o.panoSize, o.tileSize, o.face, o.tileX, o.tileY, n.direction, n.fov) && i.push(o); break; default: for (r = 0; r < e.length; r++) o = e[r], i.push(o) } for (r = 0; r < i.length; r++) o = i[r], this.canIncludeDescriptor(o) || (i[r] = null) }), n.prototype.canIncludeDescriptor = function(t) { return t.status !== c.Downloading && t.status !== c.Downloaded }, n.prototype.canIncludePano = function(t, e) { return !t.isLoaded(e) }, n.getFOVDotThreshold = function(t) { return Math.cos(l.Math.degToRad(t / 2)) }; var m = function() { var t = function t(e, i) { var n = t._panoSpaceDir, r = t._fovThreshold, o = t._fovThresholdNarrow, a = Math.max(Math.min(n.dot(e.direction), 1), -1), s = Math.max(Math.min(n.dot(i.direction), 1), -1); return e._dot = a, i._dot = s, a >= r && s < r ? -1 : a < r && s >= r ? 1 : a >= o && s < o ? -1 : a < o && s >= o || e.panoSize > i.panoSize ? 1 : i.panoSize > e.panoSize ? -1 : -(a - s) }; return t._panoSpaceDir = new l.Vector3, t._fovThreshold = -1, t._fovThresholdNarrow = -1, t }(); n.sortPanoTiles = function(t, e, i) { m._panoSpaceDir.copy(i), d.getRelativeDirection(e.quaternion, m._panoSpaceDir), m._fovThresholdNarrow = p.getFOVDotThreshold(n.DIRECTIONAL_FOV_NARROW), m._fovThreshold = p.getFOVDotThreshold(d.getDirectionalFov()), t.sort(m) }, n.insertSortedPanoTile = function(t, e, i, r) { m._panoSpaceDir.copy(r), d.getRelativeDirection(i.quaternion, m._panoSpaceDir), m._fovThresholdNarrow = p.getFOVDotThreshold(n.DIRECTIONAL_FOV_NARROW), m._fovThreshold = p.getFOVDotThreshold(d.getDirectionalFov()); for (var o = -1, a = 0; a < t.length; a++) { if (m(e, t[a]) <= 0) { o = a; break } } if (-1 === o) t[t.length] = e; else { for (var s = t.length; s > o; s--) t[s] = t[s - 1]; t[o] = e } }, n.prototype.setZoomingActive = function(t) { t !== this.zoomingActive && (this.zoomingActive = t) }, t.exports = n }) .call(this, "/js/tile/TilePrioritizer.js") }, function(t, e) { t.exports = { BuildingType: 0, TextOnly: 1, ImageText: 2, Audio: 4, OtherModel: 5, TextAudio: 6, ImageTextAudio: 7, IFrame: 8, Tag360T1: 9, TagTo360: 10, Video: 11, Title: 12, RegionalJump: 13, Custome: 104, ClassifyType: { Indoor: 1, Building: 2 }, EW: 101, IKEA: 102, Pano: 9e3 } }, function(t, e) { t.exports = function(t) { var e = function(e) { t.MeshBasicMaterial.call(this), this.depthTest = !1, this.depthWrite = !1, this.transparent = !0, this.opacity = .8, this.color.setHex(e.color), this.highlight = function(t) { this.opacity = t ? 1 : .8 } }; (e.prototype = Object.create(t.MeshBasicMaterial.prototype)) .constructor = e; var i = function(e) { t.LineBasicMaterial.call(this), this.depthTest = !1, this.depthWrite = !1, this.transparent = !0, this.linewidth = 1, this.color.setHex(e.color), this.highlight = function(t) {} }; (i.prototype = Object.create(t.LineBasicMaterial.prototype)) .constructor = i; var n = (new t.TextureLoader) .load("images/torus_2x.png"), r = (new t.TextureLoader) .load("images/arc_surface_2x.png"); n.minFilter = r.minFilter = t.LinearFilter, n.magFilter = r.magFilter = t.LinearFilter; var o = function() { for (var e = [{ x: 26, y: 16 }, { x: 26, y: 6 }, { x: -54, y: 6 }, { x: -54, y: -6 }, { x: 26, y: -6 }, { x: 26.1, y: -16.1 }, { x: 54, y: 0 }], i = new t.Shape, n = 0, r = e.length; n < r; ++n) 0 === n ? i.moveTo(e[n].x, e[n].y) : i.lineTo(e[n].x, e[n].y); return new t.ExtrudeBufferGeometry(i, { depth: 8, bevelEnabled: !1, bevelSegments: 1, steps: 1, bevelSize: 1, bevelThickness: 1 }) }, a = function(e) { var i = [{ x: -84.5, y: 21.5 }, { x: -82.8, y: -11.5 }, { x: -72, y: -2.7 }, { x: -60.3, y: -7.8 }, { x: -50.2, y: -11.9 }, { x: -36.3, y: -16.2 }, { x: -24.8, y: -18.8 }, { x: -10.57, y: -21.01 }, { x: 6.4, y: -21.74 }, { x: 20.67, y: -21.09 }, { x: 35.02, y: -18.28 }, { x: 45.3, y: -15.7 }, { x: 56.5, y: -11.5 }, { x: 72.6, y: -4.5 }, { x: 83.5, y: -13.5 }, { x: 84.5, y: 20.5 }, { x: 52.5, y: 13.1 }, { x: 60.7, y: 5 }, { x: 48.38, y: .6 }, { x: 35.6, y: -3.1 }, { x: 24.7, y: -5.2 }, { x: 12.9, y: -6.7 }, { x: -1.6, y: -7 }, { x: -14.9, y: -5.7 }, { x: -27.8, y: -3.2 }, { x: -41.2, y: .5 }, { x: -50.7, y: 3.9 }, { x: -59.7, y: 7.6 }, { x: -51.8, y: 14.4 }], n = new t.Shape; n.moveTo(i[0].x, i[0].y); for (var r = 1; r < i.length; ++r) n.lineTo(i[r].x, i[r].y); return new t.ExtrudeGeometry(n, { depth: e, bevelEnabled: !1, bevelSegments: 1, steps: 1, bevelSize: 1, bevelThickness: 1 }) }, s = function() { var e = new t.PlaneBufferGeometry(4, 4), i = new t.MeshBasicMaterial({ map: n, side: t.DoubleSide, transparent: !0, depthTest: !1, depthWrite: !1 }); return new t.Mesh(e, i) }, l = function() { var e = new t.PlaneBufferGeometry(2.84, .74), i = new t.MeshBasicMaterial({ map: r, side: t.DoubleSide, transparent: !0, depthTest: !1, depthWrite: !1 }); return new t.Mesh(e, i) }, u = function(i) { var n = new t.Group, r = new t.Mesh(new a(8), new e({ color: i.color })); r.name = i.name, r.scale.set(.01, .01, .01), r.position.set(0, -1.84, 0), r.userData.isPicker = !0, n.add(r); var o = new s; o.name = "Torus", o.visible = !1, n.add(o); var u = new l; return u.name = "ArcSurface", u.visible = !1, u.position.y -= 1.84 - .37 + .18, u.position.z += .01, n.add(u), n }; function h(e, i) { t.Object3D.call(this), i = void 0 !== i ? i : document, this.object = void 0, this.visible = !1, this.translationSnap = null, this.rotationSnap = null, this.space = "world", this.size = 1, this.axis = null, this.currentWorldPosition = new t.Vector3, this.clock = new t.Clock, this.delta = 0, this.MOVELOCK = { X: { state: !1, crash_point: null }, Y: { state: !1, crash_point: null }, Z: { state: !1, crash_point: null } }; var n = this, r = "translate", o = !1, a = { translate: new t.TransformGizmoDIYTranslate, rotate: new t.TransformGizmoDIYRotate }; for (var s in this._gizmo = a, a) { var l = a[s]; l.visible = s === r, this.add(l) } var u = { type: "change" }, h = { type: "mouseDown" }, c = { type: "mouseUp", mode: r }, d = { type: "objectChange" }, p = new t.Raycaster, f = new t.Vector2, m = new t.Vector3, g = new t.Vector3, v = new t.Vector3, y = new t.Vector3, b = 1, w = (new t.Matrix4, new t.Vector3), x = new t.Matrix4, M = new t.Vector3, T = new t.Quaternion, S = new t.Vector3(1, 0, 0), _ = new t.Vector3(0, 1, 0), A = new t.Vector3(0, 0, 1), P = new t.Quaternion, C = new t.Quaternion, E = new t.Quaternion, D = new t.Quaternion, L = (new t.Quaternion, new t.Vector3), O = new t.Vector3, I = new t.Matrix4, R = new t.Matrix4, N = new t.Vector3, k = new t.Vector3, F = new t.Euler, B = new t.Matrix4, z = new t.Vector3, U = new t.Euler; function V(t) { if (void 0 !== n.object && !0 !== o && (void 0 === t.button || 0 === t.button)) { var e = W(t.changedTouches ? t.changedTouches[0] : t, a[r].pickers.children), i = null; e && (i = e.object.name, t.preventDefault()), n.axis !== i && (n.axis = i, n.update(), n.dispatchEvent(u)) } } function j(t) { if (void 0 !== n.object && !0 !== o && (void 0 === t.button || 0 === t.button)) { var e = t.changedTouches ? t.changedTouches[0] : t; if (0 === e.button || void 0 === e.button) { var i = W(e, a[r].pickers.children); if (i) { t.preventDefault(), t.stopPropagation(), n.dispatchEvent(h), n.axis = i.object.name, n.update(), w.copy(z) .sub(k) .normalize(), a[r].setActivePlane(n.axis, w); var s = W(e, [a[r].activePlane]); s && (L.copy(n.object.position), O.copy(n.object.scale), I.extractRotation(n.object.matrix), B.extractRotation(n.object.matrixWorld), R.extractRotation(n.object.parent.matrixWorld), N.setFromMatrixScale(x.getInverse(n.object.parent.matrixWorld)), g.copy(s.point)); var l = i.object, u = n.getMode(), c = n._gizmo[u].pickerGizmos; if ("rotate" === u && l.userData.isPicker) { for (var d in c) { (p = c[d][0][0].children[0]) .visible = !1 } l.parent.getObjectByName("Torus") .visible = !0, l.parent.getObjectByName("ArcSurface") .visible = !0 } if ("translate" === u && l.userData.isPicker) for (var d in c) { var p = c[d][0][0]; n.axis !== d && (p.visible = !1) } } } o = !0 } } function H(e) { if (void 0 !== n.object && null !== n.axis && !1 !== o && (void 0 === e.button || 0 === e.button)) { var i = W(e.changedTouches ? e.changedTouches[0] : e, [a[r].activePlane]); if (!1 !== i) { if (e.preventDefault(), e.stopPropagation(), m.copy(i.point), "translate" === r) { if (n.MOVELOCK[n.axis].state) return; m.sub(g), m.multiply(N), "world" !== n.space && -1 === n.axis.search("XYZ") || (-1 === n.axis.search("X") && (m.x = 0), -1 === n.axis.search("Y") && (m.y = 0), -1 === n.axis.search("Z") && (m.z = 0), m.applyMatrix4(x.getInverse(R)), n.object.position.copy(L), n.object.position.add(m)) } if ("rotate" === r) { if (n.MOVELOCK[n.axis].state) return; if (m.sub(k), m.multiply(N), M.copy(g) .sub(k), M.multiply(N), "world" === n.space) { if (v.set(Math.atan2(m.z, m.y), Math.atan2(m.x, m.z), Math.atan2(m.y, m.x)), y.set(Math.atan2(M.z, M.y), Math.atan2(M.x, M.z), Math.atan2(M.y, M.x)), T.setFromRotationMatrix(x.getInverse(R)), null !== n.rotationSnap ? (C.setFromAxisAngle(S, Math.round((v.x - y.x) / n.rotationSnap) * n.rotationSnap), E.setFromAxisAngle(_, Math.round((v.y - y.y) / n.rotationSnap) * n.rotationSnap), D.setFromAxisAngle(A, Math.round((v.z - y.z) / n.rotationSnap) * n.rotationSnap)) : (C.setFromAxisAngle(S, v.x - y.x), E.setFromAxisAngle(_, v.y - y.y), D.setFromAxisAngle(A, v.z - y.z)), P.setFromRotationMatrix(B), "X" === n.axis) { T.multiplyQuaternions(T, C); var s = n._gizmo[r].pickerGizmos.X[0][0].getObjectByName("ArcSurface"); (l = new t.Quaternion) .setFromAxisAngle(A, v.x), s.quaternion.copy(l) } if ("Y" === n.axis) { T.multiplyQuaternions(T, E); s = n._gizmo[r].pickerGizmos.Y[0][0].getObjectByName("ArcSurface"); (l = new t.Quaternion) .setFromAxisAngle(A, v.y), s.quaternion.copy(l) } if ("Z" === n.axis) { T.multiplyQuaternions(T, D); var l; s = n._gizmo[r].pickerGizmos.Z[0][0].getObjectByName("ArcSurface"); (l = new t.Quaternion) .setFromAxisAngle(A, v.z), s.quaternion.copy(l) } if (n.MOVELOCK[n.axis].state) return; T.multiplyQuaternions(T, P), n.object.quaternion.copy(T) } } n.update(), n.dispatchEvent(u), n.dispatchEvent(d) } } } function G(t) { if (t.preventDefault(), void 0 === t.button || 0 === t.button) { if (o && null !== n.axis) { c.mode = r, n.dispatchEvent(c); var e = n.getMode(), i = n.axis, a = n._gizmo[e].pickerGizmos; if ("rotate" === e) { for (var s in a) { (l = a[s][0][0].children[0]) .visible = !0 } a[i][0][0].getObjectByName("Torus") .visible = !1, a[i][0][0].getObjectByName("ArcSurface") .visible = !1 } if ("translate" === e) for (var s in a) { var l = a[s][0][0]; n.axis !== s && (l.visible = !0) } } o = !1, "TouchEvent" in window && t instanceof TouchEvent ? (n.axis = null, n.update(), n.dispatchEvent(u)) : V(t) } } function W(t, n) { var r = i.getBoundingClientRect(), o = (t.clientX - r.left) / r.width, a = (t.clientY - r.top) / r.height; f.set(2 * o - 1, -2 * a + 1), p.setFromCamera(f, e); var s = p.intersectObjects(n, !0); return !!s[0] && s[0] } i.addEventListener("mousedown", j, !1), i.addEventListener("mousemove", V, !1), i.addEventListener("mousemove", H, !1), i.addEventListener("mouseup", G, !1), i.addEventListener("mouseout", G, !1), this.dispose = function() { i.removeEventListener("mousedown", j), i.removeEventListener("mousemove", V), i.removeEventListener("mousemove", H), i.removeEventListener("mouseup", G), i.removeEventListener("mouseout", G) }, this.attach = function(t) { this.object = t, this.visible = !0, this.update() }, this.detach = function() { this.object = void 0, this.visible = !1, this.axis = null }, this.getMode = function() { return r }, this.setMode = function(t) { for (var e in "scale" === (r = t || r) && (n.space = "local"), a) a[e].visible = e === r; this.update(), n.dispatchEvent(u) }, this.setTranslationSnap = function(t) { n.translationSnap = t }, this.setRotationSnap = function(t) { n.rotationSnap = t }, this.setSize = function(t) { n.size = t, this.update(), n.dispatchEvent(u) }, this.setSpace = function(t) { n.space = t, this.update(), n.dispatchEvent(u) }, this.update = function() { void 0 !== n.object && (n.object.updateMatrixWorld(), k.setFromMatrixPosition(n.object.matrixWorld), F.setFromRotationMatrix(x.extractRotation(n.object.matrixWorld)), e.updateMatrixWorld(), z.setFromMatrixPosition(e.matrixWorld), U.setFromRotationMatrix(x.extractRotation(e.matrixWorld)), b = k.distanceTo(z) / 6 * n.size, "Group" === n.object.type ? this.position.copy(n.currentWorldPosition) : this.position.copy(k), this.scale.set(b, b, b), e instanceof t.PerspectiveCamera ? w.copy(z) .sub(k) .normalize() : e instanceof t.OrthographicCamera && w.copy(z) .normalize(), "local" === n.space ? a[r].update(F, w) : "world" === n.space && a[r].update(new t.Euler, w), a[r].highlight(n.axis)) } } return t.TransformGizmoDIY = function() { this.init = function() { t.Object3D.call(this), this.handles = new t.Object3D, this.pickers = new t.Object3D, this.planes = new t.Object3D, this.add(this.handles), this.add(this.pickers), this.add(this.planes); var e = new t.PlaneBufferGeometry(50, 50, 2, 2), i = new t.MeshBasicMaterial({ visible: !1, side: t.DoubleSide }), n = { XY: new t.Mesh(e, i), YZ: new t.Mesh(e, i), XZ: new t.Mesh(e, i) }; for (var r in n.YZ.rotation.set(0, Math.PI / 2, 0), n.XZ.rotation.set(-Math.PI / 2, 0, 0), n) n[r].name = r, this.planes.add(n[r]), this.planes[r] = n[r]; var o = function(t, e) { for (var i in t) for (r = t[i].length; r--;) { var n = t[i][r][0], o = t[i][r][1], a = t[i][r][2]; n.name = i, o && n.position.set(o[0], o[1], o[2]), a && n.rotation.set(a[0], a[1], a[2]), e.add(n) } }; o(this.handleGizmos, this.handles), o(this.pickerGizmos, this.pickers), this.traverse((function(e) { if (e instanceof t.Mesh) { e.updateMatrix(); var i = e.geometry.clone(); i.applyMatrix(e.matrix), e.geometry = i, e.position.set(0, 0, 0), e.rotation.set(0, 0, 0), e.scale.set(1, 1, 1) } })) }; this.highlight = function(t) { this.traverse((function(e) { e.material && e.material.highlight && (e.name === t ? e.material.highlight(!0) : e.material.highlight(!1)) })) } }, t.TransformGizmoDIY.prototype = Object.create(t.Object3D.prototype), t.TransformGizmoDIY.prototype.constructor = t.TransformGizmoDIY, t.TransformGizmoDIY.prototype.update = function(t, e) {}, t.TransformGizmoDIYTranslate = function() { t.TransformGizmoDIY.call(this); var n = new t.BufferGeometry; n.addAttribute("position", new t.Float32BufferAttribute([0, 0, 0, .3, 0, 0], 3)); var r = new t.Line(n, new i({ color: 65280 })); r.userData.isLine = !0; var a = new t.BufferGeometry; a.addAttribute("position", new t.Float32BufferAttribute([0, 0, 0, 0, .3, 0], 3)); var s = new t.Line(a, new i({ color: 16711680 })); s.userData.isLine = !0; var l = new t.BufferGeometry; l.addAttribute("position", new t.Float32BufferAttribute([0, 0, 0, 0, 0, .3], 3)); var u = new t.Line(l, new i({ color: 16776960 })); r.userData.isLine = !0, this.handleGizmos = { X: [ [r] ], Y: [ [s] ], Z: [ [u] ] }; var h = new t.Mesh(new o, new e({ visible: !0, transparent: !0, color: 65280 })); h.scale.set(.01, .01, .01), h.userData.isPicker = !0; var c = new t.Mesh(new o, new e({ visible: !0, transparent: !0, color: 16711680 })); c.scale.set(.01, .01, .01), c.userData.isPicker = !0; var d = new t.Mesh(new o, new e({ visible: !0, transparent: !0, color: 16776960 })); d.scale.set(.01, .01, .01), d.userData.isPicker = !0, this.pickerGizmos = { X: [ [h, [1.2, 0, 0], [Math.PI / 2, 0, 0] ] ], Y: [ [c, [0, 1.2, 0], [0, 0, Math.PI / 2] ] ], Z: [ [d, [0, 0, 1.2], [Math.PI / 2, 0, Math.PI / 2] ] ] }, this.setActivePlane = function(e, i) { var n = new t.Matrix4; i.applyMatrix4(n.getInverse(n.extractRotation(this.planes.XY.matrixWorld))), "X" === e && (this.activePlane = this.planes.XY, Math.abs(i.y) > Math.abs(i.z) && (this.activePlane = this.planes.XZ)), "Y" === e && (this.activePlane = this.planes.XY, Math.abs(i.x) > Math.abs(i.z) && (this.activePlane = this.planes.YZ)), "Z" === e && (this.activePlane = this.planes.XZ, Math.abs(i.x) > Math.abs(i.y) && (this.activePlane = this.planes.YZ)), "XYZ" === e && (this.activePlane = this.planes.XYZE), "XY" === e && (this.activePlane = this.planes.XY), "YZ" === e && (this.activePlane = this.planes.YZ), "XZ" === e && (this.activePlane = this.planes.XZ) }; var p = new t.Vector3(1, 0, 0), f = new t.Vector3(0, 1, 0), m = new t.Vector3(0, 0, 1), g = new t.Quaternion, v = new t.Quaternion, y = new t.Vector3(0, 1, 0); this.update = function(e, i) { t.TransformGizmoDIY.prototype.update.apply(this, arguments), this.traverse((function(e) { var n; "X" === e.name && ((n = y.copy(p) .applyQuaternion(g) .dot(i)) < 0 && (e.scale.x = -1), n > 0 && (e.scale.x = 1)); if ("Y" === e.name) { var r = new t.Quaternion, o = new t.Quaternion; r.setFromAxisAngle(f, Math.atan2(i.x, i.z)), o.multiplyQuaternions(o, r), e.quaternion.copy(o) } "Z" === e.name && ((n = y.copy(m) .applyQuaternion(v) .dot(i)) < 0 && (e.scale.z = -1), n > 0 && (e.scale.z = 1)) })) }, this.init() }, t.TransformGizmoDIYTranslate.prototype = Object.create(t.TransformGizmoDIY.prototype), t.TransformGizmoDIYTranslate.prototype.constructor = t.TransformGizmoDIYTranslate, t.TransformGizmoDIYRotate = function() { t.TransformGizmoDIY.call(this); var e = new t.BufferGeometry; e.addAttribute("position", new t.Float32BufferAttribute([0, 0, 0, .3, 0, 0], 3)); var n = new t.Line(e, new i({ color: 65280 })); n.userData.isLine = !0; var r = new t.BufferGeometry; r.addAttribute("position", new t.Float32BufferAttribute([0, 0, 0, 0, .3, 0], 3)); var o = new t.Line(r, new i({ color: 16711680 })); o.userData.isLine = !0; var a = new t.BufferGeometry; a.addAttribute("position", new t.Float32BufferAttribute([0, 0, 0, 0, 0, .3], 3)); var s = new t.Line(a, new i({ color: 16776960 })); s.userData.isLine = !0, this.handleGizmos = { X: [ [n] ], Y: [ [o] ], Z: [ [s] ] }; var l = new u({ color: 8446604, name: "X" }), h = new u({ color: 15897485, name: "Y" }), c = new u({ color: 16701062, name: "Z" }); this.pickerGizmos = { X: [ [l, [0, 0, 0], [0, Math.PI / 2, -3 * Math.PI / 4] ] ], Y: [ [h, [0, 0, 0], [-Math.PI / 2, 0, 0] ] ], Z: [ [c, [0, 0, 0], [0, 0, 3 * Math.PI / 4] ] ] }, this.setActivePlane = function(t) { "X" === t && (this.activePlane = this.planes.YZ), "Y" === t && (this.activePlane = this.planes.XZ), "Z" === t && (this.activePlane = this.planes.XY) }, this.update = function(e, i) { t.TransformGizmoDIY.prototype.update.apply(this, arguments); this.handles, this.pickers, new t.Matrix4, new t.Euler(0, 0, 1); var n = new t.Quaternion, r = new t.Vector3(1, 0, 0), o = new t.Vector3(0, 1, 0), a = new t.Vector3(0, 0, 1), s = new t.Quaternion, l = (new t.Quaternion, new t.Quaternion), u = i.clone(), h = new t.Vector3(0, 1, 0), c = h.copy(r) .applyQuaternion(s) .dot(u), d = h.copy(a) .applyQuaternion(l) .dot(u); c < 0 && 1 === this.handleGizmos.X[0][0].scale.x && (this.handleGizmos.X[0][0].scale.x = -1, this.pickerGizmos.Z[0][0].rotateZ(Math.PI / 2)), c > 0 && -1 === this.handleGizmos.X[0][0].scale.x && (this.handleGizmos.X[0][0].scale.x = 1, this.pickerGizmos.Z[0][0].rotateZ(-Math.PI / 2)), d < 0 && 1 === this.handleGizmos.Z[0][0].scale.z && (this.handleGizmos.Z[0][0].scale.z = -1, this.pickerGizmos.X[0][0].rotateZ(-Math.PI / 2)), d > 0 && -1 === this.handleGizmos.Z[0][0].scale.z && (this.handleGizmos.Z[0][0].scale.z = 1, this.pickerGizmos.X[0][0].rotateZ(Math.PI / 2)); var p = new t.Quaternion; n = new t.Quaternion; p.setFromAxisAngle(o, Math.atan2(u.x, u.z)), n.multiplyQuaternions(n, p), this.pickerGizmos.Y[0][0].quaternion.copy(n), this.pickerGizmos.Y[0][0].rotateX(-Math.PI / 2) }, this.init() }, t.TransformGizmoDIYRotate.prototype = Object.create(t.TransformGizmoDIY.prototype), t.TransformGizmoDIYRotate.prototype.constructor = t.TransformGizmoDIYRotate, h.prototype = Object.create(t.Object3D.prototype), h.prototype.constructor = h, h } }, function(t, e) { t.exports = { canbeChoosedOfMode3D: !0 } }, function(t, e) { t.exports = { TagActivated: "tag.activated", TagDismissed: "tag.dismissed", TagNavigation: "tag.navigation" } }, function(t, e, i) { var n = i(0), r = i(12), o = i(7); function a(t) { t = t || {}, G.model.enablefilter ? n.RawShaderMaterial.call(this, o.extendObject({ fragmentShader: r.model2.fragmentShader, vertexShader: r.model2.vertexShader, uniforms: n.UniformsUtils.clone(r.model2.uniforms), name: "ModelTextureMaterial", depthTest: !0, depthWrite: !0 }, t)) : n.RawShaderMaterial.call(this, o.extendObject({ fragmentShader: r.model.fragmentShader, vertexShader: r.model.vertexShader, uniforms: n.UniformsUtils.clone(r.model.uniforms), name: "ModelTextureMaterial", depthTest: !0, depthWrite: !0 }, t)) } a.prototype = Object.create(n.RawShaderMaterial.prototype), a.prototype.constructor = a, a.prototype.setProjectedPanos = function(t, e, i) { if (G.model.enablefilter) { var n = t.getAjustedColors(), r = e.getAjustedColors(); i && (this.uniforms.progress.value = 0), t.ensureSkyboxReadyForRender(), this.uniforms.pano0Map.value = t.getSkyboxTexture(), this.uniforms.brightness0.value = n.brightness, this.uniforms.contrast0.value = n.contrast, this.uniforms.gamma0.value = n.gamma, this.uniforms.hue0.value = n.hue, this.uniforms.saturation0.value = n.saturation, this.uniforms.vibrance0.value = n.vibrance, this.uniforms.balance0.value.copy(n.balance), this.uniforms.pano0Position.value.copy(t.position), this.uniforms.pano0Matrix.value.copy(t.skyboxMesh.matrixWorld), e.ensureSkyboxReadyForRender(), this.uniforms.pano1Map.value = e.getSkyboxTexture(), this.uniforms.brightness1.value = r.brightness, this.uniforms.contrast1.value = r.contrast, this.uniforms.gamma1.value = r.gamma, this.uniforms.hue1.value = r.hue, this.uniforms.saturation1.value = r.saturation, this.uniforms.vibrance1.value = r.vibrance, this.uniforms.balance1.value.copy(r.balance), this.uniforms.pano1Position.value.copy(e.position), this.uniforms.pano1Matrix.value.copy(e.skyboxMesh.matrixWorld) } else i && (this.uniforms.progress.value = 0), t.ensureSkyboxReadyForRender(), this.uniforms.pano0Map.value = t.getSkyboxTexture(), this.uniforms.pano0Position.value.copy(t.position), this.uniforms.pano0Matrix.value.copy(t.skyboxMesh.matrixWorld), e.ensureSkyboxReadyForRender(), this.uniforms.pano1Map.value = e.getSkyboxTexture(), this.uniforms.pano1Position.value.copy(e.position), this.uniforms.pano1Matrix.value.copy(e.skyboxMesh.matrixWorld) }, t.exports = a }, function(t, e, i) { var n = i(0), r = i(1), o = i(7), a = i(10), s = i(153), l = i(8), u = i(15), h = i(17); function c(t, e, i) { n.Object3D.call(this), this.model = t, this.floorIndex = e, this.name = i || e + 1, this.panos = [], this.chunks = [], this.colliderBuilder = new s(3), this.collider = null, this.center = null, this.boundingBox = new n.Box3, this.size = null, this.hidden = !1, this.conservativeBoundingBox = new n.Box3, this.debugColor = 16777215 * Math.random(), this.transition = null, this.pano360Position = null } c.prototype = Object.create(n.Object3D.prototype), c.prototype.enter = function(t) { this.model.setFloor(this, t) }, c.prototype.hide = function(t) { if (!this.hidden || this.transition) { this.chunks.forEach((function(t) { t.material.transparent = !0 })), l.cancel(this.transition); var e = t ? 0 : r.hideFloorDuration + r.hideFloorDelay, i = t ? 0 : r.hideFloorDelay / e; this.transition = l.start(a.allUniforms(this.chunks, "opacity", .08), e, function() { this.hidden = !0 }.bind(this), i, u.easeInOutQuad) } }, c.prototype.show = function(t) { if (this.hidden || this.transition) { this.hidden = !1, l.cancel(this.transition); var e = t ? r.showFloorDuration : r.showFloorDuration + r.showFloorDelay, i = t ? 0 : r.showFloorDelay / e; this.transition = l.start(a.allUniforms(this.chunks, "opacity", 1), e, function() { this.hidden || this.chunks.forEach((function(t) { t.material.transparent = !1 })) }.bind(this), i, u.easeInOutQuad) } }, c.prototype.toggle = function(t, e) { (t = void 0 === t ? this.hidden : t) ? this.show(e): this.hide(e) }, c.prototype.containsPoint = function(t) { return this.collider.children.some((function(e) { return e.geometry.boundingBox || e.geometry.computeBoundingBox(), e.geometry.boundingBox.containsPoint(t) })) }, c.prototype.distanceToPoint = function(t) { var e = null, i = 1 / 0; return this.collider.children.forEach((function(n) { n.geometry.boundingBox || n.geometry.computeBoundingBox(); var r = n.geometry.boundingBox.distanceToPoint(t); (!e || i > r) && (i = r, e = n) })), i }, c.prototype.addChunk = function(t) { t.renderOrder = h.ghostFloor, this.add(t), this.chunks.push(t), this.boundingBox.union(t.geometry.boundingBox), this.size = this.boundingBox.getSize(new n.Vector3), this.colliderBuilder.add(t.geometry) }, c.prototype.addPano = function(t) { this.panos.push(t), this.add(t.skyboxMesh), t.marker && this.add(t.marker); var e = new n.Vector3(1, 1, 1); 2 == t.alignmentType && (null == this.pano360Position && (this.pano360Position = new n.Vector3((this.boundingBox.min.x + this.boundingBox.max.x) / 2, this.boundingBox.min.y - 2.1, (this.boundingBox.min.z + this.boundingBox.max.z) / 2)), t.position = this.pano360Position, t.skyboxMesh.position.copy(t.position), e = new n.Vector3(4, 4, 4)); var i = (new n.Box3) .setFromCenterAndSize(t.position, e); this.boundingBox.union(i) }, c.prototype.build = function() { this.collider = this.colliderBuilder.build(!0), this.add(this.collider), this.center = this.boundingBox.getCenter(new n.Vector3), this.conservativeBoundingBox.copy(this.boundingBox), this.conservativeBoundingBox.min.y = o.lowerMedian(this.collider.children.map((function(t) { return t.geometry.boundingBox.min.y })), 5), this.conservativeBoundingBox.max.y = o.lowerMedian(this.collider.children.map((function(t) { return t.geometry.boundingBox.max.y })), 5), this.colliderBuilder = null }, c.prototype.toShortString = function() { return o.nth(this.floorIndex + 1) }, c.prototype.toString = function() { return this.name }, t.exports = c }, function(t, e, i) { var n = i(0), r = i(12), o = i(5), a = i(43); function s(t) { this.materialInside = new a({ side: n.DoubleSide }), this.materialOutside = new n.RawShaderMaterial({ fragmentShader: r.modelOutside.fragmentShader, vertexShader: r.modelOutside.vertexShader, uniforms: n.UniformsUtils.clone(r.modelOutside.uniforms), side: n.FrontSide, name: "chunkOut", depthWrite: !0 }), n.Mesh.call(this, t.geometry, this.materialInside), this.name = t.name || "", this.textureName = t.textureName, this.meshUrl = t.meshUrl } s.prototype = Object.create(n.Mesh.prototype), s.prototype.setTextureMap = function(t) { this.materialInside.uniforms.map.value = t, this.materialOutside.uniforms.map.value = t }, s.prototype.setMode = function(t) { var e = t === o.DOLLHOUSE || t === o.FLOORPLAN ? this.materialOutside : this.materialInside; e.side = t === o.PANORAMA ? n.DoubleSide : n.FrontSide, e.transparent = this.material.transparent, e.uniforms.opacity.value = this.material.uniforms.opacity.value, this.material = e }, t.exports = s }, function(t, e, i) { (function(n) { var r, o, a; o = [i(168)], void 0 === (a = "function" == typeof(r = function(t, e) { "use strict"; var r, o = {}; return o.ByteBuffer = t, o.Long = t.Long || null, o.VERSION = "5.0.3", o.WIRE_TYPES = {}, o.WIRE_TYPES.VARINT = 0, o.WIRE_TYPES.BITS64 = 1, o.WIRE_TYPES.LDELIM = 2, o.WIRE_TYPES.STARTGROUP = 3, o.WIRE_TYPES.ENDGROUP = 4, o.WIRE_TYPES.BITS32 = 5, o.PACKABLE_WIRE_TYPES = [o.WIRE_TYPES.VARINT, o.WIRE_TYPES.BITS64, o.WIRE_TYPES.BITS32], o.TYPES = { int32: { name: "int32", wireType: o.WIRE_TYPES.VARINT, defaultValue: 0 }, uint32: { name: "uint32", wireType: o.WIRE_TYPES.VARINT, defaultValue: 0 }, sint32: { name: "sint32", wireType: o.WIRE_TYPES.VARINT, defaultValue: 0 }, int64: { name: "int64", wireType: o.WIRE_TYPES.VARINT, defaultValue: o.Long ? o.Long.ZERO : void 0 }, uint64: { name: "uint64", wireType: o.WIRE_TYPES.VARINT, defaultValue: o.Long ? o.Long.UZERO : void 0 }, sint64: { name: "sint64", wireType: o.WIRE_TYPES.VARINT, defaultValue: o.Long ? o.Long.ZERO : void 0 }, bool: { name: "bool", wireType: o.WIRE_TYPES.VARINT, defaultValue: !1 }, double: { name: "double", wireType: o.WIRE_TYPES.BITS64, defaultValue: 0 }, string: { name: "string", wireType: o.WIRE_TYPES.LDELIM, defaultValue: "" }, bytes: { name: "bytes", wireType: o.WIRE_TYPES.LDELIM, defaultValue: null }, fixed32: { name: "fixed32", wireType: o.WIRE_TYPES.BITS32, defaultValue: 0 }, sfixed32: { name: "sfixed32", wireType: o.WIRE_TYPES.BITS32, defaultValue: 0 }, fixed64: { name: "fixed64", wireType: o.WIRE_TYPES.BITS64, defaultValue: o.Long ? o.Long.UZERO : void 0 }, sfixed64: { name: "sfixed64", wireType: o.WIRE_TYPES.BITS64, defaultValue: o.Long ? o.Long.ZERO : void 0 }, float: { name: "float", wireType: o.WIRE_TYPES.BITS32, defaultValue: 0 }, enum: { name: "enum", wireType: o.WIRE_TYPES.VARINT, defaultValue: 0 }, message: { name: "message", wireType: o.WIRE_TYPES.LDELIM, defaultValue: null }, group: { name: "group", wireType: o.WIRE_TYPES.STARTGROUP, defaultValue: null } }, o.MAP_KEY_TYPES = [o.TYPES.int32, o.TYPES.sint32, o.TYPES.sfixed32, o.TYPES.uint32, o.TYPES.fixed32, o.TYPES.int64, o.TYPES.sint64, o.TYPES.sfixed64, o.TYPES.uint64, o.TYPES.fixed64, o.TYPES.bool, o.TYPES.string, o.TYPES.bytes], o.ID_MIN = 1, o.ID_MAX = 536870911, o.convertFieldsToCamelCase = !1, o.populateAccessors = !0, o.populateDefaults = !0, o.Util = ((r = {}) .IS_NODE = !("object" != typeof n || n + "" != "[object process]" || n.browser), r.XHR = function() { for (var t = [function() { return new XMLHttpRequest }, function() { return new ActiveXObject("Msxml2.XMLHTTP") }, function() { return new ActiveXObject("Msxml3.XMLHTTP") }, function() { return new ActiveXObject("Microsoft.XMLHTTP") }], e = null, i = 0; i < t.length; i++) { try { e = t[i]() } catch (t) { continue } break } if (!e) throw Error("XMLHttpRequest is not supported"); return e }, r.fetch = function(t, e) { if (e && "function" != typeof e && (e = null), r.IS_NODE) { var n = i(170); if (e) n.readFile(t, (function(t, i) { e(t ? null : "" + i) })); else try { return n.readFileSync(t) } catch (t) { return null } } else { var o = r.XHR(); if (o.open("GET", t, !!e), o.setRequestHeader("Accept", "text/plain"), "function" == typeof o.overrideMimeType && o.overrideMimeType("text/plain"), !e) return o.send(null), 200 == o.status || 0 == o.status && "string" == typeof o.responseText ? o.responseText : null; if (o.onreadystatechange = function() { 4 == o.readyState && (200 == o.status || 0 == o.status && "string" == typeof o.responseText ? e(o.responseText) : e(null)) }, 4 == o.readyState) return; o.send(null) } }, r.toCamelCase = function(t) { return t.replace(/_([a-zA-Z])/g, (function(t, e) { return e.toUpperCase() })) }, r), o.Lang = { DELIM: /[\s\{\}=;:\[\],'"\(\)<>]/g, RULE: /^(?:required|optional|repeated|map)$/, TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/, NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/, TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/, TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/, FQTYPEREF: /^(?:\.[a-zA-Z_][a-zA-Z_0-9]*)+$/, NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/, NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/, NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/, NUMBER_OCT: /^0[0-7]+$/, NUMBER_FLT: /^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/, BOOL: /^(?:true|false)$/i, ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/, NEGID: /^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/, WHITESPACE: /\s/, STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g, STRING_DQ: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g, STRING_SQ: /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g }, o.DotProto = function(t, e) { var i = {}, n = function(t) { this.source = t + "", this.index = 0, this.line = 1, this.stack = [], this._stringOpen = null }, r = n.prototype; r._readString = function() { var t = '"' === this._stringOpen ? e.STRING_DQ : e.STRING_SQ; t.lastIndex = this.index - 1; var i = t.exec(this.source); if (!i) throw Error("unterminated string"); return this.index = t.lastIndex, this.stack.push(this._stringOpen), this._stringOpen = null, i[1] }, r.next = function() { if (this.stack.length > 0) return this.stack.shift(); if (this.index >= this.source.length) return null; if (null !== this._stringOpen) return this._readString(); var t, i, n; do { for (t = !1; e.WHITESPACE.test(n = this.source.charAt(this.index));) if ("\n" === n && ++this.line, ++this.index === this.source.length) return null; if ("/" === this.source.charAt(this.index)) if (++this.index, "/" === this.source.charAt(this.index)) { for (; "\n" !== this.source.charAt(++this.index);) if (this.index == this.source.length) return null; ++this.index, ++this.line, t = !0 } else { if ("*" !== (n = this.source.charAt(this.index))) return "/"; do { if ("\n" === n && ++this.line, ++this.index === this.source.length) return null; i = n, n = this.source.charAt(this.index) } while ("*" !== i || "/" !== n); ++this.index, t = !0 } } while (t); if (this.index === this.source.length) return null; var r = this.index; if (e.DELIM.lastIndex = 0, !e.DELIM.test(this.source.charAt(r++))) for (; r < this.source.length && !e.DELIM.test(this.source.charAt(r));) ++r; var o = this.source.substring(this.index, this.index = r); return '"' !== o && "'" !== o || (this._stringOpen = o), o }, r.peek = function() { if (0 === this.stack.length) { var t = this.next(); if (null === t) return null; this.stack.push(t) } return this.stack[0] }, r.skip = function(t) { var e = this.next(); if (e !== t) throw Error("illegal '" + e + "', '" + t + "' expected") }, r.omit = function(t) { return this.peek() === t && (this.next(), !0) }, r.toString = function() { return "Tokenizer (" + this.index + "/" + this.source.length + " at line " + this.line + ")" }, i.Tokenizer = n; var o = function(t) { this.tn = new n(t), this.proto3 = !1 }, a = o.prototype; function s(t, i) { var n = -1, r = 1; if ("-" == t.charAt(0) && (r = -1, t = t.substring(1)), e.NUMBER_DEC.test(t)) n = parseInt(t); else if (e.NUMBER_HEX.test(t)) n = parseInt(t.substring(2), 16); else { if (!e.NUMBER_OCT.test(t)) throw Error("illegal id value: " + (r < 0 ? "-" : "") + t); n = parseInt(t.substring(1), 8) } if (n = r * n | 0, !i && n < 0) throw Error("illegal id value: " + (r < 0 ? "-" : "") + t); return n } function l(t) { var i = 1; if ("-" == t.charAt(0) && (i = -1, t = t.substring(1)), e.NUMBER_DEC.test(t)) return i * parseInt(t, 10); if (e.NUMBER_HEX.test(t)) return i * parseInt(t.substring(2), 16); if (e.NUMBER_OCT.test(t)) return i * parseInt(t.substring(1), 8); if ("inf" === t) return i * (1 / 0); if ("nan" === t) return NaN; if (e.NUMBER_FLT.test(t)) return i * parseFloat(t); throw Error("illegal number value: " + (i < 0 ? "-" : "") + t) } function u(t, e, i) { void 0 === t[e] ? t[e] = i : (Array.isArray(t[e]) || (t[e] = [t[e]]), t[e].push(i)) } return a.parse = function() { var t, i, n = { name: "[ROOT]", package: null, messages: [], enums: [], imports: [], options: {}, services: [] }, r = !0; try { for (; t = this.tn.next();) switch (t) { case "package": if (!r || null !== n.package) throw Error("unexpected 'package'"); if (t = this.tn.next(), !e.TYPEREF.test(t)) throw Error("illegal package name: " + t); this.tn.skip(";"), n.package = t; break; case "import": if (!r) throw Error("unexpected 'import'"); ("public" === (t = this.tn.peek()) || (i = "weak" === t)) && this.tn.next(), t = this._readString(), this.tn.skip(";"), i || n.imports.push(t); break; case "syntax": if (!r) throw Error("unexpected 'syntax'"); this.tn.skip("="), "proto3" === (n.syntax = this._readString()) && (this.proto3 = !0), this.tn.skip(";"); break; case "message": this._parseMessage(n, null), r = !1; break; case "enum": this._parseEnum(n), r = !1; break; case "option": this._parseOption(n); break; case "service": this._parseService(n); break; case "extend": this._parseExtend(n); break; default: throw Error("unexpected '" + t + "'") } } catch (t) { throw t.message = "Parse error at line " + this.tn.line + ": " + t.message, t } return delete n.name, n }, o.parse = function(t) { return new o(t) .parse() }, a._readString = function() { var t, e, i = ""; do { if ("'" !== (e = this.tn.next()) && '"' !== e) throw Error("illegal string delimiter: " + e); i += this.tn.next(), this.tn.skip(e), t = this.tn.peek() } while ('"' === t || '"' === t); return i }, a._readValue = function(t) { var i = this.tn.peek(); if ('"' === i || "'" === i) return this._readString(); if (this.tn.next(), e.NUMBER.test(i)) return l(i); if (e.BOOL.test(i)) return "true" === i.toLowerCase(); if (t && e.TYPEREF.test(i)) return i; throw Error("illegal value: " + i) }, a._parseOption = function(t, i) { var n = this.tn.next(), r = !1; if ("(" === n && (r = !0, n = this.tn.next()), !e.TYPEREF.test(n)) throw Error("illegal option name: " + n); var o = n; r && (this.tn.skip(")"), o = "(" + o + ")", n = this.tn.peek(), e.FQTYPEREF.test(n) && (o += n, this.tn.next())), this.tn.skip("="), this._parseOptionValue(t, o), i || this.tn.skip(";") }, a._parseOptionValue = function(t, i) { var n = this.tn.peek(); if ("{" !== n) u(t.options, i, this._readValue(!0)); else for (this.tn.skip("{"); "}" !== (n = this.tn.next());) { if (!e.NAME.test(n)) throw Error("illegal option name: " + i + "." + n); this.tn.omit(":") ? u(t.options, i + "." + n, this._readValue(!0)) : this._parseOptionValue(t, i + "." + n) } }, a._parseService = function(t) { var i = this.tn.next(); if (!e.NAME.test(i)) throw Error("illegal service name at line " + this.tn.line + ": " + i); var n = { name: i, rpc: {}, options: {} }; for (this.tn.skip("{"); "}" !== (i = this.tn.next());) if ("option" === i) this._parseOption(n); else { if ("rpc" !== i) throw Error("illegal service token: " + i); this._parseServiceRPC(n) } this.tn.omit(";"), t.services.push(n) }, a._parseServiceRPC = function(t) { var i = this.tn.next(); if (!e.NAME.test(i)) throw Error("illegal rpc service method name: " + i); var n = i, r = { request: null, response: null, request_stream: !1, response_stream: !1, options: {} }; if (this.tn.skip("("), "stream" === (i = this.tn.next()) .toLowerCase() && (r.request_stream = !0, i = this.tn.next()), !e.TYPEREF.test(i)) throw Error("illegal rpc service request type: " + i); if (r.request = i, this.tn.skip(")"), "returns" !== (i = this.tn.next()) .toLowerCase()) throw Error("illegal rpc service request type delimiter: " + i); if (this.tn.skip("("), "stream" === (i = this.tn.next()) .toLowerCase() && (r.response_stream = !0, i = this.tn.next()), r.response = i, this.tn.skip(")"), "{" === (i = this.tn.peek())) { for (this.tn.next(); "}" !== (i = this.tn.next());) { if ("option" !== i) throw Error("illegal rpc service token: " + i); this._parseOption(r) } this.tn.omit(";") } else this.tn.skip(";"); void 0 === t.rpc && (t.rpc = {}), t.rpc[n] = r }, a._parseMessage = function(t, i) { var n = !!i, r = this.tn.next(), o = { name: "", fields: [], enums: [], messages: [], options: {}, services: [], oneofs: {} }; if (!e.NAME.test(r)) throw Error("illegal " + (n ? "group" : "message") + " name: " + r); for (o.name = r, n && (this.tn.skip("="), i.id = s(this.tn.next()), o.isGroup = !0), "[" === (r = this.tn.peek()) && i && this._parseFieldOptions(i), this.tn.skip("{"); "}" !== (r = this.tn.next());) if (e.RULE.test(r)) this._parseMessageField(o, r); else if ("oneof" === r) this._parseMessageOneOf(o); else if ("enum" === r) this._parseEnum(o); else if ("message" === r) this._parseMessage(o); else if ("option" === r) this._parseOption(o); else if ("service" === r) this._parseService(o); else if ("extensions" === r) o.hasOwnProperty("extensions") ? o.extensions = o.extensions.concat(this._parseExtensionRanges()) : o.extensions = this._parseExtensionRanges(); else if ("reserved" === r) this._parseIgnored(); else if ("extend" === r) this._parseExtend(o); else { if (!e.TYPEREF.test(r)) throw Error("illegal message token: " + r); if (!this.proto3) throw Error("illegal field rule: " + r); this._parseMessageField(o, "optional", r) } return this.tn.omit(";"), t.messages.push(o), o }, a._parseIgnored = function() { for (; ";" !== this.tn.peek();) this.tn.next(); this.tn.skip(";") }, a._parseMessageField = function(t, i, n) { if (!e.RULE.test(i)) throw Error("illegal message field rule: " + i); var r, o = { rule: i, type: "", name: "", options: {}, id: 0 }; if ("map" === i) { if (n) throw Error("illegal type: " + n); if (this.tn.skip("<"), r = this.tn.next(), !e.TYPE.test(r) && !e.TYPEREF.test(r)) throw Error("illegal message field type: " + r); if (o.keytype = r, this.tn.skip(","), r = this.tn.next(), !e.TYPE.test(r) && !e.TYPEREF.test(r)) throw Error("illegal message field: " + r); if (o.type = r, this.tn.skip(">"), r = this.tn.next(), !e.NAME.test(r)) throw Error("illegal message field name: " + r); o.name = r, this.tn.skip("="), o.id = s(this.tn.next()), "[" === (r = this.tn.peek()) && this._parseFieldOptions(o), this.tn.skip(";") } else if ("group" === (n = void 0 !== n ? n : this.tn.next())) { var a = this._parseMessage(t, o); if (!/^[A-Z]/.test(a.name)) throw Error("illegal group name: " + a.name); o.type = a.name, o.name = a.name.toLowerCase(), this.tn.omit(";") } else { if (!e.TYPE.test(n) && !e.TYPEREF.test(n)) throw Error("illegal message field type: " + n); if (o.type = n, r = this.tn.next(), !e.NAME.test(r)) throw Error("illegal message field name: " + r); o.name = r, this.tn.skip("="), o.id = s(this.tn.next()), "[" === (r = this.tn.peek()) && this._parseFieldOptions(o), this.tn.skip(";") } return t.fields.push(o), o }, a._parseMessageOneOf = function(t) { var i = this.tn.next(); if (!e.NAME.test(i)) throw Error("illegal oneof name: " + i); var n, r = i, o = []; for (this.tn.skip("{"); "}" !== (i = this.tn.next());)(n = this._parseMessageField(t, "optional", i)) .oneof = r, o.push(n.id); this.tn.omit(";"), t.oneofs[r] = o }, a._parseFieldOptions = function(t) { this.tn.skip("["); for (var e = !0; "]" !== this.tn.peek();) e || this.tn.skip(","), this._parseOption(t, !0), e = !1; this.tn.next() }, a._parseEnum = function(t) { var i = { name: "", values: [], options: {} }, n = this.tn.next(); if (!e.NAME.test(n)) throw Error("illegal name: " + n); for (i.name = n, this.tn.skip("{"); "}" !== (n = this.tn.next());) if ("option" === n) this._parseOption(i); else { if (!e.NAME.test(n)) throw Error("illegal name: " + n); this.tn.skip("="); var r = { name: n, id: s(this.tn.next(), !0) }; "[" === (n = this.tn.peek()) && this._parseFieldOptions({ options: {} }), this.tn.skip(";"), i.values.push(r) } this.tn.omit(";"), t.enums.push(i) }, a._parseExtensionRanges = function() { var e, i, n, r = []; do { for (i = [];;) { switch (e = this.tn.next()) { case "min": n = t.ID_MIN; break; case "max": n = t.ID_MAX; break; default: n = l(e) } if (i.push(n), 2 === i.length) break; if ("to" !== this.tn.peek()) { i.push(n); break } this.tn.next() } r.push(i) } while (this.tn.omit(",")); return this.tn.skip(";"), r }, a._parseExtend = function(t) { var i = this.tn.next(); if (!e.TYPEREF.test(i)) throw Error("illegal extend reference: " + i); var n = { ref: i, fields: [] }; for (this.tn.skip("{"); "}" !== (i = this.tn.next());) if (e.RULE.test(i)) this._parseMessageField(n, i); else { if (!e.TYPEREF.test(i)) throw Error("illegal extend token: " + i); if (!this.proto3) throw Error("illegal field rule: " + i); this._parseMessageField(n, "optional", i) } return this.tn.omit(";"), t.messages.push(n), n }, a.toString = function() { return "Parser at line " + this.tn.line }, i.Parser = o, i }(o, o.Lang), o.Reflect = function(e) { var i = {}, n = function(t, e, i) { this.builder = t, this.parent = e, this.name = i, this.className }, r = n.prototype; r.fqn = function() { for (var t = this.name, e = this; null != (e = e.parent);) t = e.name + "." + t; return t }, r.toString = function(t) { return (t ? this.className + " " : "") + this.fqn() }, r.build = function() { throw Error(this.toString(!0) + " cannot be built directly") }, i.T = n; var o = function(t, e, i, r, o) { n.call(this, t, e, i), this.className = "Namespace", this.children = [], this.options = r || {}, this.syntax = o || "proto2" }, a = o.prototype = Object.create(n.prototype); a.getChildren = function(t) { if (null == (t = t || null)) return this.children.slice(); for (var e = [], i = 0, n = this.children.length; i < n; ++i) this.children[i] instanceof t && e.push(this.children[i]); return e }, a.addChild = function(t) { var e; if (e = this.getChild(t.name)) if (e instanceof h.Field && e.name !== e.originalName && null === this.getChild(e.originalName)) e.name = e.originalName; else { if (!(t instanceof h.Field && t.name !== t.originalName && null === this.getChild(t.originalName))) throw Error("Duplicate name in namespace " + this.toString(!0) + ": " + t.name); t.name = t.originalName } this.children.push(t) }, a.getChild = function(t) { for (var e = "number" == typeof t ? "id" : "name", i = 0, n = this.children.length; i < n; ++i) if (this.children[i][e] === t) return this.children[i]; return null }, a.resolve = function(t, e) { var n, r = "string" == typeof t ? t.split(".") : t, o = this, a = 0; if ("" === r[a]) { for (; null !== o.parent;) o = o.parent; a++ } do { do { if (!(o instanceof i.Namespace)) { o = null; break } if (!(n = o.getChild(r[a])) || !(n instanceof i.T) || e && !(n instanceof i.Namespace)) { o = null; break } o = n, a++ } while (a < r.length); if (null != o) break; if (null !== this.parent) return this.parent.resolve(t, e) } while (null != o); return o }, a.qn = function(t) { var e = [], n = t; do { e.unshift(n.name), n = n.parent } while (null !== n); for (var r = 1; r <= e.length; r++) { var o = e.slice(e.length - r); if (t === this.resolve(o, t instanceof i.Namespace)) return o.join(".") } return t.fqn() }, a.build = function() { for (var t, e = {}, i = this.children, n = 0, r = i.length; n < r; ++n)(t = i[n]) instanceof o && (e[t.name] = t.build()); return Object.defineProperty && Object.defineProperty(e, "$options", { value: this.buildOpt() }), e }, a.buildOpt = function() { for (var t = {}, e = Object.keys(this.options), i = 0, n = e.length; i < n; ++i) { var r = e[i], o = this.options[e[i]]; t[r] = o } return t }, a.getOption = function(t) { return void 0 === t ? this.options : void 0 !== this.options[t] ? this.options[t] : null }, i.Namespace = o; var s = function(t, i, n, r, o) { if (this.type = t, this.resolvedType = i, this.isMapKey = n, this.syntax = r, this.name = o, n && e.MAP_KEY_TYPES.indexOf(t) < 0) throw Error("Invalid map key type: " + t.name) }, l = s.prototype; function u(t, i) { if (t && "number" == typeof t.low && "number" == typeof t.high && "boolean" == typeof t.unsigned && t.low == t.low && t.high == t.high) return new e.Long(t.low, t.high, void 0 === i ? t.unsigned : i); if ("string" == typeof t) return e.Long.fromString(t, i || !1, 10); if ("number" == typeof t) return e.Long.fromNumber(t, i || !1); throw Error("not convertible to Long") } s.defaultFieldValue = function(i) { if ("string" == typeof i && (i = e.TYPES[i]), void 0 === i.defaultValue) throw Error("default value for type " + i.name + " is not supported"); return i == e.TYPES.bytes ? new t(0) : i.defaultValue }, l.toString = function() { return (this.name || "") + (this.isMapKey ? "map" : "value") + " element" }, l.verifyValue = function(i) { var n = this; function r(t, e) { throw Error("Illegal value for " + n.toString(!0) + " of type " + n.type.name + ": " + t + " (" + e + ")") } switch (this.type) { case e.TYPES.int32: case e.TYPES.sint32: case e.TYPES.sfixed32: return ("number" != typeof i || i == i && i % 1 != 0) && r(typeof i, "not an integer"), i > 4294967295 ? 0 | i : i; case e.TYPES.uint32: case e.TYPES.fixed32: return ("number" != typeof i || i == i && i % 1 != 0) && r(typeof i, "not an integer"), i < 0 ? i >>> 0 : i; case e.TYPES.int64: case e.TYPES.sint64: case e.TYPES.sfixed64: if (e.Long) try { return u(i, !1) } catch (t) { r(typeof i, t.message) } else r(typeof i, "requires Long.js"); case e.TYPES.uint64: case e.TYPES.fixed64: if (e.Long) try { return u(i, !0) } catch (t) { r(typeof i, t.message) } else r(typeof i, "requires Long.js"); case e.TYPES.bool: return "boolean" != typeof i && r(typeof i, "not a boolean"), i; case e.TYPES.float: case e.TYPES.double: return "number" != typeof i && r(typeof i, "not a number"), i; case e.TYPES.string: return "string" == typeof i || i && i instanceof String || r(typeof i, "not a string"), "" + i; case e.TYPES.bytes: return t.isByteBuffer(i) ? i : t.wrap(i, "base64"); case e.TYPES.enum: var o = this.resolvedType.getChildren(e.Reflect.Enum.Value); for (s = 0; s < o.length; s++) { if (o[s].name == i) return o[s].id; if (o[s].id == i) return o[s].id } if ("proto3" === this.syntax) return ("number" != typeof i || i == i && i % 1 != 0) && r(typeof i, "not an integer"), (i > 4294967295 || i < 0) && r(typeof i, "not in range for uint32"), i; r(i, "not a valid enum value"); case e.TYPES.group: case e.TYPES.message: if (i && "object" == typeof i || r(typeof i, "object expected"), i instanceof this.resolvedType.clazz) return i; if (i instanceof e.Builder.Message) { var a = {}; for (var s in i) i.hasOwnProperty(s) && (a[s] = i[s]); i = a } return new this.resolvedType.clazz(i) } throw Error("[INTERNAL] Illegal value for " + this.toString(!0) + ": " + i + " (undefined type " + this.type + ")") }, l.calculateLength = function(i, n) { if (null === n) return 0; var r; switch (this.type) { case e.TYPES.int32: return n < 0 ? t.calculateVarint64(n) : t.calculateVarint32(n); case e.TYPES.uint32: return t.calculateVarint32(n); case e.TYPES.sint32: return t.calculateVarint32(t.zigZagEncode32(n)); case e.TYPES.fixed32: case e.TYPES.sfixed32: case e.TYPES.float: return 4; case e.TYPES.int64: case e.TYPES.uint64: return t.calculateVarint64(n); case e.TYPES.sint64: return t.calculateVarint64(t.zigZagEncode64(n)); case e.TYPES.fixed64: case e.TYPES.sfixed64: return 8; case e.TYPES.bool: return 1; case e.TYPES.enum: return t.calculateVarint32(n); case e.TYPES.double: return 8; case e.TYPES.string: return r = t.calculateUTF8Bytes(n), t.calculateVarint32(r) + r; case e.TYPES.bytes: if (n.remaining() < 0) throw Error("Illegal value for " + this.toString(!0) + ": " + n.remaining() + " bytes remaining"); return t.calculateVarint32(n.remaining()) + n.remaining(); case e.TYPES.message: return r = this.resolvedType.calculate(n), t.calculateVarint32(r) + r; case e.TYPES.group: return (r = this.resolvedType.calculate(n)) + t.calculateVarint32(i << 3 | e.WIRE_TYPES.ENDGROUP) } throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + n + " (unknown type)") }, l.encodeValue = function(i, n, r) { if (null === n) return r; switch (this.type) { case e.TYPES.int32: n < 0 ? r.writeVarint64(n) : r.writeVarint32(n); break; case e.TYPES.uint32: r.writeVarint32(n); break; case e.TYPES.sint32: r.writeVarint32ZigZag(n); break; case e.TYPES.fixed32: r.writeUint32(n); break; case e.TYPES.sfixed32: r.writeInt32(n); break; case e.TYPES.int64: case e.TYPES.uint64: r.writeVarint64(n); break; case e.TYPES.sint64: r.writeVarint64ZigZag(n); break; case e.TYPES.fixed64: r.writeUint64(n); break; case e.TYPES.sfixed64: r.writeInt64(n); break; case e.TYPES.bool: "string" == typeof n ? r.writeVarint32("false" === n.toLowerCase() ? 0 : !!n) : r.writeVarint32(n ? 1 : 0); break; case e.TYPES.enum: r.writeVarint32(n); break; case e.TYPES.float: r.writeFloat32(n); break; case e.TYPES.double: r.writeFloat64(n); break; case e.TYPES.string: r.writeVString(n); break; case e.TYPES.bytes: if (n.remaining() < 0) throw Error("Illegal value for " + this.toString(!0) + ": " + n.remaining() + " bytes remaining"); var o = n.offset; r.writeVarint32(n.remaining()), r.append(n), n.offset = o; break; case e.TYPES.message: var a = (new t) .LE(); this.resolvedType.encode(n, a), r.writeVarint32(a.offset), r.append(a.flip()); break; case e.TYPES.group: this.resolvedType.encode(n, r), r.writeVarint32(i << 3 | e.WIRE_TYPES.ENDGROUP); break; default: throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + n + " (unknown type)") } return r }, l.decode = function(t, i, n) { if (i != this.type.wireType) throw Error("Unexpected wire type for element"); var r, o; switch (this.type) { case e.TYPES.int32: return 0 | t.readVarint32(); case e.TYPES.uint32: return t.readVarint32() >>> 0; case e.TYPES.sint32: return 0 | t.readVarint32ZigZag(); case e.TYPES.fixed32: return t.readUint32() >>> 0; case e.TYPES.sfixed32: return 0 | t.readInt32(); case e.TYPES.int64: return t.readVarint64(); case e.TYPES.uint64: return t.readVarint64() .toUnsigned(); case e.TYPES.sint64: return t.readVarint64ZigZag(); case e.TYPES.fixed64: return t.readUint64(); case e.TYPES.sfixed64: return t.readInt64(); case e.TYPES.bool: return !!t.readVarint32(); case e.TYPES.enum: return t.readVarint32(); case e.TYPES.float: return t.readFloat(); case e.TYPES.double: return t.readDouble(); case e.TYPES.string: return t.readVString(); case e.TYPES.bytes: if (o = t.readVarint32(), t.remaining() < o) throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + o + " required but got only " + t.remaining()); return (r = t.clone()) .limit = r.offset + o, t.offset += o, r; case e.TYPES.message: return o = t.readVarint32(), this.resolvedType.decode(t, o); case e.TYPES.group: return this.resolvedType.decode(t, -1, n) } throw Error("[INTERNAL] Illegal decode type") }, l.valueFromString = function(i) { if (!this.isMapKey) throw Error("valueFromString() called on non-map-key element"); switch (this.type) { case e.TYPES.int32: case e.TYPES.sint32: case e.TYPES.sfixed32: case e.TYPES.uint32: case e.TYPES.fixed32: return this.verifyValue(parseInt(i)); case e.TYPES.int64: case e.TYPES.sint64: case e.TYPES.sfixed64: case e.TYPES.uint64: case e.TYPES.fixed64: return this.verifyValue(i); case e.TYPES.bool: return "true" === i; case e.TYPES.string: return this.verifyValue(i); case e.TYPES.bytes: return t.fromBinary(i) } }, l.valueToString = function(t) { if (!this.isMapKey) throw Error("valueToString() called on non-map-key element"); return this.type === e.TYPES.bytes ? t.toString("binary") : t.toString() }, i.Element = s; var h = function(t, e, i, n, r, a) { o.call(this, t, e, i, n, a), this.className = "Message", this.extensions = void 0, this.clazz = null, this.isGroup = !!r, this._fields = null, this._fieldsById = null, this._fieldsByName = null }, c = h.prototype = Object.create(o.prototype); function d(t, i) { var n = i.readVarint32(), r = 7 & n, o = n >>> 3; switch (r) { case e.WIRE_TYPES.VARINT: do { n = i.readUint8() } while (128 == (128 & n)); break; case e.WIRE_TYPES.BITS64: i.offset += 8; break; case e.WIRE_TYPES.LDELIM: n = i.readVarint32(), i.offset += n; break; case e.WIRE_TYPES.STARTGROUP: d(o, i); break; case e.WIRE_TYPES.ENDGROUP: if (o === t) return !1; throw Error("Illegal GROUPEND after unknown group: " + o + " (" + t + " expected)"); case e.WIRE_TYPES.BITS32: i.offset += 4; break; default: throw Error("Illegal wire type in unknown group " + t + ": " + r) } return !0 } c.build = function(i) { if (this.clazz && !i) return this.clazz; var n = function(e, i) { var n = i.getChildren(e.Reflect.Message.Field), r = i.getChildren(e.Reflect.Message.OneOf), o = function(a, s) { e.Builder.Message.call(this); for (var l = 0, u = r.length; l < u; ++l) this[r[l].name] = null; for (l = 0, u = n.length; l < u; ++l) { var h = n[l]; this[h.name] = h.repeated ? [] : h.map ? new e.Map(h) : null, !h.required && "proto3" !== i.syntax || null === h.defaultValue || (this[h.name] = h.defaultValue) } var c; if (arguments.length > 0) if (1 !== arguments.length || null === a || "object" != typeof a || !("function" != typeof a.encode || a instanceof o) || Array.isArray(a) || a instanceof e.Map || t.isByteBuffer(a) || a instanceof ArrayBuffer || e.Long && a instanceof e.Long) for (l = 0, u = arguments.length; l < u; ++l) void 0 !== (c = arguments[l]) && this.$set(n[l].name, c); else this.$set(a) }, a = o.prototype = Object.create(e.Builder.Message.prototype); a.add = function(t, n, r) { var o = i._fieldsByName[t]; if (!r) { if (!o) throw Error(this + "#" + t + " is undefined"); if (!(o instanceof e.Reflect.Message.Field)) throw Error(this + "#" + t + " is not a field: " + o.toString(!0)); if (!o.repeated) throw Error(this + "#" + t + " is not a repeated field"); n = o.verifyValue(n, !0) } return null === this[t] && (this[t] = []), this[t].push(n), this }, a.$add = a.add, a.set = function(t, n, r) { if (t && "object" == typeof t) { for (var o in r = n, t) t.hasOwnProperty(o) && void 0 !== (n = t[o]) && void 0 === i._oneofsByName[o] && this.$set(o, n, r); return this } var a = i._fieldsByName[t]; if (r) this[t] = n; else { if (!a) throw Error(this + "#" + t + " is not a field: undefined"); if (!(a instanceof e.Reflect.Message.Field)) throw Error(this + "#" + t + " is not a field: " + a.toString(!0)); this[a.name] = n = a.verifyValue(n) } if (a && a.oneof) { var s = this[a.oneof.name]; null !== n ? (null !== s && s !== a.name && (this[s] = null), this[a.oneof.name] = a.name) : s === t && (this[a.oneof.name] = null) } return this }, a.$set = a.set, a.get = function(t, n) { if (n) return this[t]; var r = i._fieldsByName[t]; if (!(r && r instanceof e.Reflect.Message.Field)) throw Error(this + "#" + t + " is not a field: undefined"); if (!(r instanceof e.Reflect.Message.Field)) throw Error(this + "#" + t + " is not a field: " + r.toString(!0)); return this[r.name] }, a.$get = a.get; for (var s = 0; s < n.length; s++) { var l = n[s]; l instanceof e.Reflect.Message.ExtensionField || i.builder.options.populateAccessors && function(t) { var e = t.originalName.replace(/(_[a-zA-Z])/g, (function(t) { return t.toUpperCase() .replace("_", "") })); e = e.substring(0, 1) .toUpperCase() + e.substring(1); var n = t.originalName.replace(/([A-Z])/g, (function(t) { return "_" + t })), r = function(e, i) { return this[t.name] = i ? e : t.verifyValue(e), this }, o = function() { return this[t.name] }; null === i.getChild("set" + e) && (a["set" + e] = r), null === i.getChild("set_" + n) && (a["set_" + n] = r), null === i.getChild("get" + e) && (a["get" + e] = o), null === i.getChild("get_" + n) && (a["get_" + n] = o) }(l) } function u(i, n, r, o) { if (null === i || "object" != typeof i) { if (o && o instanceof e.Reflect.Enum) { var a = e.Reflect.Enum.getName(o.object, i); if (null !== a) return a } return i } if (t.isByteBuffer(i)) return n ? i.toBase64() : i.toBuffer(); if (e.Long.isLong(i)) return r ? i.toString() : e.Long.fromValue(i); var s; if (Array.isArray(i)) return s = [], i.forEach((function(t, e) { s[e] = u(t, n, r, o) })), s; if (s = {}, i instanceof e.Map) { for (var l = i.entries(), h = l.next(); !h.done; h = l.next()) s[i.keyElem.valueToString(h.value[0])] = u(h.value[1], n, r, i.valueElem.resolvedType); return s } var c = i.$type, d = void 0; for (var p in i) i.hasOwnProperty(p) && (c && (d = c.getChild(p)) ? s[p] = u(i[p], n, r, d.resolvedType) : s[p] = u(i[p], n, r)); return s } return a.encode = function(e, n) { "boolean" == typeof e && (n = e, e = void 0); var r = !1; e || (e = new t, r = !0); var o = e.littleEndian; try { return i.encode(this, e.LE(), n), (r ? e.flip() : e) .LE(o) } catch (t) { throw e.LE(o), t } }, o.encode = function(t, e, i) { return new o(t) .encode(e, i) }, a.calculate = function() { return i.calculate(this) }, a.encodeDelimited = function(e, n) { var r = !1; e || (e = new t, r = !0); var o = (new t) .LE(); return i.encode(this, o, n) .flip(), e.writeVarint32(o.remaining()), e.append(o), r ? e.flip() : e }, a.encodeAB = function() { try { return this.encode() .toArrayBuffer() } catch (t) { throw t.encoded && (t.encoded = t.encoded.toArrayBuffer()), t } }, a.toArrayBuffer = a.encodeAB, a.encodeNB = function() { try { return this.encode() .toBuffer() } catch (t) { throw t.encoded && (t.encoded = t.encoded.toBuffer()), t } }, a.toBuffer = a.encodeNB, a.encode64 = function() { try { return this.encode() .toBase64() } catch (t) { throw t.encoded && (t.encoded = t.encoded.toBase64()), t } }, a.toBase64 = a.encode64, a.encodeHex = function() { try { return this.encode() .toHex() } catch (t) { throw t.encoded && (t.encoded = t.encoded.toHex()), t } }, a.toHex = a.encodeHex, a.toRaw = function(t, e) { return u(this, !!t, !!e, this.$type) }, a.encodeJSON = function() { return JSON.stringify(u(this, !0, !0, this.$type)) }, o.decode = function(e, n, r) { "string" == typeof n && (r = n, n = -1), "string" == typeof e ? e = t.wrap(e, r || "base64") : t.isByteBuffer(e) || (e = t.wrap(e)); var o = e.littleEndian; try { var a = i.decode(e.LE(), n); return e.LE(o), a } catch (t) { throw e.LE(o), t } }, o.decodeDelimited = function(e, n) { if ("string" == typeof e ? e = t.wrap(e, n || "base64") : t.isByteBuffer(e) || (e = t.wrap(e)), e.remaining() < 1) return null; var r = e.offset, o = e.readVarint32(); if (e.remaining() < o) return e.offset = r, null; try { var a = i.decode(e.slice(e.offset, e.offset + o) .LE()); return e.offset += o, a } catch (t) { throw e.offset += o, t } }, o.decode64 = function(t) { return o.decode(t, "base64") }, o.decodeHex = function(t) { return o.decode(t, "hex") }, o.decodeJSON = function(t) { return new o(JSON.parse(t)) }, a.toString = function() { return i.toString() }, Object.defineProperty && (Object.defineProperty(o, "$options", { value: i.buildOpt() }), Object.defineProperty(a, "$options", { value: o.$options }), Object.defineProperty(o, "$type", { value: i }), Object.defineProperty(a, "$type", { value: i })), o }(e, this); this._fields = [], this._fieldsById = {}, this._fieldsByName = {}, this._oneofsByName = {}; for (var r, o = 0, a = this.children.length; o < a; o++) if ((r = this.children[o]) instanceof g || r instanceof h || r instanceof b) { if (n.hasOwnProperty(r.name)) throw Error("Illegal reflect child of " + this.toString(!0) + ": " + r.toString(!0) + " cannot override static property '" + r.name + "'"); n[r.name] = r.build() } else if (r instanceof h.Field) r.build(), this._fields.push(r), this._fieldsById[r.id] = r, this._fieldsByName[r.name] = r; else if (r instanceof h.OneOf) this._oneofsByName[r.name] = r; else if (!(r instanceof h.OneOf || r instanceof y)) throw Error("Illegal reflect child of " + this.toString(!0) + ": " + this.children[o].toString(!0)); return this.clazz = n }, c.encode = function(t, e, i) { for (var n, r, o = null, a = 0, s = this._fields.length; a < s; ++a) r = t[(n = this._fields[a]) .name], n.required && null === r ? null === o && (o = n) : n.encode(i ? r : n.verifyValue(r), e, t); if (null !== o) { var l = Error("Missing at least one required field for " + this.toString(!0) + ": " + o); throw l.encoded = e, l } return e }, c.calculate = function(t) { for (var e, i, n = 0, r = 0, o = this._fields.length; r < o; ++r) { if (i = t[(e = this._fields[r]) .name], e.required && null === i) throw Error("Missing at least one required field for " + this.toString(!0) + ": " + e); n += e.calculate(i, t) } return n }, c.decode = function(t, i, n) { "number" != typeof i && (i = -1); for (var r, o, a, s, l = t.offset, u = new this.clazz; t.offset < l + i || -1 === i && t.remaining() > 0;) { if (a = (r = t.readVarint32()) >>> 3, (o = 7 & r) === e.WIRE_TYPES.ENDGROUP) { if (a !== n) throw Error("Illegal group end indicator for " + this.toString(!0) + ": " + a + " (" + (n ? n + " expected" : "not a group") + ")"); break } if (s = this._fieldsById[a]) { if (s.repeated && !s.options.packed) u[s.name].push(s.decode(o, t)); else if (s.map) { var h = s.decode(o, t); u[s.name].set(h[0], h[1]) } else if (u[s.name] = s.decode(o, t), s.oneof) { var c = u[s.oneof.name]; null !== c && c !== s.name && (u[c] = null), u[s.oneof.name] = s.name } } else switch (o) { case e.WIRE_TYPES.VARINT: t.readVarint32(); break; case e.WIRE_TYPES.BITS32: t.offset += 4; break; case e.WIRE_TYPES.BITS64: t.offset += 8; break; case e.WIRE_TYPES.LDELIM: var p = t.readVarint32(); t.offset += p; break; case e.WIRE_TYPES.STARTGROUP: for (; d(a, t);); break; default: throw Error("Illegal wire type for unknown field " + a + " in " + this.toString(!0) + "#decode: " + o) } } for (var f = 0, m = this._fields.length; f < m; ++f) if (null === u[(s = this._fields[f]) .name]) if ("proto3" === this.syntax) u[s.name] = s.defaultValue; else { if (s.required) { var g = Error("Missing at least one required field for " + this.toString(!0) + ": " + s.name); throw g.decoded = u, g } e.populateDefaults && null !== s.defaultValue && (u[s.name] = s.defaultValue) } return u }, i.Message = h; var p = function(t, i, r, o, a, s, l, u, c, d) { n.call(this, t, i, s), this.className = "Message.Field", this.required = "required" === r, this.repeated = "repeated" === r, this.map = "map" === r, this.keyType = o || null, this.type = a, this.resolvedType = null, this.id = l, this.options = u || {}, this.defaultValue = null, this.oneof = c || null, this.syntax = d || "proto2", this.originalName = this.name, this.element = null, this.keyElement = null, !this.builder.options.convertFieldsToCamelCase || this instanceof h.ExtensionField || (this.name = e.Util.toCamelCase(this.name)) }, f = p.prototype = Object.create(n.prototype); f.build = function() { this.element = new s(this.type, this.resolvedType, !1, this.syntax, this.name), this.map && (this.keyElement = new s(this.keyType, void 0, !0, this.syntax, this.name)), "proto3" !== this.syntax || this.repeated || this.map ? void 0 !== this.options.default && (this.defaultValue = this.verifyValue(this.options.default)) : this.defaultValue = s.defaultFieldValue(this.type) }, f.verifyValue = function(t, i) { i = i || !1; var n, r = this; function o(t, e) { throw Error("Illegal value for " + r.toString(!0) + " of type " + r.type.name + ": " + t + " (" + e + ")") } if (null === t) return this.required && o(typeof t, "required"), "proto3" === this.syntax && this.type !== e.TYPES.message && o(typeof t, "proto3 field without field presence cannot be null"), null; if (this.repeated && !i) { Array.isArray(t) || (t = [t]); var a = []; for (n = 0; n < t.length; n++) a.push(this.element.verifyValue(t[n])); return a } return this.map && !i ? t instanceof e.Map ? t : (t instanceof Object || o(typeof t, "expected ProtoBuf.Map or raw object for map field"), new e.Map(this, t)) : (!this.repeated && Array.isArray(t) && o(typeof t, "no array expected"), this.element.verifyValue(t)) }, f.hasWirePresence = function(t, i) { if ("proto3" !== this.syntax) return null !== t; if (this.oneof && i[this.oneof.name] === this.name) return !0; switch (this.type) { case e.TYPES.int32: case e.TYPES.sint32: case e.TYPES.sfixed32: case e.TYPES.uint32: case e.TYPES.fixed32: return 0 !== t; case e.TYPES.int64: case e.TYPES.sint64: case e.TYPES.sfixed64: case e.TYPES.uint64: case e.TYPES.fixed64: return 0 !== t.low || 0 !== t.high; case e.TYPES.bool: return t; case e.TYPES.float: case e.TYPES.double: return 0 !== t; case e.TYPES.string: return t.length > 0; case e.TYPES.bytes: return t.remaining() > 0; case e.TYPES.enum: return 0 !== t; case e.TYPES.message: return null !== t; default: return !0 } }, f.encode = function(i, n, r) { if (null === this.type || "object" != typeof this.type) throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type); if (null === i || this.repeated && 0 == i.length) return n; try { var o; if (this.repeated) if (this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) { n.writeVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM), n.ensureCapacity(n.offset += 1); var a = n.offset; for (o = 0; o < i.length; o++) this.element.encodeValue(this.id, i[o], n); var s = n.offset - a, l = t.calculateVarint32(s); if (l > 1) { var u = n.slice(a, n.offset); a += l - 1, n.offset = a, n.append(u) } n.writeVarint32(s, a - l) } else for (o = 0; o < i.length; o++) n.writeVarint32(this.id << 3 | this.type.wireType), this.element.encodeValue(this.id, i[o], n); else this.map ? i.forEach((function(i, r, o) { var a = t.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, r) + t.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, i); n.writeVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM), n.writeVarint32(a), n.writeVarint32(8 | this.keyType.wireType), this.keyElement.encodeValue(1, r, n), n.writeVarint32(16 | this.type.wireType), this.element.encodeValue(2, i, n) }), this) : this.hasWirePresence(i, r) && (n.writeVarint32(this.id << 3 | this.type.wireType), this.element.encodeValue(this.id, i, n)) } catch (t) { throw Error("Illegal value for " + this.toString(!0) + ": " + i + " (" + t + ")") } return n }, f.calculate = function(i, n) { if (i = this.verifyValue(i), null === this.type || "object" != typeof this.type) throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type); if (null === i || this.repeated && 0 == i.length) return 0; var r = 0; try { var o, a; if (this.repeated) if (this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) { for (r += t.calculateVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM), a = 0, o = 0; o < i.length; o++) a += this.element.calculateLength(this.id, i[o]); r += t.calculateVarint32(a), r += a } else for (o = 0; o < i.length; o++) r += t.calculateVarint32(this.id << 3 | this.type.wireType), r += this.element.calculateLength(this.id, i[o]); else this.map ? i.forEach((function(i, n, o) { var a = t.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, n) + t.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, i); r += t.calculateVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM), r += t.calculateVarint32(a), r += a }), this) : this.hasWirePresence(i, n) && (r += t.calculateVarint32(this.id << 3 | this.type.wireType), r += this.element.calculateLength(this.id, i)) } catch (t) { throw Error("Illegal value for " + this.toString(!0) + ": " + i + " (" + t + ")") } return r }, f.decode = function(t, i, n) { var r, o; if (!(!this.map && t == this.type.wireType || !n && this.repeated && this.options.packed && t == e.WIRE_TYPES.LDELIM || this.map && t == e.WIRE_TYPES.LDELIM)) throw Error("Illegal wire type for field " + this.toString(!0) + ": " + t + " (" + this.type.wireType + " expected)"); if (t == e.WIRE_TYPES.LDELIM && this.repeated && this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0 && !n) { o = i.readVarint32(), o = i.offset + o; for (var a = []; i.offset < o;) a.push(this.decode(this.type.wireType, i, !0)); return a } if (this.map) { var l = s.defaultFieldValue(this.keyType); if (r = s.defaultFieldValue(this.type), o = i.readVarint32(), i.remaining() < o) throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + o + " required but got only " + i.remaining()); var u = i.clone(); for (u.limit = u.offset + o, i.offset += o; u.remaining() > 0;) { var h = u.readVarint32(); t = 7 & h; var c = h >>> 3; if (1 === c) l = this.keyElement.decode(u, t, c); else { if (2 !== c) throw Error("Unexpected tag in map field key/value submessage"); r = this.element.decode(u, t, c) } } return [l, r] } return this.element.decode(i, t, this.id) }, i.Message.Field = p; var m = function(t, e, i, n, r, o, a) { p.call(this, t, e, i, null, n, r, o, a), this.extension }; m.prototype = Object.create(p.prototype), i.Message.ExtensionField = m, i.Message.OneOf = function(t, e, i) { n.call(this, t, e, i), this.fields = [] }; var g = function(t, e, i, n, r) { o.call(this, t, e, i, n, r), this.className = "Enum", this.object = null }; g.getName = function(t, e) { for (var i, n = Object.keys(t), r = 0; r < n.length; ++r) if (t[i = n[r]] === e) return i; return null }, (g.prototype = Object.create(o.prototype)) .build = function(t) { if (this.object && !t) return this.object; for (var i = new e.Builder.Enum, n = this.getChildren(g.Value), r = 0, o = n.length; r < o; ++r) i[n[r].name] = n[r].id; return Object.defineProperty && Object.defineProperty(i, "$options", { value: this.buildOpt(), enumerable: !1 }), this.object = i }, i.Enum = g; var v = function(t, e, i, r) { n.call(this, t, e, i), this.className = "Enum.Value", this.id = r }; v.prototype = Object.create(n.prototype), i.Enum.Value = v; var y = function(t, e, i, r) { n.call(this, t, e, i), this.field = r }; y.prototype = Object.create(n.prototype), i.Extension = y; var b = function(t, e, i, n) { o.call(this, t, e, i, n), this.className = "Service", this.clazz = null }; (b.prototype = Object.create(o.prototype)) .build = function(i) { return this.clazz && !i ? this.clazz : this.clazz = function(e, i) { for (var n = function(t) { e.Builder.Service.call(this), this.rpcImpl = t || function(t, e, i) { setTimeout(i.bind(this, Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")), 0) } }, r = n.prototype = Object.create(e.Builder.Service.prototype), o = i.getChildren(e.Reflect.Service.RPCMethod), a = 0; a < o.length; a++) ! function(e) { r[e.name] = function(n, r) { try { try { n = e.resolvedRequestType.clazz.decode(t.wrap(n)) } catch (t) { if (!(t instanceof TypeError)) throw t } if (null === n || "object" != typeof n) throw Error("Illegal arguments"); n instanceof e.resolvedRequestType.clazz || (n = new e.resolvedRequestType.clazz(n)), this.rpcImpl(e.fqn(), n, (function(t, n) { if (t) r(t); else { null === n && (n = ""); try { n = e.resolvedResponseType.clazz.decode(n) } catch (t) {} n && n instanceof e.resolvedResponseType.clazz ? r(null, n) : r(Error("Illegal response type received in service method " + i.name + "#" + e.name)) } })) } catch (t) { setTimeout(r.bind(this, t), 0) } }, n[e.name] = function(t, i, r) { new n(t)[e.name](i, r) }, Object.defineProperty && (Object.defineProperty(n[e.name], "$options", { value: e.buildOpt() }), Object.defineProperty(r[e.name], "$options", { value: n[e.name].$options })) }(o[a]); return Object.defineProperty && (Object.defineProperty(n, "$options", { value: i.buildOpt() }), Object.defineProperty(r, "$options", { value: n.$options }), Object.defineProperty(n, "$type", { value: i }), Object.defineProperty(r, "$type", { value: i })), n }(e, this) }, i.Service = b; var w = function(t, e, i, r) { n.call(this, t, e, i), this.className = "Service.Method", this.options = r || {} }; (w.prototype = Object.create(n.prototype)) .buildOpt = a.buildOpt, i.Service.Method = w; var x = function(t, e, i, n, r, o, a, s) { w.call(this, t, e, i, s), this.className = "Service.RPCMethod", this.requestName = n, this.responseName = r, this.requestStream = o, this.responseStream = a, this.resolvedRequestType = null, this.resolvedResponseType = null }; return x.prototype = Object.create(w.prototype), i.Service.RPCMethod = x, i }(o), o.Builder = function(t, e, n) { var r = function(t) { this.ns = new n.Namespace(this, null, ""), this.ptr = this.ns, this.resolved = !1, this.result = null, this.files = {}, this.importRoot = null, this.options = t || {} }, o = r.prototype; return r.isMessage = function(t) { return "string" == typeof t.name && void 0 === t.values && void 0 === t.rpc }, r.isMessageField = function(t) { return "string" == typeof t.rule && "string" == typeof t.name && "string" == typeof t.type && void 0 !== t.id }, r.isEnum = function(t) { return "string" == typeof t.name && !(void 0 === t.values || !Array.isArray(t.values) || 0 === t.values.length) }, r.isService = function(t) { return !("string" != typeof t.name || "object" != typeof t.rpc || !t.rpc) }, r.isExtend = function(t) { return "string" == typeof t.ref }, o.reset = function() { return this.ptr = this.ns, this }, o.define = function(t) { if ("string" != typeof t || !e.TYPEREF.test(t)) throw Error("illegal namespace: " + t); return t.split(".") .forEach((function(t) { var e = this.ptr.getChild(t); null === e && this.ptr.addChild(e = new n.Namespace(this, this.ptr, t)), this.ptr = e }), this), this }, o.create = function(e) { if (!e) return this; if (Array.isArray(e)) { if (0 === e.length) return this; e = e.slice() } else e = [e]; for (var i = [e]; i.length > 0;) { if (e = i.pop(), !Array.isArray(e)) throw Error("not a valid namespace: " + JSON.stringify(e)); for (; e.length > 0;) { var o = e.shift(); if (r.isMessage(o)) { var a = new n.Message(this, this.ptr, o.name, o.options, o.isGroup, o.syntax), s = {}; o.oneofs && Object.keys(o.oneofs) .forEach((function(t) { a.addChild(s[t] = new n.Message.OneOf(this, a, t)) }), this), o.fields && o.fields.forEach((function(t) { if (null !== a.getChild(0 | t.id)) throw Error("duplicate or invalid field id in " + a.name + ": " + t.id); if (t.options && "object" != typeof t.options) throw Error("illegal field options in " + a.name + "#" + t.name); var e = null; if ("string" == typeof t.oneof && !(e = s[t.oneof])) throw Error("illegal oneof in " + a.name + "#" + t.name + ": " + t.oneof); t = new n.Message.Field(this, a, t.rule, t.keytype, t.type, t.name, t.id, t.options, e, o.syntax), e && e.fields.push(t), a.addChild(t) }), this); var l = []; if (o.enums && o.enums.forEach((function(t) { l.push(t) })), o.messages && o.messages.forEach((function(t) { l.push(t) })), o.services && o.services.forEach((function(t) { l.push(t) })), o.extensions && ("number" == typeof o.extensions[0] ? a.extensions = [o.extensions] : a.extensions = o.extensions), this.ptr.addChild(a), l.length > 0) { i.push(e), e = l, l = null, this.ptr = a, a = null; continue } l = null } else if (r.isEnum(o)) a = new n.Enum(this, this.ptr, o.name, o.options, o.syntax), o.values.forEach((function(t) { a.addChild(new n.Enum.Value(this, a, t.name, t.id)) }), this), this.ptr.addChild(a); else if (r.isService(o)) a = new n.Service(this, this.ptr, o.name, o.options), Object.keys(o.rpc) .forEach((function(t) { var e = o.rpc[t]; a.addChild(new n.Service.RPCMethod(this, a, t, e.request, e.response, !!e.request_stream, !!e.response_stream, e.options)) }), this), this.ptr.addChild(a); else { if (!r.isExtend(o)) throw Error("not a valid definition: " + JSON.stringify(o)); if (a = this.ptr.resolve(o.ref, !0)) o.fields.forEach((function(e) { if (null !== a.getChild(0 | e.id)) throw Error("duplicate extended field id in " + a.name + ": " + e.id); if (a.extensions) { var i = !1; if (a.extensions.forEach((function(t) { e.id >= t[0] && e.id <= t[1] && (i = !0) })), !i) throw Error("illegal extended field id in " + a.name + ": " + e.id + " (not within valid ranges)") } var r = e.name; this.options.convertFieldsToCamelCase && (r = t.Util.toCamelCase(r)); var o = new n.Message.ExtensionField(this, a, e.rule, e.type, this.ptr.fqn() + "." + r, e.id, e.options), s = new n.Extension(this, this.ptr, e.name, o); o.extension = s, this.ptr.addChild(s), a.addChild(o) }), this); else if (!/\.?google\.protobuf\./.test(o.ref)) throw Error("extended message " + o.ref + " is not defined") } o = null, a = null } e = null, this.ptr = this.ptr.parent } return this.resolved = !1, this.result = null, this }, o.import = function(e, n) { var r = "/"; if ("string" == typeof n) { if (t.Util.IS_NODE && (n = i(34) .resolve(n)), !0 === this.files[n]) return this.reset(); this.files[n] = !0 } else if ("object" == typeof n) { var o, a = n.root; if (t.Util.IS_NODE && (a = i(34) .resolve(a)), (a.indexOf("\\") >= 0 || n.file.indexOf("\\") >= 0) && (r = "\\"), o = t.Util.IS_NODE ? i(34) .join(a, n.file) : a + r + n.file, !0 === this.files[o]) return this.reset(); this.files[o] = !0 } if (e.imports && e.imports.length > 0) { var s, l = !1; "object" == typeof n ? (this.importRoot = n.root, l = !0, s = this.importRoot, n = n.file, (s.indexOf("\\") >= 0 || n.indexOf("\\") >= 0) && (r = "\\")) : "string" == typeof n ? this.importRoot ? s = this.importRoot : n.indexOf("/") >= 0 ? "" === (s = n.replace(/\/[^\/]*$/, "")) && (s = "/") : n.indexOf("\\") >= 0 ? (s = n.replace(/\\[^\\]*$/, ""), r = "\\") : s = "." : s = null; for (var u = 0; u < e.imports.length; u++) if ("string" == typeof e.imports[u]) { if (!s) throw Error("cannot determine import root"); var h = e.imports[u]; if ("google/protobuf/descriptor.proto" === h) continue; if (h = t.Util.IS_NODE ? i(34) .join(s, h) : s + r + h, !0 === this.files[h]) continue; /\.proto$/i.test(h) && !t.DotProto && (h = h.replace(/\.proto$/, ".json")); var c = t.Util.fetch(h); if (null === c) throw Error("failed to import '" + h + "' in '" + n + "': file not found"); /\.json$/i.test(h) ? this.import(JSON.parse(c + ""), h) : this.import(t.DotProto.Parser.parse(c), h) } else n ? /\.(\w+)$/.test(n) ? this.import(e.imports[u], n.replace(/^(.+)\.(\w+)$/, (function(t, e, i) { return e + "_import" + u + "." + i }))) : this.import(e.imports[u], n + "_import" + u) : this.import(e.imports[u]); l && (this.importRoot = null) } e.package && this.define(e.package), e.syntax && function t(e) { e.messages && e.messages.forEach((function(i) { i.syntax = e.syntax, t(i) })), e.enums && e.enums.forEach((function(t) { t.syntax = e.syntax })) }(e); var d = this.ptr; return e.options && Object.keys(e.options) .forEach((function(t) { d.options[t] = e.options[t] })), e.messages && (this.create(e.messages), this.ptr = d), e.enums && (this.create(e.enums), this.ptr = d), e.services && (this.create(e.services), this.ptr = d), e.extends && this.create(e.extends), this.reset() }, o.resolveAll = function() { var i; if (null == this.ptr || "object" == typeof this.ptr.type) return this; if (this.ptr instanceof n.Namespace) this.ptr.children.forEach((function(t) { this.ptr = t, this.resolveAll() }), this); else if (this.ptr instanceof n.Message.Field) { if (e.TYPE.test(this.ptr.type)) this.ptr.type = t.TYPES[this.ptr.type]; else { if (!e.TYPEREF.test(this.ptr.type)) throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type); if (!(i = (this.ptr instanceof n.Message.ExtensionField ? this.ptr.extension.parent : this.ptr.parent) .resolve(this.ptr.type, !0))) throw Error("unresolvable type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type); if (this.ptr.resolvedType = i, i instanceof n.Enum) { if (this.ptr.type = t.TYPES.enum, "proto3" === this.ptr.syntax && "proto3" !== i.syntax) throw Error("proto3 message cannot reference proto2 enum") } else { if (!(i instanceof n.Message)) throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type); this.ptr.type = i.isGroup ? t.TYPES.group : t.TYPES.message } } if (this.ptr.map) { if (!e.TYPE.test(this.ptr.keyType)) throw Error("illegal key type for map field in " + this.ptr.toString(!0) + ": " + this.ptr.keyType); this.ptr.keyType = t.TYPES[this.ptr.keyType] } "proto3" === this.ptr.syntax && this.ptr.repeated && void 0 === this.ptr.options.packed && -1 !== t.PACKABLE_WIRE_TYPES.indexOf(this.ptr.type.wireType) && (this.ptr.options.packed = !0) } else if (this.ptr instanceof t.Reflect.Service.Method) { if (!(this.ptr instanceof t.Reflect.Service.RPCMethod)) throw Error("illegal service type in " + this.ptr.toString(!0)); if (!((i = this.ptr.parent.resolve(this.ptr.requestName, !0)) && i instanceof t.Reflect.Message)) throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.requestName); if (this.ptr.resolvedRequestType = i, !((i = this.ptr.parent.resolve(this.ptr.responseName, !0)) && i instanceof t.Reflect.Message)) throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.responseName); this.ptr.resolvedResponseType = i } else if (!(this.ptr instanceof t.Reflect.Message.OneOf || this.ptr instanceof t.Reflect.Extension || this.ptr instanceof t.Reflect.Enum.Value)) throw Error("illegal object in namespace: " + typeof this.ptr + ": " + this.ptr); return this.reset() }, o.build = function(t) { if (this.reset(), this.resolved || (this.resolveAll(), this.resolved = !0, this.result = null), null === this.result && (this.result = this.ns.build()), !t) return this.result; for (var e = "string" == typeof t ? t.split(".") : t, i = this.result, n = 0; n < e.length; n++) { if (!i[e[n]]) { i = null; break } i = i[e[n]] } return i }, o.lookup = function(t, e) { return t ? this.ns.resolve(t, e) : this.ns }, o.toString = function() { return "Builder" }, r.Message = function() {}, r.Enum = function() {}, r.Service = function() {}, r }(o, o.Lang, o.Reflect), o.Map = function(t, e) { var i = function(t, i) { if (!t.map) throw Error("field is not a map"); if (this.field = t, this.keyElem = new e.Element(t.keyType, null, !0, t.syntax), this.valueElem = new e.Element(t.type, t.resolvedType, !1, t.syntax), this.map = {}, Object.defineProperty(this, "size", { get: function() { return Object.keys(this.map) .length } }), i) for (var n = Object.keys(i), r = 0; r < n.length; r++) { var o = this.keyElem.valueFromString(n[r]), a = this.valueElem.verifyValue(i[n[r]]); this.map[this.keyElem.valueToString(o)] = { key: o, value: a } } }, n = i.prototype; function r(t) { var e = 0; return { next: function() { return e < t.length ? { done: !1, value: t[e++] } : { done: !0 } } } } return n.clear = function() { this.map = {} }, n.delete = function(t) { var e = this.keyElem.valueToString(this.keyElem.verifyValue(t)), i = e in this.map; return delete this.map[e], i }, n.entries = function() { for (var t, e = [], i = Object.keys(this.map), n = 0; n < i.length; n++) e.push([(t = this.map[i[n]]) .key, t.value ]); return r(e) }, n.keys = function() { for (var t = [], e = Object.keys(this.map), i = 0; i < e.length; i++) t.push(this.map[e[i]].key); return r(t) }, n.values = function() { for (var t = [], e = Object.keys(this.map), i = 0; i < e.length; i++) t.push(this.map[e[i]].value); return r(t) }, n.forEach = function(t, e) { for (var i, n = Object.keys(this.map), r = 0; r < n.length; r++) t.call(e, (i = this.map[n[r]]) .value, i.key, this) }, n.set = function(t, e) { var i = this.keyElem.verifyValue(t), n = this.valueElem.verifyValue(e); return this.map[this.keyElem.valueToString(i)] = { key: i, value: n }, this }, n.get = function(t) { var e = this.keyElem.valueToString(this.keyElem.verifyValue(t)); if (e in this.map) return this.map[e].value }, n.has = function(t) { return this.keyElem.valueToString(this.keyElem.verifyValue(t)) in this.map }, i }(0, o.Reflect), o.loadProto = function(t, e, i) { return ("string" == typeof e || e && "string" == typeof e.file && "string" == typeof e.root) && (i = e, e = void 0), o.loadJson(o.DotProto.Parser.parse(t), e, i) }, o.protoFromString = o.loadProto, o.loadProtoFile = function(t, e, i) { if (e && "object" == typeof e ? (i = e, e = null) : e && "function" == typeof e || (e = null), e) return o.Util.fetch("string" == typeof t ? t : t.root + "/" + t.file, (function(n) { if (null !== n) try { e(null, o.loadProto(n, i, t)) } catch (t) { e(t) } else e(Error("Failed to fetch file")) })); var n = o.Util.fetch("object" == typeof t ? t.root + "/" + t.file : t); return null === n ? null : o.loadProto(n, i, t) }, o.protoFromFile = o.loadProtoFile, o.newBuilder = function(t) { return void 0 === (t = t || {}) .convertFieldsToCamelCase && (t.convertFieldsToCamelCase = o.convertFieldsToCamelCase), void 0 === t.populateAccessors && (t.populateAccessors = o.populateAccessors), new o.Builder(t) }, o.loadJson = function(t, e, i) { return ("string" == typeof e || e && "string" == typeof e.file && "string" == typeof e.root) && (i = e, e = null), e && "object" == typeof e || (e = o.newBuilder()), "string" == typeof t && (t = JSON.parse(t)), e.import(t, i), e.resolveAll(), e }, o.loadJsonFile = function(t, e, i) { if (e && "object" == typeof e ? (i = e, e = null) : e && "function" == typeof e || (e = null), e) return o.Util.fetch("string" == typeof t ? t : t.root + "/" + t.file, (function(n) { if (null !== n) try { e(null, o.loadJson(JSON.parse(n), i, t)) } catch (t) { e(t) } else e(Error("Failed to fetch file")) })); var n = o.Util.fetch("object" == typeof t ? t.root + "/" + t.file : t); return null === n ? null : o.loadJson(JSON.parse(n), i, t) }, o }) ? r.apply(e, o) : r) || (t.exports = a) }) .call(this, i(50)) }, function(t, e, i) { "use strict"; (function(t) { var n = i(172), r = i(173), o = i(174); function a() { return l.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823 } function s(t, e) { if (a() < e) throw new RangeError("Invalid typed array length"); return l.TYPED_ARRAY_SUPPORT ? (t = new Uint8Array(e)) .__proto__ = l.prototype : (null === t && (t = new l(e)), t.length = e), t } function l(t, e, i) { if (!(l.TYPED_ARRAY_SUPPORT || this instanceof l)) return new l(t, e, i); if ("number" == typeof t) { if ("string" == typeof e) throw new Error("If encoding is specified then the first argument must be a string"); return c(this, t) } return u(this, t, e, i) } function u(t, e, i, n) { if ("number" == typeof e) throw new TypeError('"value" argument must not be a number'); return "undefined" != typeof ArrayBuffer && e instanceof ArrayBuffer ? function(t, e, i, n) { if (e.byteLength, i < 0 || e.byteLength < i) throw new RangeError("'offset' is out of bounds"); if (e.byteLength < i + (n || 0)) throw new RangeError("'length' is out of bounds"); e = void 0 === i && void 0 === n ? new Uint8Array(e) : void 0 === n ? new Uint8Array(e, i) : new Uint8Array(e, i, n); l.TYPED_ARRAY_SUPPORT ? (t = e) .__proto__ = l.prototype : t = d(t, e); return t }(t, e, i, n) : "string" == typeof e ? function(t, e, i) { "string" == typeof i && "" !== i || (i = "utf8"); if (!l.isEncoding(i)) throw new TypeError('"encoding" must be a valid string encoding'); var n = 0 | f(e, i), r = (t = s(t, n)) .write(e, i); r !== n && (t = t.slice(0, r)); return t }(t, e, i) : function(t, e) { if (l.isBuffer(e)) { var i = 0 | p(e.length); return 0 === (t = s(t, i)) .length || e.copy(t, 0, 0, i), t } if (e) { if ("undefined" != typeof ArrayBuffer && e.buffer instanceof ArrayBuffer || "length" in e) return "number" != typeof e.length || (n = e.length) != n ? s(t, 0) : d(t, e); if ("Buffer" === e.type && o(e.data)) return d(t, e.data) } var n; throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.") }(t, e) } function h(t) { if ("number" != typeof t) throw new TypeError('"size" argument must be a number'); if (t < 0) throw new RangeError('"size" argument must not be negative') } function c(t, e) { if (h(e), t = s(t, e < 0 ? 0 : 0 | p(e)), !l.TYPED_ARRAY_SUPPORT) for (var i = 0; i < e; ++i) t[i] = 0; return t } function d(t, e) { var i = e.length < 0 ? 0 : 0 | p(e.length); t = s(t, i); for (var n = 0; n < i; n += 1) t[n] = 255 & e[n]; return t } function p(t) { if (t >= a()) throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + a() .toString(16) + " bytes"); return 0 | t } function f(t, e) { if (l.isBuffer(t)) return t.length; if ("undefined" != typeof ArrayBuffer && "function" == typeof ArrayBuffer.isView && (ArrayBuffer.isView(t) || t instanceof ArrayBuffer)) return t.byteLength; "string" != typeof t && (t = "" + t); var i = t.length; if (0 === i) return 0; for (var n = !1;;) switch (e) { case "ascii": case "latin1": case "binary": return i; case "utf8": case "utf-8": case void 0: return U(t) .length; case "ucs2": case "ucs-2": case "utf16le": case "utf-16le": return 2 * i; case "hex": return i >>> 1; case "base64": return V(t) .length; default: if (n) return U(t) .length; e = ("" + e) .toLowerCase(), n = !0 } } function m(t, e, i) { var n = !1; if ((void 0 === e || e < 0) && (e = 0), e > this.length) return ""; if ((void 0 === i || i > this.length) && (i = this.length), i <= 0) return ""; if ((i >>>= 0) <= (e >>>= 0)) return ""; for (t || (t = "utf8");;) switch (t) { case "hex": return E(this, e, i); case "utf8": case "utf-8": return A(this, e, i); case "ascii": return P(this, e, i); case "latin1": case "binary": return C(this, e, i); case "base64": return _(this, e, i); case "ucs2": case "ucs-2": case "utf16le": case "utf-16le": return D(this, e, i); default: if (n) throw new TypeError("Unknown encoding: " + t); t = (t + "") .toLowerCase(), n = !0 } } function g(t, e, i) { var n = t[e]; t[e] = t[i], t[i] = n } function v(t, e, i, n, r) { if (0 === t.length) return -1; if ("string" == typeof i ? (n = i, i = 0) : i > 2147483647 ? i = 2147483647 : i < -2147483648 && (i = -2147483648), i = +i, isNaN(i) && (i = r ? 0 : t.length - 1), i < 0 && (i = t.length + i), i >= t.length) { if (r) return -1; i = t.length - 1 } else if (i < 0) { if (!r) return -1; i = 0 } if ("string" == typeof e && (e = l.from(e, n)), l.isBuffer(e)) return 0 === e.length ? -1 : y(t, e, i, n, r); if ("number" == typeof e) return e &= 255, l.TYPED_ARRAY_SUPPORT && "function" == typeof Uint8Array.prototype.indexOf ? r ? Uint8Array.prototype.indexOf.call(t, e, i) : Uint8Array.prototype.lastIndexOf.call(t, e, i) : y(t, [e], i, n, r); throw new TypeError("val must be string, number or Buffer") } function y(t, e, i, n, r) { var o, a = 1, s = t.length, l = e.length; if (void 0 !== n && ("ucs2" === (n = String(n) .toLowerCase()) || "ucs-2" === n || "utf16le" === n || "utf-16le" === n)) { if (t.length < 2 || e.length < 2) return -1; a = 2, s /= 2, l /= 2, i /= 2 } function u(t, e) { return 1 === a ? t[e] : t.readUInt16BE(e * a) } if (r) { var h = -1; for (o = i; o < s; o++) if (u(t, o) === u(e, -1 === h ? 0 : o - h)) { if (-1 === h && (h = o), o - h + 1 === l) return h * a } else -1 !== h && (o -= o - h), h = -1 } else for (i + l > s && (i = s - l), o = i; o >= 0; o--) { for (var c = !0, d = 0; d < l; d++) if (u(t, o + d) !== u(e, d)) { c = !1; break } if (c) return o } return -1 } function b(t, e, i, n) { i = Number(i) || 0; var r = t.length - i; n ? (n = Number(n)) > r && (n = r) : n = r; var o = e.length; if (o % 2 != 0) throw new TypeError("Invalid hex string"); n > o / 2 && (n = o / 2); for (var a = 0; a < n; ++a) { var s = parseInt(e.substr(2 * a, 2), 16); if (isNaN(s)) return a; t[i + a] = s } return a } function w(t, e, i, n) { return j(U(e, t.length - i), t, i, n) } function x(t, e, i, n) { return j(function(t) { for (var e = [], i = 0; i < t.length; ++i) e.push(255 & t.charCodeAt(i)); return e }(e), t, i, n) } function M(t, e, i, n) { return x(t, e, i, n) } function T(t, e, i, n) { return j(V(e), t, i, n) } function S(t, e, i, n) { return j(function(t, e) { for (var i, n, r, o = [], a = 0; a < t.length && !((e -= 2) < 0); ++a) i = t.charCodeAt(a), n = i >> 8, r = i % 256, o.push(r), o.push(n); return o }(e, t.length - i), t, i, n) } function _(t, e, i) { return 0 === e && i === t.length ? n.fromByteArray(t) : n.fromByteArray(t.slice(e, i)) } function A(t, e, i) { i = Math.min(t.length, i); for (var n = [], r = e; r < i;) { var o, a, s, l, u = t[r], h = null, c = u > 239 ? 4 : u > 223 ? 3 : u > 191 ? 2 : 1; if (r + c <= i) switch (c) { case 1: u < 128 && (h = u); break; case 2: 128 == (192 & (o = t[r + 1])) && (l = (31 & u) << 6 | 63 & o) > 127 && (h = l); break; case 3: o = t[r + 1], a = t[r + 2], 128 == (192 & o) && 128 == (192 & a) && (l = (15 & u) << 12 | (63 & o) << 6 | 63 & a) > 2047 && (l < 55296 || l > 57343) && (h = l); break; case 4: o = t[r + 1], a = t[r + 2], s = t[r + 3], 128 == (192 & o) && 128 == (192 & a) && 128 == (192 & s) && (l = (15 & u) << 18 | (63 & o) << 12 | (63 & a) << 6 | 63 & s) > 65535 && l < 1114112 && (h = l) } null === h ? (h = 65533, c = 1) : h > 65535 && (h -= 65536, n.push(h >>> 10 & 1023 | 55296), h = 56320 | 1023 & h), n.push(h), r += c } return function(t) { var e = t.length; if (e <= 4096) return String.fromCharCode.apply(String, t); var i = "", n = 0; for (; n < e;) i += String.fromCharCode.apply(String, t.slice(n, n += 4096)); return i }(n) } e.Buffer = l, e.SlowBuffer = function(t) { +t != t && (t = 0); return l.alloc(+t) }, e.INSPECT_MAX_BYTES = 50, l.TYPED_ARRAY_SUPPORT = void 0 !== t.TYPED_ARRAY_SUPPORT ? t.TYPED_ARRAY_SUPPORT : function() { try { var t = new Uint8Array(1); return t.__proto__ = { __proto__: Uint8Array.prototype, foo: function() { return 42 } }, 42 === t.foo() && "function" == typeof t.subarray && 0 === t.subarray(1, 1) .byteLength } catch (t) { return !1 } }(), e.kMaxLength = a(), l.poolSize = 8192, l._augment = function(t) { return t.__proto__ = l.prototype, t }, l.from = function(t, e, i) { return u(null, t, e, i) }, l.TYPED_ARRAY_SUPPORT && (l.prototype.__proto__ = Uint8Array.prototype, l.__proto__ = Uint8Array, "undefined" != typeof Symbol && Symbol.species && l[Symbol.species] === l && Object.defineProperty(l, Symbol.species, { value: null, configurable: !0 })), l.alloc = function(t, e, i) { return function(t, e, i, n) { return h(e), e <= 0 ? s(t, e) : void 0 !== i ? "string" == typeof n ? s(t, e) .fill(i, n) : s(t, e) .fill(i) : s(t, e) }(null, t, e, i) }, l.allocUnsafe = function(t) { return c(null, t) }, l.allocUnsafeSlow = function(t) { return c(null, t) }, l.isBuffer = function(t) { return !(null == t || !t._isBuffer) }, l.compare = function(t, e) { if (!l.isBuffer(t) || !l.isBuffer(e)) throw new TypeError("Arguments must be Buffers"); if (t === e) return 0; for (var i = t.length, n = e.length, r = 0, o = Math.min(i, n); r < o; ++r) if (t[r] !== e[r]) { i = t[r], n = e[r]; break } return i < n ? -1 : n < i ? 1 : 0 }, l.isEncoding = function(t) { switch (String(t) .toLowerCase()) { case "hex": case "utf8": case "utf-8": case "ascii": case "latin1": case "binary": case "base64": case "ucs2": case "ucs-2": case "utf16le": case "utf-16le": return !0; default: return !1 } }, l.concat = function(t, e) { if (!o(t)) throw new TypeError('"list" argument must be an Array of Buffers'); if (0 === t.length) return l.alloc(0); var i; if (void 0 === e) for (e = 0, i = 0; i < t.length; ++i) e += t[i].length; var n = l.allocUnsafe(e), r = 0; for (i = 0; i < t.length; ++i) { var a = t[i]; if (!l.isBuffer(a)) throw new TypeError('"list" argument must be an Array of Buffers'); a.copy(n, r), r += a.length } return n }, l.byteLength = f, l.prototype._isBuffer = !0, l.prototype.swap16 = function() { var t = this.length; if (t % 2 != 0) throw new RangeError("Buffer size must be a multiple of 16-bits"); for (var e = 0; e < t; e += 2) g(this, e, e + 1); return this }, l.prototype.swap32 = function() { var t = this.length; if (t % 4 != 0) throw new RangeError("Buffer size must be a multiple of 32-bits"); for (var e = 0; e < t; e += 4) g(this, e, e + 3), g(this, e + 1, e + 2); return this }, l.prototype.swap64 = function() { var t = this.length; if (t % 8 != 0) throw new RangeError("Buffer size must be a multiple of 64-bits"); for (var e = 0; e < t; e += 8) g(this, e, e + 7), g(this, e + 1, e + 6), g(this, e + 2, e + 5), g(this, e + 3, e + 4); return this }, l.prototype.toString = function() { var t = 0 | this.length; return 0 === t ? "" : 0 === arguments.length ? A(this, 0, t) : m.apply(this, arguments) }, l.prototype.equals = function(t) { if (!l.isBuffer(t)) throw new TypeError("Argument must be a Buffer"); return this === t || 0 === l.compare(this, t) }, l.prototype.inspect = function() { var t = "", i = e.INSPECT_MAX_BYTES; return this.length > 0 && (t = this.toString("hex", 0, i) .match(/.{2}/g) .join(" "), this.length > i && (t += " ... ")), "" }, l.prototype.compare = function(t, e, i, n, r) { if (!l.isBuffer(t)) throw new TypeError("Argument must be a Buffer"); if (void 0 === e && (e = 0), void 0 === i && (i = t ? t.length : 0), void 0 === n && (n = 0), void 0 === r && (r = this.length), e < 0 || i > t.length || n < 0 || r > this.length) throw new RangeError("out of range index"); if (n >= r && e >= i) return 0; if (n >= r) return -1; if (e >= i) return 1; if (this === t) return 0; for (var o = (r >>>= 0) - (n >>>= 0), a = (i >>>= 0) - (e >>>= 0), s = Math.min(o, a), u = this.slice(n, r), h = t.slice(e, i), c = 0; c < s; ++c) if (u[c] !== h[c]) { o = u[c], a = h[c]; break } return o < a ? -1 : a < o ? 1 : 0 }, l.prototype.includes = function(t, e, i) { return -1 !== this.indexOf(t, e, i) }, l.prototype.indexOf = function(t, e, i) { return v(this, t, e, i, !0) }, l.prototype.lastIndexOf = function(t, e, i) { return v(this, t, e, i, !1) }, l.prototype.write = function(t, e, i, n) { if (void 0 === e) n = "utf8", i = this.length, e = 0; else if (void 0 === i && "string" == typeof e) n = e, i = this.length, e = 0; else { if (!isFinite(e)) throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported"); e |= 0, isFinite(i) ? (i |= 0, void 0 === n && (n = "utf8")) : (n = i, i = void 0) } var r = this.length - e; if ((void 0 === i || i > r) && (i = r), t.length > 0 && (i < 0 || e < 0) || e > this.length) throw new RangeError("Attempt to write outside buffer bounds"); n || (n = "utf8"); for (var o = !1;;) switch (n) { case "hex": return b(this, t, e, i); case "utf8": case "utf-8": return w(this, t, e, i); case "ascii": return x(this, t, e, i); case "latin1": case "binary": return M(this, t, e, i); case "base64": return T(this, t, e, i); case "ucs2": case "ucs-2": case "utf16le": case "utf-16le": return S(this, t, e, i); default: if (o) throw new TypeError("Unknown encoding: " + n); n = ("" + n) .toLowerCase(), o = !0 } }, l.prototype.toJSON = function() { return { type: "Buffer", data: Array.prototype.slice.call(this._arr || this, 0) } }; function P(t, e, i) { var n = ""; i = Math.min(t.length, i); for (var r = e; r < i; ++r) n += String.fromCharCode(127 & t[r]); return n } function C(t, e, i) { var n = ""; i = Math.min(t.length, i); for (var r = e; r < i; ++r) n += String.fromCharCode(t[r]); return n } function E(t, e, i) { var n = t.length; (!e || e < 0) && (e = 0), (!i || i < 0 || i > n) && (i = n); for (var r = "", o = e; o < i; ++o) r += z(t[o]); return r } function D(t, e, i) { for (var n = t.slice(e, i), r = "", o = 0; o < n.length; o += 2) r += String.fromCharCode(n[o] + 256 * n[o + 1]); return r } function L(t, e, i) { if (t % 1 != 0 || t < 0) throw new RangeError("offset is not uint"); if (t + e > i) throw new RangeError("Trying to access beyond buffer length") } function O(t, e, i, n, r, o) { if (!l.isBuffer(t)) throw new TypeError('"buffer" argument must be a Buffer instance'); if (e > r || e < o) throw new RangeError('"value" argument is out of bounds'); if (i + n > t.length) throw new RangeError("Index out of range") } function I(t, e, i, n) { e < 0 && (e = 65535 + e + 1); for (var r = 0, o = Math.min(t.length - i, 2); r < o; ++r) t[i + r] = (e & 255 << 8 * (n ? r : 1 - r)) >>> 8 * (n ? r : 1 - r) } function R(t, e, i, n) { e < 0 && (e = 4294967295 + e + 1); for (var r = 0, o = Math.min(t.length - i, 4); r < o; ++r) t[i + r] = e >>> 8 * (n ? r : 3 - r) & 255 } function N(t, e, i, n, r, o) { if (i + n > t.length) throw new RangeError("Index out of range"); if (i < 0) throw new RangeError("Index out of range") } function k(t, e, i, n, o) { return o || N(t, 0, i, 4), r.write(t, e, i, n, 23, 4), i + 4 } function F(t, e, i, n, o) { return o || N(t, 0, i, 8), r.write(t, e, i, n, 52, 8), i + 8 } l.prototype.slice = function(t, e) { var i, n = this.length; if ((t = ~~t) < 0 ? (t += n) < 0 && (t = 0) : t > n && (t = n), (e = void 0 === e ? n : ~~e) < 0 ? (e += n) < 0 && (e = 0) : e > n && (e = n), e < t && (e = t), l.TYPED_ARRAY_SUPPORT)(i = this.subarray(t, e)) .__proto__ = l.prototype; else { var r = e - t; i = new l(r, void 0); for (var o = 0; o < r; ++o) i[o] = this[o + t] } return i }, l.prototype.readUIntLE = function(t, e, i) { t |= 0, e |= 0, i || L(t, e, this.length); for (var n = this[t], r = 1, o = 0; ++o < e && (r *= 256);) n += this[t + o] * r; return n }, l.prototype.readUIntBE = function(t, e, i) { t |= 0, e |= 0, i || L(t, e, this.length); for (var n = this[t + --e], r = 1; e > 0 && (r *= 256);) n += this[t + --e] * r; return n }, l.prototype.readUInt8 = function(t, e) { return e || L(t, 1, this.length), this[t] }, l.prototype.readUInt16LE = function(t, e) { return e || L(t, 2, this.length), this[t] | this[t + 1] << 8 }, l.prototype.readUInt16BE = function(t, e) { return e || L(t, 2, this.length), this[t] << 8 | this[t + 1] }, l.prototype.readUInt32LE = function(t, e) { return e || L(t, 4, this.length), (this[t] | this[t + 1] << 8 | this[t + 2] << 16) + 16777216 * this[t + 3] }, l.prototype.readUInt32BE = function(t, e) { return e || L(t, 4, this.length), 16777216 * this[t] + (this[t + 1] << 16 | this[t + 2] << 8 | this[t + 3]) }, l.prototype.readIntLE = function(t, e, i) { t |= 0, e |= 0, i || L(t, e, this.length); for (var n = this[t], r = 1, o = 0; ++o < e && (r *= 256);) n += this[t + o] * r; return n >= (r *= 128) && (n -= Math.pow(2, 8 * e)), n }, l.prototype.readIntBE = function(t, e, i) { t |= 0, e |= 0, i || L(t, e, this.length); for (var n = e, r = 1, o = this[t + --n]; n > 0 && (r *= 256);) o += this[t + --n] * r; return o >= (r *= 128) && (o -= Math.pow(2, 8 * e)), o }, l.prototype.readInt8 = function(t, e) { return e || L(t, 1, this.length), 128 & this[t] ? -1 * (255 - this[t] + 1) : this[t] }, l.prototype.readInt16LE = function(t, e) { e || L(t, 2, this.length); var i = this[t] | this[t + 1] << 8; return 32768 & i ? 4294901760 | i : i }, l.prototype.readInt16BE = function(t, e) { e || L(t, 2, this.length); var i = this[t + 1] | this[t] << 8; return 32768 & i ? 4294901760 | i : i }, l.prototype.readInt32LE = function(t, e) { return e || L(t, 4, this.length), this[t] | this[t + 1] << 8 | this[t + 2] << 16 | this[t + 3] << 24 }, l.prototype.readInt32BE = function(t, e) { return e || L(t, 4, this.length), this[t] << 24 | this[t + 1] << 16 | this[t + 2] << 8 | this[t + 3] }, l.prototype.readFloatLE = function(t, e) { return e || L(t, 4, this.length), r.read(this, t, !0, 23, 4) }, l.prototype.readFloatBE = function(t, e) { return e || L(t, 4, this.length), r.read(this, t, !1, 23, 4) }, l.prototype.readDoubleLE = function(t, e) { return e || L(t, 8, this.length), r.read(this, t, !0, 52, 8) }, l.prototype.readDoubleBE = function(t, e) { return e || L(t, 8, this.length), r.read(this, t, !1, 52, 8) }, l.prototype.writeUIntLE = function(t, e, i, n) { (t = +t, e |= 0, i |= 0, n) || O(this, t, e, i, Math.pow(2, 8 * i) - 1, 0); var r = 1, o = 0; for (this[e] = 255 & t; ++o < i && (r *= 256);) this[e + o] = t / r & 255; return e + i }, l.prototype.writeUIntBE = function(t, e, i, n) { (t = +t, e |= 0, i |= 0, n) || O(this, t, e, i, Math.pow(2, 8 * i) - 1, 0); var r = i - 1, o = 1; for (this[e + r] = 255 & t; --r >= 0 && (o *= 256);) this[e + r] = t / o & 255; return e + i }, l.prototype.writeUInt8 = function(t, e, i) { return t = +t, e |= 0, i || O(this, t, e, 1, 255, 0), l.TYPED_ARRAY_SUPPORT || (t = Math.floor(t)), this[e] = 255 & t, e + 1 }, l.prototype.writeUInt16LE = function(t, e, i) { return t = +t, e |= 0, i || O(this, t, e, 2, 65535, 0), l.TYPED_ARRAY_SUPPORT ? (this[e] = 255 & t, this[e + 1] = t >>> 8) : I(this, t, e, !0), e + 2 }, l.prototype.writeUInt16BE = function(t, e, i) { return t = +t, e |= 0, i || O(this, t, e, 2, 65535, 0), l.TYPED_ARRAY_SUPPORT ? (this[e] = t >>> 8, this[e + 1] = 255 & t) : I(this, t, e, !1), e + 2 }, l.prototype.writeUInt32LE = function(t, e, i) { return t = +t, e |= 0, i || O(this, t, e, 4, 4294967295, 0), l.TYPED_ARRAY_SUPPORT ? (this[e + 3] = t >>> 24, this[e + 2] = t >>> 16, this[e + 1] = t >>> 8, this[e] = 255 & t) : R(this, t, e, !0), e + 4 }, l.prototype.writeUInt32BE = function(t, e, i) { return t = +t, e |= 0, i || O(this, t, e, 4, 4294967295, 0), l.TYPED_ARRAY_SUPPORT ? (this[e] = t >>> 24, this[e + 1] = t >>> 16, this[e + 2] = t >>> 8, this[e + 3] = 255 & t) : R(this, t, e, !1), e + 4 }, l.prototype.writeIntLE = function(t, e, i, n) { if (t = +t, e |= 0, !n) { var r = Math.pow(2, 8 * i - 1); O(this, t, e, i, r - 1, -r) } var o = 0, a = 1, s = 0; for (this[e] = 255 & t; ++o < i && (a *= 256);) t < 0 && 0 === s && 0 !== this[e + o - 1] && (s = 1), this[e + o] = (t / a >> 0) - s & 255; return e + i }, l.prototype.writeIntBE = function(t, e, i, n) { if (t = +t, e |= 0, !n) { var r = Math.pow(2, 8 * i - 1); O(this, t, e, i, r - 1, -r) } var o = i - 1, a = 1, s = 0; for (this[e + o] = 255 & t; --o >= 0 && (a *= 256);) t < 0 && 0 === s && 0 !== this[e + o + 1] && (s = 1), this[e + o] = (t / a >> 0) - s & 255; return e + i }, l.prototype.writeInt8 = function(t, e, i) { return t = +t, e |= 0, i || O(this, t, e, 1, 127, -128), l.TYPED_ARRAY_SUPPORT || (t = Math.floor(t)), t < 0 && (t = 255 + t + 1), this[e] = 255 & t, e + 1 }, l.prototype.writeInt16LE = function(t, e, i) { return t = +t, e |= 0, i || O(this, t, e, 2, 32767, -32768), l.TYPED_ARRAY_SUPPORT ? (this[e] = 255 & t, this[e + 1] = t >>> 8) : I(this, t, e, !0), e + 2 }, l.prototype.writeInt16BE = function(t, e, i) { return t = +t, e |= 0, i || O(this, t, e, 2, 32767, -32768), l.TYPED_ARRAY_SUPPORT ? (this[e] = t >>> 8, this[e + 1] = 255 & t) : I(this, t, e, !1), e + 2 }, l.prototype.writeInt32LE = function(t, e, i) { return t = +t, e |= 0, i || O(this, t, e, 4, 2147483647, -2147483648), l.TYPED_ARRAY_SUPPORT ? (this[e] = 255 & t, this[e + 1] = t >>> 8, this[e + 2] = t >>> 16, this[e + 3] = t >>> 24) : R(this, t, e, !0), e + 4 }, l.prototype.writeInt32BE = function(t, e, i) { return t = +t, e |= 0, i || O(this, t, e, 4, 2147483647, -2147483648), t < 0 && (t = 4294967295 + t + 1), l.TYPED_ARRAY_SUPPORT ? (this[e] = t >>> 24, this[e + 1] = t >>> 16, this[e + 2] = t >>> 8, this[e + 3] = 255 & t) : R(this, t, e, !1), e + 4 }, l.prototype.writeFloatLE = function(t, e, i) { return k(this, t, e, !0, i) }, l.prototype.writeFloatBE = function(t, e, i) { return k(this, t, e, !1, i) }, l.prototype.writeDoubleLE = function(t, e, i) { return F(this, t, e, !0, i) }, l.prototype.writeDoubleBE = function(t, e, i) { return F(this, t, e, !1, i) }, l.prototype.copy = function(t, e, i, n) { if (i || (i = 0), n || 0 === n || (n = this.length), e >= t.length && (e = t.length), e || (e = 0), n > 0 && n < i && (n = i), n === i) return 0; if (0 === t.length || 0 === this.length) return 0; if (e < 0) throw new RangeError("targetStart out of bounds"); if (i < 0 || i >= this.length) throw new RangeError("sourceStart out of bounds"); if (n < 0) throw new RangeError("sourceEnd out of bounds"); n > this.length && (n = this.length), t.length - e < n - i && (n = t.length - e + i); var r, o = n - i; if (this === t && i < e && e < n) for (r = o - 1; r >= 0; --r) t[r + e] = this[r + i]; else if (o < 1e3 || !l.TYPED_ARRAY_SUPPORT) for (r = 0; r < o; ++r) t[r + e] = this[r + i]; else Uint8Array.prototype.set.call(t, this.subarray(i, i + o), e); return o }, l.prototype.fill = function(t, e, i, n) { if ("string" == typeof t) { if ("string" == typeof e ? (n = e, e = 0, i = this.length) : "string" == typeof i && (n = i, i = this.length), 1 === t.length) { var r = t.charCodeAt(0); r < 256 && (t = r) } if (void 0 !== n && "string" != typeof n) throw new TypeError("encoding must be a string"); if ("string" == typeof n && !l.isEncoding(n)) throw new TypeError("Unknown encoding: " + n) } else "number" == typeof t && (t &= 255); if (e < 0 || this.length < e || this.length < i) throw new RangeError("Out of range index"); if (i <= e) return this; var o; if (e >>>= 0, i = void 0 === i ? this.length : i >>> 0, t || (t = 0), "number" == typeof t) for (o = e; o < i; ++o) this[o] = t; else { var a = l.isBuffer(t) ? t : U(new l(t, n) .toString()), s = a.length; for (o = 0; o < i - e; ++o) this[o + e] = a[o % s] } return this }; var B = /[^+\/0-9A-Za-z-_]/g; function z(t) { return t < 16 ? "0" + t.toString(16) : t.toString(16) } function U(t, e) { var i; e = e || 1 / 0; for (var n = t.length, r = null, o = [], a = 0; a < n; ++a) { if ((i = t.charCodeAt(a)) > 55295 && i < 57344) { if (!r) { if (i > 56319) { (e -= 3) > -1 && o.push(239, 191, 189); continue } if (a + 1 === n) { (e -= 3) > -1 && o.push(239, 191, 189); continue } r = i; continue } if (i < 56320) { (e -= 3) > -1 && o.push(239, 191, 189), r = i; continue } i = 65536 + (r - 55296 << 10 | i - 56320) } else r && (e -= 3) > -1 && o.push(239, 191, 189); if (r = null, i < 128) { if ((e -= 1) < 0) break; o.push(i) } else if (i < 2048) { if ((e -= 2) < 0) break; o.push(i >> 6 | 192, 63 & i | 128) } else if (i < 65536) { if ((e -= 3) < 0) break; o.push(i >> 12 | 224, i >> 6 & 63 | 128, 63 & i | 128) } else { if (!(i < 1114112)) throw new Error("Invalid code point"); if ((e -= 4) < 0) break; o.push(i >> 18 | 240, i >> 12 & 63 | 128, i >> 6 & 63 | 128, 63 & i | 128) } } return o } function V(t) { return n.toByteArray(function(t) { if ((t = function(t) { return t.trim ? t.trim() : t.replace(/^\s+|\s+$/g, "") }(t) .replace(B, "")) .length < 2) return ""; for (; t.length % 4 != 0;) t += "="; return t }(t)) } function j(t, e, i, n) { for (var r = 0; r < n && !(r + i >= e.length || r >= t.length); ++r) e[r + i] = t[r]; return r } }) .call(this, i(171)) }, function(t, e) { t.exports = { ContextCreated: "scene-renderer-context-created", AfterRender: "after-render", MemoryUsageUpdated: "scene-renderer-memory-usage-updated" } }, function(t, e, i) { "use strict"; i.r(e), function(t) { i.d(e, "Easing", (function() { return r })), i.d(e, "Group", (function() { return a })), i.d(e, "Interpolation", (function() { return s })), i.d(e, "Sequence", (function() { return l })), i.d(e, "Tween", (function() { return h })), i.d(e, "VERSION", (function() { return c })), i.d(e, "add", (function() { return g })), i.d(e, "getAll", (function() { return f })), i.d(e, "nextId", (function() { return d })), i.d(e, "now", (function() { return o })), i.d(e, "remove", (function() { return v })), i.d(e, "removeAll", (function() { return m })), i.d(e, "update", (function() { return y })); var n, r = { Linear: { None: function(t) { return t } }, Quadratic: { In: function(t) { return t * t }, Out: function(t) { return t * (2 - t) }, InOut: function(t) { return (t *= 2) < 1 ? .5 * t * t : -.5 * (--t * (t - 2) - 1) } }, Cubic: { In: function(t) { return t * t * t }, Out: function(t) { return --t * t * t + 1 }, InOut: function(t) { return (t *= 2) < 1 ? .5 * t * t * t : .5 * ((t -= 2) * t * t + 2) } }, Quartic: { In: function(t) { return t * t * t * t }, Out: function(t) { return 1 - --t * t * t * t }, InOut: function(t) { return (t *= 2) < 1 ? .5 * t * t * t * t : -.5 * ((t -= 2) * t * t * t - 2) } }, Quintic: { In: function(t) { return t * t * t * t * t }, Out: function(t) { return --t * t * t * t * t + 1 }, InOut: function(t) { return (t *= 2) < 1 ? .5 * t * t * t * t * t : .5 * ((t -= 2) * t * t * t * t + 2) } }, Sinusoidal: { In: function(t) { return 1 - Math.cos(t * Math.PI / 2) }, Out: function(t) { return Math.sin(t * Math.PI / 2) }, InOut: function(t) { return .5 * (1 - Math.cos(Math.PI * t)) } }, Exponential: { In: function(t) { return 0 === t ? 0 : Math.pow(1024, t - 1) }, Out: function(t) { return 1 === t ? 1 : 1 - Math.pow(2, -10 * t) }, InOut: function(t) { return 0 === t ? 0 : 1 === t ? 1 : (t *= 2) < 1 ? .5 * Math.pow(1024, t - 1) : .5 * (2 - Math.pow(2, -10 * (t - 1))) } }, Circular: { In: function(t) { return 1 - Math.sqrt(1 - t * t) }, Out: function(t) { return Math.sqrt(1 - --t * t) }, InOut: function(t) { return (t *= 2) < 1 ? -.5 * (Math.sqrt(1 - t * t) - 1) : .5 * (Math.sqrt(1 - (t -= 2) * t) + 1) } }, Elastic: { In: function(t) { return 0 === t ? 0 : 1 === t ? 1 : -Math.pow(2, 10 * (t - 1)) * Math.sin(5 * (t - 1.1) * Math.PI) }, Out: function(t) { return 0 === t ? 0 : 1 === t ? 1 : Math.pow(2, -10 * t) * Math.sin(5 * (t - .1) * Math.PI) + 1 }, InOut: function(t) { return 0 === t ? 0 : 1 === t ? 1 : (t *= 2) < 1 ? -.5 * Math.pow(2, 10 * (t - 1)) * Math.sin(5 * (t - 1.1) * Math.PI) : .5 * Math.pow(2, -10 * (t - 1)) * Math.sin(5 * (t - 1.1) * Math.PI) + 1 } }, Back: { In: function(t) { var e = 1.70158; return t * t * ((e + 1) * t - e) }, Out: function(t) { var e = 1.70158; return --t * t * ((e + 1) * t + e) + 1 }, InOut: function(t) { var e = 2.5949095; return (t *= 2) < 1 ? t * t * ((e + 1) * t - e) * .5 : .5 * ((t -= 2) * t * ((e + 1) * t + e) + 2) } }, Bounce: { In: function(t) { return 1 - r.Bounce.Out(1 - t) }, Out: function(t) { return t < 1 / 2.75 ? 7.5625 * t * t : t < 2 / 2.75 ? 7.5625 * (t -= 1.5 / 2.75) * t + .75 : t < 2.5 / 2.75 ? 7.5625 * (t -= 2.25 / 2.75) * t + .9375 : 7.5625 * (t -= 2.625 / 2.75) * t + .984375 }, InOut: function(t) { return t < .5 ? .5 * r.Bounce.In(2 * t) : .5 * r.Bounce.Out(2 * t - 1) + .5 } } }, o = "undefined" == typeof self && void 0 !== t && t.hrtime ? function() { var e = t.hrtime(); return 1e3 * e[0] + e[1] / 1e6 } : "undefined" != typeof self && void 0 !== self.performance && void 0 !== self.performance.now ? self.performance.now.bind(self.performance) : void 0 !== Date.now ? Date.now : function() { return (new Date) .getTime() }, a = function() { function t() { this._tweens = {}, this._tweensAddedDuringUpdate = {} } return t.prototype.getAll = function() { var t = this; return Object.keys(this._tweens) .map((function(e) { return t._tweens[e] })) }, t.prototype.removeAll = function() { this._tweens = {} }, t.prototype.add = function(t) { this._tweens[t.getId()] = t, this._tweensAddedDuringUpdate[t.getId()] = t }, t.prototype.remove = function(t) { delete this._tweens[t.getId()], delete this._tweensAddedDuringUpdate[t.getId()] }, t.prototype.update = function(t, e) { void 0 === t && (t = o()), void 0 === e && (e = !1); var i = Object.keys(this._tweens); if (0 === i.length) return !1; for (; i.length > 0;) { this._tweensAddedDuringUpdate = {}; for (var n = 0; n < i.length; n++) { var r = this._tweens[i[n]], a = !e; r && !1 === r.update(t, a) && !e && delete this._tweens[i[n]] } i = Object.keys(this._tweensAddedDuringUpdate) } return !0 }, t }(), s = { Linear: function(t, e) { var i = t.length - 1, n = i * e, r = Math.floor(n), o = s.Utils.Linear; return e < 0 ? o(t[0], t[1], n) : e > 1 ? o(t[i], t[i - 1], i - n) : o(t[r], t[r + 1 > i ? i : r + 1], n - r) }, Bezier: function(t, e) { for (var i = 0, n = t.length - 1, r = Math.pow, o = s.Utils.Bernstein, a = 0; a <= n; a++) i += r(1 - e, n - a) * r(e, a) * t[a] * o(n, a); return i }, CatmullRom: function(t, e) { var i = t.length - 1, n = i * e, r = Math.floor(n), o = s.Utils.CatmullRom; return t[0] === t[i] ? (e < 0 && (r = Math.floor(n = i * (1 + e))), o(t[(r - 1 + i) % i], t[r], t[(r + 1) % i], t[(r + 2) % i], n - r)) : e < 0 ? t[0] - (o(t[0], t[0], t[1], t[1], -n) - t[0]) : e > 1 ? t[i] - (o(t[i], t[i], t[i - 1], t[i - 1], n - i) - t[i]) : o(t[r ? r - 1 : 0], t[r], t[i < r + 1 ? i : r + 1], t[i < r + 2 ? i : r + 2], n - r) }, Utils: { Linear: function(t, e, i) { return (e - t) * i + t }, Bernstein: function(t, e) { var i = s.Utils.Factorial; return i(t) / i(e) / i(t - e) }, Factorial: (n = [1], function(t) { var e = 1; if (n[t]) return n[t]; for (var i = t; i > 1; i--) e *= i; return n[t] = e, e }), CatmullRom: function(t, e, i, n, r) { var o = .5 * (i - t), a = .5 * (n - e), s = r * r; return (2 * e - 2 * i + o + a) * (r * s) + (-3 * e + 3 * i - 2 * o - a) * s + o * r + e } } }, l = function() { function t() {} return t.nextId = function() { return t._nextId++ }, t._nextId = 0, t }(), u = new a, h = function() { function t(t, e) { void 0 === e && (e = u), this._object = t, this._group = e, this._isPaused = !1, this._pauseStart = 0, this._valuesStart = {}, this._valuesEnd = {}, this._valuesStartRepeat = {}, this._duration = 1e3, this._initialRepeat = 0, this._repeat = 0, this._yoyo = !1, this._isPlaying = !1, this._reversed = !1, this._delayTime = 0, this._startTime = 0, this._easingFunction = r.Linear.None, this._interpolationFunction = s.Linear, this._chainedTweens = [], this._onStartCallbackFired = !1, this._id = l.nextId(), this._isChainStopped = !1, this._goToEnd = !1 } return t.prototype.getId = function() { return this._id }, t.prototype.isPlaying = function() { return this._isPlaying }, t.prototype.isPaused = function() { return this._isPaused }, t.prototype.to = function(t, e) { return this._valuesEnd = Object.create(t), void 0 !== e && (this._duration = e), this }, t.prototype.duration = function(t) { return this._duration = t, this }, t.prototype.start = function(t) { if (this._isPlaying) return this; if (this._group && this._group.add(this), this._repeat = this._initialRepeat, this._reversed) for (var e in this._reversed = !1, this._valuesStartRepeat) this._swapEndStartRepeatValues(e), this._valuesStart[e] = this._valuesStartRepeat[e]; return this._isPlaying = !0, this._isPaused = !1, this._onStartCallbackFired = !1, this._isChainStopped = !1, this._startTime = void 0 !== t ? "string" == typeof t ? o() + parseFloat(t) : t : o(), this._startTime += this._delayTime, this._setupProperties(this._object, this._valuesStart, this._valuesEnd, this._valuesStartRepeat), this }, t.prototype._setupProperties = function(t, e, i, n) { for (var r in i) { var o = t[r], a = Array.isArray(o), s = a ? "array" : typeof o, l = !a && Array.isArray(i[r]); if ("undefined" !== s && "function" !== s) { if (l) { var u = i[r]; if (0 === u.length) continue; u = u.map(this._handleRelativeValue.bind(this, o)), i[r] = [o].concat(u) } if ("object" !== s && !a || !o || l) void 0 === e[r] && (e[r] = o), a || (e[r] *= 1), n[r] = l ? i[r].slice() .reverse() : e[r] || 0; else { for (var h in e[r] = a ? [] : {}, o) e[r][h] = o[h]; n[r] = a ? [] : {}, this._setupProperties(o, e[r], i[r], n[r]) } } } }, t.prototype.stop = function() { return this._isChainStopped || (this._isChainStopped = !0, this.stopChainedTweens()), this._isPlaying ? (this._group && this._group.remove(this), this._isPlaying = !1, this._isPaused = !1, this._onStopCallback && this._onStopCallback(this._object), this) : this }, t.prototype.end = function() { return this._goToEnd = !0, this.update(1 / 0), this }, t.prototype.pause = function(t) { return void 0 === t && (t = o()), this._isPaused || !this._isPlaying || (this._isPaused = !0, this._pauseStart = t, this._group && this._group.remove(this)), this }, t.prototype.resume = function(t) { return void 0 === t && (t = o()), this._isPaused && this._isPlaying ? (this._isPaused = !1, this._startTime += t - this._pauseStart, this._pauseStart = 0, this._group && this._group.add(this), this) : this }, t.prototype.stopChainedTweens = function() { for (var t = 0, e = this._chainedTweens.length; t < e; t++) this._chainedTweens[t].stop(); return this }, t.prototype.group = function(t) { return this._group = t, this }, t.prototype.delay = function(t) { return this._delayTime = t, this }, t.prototype.repeat = function(t) { return this._initialRepeat = t, this._repeat = t, this }, t.prototype.repeatDelay = function(t) { return this._repeatDelayTime = t, this }, t.prototype.yoyo = function(t) { return this._yoyo = t, this }, t.prototype.easing = function(t) { return this._easingFunction = t, this }, t.prototype.interpolation = function(t) { return this._interpolationFunction = t, this }, t.prototype.chain = function() { for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; return this._chainedTweens = t, this }, t.prototype.onStart = function(t) { return this._onStartCallback = t, this }, t.prototype.onUpdate = function(t) { return this._onUpdateCallback = t, this }, t.prototype.onRepeat = function(t) { return this._onRepeatCallback = t, this }, t.prototype.onComplete = function(t) { return this._onCompleteCallback = t, this }, t.prototype.onStop = function(t) { return this._onStopCallback = t, this }, t.prototype.update = function(t, e) { if (void 0 === t && (t = o()), void 0 === e && (e = !0), this._isPaused) return !0; var i, n, r = this._startTime + this._duration; if (!this._goToEnd && !this._isPlaying) { if (t > r) return !1; e && this.start(t) } if (this._goToEnd = !1, t < this._startTime) return !0; !1 === this._onStartCallbackFired && (this._onStartCallback && this._onStartCallback(this._object), this._onStartCallbackFired = !0), n = (t - this._startTime) / this._duration, n = 0 === this._duration || n > 1 ? 1 : n; var a = this._easingFunction(n); if (this._updateProperties(this._object, this._valuesStart, this._valuesEnd, a), this._onUpdateCallback && this._onUpdateCallback(this._object, n), 1 === n) { if (this._repeat > 0) { for (i in isFinite(this._repeat) && this._repeat--, this._valuesStartRepeat) this._yoyo || "string" != typeof this._valuesEnd[i] || (this._valuesStartRepeat[i] = this._valuesStartRepeat[i] + parseFloat(this._valuesEnd[i])), this._yoyo && this._swapEndStartRepeatValues(i), this._valuesStart[i] = this._valuesStartRepeat[i]; return this._yoyo && (this._reversed = !this._reversed), void 0 !== this._repeatDelayTime ? this._startTime = t + this._repeatDelayTime : this._startTime = t + this._delayTime, this._onRepeatCallback && this._onRepeatCallback(this._object), !0 } this._onCompleteCallback && this._onCompleteCallback(this._object); for (var s = 0, l = this._chainedTweens.length; s < l; s++) this._chainedTweens[s].start(this._startTime + this._duration); return this._isPlaying = !1, !1 } return !0 }, t.prototype._updateProperties = function(t, e, i, n) { for (var r in i) if (void 0 !== e[r]) { var o = e[r] || 0, a = i[r], s = Array.isArray(t[r]), l = Array.isArray(a); !s && l ? t[r] = this._interpolationFunction(a, n) : "object" == typeof a && a ? this._updateProperties(t[r], o, a, n) : "number" == typeof(a = this._handleRelativeValue(o, a)) && (t[r] = o + (a - o) * n) } }, t.prototype._handleRelativeValue = function(t, e) { return "string" != typeof e ? e : "+" === e.charAt(0) || "-" === e.charAt(0) ? t + parseFloat(e) : parseFloat(e) }, t.prototype._swapEndStartRepeatValues = function(t) { var e = this._valuesStartRepeat[t], i = this._valuesEnd[t]; this._valuesStartRepeat[t] = "string" == typeof i ? this._valuesStartRepeat[t] + parseFloat(i) : this._valuesEnd[t], this._valuesEnd[t] = e }, t }(), c = "18.6.4", d = l.nextId, p = u, f = p.getAll.bind(p), m = p.removeAll.bind(p), g = p.add.bind(p), v = p.remove.bind(p), y = p.update.bind(p), b = { Easing: r, Group: a, Interpolation: s, now: o, Sequence: l, nextId: d, Tween: h, VERSION: c, getAll: f, removeAll: m, add: g, remove: v, update: y }; e.default = b }.call(this, i(50)) }, function(t, e) { var i, n, r = t.exports = {}; function o() { throw new Error("setTimeout has not been defined") } function a() { throw new Error("clearTimeout has not been defined") } function s(t) { if (i === setTimeout) return setTimeout(t, 0); if ((i === o || !i) && setTimeout) return i = setTimeout, setTimeout(t, 0); try { return i(t, 0) } catch (e) { try { return i.call(null, t, 0) } catch (e) { return i.call(this, t, 0) } } }! function() { try { i = "function" == typeof setTimeout ? setTimeout : o } catch (t) { i = o } try { n = "function" == typeof clearTimeout ? clearTimeout : a } catch (t) { n = a } }(); var l, u = [], h = !1, c = -1; function d() { h && l && (h = !1, l.length ? u = l.concat(u) : c = -1, u.length && p()) } function p() { if (!h) { var t = s(d); h = !0; for (var e = u.length; e;) { for (l = u, u = []; ++c < e;) l && l[c].run(); c = -1, e = u.length } l = null, h = !1, function(t) { if (n === clearTimeout) return clearTimeout(t); if ((n === a || !n) && clearTimeout) return n = clearTimeout, clearTimeout(t); try { n(t) } catch (e) { try { return n.call(null, t) } catch (e) { return n.call(this, t) } } }(t) } } function f(t, e) { this.fun = t, this.array = e } function m() {} r.nextTick = function(t) { var e = new Array(arguments.length - 1); if (arguments.length > 1) for (var i = 1; i < arguments.length; i++) e[i - 1] = arguments[i]; u.push(new f(t, e)), 1 !== u.length || h || s(p) }, f.prototype.run = function() { this.fun.apply(null, this.array) }, r.title = "browser", r.browser = !0, r.env = {}, r.argv = [], r.version = "", r.versions = {}, r.on = m, r.addListener = m, r.once = m, r.off = m, r.removeListener = m, r.removeAllListeners = m, r.emit = m, r.prependListener = m, r.prependOnceListener = m, r.listeners = function(t) { return [] }, r.binding = function(t) { throw new Error("process.binding is not supported") }, r.cwd = function() { return "/" }, r.chdir = function(t) { throw new Error("process.chdir is not supported") }, r.umask = function() { return 0 } }, function(t, e, i) { var n, r = i(0), o = i(1), a = i(8), s = i(16), l = i(10), u = i(12), h = i(17), c = i(22); i(3); function d(t) { var e = r.UniformsUtils.clone(u.waypoint.uniforms); e.map.value = n, e.opacity.value = 0, e.color.value.set(o.reticuleColor); var i = new r.PlaneBufferGeometry(.2, .2, 1, 1), a = new r.RawShaderMaterial({ side: r.DoubleSide, depthWrite: !1, depthTest: !1, transparent: !0, vertexShader: u.waypoint.vertexShader, fragmentShader: u.waypoint.fragmentShader, uniforms: e, name: "waypoint", opacity: 0 }); r.Mesh.call(this, i, a), this.renderOrder = h.reticule, this.player = t, this.direction = new r.Vector3, this.hidden = !0, this.mouseLastMoveTime = Date.now(), this.editHidden = !1 } n = G.conf.isCleanUI ? s.loadurl(c.splitUrl("./images/nonepointer.png")) : s.loadurl(c.splitUrl("./images/pointermain_512x512.png")), d.prototype = Object.create(r.Mesh.prototype), d.prototype.move = function(t, e, i) { this.editHidden ? this.hidden = !0 : (this.hidden = i, this.mouseLastMoveTime = Date.now()) }, d.prototype.hide = function() { this.hidden || (this.hidden = !0, a.start(l.property(this.material.uniforms.opacity, "value", 0), o.reticuleOpacityTransitionTime)) }, d.prototype.show = function() { this.hidden = !1, this.material.opacity <= 0 && a.start(l.property(this.material.uniforms.opacity, "value", o[this.player.mode].reticuleOpacity), o.reticuleOpacityTransitionTime) }, d.prototype.changeNormalMaterial = function() {}, d.prototype.changeCrossMaterial = function() {}, d.prototype.update = function() { this.editHidden }, d.prototype.updatePosition = function(t, e) { if (!this.hidden) { if (!e) return this.hide(); var i = e.point, n = t.distanceTo(i), r = 1 + .01 * n; n < 1 && (r -= 1 - n), this.show(), this.scale.set(r, r, r), this.direction = this.direction.multiplyScalar(.8), this.direction.add(e.face.normal.clone() .multiplyScalar(.2)), this.position.copy(i) .add(e.face.normal.clone() .multiplyScalar(.01)), this.lookAt(this.position.clone() .add(this.direction)) } }, d.prototype.writeAsMattertag = function() { var t = Math.floor(4294967296 * (1 + Math.random())) .toString(16) + Math.floor(16 * (1 + Math.random())) .toString(16), e = new Date; this.tagCount = void 0 === this.tagCount ? 1 : this.tagCount + 1; var i = { enabled: !0, version: "0", created: e.toISOString(), created_by: "APITest", position: this.position.clone(), stem: { enabled: o.mattertags.pole.enabled, direction: this.direction.multiplyScalar(o.mattertags.pole.height) }, label: "Mattertag " + this.tagCount, description: "Description " + t, floor: function(t) { if (t.currentFloor) { var e = t.floors.indexOf(t.currentFloor); return e > -1 ? e : void 0 } }(this.player.model), type: "info", metadata: { preferred_camera: { mode: this.player.mode } } }, n = this.player.model.addMattertag(t, i) .build(); n && (n.disc && this.player.mattertagDiscs.push(n.disc), n.visible || n.show(o.mattertags.startup.fadeInDuration)) }, t.exports = d }, function(t, e, i) { "use strict"; var n = i(0), r = i(1), o = i(53); function a(t) { o.call(this, t), this.minPolarAngle = r.dollhouseDefault.minPolarAngle, this.maxPolarAngle = r.dollhouseDefault.maxPolarAngle, this.minDistance = r.dollhouseDefault.minDistance, this.maxDistance = r.dollhouseDefault.maxDistance, this.adjustedMinDistance = this.minDistance, this.adjustedMaxDistance = this.maxDistance } a.prototype = Object.create(o.prototype), a.prototype.pan = function(t, e) { this.camera.updateMatrix(); var i = this.camera.position.clone() .sub(this.target) .length(); i *= Math.tan(this.camera.fov / 2 * Math.PI / 180), this.panLeft(2 * t * i / (window.renderHeight || window.innerHeight)), this.panUp(-2 * e * i / (window.renderHeight || window.innerHeight)) }, a.prototype.updateZoom = function() { return this.cameraLength *= this.scale, this.cameraLength }, a.prototype.setZoomBounds = function(t) { var e = t.min.distanceTo(t.max); this.adjustedMinDistance = Math.max(Math.min(e / 2, r.dollhouseDefault.minDistance), 0), this.adjustedMaxDistance = Math.min(Math.max(e, r.dollhouseDefault.maxDistance), r.skyboxRadius), this.minDistance = this.adjustedMinDistance, this.maxDistance = this.adjustedMaxDistance }, a.prototype.resetRanges = function(t, e) { t ? (this.minDistance = Math.min(t, this.minDistance), this.maxDistance = Math.max(t, this.maxDistance)) : (this.minDistance = this.adjustedMinDistance, this.maxDistance = this.adjustedMaxDistance), e ? (this.minPolarAngle = n.Math.degToRad(10), this.maxPolarAngle = n.Math.degToRad(65)) : (this.minPolarAngle = r.dollhouseDefault.minPolarAngle, this.maxPolarAngle = r.dollhouseDefault.maxPolarAngle) }, a.prototype.toJSON = function() { return o.prototype.toJSON.call(this) }, t.exports = a }, function(t, e, i) { "use strict"; var n = i(0), r = i(1), o = i(7), a = i(9), s = i(32), l = i(27), u = i(4) .EventEmitter, h = i(28), c = 1e-6, d = -1, p = 0, f = 1, m = 2, g = 3, v = 4; function y(t) { this.camera = t, this.camera.controls = this, this.enabled = !1, this.target = new n.Vector3, this.targetBounds = new n.Box3, this.noZoom = !1, this.zoomSpeed = 1, this.minDistance = 0, this.maxDistance = 1 / 0, this.noRotate = !1, this.noRotateUpDown = !1, this.rotateSpeed = 1, this.keyboardZoomSpeed = 0, this.noPan = !0, this.keyPanSpeed = 7, this.autoRotate = !1, this.autoRotateSpeed = 2, this.minPolarAngle = n.Math.degToRad(25), this.maxPolarAngle = n.Math.degToRad(65), this.noKeys = !1, this.rotationAcceleration = new n.Vector2, this.rotationSpeed = new n.Vector2, this.panAcceleration = new n.Vector2, this.panSpeed = new n.Vector2, this.rotateStart = new n.Vector2, this.rotateEnd = new n.Vector2, this.rotateDelta = new n.Vector2, this.panStart = new n.Vector2, this.panEnd = new n.Vector2, this.panDelta = new n.Vector2, this.panOffset = new n.Vector3, this.offset = new n.Vector3, this.dollyStart = new n.Vector2, this.dollyEnd = new n.Vector2, this.dollyDelta = new n.Vector2, this.phiDelta = 0, this.thetaDelta = 0, this.scale = 1, this.panVector = new n.Vector3, this.lastPosition = new n.Vector3, this.state = d, this.lastMoveTime = 0, this.pointersLimit = 2, this.pointers = [], this.lon = 0, this.lat = 0, this.on("touch-one-finger-start", y.touch.rotate.start), this.on("touch-one-finger-move", y.touch.rotate.move), this.on("touch-two-finger-start", y.touch.pan.start), this.on("touch-two-finger-start", y.touch.zoom.start), this.on("touch-two-finger-move", y.touch.zoom.move), this.sendData = !1, this.responseMessage = this.responseMessage.bind(this), this.connect = h(), this.connect.on("operation", this.responseMessage), this._lockedMouseWheel = !1, this.defineProperty() } y.prototype = Object.create(u.prototype), y.prototype.defineProperty = function() { var t = !0, e = this; Object.defineProperty(this, "touchup", { get: function() { return t }, set: function(i) { t = i, e.connect.busy = !i } }), Object.defineProperty(this, "lockedMouseWheel", { get: function() { return this._lockedMouseWheel }, set: function(t) { this._lockedMouseWheel = t } }) }, y.prototype.setBounds = function(t) { this.targetBounds = t }, y.prototype.bindEvents = function(t) { (t = t || document) .addEventListener("contextmenu", (function(t) { t.preventDefault() })), t.addEventListener("mousedown", this.onMouseDown.bind(this)), t.addEventListener("mousemove", this.onMouseMove.bind(this)), t.addEventListener("mouseup", this.onMouseUp.bind(this)), t.addEventListener("mouseover", function(t) { 0 !== t.which && 0 !== t.buttons || this.onMouseUp(t) }.bind(this)), r.useWheel && (t.addEventListener("mousewheel", this.onMouseWheel.bind(this)), t.addEventListener("DOMMouseScroll", this.onMouseWheel.bind(this))), t.addEventListener("touchstart", this.onTouchStart.bind(this)), t.addEventListener("touchend", this.onTouchEnd.bind(this)), t.addEventListener("touchmove", this.onTouchMove.bind(this)), t.addEventListener("pointerdown", this.onPointerDown.bind(this)), t.addEventListener("pointerup", this.onPointerUp.bind(this)), t.addEventListener("pointerout", this.onPointerUp.bind(this)), t.addEventListener("pointercancel", this.onPointerUp.bind(this)), t.addEventListener("pointermove", this.onPointerMove.bind(this)), t.addEventListener("keydown", this.onKeyDown.bind(this)), t.addEventListener("keyup", this.onKeyUp.bind(this)) }, y.prototype.isEngaged = function() { return this.state !== d }; var b, w, x, M, T, S, _ = null, A = null, P = null; y.prototype.rotateLeft = function(t) { void 0 === t && (t = this.getAutoRotationAngle()), this.thetaDelta -= t, 0 === this.thetaDelta && 0 === t && null === _ && this.touchup ? (_ = !0, this.emit("dollhouse-move-stop")) : 0 < this.thetaDelta ? (_ = null, .001 < this.thetaDelta ? (A = !1, this.emit("dollhouse-move")) : !1 === A && (A = !0, this.emit("dollhouse-move-stop"))) : 0 > this.thetaDelta && (_ = null, -.001 > this.thetaDelta ? (P = !1, this.emit("dollhouse-move")) : !1 === P && (P = !0, this.emit("dollhouse-move-stop"))) }, y.prototype.rotateUp = function(t) { this.noRotateUpDown || (void 0 === t && (t = this.getAutoRotationAngle()), this.phiDelta -= t) }, y.prototype.panLeft = function(t) { var e = this.camera.matrix.elements; 0 == e[0] && 0 == e[2] ? this.panOffset.set(e[0], 0, e[2]) : this.panOffset.set(e[0], 0, e[2]) .normalize(), this.panOffset.multiplyScalar(-t), this.panVector.add(this.panOffset) }, y.prototype.panUp = function(t) { var e = this.camera.matrix.elements; 0 == e[4] && 0 == e[6] ? this.panOffset.set(e[4], 0, e[6]) : this.panOffset.set(e[4], 0, e[6]) .normalize(), this.panOffset.multiplyScalar(-t), this.panVector.add(this.panOffset) }, y.prototype.dollyIn = function(t) { void 0 === t && (t = this.getZoomScale()), G.R.recording && G.R.save({ tap: "zoom", type: "dollhouse", level: 1 / t }), this.scale /= t, this.emit("dollhouse-move-stop") }, y.prototype.dollyOut = function(t) { void 0 === t && (t = this.getZoomScale()), G.R.recording && G.R.save({ tap: "zoom", type: "dollhouse", level: t }), this.scale *= t, this.emit("dollhouse-move-stop") }, y.prototype.lookAt = function(t, e, i) { this.camera.position.copy(t), this.camera.quaternion.copy(i), this.target.copy(e), this.offset.copy(t) .sub(e), this.lon = Math.atan2(this.offset.x, this.offset.z), this.lat = Math.atan2(Math.sqrt(this.offset.x * this.offset.x + this.offset.z * this.offset.z), this.offset.y), this.cameraLength = this.offset.length() }, y.prototype.update = function(t) { var e, i, n, o; if (!G.measurestarted) { if (e = this.camera.position, this.updateFromRecord) return this.updateFromRecord = !1, void this.updateCamera(this.lon, this.lat); this.updateFromRecord = !1, t || (t = 1 / 60), this.rotationSpeed.multiplyScalar(1 - r.rotationFriction) .addScaledVector(this.rotationAcceleration, r.rotationAccelerationOutside * t), this.rotateLeft(-this.rotationSpeed.x), this.noRotateUpDown || this.rotateUp(this.rotationSpeed.y), this.panSpeed.multiplyScalar(1 - r.panFriction) .addScaledVector(this.panAcceleration, r.panAccelerationOutside * t), this.pan(-this.panSpeed.x, this.panSpeed.y), this.offset.copy(e) .sub(this.target), i = Math.atan2(this.offset.x, this.offset.z), n = Math.atan2(Math.sqrt(this.offset.x * this.offset.x + this.offset.z * this.offset.z), this.offset.y), this.autoRotate && this.rotateLeft(this.getAutoRotationAngle()), o = this.offset.length(), i += this.thetaDelta, n += this.phiDelta, i < 0 && (i += 2 * Math.PI), (this.connect.remoteControl || this.connect.sync) && "floorplan" !== this.type || (this.lon = i, this.lat = n, this.cameraLength = o), G.R.recording && this.record(i), this.updateCamera(this.lon, this.lat), this.connect.remoteControl || this.connect.sync || this.sendFrameData(t), this.thetaDelta = 0, this.phiDelta = 0, this.scale = 1, this.panVector.set(0, 0, 0), this.lastPosition.distanceTo(this.camera.position) > 0 && this.lastPosition.copy(this.camera.position) } }, y.prototype.updateCamera = (w = new n.Vector3, function(t, e) { "floorplan" === this.type && (t = 0, e = 0), b = this.updateZoom(), b = Math.max(this.minDistance, Math.min(this.maxDistance, b)), isNaN(t) || isNaN(e) || (e = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, e)), e = Math.max(c, Math.min(Math.PI - c, e)), w.x = b * Math.sin(e) * Math.sin(t), w.y = b * Math.cos(e), w.z = b * Math.sin(e) * Math.cos(t)), this.camera.position.copy(this.target) .add(w), this.camera.lookAt(this.target) }), y.prototype.sendFrameData = (S = 0, function(t) { "dollhouse" === G.player.mode && ((S += t) < r.connectDelay || Math.abs(x - this.lon) < .001 && Math.abs(M - this.lat) < .001 && Math.abs(T - this.cameraLength) < .001 || (S = 0, this.connect.sendOperation({ type: "outside", lon: this.lon, lat: this.lat, cameraLength: this.cameraLength }), x = this.lon, M = this.lat, T = this.cameraLength)) }), y.prototype._progressNumber = function(t, e, i) { return t + (e - t) * i }, y.prototype._progressRad = function(t, e, i) { var n = 2 * Math.PI, r = Math.PI, o = function(t) { return (t % n + n) % n }; return t = o(t), (e = o(e)) - t > r ? this._progressNumber(t + n, e, i) : t - e > r ? this._progressNumber(t - n, e, i) : this._progressNumber(t, e, i) }, y.prototype.responseMessage = function(t) { var e = this; if ("outside" === t.type) { var i = t.lon, n = t.lat, o = t.cameraLength; this.tweenProgress && (this.tweenProgress.stop(), this.tweenProgress = null); var a = this.lon, s = this.lat, l = this.cameraLength; this.tweenProgress = new TWEEN.Tween({ progress: 0 }) .to({ progress: 1 }, r.animationDelay) .easing(TWEEN.Easing.Linear.None) .start(), this.tweenProgress.onUpdate((function(t) { null === i && 0 === i || (e.lon = e._progressRad(a, i, this.progress)), null === n && 0 === i || (e.lat = e._progressNumber(s, n, this.progress)), e.cameraLength = e._progressNumber(l, o, this.progress) })), this.tweenProgress.onComplete((function() { this.tweenProgress = null })) } }, y.prototype.getAutoRotationAngle = function(t, e) { return { lon: t, lat: e } }, y.prototype.getAutoRotationAngle = function() { return 2 * Math.PI / 60 / 60 * this.autoRotateSpeed }, y.prototype.getZoomScale = function() { return Math.pow(.95, this.zoomSpeed) }, y.prototype.onMouseDown = function(t) { if (this.enabled) { switch (this.touchup = !1, t.preventDefault(), this.mouseDown = !0, t.button) { case 0: if (this.noRotate) return; this.state = p, this.rotateStart.set(t.clientX, this.noRotateUpDown ? 0 : t.clientY), this.rotationSpeed.set(0, 0); break; case 1: if (this.noZoom) return; this.state = f, this.dollyStart.set(t.clientX, t.clientY); break; case 2: if (this.noPan) return; this.state = m, this.panStart.set(t.clientX, t.clientY) } this.emit(l.InputStart, "mouse") } }, y.prototype.play = function(t) { this.touchup && (this.lon = t.lon, this.lat = t.lat, this.updateFromRecord = !0) }, y.prototype.record = function(t) { G.player.flying || G.R.rtime && !(G.R.time.getElapsedTime() - G.R.rtime > .15) || ("dollhouse" === G.player.mode ? (void 0 !== G.R.lastlon && Math.abs(this.lon - G.R.lastlon) > 3 && (this.lon < G.R.lastlon ? G.R.lon += 2 * Math.PI : G.R.lon -= 2 * Math.PI), G.R.rtime = G.R.save({ tap: "dollhouse", lon: parseFloat((this.lon + G.R.lon) .toFixed(5)), lat: parseFloat(this.lat.toFixed(5)), action: "rotate" }), G.R.lastlon = this.lon) : "floorplan" === G.player.mode && (G.R.rtime = G.R.save({ tap: "floorplan", lon: parseFloat(this.lon.toFixed(5)), lat: parseFloat(this.lat.toFixed(5)), action: "rotate" }))) }, y.prototype.onMouseMove = function(t) { if (this.enabled && this.mouseDown && 0 !== t.buttons) { if (t.preventDefault(), r.delBK && "floorplan" === G.player.mode) return !1; var e = t.currentTarget; switch (this.state) { case p: if (this.noRotate) return; this.rotateEnd.set(t.clientX, this.noRotateUpDown ? 0 : t.clientY), this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart), this.rotateLeft(2 * Math.PI * this.rotateDelta.x / e.clientWidth * this.rotateSpeed), this.rotateUp(2 * Math.PI * this.rotateDelta.y / e.clientHeight * this.rotateSpeed), this.rotateStart.copy(this.rotateEnd); break; case f: if (this.noZoom) return; this.dollyEnd.set(t.clientX, t.clientY), this.dollyDelta.subVectors(this.dollyEnd, this.dollyStart), (this.dollyDelta.y > 0 ? this.dollyIn : this.dollyOut) .call(this), this.dollyStart.copy(this.dollyEnd); break; case m: if (this.noPan) return; this.panEnd.set(t.clientX, t.clientY), this.panDelta.subVectors(this.panEnd, this.panStart), this.pan(this.panDelta.x, this.panDelta.y), this.panStart.copy(this.panEnd) } this.emit(l.Move, "mouse"), this.lastMoveTime = t.timeStamp, this.update() } }, y.prototype.onMouseUp = function(t) { if (!this.enabled) return !1; this.mouseDown = !1, this.touchup = !0, this.state = d, "mouseover" !== t.type && (t.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0), this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y), this.update(), this.rotationAcceleration.set(0, 0), this.rotateDelta.set(0, 0)) }, y.prototype.onMouseWheel = function(t) { this._lockedMouseWheel || this.enabled && !this.noZoom && r.useWheel && !G.R.playing && (r.delBK && "floorplan" === G.player.mode || (this.emit(l.Move, "wheel"), ((t.wheelDelta || -t.detail) > 0 ? this.dollyOut : this.dollyIn) .call(this), this.update())) }, y.prototype.onKeyDown = function(t) { "floorplan" !== G.player.mode && (!this.enabled || this.noKeys || t.metaKey || t.ctrlKey || (t.preventDefault(), this.handleKeyDown(t.which))) }, y.prototype.handleKeyDown = function(t) { var e = function(t, e) { "y" === t ? this.noRotateUpDown ? this.keyboardZoomSpeed = e : this.rotationAcceleration.y = e : this.rotationAcceleration.x = e }.bind(this), i = function(t, e) { this.panAcceleration[t] = e }.bind(this), n = !0; switch (t) { case s.UPARROW: case s.I: e("y", 1); break; case s.DOWNARROW: case s.K: e("y", -1); break; case s.LEFTARROW: case s.J: e("x", -1); break; case s.RIGHTARROW: case s.L: e("x", 1); break; case s.W: i("y", 1); break; case s.S: i("y", -1); break; case s.A: i("x", -1); break; case s.D: i("x", 1); break; default: n = !1 } n && this.emit(l.Move, "key") }, y.prototype.onKeyUp = function(t) { !this.enabled || this.noKeys || (t.preventDefault(), t.stopPropagation(), this.handleKeyUp(t.which)) }, y.prototype.handleKeyUp = function(t) { switch (t) { case s.I: case s.K: case s.UPARROW: case s.DOWNARROW: this.keyboardZoomSpeed = 0, this.rotationAcceleration.y = 0; break; case s.J: case s.L: case s.LEFTARROW: case s.RIGHTARROW: this.rotationAcceleration.x = 0; break; case s.S: case s.W: this.panAcceleration.y = 0; break; case s.A: case s.D: this.panAcceleration.x = 0 } }, y.prototype.onTouchStart = function(t) { if (this.enabled) { switch (this.touchup = !1, t.preventDefault(), t.stopPropagation(), t.touches.length) { case 1: this.emit("touch-one-finger-start", t); break; case 2: this.emit("touch-two-finger-start", t); break; default: this.state = d } this.rotationSpeed.set(0, 0), this.emit(l.InputStart, "touch") } }, y.prototype.onTouchMove = function(t) { if (this.enabled) { if (r.delBK && "floorplan" === G.player.mode) return !1; switch (t.preventDefault(), t.stopPropagation(), t.touches.length) { case 1: this.emit("touch-one-finger-move", t), this.update(); break; case 2: this.emit("touch-two-finger-move", t), this.update(); break; default: this.state = d } this.lastMoveTime = t.timeStamp } }, y.prototype.onTouchEnd = function(t) { this.enabled && (this.emit("touch-one-finger-end", t), this.touchup = !0, this.emit("touch-two-finger-end", t), this.state = d, t.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0), this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y), this.update(), this.rotationAcceleration.set(0, 0), this.rotateDelta.set(0, 0)) }, y.prototype._progressNumber = function(t, e, i) { return t + (e - t) * i }, y.prototype._progressRad = function(t, e, i) { var n = 2 * Math.PI, r = Math.PI, o = function(t) { return (t % n + n) % n }; return t = o(t), (e = o(e)) - t > r ? this._progressNumber(t + n, e, i) : t - e > r ? this._progressNumber(t - n, e, i) : this._progressNumber(t, e, i) }, y.prototype.translateWithAnimation = function(t, e, i) { var n = this; this.tweenProgress && (this.tweenProgress.stop(), this.tweenProgress = null); var r = this.lon, o = this.lat; this.tweenProgress = new TWEEN.Tween({ progress: 0 }) .to({ progress: 1 }, i) .easing(TWEEN.Easing.Linear.None) .start(), this.tweenProgress.onUpdate((function() { null !== t && 0 !== t && (n.lon = n._progressRad(r, t, this.progress)), null !== e && 0 !== e && (n.lat = n._progressNumber(o, e, this.progress)) })), this.tweenProgress.onComplete((function() { this.tweenProgress = null })) }, y.prototype.onPointerDown = function(t) { this.enabled && ("touch" === t.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({ id: t.pointerId, pageX: t.pageX, pageY: t.pageY }), t.touches = this.pointers, this.onTouchStart(t)), this.emit(l.InputStart, "pointer")) }, y.prototype.onPointerMove = function(t) { this.enabled && "touch" === t.pointerType && (this.pointers.forEach((function(e) { t.pointerId === e.id && (e.pageX = t.pageX, e.pageY = t.pageY) })), t.touches = this.pointers, this.onTouchMove(t)) }, y.prototype.onPointerUp = function(t) { this.enabled && "touch" === t.pointerType && (this.pointers.forEach(function(e, i) { t.pointerId === e.id && this.pointers.splice(i, 1) }.bind(this)), t.touches = this.pointers, this.onTouchEnd(t)) }, y.prototype.reset = function() { this.state = d, this.rotationSpeed.set(0, 0), this.rotationAcceleration.set(0, 0), this.panSpeed.set(0, 0), this.panAcceleration.set(0, 0) }, y.prototype.toJSON = function() { return { _viewpoint: { x: a.toPrecision(this.camera.position.x, 4), y: a.toPrecision(this.camera.position.y, 4), z: a.toPrecision(this.camera.position.z, 4) }, _rotation: { x: a.toPrecision(this.camera.quaternion.x, 4), y: a.toPrecision(this.camera.quaternion.y, 4), z: a.toPrecision(this.camera.quaternion.z, 4), w: a.toPrecision(this.camera.quaternion.w, 4) } } }, y.touch = { rotate: { start: function(t) { this.state = g, this.rotateStart.set(t.touches[0].pageX, t.touches[0].pageY) }, move: function(t) { if (this.state === g) { this.emit(l.Move, "touch"); var e = t.currentTarget; this.rotateEnd.set(t.touches[0].pageX, t.touches[0].pageY), this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart), this.rotateLeft(2 * Math.PI * this.rotateDelta.x / e.clientWidth * this.rotateSpeed), this.rotateUp(2 * Math.PI * this.rotateDelta.y / e.clientHeight * this.rotateSpeed), this.rotateStart.copy(this.rotateEnd) } } }, zoom: { start: function(t) { this.state = v; var e = t.touches[0].pageX - t.touches[1].pageX, i = t.touches[0].pageY - t.touches[1].pageY, n = Math.sqrt(e * e + i * i); this.dollyStart.set(0, n) }, move: function(t) { if (this.state === v) { this.emit(l.Move, "touch"); var e = t.touches[0].pageX - t.touches[1].pageX, i = t.touches[0].pageY - t.touches[1].pageY, n = Math.sqrt(e * e + i * i); this.dollyEnd.set(0, n), this.dollyDelta.subVectors(this.dollyEnd, this.dollyStart), this.dollyDelta.y > 0 ? this.dollyOut(1 - this.dollyDelta.y / 500) : this.dollyIn(1 + this.dollyDelta.y / 500), this.dollyStart.copy(this.dollyEnd) } } }, pan: { start: function(t) { this.state = v, this.panStart.set(o.average(t.touches, "pageX"), o.average(t.touches, "pageY")) }, move: function(t) { this.state === v && (this.emit(l.Move, "touch"), this.panEnd.set(o.average(t.touches, "pageX"), o.average(t.touches, "pageY")), this.panDelta.subVectors(this.panEnd, this.panStart), this.pan(this.panDelta.x, this.panDelta.y), this.panStart.copy(this.panEnd), this.rotateDelta.set(0, 0)) } } }, t.exports = y }, function(t, e, i) { var n = i(0), r = i(1), o = i(53), a = i(9), s = i(3); function l(t) { o.call(this, t), this.minDistance = 20, this.maxDistance = 50, this.noRotateUpDown = !0, this.minPolarAngle = 0, this.maxPolarAngle = 0, this.absoluteScale = 1, this.currentScale = 1 } l.prototype = Object.create(o.prototype), l.prototype.zoomToContain = function(t) { if (r.delBK) { var e = Math.max(t.x, t.z, t.x * this.camera.aspect, t.z * this.camera.aspect); this.absoluteScale = e / 2 / r.orthoBase * 1.4, this.currentScale = this.absoluteScale } else { var i = Math.max(t.x, t.z), n = Math.min(t.x, t.z), o = Math.max(i, n * this.camera.aspect), a = Math.max(n, i * this.camera.aspect); this.absoluteScale = (s.aspectRatio() < 1 ? a : o) / 2 / r.orthoBase * 1.2, this.currentScale = this.absoluteScale } }, l.prototype.rotateToView = function(t, e) { if (r.delBK) { var i = 0; this.rotateLeft(i), this.update(0) } else { i = 0; s.aspectRatio() < 1 === t.x < t.z ? e.z > 0 && (i = Math.PI) : i = e.x > 0 ? Math.PI / 2 : -Math.PI / 2, this.rotateLeft(i) } }, l.prototype.pan = function(t, e) { this.camera.updateMatrix(), this.panLeft(t * (this.camera.right - this.camera.left) / (window.renderWidth || window.innerWidth)), this.panUp(-e * (this.camera.top - this.camera.bottom) / (window.renderHeight || window.innerHeight)) }, l.prototype.updateZoom = function() { return this.absoluteScale *= this.scale - .03 * this.keyboardZoomSpeed, this.absoluteScale = Math.max(r.zoomNearLimit, Math.min(this.absoluteScale, r.zoomFarLimit)), this.currentScale = .8 * this.currentScale + .2 * this.absoluteScale, this.camera.left = -r.orthoBase * this.currentScale, this.camera.right = r.orthoBase * this.currentScale, this.camera.top = r.orthoBase * this.currentScale / this.camera.aspect, this.camera.bottom = -r.orthoBase * this.currentScale / this.camera.aspect, this.camera.updateProjectionMatrix(), this.offset.length() }, l.prototype.toJSON = function() { var t = new n.Quaternion, e = (new n.Quaternion) .setFromAxisAngle(new n.Vector3(0, 1, 0), n.Math.degToRad(90)), i = new n.Quaternion; return function() { var n = o.prototype.toJSON.call(this); return t.copy(n._rotation), i.copy(e), i.multiply(t), n._rotation.x = a.toPrecision(i.x, 4), n._rotation.y = a.toPrecision(i.y, 4), n._rotation.z = a.toPrecision(i.z, 4), n._rotation.w = a.toPrecision(i.w, 4), n._zoom = a.toPrecision(this.currentScale * this.camera.aspect, 4), n } }(), t.exports = l }, function(t, e) { t.exports = { PanoRenderComplete: "panorama.render.complete", TileRenderFailure: "panorama.tile.render.failed", TileRenderSuccess: "panorama.tile.render.success", TileUploadAttempted: "panorama.tile.upload.attempted", UploadAttemptedForAllTiles: "panorama.upload.attempted.all.tiles" } }, function(t, e) { var i, n, r = {}; r.RADIANS_PER_DEGREE = Math.PI / 180, r.DEGREES_PER_RADIAN = 180 / Math.PI, r.Vector3 = function(t, e, i) { this.x = t || 0, this.y = e || 0, this.z = i || 0 }, r.Matrix4 = function() { this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]) }, r.Matrix4.prototype = { identity: function() { return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this }, copy: function(t) { return this.elements.set(t.elements), this }, applyToVector3: function(t) { var e = t.x, i = t.y, n = t.z, r = this.elements; return t.x = r[0] * e + r[4] * i + r[8] * n + r[12], t.y = r[1] * e + r[5] * i + r[9] * n + r[13], t.z = r[2] * e + r[6] * i + r[10] * n + r[14], this }, getInverse: function(t, e) { var i = this.elements, n = t.elements, r = n[0], o = n[1], a = n[2], s = n[3], l = n[4], u = n[5], h = n[6], c = n[7], d = n[8], p = n[9], f = n[10], m = n[11], g = n[12], v = n[13], y = n[14], b = n[15], w = p * y * c - v * f * c + v * h * m - u * y * m - p * h * b + u * f * b, x = g * f * c - d * y * c - g * h * m + l * y * m + d * h * b - l * f * b, M = d * v * c - g * p * c + g * u * m - l * v * m - d * u * b + l * p * b, T = g * p * h - d * v * h - g * u * f + l * v * f + d * u * y - l * p * y, S = r * w + o * x + a * M + s * T; if (0 === S) { if (e) throw new Error("MathLight.Matrix4.getInverse(): can't invert matrix, determinant is 0"); return this.identity() } var _ = 1 / S; return i[0] = w * _, i[1] = (v * f * s - p * y * s - v * a * m + o * y * m + p * a * b - o * f * b) * _, i[2] = (u * y * s - v * h * s + v * a * c - o * y * c - u * a * b + o * h * b) * _, i[3] = (p * h * s - u * f * s - p * a * c + o * f * c + u * a * m - o * h * m) * _, i[4] = x * _, i[5] = (d * y * s - g * f * s + g * a * m - r * y * m - d * a * b + r * f * b) * _, i[6] = (g * h * s - l * y * s - g * a * c + r * y * c + l * a * b - r * h * b) * _, i[7] = (l * f * s - d * h * s + d * a * c - r * f * c - l * a * m + r * h * m) * _, i[8] = M * _, i[9] = (g * p * s - d * v * s - g * o * m + r * v * m + d * o * b - r * p * b) * _, i[10] = (l * v * s - g * u * s + g * o * c - r * v * c - l * o * b + r * u * b) * _, i[11] = (d * u * s - l * p * s - d * o * c + r * p * c + l * o * m - r * u * m) * _, i[12] = T * _, i[13] = (d * v * a - g * p * a + g * o * f - r * v * f - d * o * y + r * p * y) * _, i[14] = (g * u * a - l * v * a - g * o * h + r * v * h + l * o * y - r * u * y) * _, i[15] = (l * p * a - d * u * a + d * o * h - r * p * h - l * o * f + r * u * f) * _, this }, makeRotationFromQuaternion: function(t) { var e = this.elements, i = t.x, n = t.y, r = t.z, o = t.w, a = i + i, s = n + n, l = r + r, u = i * a, h = i * s, c = i * l, d = n * s, p = n * l, f = r * l, m = o * a, g = o * s, v = o * l; return e[0] = 1 - (d + f), e[4] = h - v, e[8] = c + g, e[1] = h + v, e[5] = 1 - (u + f), e[9] = p - m, e[2] = c - g, e[6] = p + m, e[10] = 1 - (u + d), e[3] = 0, e[7] = 0, e[11] = 0, e[12] = 0, e[13] = 0, e[14] = 0, e[15] = 1, this } }, r.Quaternion = function(t, e, i, n) { this._x = t || 0, this._y = e || 0, this._z = i || 0, this._w = void 0 !== n ? n : 1 }, r.Quaternion.prototype = { get x() { return this._x }, set x(t) { this._x = t }, get y() { return this._y }, set y(t) { this._y = t }, get z() { return this._z }, set z(t) { this._z = t }, get w() { return this._w }, set w(t) { this._w = t }, copy: function(t) { this._x = t.x, this._y = t.y, this._z = t.z, this._w = t.w }, inverse: function() { return this.conjugate() .normalize() }, conjugate: function() { return this._x *= -1, this._y *= -1, this._z *= -1, this }, length: function() { return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w) }, normalize: function() { var t = this.length(); return 0 === t ? (this._x = 0, this._y = 0, this._z = 0, this._w = 1) : (t = 1 / t, this._x = this._x * t, this._y = this._y * t, this._z = this._z * t, this._w = this._w * t), this }, setFromAxisAngle: function(t, e) { var i = e / 2, n = Math.sin(i); return this._x = t.x * n, this._y = t.y * n, this._z = t.z * n, this._w = Math.cos(i), this }, setFromUnitVectors: function(t, e) { return void 0 === i && (i = new r.Vector3), (n = r.dot(t, e) + 1) < 1e-6 ? (n = 0, Math.abs(t.x) > Math.abs(t.z) ? r.setVector(i, -t.y, t.x, 0) : r.setVector(i, 0, -t.z, t.y)) : r.cross(t, e, i), this._x = i.x, this._y = i.y, this._z = i.z, this._w = n, this.normalize() }, multiply: function(t) { return this.multiplyQuaternions(this, t) }, premultiply: function(t) { return this.multiplyQuaternions(t, this) }, multiplyQuaternions: function(t, e) { var i = t._x, n = t._y, r = t._z, o = t._w, a = e._x, s = e._y, l = e._z, u = e._w; return this._x = i * u + o * a + n * l - r * s, this._y = n * u + o * s + r * a - i * l, this._z = r * u + o * l + i * s - n * a, this._w = o * u - i * a - n * s - r * l, this } }, r.convertWorkshopVector = function(t) { return new r.Vector3(-t.x, t.y, t.z) }, r.convertWorkshopQuaternion = function(t) { return new r.Quaternion(-t.x, t.y, t.z, -t.w) .multiply(new r.Quaternion(Math.sqrt(2) / 2, Math.sqrt(2) / 2, 0, 0)) }, r.convertWorkshopOrthoZoom = function(t) { return -1 === t ? -1 : t / 4 }, r.convertWorkshopPanoramaQuaternion = function(t) { return new r.Quaternion(t.x, -t.y, -t.z, t.w) .normalize() .multiply((new r.Quaternion) .setFromAxisAngle(new r.Vector3(0, 1, 0), 270 * r.RADIANS_PER_DEGREE)) }, r.normalize = function(t) { var e = t.x * t.x + t.y * t.y + t.z * t.z, i = Math.sqrt(e); t.x /= i, t.y /= i, t.z /= i }, r.dot = function(t, e) { return t.x * e.x + t.y * e.y + t.z * e.z }, r.cross = function(t, e, i) { var n = t.x, r = t.y, o = t.z; i.x = r * e.z - o * e.y, i.y = o * e.x - n * e.z, i.z = n * e.y - r * e.x }, r.setVector = function(t, e, i, n) { t.x = e, t.y = i, t.z = n }, r.copyVector = function(t, e) { e.x = t.x, e.y = t.y, e.z = t.z }, r.addVector = function(t, e) { t.x += e.x, t.y += e.y, t.z += e.z }, r.subVector = function(t, e) { t.x -= e.x, t.y -= e.y, t.z -= e.z }, r.applyQuaternionToVector = function(t, e) { var i = e.x, n = e.y, r = e.z, o = t.x, a = t.y, s = t.z, l = t.w, u = l * i + a * r - s * n, h = l * n + s * i - o * r, c = l * r + o * n - a * i, d = -o * i - a * n - s * r; e.x = u * l + d * -o + h * -s - c * -a, e.y = h * l + d * -a + c * -o - u * -s, e.z = c * l + d * -s + u * -a - h * -o }, r.angleBetweenVectors = function(t, e) { return Math.acos(r.dot(t, e)) }, t.exports = r }, function(t, e, i) { (function(e) { function n(t) { o.call(this, t), this.panoId = t.panoId, this.orthoZoom = t.orthoZoom, this.floorVisibility = t.floorVisibility, this.thumbUrl = t.thumbUrl, this.name = t.name, this.isHero = t.isHero, this.script = t.script, this.cameraType = t.cameraType } var r = (i(0), i(2)), o = (i(1), i(5), i(7), i(8), i(10), i(11), i(16), i(58)); i(4) .EventEmitter, new r(e), n.prototype = Object.create(o.prototype), n.prototype.isPano = function() { return this.panoId && "" !== this.panoId }, t.exports = n }) .call(this, "/js/objects/Snapshot.js") }, function(t, e, i) { (function(e) { var n = i(0), r = i(4) .EventEmitter; function o(t) { t = t || {}, this.position = new n.Vector3, this.quaternion = new n.Quaternion, this.update(t) } n = i(0); var a = i(2); i(1), i(5), i(7), i(8), i(10), i(11), i(16), r = i(4) .EventEmitter; new a(e), o.prototype = Object.create(r.prototype), o.prototype.isValid = function() { return !!this.cameraMode }, o.prototype.update = function(t) { return this.cameraMode = t.cameraMode || this.cameraMode, this.pano = t.pano || this.pano, t.position && this.position.copy(t.position), t.quaternion && this.quaternion.copy(t.quaternion), this }, t.exports = o }) .call(this, "/js/objects/View.js") }, function(t, e, i) { var n = i(0), r = i(5), o = i(8), a = i(20), s = new n.ShaderPass(n.HorizontalBlurShader), l = new n.ShaderPass(n.VerticalBlurShader); l.renderToScreen = !0; var u = (window.renderWidth || window.innerWidth) / (window.renderHeight || window.innerHeight); isNaN(u) && (u = 1); var h = { currentBlur: 0, aspect: u, blurStrength: 1, hblurPass: s, vblurPass: l, bindEvents: function(t) { t.on(a.ModeChanged, (function(t, e) { t === r.PANORAMA && (o.cancel(h.blur), o.cancel(h.addBlur), o.start(h.removeBlur, 500, null, 0, null, "deblur")) })) }, blur: function(t) { h.currentBlur = 1; var e = t * h.blurStrength; l.uniforms.v.value = e / 512 * h.aspect, s.uniforms.h.value = e / 512 }, addBlur: function(t) { t = Math.max(t, h.currentBlur), h.blur(t) }, removeBlur: function(t) { t = Math.min(1 - t, h.currentBlur), h.blur(t) } }; h.blur(1), t.exports = h }, function(t, e, i) { var n = (i(0), i(7)), r = i(14), o = i(21), a = i(4) .EventEmitter; function s() { this.modelMap = {}, this.activeModel = null, this.modelCount = 0, this.tileDownloader = null, this.panoRenderer = null } s.prototype.init = function(t, e, i) { this.tileDownloader = t, this.panoRenderer = e, this.qualityManager = i }, s.prototype.addModel = function(t) { this.modelMap[t.modelid] = t, 0 === this.modelCount && this.activateModel(t.modelid), this.modelCount++, this.emit(o.ModelAdded) }, s.prototype.activateModel = function(t) { var e = this.modelMap[t]; if (!e) throw new r("Tried to activate invalid model!"); var i = this.activeModel; this.activeModel = e, this.tileDownloader.setPanoData(e.panos, e.listImagePanos(), e.modelid), this.tileDownloader.setUrls(e.urls), e.panos.forEach(function(t) { t.attachToPanoRenderer(this.panoRenderer), t.tileDownloader = this.tileDownloader, t.qualityManager = this.qualityManager }.bind(this)), this.emit(o.ActiveModelChanged, { oldModel: i, model: e }) }, s.prototype.getActiveModel = function() { return this.activeModel }, n.extend(s, a), t.exports = s }, function(t, e, i) { var n = i(0), r = i(1); function o() { n.PerspectiveCamera.call(this, r.dollhouseFOV, (window.renderWidth || window.innerWidth) / (window.renderHeight || window.innerHeight), r.dollhouseNear, r.dollhouseFar), this.controls = null } o.prototype = Object.create(n.PerspectiveCamera.prototype), o.prototype.updateAspect = function(t) { this.aspect = t, this.updateProjectionMatrix() }, t.exports = o }, function(t, e, i) { var n = i(0), r = i(1); function o() { var t = (window.renderWidth || window.innerWidth) / (window.renderHeight || window.innerHeight); n.OrthographicCamera.call(this, -r.orthoBase, r.orthoBase, r.orthoBase / t, -r.orthoBase / t, r.orthoNear, r.orthoFar), this.controls = null, this.updateAspect(t) } o.prototype = Object.create(n.OrthographicCamera.prototype), o.prototype.updateAspect = function(t) { this.aspect = t, this.top = r.orthoBase / t, this.bottom = -r.orthoBase / t, this.updateProjectionMatrix() }, t.exports = o }, function(t, e) { t.exports = Object.freeze({ Standard: 0, Slow: 1, Retain: 2 }) }, function(t, e) { t.exports = Object.freeze({ Show: 0, Hide: 1, Retain: 2 }) }, function(t, e) { t.exports = Object.freeze({ None: 0, Queued: 1, ForceQueued: 2, Downloading: 3, Downloaded: 4, DownloadFailed: 5 }) }, function(t, e) { t.exports = { STAY3D: 1, FLYTOPANO: 2, STARTPANO: 3 } }, function(t, e, i) { var n = i(0), r = i(1), o = null; function a(t) { o = this, this.player = t, this.raycaster = this.player.raycaster, this.camera = this.player.camera; this.perspectiveCamera = new n.PerspectiveCamera(r.insideFOV, (window.renderWidth || window.innerWidth) / (window.renderHeight || window.innerHeight), r.insideNear, r.insideFar), this.sRender = t.sRender, this.scene = this.sRender.scene, this.lookVector = new n.Vector2, this.renderTarget = new n.WebGLRenderTarget(512, 512), this.lensMesh = null } a.prototype.createNewColliders = function() { return !1 }, a.prototype.createMeasureLens = function() { return !1 }, a.prototype.onMouseMove = function(t, e, i) { return e.chunks.forEach((function(t) { t.material.uniforms.mouseAPosition && t.material.uniforms.measureMode && (t.material.uniforms.mouseAPosition.value.copy(i), t.material.uniforms.measureMode.value = 1) })), !1 }, a.prototype.show = function() { return !1 }, a.prototype.hide = function() { return !1 }, a.prototype.update = function() { return !1 }, a.prototype.render = function() { this.sRender.mesaueLensRender(o.scene, o.perspectiveCamera, o.renderTarget, !0) }, t.exports = a }, function(t, e, i) { "use strict"; function n() { this.enabled = !0 } n.prototype.echo = function(t, e) { this.enabled && t.apply(console, e) }, n.prototype.log = function() { this.echo(console.debug, arguments) }, n.prototype.info = function() { this.echo(console.info, arguments) }, n.prototype.debug = function() { this.echo(console.debug, arguments) }, n.prototype.warn = function() { this.echo(console.warn, arguments) }, n.prototype.error = function() { this.echo(console.error, arguments) }; var r = new n; G.ncz_my_log = r, t.exports = r }, function(t, e, i) { "use strict"; var n = i(0), r = i(132); function o(t) { this.id = t, this.postil = null, this.settingItem = null } o.prototype.init = function(t) { var e; (this.postilEngine = { type_1: this.createTorus, type_2: this.createRect }, t) || (this.settingItem = new r(this.id), 1 === this.settingItem.type && (e = 328), 2 === this.settingItem.type && (e = 320), this.postil = this.postilEngine["type_" + this.id].call(this, 8, e, "#ff0000"), this.settingItem.uuid = this.postil.uuid); t && (this.settingItem = t, 1 === t.type && (e = 328), 2 === t.type && (e = 320), this.postil = this.postilEngine["type_" + this.id].call(this, t.fat, e, t.color), this.postil.position.copy(t.position), this.postil.scale.copy(t.scale)); return this.settingItem.uuid = this.postil.uuid, this.settingItem.position = this.postil.position, this.settingItem.scale = this.postil.scale, this.initUserData(), this.postil }, o.prototype.initUserData = function() { this.postil.name = "postil_" + (new Date) .getTime(), this.postil.userData.PostilModel = this, this.postil.userData.fat = this.settingItem.fat, this.postil.userData.type = "postil", this.postil.userData.follow_mouse = !1, this.postil.userData.box_line = null, this.postil.userData.transform_control = null, this.postil.userData.setting_item = this.settingItem }, o.prototype.createTorusTexture = function(t, e, i) { var r = document.createElement("canvas"), o = r.getContext("2d"), a = 1024, s = a * (t / e); r.width = a * (window.devicePixelRatio ? window.devicePixelRatio : 1), r.height = a * (window.devicePixelRatio ? window.devicePixelRatio : 1), o.beginPath(), o.lineWidth = s, o.strokeStyle = i || "#ff0000", o.arc(r.width / 2, r.height / 2, (r.width - s) / 2, 0, 360, !1), o.stroke(), o.closePath(), window.devicePixelRatio && o.scale(window.devicePixelRatio, window.devicePixelRatio); var l = new n.CanvasTexture(r); return l.minFilter = n.LinearFilter, l.magFilter = n.LinearFilter, l }, o.prototype.createRectTexture = function(t, e, i) { var r = document.createElement("canvas"), o = r.getContext("2d"), a = 1024, s = a * (t / e); r.width = a * (window.devicePixelRatio ? window.devicePixelRatio : 1), r.height = a * (window.devicePixelRatio ? window.devicePixelRatio : 1), o.lineWidth = s, o.strokeStyle = i || "#ff0000", o.moveTo(0, 0), o.lineTo(r.width, 0), o.lineTo(r.width, r.height), o.lineTo(0, r.height), o.lineTo(0, 0), o.stroke(), window.devicePixelRatio && o.scale(window.devicePixelRatio, window.devicePixelRatio); var l = new n.CanvasTexture(r); return l.minFilter = n.LinearFilter, l.magFilter = n.LinearFilter, l }, o.prototype.createPostilOfTexture = function(t) { var e = new n.PlaneBufferGeometry(.5, .5), i = new n.MeshBasicMaterial({ map: t, side: n.DoubleSide, transparent: !0, depthTest: !1, depthWrite: !1 }), r = new n.Mesh(e, i); return r.scale.divideScalar(2), r }, o.prototype.createTorus = function(t, e, i) { var n = this.createTorusTexture(t, e, i), r = this.createPostilOfTexture(n); return r.userData.default_scale = r.scale.clone(), r.userData.default_size = { width: 328, height: 328 }, r.userData.default_fat = 8, r }, o.prototype.createRect = function(t, e, i) { var n = this.createRectTexture(t, e, i), r = this.createPostilOfTexture(n); return r.userData.default_scale = r.scale.clone(), r.userData.default_size = { width: 320, height: 320 }, r.userData.default_fat = 8, r }, t.exports = o }, function(t, e) { t.exports = { ActionInterrupted: "action.interrupted" } }, function(t, e) { t.exports = { Normal: 0, Audio: 1, Video: 2, IFrame: 3 } }, function(t, e, i) { (function(e) { new(i(2))(e); var n = { parseIdsFromChunkName: function(t, e) { e.floorId = n.parseFloor(t), e.roomId = n.parseRoom(t) }, parseFloor: function(t) { var e, i = t.match(/block_([0-9]+)/); if (!i) return 0; try { e = parseInt(i[1], 10) } catch (t) { return 0 } return this.getfid(e) }, getfid: function(t) { for (var e = G.settings.building.blocks, i = e.length || 0, n = 0; n < i; n++) if (e[n].blockidx === t) return e[n].flooridx; return 0 }, getflooridx: function() { for (var t = G.model.chunks, e = 0; e < t.length; e++) if (G.model.chunks[e].id === G.interchunkid) return this.getfid(e); return 0 }, getrid: function(t) { for (var e = G.settings.building.blocks, i = e.length || 0, n = 0; n < i; n++) if (e[n].blockidx === t) return e[n].roomidx; return 0 }, parseRoom: function(t) { var e, i = t.match(/block_([0-9]+)/); if (!i) return 0; try { e = parseInt(i[1], 10) } catch (t) { return 0 } return this.getrid(e) } }; t.exports = n }) .call(this, "/js/model/Chunks.js") }, function(t, e, i) { var n = i(4) .EventEmitter, r = function() { this.audioContext = null, window.AudioContext = window.AudioContext || window.webkitAudioContext || window.mozAudioContext || window.msAudioContext, window.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.msRequestAnimationFrame, window.cancelAnimationFrame = window.cancelAnimationFrame || window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || window.msCancelAnimationFrame; try { this.audioContext = new AudioContext } catch (t) {} this.audioContext || alert("该浏览器不支持AudioContext,讲房无法正常使用!"), this.bufferList = {}, this.cellList = {} }; r.prototype.load = function(t) { var e = new XMLHttpRequest; e.open("GET", t, !0), e.responseType = "arraybuffer"; var i = this; this.audioContext && (i.cellList[t] = new o(this.audioContext)), e.onload = function() { i.audioContext && i.audioContext.decodeAudioData(e.response, (function(e) { e && i.cellList[t].setBuffer(e) })) }, e.onerror = function() {}, e.send() }, r.prototype.getCell = function(t) { return null !== this.cellList[t] ? this.cellList[t] : null }; var o = function(t) { this.audioContext = t, this.audioBuffer = null, this.source = null, this.pauseTime = 0, this.startTime = 0, this.readyState = 0, this.oncanplay = function() {}, this.audioContext && this.audioContext.addEventListener("ended", (function() {})), this._ended = this._ended.bind(this); var e = this; Object.defineProperty(this, "contextCurrentTime", { get: function() { return e.audioContext.currentTime }, set: function(t) { t, e.pauseTime = t } }), Object.defineProperty(this, "currentTime", { get: function() { return e.audioContext.currentTime - e.startTime }, set: function(t) { t, e.pauseTime = t } }), Object.defineProperty(this, "duration", { get: function() { return e.audioBuffer.duration } }), this.keeprunning = this.keeprunning.bind(this), document.body.addEventListener("touchend", this.keeprunning, !1) }; o.prototype = Object.create(n.prototype), o.prototype.setBuffer = function(t) { this.audioBuffer = t, this.readyState = 4, this.oncanplay() }, o.prototype.keeprunning = function() { if ("running" !== this.audioContext) { var t = this; this.audioContext.resume(); var e = setTimeout((function() { "running" === t.audioContext.state && clearTimeout(e) }), 0) } }, o.prototype.play = function() { var t = 0; 0 !== this.pauseTime && (t = this.pauseTime, this.pauseTime = 0); var e = this.audioContext, i = e.createBufferSource(); i.connect(e.destination), i.buffer = this.audioBuffer, i.start || (i.start = i.noteOn, i.stop = i.noteOff), this.source = i, this.startTime = this.contextCurrentTime, i.onended = this._ended, i.start(0, t) }, o.prototype._ended = function() { this.emit("play_done") }, o.prototype.pause = function() { null !== this.source && (this.pauseTime = this.contextCurrentTime - this.startTime, this.source.disconnect()) }, o.prototype.stop = function() { null !== this.source && this.source.disconnect() }; var a, s = (a = null, function() { return null === a && (a = new r), a }); t.exports = s }, function(t, e, i) { function n() { var t = new r.SphereBufferGeometry(a.skyboxRadius, 20, 5), e = new r.RawShaderMaterial({ fragmentShader: o.skysphere.fragmentShader, vertexShader: o.skysphere.vertexShader, uniforms: r.UniformsUtils.clone(o.skysphere.uniforms), side: r.BackSide, name: "skysphere" }); e.uniforms.radius.value = t.parameters.radius, r.Mesh.call(this, t, e) } var r = i(0), o = i(12), a = i(1); n.prototype = Object.create(r.Mesh.prototype), n.prototype.constructor = n, t.exports = n }, function(t, e, i) { (function(e) { function n(t) { t.camera && (t.camera.quaternion = r(t.camera.quaternion)), t.pano && (t.pano.quaternion = r(t.pano.quaternion)) } function r(t) { return t = t || new c.Quaternion, 0 === Math.abs(t.x) && 0 === Math.abs(t.y) && 0 === Math.abs(t.z) && 0 === Math.abs(t.w) && (t.w = 1), t } function o(t) { return a.deserialize(t) } var a = i(182), s = i(9), l = i(3), u = i(5), h = i(2), c = i(0), d = new h(e); t.exports = { optionsFromString: o, getStartCameraOptions: function(t, e, i, r) { var a = {}; if (r || (a = function(t) { var e = l.valueFromHash("start", ""), i = {}; "" !== e && (d.debug("Start override found in parameters, trying to parse..."), (i = o(e) || {}) .tag = l.valueFromHash("tag", null), i.panoId && (i.pano = t.get(i.panoId))); return i }(e)), "" != (a = function(t) { var e = l.valueFromHash("o", ""), i = {}; e || (e = t.data.orientationkey); if (e) { var n = t.data.orientations; if (null != n && null != n) { var r = n.length; for (i = 0; i < r; i++) if (n[i].key == e) return n[i] } } return i }(t)) && a.enable) { var h = a.location_id, p = a.rotation, f = e.list.length; if (1 == a.type) { a.mode = u.PANORAMA; for (i = 0; i < f; i++) e.list[i].id == h && (a.pano = e.list[i], a.position = a.pano.position, a.quaternion = p); return a.quaternion && (a.quaternion = s.convertWorkshopQuaternion(a.quaternion)), a } for (i = 0; i < f; i++) e.list[i].id == h && (a.pano = e.list[i], a.position = a.pano.position, a.quaternion = a.pano.quaternion); return a } var m = l.valueFromHash("l", ""); if ("" != m) { h = m, f = e.list.length; a.mode = u.PANORAMA; for (i = 0; i < f; i++) e.list[i].id == h && (a.pano = e.list[i], a.position = a.pano.position, a.quaternion = a.pano.quaternion); return a.quaternion && (a.quaternion = s.convertWorkshopQuaternion(a.quaternion)), a } var g = function(t) { var e = t.data.images.scenes, i = t.settings; if (i.jf && i.jf.enable && i.jf.dataset.length > 0) return e[0]._camera; for (var n = 0; n < e.length; n++) { var r = e[n]; if (null !== r.name && "总述" !== r.name) return r._camera } return "" }(t); if ("" !== g) { h = g._locationid, f = e.list.length, p = g._rotation; a.mode = u.PANORAMA; for (i = 0; i < f; i++) e.list[i].id == h && (a.pano = e.list[i], 2 == g._type ? a.quaternion = a.pano.quaternionAutoScene : a.quaternion = p, a.position = a.pano.position); if (a.quaternion) { var v = a.quaternion; a.quaternion = new c.Quaternion(v.x, v.y, v.z, v.w) } return a } var y = t.data.camera_start; if (y) try { n(y), Object.keys(y) .length > 0 && 0 === Object.keys(a) .length && (a.mode = u.convertWorkshopModeInt(y.mode), a.position = y.camera.position, a.quaternion = y.camera.quaternion, a.zoom = s.convertWorkshopOrthoZoom(y.camera.zoom), y.pano && (a.pano = e.get(y.pano.locationid), d.debug("Using camera_start"), d.debug("Modeldata pano: ", a.pano.quaternion), d.debug("Camera start pano: ", y.pano.quaternion)), a.mode !== u.PANORAMA && (a.floorVisibility = t.heroImage._camera.floor_visibility)) } catch (t) { d.warn(t.message) } if (0 === Object.keys(a) .length && (a = function(t, e) { if (!t.heroImage || !t.heroImage._camera._viewpoint) return {}; var i = {}, n = t.heroImage._camera; d.debug("Using start position from thumbnail image"), i.position = n._viewpoint, i.quaternion = n._rotation; try { i.mode = u.convertWorkshopModeInt(0), i.mode === u.PANORAMA ? i.pano = e.get(n._locationid) : i.floorVisibility = n.floor_visibility } catch (t) { d.debug(t.message) } return i }(t, e)), t.outsideAllowed() || a.mode === u.PANORAMA || (a = {}), 0 === Object.keys(a) .length) { for (i = 0; i < e.list.length && 1 != e.list[i].alignmentType; i++); a.pano = e.list[i], a.position = a.pano.position, a.quaternion = a.pano.quaternionAutoScene, d.info("Starting at 1st pano " + a.pano.id) } return a.mode = a.mode || u.PANORAMA, a.pano || (d.debug("No pano selected, choosing the closest one to player location"), a.pano = e.findClosest(a.position || i)), a.mode === u.MESH && (a.mode = u.PANORAMA, a.position = a.pano ? a.pano.position : i), a } } }) .call(this, "/js/util/camera.js") }, function(t, e) { t.exports = { TileDownloadSuccess: "tiledownloader.download.success", TileDownloadFailure: "tiledownloader.download.failure", PanoDownloadComplete: "tiledownloader.pano.download.complete" } }, function(t, e, i) { var n = i(78), r = i(3), o = i(1), a = i(2); t.exports.HousePlay = n, t.exports.Browser = r, t.exports.Config = o, t.exports.Logger = a }, function(t, e, i) { "use strict"; (function(e) { window.G = {}, G.conf = { isNewServerPreviewVersion: !1, isNewEditVersion: !1, isCleanUI: 0, jfedit: !1, screenshot: !1, modelplaced: !0, modelMeasure: !1, annotation: !1, publicity: !1 }, i(79), i(80), i(81), i(82), i(83), i(84), i(85), i(86), i(87), i(88), i(89), i(90), i(91), i(92), i(93), i(94), i(95), i(96), i(97), i(10), i(11); var n = i(0), r = i(98), o = i(144), a = i(60), s = i(145), l = i(5), u = i(2), h = i(146), c = i(3), d = i(1), p = i(8), f = i(59), m = i(74), g = (i(25), i(75)), v = i(183), y = i(4) .EventEmitter, b = i(184), w = i(186), x = i(191), M = i(195), T = i(196), S = (i(42), i(198)), _ = i(199), A = i(48), P = i(66), C = i(20), E = i(27), D = i(201), L = i(28)(), O = i(202); function I(t) { t.stopPropagation(), t.preventDefault() } function R(t) { y.defaultMaxListeners = 1e3, function(t) { t.addEventListener("dragenter", I, !1), t.addEventListener("dragover", I, !1) }(t) } function N(t) { ! function t(e) { for (var i in e) "object" == typeof e[i] ? t(e[i]) : "string" == typeof e[i] && (e[i] = e[i].replace("modelcdn.3dnest.cn", "modelcdn2.3dnest.cn") .replace("infocdn.3dnest.cn", "infocdn2.3dnest.cn") .replace("template.3dnest.cn", "template2.3dnest.cn")) }(t) } function k(t, e, i, n) { return n.progressCallback = e, t.load(i) .progress(F.bind(this, n)) } function F(t, e) { var i; t.modelElementsToLoad = e[1], (i = t) .totalElementsToLoad = i.modelElementsToLoad + i.panoElementsToLoad, function(t) { t.totalElementsLoaded++, t.totalPercentageLoaded = t.totalElementsLoaded / t.totalElementsToLoad, t.progressCallback && t.progressCallback(100 * t.totalPercentageLoaded) }(t) } function B(t, e, i) { try { t.start(e) } catch (t) { throw i.modelid, (n = c.details()) && "Safari" === n.name && n.version > 500 && n.version, t } var n } u.level = d.logLevel, u.consoleEnabled = d.console; var z = function(t) { if (this.event = { load: new y, player: new y, director: new y, model: new y }, this.playContainer = void 0 !== t.container ? t.container : document.getElementById("player"), this.modelId = void 0 !== t.modelId ? t.modelId : "", this.settings = void 0 !== t.settings ? t.settings : {}, this.version = void 0 !== t.version ? t.version : {}, this.siteConf = void 0 !== t.siteConf ? t.siteConf : {}, this.enterType = void 0 !== t.enterType ? t.enterType : 2, this.loadingState = !1, this.compassAngle = 0, this.lastCompassAngle = 0, this.settings.basic.menu && (d.unit_type = this.settings.basic.menu.unit_type || 0, 1 === d.unit_type && (d.unit_conversion_value = 3.28, d.unit_name = "ft", d.unit_sq_name = "ft²")), !this.modelId) return this.event.error.emit("invalid_modelid"); var e = this.settings.building.blocks; if (e && this.settings.building) for (var i = 0; i < e.length; i++) e[i].blockidx = parseInt(e[i].blockidx), e[i].flooridx = parseInt(e[i].flooridx), e[i].roomidx = parseInt(e[i].roomidx); else this.settings.building.blocks = {}; G.url = G.url || {}, G.url.modelid = this.modelId, G.url.type = this.siteConf.type, window.PREFETCHED_MODELDATA = this.settings; var n = this; this.progStruct = { panoElementsToLoad: 6, modelElementsToLoad: 0, totalElementsLoaded: 0, totalElementsToLoad: 0, totalPercentageLoaded: 0, progressCallback: null }, this.qFlag = d.quickstart.enabled, this.quickstartManager = null, this.startOptions = null, this.player = null, this.director = null, this.mattertagManager = null, this.sceneRenderer = null, this.tileDownloader = null, this.qualityManager = null, this.model = null, this.Controller = null, this.panoRenderer = null, this.quickStart = null, this.panoramaSize = new D, this.panoramaSize.on("updatePanoSize", (function(t, e, i) { n.panoramaSize.enable && n.emit("updatePanoSize", t, e, i) })), this.record = null, this.playType = "heighlight", R(this.playContainer); var r, o, a = (this.modelId, r = this.version, this.settings, (o = this.siteConf) .type, { modelLink: o.modelpre + r.version, infoLink: o.infopre + r.version }); G.url.model = a.modelLink, G.url.info = a.infoLink, G.settings = this.settings || {}, N(this.settings), this._updatePanorameSize = this._updatePanorameSize.bind(this), this._emitAngle = this._emitAngle.bind(this), this._emitFloorChange = this._emitFloorChange.bind(this), this._emitSpinnerState = this._emitSpinnerState.bind(this), this._emitFlyingEnd = this._emitFlyingEnd.bind(this), this._emitHighlightsBarChange = this._emitHighlightsBarChange.bind(this), this._emitModeChange = this._emitModeChange.bind(this), this._emitMoveState = this._emitMoveState.bind(this), this._emitUpdateTour = this._emitUpdateTour.bind(this), this._emitPanoChange = this._emitPanoChange.bind(this), this._emitPnaoChosen = this._emitPnaoChosen.bind(this), this._emitStopTour = this._emitStopTour.bind(this), this._emitLoadProgress = this._emitLoadProgress.bind(this), this._emitExitMeasureActive = this._emitExitMeasureActive.bind(this), this._emitChoosedHumanModel = this._emitChoosedHumanModel.bind(this), this._emitHumanModelIsLoaded = this._emitHumanModelIsLoaded.bind(this), this._emitAddModelListItem = this._emitAddModelListItem.bind(this), this._emitDeletePutModelSuccess = this._emitDeletePutModelSuccess.bind(this), this._emitHidePutModelInfoPanel = this._emitHidePutModelInfoPanel.bind(this), this._emitShowLoaddingOfLoadPutModel = this._emitShowLoaddingOfLoadPutModel.bind(this), this._emitHideLoaddingOfLoadPutModel = this._emitHideLoaddingOfLoadPutModel.bind(this), this._emitPutModelListLoadingIsOver = this._emitPutModelListLoadingIsOver.bind(this), this._emitResetPutModelInfo = this._emitResetPutModelInfo.bind(this), this._emitSetPutModelToolsPosition = this._emitSetPutModelToolsPosition.bind(this), this._emitHidePutModelSetTools = this._emitHidePutModelSetTools.bind(this), this._emitShowPutModelSetTools = this._emitShowPutModelSetTools.bind(this), this._emitViewModeTransitioning = this._emitViewModeTransitioning.bind(this), this._emitViewModePanorama = this._emitViewModePanorama.bind(this), this._emitShowModelListPanel = this._emitShowModelListPanel.bind(this), this._emitHideModelListPanel = this._emitHideModelListPanel.bind(this), this._emitUpdatePostilShow = this._emitUpdatePostilShow.bind(this), this._emitChoosedPostil = this._emitChoosedPostil.bind(this), this._emitAddPostilItem = this._emitAddPostilItem.bind(this), this._emitUpdatePostilUI = this._emitUpdatePostilUI.bind(this), this._emitHidePostilSetTool = this._emitHidePostilSetTool.bind(this), this._emitDeletePostilSuccess = this._emitDeletePostilSuccess.bind(this), this._emitShowDeleteDialogOfPostil = this._emitShowDeleteDialogOfPostil.bind(this), this._emitShowEditPanelOfPostil = this._emitShowEditPanelOfPostil.bind(this), this._emitShowAllPostils = this._emitShowAllPostils.bind(this), this._emitHideAllPostils = this._emitHideAllPostils.bind(this), this._emitEditConfirm = this._emitEditConfirm.bind(this), this._emitChoosedWeapon = this._emitEditProbeModel.bind(this), this._emitPutProbeModelComplete = this._emitPutProbeModelComplete.bind(this), this._emitGetMeasurementInfo = this._emitGetMeasurementInfo.bind(this), this._emitAddHumanLabel = this._emitAddHumanLabel.bind(this), this._emitChoosedVirtualCamera = this._emitChoosedVirtualCamera.bind(this), this._emitHideAllHumanLabel = this._emitHideAllHumanLabel.bind(this), this._emitAddVirtualCameraLabel = this._emitAddVirtualCameraLabel.bind(this), this._emitHideAllVirtualCameraLabel = this._emitHideAllVirtualCameraLabel.bind(this), this._emitShowVirtualCameraInfo = this._emitShowVirtualCameraInfo.bind(this), this._emitHideVirtualCameraInfo = this._emitHideVirtualCameraInfo.bind(this), this._emitHideRightTools = this._emitHideRightTools.bind(this), this._emitShowRightTools = this._emitShowRightTools.bind(this), this._emitPutModelFollowMouse = this._emitPutModelFollowMouse.bind(this), this._emitPutModelFollowMouseOver = this._emitPutModelFollowMouseOver.bind(this), this._emitPutModelFollowMouseCancel = this._emitPutModelFollowMouseCancel.bind(this), this._emitQuitPutMode = this._emitQuitPutMode.bind(this), this._emitViewModeDollhouse = this._emitViewModeDollhouse.bind(this), this._emitShowVirtualHumanInfo = this._emitShowVirtualHumanInfo.bind(this), this._emitHideVirtualHumanInfo = this._emitHideVirtualHumanInfo.bind(this), this._emitHandleControlPanoramaMove = this._emitHandleControlPanoramaMove.bind(this), this._emitHandleControlDollhouseMove = this._emitHandleControlDollhouseMove.bind(this), this._emitUpateUiRoate = this._emitUpateUiRoate.bind(this), this.registryOri() }; function U(t, e) {}(z.prototype = Object.create(y.prototype)) .start = function(t, i) { var u = "quickstart" === t || d.quickstart.enabled, y = null, C = null, E = this; this.loadingState = !0, this.record = new O, G.R = this.record, h.initS({ url: this.modelId, floors: c.valueFromHash("f", !0), autoload: !1 }, this.settings) .then((function(t) { return E.model = t, E.model.startup_type === P.STARTPANO && (u = !0, d.quickstart.enabled = !0), E.model.loadPanos() })) .then((function() { y = g.getStartCameraOptions(E.model, E.model.panos, new n.Vector3(0, 0, 0), !0), E.sceneRenderer = function(t) { var e = new n.PerspectiveCamera, i = new n.Scene, r = new n.AmbientLight(16053492, 1); i.add(r); var o = new n.HemisphereLight(16053492, 4473924, 1); return i.add(o), i.skybox = new m, i.add(i.skybox), i.plane = new n.Mesh(new n.PlaneBufferGeometry(1e5, 1e5), new n.RawShaderMaterial({ side: n.DoubleSide })), i.plane.position.y = 0, i.plane.rotateX(-Math.PI / 2), i.plane.material.visible = !1, i.add(i.plane), d.showScreenshotLocations && t.data.images.forEach((function(t) { if (t._camera && t._camera._viewpoint) { var e = t._camera._viewpoint, r = new n.Mesh(new n.BoxGeometry(.3, .3, .3)); r.position.copy(e.clone()), i.add(r); var o = t._camera._viewpoint, a = new n.Vector3(0, 0, -1) .applyQuaternion(o); i.add(new n.ArrowHelper(a, e.clone(), 1, 16711680)) } })), d.showAxis && (i.add(new n.ArrowHelper(new n.Vector3(0, 1, 0), new n.Vector3(0, 0, 0), 1, 255)), i.add(new n.ArrowHelper(new n.Vector3(0, 0, 1), new n.Vector3(0, 0, 0), 1, 16711680)), i.add(new n.ArrowHelper(new n.Vector3(1, 0, 0), new n.Vector3(0, 0, 0), 1, 65280))), new w(i, e, f) }(E.model), C = function(t, e, i, n) { var l = t ? 1 : 1e3, u = new M, h = new S({ concurrentDownloads: c.valueFromHash("tileconc", 4) }), d = new _, f = new a, m = new o, g = new r(e), v = new s(l), y = new T; return u.init(f), h.init(u), d.init(i, h, u), f.init(h, d, u), f.addModel(n), i.addComponent(p), { qualityManager: u, panoRenderer: d, tileDownloader: h, player: g, director: m, modelManager: f, mattertagManager: y, displayController: v } }(u, y.mode, E.sceneRenderer, E.model), E.player = C.player, E.director = C.director, E.mattertagManager = C.mattertagManager, E.tileDownloader = C.tileDownloader, E.qualityManager = C.qualityManager, E.panoRenderer = C.panoRenderer, E.record.init(E.settings.jf), E.model.supportsTiles && E.tileDownloader.start(), u && y.mode !== l.PANORAMA && (u = !1), (u || y.mode === l.PANORAMA) && y.pano && E.emit("enterPoint", y.pano.id); var t = null; return u && (E.quickstartManager = new x(E.qualityManager, E.sceneRenderer.scene, E.sceneRenderer.camera, E.playContainer), B(E.sceneRenderer, E.playContainer, E.model), t = E.quickstartManager.load(y) .then((function() { E.sceneRenderer.addComponent(E.quickstartManager), d.autoplay && (E.quickStart = E.quickstartManager.startLanding()), E.sceneRenderer.once(A.AfterRender, (function() {})) }))), E.director.sLen = E.model.getSceneLength(), E.emit("initLoading"), E.emit("startLoading", E.model, !0, u, E.settings), e.when(t) })) .then((function() { return k(E.model, E._emitLoadProgress, !u, E.progStruct) })) .then((function() { var e = !1; function r() { var t, i; (e = !0, function(t, e, i, n) { var r = i.qualityManager, o = i.panoRenderer, a = i.tileDownloader, s = i.modelManager, l = i.player, u = i.director, h = i.mattertagManager, c = i.displayController; e.scene.add(t), e.qualityManager = r, t.update(); var d = { camera: e.camera, director: u, modelManager: s, tileDownloader: a, panoRenderer: o, qualityManager: r, mattertagManager: h, container: n }; l.init(d), l.setScene(e.scene), u.init(l, s), h.init(s, l, u), c.init(u, l, s, h, n), f.bindEvents(l), e.addComponent(h), e.addComponent(t), e.addComponent(l), e.addComponent(o), e.addComponent(G.R), l.mattertagManager.updateModel() }(E.model, E.sceneRenderer, C, E.playContainer), b.init(E.director, E.player), E.sceneRenderer.started || B(E.sceneRenderer, E.playContainer, E.model), u || E.emit("endLoading", y.mode), (t = E.player, E.model, i = y, t.start(i)) .done((function() { if (G.conf.isNewEditVersion && window.parent && (window.parent.flag = 1), G.model.panosUV.find((function(t) { return G.player.currentPano ? G.player.currentPano.id == t.id : null })) && E.player.currentPano) { var t = G.player.currentPano; E._emitPanoChange(t, 0), E._emitModeChange(null, E.player.mode), E.player.updateWarpEnded() } E.director.autoTour() })), u && (E.quickstartManager.controls.locked = !1, E.player.control.copy(E.quickstartManager.controls), E.sceneRenderer.removeComponent(E.quickstartManager), E.quickstartManager.destroy()), E.model.supportsTiles) || new v(E.model, E.player) .start(); E.registryEvent(E.model, E.play, E.director), E.panoramaSize.init(E.player.currentPano), E._initEvent(), E.emit("endLoading", y.mode), E.settings.jf && E.settings.jf.dataset && E.settings.jf.dataset.length > 0 && E.settings.jf.enable && (E.playType = "Lecture"), E.model && E.model.steeringWheel && (E.model.steeringWheel.visible = !0), E.sceneRenderer.once(A.AfterRender, (function() { E.loadingState = !1, E.emit("afterRender"), E.player.mode === l.PANORAMA && E.model.setEntranceState(!1), E.initMeasure(), G.startEntryPage = !0, E.settings.jf && E.settings.jf.dataset && E.settings.jf.dataset.length > 0 && E.settings.jf.enable && (E.playType = "Lecture"), E.model.steeringWheel && (E.model.steeringWheel.visible = !0) })) } y = g.getStartCameraOptions(E.model, E.model.panos, E.player.position), E.model.data.player_options.show3d ? E.model.startup_type === P.STARTPANO ? y.quickstart = !0 : y.quickstart = u : y.quickstart = !0; var o = null; if ("guid" === t) { var a = !1; E.connectEvent(L, { init: "connect_init_start", init_done: "connect_init_done", wait_connect: "connect_wait_connect", user_added: "connect_uesr_added", bussiness_busy: "connect_call_refuse", user_connected: "connect_user_addIn", close_connect: "connect_close", remote_busy: "connect_remote_operate_busy", callsuccess: "connect_call_success" }), L.on("init_done", (function() { o = setTimeout((function() { u ? E.quickStart.done(r) : r(), o = null }), 1e3) })), L.on("operation", (function(t) { E.emit("connect_operation", t) })), L.on("close_connect", (function(t) { E.emit("connect_identity_update", t) })), L.on("identity", (function(t) { E.emit("connect_identity_update", t) })), L.on("changestate", (function(t) { if (o && clearTimeout(o), !e) { var i = function(t, e) { for (var i = null, n = e.list, r = 0; r < n.length; r++) if (n[r].id === t) { i = n[r]; break } return i }(t.location, E.model.panos); y.mode = t.mode, y.pano = i, "panorama" === t.mode ? (y.position = t.position, y.quaternion = (new n.Quaternion) .copy(t.rotation)) : "dollhouse" === t.mode ? (y.floorVisibility = t.floorVisibility, y.position = t.position, y.quaternion = (new n.Quaternion) .copy(t.rotation)) : "floorplan" === t.mode && (y.floorVisibility = t.floorVisibility, y.position = t.position, y.quaternion = (new n.Quaternion) .copy(t.rotation), y.zoom = t.zoom), a ? r() : u ? E.quickStart.done(r) : r() } })); try { u && E.quickStart.done((function() { a = !0 })), L.joinChannel(i, E.player.getCurrentState) } catch (t) { t, u ? E.quickStart.done(r) : r() } } else u ? E.quickStart.done(r) : r() })) .fail(U.bind(this)) }, z.prototype.connectEvent = function(t, e) { function i(t, e, i) { t.on(e, (function() { n.emit(i) })) } var n = this; for (var r in e) i(t, r, e[r]) }, z.prototype.registryEvent = function(t, e, i) { var n = this; this.model.on("floor.changed", this._emitFloorChange), this.model.on("waiting", this._emitSpinnerState), this.model.on("waiting-done", this._emitSpinnerState), this.director.on("tourStop", this._emitStopTour), this.director.on("update.controls", this._emitUpdateTour), this.player.on("PanoAnimation", this._emitPanoChange), this.player.on(C.ModeChanged, this._emitModeChange), this.player.on(C.WarpEnded, (function() { var t = n.player.currentPano; n._emitPanoChange(t, 0) })), this.player.on(C.FlyingEnded, this._emitFlyingEnd), this.player.on(C.Ready, (function() {})), this.player.on(C.PanoChosen, this._emitPnaoChosen), this.player.on(C.RulersMove, this._updatePanorameSize), this.player.on(E.RulersWalk, this._updatePanorameSize), this.player.on(C.EditAddTagHighlight, this._EditAddTagHighligh), this.player.on(E.MoveHighlightsBar, this._emitHighlightsBarChange), this.player.on(E.ClickHighlightsBar, this._emitHighlightsBarChange), this.player.on("hide-right-tools", this._emitHideRightTools), this.player.on("show-right-tools", this._emitShowRightTools), this.player.on("addModelListItem", this._emitAddModelListItem), this.player.on("deletePutModelSuccess", this._emitDeletePutModelSuccess), this.player.on("hidePutModelInfoPanel", this._emitHidePutModelInfoPanel), this.player.on("showLoaddingOfLoadPutModel", this._emitShowLoaddingOfLoadPutModel), this.player.on("hideLoaddingOfLoadPutModel", this._emitHideLoaddingOfLoadPutModel), this.player.on("putModelListLoadingIsOver", this._emitPutModelListLoadingIsOver), this.player.on("resetPutModelInfo", this._emitResetPutModelInfo), this.player.on("setPutModelToolsPosition", this._emitSetPutModelToolsPosition), this.player.on("hidePutModelSetTools", this._emitHidePutModelSetTools), this.player.on("showPutModelSetTools", this._emitShowPutModelSetTools), this.player.on("viewModeTransitioning", this._emitViewModeTransitioning), this.player.on("viewModePanorama", this._emitViewModePanorama), this.player.on("showModelListPanel", this._emitShowModelListPanel), this.player.on("hideModelListPanel", this._emitHideModelListPanel), this.player.on("put-model-follow-mouse", this._emitPutModelFollowMouse), this.player.on("put-model-follow-mouse-over", this._emitPutModelFollowMouseOver), this.player.on("put-model-follow-mouse-cancel", this._emitPutModelFollowMouseCancel), this.player.on("quit-put-mode", this._emitQuitPutMode), this.player.on("view-mode-dollhouse", this._emitViewModeDollhouse), this.player.on("handle-control-panorama-move", this._emitHandleControlPanoramaMove), this.player.on("handle-control-dollhouse-move", this._emitHandleControlDollhouseMove), this.player.on("choosedHumanModel", this._emitChoosedHumanModel), this.player.on("humanModelIsLoaded", this._emitHumanModelIsLoaded), this.player.on("add-human-label", this._emitAddHumanLabel), this.player.on("hide-all-human-label", this._emitHideAllHumanLabel), this.player.on("show-virtual-human-info", this._emitShowVirtualHumanInfo), this.player.on("hide-virtual-human-info", this._emitHideVirtualHumanInfo), this.player.on("choosed-weapon", this._emitChoosedWeapon), this.player.on("putProbeModelComplete", this._emitPutProbeModelComplete), this.player.on("choosed-virtual-camera", this._emitChoosedVirtualCamera), this.player.on("add-virtual-camera-label", this._emitAddVirtualCameraLabel), this.player.on("hide-all-virtual-camera-label", this._emitHideAllVirtualCameraLabel), this.player.on("show-virtual-camera-info", this._emitShowVirtualCameraInfo), this.player.on("hide-virtual-camera-info", this._emitHideVirtualCameraInfo), this.player.on("update-ui-rotate", this._emitUpateUiRoate), this.player.on("choosed-postil", this._emitChoosedPostil), this.player.on("add-postil-item", this._emitAddPostilItem), this.player.on("update-postil-ui", this._emitUpdatePostilUI), this.player.on("hide-postil-set-tool", this._emitHidePostilSetTool), this.player.on("show-delete-dialog-of-postil", this._emitShowDeleteDialogOfPostil), this.player.on("delete-postil-success", this._emitDeletePostilSuccess), this.player.on("show-edit-panel-of-postil", this._emitShowEditPanelOfPostil), this.player.on("show-all-postils", this._emitShowAllPostils), this.player.on("hide-all-postils", this._emitHideAllPostils), this.player.on("edit-confirm", this._emitEditConfirm), this.player.on("update-postil-show", this._emitUpdatePostilShow), this.player.on("get-measurement-info", this._emitGetMeasurementInfo), this.player.on("exitMeasureActive", this._emitExitMeasureActive), this.player.controls[l.PANORAMA].on("move", this._emitMoveState), this.player.controls[l.DOLLHOUSE].on("move", this._emitMoveState), this.player.controls[l.FLOORPLAN].on("move", this._emitMoveState), this.sceneRenderer.on("compass", this._emitAngle), this.record.on("recording", (function() {})), this.record.on("readyToRecord", (function() {})), this.record.on("startRecord", (function() {})), this.record.on("stopRecord", (function() {})), this.record.on("countdown", (function(t) {})), this.record.on("stopRecordCountDown", (function(t) {})); var r = this; this.record.on("emity", (function() { r._emitLectureError("emity") })), this.record.on("loadAudio", (function() { r._emitLectureLoadAudio("load") })), this.record.on("loadAudioDone", (function() { r._emitLectureLoadAudio("done") })), this.record.on("updateView", (function(t, e) { r._emitLectureUpdate(t, e) })), this.record.on("housedetail", (function(t) { r._emitLectureUI("housedetail", t) })), this.record.on("stop", (function() { r.emit("lecture", "stop") })), this.mattertagManager.on("tagActiveEvent", (function(t) { r.emit("tag.active", t) })), this.on("afterRender", this._emitFirstRender) }, z.prototype._emitFirstRender = function() { var t = this.player.mode, e = this.player.currentPano; this._emitModeChange(null, t), this._emitFlyingEnd(null, null, e, null) }, z.prototype._emitLectureError = function(t) { this.emit("lectureError", t) }, z.prototype._emitLectureLoadAudio = function(t) { this.emit("lectureLoadaudio", t) }, z.prototype._emitLectureUpdate = function(t, e) { this.emit("lectureUpdate", t, e) }, z.prototype._emitLectureUI = function(t, e) { this.emit("lecutreUI", t, e) }, z.prototype._updatePanorameSize = function() { this.panoramaSize.enable && this.panoramaSize.update(this.player) }, z.prototype._updateMeasure = function() { this.Measure.enable && this.Measure.update(this.player) }, z.prototype._emitAngle = function(t) { var e = { angle: t, director: t }; this.model.data.orientation_correct && (e.angle += this.model.data.orientation_correct), this.angle = e.director, this.emit("compass", e) }, z.prototype._emitHighlightsBarChange = function(t) { this.emit("highLightsBarChange", t, this.settings) }, z.prototype._EditAddTagHighligh = function(t) { G.conf.isNewEditVersion && G.sendTag("data") }, z.prototype._emitPnaoChosen = function(t) { this.player.mode; this.emit("panoChosen", this.player) }, z.prototype._emitFlyingEnd = function(t, e, i, n) { var r = {}; if (d.delBK) { this.model.currentFloor.floorIndex; r.floorUrl = this.model.house_type_url } r.showArea = this.model.floorplan_enable, d.delBK && i && i.areaName && i.areaSize && (r.areaName = i.areaName, r.areaSize = i.areaSize), this.needsUpdateRadar && (this.needsUpdateRadar = !1, r.showRadar = !0, r.pano = i), this.player.mattertagManager.ttflying = !1, this.player.mattertagManager.updatetitletags(), this.emit("flyingEnd", r), this.player.baseControls && this.player.baseControls.onFlyEnd() }, z.prototype._emitClickTag = function(t) { t && this.emit("clickTag", t) }, z.prototype._emitModeChange = function(t, e) { this._updatePanorameSize(), "panorama" === e && (this.needsUpdateRadar = !0), this.emit("modeChange", t, e) }, z.prototype._emitPanoChange = function(t, e) { var i = this.model.floorplan_enable; this.emit("panoChange", { pano: t, time: e, showArea: i }) }, z.prototype._emitStopTour = function() { this.emit("stopTour") }, z.prototype._emitUpdateTour = function() { this.emit("updateTour", this.director.describe()) }, z.prototype._emitSpinnerState = function() { var t = "stopSpinner"; this.model.waitQueue.length < 0 ? t = "stopSpinner" : this.loadingState || (t = "delayStopSpinner"), this.emit("spinner", t) }, z.prototype._emitFloorChange = function(t, e) { var i = this.getModelScreenSize(), n = { mode: e, model: this.model, project: i, floorIndex: t.floorIndex, imageUrl: "floorplan" === e ? this.model.getCurrentHouseTypeImage() : "" }; this.model.allFloorsVisible && (n.floorIndex = "all"), this.emit("floorChange", n) }, z.prototype._emitMoveState = function() { (this.emit("move", this.player), this._updatePanorameSize(), this.player.postilControls && this.player.postilControls.POSTIL) && (this.player.postilControls.POSTIL.userData.follow_mouse || this.player.postilControls.destroyPostilChoosedState()) }, z.prototype._emitChoosedHumanModel = function(t) { this.emit("choosedHumanModel", t) }, z.prototype._emitHumanModelIsLoaded = function() { this.emit("humanModelIsLoaded", !0) }, z.prototype._emitAddModelListItem = function(t) { this.emit("addModelListItem", t) }, z.prototype._emitDeletePutModelSuccess = function(t) { this.emit("deletePutModelSuccess", t) }, z.prototype._emitHidePutModelInfoPanel = function() { this.emit("hidePutModelInfoPanel") }, z.prototype._emitShowLoaddingOfLoadPutModel = function() { this.emit("showLoaddingOfLoadPutModel") }, z.prototype._emitHideLoaddingOfLoadPutModel = function() { this.emit("hideLoaddingOfLoadPutModel") }, z.prototype._emitPutModelListLoadingIsOver = function() { this.emit("putModelListLoadingIsOver") }, z.prototype._emitResetPutModelInfo = function(t) { this.emit("resetPutModelInfo", t) }, z.prototype._emitSetPutModelToolsPosition = function(t) { this.emit("setPutModelToolsPosition", t) }, z.prototype._emitShowPutModelSetTools = function(t) { this.emit("showPutModelSetTools", t) }, z.prototype._emitViewModeTransitioning = function() { this.emit("viewModeTransitioning") }, z.prototype._emitViewModePanorama = function() { this.emit("viewModePanorama") }, z.prototype._emitHidePutModelSetTools = function() { this.emit("hidePutModelSetTools") }, z.prototype._emitShowModelListPanel = function() { this.emit("showModelListPanel") }, z.prototype._emitHideModelListPanel = function() { this.emit("hideModelListPanel") }, z.prototype._emitChoosedPostil = function(t) { this.emit("choosed-postil", t) }, z.prototype._emitAddPostilItem = function(t) { this.emit("add-postil-item", t) }, z.prototype._emitUpdatePostilUI = function(t) { this.emit("update-postil-ui", t) }, z.prototype._emitHidePostilSetTool = function() { this.emit("hide-postil-set-tool") }, z.prototype._emitShowDeleteDialogOfPostil = function(t) { this.emit("show-delete-dialog-of-postil", t) }, z.prototype._emitDeletePostilSuccess = function(t) { this.emit("delete-postil-success", t) }, z.prototype._emitShowEditPanelOfPostil = function() { this.emit("show-edit-panel-of-postil") }, z.prototype._emitShowAllPostils = function(t) { this.emit("show-all-postils", t) }, z.prototype._emitHideAllPostils = function(t) { this.emit("hide-all-postils", t) }, z.prototype._emitEditConfirm = function(t) { this.emit("edit-confirm", t) }, z.prototype._emitEditProbeModel = function(t) { this.emit("edit-probe-model", t) }, z.prototype._emitPutProbeModelComplete = function(t) { this.emit("putProbeModelComplete", t) }, z.prototype._emitGetMeasurementInfo = function(t) { this.emit("get-measurement-info", t) }, z.prototype._emitAddHumanLabel = function(t) { this.emit("add-human-label", t) }, z.prototype._emitChoosedVirtualCamera = function(t) { this.emit("choosed-virtual-camera", t) }, z.prototype._emitHideAllHumanLabel = function() { this.emit("hide-all-human-label") }, z.prototype._emitAddVirtualCameraLabel = function(t) { this.emit("add-virtual-camera-label", t) }, z.prototype._emitHideAllVirtualCameraLabel = function() { this.emit("hide-all-virtual-camera-label") }, z.prototype._emitShowVirtualCameraInfo = function(t) { this.emit("show-virtual-camera-info", t) }, z.prototype._emitHideVirtualCameraInfo = function() { this.emit("hide-virtual-camera-info") }, z.prototype._emitHideRightTools = function() { this.emit("hide-right-tools") }, z.prototype._emitShowRightTools = function() { this.emit("show-right-tools") }, z.prototype._emitPutModelFollowMouse = function() { this.emit("put-model-follow-mouse") }, z.prototype._emitPutModelFollowMouseOver = function() { this.emit("put-model-follow-mouse-over") }, z.prototype._emitPutModelFollowMouseCancel = function() { this.emit("put-model-follow-mouse-cancel") }, z.prototype._emitQuitPutMode = function() { this.emit("quit-put-mode") }, z.prototype._emitViewModeDollhouse = function() { this.emit("view-mode-dollhouse") }, z.prototype._emitShowVirtualHumanInfo = function(t) { this.emit("show-virtual-human-info", t) }, z.prototype._emitHideVirtualHumanInfo = function() { this.emit("hide-virtual-human-info") }, z.prototype._emitHandleControlPanoramaMove = function() { this.emit("handle-control-panorama-move") }, z.prototype._emitHandleControlDollhouseMove = function() { this.emit("handle-control-dollhouse-move") }, z.prototype._emitUpdatePostilShow = function(t) { this.emit("update-postil-show", t) }, z.prototype._initEvent = function() { this.emit("init_UI", this.model), this.emit("load_progress", 100) }, z.prototype._emitLoadProgress = function(t) { this.emit("load_progress", t) }, z.prototype._emitExitMeasureActive = function() { this.emit("exitMeasureActive") }, z.prototype._emitUpateUiRoate = function(t) { this.emit("upateUiRoate", t) }, z.prototype._registryKeyEvent = function() { var t = this; c.isMobile() || (document.addEventListener("keydown", (function(e) { switch (e.which) { case Keys.ZERO: d.debug && t.model.toggleAlpha(); break; case Keys.ONE: t.player.model.has360Views && !t.player.isInMode(l.TRANSITIONING) ? t.player.isInMode(l.PANORAMA) && t.player.currentPano.isAligned() || (t.player.controls[l.PANORAMA].emit(E.InteractionKey), t.director.tourIsPlaying ? t.director.stopTour() : t.player.goToLastView(!0)) : t.player.isInMode(l.PANORAMA, l.TRANSITIONING) || t.director.changeMode(l.PANORAMA, "key"); break; case Keys.TWO: t.model.outsideAllowed() && !t.player.isInMode(l.DOLLHOUSE, l.TRANSITIONING) && t.director.changeMode(l.DOLLHOUSE, "key"); break; case Keys.THREE: t.model.outsideAllowed() && !t.player.isInMode(l.FLOORPLAN, l.TRANSITIONING) && t.director.changeMode(l.FLOORPLAN, "key"); break; case Keys.FOUR: t.player.model.has360Views && !t.player.isInMode(l.TRANSITIONING) && (t.player.isInMode(l.PANORAMA) && !t.player.currentPano.isAligned() || (t.player.controls[l.PANORAMA].emit(E.InteractionKey), t.director.tourIsPlaying ? t.director.stopTour() : t.player.goToLastView(!1))); break; case Keys.SPACE: d.debug && t.model.toggleExplode(); break; case Keys.RETURN: d.debug && t.model.toggleExplodeUp(); break; case Keys.PLUSEQUALS: t.director.player.activatePersistentZooming(!0); break; case Keys.DASHUNDERSCORE: t.director.player.activatePersistentZooming(!1); break; case Keys.EIGHT: t.director.player.decreaseZoomSpeed(); break; case Keys.NINE: t.director.player.increaseZoomSpeed() } return t.player && t.player.reticule.hide(), !0 })), document.addEventListener("keyup", (function(e) { switch (e.which) { case Keys.PLUSEQUALS: t.director.player.deactivatePersistentZooming(); break; case Keys.DASHUNDERSCORE: t.director.player.deactivatePersistentZooming() } }))) }, z.prototype.registryOri = function() { G.ori = {}, c.isMobile() ? G.ori.flag = !0 : G.ori.flag = !1, G.ori.isHuawei5X = c.detectHUAWEI5X(), G.ori.gamma = -1e3, G.ori.beta = -1e3, G.ori.alpha = -1e3, G.ori.enable = !0, G.ori.orient = n.Math.degToRad(window.orientation || 0), G.orientationHandler = function(t) { t.gamma || t.beta || (t.gamma = t.x * (180 / Math.PI), t.beta = t.y * (180 / Math.PI), t.alpha = t.z * (180 / Math.PI)); var e = t.gamma, i = t.beta, n = t.alpha; t.accelerationIncludingGravity && (e = 10 * event.accelerationIncludingGravity.x, i = 10 * -event.accelerationIncludingGravity.y, n = 10 * event.accelerationIncludingGravity.z), G.ori.gamma = e, G.ori.beta = i, G.ori.alpha = n }, G.HorientationChange = function() { G.ori.orient = n.Math.degToRad(window.orientation || 0) }, G.HdeviceOrientation = function(t) { var e = n.Math.degToRad(t.alpha), i = n.Math.degToRad(t.beta), r = n.Math.degToRad(t.gamma); G.ori.isHuawei5X ? (-1e3 == G.ori.alpha && (G.ori.alpha = e), -1e3 == G.ori.beta && (G.ori.beta = i), -1e3 == G.ori.gamma && (G.ori.gamma = r), Math.abs(e - G.ori.alpha) > .06 && (G.ori.alpha = e), Math.abs(i - G.ori.beta) > .006 && (G.ori.beta = i), Math.abs(r - G.ori.gamma) > .006 && (G.ori.gamma = r)) : (G.ori.alpha = e, G.ori.beta = i, G.ori.gamma = r) }, window.addEventListener("orientationchange", G.HorientationChange), window.addEventListener("deviceorientation", G.HdeviceOrientation) }, z.prototype.getModelScreenSize = function() { function t(t, e) { var i = (window.renderWidth || window.innerWidth) / 2, r = (window.renderHeight || window.innerHeight) / 2, o = t.project(e), a = Math.round(o.x * i + i), s = Math.round(-o.y * r + r); return new n.Vector2(a, s) } var e = this.model.boundingBox, i = this.player.camera, r = new n.Vector3(e.max.x, 0, e.max.z), o = new n.Vector3(e.min.x, 0, e.min.z), a = new n.Vector3(e.max.x, 0, e.min.z), s = new n.Vector3(e.min.x, 0, e.max.z), l = t(r, i), u = t(o, i), h = t(a, i), c = t(s, i), d = Math.max(l.x, u.x, h.x, c.x), p = Math.min(l.x, u.x, h.x, c.x), f = Math.max(l.y, u.y, h.y, c.y), m = Math.min(l.y, u.y, h.y, c.y); return { width: d - p, height: f - m, top: m, left: p } }, z.prototype.getFloorPlanParam = function() { var t = this.getModelScreenSize(), e = { model: this.model, project: t, floorIndex: this.model.currentFloor.floorIndex }; return this.player.currentPano && this.player.currentPano.u && (e.radar = { uv: { u: this.player.currentPano.u, v: this.player.currentPano.v }, angle: this.lastCompassAngle }), e }, z.prototype.loadHumanModel = function(t) { this.player.loadHumanModel(t) }, z.prototype.loadProbeModel = function() { this.player.loadProbeModel(1) }, z.prototype.selectPutModel = function(t) { this.player.selectPutModel(t) }, z.prototype.updatePutModelColor = function(t) { this.player.updatePutModelColor(t) }, z.prototype.showPutModel = function(t) { this.player.showPutModel(t) }, z.prototype.hidePutModel = function(t) { this.player.hidePutModel(t) }, z.prototype.handleClickCompleteBtn = function() { this.player.handleClickCompleteBtn() }, z.prototype.removePutModel = function(t) { this.player.removePutModel(t) }, z.prototype.getSettingsDataOfPutModel = function() { return JSON.stringify(this.player.SETTINGS_DATA_PUT) }, z.prototype.updateCollision = function(t) { this.player.updateCollision(t) }, z.prototype.loadModelList = function(t, e) { this.player.showModelList(t, e) }, z.prototype.showModelList = function(t) { this.player.showModelList(t) }, z.prototype.hideModelList = function() { this.player.hideModelList() }, z.prototype.updatePutModelName = function(t) { this.player.updatePutModelName(t) }, z.prototype.resetPutModel = function() { this.player.resetPutModel() }, z.prototype.updateSizeOfPutModel = function(t) { this.player.updateSizeOfPutModel(t) }, z.prototype.updatePutModelGroundClearance = function(t) { this.player.updatePutModelGroundClearance(t) }, z.prototype.updateControlOfPutModel = function(t) { this.player.updateControlOfPutModel(t) }, z.prototype.showHumanModelBonesNode = function() { this.player.showHumanModelBonesNode() }, z.prototype.bundleTranslateControlOfPutModel = function() { this.player.bundleTranslateControlOfPutModel() }, z.prototype.bundleRotateControlOfPutModel = function() { this.player.bundleRotateControlOfPutModel() }, z.prototype.virtualSetSlideStop = function(t) { this.player.virtualSetSlideStop(t) }, z.prototype.handleClickModelItem = function(t) { this.player.handleClickModelItem(t) }, z.prototype.onIntoPutMode = function() { this.player.onIntoPutMode() }, z.prototype.onQuitPutMode = function() { this.player.onQuitPutMode() }, z.prototype.onApiQuitPutMode = function() { this.player.onApiQuitPutMode() }, z.prototype.onIntoEditMode = function() { this.player.onIntoEditMode() }, z.prototype.onQuitEditMode = function() { this.player.onQuitEditMode() }, z.prototype.onQuitEditMeasure = function() { this.player.onQuitEditMeasure() }, z.prototype.onIntoEditMeasure = function() { this.player.onIntoEditMeasure() }, z.prototype.loadPostilModel = function(t) { this.player.loadPostilModel(t) }, z.prototype.updatePostilInfo = function(t) { this.player.updatePostilInfo(t) }, z.prototype.loadPostilsOfSave = function(t) { this.player.loadPostilsOfSave(t) }, z.prototype.handleDeletePostil = function(t) { this.player.removePostil(t) }, z.prototype.deletePostilOfConfirm = function(t) { this.player.deletePostilOfConfirm(t) }, z.prototype.hidePostilsOfSave = function() { this.player.hidePostilsOfSave() }, z.prototype.loadCameraModel = function(t) { this.player.loadVirtualCamera(t) }, z.prototype.updateCameraFov = function(t) { this.player.updateVirtualCameraFov(t) }, z.prototype.updateCameraDistance = function(t) { this.player.updateVirtualCameraDistance(t) }, z.prototype.updateMiniCameraPosition = function(t) { this.player.updateMiniCameraPosition(t) }, z.prototype.miniCameraScreenShot = function(t) { this.player.miniCameraScreenShot(t) }, z.prototype.changeMode = function(t) { if (!1 === this.model.data.player_options.show3d) return !1; "floorplan" === t && (this.lastCompassAngle = this.angle), this.director.changeMode(t) }, z.prototype.play = function(t) { if (this.disablePanramaSize(), "Lecture" === this.playType) this.record.pplay(t); else if (this.settings.nestscenes && this.settings.nestscenes.scenes && this.settings.nestscenes.scenes.length > 0) { var e = 0; this.model.enableTagMovie && (e = 1), G.playing = !0, this.director.currentScript = e, this.director.playTour() } }, z.prototype.pause = function() { "Lecture" === this.playType ? this.record.ppause() : this.settings.nestscenes && this.settings.nestscenes.scenes && this.settings.nestscenes.scenes.length > 0 && (this.director.stopTour(), G.playing = !1) }, z.prototype.enterVR = function() { return "panorama" === this.player.mode && (!!c.isMobile() && (this.sceneRenderer.vrEnabled = !0, G.ori.flag = !0, !0)) }, z.prototype.exitVR = function() { this.sceneRenderer.vrEnabled = !1, G.ori.flag = !1 }, z.prototype.gotoFloor = function(t) { "all" === t ? this.director.allFloors() : this.director.gotoFloor(t) }, z.prototype.mute = function() { L.setMute(!0) }, z.prototype.unmute = function() { L.setMute(!1) }, z.prototype.disableTag = function() { this.player.mattertagManager.showtitletags = !1, this.player.mattertagManager.updatetitletags(), this.player.mattertagManager.hideAllMattertags(10, 10) }, z.prototype.enableTag = function() { this.player.mattertagManager.showtitletags = !0, this.player.mattertagManager.updatetitletags(), this.player.mattertagManager.showAllMattertags(10, 10) }, z.prototype.warpToPanoByTagId = function(t) { var e = t.tagId, i = t.openTag, r = this, o = this.player.model.getTagByTagid(e), a = this.player.model.panos.index[o.data.locationid]; if (e) { var s = o.position.clone(), l = new n.Matrix4; l.lookAt(a.position, s, new n.Vector3(0, 0, -1)), a.quaternion = (new n.Quaternion) .setFromRotationMatrix(l) } var u = null; i && (u = function() { r.openTag(o) }), this.player.warpToPanoById(o.data.locationid, a.quaternion, null, null, "black", 1, 500, u) }, z.prototype.openTag = function(t) { var e = this; setTimeout((function() { e.player.mattertagManager.openTag(t) }), 1e3) }, z.prototype.disablePanramaSize = function() { this.panoramaSize.setEnable(!1) }, z.prototype.enablePanramaSize = function() { this.panoramaSize.setEnable(!0), this.panoramaSize.update(this.player) }, z.prototype.initMeasure = function() { this.player.initMeasure() }, z.prototype.enableMeasure = function(t) { this.player.setMeasureEnable(t) }, z.prototype.manipulateMeasure = function(t, e, i) { switch (t) { case "show": this.player.showMeasure(e); break; case "hide": this.player.hideMeasure(e); break; case "showAll": this.player.showAllMeasure(); break; case "hideAll": this.player.hideAllMeasure(); break; case "delete": this.player.deleteMeasure(e); break; case "changeName": this.player.changeMeasureName(e, i); break; case "changeUnit": this.player.changeUnit(e); break; case "clicked": this.player.clickedOnMeasure(e); break; case "disClicked": this.player.disOnMeasure(e); break; case "setAutoFit": this.player.setAutoFit(e); break; case "setMeasureArea": this.player.setMeasureArea(e) } }, z.prototype.gotoScenebyId = function(t) { this.director.goToHighlight(t) }, z.prototype.getCurrentState = function() { return { panoSize: this.panoramaSize.enable } }, z.prototype.setPlaySpeed = function(t) { var e = ""; switch (t) { case 1: e = "0.3x"; break; case 2: e = "0.5x"; break; case 3: e = "1.0x"; break; case 4: e = "1.5x"; break; case 5: e = "2.0x"; break; default: e = "1.0x" } this.player.setSpeedMultiplier(e) }, z.prototype.screenshot = function(t) { var e = this, i = this.player.reticule; i.hidden = !0, i.material.uniforms.opacity.value = 0, this.model.panos.list.forEach((function(t) { t.marker && (t.marker.material.opacity = 0) })), setTimeout((function() { var i = document.getElementsByTagName("canvas")[0], n = document.createElement("canvas"); n.width = i.width, n.height = i.height; var r = n.getContext("2d"); r.drawImage(i, 0, 0, i.width, i.height), r.scale(.5, .5), t({ img: n.toDataURL("image/png"), location: e.player.currentPano.id, position: { x: e.player.camera.quaternion.x, y: e.player.camera.quaternion.y, z: e.player.camera.quaternion.z, w: e.player.camera.quaternion.w } }), e.model.panos.list.forEach((function(t) { t.marker && (t.marker.material.opacity = 1) })) }), 1e3) }, z.prototype.gotoScene = function(t) { var e = {}, i = t.position, r = t.location, o = this.model.panos.index[r]; e.pano = o; var a = new n.Vector3(0, 0, -1); a.applyQuaternion(i), a.add(o.position), e.lookAtPoint = a, this.player.flyToPano(e) }, z.prototype.addModel = function(t) { this.player.addModel(t) }, z.prototype.setModelPose = function(t) { this.player.addModel(t) }, t.exports = z }) .call(this, i(6)) }, function(t, e, i) { ! function(t) { "use strict"; function e(t) { return "0123456789abcdefghijklmnopqrstuvwxyz".charAt(t) } function i(t, e) { return t & e } function n(t, e) { return t | e } function r(t, e) { return t ^ e } function o(t, e) { return t & ~e } function a(t) { if (0 == t) return -1; var e = 0; return 0 == (65535 & t) && (t >>= 16, e += 16), 0 == (255 & t) && (t >>= 8, e += 8), 0 == (15 & t) && (t >>= 4, e += 4), 0 == (3 & t) && (t >>= 2, e += 2), 0 == (1 & t) && ++e, e } function s(t) { for (var e = 0; 0 != t;) t &= t - 1, ++e; return e } var l = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; function u(t) { var e, i, n = ""; for (e = 0; e + 3 <= t.length; e += 3) i = parseInt(t.substring(e, e + 3), 16), n += l.charAt(i >> 6) + l.charAt(63 & i); for (e + 1 == t.length ? (i = parseInt(t.substring(e, e + 1), 16), n += l.charAt(i << 2)) : e + 2 == t.length && (i = parseInt(t.substring(e, e + 2), 16), n += l.charAt(i >> 2) + l.charAt((3 & i) << 4)); (3 & n.length) > 0;) n += "="; return n } function h(t) { var i, n = "", r = 0, o = 0; for (i = 0; i < t.length && "=" != t.charAt(i); ++i) { var a = l.indexOf(t.charAt(i)); a < 0 || (0 == r ? (n += e(a >> 2), o = 3 & a, r = 1) : 1 == r ? (n += e(o << 2 | a >> 4), o = 15 & a, r = 2) : 2 == r ? (n += e(o), n += e(a >> 2), o = 3 & a, r = 3) : (n += e(o << 2 | a >> 4), n += e(15 & a), r = 0)) } return 1 == r && (n += e(o << 2)), n } var c, d, p = function(t, e) { return (p = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, e) { t.__proto__ = e } || function(t, e) { for (var i in e) e.hasOwnProperty(i) && (t[i] = e[i]) })(t, e) }, f = function(t) { var e; if (void 0 === c) { var i = "0123456789ABCDEF"; for (c = {}, e = 0; e < 16; ++e) c[i.charAt(e)] = e; for (i = i.toLowerCase(), e = 10; e < 16; ++e) c[i.charAt(e)] = e; for (e = 0; e < " \f\n\r\t \u2028\u2029".length; ++e) c[" \f\n\r\t \u2028\u2029".charAt(e)] = -1 } var n = [], r = 0, o = 0; for (e = 0; e < t.length; ++e) { var a = t.charAt(e); if ("=" == a) break; if (-1 != (a = c[a])) { if (void 0 === a) throw new Error("Illegal character at offset " + e); r |= a, ++o >= 2 ? (n[n.length] = r, r = 0, o = 0) : r <<= 4 } } if (o) throw new Error("Hex encoding incomplete: 4 bits missing"); return n }, m = { decode: function(t) { var e; if (void 0 === d) { for (d = Object.create(null), e = 0; e < 64; ++e) d["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e)] = e; for (e = 0; e < "= \f\n\r\t \u2028\u2029".length; ++e) d["= \f\n\r\t \u2028\u2029".charAt(e)] = -1 } var i = [], n = 0, r = 0; for (e = 0; e < t.length; ++e) { var o = t.charAt(e); if ("=" == o) break; if (-1 != (o = d[o])) { if (void 0 === o) throw new Error("Illegal character at offset " + e); n |= o, ++r >= 4 ? (i[i.length] = n >> 16, i[i.length] = n >> 8 & 255, i[i.length] = 255 & n, n = 0, r = 0) : n <<= 6 } } switch (r) { case 1: throw new Error("Base64 encoding incomplete: at least 2 bits missing"); case 2: i[i.length] = n >> 10; break; case 3: i[i.length] = n >> 16, i[i.length] = n >> 8 & 255 } return i }, re: /-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/, unarmor: function(t) { var e = m.re.exec(t); if (e) if (e[1]) t = e[1]; else { if (!e[2]) throw new Error("RegExp out of sync"); t = e[2] } return m.decode(t) } }, g = 1e13, v = function() { function t(t) { this.buf = [+t || 0] } return t.prototype.mulAdd = function(t, e) { var i, n, r = this.buf, o = r.length; for (i = 0; i < o; ++i)(n = r[i] * t + e) < g ? e = 0 : n -= (e = 0 | n / g) * g, r[i] = n; e > 0 && (r[i] = e) }, t.prototype.sub = function(t) { var e, i, n = this.buf, r = n.length; for (e = 0; e < r; ++e)(i = n[e] - t) < 0 ? (i += g, t = 1) : t = 0, n[e] = i; for (; 0 === n[n.length - 1];) n.pop() }, t.prototype.toString = function(t) { if (10 != (t || 10)) throw new Error("only base 10 is supported"); for (var e = this.buf, i = e[e.length - 1].toString(), n = e.length - 2; n >= 0; --n) i += (g + e[n]) .toString() .substring(1); return i }, t.prototype.valueOf = function() { for (var t = this.buf, e = 0, i = t.length - 1; i >= 0; --i) e = e * g + t[i]; return e }, t.prototype.simplify = function() { var t = this.buf; return 1 == t.length ? t[0] : this }, t }(), y = /^(\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/, b = /^(\d\d\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/; function w(t, e) { return t.length > e && (t = t.substring(0, e) + "…"), t } var x, M = function() { function t(e, i) { this.hexDigits = "0123456789ABCDEF", e instanceof t ? (this.enc = e.enc, this.pos = e.pos) : (this.enc = e, this.pos = i) } return t.prototype.get = function(t) { if (void 0 === t && (t = this.pos++), t >= this.enc.length) throw new Error("Requesting byte offset " + t + " on a stream of length " + this.enc.length); return "string" == typeof this.enc ? this.enc.charCodeAt(t) : this.enc[t] }, t.prototype.hexByte = function(t) { return this.hexDigits.charAt(t >> 4 & 15) + this.hexDigits.charAt(15 & t) }, t.prototype.hexDump = function(t, e, i) { for (var n = "", r = t; r < e; ++r) if (n += this.hexByte(this.get(r)), !0 !== i) switch (15 & r) { case 7: n += " "; break; case 15: n += "\n"; break; default: n += " " } return n }, t.prototype.isASCII = function(t, e) { for (var i = t; i < e; ++i) { var n = this.get(i); if (n < 32 || n > 176) return !1 } return !0 }, t.prototype.parseStringISO = function(t, e) { for (var i = "", n = t; n < e; ++n) i += String.fromCharCode(this.get(n)); return i }, t.prototype.parseStringUTF = function(t, e) { for (var i = "", n = t; n < e;) { var r = this.get(n++); i += r < 128 ? String.fromCharCode(r) : r > 191 && r < 224 ? String.fromCharCode((31 & r) << 6 | 63 & this.get(n++)) : String.fromCharCode((15 & r) << 12 | (63 & this.get(n++)) << 6 | 63 & this.get(n++)) } return i }, t.prototype.parseStringBMP = function(t, e) { for (var i, n, r = "", o = t; o < e;) i = this.get(o++), n = this.get(o++), r += String.fromCharCode(i << 8 | n); return r }, t.prototype.parseTime = function(t, e, i) { var n = this.parseStringISO(t, e), r = (i ? y : b) .exec(n); return r ? (i && (r[1] = +r[1], r[1] += +r[1] < 70 ? 2e3 : 1900), n = r[1] + "-" + r[2] + "-" + r[3] + " " + r[4], r[5] && (n += ":" + r[5], r[6] && (n += ":" + r[6], r[7] && (n += "." + r[7]))), r[8] && (n += " UTC", "Z" != r[8] && (n += r[8], r[9] && (n += ":" + r[9]))), n) : "Unrecognized time: " + n }, t.prototype.parseInteger = function(t, e) { for (var i, n = this.get(t), r = n > 127, o = r ? 255 : 0, a = ""; n == o && ++t < e;) n = this.get(t); if (0 == (i = e - t)) return r ? -1 : 0; if (i > 4) { for (a = n, i <<= 3; 0 == (128 & (+a ^ o));) a = +a << 1, --i; a = "(" + i + " bit)\n" } r && (n -= 256); for (var s = new v(n), l = t + 1; l < e; ++l) s.mulAdd(256, this.get(l)); return a + s.toString() }, t.prototype.parseBitString = function(t, e, i) { for (var n = this.get(t), r = "(" + ((e - t - 1 << 3) - n) + " bit)\n", o = "", a = t + 1; a < e; ++a) { for (var s = this.get(a), l = a == e - 1 ? n : 0, u = 7; u >= l; --u) o += s >> u & 1 ? "1" : "0"; if (o.length > i) return r + w(o, i) } return r + o }, t.prototype.parseOctetString = function(t, e, i) { if (this.isASCII(t, e)) return w(this.parseStringISO(t, e), i); var n = e - t, r = "(" + n + " byte)\n"; n > (i /= 2) && (e = t + i); for (var o = t; o < e; ++o) r += this.hexByte(this.get(o)); return n > i && (r += "…"), r }, t.prototype.parseOID = function(t, e, i) { for (var n = "", r = new v, o = 0, a = t; a < e; ++a) { var s = this.get(a); if (r.mulAdd(128, 127 & s), o += 7, !(128 & s)) { if ("" === n) if ((r = r.simplify()) instanceof v) r.sub(80), n = "2." + r.toString(); else { var l = r < 80 ? r < 40 ? 0 : 1 : 2; n = l + "." + (r - 40 * l) } else n += "." + r.toString(); if (n.length > i) return w(n, i); r = new v, o = 0 } } return o > 0 && (n += ".incomplete"), n }, t }(), T = function() { function t(t, e, i, n, r) { if (!(n instanceof S)) throw new Error("Invalid tag value."); this.stream = t, this.header = e, this.length = i, this.tag = n, this.sub = r } return t.prototype.typeName = function() { switch (this.tag.tagClass) { case 0: switch (this.tag.tagNumber) { case 0: return "EOC"; case 1: return "BOOLEAN"; case 2: return "INTEGER"; case 3: return "BIT_STRING"; case 4: return "OCTET_STRING"; case 5: return "NULL"; case 6: return "OBJECT_IDENTIFIER"; case 7: return "ObjectDescriptor"; case 8: return "EXTERNAL"; case 9: return "REAL"; case 10: return "ENUMERATED"; case 11: return "EMBEDDED_PDV"; case 12: return "UTF8String"; case 16: return "SEQUENCE"; case 17: return "SET"; case 18: return "NumericString"; case 19: return "PrintableString"; case 20: return "TeletexString"; case 21: return "VideotexString"; case 22: return "IA5String"; case 23: return "UTCTime"; case 24: return "GeneralizedTime"; case 25: return "GraphicString"; case 26: return "VisibleString"; case 27: return "GeneralString"; case 28: return "UniversalString"; case 30: return "BMPString" } return "Universal_" + this.tag.tagNumber.toString(); case 1: return "Application_" + this.tag.tagNumber.toString(); case 2: return "[" + this.tag.tagNumber.toString() + "]"; case 3: return "Private_" + this.tag.tagNumber.toString() } }, t.prototype.content = function(t) { if (void 0 === this.tag) return null; void 0 === t && (t = 1 / 0); var e = this.posContent(), i = Math.abs(this.length); if (!this.tag.isUniversal()) return null !== this.sub ? "(" + this.sub.length + " elem)" : this.stream.parseOctetString(e, e + i, t); switch (this.tag.tagNumber) { case 1: return 0 === this.stream.get(e) ? "false" : "true"; case 2: return this.stream.parseInteger(e, e + i); case 3: return this.sub ? "(" + this.sub.length + " elem)" : this.stream.parseBitString(e, e + i, t); case 4: return this.sub ? "(" + this.sub.length + " elem)" : this.stream.parseOctetString(e, e + i, t); case 6: return this.stream.parseOID(e, e + i, t); case 16: case 17: return null !== this.sub ? "(" + this.sub.length + " elem)" : "(no elem)"; case 12: return w(this.stream.parseStringUTF(e, e + i), t); case 18: case 19: case 20: case 21: case 22: case 26: return w(this.stream.parseStringISO(e, e + i), t); case 30: return w(this.stream.parseStringBMP(e, e + i), t); case 23: case 24: return this.stream.parseTime(e, e + i, 23 == this.tag.tagNumber) } return null }, t.prototype.toString = function() { return this.typeName() + "@" + this.stream.pos + "[header:" + this.header + ",length:" + this.length + ",sub:" + (null === this.sub ? "null" : this.sub.length) + "]" }, t.prototype.toPrettyString = function(t) { void 0 === t && (t = ""); var e = t + this.typeName() + " @" + this.stream.pos; if (this.length >= 0 && (e += "+"), e += this.length, this.tag.tagConstructed ? e += " (constructed)" : !this.tag.isUniversal() || 3 != this.tag.tagNumber && 4 != this.tag.tagNumber || null === this.sub || (e += " (encapsulates)"), e += "\n", null !== this.sub) { t += " "; for (var i = 0, n = this.sub.length; i < n; ++i) e += this.sub[i].toPrettyString(t) } return e }, t.prototype.posStart = function() { return this.stream.pos }, t.prototype.posContent = function() { return this.stream.pos + this.header }, t.prototype.posEnd = function() { return this.stream.pos + this.header + Math.abs(this.length) }, t.prototype.toHexString = function() { return this.stream.hexDump(this.posStart(), this.posEnd(), !0) }, t.decodeLength = function(t) { var e = t.get(), i = 127 & e; if (i == e) return i; if (i > 6) throw new Error("Length over 48 bits not supported at position " + (t.pos - 1)); if (0 === i) return null; e = 0; for (var n = 0; n < i; ++n) e = 256 * e + t.get(); return e }, t.prototype.getHexStringValue = function() { var t = this.toHexString(), e = 2 * this.header, i = 2 * this.length; return t.substr(e, i) }, t.decode = function(e) { var i; i = e instanceof M ? e : new M(e, 0); var n = new M(i), r = new S(i), o = t.decodeLength(i), a = i.pos, s = a - n.pos, l = null, u = function() { var e = []; if (null !== o) { for (var n = a + o; i.pos < n;) e[e.length] = t.decode(i); if (i.pos != n) throw new Error("Content size is not correct for container starting at offset " + a) } else try { for (;;) { var r = t.decode(i); if (r.tag.isEOC()) break; e[e.length] = r } o = a - i.pos } catch (t) { throw new Error("Exception while decoding undefined length content: " + t) } return e }; if (r.tagConstructed) l = u(); else if (r.isUniversal() && (3 == r.tagNumber || 4 == r.tagNumber)) try { if (3 == r.tagNumber && 0 != i.get()) throw new Error("BIT STRINGs with unused bits cannot encapsulate."); l = u(); for (var h = 0; h < l.length; ++h) if (l[h].tag.isEOC()) throw new Error("EOC is not supposed to be actual content.") } catch (t) { l = null } if (null === l) { if (null === o) throw new Error("We can't skip over an invalid tag with undefined length at offset " + a); i.pos = a + Math.abs(o) } return new t(n, s, o, r, l) }, t }(), S = function() { function t(t) { var e = t.get(); if (this.tagClass = e >> 6, this.tagConstructed = 0 != (32 & e), this.tagNumber = 31 & e, 31 == this.tagNumber) { var i = new v; do { e = t.get(), i.mulAdd(128, 127 & e) } while (128 & e); this.tagNumber = i.simplify() } } return t.prototype.isUniversal = function() { return 0 === this.tagClass }, t.prototype.isEOC = function() { return 0 === this.tagClass && 0 === this.tagNumber }, t }(), _ = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997], A = (1 << 26) / _[_.length - 1], P = function() { function t(t, e, i) { null != t && ("number" == typeof t ? this.fromNumber(t, e, i) : null == e && "string" != typeof t ? this.fromString(t, 256) : this.fromString(t, e)) } return t.prototype.toString = function(t) { if (this.s < 0) return "-" + this.negate() .toString(t); var i; if (16 == t) i = 4; else if (8 == t) i = 3; else if (2 == t) i = 1; else if (32 == t) i = 5; else { if (4 != t) return this.toRadix(t); i = 2 } var n, r = (1 << i) - 1, o = !1, a = "", s = this.t, l = this.DB - s * this.DB % i; if (s-- > 0) for (l < this.DB && (n = this[s] >> l) > 0 && (o = !0, a = e(n)); s >= 0;) l < i ? (n = (this[s] & (1 << l) - 1) << i - l, n |= this[--s] >> (l += this.DB - i)) : (n = this[s] >> (l -= i) & r, l <= 0 && (l += this.DB, --s)), n > 0 && (o = !0), o && (a += e(n)); return o ? a : "0" }, t.prototype.negate = function() { var e = O(); return t.ZERO.subTo(this, e), e }, t.prototype.abs = function() { return this.s < 0 ? this.negate() : this }, t.prototype.compareTo = function(t) { var e = this.s - t.s; if (0 != e) return e; var i = this.t; if (0 != (e = i - t.t)) return this.s < 0 ? -e : e; for (; --i >= 0;) if (0 != (e = this[i] - t[i])) return e; return 0 }, t.prototype.bitLength = function() { return this.t <= 0 ? 0 : this.DB * (this.t - 1) + z(this[this.t - 1] ^ this.s & this.DM) }, t.prototype.mod = function(e) { var i = O(); return this.abs() .divRemTo(e, null, i), this.s < 0 && i.compareTo(t.ZERO) > 0 && e.subTo(i, i), i }, t.prototype.modPowInt = function(t, e) { var i; return i = t < 256 || e.isEven() ? new E(e) : new D(e), this.exp(t, i) }, t.prototype.clone = function() { var t = O(); return this.copyTo(t), t }, t.prototype.intValue = function() { if (this.s < 0) { if (1 == this.t) return this[0] - this.DV; if (0 == this.t) return -1 } else { if (1 == this.t) return this[0]; if (0 == this.t) return 0 } return (this[1] & (1 << 32 - this.DB) - 1) << this.DB | this[0] }, t.prototype.byteValue = function() { return 0 == this.t ? this.s : this[0] << 24 >> 24 }, t.prototype.shortValue = function() { return 0 == this.t ? this.s : this[0] << 16 >> 16 }, t.prototype.signum = function() { return this.s < 0 ? -1 : this.t <= 0 || 1 == this.t && this[0] <= 0 ? 0 : 1 }, t.prototype.toByteArray = function() { var t = this.t, e = []; e[0] = this.s; var i, n = this.DB - t * this.DB % 8, r = 0; if (t-- > 0) for (n < this.DB && (i = this[t] >> n) != (this.s & this.DM) >> n && (e[r++] = i | this.s << this.DB - n); t >= 0;) n < 8 ? (i = (this[t] & (1 << n) - 1) << 8 - n, i |= this[--t] >> (n += this.DB - 8)) : (i = this[t] >> (n -= 8) & 255, n <= 0 && (n += this.DB, --t)), 0 != (128 & i) && (i |= -256), 0 == r && (128 & this.s) != (128 & i) && ++r, (r > 0 || i != this.s) && (e[r++] = i); return e }, t.prototype.equals = function(t) { return 0 == this.compareTo(t) }, t.prototype.min = function(t) { return this.compareTo(t) < 0 ? this : t }, t.prototype.max = function(t) { return this.compareTo(t) > 0 ? this : t }, t.prototype.and = function(t) { var e = O(); return this.bitwiseTo(t, i, e), e }, t.prototype.or = function(t) { var e = O(); return this.bitwiseTo(t, n, e), e }, t.prototype.xor = function(t) { var e = O(); return this.bitwiseTo(t, r, e), e }, t.prototype.andNot = function(t) { var e = O(); return this.bitwiseTo(t, o, e), e }, t.prototype.not = function() { for (var t = O(), e = 0; e < this.t; ++e) t[e] = this.DM & ~this[e]; return t.t = this.t, t.s = ~this.s, t }, t.prototype.shiftLeft = function(t) { var e = O(); return t < 0 ? this.rShiftTo(-t, e) : this.lShiftTo(t, e), e }, t.prototype.shiftRight = function(t) { var e = O(); return t < 0 ? this.lShiftTo(-t, e) : this.rShiftTo(t, e), e }, t.prototype.getLowestSetBit = function() { for (var t = 0; t < this.t; ++t) if (0 != this[t]) return t * this.DB + a(this[t]); return this.s < 0 ? this.t * this.DB : -1 }, t.prototype.bitCount = function() { for (var t = 0, e = this.s & this.DM, i = 0; i < this.t; ++i) t += s(this[i] ^ e); return t }, t.prototype.testBit = function(t) { var e = Math.floor(t / this.DB); return e >= this.t ? 0 != this.s : 0 != (this[e] & 1 << t % this.DB) }, t.prototype.setBit = function(t) { return this.changeBit(t, n) }, t.prototype.clearBit = function(t) { return this.changeBit(t, o) }, t.prototype.flipBit = function(t) { return this.changeBit(t, r) }, t.prototype.add = function(t) { var e = O(); return this.addTo(t, e), e }, t.prototype.subtract = function(t) { var e = O(); return this.subTo(t, e), e }, t.prototype.multiply = function(t) { var e = O(); return this.multiplyTo(t, e), e }, t.prototype.divide = function(t) { var e = O(); return this.divRemTo(t, e, null), e }, t.prototype.remainder = function(t) { var e = O(); return this.divRemTo(t, null, e), e }, t.prototype.divideAndRemainder = function(t) { var e = O(), i = O(); return this.divRemTo(t, e, i), [e, i] }, t.prototype.modPow = function(t, e) { var i, n, r = t.bitLength(), o = B(1); if (r <= 0) return o; i = r < 18 ? 1 : r < 48 ? 3 : r < 144 ? 4 : r < 768 ? 5 : 6, n = r < 8 ? new E(e) : e.isEven() ? new L(e) : new D(e); var a = [], s = 3, l = i - 1, u = (1 << i) - 1; if (a[1] = n.convert(this), i > 1) { var h = O(); for (n.sqrTo(a[1], h); s <= u;) a[s] = O(), n.mulTo(h, a[s - 2], a[s]), s += 2 } var c, d, p = t.t - 1, f = !0, m = O(); for (r = z(t[p]) - 1; p >= 0;) { for (r >= l ? c = t[p] >> r - l & u : (c = (t[p] & (1 << r + 1) - 1) << l - r, p > 0 && (c |= t[p - 1] >> this.DB + r - l)), s = i; 0 == (1 & c);) c >>= 1, --s; if ((r -= s) < 0 && (r += this.DB, --p), f) a[c].copyTo(o), f = !1; else { for (; s > 1;) n.sqrTo(o, m), n.sqrTo(m, o), s -= 2; s > 0 ? n.sqrTo(o, m) : (d = o, o = m, m = d), n.mulTo(m, a[c], o) } for (; p >= 0 && 0 == (t[p] & 1 << r);) n.sqrTo(o, m), d = o, o = m, m = d, --r < 0 && (r = this.DB - 1, --p) } return n.revert(o) }, t.prototype.modInverse = function(e) { var i = e.isEven(); if (this.isEven() && i || 0 == e.signum()) return t.ZERO; for (var n = e.clone(), r = this.clone(), o = B(1), a = B(0), s = B(0), l = B(1); 0 != n.signum();) { for (; n.isEven();) n.rShiftTo(1, n), i ? (o.isEven() && a.isEven() || (o.addTo(this, o), a.subTo(e, a)), o.rShiftTo(1, o)) : a.isEven() || a.subTo(e, a), a.rShiftTo(1, a); for (; r.isEven();) r.rShiftTo(1, r), i ? (s.isEven() && l.isEven() || (s.addTo(this, s), l.subTo(e, l)), s.rShiftTo(1, s)) : l.isEven() || l.subTo(e, l), l.rShiftTo(1, l); n.compareTo(r) >= 0 ? (n.subTo(r, n), i && o.subTo(s, o), a.subTo(l, a)) : (r.subTo(n, r), i && s.subTo(o, s), l.subTo(a, l)) } return 0 != r.compareTo(t.ONE) ? t.ZERO : l.compareTo(e) >= 0 ? l.subtract(e) : l.signum() < 0 ? (l.addTo(e, l), l.signum() < 0 ? l.add(e) : l) : l }, t.prototype.pow = function(t) { return this.exp(t, new C) }, t.prototype.gcd = function(t) { var e = this.s < 0 ? this.negate() : this.clone(), i = t.s < 0 ? t.negate() : t.clone(); if (e.compareTo(i) < 0) { var n = e; e = i, i = n } var r = e.getLowestSetBit(), o = i.getLowestSetBit(); if (o < 0) return e; for (r < o && (o = r), o > 0 && (e.rShiftTo(o, e), i.rShiftTo(o, i)); e.signum() > 0;)(r = e.getLowestSetBit()) > 0 && e.rShiftTo(r, e), (r = i.getLowestSetBit()) > 0 && i.rShiftTo(r, i), e.compareTo(i) >= 0 ? (e.subTo(i, e), e.rShiftTo(1, e)) : (i.subTo(e, i), i.rShiftTo(1, i)); return o > 0 && i.lShiftTo(o, i), i }, t.prototype.isProbablePrime = function(t) { var e, i = this.abs(); if (1 == i.t && i[0] <= _[_.length - 1]) { for (e = 0; e < _.length; ++e) if (i[0] == _[e]) return !0; return !1 } if (i.isEven()) return !1; for (e = 1; e < _.length;) { for (var n = _[e], r = e + 1; r < _.length && n < A;) n *= _[r++]; for (n = i.modInt(n); e < r;) if (n % _[e++] == 0) return !1 } return i.millerRabin(t) }, t.prototype.copyTo = function(t) { for (var e = this.t - 1; e >= 0; --e) t[e] = this[e]; t.t = this.t, t.s = this.s }, t.prototype.fromInt = function(t) { this.t = 1, this.s = t < 0 ? -1 : 0, t > 0 ? this[0] = t : t < -1 ? this[0] = t + this.DV : this.t = 0 }, t.prototype.fromString = function(e, i) { var n; if (16 == i) n = 4; else if (8 == i) n = 3; else if (256 == i) n = 8; else if (2 == i) n = 1; else if (32 == i) n = 5; else { if (4 != i) return void this.fromRadix(e, i); n = 2 } this.t = 0, this.s = 0; for (var r = e.length, o = !1, a = 0; --r >= 0;) { var s = 8 == n ? 255 & +e[r] : F(e, r); s < 0 ? "-" == e.charAt(r) && (o = !0) : (o = !1, 0 == a ? this[this.t++] = s : a + n > this.DB ? (this[this.t - 1] |= (s & (1 << this.DB - a) - 1) << a, this[this.t++] = s >> this.DB - a) : this[this.t - 1] |= s << a, (a += n) >= this.DB && (a -= this.DB)) } 8 == n && 0 != (128 & +e[0]) && (this.s = -1, a > 0 && (this[this.t - 1] |= (1 << this.DB - a) - 1 << a)), this.clamp(), o && t.ZERO.subTo(this, this) }, t.prototype.clamp = function() { for (var t = this.s & this.DM; this.t > 0 && this[this.t - 1] == t;) --this.t }, t.prototype.dlShiftTo = function(t, e) { var i; for (i = this.t - 1; i >= 0; --i) e[i + t] = this[i]; for (i = t - 1; i >= 0; --i) e[i] = 0; e.t = this.t + t, e.s = this.s }, t.prototype.drShiftTo = function(t, e) { for (var i = t; i < this.t; ++i) e[i - t] = this[i]; e.t = Math.max(this.t - t, 0), e.s = this.s }, t.prototype.lShiftTo = function(t, e) { for (var i = t % this.DB, n = this.DB - i, r = (1 << n) - 1, o = Math.floor(t / this.DB), a = this.s << i & this.DM, s = this.t - 1; s >= 0; --s) e[s + o + 1] = this[s] >> n | a, a = (this[s] & r) << i; for (s = o - 1; s >= 0; --s) e[s] = 0; e[o] = a, e.t = this.t + o + 1, e.s = this.s, e.clamp() }, t.prototype.rShiftTo = function(t, e) { e.s = this.s; var i = Math.floor(t / this.DB); if (i >= this.t) e.t = 0; else { var n = t % this.DB, r = this.DB - n, o = (1 << n) - 1; e[0] = this[i] >> n; for (var a = i + 1; a < this.t; ++a) e[a - i - 1] |= (this[a] & o) << r, e[a - i] = this[a] >> n; n > 0 && (e[this.t - i - 1] |= (this.s & o) << r), e.t = this.t - i, e.clamp() } }, t.prototype.subTo = function(t, e) { for (var i = 0, n = 0, r = Math.min(t.t, this.t); i < r;) n += this[i] - t[i], e[i++] = n & this.DM, n >>= this.DB; if (t.t < this.t) { for (n -= t.s; i < this.t;) n += this[i], e[i++] = n & this.DM, n >>= this.DB; n += this.s } else { for (n += this.s; i < t.t;) n -= t[i], e[i++] = n & this.DM, n >>= this.DB; n -= t.s } e.s = n < 0 ? -1 : 0, n < -1 ? e[i++] = this.DV + n : n > 0 && (e[i++] = n), e.t = i, e.clamp() }, t.prototype.multiplyTo = function(e, i) { var n = this.abs(), r = e.abs(), o = n.t; for (i.t = o + r.t; --o >= 0;) i[o] = 0; for (o = 0; o < r.t; ++o) i[o + n.t] = n.am(0, r[o], i, o, 0, n.t); i.s = 0, i.clamp(), this.s != e.s && t.ZERO.subTo(i, i) }, t.prototype.squareTo = function(t) { for (var e = this.abs(), i = t.t = 2 * e.t; --i >= 0;) t[i] = 0; for (i = 0; i < e.t - 1; ++i) { var n = e.am(i, e[i], t, 2 * i, 0, 1); (t[i + e.t] += e.am(i + 1, 2 * e[i], t, 2 * i + 1, n, e.t - i - 1)) >= e.DV && (t[i + e.t] -= e.DV, t[i + e.t + 1] = 1) } t.t > 0 && (t[t.t - 1] += e.am(i, e[i], t, 2 * i, 0, 1)), t.s = 0, t.clamp() }, t.prototype.divRemTo = function(e, i, n) { var r = e.abs(); if (!(r.t <= 0)) { var o = this.abs(); if (o.t < r.t) return null != i && i.fromInt(0), void(null != n && this.copyTo(n)); null == n && (n = O()); var a = O(), s = this.s, l = e.s, u = this.DB - z(r[r.t - 1]); u > 0 ? (r.lShiftTo(u, a), o.lShiftTo(u, n)) : (r.copyTo(a), o.copyTo(n)); var h = a.t, c = a[h - 1]; if (0 != c) { var d = c * (1 << this.F1) + (h > 1 ? a[h - 2] >> this.F2 : 0), p = this.FV / d, f = (1 << this.F1) / d, m = 1 << this.F2, g = n.t, v = g - h, y = null == i ? O() : i; for (a.dlShiftTo(v, y), n.compareTo(y) >= 0 && (n[n.t++] = 1, n.subTo(y, n)), t.ONE.dlShiftTo(h, y), y.subTo(a, a); a.t < h;) a[a.t++] = 0; for (; --v >= 0;) { var b = n[--g] == c ? this.DM : Math.floor(n[g] * p + (n[g - 1] + m) * f); if ((n[g] += a.am(0, b, n, v, 0, h)) < b) for (a.dlShiftTo(v, y), n.subTo(y, n); n[g] < --b;) n.subTo(y, n) } null != i && (n.drShiftTo(h, i), s != l && t.ZERO.subTo(i, i)), n.t = h, n.clamp(), u > 0 && n.rShiftTo(u, n), s < 0 && t.ZERO.subTo(n, n) } } }, t.prototype.invDigit = function() { if (this.t < 1) return 0; var t = this[0]; if (0 == (1 & t)) return 0; var e = 3 & t; return (e = (e = (e = (e = e * (2 - (15 & t) * e) & 15) * (2 - (255 & t) * e) & 255) * (2 - ((65535 & t) * e & 65535)) & 65535) * (2 - t * e % this.DV) % this.DV) > 0 ? this.DV - e : -e }, t.prototype.isEven = function() { return 0 == (this.t > 0 ? 1 & this[0] : this.s) }, t.prototype.exp = function(e, i) { if (e > 4294967295 || e < 1) return t.ONE; var n = O(), r = O(), o = i.convert(this), a = z(e) - 1; for (o.copyTo(n); --a >= 0;) if (i.sqrTo(n, r), (e & 1 << a) > 0) i.mulTo(r, o, n); else { var s = n; n = r, r = s } return i.revert(n) }, t.prototype.chunkSize = function(t) { return Math.floor(Math.LN2 * this.DB / Math.log(t)) }, t.prototype.toRadix = function(t) { if (null == t && (t = 10), 0 == this.signum() || t < 2 || t > 36) return "0"; var e = this.chunkSize(t), i = Math.pow(t, e), n = B(i), r = O(), o = O(), a = ""; for (this.divRemTo(n, r, o); r.signum() > 0;) a = (i + o.intValue()) .toString(t) .substr(1) + a, r.divRemTo(n, r, o); return o.intValue() .toString(t) + a }, t.prototype.fromRadix = function(e, i) { this.fromInt(0), null == i && (i = 10); for (var n = this.chunkSize(i), r = Math.pow(i, n), o = !1, a = 0, s = 0, l = 0; l < e.length; ++l) { var u = F(e, l); u < 0 ? "-" == e.charAt(l) && 0 == this.signum() && (o = !0) : (s = i * s + u, ++a >= n && (this.dMultiply(r), this.dAddOffset(s, 0), a = 0, s = 0)) } a > 0 && (this.dMultiply(Math.pow(i, a)), this.dAddOffset(s, 0)), o && t.ZERO.subTo(this, this) }, t.prototype.fromNumber = function(e, i, r) { if ("number" == typeof i) if (e < 2) this.fromInt(1); else for (this.fromNumber(e, r), this.testBit(e - 1) || this.bitwiseTo(t.ONE.shiftLeft(e - 1), n, this), this.isEven() && this.dAddOffset(1, 0); !this.isProbablePrime(i);) this.dAddOffset(2, 0), this.bitLength() > e && this.subTo(t.ONE.shiftLeft(e - 1), this); else { var o = [], a = 7 & e; o.length = 1 + (e >> 3), i.nextBytes(o), a > 0 ? o[0] &= (1 << a) - 1 : o[0] = 0, this.fromString(o, 256) } }, t.prototype.bitwiseTo = function(t, e, i) { var n, r, o = Math.min(t.t, this.t); for (n = 0; n < o; ++n) i[n] = e(this[n], t[n]); if (t.t < this.t) { for (r = t.s & this.DM, n = o; n < this.t; ++n) i[n] = e(this[n], r); i.t = this.t } else { for (r = this.s & this.DM, n = o; n < t.t; ++n) i[n] = e(r, t[n]); i.t = t.t } i.s = e(this.s, t.s), i.clamp() }, t.prototype.changeBit = function(e, i) { var n = t.ONE.shiftLeft(e); return this.bitwiseTo(n, i, n), n }, t.prototype.addTo = function(t, e) { for (var i = 0, n = 0, r = Math.min(t.t, this.t); i < r;) n += this[i] + t[i], e[i++] = n & this.DM, n >>= this.DB; if (t.t < this.t) { for (n += t.s; i < this.t;) n += this[i], e[i++] = n & this.DM, n >>= this.DB; n += this.s } else { for (n += this.s; i < t.t;) n += t[i], e[i++] = n & this.DM, n >>= this.DB; n += t.s } e.s = n < 0 ? -1 : 0, n > 0 ? e[i++] = n : n < -1 && (e[i++] = this.DV + n), e.t = i, e.clamp() }, t.prototype.dMultiply = function(t) { this[this.t] = this.am(0, t - 1, this, 0, 0, this.t), ++this.t, this.clamp() }, t.prototype.dAddOffset = function(t, e) { if (0 != t) { for (; this.t <= e;) this[this.t++] = 0; for (this[e] += t; this[e] >= this.DV;) this[e] -= this.DV, ++e >= this.t && (this[this.t++] = 0), ++this[e] } }, t.prototype.multiplyLowerTo = function(t, e, i) { var n = Math.min(this.t + t.t, e); for (i.s = 0, i.t = n; n > 0;) i[--n] = 0; for (var r = i.t - this.t; n < r; ++n) i[n + this.t] = this.am(0, t[n], i, n, 0, this.t); for (r = Math.min(t.t, e); n < r; ++n) this.am(0, t[n], i, n, 0, e - n); i.clamp() }, t.prototype.multiplyUpperTo = function(t, e, i) { --e; var n = i.t = this.t + t.t - e; for (i.s = 0; --n >= 0;) i[n] = 0; for (n = Math.max(e - this.t, 0); n < t.t; ++n) i[this.t + n - e] = this.am(e - n, t[n], i, 0, 0, this.t + n - e); i.clamp(), i.drShiftTo(1, i) }, t.prototype.modInt = function(t) { if (t <= 0) return 0; var e = this.DV % t, i = this.s < 0 ? t - 1 : 0; if (this.t > 0) if (0 == e) i = this[0] % t; else for (var n = this.t - 1; n >= 0; --n) i = (e * i + this[n]) % t; return i }, t.prototype.millerRabin = function(e) { var i = this.subtract(t.ONE), n = i.getLowestSetBit(); if (n <= 0) return !1; var r = i.shiftRight(n); (e = e + 1 >> 1) > _.length && (e = _.length); for (var o = O(), a = 0; a < e; ++a) { o.fromInt(_[Math.floor(Math.random() * _.length)]); var s = o.modPow(r, this); if (0 != s.compareTo(t.ONE) && 0 != s.compareTo(i)) { for (var l = 1; l++ < n && 0 != s.compareTo(i);) if (0 == (s = s.modPowInt(2, this)) .compareTo(t.ONE)) return !1; if (0 != s.compareTo(i)) return !1 } } return !0 }, t.prototype.square = function() { var t = O(); return this.squareTo(t), t }, t.prototype.gcda = function(t, e) { var i = this.s < 0 ? this.negate() : this.clone(), n = t.s < 0 ? t.negate() : t.clone(); if (i.compareTo(n) < 0) { var r = i; i = n, n = r } var o = i.getLowestSetBit(), a = n.getLowestSetBit(); if (a < 0) e(i); else { o < a && (a = o), a > 0 && (i.rShiftTo(a, i), n.rShiftTo(a, n)); var s = function() { (o = i.getLowestSetBit()) > 0 && i.rShiftTo(o, i), (o = n.getLowestSetBit()) > 0 && n.rShiftTo(o, n), i.compareTo(n) >= 0 ? (i.subTo(n, i), i.rShiftTo(1, i)) : (n.subTo(i, n), n.rShiftTo(1, n)), i.signum() > 0 ? setTimeout(s, 0) : (a > 0 && n.lShiftTo(a, n), setTimeout((function() { e(n) }), 0)) }; setTimeout(s, 10) } }, t.prototype.fromNumberAsync = function(e, i, r, o) { if ("number" == typeof i) if (e < 2) this.fromInt(1); else { this.fromNumber(e, r), this.testBit(e - 1) || this.bitwiseTo(t.ONE.shiftLeft(e - 1), n, this), this.isEven() && this.dAddOffset(1, 0); var a = this, s = function() { a.dAddOffset(2, 0), a.bitLength() > e && a.subTo(t.ONE.shiftLeft(e - 1), a), a.isProbablePrime(i) ? setTimeout((function() { o() }), 0) : setTimeout(s, 0) }; setTimeout(s, 0) } else { var l = [], u = 7 & e; l.length = 1 + (e >> 3), i.nextBytes(l), u > 0 ? l[0] &= (1 << u) - 1 : l[0] = 0, this.fromString(l, 256) } }, t }(), C = function() { function t() {} return t.prototype.convert = function(t) { return t }, t.prototype.revert = function(t) { return t }, t.prototype.mulTo = function(t, e, i) { t.multiplyTo(e, i) }, t.prototype.sqrTo = function(t, e) { t.squareTo(e) }, t }(), E = function() { function t(t) { this.m = t } return t.prototype.convert = function(t) { return t.s < 0 || t.compareTo(this.m) >= 0 ? t.mod(this.m) : t }, t.prototype.revert = function(t) { return t }, t.prototype.reduce = function(t) { t.divRemTo(this.m, null, t) }, t.prototype.mulTo = function(t, e, i) { t.multiplyTo(e, i), this.reduce(i) }, t.prototype.sqrTo = function(t, e) { t.squareTo(e), this.reduce(e) }, t }(), D = function() { function t(t) { this.m = t, this.mp = t.invDigit(), this.mpl = 32767 & this.mp, this.mph = this.mp >> 15, this.um = (1 << t.DB - 15) - 1, this.mt2 = 2 * t.t } return t.prototype.convert = function(t) { var e = O(); return t.abs() .dlShiftTo(this.m.t, e), e.divRemTo(this.m, null, e), t.s < 0 && e.compareTo(P.ZERO) > 0 && this.m.subTo(e, e), e }, t.prototype.revert = function(t) { var e = O(); return t.copyTo(e), this.reduce(e), e }, t.prototype.reduce = function(t) { for (; t.t <= this.mt2;) t[t.t++] = 0; for (var e = 0; e < this.m.t; ++e) { var i = 32767 & t[e], n = i * this.mpl + ((i * this.mph + (t[e] >> 15) * this.mpl & this.um) << 15) & t.DM; for (t[i = e + this.m.t] += this.m.am(0, n, t, e, 0, this.m.t); t[i] >= t.DV;) t[i] -= t.DV, t[++i]++ } t.clamp(), t.drShiftTo(this.m.t, t), t.compareTo(this.m) >= 0 && t.subTo(this.m, t) }, t.prototype.mulTo = function(t, e, i) { t.multiplyTo(e, i), this.reduce(i) }, t.prototype.sqrTo = function(t, e) { t.squareTo(e), this.reduce(e) }, t }(), L = function() { function t(t) { this.m = t, this.r2 = O(), this.q3 = O(), P.ONE.dlShiftTo(2 * t.t, this.r2), this.mu = this.r2.divide(t) } return t.prototype.convert = function(t) { if (t.s < 0 || t.t > 2 * this.m.t) return t.mod(this.m); if (t.compareTo(this.m) < 0) return t; var e = O(); return t.copyTo(e), this.reduce(e), e }, t.prototype.revert = function(t) { return t }, t.prototype.reduce = function(t) { for (t.drShiftTo(this.m.t - 1, this.r2), t.t > this.m.t + 1 && (t.t = this.m.t + 1, t.clamp()), this.mu.multiplyUpperTo(this.r2, this.m.t + 1, this.q3), this.m.multiplyLowerTo(this.q3, this.m.t + 1, this.r2); t.compareTo(this.r2) < 0;) t.dAddOffset(1, this.m.t + 1); for (t.subTo(this.r2, t); t.compareTo(this.m) >= 0;) t.subTo(this.m, t) }, t.prototype.mulTo = function(t, e, i) { t.multiplyTo(e, i), this.reduce(i) }, t.prototype.sqrTo = function(t, e) { t.squareTo(e), this.reduce(e) }, t }(); function O() { return new P(null) } function I(t, e) { return new P(t, e) } "Microsoft Internet Explorer" == navigator.appName ? (P.prototype.am = function(t, e, i, n, r, o) { for (var a = 32767 & e, s = e >> 15; --o >= 0;) { var l = 32767 & this[t], u = this[t++] >> 15, h = s * l + u * a; r = ((l = a * l + ((32767 & h) << 15) + i[n] + (1073741823 & r)) >>> 30) + (h >>> 15) + s * u + (r >>> 30), i[n++] = 1073741823 & l } return r }, x = 30) : "Netscape" != navigator.appName ? (P.prototype.am = function(t, e, i, n, r, o) { for (; --o >= 0;) { var a = e * this[t++] + i[n] + r; r = Math.floor(a / 67108864), i[n++] = 67108863 & a } return r }, x = 26) : (P.prototype.am = function(t, e, i, n, r, o) { for (var a = 16383 & e, s = e >> 14; --o >= 0;) { var l = 16383 & this[t], u = this[t++] >> 14, h = s * l + u * a; r = ((l = a * l + ((16383 & h) << 14) + i[n] + r) >> 28) + (h >> 14) + s * u, i[n++] = 268435455 & l } return r }, x = 28), P.prototype.DB = x, P.prototype.DM = (1 << x) - 1, P.prototype.DV = 1 << x, P.prototype.FV = Math.pow(2, 52), P.prototype.F1 = 52 - x, P.prototype.F2 = 2 * x - 52; var R, N, k = []; for (R = "0".charCodeAt(0), N = 0; N <= 9; ++N) k[R++] = N; for (R = "a".charCodeAt(0), N = 10; N < 36; ++N) k[R++] = N; for (R = "A".charCodeAt(0), N = 10; N < 36; ++N) k[R++] = N; function F(t, e) { var i = k[t.charCodeAt(e)]; return null == i ? -1 : i } function B(t) { var e = O(); return e.fromInt(t), e } function z(t) { var e, i = 1; return 0 != (e = t >>> 16) && (t = e, i += 16), 0 != (e = t >> 8) && (t = e, i += 8), 0 != (e = t >> 4) && (t = e, i += 4), 0 != (e = t >> 2) && (t = e, i += 2), 0 != (e = t >> 1) && (t = e, i += 1), i } P.ZERO = B(0), P.ONE = B(1); var U, V, j = function() { function t() { this.i = 0, this.j = 0, this.S = [] } return t.prototype.init = function(t) { var e, i, n; for (e = 0; e < 256; ++e) this.S[e] = e; for (i = 0, e = 0; e < 256; ++e) i = i + this.S[e] + t[e % t.length] & 255, n = this.S[e], this.S[e] = this.S[i], this.S[i] = n; this.i = 0, this.j = 0 }, t.prototype.next = function() { var t; return this.i = this.i + 1 & 255, this.j = this.j + this.S[this.i] & 255, t = this.S[this.i], this.S[this.i] = this.S[this.j], this.S[this.j] = t, this.S[t + this.S[this.i] & 255] }, t }(), H = null; if (null == H) { H = [], V = 0; var G = void 0; if (window.crypto && window.crypto.getRandomValues) { var W = new Uint32Array(256); for (window.crypto.getRandomValues(W), G = 0; G < W.length; ++G) H[V++] = 255 & W[G] } var q = function(t) { if (this.count = this.count || 0, this.count >= 256 || V >= 256) window.removeEventListener ? window.removeEventListener("mousemove", q, !1) : window.detachEvent && window.detachEvent("onmousemove", q); else try { var e = t.x + t.y; H[V++] = 255 & e, this.count += 1 } catch (t) {} }; window.addEventListener ? window.addEventListener("mousemove", q, !1) : window.attachEvent && window.attachEvent("onmousemove", q) } function Y() { if (null == U) { for (U = new j; V < 256;) { var t = Math.floor(65536 * Math.random()); H[V++] = 255 & t } for (U.init(H), V = 0; V < H.length; ++V) H[V] = 0; V = 0 } return U.next() } var X = function() { function t() {} return t.prototype.nextBytes = function(t) { for (var e = 0; e < t.length; ++e) t[e] = Y() }, t }(), Z = function() { function t() { this.n = null, this.e = 0, this.d = null, this.p = null, this.q = null, this.dmp1 = null, this.dmq1 = null, this.coeff = null } return t.prototype.doPublic = function(t) { return t.modPowInt(this.e, this.n) }, t.prototype.doPrivate = function(t) { if (null == this.p || null == this.q) return t.modPow(this.d, this.n); for (var e = t.mod(this.p) .modPow(this.dmp1, this.p), i = t.mod(this.q) .modPow(this.dmq1, this.q); e.compareTo(i) < 0;) e = e.add(this.p); return e.subtract(i) .multiply(this.coeff) .mod(this.p) .multiply(this.q) .add(i) }, t.prototype.setPublic = function(t, e) { null != t && null != e && t.length > 0 && e.length > 0 && (this.n = I(t, 16), this.e = parseInt(e, 16)) }, t.prototype.encrypt = function(t) { var e = function(t, e) { if (e < t.length + 11) return null; for (var i = [], n = t.length - 1; n >= 0 && e > 0;) { var r = t.charCodeAt(n--); r < 128 ? i[--e] = r : r > 127 && r < 2048 ? (i[--e] = 63 & r | 128, i[--e] = r >> 6 | 192) : (i[--e] = 63 & r | 128, i[--e] = r >> 6 & 63 | 128, i[--e] = r >> 12 | 224) } i[--e] = 0; for (var o = new X, a = []; e > 2;) { for (a[0] = 0; 0 == a[0];) o.nextBytes(a); i[--e] = a[0] } return i[--e] = 2, i[--e] = 0, new P(i) }(t, this.n.bitLength() + 7 >> 3); if (null == e) return null; var i = this.doPublic(e); if (null == i) return null; var n = i.toString(16); return 0 == (1 & n.length) ? n : "0" + n }, t.prototype.setPrivate = function(t, e, i) { null != t && null != e && t.length > 0 && e.length > 0 && (this.n = I(t, 16), this.e = parseInt(e, 16), this.d = I(i, 16)) }, t.prototype.setPrivateEx = function(t, e, i, n, r, o, a, s) { null != t && null != e && t.length > 0 && e.length > 0 && (this.n = I(t, 16), this.e = parseInt(e, 16), this.d = I(i, 16), this.p = I(n, 16), this.q = I(r, 16), this.dmp1 = I(o, 16), this.dmq1 = I(a, 16), this.coeff = I(s, 16)) }, t.prototype.generate = function(t, e) { var i = new X, n = t >> 1; this.e = parseInt(e, 16); for (var r = new P(e, 16);;) { for (; this.p = new P(t - n, 1, i), 0 != this.p.subtract(P.ONE) .gcd(r) .compareTo(P.ONE) || !this.p.isProbablePrime(10);); for (; this.q = new P(n, 1, i), 0 != this.q.subtract(P.ONE) .gcd(r) .compareTo(P.ONE) || !this.q.isProbablePrime(10);); if (this.p.compareTo(this.q) <= 0) { var o = this.p; this.p = this.q, this.q = o } var a = this.p.subtract(P.ONE), s = this.q.subtract(P.ONE), l = a.multiply(s); if (0 == l.gcd(r) .compareTo(P.ONE)) { this.n = this.p.multiply(this.q), this.d = r.modInverse(l), this.dmp1 = this.d.mod(a), this.dmq1 = this.d.mod(s), this.coeff = this.q.modInverse(this.p); break } } }, t.prototype.decrypt = function(t) { var e = I(t, 16), i = this.doPrivate(e); return null == i ? null : function(t, e) { for (var i = t.toByteArray(), n = 0; n < i.length && 0 == i[n];) ++n; if (i.length - n != e - 1 || 2 != i[n]) return null; for (++n; 0 != i[n];) if (++n >= i.length) return null; for (var r = ""; ++n < i.length;) { var o = 255 & i[n]; o < 128 ? r += String.fromCharCode(o) : o > 191 && o < 224 ? (r += String.fromCharCode((31 & o) << 6 | 63 & i[n + 1]), ++n) : (r += String.fromCharCode((15 & o) << 12 | (63 & i[n + 1]) << 6 | 63 & i[n + 2]), n += 2) } return r }(i, this.n.bitLength() + 7 >> 3) }, t.prototype.generateAsync = function(t, e, i) { var n = new X, r = t >> 1; this.e = parseInt(e, 16); var o = new P(e, 16), a = this, s = function() { var e = function() { if (a.p.compareTo(a.q) <= 0) { var t = a.p; a.p = a.q, a.q = t } var e = a.p.subtract(P.ONE), n = a.q.subtract(P.ONE), r = e.multiply(n); 0 == r.gcd(o) .compareTo(P.ONE) ? (a.n = a.p.multiply(a.q), a.d = o.modInverse(r), a.dmp1 = a.d.mod(e), a.dmq1 = a.d.mod(n), a.coeff = a.q.modInverse(a.p), setTimeout((function() { i() }), 0)) : setTimeout(s, 0) }, l = function() { a.q = O(), a.q.fromNumberAsync(r, 1, n, (function() { a.q.subtract(P.ONE) .gcda(o, (function(t) { 0 == t.compareTo(P.ONE) && a.q.isProbablePrime(10) ? setTimeout(e, 0) : setTimeout(l, 0) })) })) }, u = function() { a.p = O(), a.p.fromNumberAsync(t - r, 1, n, (function() { a.p.subtract(P.ONE) .gcda(o, (function(t) { 0 == t.compareTo(P.ONE) && a.p.isProbablePrime(10) ? setTimeout(l, 0) : setTimeout(u, 0) })) })) }; setTimeout(u, 0) }; setTimeout(s, 0) }, t.prototype.sign = function(t, e, i) { var n = function(t, e) { if (e < t.length + 22) return null; for (var i = e - t.length - 6, n = "", r = 0; r < i; r += 2) n += "ff"; return I("0001" + n + "00" + t, 16) }((K[i] || "") + e(t) .toString(), this.n.bitLength() / 4); if (null == n) return null; var r = this.doPrivate(n); if (null == r) return null; var o = r.toString(16); return 0 == (1 & o.length) ? o : "0" + o }, t.prototype.verify = function(t, e, i) { var n = I(e, 16), r = this.doPublic(n); return null == r ? null : function(t) { for (var e in K) if (K.hasOwnProperty(e)) { var i = K[e], n = i.length; if (t.substr(0, n) == i) return t.substr(n) } return t }(r.toString(16) .replace(/^1f+00/, "")) == i(t) .toString() }, t }(), K = { md2: "3020300c06082a864886f70d020205000410", md5: "3020300c06082a864886f70d020505000410", sha1: "3021300906052b0e03021a05000414", sha224: "302d300d06096086480165030402040500041c", sha256: "3031300d060960864801650304020105000420", sha384: "3041300d060960864801650304020205000430", sha512: "3051300d060960864801650304020305000440", ripemd160: "3021300906052b2403020105000414" }, Q = {}; Q.lang = { extend: function(t, e, i) { if (!e || !t) throw new Error("YAHOO.lang.extend failed, please check that all dependencies are included."); var n = function() {}; if (n.prototype = e.prototype, t.prototype = new n, t.prototype.constructor = t, t.superclass = e.prototype, e.prototype.constructor == Object.prototype.constructor && (e.prototype.constructor = e), i) { var r; for (r in i) t.prototype[r] = i[r]; var o = function() {}, a = ["toString", "valueOf"]; try { /MSIE/.test(navigator.userAgent) && (o = function(t, e) { for (r = 0; r < a.length; r += 1) { var i = a[r], n = e[i]; "function" == typeof n && n != Object.prototype[i] && (t[i] = n) } }) } catch (t) {} o(t.prototype, i) } } }; var J = {}; void 0 !== J.asn1 && J.asn1 || (J.asn1 = {}), J.asn1.ASN1Util = new function() { this.integerToByteHex = function(t) { var e = t.toString(16); return e.length % 2 == 1 && (e = "0" + e), e }, this.bigIntToMinTwosComplementsHex = function(t) { var e = t.toString(16); if ("-" != e.substr(0, 1)) e.length % 2 == 1 ? e = "0" + e : e.match(/^[0-7]/) || (e = "00" + e); else { var i = e.substr(1) .length; i % 2 == 1 ? i += 1 : e.match(/^[0-7]/) || (i += 2); for (var n = "", r = 0; r < i; r++) n += "f"; e = new P(n, 16) .xor(t) .add(P.ONE) .toString(16) .replace(/^-/, "") } return e }, this.getPEMStringFromHex = function(t, e) { return hextopem(t, e) }, this.newObject = function(t) { var e = J.asn1, i = e.DERBoolean, n = e.DERInteger, r = e.DERBitString, o = e.DEROctetString, a = e.DERNull, s = e.DERObjectIdentifier, l = e.DEREnumerated, u = e.DERUTF8String, h = e.DERNumericString, c = e.DERPrintableString, d = e.DERTeletexString, p = e.DERIA5String, f = e.DERUTCTime, m = e.DERGeneralizedTime, g = e.DERSequence, v = e.DERSet, y = e.DERTaggedObject, b = e.ASN1Util.newObject, w = Object.keys(t); if (1 != w.length) throw "key of param shall be only one."; var x = w[0]; if (-1 == ":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:set:tag:".indexOf(":" + x + ":")) throw "undefined key: " + x; if ("bool" == x) return new i(t[x]); if ("int" == x) return new n(t[x]); if ("bitstr" == x) return new r(t[x]); if ("octstr" == x) return new o(t[x]); if ("null" == x) return new a(t[x]); if ("oid" == x) return new s(t[x]); if ("enum" == x) return new l(t[x]); if ("utf8str" == x) return new u(t[x]); if ("numstr" == x) return new h(t[x]); if ("prnstr" == x) return new c(t[x]); if ("telstr" == x) return new d(t[x]); if ("ia5str" == x) return new p(t[x]); if ("utctime" == x) return new f(t[x]); if ("gentime" == x) return new m(t[x]); if ("seq" == x) { for (var M = t[x], T = [], S = 0; S < M.length; S++) { var _ = b(M[S]); T.push(_) } return new g({ array: T }) } if ("set" == x) { for (M = t[x], T = [], S = 0; S < M.length; S++) _ = b(M[S]), T.push(_); return new v({ array: T }) } if ("tag" == x) { var A = t[x]; if ("[object Array]" === Object.prototype.toString.call(A) && 3 == A.length) { var P = b(A[2]); return new y({ tag: A[0], explicit: A[1], obj: P }) } var C = {}; if (void 0 !== A.explicit && (C.explicit = A.explicit), void 0 !== A.tag && (C.tag = A.tag), void 0 === A.obj) throw "obj shall be specified for 'tag'."; return C.obj = b(A.obj), new y(C) } }, this.jsonToASN1HEX = function(t) { return this.newObject(t) .getEncodedHex() } }, J.asn1.ASN1Util.oidHexToInt = function(t) { for (var e = "", i = parseInt(t.substr(0, 2), 16), n = (e = Math.floor(i / 40) + "." + i % 40, ""), r = 2; r < t.length; r += 2) { var o = ("00000000" + parseInt(t.substr(r, 2), 16) .toString(2)) .slice(-8); n += o.substr(1, 7), "0" == o.substr(0, 1) && (e = e + "." + new P(n, 2) .toString(10), n = "") } return e }, J.asn1.ASN1Util.oidIntToHex = function(t) { var e = function(t) { var e = t.toString(16); return 1 == e.length && (e = "0" + e), e }, i = function(t) { var i = "", n = new P(t, 10) .toString(2), r = 7 - n.length % 7; 7 == r && (r = 0); for (var o = "", a = 0; a < r; a++) o += "0"; for (n = o + n, a = 0; a < n.length - 1; a += 7) { var s = n.substr(a, 7); a != n.length - 7 && (s = "1" + s), i += e(parseInt(s, 2)) } return i }; if (!t.match(/^[0-9.]+$/)) throw "malformed oid string: " + t; var n = "", r = t.split("."), o = 40 * parseInt(r[0]) + parseInt(r[1]); n += e(o), r.splice(0, 2); for (var a = 0; a < r.length; a++) n += i(r[a]); return n }, J.asn1.ASN1Object = function() { this.getLengthHexFromValue = function() { if (void 0 === this.hV || null == this.hV) throw "this.hV is null or undefined."; if (this.hV.length % 2 == 1) throw "value hex must be even length: n=" + "".length + ",v=" + this.hV; var t = this.hV.length / 2, e = t.toString(16); if (e.length % 2 == 1 && (e = "0" + e), t < 128) return e; var i = e.length / 2; if (i > 15) throw "ASN.1 length too long to represent by 8x: n = " + t.toString(16); return (128 + i) .toString(16) + e }, this.getEncodedHex = function() { return (null == this.hTLV || this.isModified) && (this.hV = this.getFreshValueHex(), this.hL = this.getLengthHexFromValue(), this.hTLV = this.hT + this.hL + this.hV, this.isModified = !1), this.hTLV }, this.getValueHex = function() { return this.getEncodedHex(), this.hV }, this.getFreshValueHex = function() { return "" } }, J.asn1.DERAbstractString = function(t) { J.asn1.DERAbstractString.superclass.constructor.call(this), this.getString = function() { return this.s }, this.setString = function(t) { this.hTLV = null, this.isModified = !0, this.s = t, this.hV = stohex(this.s) }, this.setStringHex = function(t) { this.hTLV = null, this.isModified = !0, this.s = null, this.hV = t }, this.getFreshValueHex = function() { return this.hV }, void 0 !== t && ("string" == typeof t ? this.setString(t) : void 0 !== t.str ? this.setString(t.str) : void 0 !== t.hex && this.setStringHex(t.hex)) }, Q.lang.extend(J.asn1.DERAbstractString, J.asn1.ASN1Object), J.asn1.DERAbstractTime = function(t) { J.asn1.DERAbstractTime.superclass.constructor.call(this), this.localDateToUTC = function(t) { return utc = t.getTime() + 6e4 * t.getTimezoneOffset(), new Date(utc) }, this.formatDate = function(t, e, i) { var n = this.zeroPadding, r = this.localDateToUTC(t), o = String(r.getFullYear()); "utc" == e && (o = o.substr(2, 2)); var a = o + n(String(r.getMonth() + 1), 2) + n(String(r.getDate()), 2) + n(String(r.getHours()), 2) + n(String(r.getMinutes()), 2) + n(String(r.getSeconds()), 2); if (!0 === i) { var s = r.getMilliseconds(); if (0 != s) { var l = n(String(s), 3); a = a + "." + (l = l.replace(/[0]+$/, "")) } } return a + "Z" }, this.zeroPadding = function(t, e) { return t.length >= e ? t : new Array(e - t.length + 1) .join("0") + t }, this.getString = function() { return this.s }, this.setString = function(t) { this.hTLV = null, this.isModified = !0, this.s = t, this.hV = stohex(t) }, this.setByDateValue = function(t, e, i, n, r, o) { var a = new Date(Date.UTC(t, e - 1, i, n, r, o, 0)); this.setByDate(a) }, this.getFreshValueHex = function() { return this.hV } }, Q.lang.extend(J.asn1.DERAbstractTime, J.asn1.ASN1Object), J.asn1.DERAbstractStructured = function(t) { J.asn1.DERAbstractString.superclass.constructor.call(this), this.setByASN1ObjectArray = function(t) { this.hTLV = null, this.isModified = !0, this.asn1Array = t }, this.appendASN1Object = function(t) { this.hTLV = null, this.isModified = !0, this.asn1Array.push(t) }, this.asn1Array = new Array, void 0 !== t && void 0 !== t.array && (this.asn1Array = t.array) }, Q.lang.extend(J.asn1.DERAbstractStructured, J.asn1.ASN1Object), J.asn1.DERBoolean = function() { J.asn1.DERBoolean.superclass.constructor.call(this), this.hT = "01", this.hTLV = "0101ff" }, Q.lang.extend(J.asn1.DERBoolean, J.asn1.ASN1Object), J.asn1.DERInteger = function(t) { J.asn1.DERInteger.superclass.constructor.call(this), this.hT = "02", this.setByBigInteger = function(t) { this.hTLV = null, this.isModified = !0, this.hV = J.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t) }, this.setByInteger = function(t) { var e = new P(String(t), 10); this.setByBigInteger(e) }, this.setValueHex = function(t) { this.hV = t }, this.getFreshValueHex = function() { return this.hV }, void 0 !== t && (void 0 !== t.bigint ? this.setByBigInteger(t.bigint) : void 0 !== t.int ? this.setByInteger(t.int) : "number" == typeof t ? this.setByInteger(t) : void 0 !== t.hex && this.setValueHex(t.hex)) }, Q.lang.extend(J.asn1.DERInteger, J.asn1.ASN1Object), J.asn1.DERBitString = function(t) { if (void 0 !== t && void 0 !== t.obj) { var e = J.asn1.ASN1Util.newObject(t.obj); t.hex = "00" + e.getEncodedHex() } J.asn1.DERBitString.superclass.constructor.call(this), this.hT = "03", this.setHexValueIncludingUnusedBits = function(t) { this.hTLV = null, this.isModified = !0, this.hV = t }, this.setUnusedBitsAndHexValue = function(t, e) { if (t < 0 || 7 < t) throw "unused bits shall be from 0 to 7: u = " + t; var i = "0" + t; this.hTLV = null, this.isModified = !0, this.hV = i + e }, this.setByBinaryString = function(t) { var e = 8 - (t = t.replace(/0+$/, "")) .length % 8; 8 == e && (e = 0); for (var i = 0; i <= e; i++) t += "0"; var n = ""; for (i = 0; i < t.length - 1; i += 8) { var r = t.substr(i, 8), o = parseInt(r, 2) .toString(16); 1 == o.length && (o = "0" + o), n += o } this.hTLV = null, this.isModified = !0, this.hV = "0" + e + n }, this.setByBooleanArray = function(t) { for (var e = "", i = 0; i < t.length; i++) 1 == t[i] ? e += "1" : e += "0"; this.setByBinaryString(e) }, this.newFalseArray = function(t) { for (var e = new Array(t), i = 0; i < t; i++) e[i] = !1; return e }, this.getFreshValueHex = function() { return this.hV }, void 0 !== t && ("string" == typeof t && t.toLowerCase() .match(/^[0-9a-f]+$/) ? this.setHexValueIncludingUnusedBits(t) : void 0 !== t.hex ? this.setHexValueIncludingUnusedBits(t.hex) : void 0 !== t.bin ? this.setByBinaryString(t.bin) : void 0 !== t.array && this.setByBooleanArray(t.array)) }, Q.lang.extend(J.asn1.DERBitString, J.asn1.ASN1Object), J.asn1.DEROctetString = function(t) { if (void 0 !== t && void 0 !== t.obj) { var e = J.asn1.ASN1Util.newObject(t.obj); t.hex = e.getEncodedHex() } J.asn1.DEROctetString.superclass.constructor.call(this, t), this.hT = "04" }, Q.lang.extend(J.asn1.DEROctetString, J.asn1.DERAbstractString), J.asn1.DERNull = function() { J.asn1.DERNull.superclass.constructor.call(this), this.hT = "05", this.hTLV = "0500" }, Q.lang.extend(J.asn1.DERNull, J.asn1.ASN1Object), J.asn1.DERObjectIdentifier = function(t) { var e = function(t) { var e = t.toString(16); return 1 == e.length && (e = "0" + e), e }, i = function(t) { var i = "", n = new P(t, 10) .toString(2), r = 7 - n.length % 7; 7 == r && (r = 0); for (var o = "", a = 0; a < r; a++) o += "0"; for (n = o + n, a = 0; a < n.length - 1; a += 7) { var s = n.substr(a, 7); a != n.length - 7 && (s = "1" + s), i += e(parseInt(s, 2)) } return i }; J.asn1.DERObjectIdentifier.superclass.constructor.call(this), this.hT = "06", this.setValueHex = function(t) { this.hTLV = null, this.isModified = !0, this.s = null, this.hV = t }, this.setValueOidString = function(t) { if (!t.match(/^[0-9.]+$/)) throw "malformed oid string: " + t; var n = "", r = t.split("."), o = 40 * parseInt(r[0]) + parseInt(r[1]); n += e(o), r.splice(0, 2); for (var a = 0; a < r.length; a++) n += i(r[a]); this.hTLV = null, this.isModified = !0, this.s = null, this.hV = n }, this.setValueName = function(t) { var e = J.asn1.x509.OID.name2oid(t); if ("" === e) throw "DERObjectIdentifier oidName undefined: " + t; this.setValueOidString(e) }, this.getFreshValueHex = function() { return this.hV }, void 0 !== t && ("string" == typeof t ? t.match(/^[0-2].[0-9.]+$/) ? this.setValueOidString(t) : this.setValueName(t) : void 0 !== t.oid ? this.setValueOidString(t.oid) : void 0 !== t.hex ? this.setValueHex(t.hex) : void 0 !== t.name && this.setValueName(t.name)) }, Q.lang.extend(J.asn1.DERObjectIdentifier, J.asn1.ASN1Object), J.asn1.DEREnumerated = function(t) { J.asn1.DEREnumerated.superclass.constructor.call(this), this.hT = "0a", this.setByBigInteger = function(t) { this.hTLV = null, this.isModified = !0, this.hV = J.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t) }, this.setByInteger = function(t) { var e = new P(String(t), 10); this.setByBigInteger(e) }, this.setValueHex = function(t) { this.hV = t }, this.getFreshValueHex = function() { return this.hV }, void 0 !== t && (void 0 !== t.int ? this.setByInteger(t.int) : "number" == typeof t ? this.setByInteger(t) : void 0 !== t.hex && this.setValueHex(t.hex)) }, Q.lang.extend(J.asn1.DEREnumerated, J.asn1.ASN1Object), J.asn1.DERUTF8String = function(t) { J.asn1.DERUTF8String.superclass.constructor.call(this, t), this.hT = "0c" }, Q.lang.extend(J.asn1.DERUTF8String, J.asn1.DERAbstractString), J.asn1.DERNumericString = function(t) { J.asn1.DERNumericString.superclass.constructor.call(this, t), this.hT = "12" }, Q.lang.extend(J.asn1.DERNumericString, J.asn1.DERAbstractString), J.asn1.DERPrintableString = function(t) { J.asn1.DERPrintableString.superclass.constructor.call(this, t), this.hT = "13" }, Q.lang.extend(J.asn1.DERPrintableString, J.asn1.DERAbstractString), J.asn1.DERTeletexString = function(t) { J.asn1.DERTeletexString.superclass.constructor.call(this, t), this.hT = "14" }, Q.lang.extend(J.asn1.DERTeletexString, J.asn1.DERAbstractString), J.asn1.DERIA5String = function(t) { J.asn1.DERIA5String.superclass.constructor.call(this, t), this.hT = "16" }, Q.lang.extend(J.asn1.DERIA5String, J.asn1.DERAbstractString), J.asn1.DERUTCTime = function(t) { J.asn1.DERUTCTime.superclass.constructor.call(this, t), this.hT = "17", this.setByDate = function(t) { this.hTLV = null, this.isModified = !0, this.date = t, this.s = this.formatDate(this.date, "utc"), this.hV = stohex(this.s) }, this.getFreshValueHex = function() { return void 0 === this.date && void 0 === this.s && (this.date = new Date, this.s = this.formatDate(this.date, "utc"), this.hV = stohex(this.s)), this.hV }, void 0 !== t && (void 0 !== t.str ? this.setString(t.str) : "string" == typeof t && t.match(/^[0-9]{12}Z$/) ? this.setString(t) : void 0 !== t.hex ? this.setStringHex(t.hex) : void 0 !== t.date && this.setByDate(t.date)) }, Q.lang.extend(J.asn1.DERUTCTime, J.asn1.DERAbstractTime), J.asn1.DERGeneralizedTime = function(t) { J.asn1.DERGeneralizedTime.superclass.constructor.call(this, t), this.hT = "18", this.withMillis = !1, this.setByDate = function(t) { this.hTLV = null, this.isModified = !0, this.date = t, this.s = this.formatDate(this.date, "gen", this.withMillis), this.hV = stohex(this.s) }, this.getFreshValueHex = function() { return void 0 === this.date && void 0 === this.s && (this.date = new Date, this.s = this.formatDate(this.date, "gen", this.withMillis), this.hV = stohex(this.s)), this.hV }, void 0 !== t && (void 0 !== t.str ? this.setString(t.str) : "string" == typeof t && t.match(/^[0-9]{14}Z$/) ? this.setString(t) : void 0 !== t.hex ? this.setStringHex(t.hex) : void 0 !== t.date && this.setByDate(t.date), !0 === t.millis && (this.withMillis = !0)) }, Q.lang.extend(J.asn1.DERGeneralizedTime, J.asn1.DERAbstractTime), J.asn1.DERSequence = function(t) { J.asn1.DERSequence.superclass.constructor.call(this, t), this.hT = "30", this.getFreshValueHex = function() { for (var t = "", e = 0; e < this.asn1Array.length; e++) t += this.asn1Array[e].getEncodedHex(); return this.hV = t, this.hV } }, Q.lang.extend(J.asn1.DERSequence, J.asn1.DERAbstractStructured), J.asn1.DERSet = function(t) { J.asn1.DERSet.superclass.constructor.call(this, t), this.hT = "31", this.sortFlag = !0, this.getFreshValueHex = function() { for (var t = new Array, e = 0; e < this.asn1Array.length; e++) { var i = this.asn1Array[e]; t.push(i.getEncodedHex()) } return 1 == this.sortFlag && t.sort(), this.hV = t.join(""), this.hV }, void 0 !== t && void 0 !== t.sortflag && 0 == t.sortflag && (this.sortFlag = !1) }, Q.lang.extend(J.asn1.DERSet, J.asn1.DERAbstractStructured), J.asn1.DERTaggedObject = function(t) { J.asn1.DERTaggedObject.superclass.constructor.call(this), this.hT = "a0", this.hV = "", this.isExplicit = !0, this.asn1Object = null, this.setASN1Object = function(t, e, i) { this.hT = e, this.isExplicit = t, this.asn1Object = i, this.isExplicit ? (this.hV = this.asn1Object.getEncodedHex(), this.hTLV = null, this.isModified = !0) : (this.hV = null, this.hTLV = i.getEncodedHex(), this.hTLV = this.hTLV.replace(/^../, e), this.isModified = !1) }, this.getFreshValueHex = function() { return this.hV }, void 0 !== t && (void 0 !== t.tag && (this.hT = t.tag), void 0 !== t.explicit && (this.isExplicit = t.explicit), void 0 !== t.obj && (this.asn1Object = t.obj, this.setASN1Object(this.isExplicit, this.hT, this.asn1Object))) }, Q.lang.extend(J.asn1.DERTaggedObject, J.asn1.ASN1Object); var $ = function(t) { function e(i) { var n = t.call(this) || this; return i && ("string" == typeof i ? n.parseKey(i) : (e.hasPrivateKeyProperty(i) || e.hasPublicKeyProperty(i)) && n.parsePropertiesFrom(i)), n } return function(t, e) { function i() { this.constructor = t } p(t, e), t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i) }(e, t), e.prototype.parseKey = function(t) { try { var e = 0, i = 0, n = /^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/.test(t) ? f(t) : m.unarmor(t), r = T.decode(n); if (3 === r.sub.length && (r = r.sub[2].sub[0]), 9 === r.sub.length) { e = r.sub[1].getHexStringValue(), this.n = I(e, 16), i = r.sub[2].getHexStringValue(), this.e = parseInt(i, 16); var o = r.sub[3].getHexStringValue(); this.d = I(o, 16); var a = r.sub[4].getHexStringValue(); this.p = I(a, 16); var s = r.sub[5].getHexStringValue(); this.q = I(s, 16); var l = r.sub[6].getHexStringValue(); this.dmp1 = I(l, 16); var u = r.sub[7].getHexStringValue(); this.dmq1 = I(u, 16); var h = r.sub[8].getHexStringValue(); this.coeff = I(h, 16) } else { if (2 !== r.sub.length) return !1; var c = r.sub[1].sub[0]; e = c.sub[0].getHexStringValue(), this.n = I(e, 16), i = c.sub[1].getHexStringValue(), this.e = parseInt(i, 16) } return !0 } catch (t) { return !1 } }, e.prototype.getPrivateBaseKey = function() { var t = { array: [new J.asn1.DERInteger({ int: 0 }), new J.asn1.DERInteger({ bigint: this.n }), new J.asn1.DERInteger({ int: this.e }), new J.asn1.DERInteger({ bigint: this.d }), new J.asn1.DERInteger({ bigint: this.p }), new J.asn1.DERInteger({ bigint: this.q }), new J.asn1.DERInteger({ bigint: this.dmp1 }), new J.asn1.DERInteger({ bigint: this.dmq1 }), new J.asn1.DERInteger({ bigint: this.coeff })] }; return new J.asn1.DERSequence(t) .getEncodedHex() }, e.prototype.getPrivateBaseKeyB64 = function() { return u(this.getPrivateBaseKey()) }, e.prototype.getPublicBaseKey = function() { var t = new J.asn1.DERSequence({ array: [new J.asn1.DERObjectIdentifier({ oid: "1.2.840.113549.1.1.1" }), new J.asn1.DERNull] }), e = new J.asn1.DERSequence({ array: [new J.asn1.DERInteger({ bigint: this.n }), new J.asn1.DERInteger({ int: this.e })] }), i = new J.asn1.DERBitString({ hex: "00" + e.getEncodedHex() }); return new J.asn1.DERSequence({ array: [t, i] }) .getEncodedHex() }, e.prototype.getPublicBaseKeyB64 = function() { return u(this.getPublicBaseKey()) }, e.wordwrap = function(t, e) { if (!t) return t; var i = "(.{1," + (e = e || 64) + "})( +|$\n?)|(.{1," + e + "})"; return t.match(RegExp(i, "g")) .join("\n") }, e.prototype.getPrivateKey = function() { var t = "-----BEGIN RSA PRIVATE KEY-----\n"; return t += e.wordwrap(this.getPrivateBaseKeyB64()) + "\n", t += "-----END RSA PRIVATE KEY-----" }, e.prototype.getPublicKey = function() { var t = "-----BEGIN PUBLIC KEY-----\n"; return t += e.wordwrap(this.getPublicBaseKeyB64()) + "\n", t += "-----END PUBLIC KEY-----" }, e.hasPublicKeyProperty = function(t) { return (t = t || {}) .hasOwnProperty("n") && t.hasOwnProperty("e") }, e.hasPrivateKeyProperty = function(t) { return (t = t || {}) .hasOwnProperty("n") && t.hasOwnProperty("e") && t.hasOwnProperty("d") && t.hasOwnProperty("p") && t.hasOwnProperty("q") && t.hasOwnProperty("dmp1") && t.hasOwnProperty("dmq1") && t.hasOwnProperty("coeff") }, e.prototype.parsePropertiesFrom = function(t) { this.n = t.n, this.e = t.e, t.hasOwnProperty("d") && (this.d = t.d, this.p = t.p, this.q = t.q, this.dmp1 = t.dmp1, this.dmq1 = t.dmq1, this.coeff = t.coeff) }, e }(Z), tt = function() { function t(t) { t = t || {}, this.default_key_size = parseInt(t.default_key_size, 10) || 1024, this.default_public_exponent = t.default_public_exponent || "010001", this.log = t.log || !1, this.key = null } return t.prototype.setKey = function(t) { this.log && this.key, this.key = new $(t) }, t.prototype.setPrivateKey = function(t) { this.setKey(t) }, t.prototype.setPublicKey = function(t) { this.setKey(t) }, t.prototype.decrypt = function(t) { try { return this.getKey() .decrypt(h(t)) } catch (t) { return !1 } }, t.prototype.encrypt = function(t) { try { return u(this.getKey() .encrypt(t)) } catch (t) { return !1 } }, t.prototype.encryptLong = function(t) { var e = this.getKey(), i = (e.n.bitLength() + 7 >> 3) - 11; try { var n = ""; return t.length > i ? t.match(/.{1,117}/g) .forEach((function(t) { var i = e.encrypt(t); n += i })) : n = e.encrypt(t), u(n) } catch (t) { return !1 } }, t.prototype.sign = function(t, e, i) { try { return u(this.getKey() .sign(t, e, i)) } catch (t) { return !1 } }, t.prototype.verify = function(t, e, i) { try { return this.getKey() .verify(t, h(e), i) } catch (t) { return !1 } }, t.prototype.getKey = function(t) { if (!this.key) { if (this.key = new $, t && "[object Function]" === {}.toString.call(t)) return void this.key.generateAsync(this.default_key_size, this.default_public_exponent, t); this.key.generate(this.default_key_size, this.default_public_exponent) } return this.key }, t.prototype.getPrivateKey = function() { return this.getKey() .getPrivateKey() }, t.prototype.getPrivateKeyB64 = function() { return this.getKey() .getPrivateBaseKeyB64() }, t.prototype.getPublicKey = function() { return this.getKey() .getPublicKey() }, t.prototype.getPublicKeyB64 = function() { return this.getKey() .getPublicBaseKeyB64() }, t.version = "3.0.0-rc.1", t }(); window.JSEncrypt = tt, t.JSEncrypt = tt, t.default = tt, Object.defineProperty(t, "__esModule", { value: !0 }) }(e) }, function(t, e, i) { var n; ! function(e, i) { "object" == typeof t.exports ? t.exports = e.document ? i(e, !0) : function(t) { if (!t.document) throw new Error("jQuery requires a window with a document"); return i(t) } : i(e) }("undefined" != typeof window ? window : this, (function(i, r) { var o = [], a = o.slice, s = o.concat, l = o.push, u = o.indexOf, h = {}, c = h.toString, d = h.hasOwnProperty, p = {}, f = i.document, m = "2.1.1", g = function(t, e) { return new g.fn.init(t, e) }, v = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, y = /^-ms-/, b = /-([\da-z])/gi, w = function(t, e) { return e.toUpperCase() }; function x(t) { var e = t.length, i = g.type(t); return "function" !== i && !g.isWindow(t) && (!(1 !== t.nodeType || !e) || ("array" === i || 0 === e || "number" == typeof e && e > 0 && e - 1 in t)) } g.fn = g.prototype = { jquery: m, constructor: g, selector: "", length: 0, toArray: function() { return a.call(this) }, get: function(t) { return null != t ? 0 > t ? this[t + this.length] : this[t] : a.call(this) }, pushStack: function(t) { var e = g.merge(this.constructor(), t); return e.prevObject = this, e.context = this.context, e }, each: function(t, e) { return g.each(this, t, e) }, map: function(t) { return this.pushStack(g.map(this, (function(e, i) { return t.call(e, i, e) }))) }, slice: function() { return this.pushStack(a.apply(this, arguments)) }, first: function() { return this.eq(0) }, last: function() { return this.eq(-1) }, eq: function(t) { var e = this.length, i = +t + (0 > t ? e : 0); return this.pushStack(i >= 0 && e > i ? [this[i]] : []) }, end: function() { return this.prevObject || this.constructor(null) }, push: l, sort: o.sort, splice: o.splice }, g.extend = g.fn.extend = function() { var t, e, i, n, r, o, a = arguments[0] || {}, s = 1, l = arguments.length, u = !1; for ("boolean" == typeof a && (u = a, a = arguments[s] || {}, s++), "object" == typeof a || g.isFunction(a) || (a = {}), s === l && (a = this, s--); l > s; s++) if (null != (t = arguments[s])) for (e in t) i = a[e], a !== (n = t[e]) && (u && n && (g.isPlainObject(n) || (r = g.isArray(n))) ? (r ? (r = !1, o = i && g.isArray(i) ? i : []) : o = i && g.isPlainObject(i) ? i : {}, a[e] = g.extend(u, o, n)) : void 0 !== n && (a[e] = n)); return a }, g.extend({ expando: "jQuery" + (m + Math.random()) .replace(/\D/g, ""), isReady: !0, error: function(t) { throw new Error(t) }, noop: function() {}, isFunction: function(t) { return "function" === g.type(t) }, isArray: Array.isArray, isWindow: function(t) { return null != t && t === t.window }, isNumeric: function(t) { return !g.isArray(t) && t - parseFloat(t) >= 0 }, isPlainObject: function(t) { return "object" === g.type(t) && !t.nodeType && !g.isWindow(t) && !(t.constructor && !d.call(t.constructor.prototype, "isPrototypeOf")) }, isEmptyObject: function(t) { var e; for (e in t) return !1; return !0 }, type: function(t) { return null == t ? t + "" : "object" == typeof t || "function" == typeof t ? h[c.call(t)] || "object" : typeof t }, globalEval: function(t) { var e, i = eval; (t = g.trim(t)) && (1 === t.indexOf("use strict") ? ((e = f.createElement("script")) .text = t, f.head.appendChild(e) .parentNode.removeChild(e)) : i(t)) }, camelCase: function(t) { return t.replace(y, "ms-") .replace(b, w) }, nodeName: function(t, e) { return t.nodeName && t.nodeName.toLowerCase() === e.toLowerCase() }, each: function(t, e, i) { var n = 0, r = t.length, o = x(t); if (i) { if (o) for (; r > n && !1 !== e.apply(t[n], i); n++); else for (n in t) if (!1 === e.apply(t[n], i)) break } else if (o) for (; r > n && !1 !== e.call(t[n], n, t[n]); n++); else for (n in t) if (!1 === e.call(t[n], n, t[n])) break; return t }, trim: function(t) { return null == t ? "" : (t + "") .replace(v, "") }, makeArray: function(t, e) { var i = e || []; return null != t && (x(Object(t)) ? g.merge(i, "string" == typeof t ? [t] : t) : l.call(i, t)), i }, inArray: function(t, e, i) { return null == e ? -1 : u.call(e, t, i) }, merge: function(t, e) { for (var i = +e.length, n = 0, r = t.length; i > n; n++) t[r++] = e[n]; return t.length = r, t }, grep: function(t, e, i) { for (var n = [], r = 0, o = t.length, a = !i; o > r; r++) !e(t[r], r) !== a && n.push(t[r]); return n }, map: function(t, e, i) { var n, r = 0, o = t.length, a = []; if (x(t)) for (; o > r; r++) null != (n = e(t[r], r, i)) && a.push(n); else for (r in t) null != (n = e(t[r], r, i)) && a.push(n); return s.apply([], a) }, guid: 1, proxy: function(t, e) { var i, n, r; return "string" == typeof e && (i = t[e], e = t, t = i), g.isFunction(t) ? (n = a.call(arguments, 2), (r = function() { return t.apply(e || this, n.concat(a.call(arguments))) }) .guid = t.guid = t.guid || g.guid++, r) : void 0 }, now: Date.now, support: p }), g.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), (function(t, e) { h["[object " + e + "]"] = e.toLowerCase() })); var M = function(t) { var e, i, n, r, o, a, s, l, u, h, c, d, p, f, m, g, v, y, b, w = "sizzle" + -new Date, x = t.document, M = 0, T = 0, S = rt(), _ = rt(), A = rt(), P = function(t, e) { return t === e && (c = !0), 0 }, C = "undefined", E = {}.hasOwnProperty, D = [], L = D.pop, O = D.push, I = D.push, R = D.slice, N = D.indexOf || function(t) { for (var e = 0, i = this.length; i > e; e++) if (this[e] === t) return e; return -1 }, k = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", F = "[\\x20\\t\\r\\n\\f]", B = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", z = B.replace("w", "w#"), U = "\\[" + F + "*(" + B + ")(?:" + F + "*([*^$|!~]?=)" + F + "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + z + "))|)" + F + "*\\]", V = ":(" + B + ")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|" + U + ")*)|.*)\\)|)", j = new RegExp("^" + F + "+|((?:^|[^\\\\])(?:\\\\.)*)" + F + "+$", "g"), H = new RegExp("^" + F + "*," + F + "*"), G = new RegExp("^" + F + "*([>+~]|" + F + ")" + F + "*"), W = new RegExp("=" + F + "*([^\\]'\"]*?)" + F + "*\\]", "g"), q = new RegExp(V), Y = new RegExp("^" + z + "$"), X = { ID: new RegExp("^#(" + B + ")"), CLASS: new RegExp("^\\.(" + B + ")"), TAG: new RegExp("^(" + B.replace("w", "w*") + ")"), ATTR: new RegExp("^" + U), PSEUDO: new RegExp("^" + V), CHILD: new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + F + "*(even|odd|(([+-]|)(\\d*)n|)" + F + "*(?:([+-]|)" + F + "*(\\d+)|))" + F + "*\\)|)", "i"), bool: new RegExp("^(?:" + k + ")$", "i"), needsContext: new RegExp("^" + F + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + F + "*((?:-\\d)?\\d*)" + F + "*\\)|)(?=[^-]|$)", "i") }, Z = /^(?:input|select|textarea|button)$/i, K = /^h\d$/i, Q = /^[^{]+\{\s*\[native \w/, J = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, $ = /[+~]/, tt = /'|\\/g, et = new RegExp("\\\\([\\da-f]{1,6}" + F + "?|(" + F + ")|.)", "ig"), it = function(t, e, i) { var n = "0x" + e - 65536; return n != n || i ? e : 0 > n ? String.fromCharCode(n + 65536) : String.fromCharCode(n >> 10 | 55296, 1023 & n | 56320) }; try { I.apply(D = R.call(x.childNodes), x.childNodes), D[x.childNodes.length].nodeType } catch (t) { I = { apply: D.length ? function(t, e) { O.apply(t, R.call(e)) } : function(t, e) { for (var i = t.length, n = 0; t[i++] = e[n++];); t.length = i - 1 } } } function nt(t, e, n, r) { var o, s, u, h, c, f, v, y, M, T; if ((e ? e.ownerDocument || e : x) !== p && d(e), n = n || [], !t || "string" != typeof t) return n; if (1 !== (h = (e = e || p) .nodeType) && 9 !== h) return []; if (m && !r) { if (o = J.exec(t)) if (u = o[1]) { if (9 === h) { if (!(s = e.getElementById(u)) || !s.parentNode) return n; if (s.id === u) return n.push(s), n } else if (e.ownerDocument && (s = e.ownerDocument.getElementById(u)) && b(e, s) && s.id === u) return n.push(s), n } else { if (o[2]) return I.apply(n, e.getElementsByTagName(t)), n; if ((u = o[3]) && i.getElementsByClassName && e.getElementsByClassName) return I.apply(n, e.getElementsByClassName(u)), n } if (i.qsa && (!g || !g.test(t))) { if (y = v = w, M = e, T = 9 === h && t, 1 === h && "object" !== e.nodeName.toLowerCase()) { for (f = a(t), (v = e.getAttribute("id")) ? y = v.replace(tt, "\\$&") : e.setAttribute("id", y), y = "[id='" + y + "'] ", c = f.length; c--;) f[c] = y + ft(f[c]); M = $.test(t) && dt(e.parentNode) || e, T = f.join(",") } if (T) try { return I.apply(n, M.querySelectorAll(T)), n } catch (t) {} finally { v || e.removeAttribute("id") } } } return l(t.replace(j, "$1"), e, n, r) } function rt() { var t = []; return function e(i, r) { return t.push(i + " ") > n.cacheLength && delete e[t.shift()], e[i + " "] = r } } function ot(t) { return t[w] = !0, t } function at(t) { var e = p.createElement("div"); try { return !!t(e) } catch (t) { return !1 } finally { e.parentNode && e.parentNode.removeChild(e), e = null } } function st(t, e) { for (var i = t.split("|"), r = t.length; r--;) n.attrHandle[i[r]] = e } function lt(t, e) { var i = e && t, n = i && 1 === t.nodeType && 1 === e.nodeType && (~e.sourceIndex || 1 << 31) - (~t.sourceIndex || 1 << 31); if (n) return n; if (i) for (; i = i.nextSibling;) if (i === e) return -1; return t ? 1 : -1 } function ut(t) { return function(e) { return "input" === e.nodeName.toLowerCase() && e.type === t } } function ht(t) { return function(e) { var i = e.nodeName.toLowerCase(); return ("input" === i || "button" === i) && e.type === t } } function ct(t) { return ot((function(e) { return e = +e, ot((function(i, n) { for (var r, o = t([], i.length, e), a = o.length; a--;) i[r = o[a]] && (i[r] = !(n[r] = i[r])) })) })) } function dt(t) { return t && typeof t.getElementsByTagName !== C && t } for (e in i = nt.support = {}, o = nt.isXML = function(t) { var e = t && (t.ownerDocument || t) .documentElement; return !!e && "HTML" !== e.nodeName }, d = nt.setDocument = function(t) { var e, r = t ? t.ownerDocument || t : x, a = r.defaultView; return r !== p && 9 === r.nodeType && r.documentElement ? (p = r, f = r.documentElement, m = !o(r), a && a !== a.top && (a.addEventListener ? a.addEventListener("unload", (function() { d() }), !1) : a.attachEvent && a.attachEvent("onunload", (function() { d() }))), i.attributes = at((function(t) { return t.className = "i", !t.getAttribute("className") })), i.getElementsByTagName = at((function(t) { return t.appendChild(r.createComment("")), !t.getElementsByTagName("*") .length })), i.getElementsByClassName = Q.test(r.getElementsByClassName) && at((function(t) { return t.innerHTML = "
", t.firstChild.className = "i", 2 === t.getElementsByClassName("i") .length })), i.getById = at((function(t) { return f.appendChild(t) .id = w, !r.getElementsByName || !r.getElementsByName(w) .length })), i.getById ? (n.find.ID = function(t, e) { if (typeof e.getElementById !== C && m) { var i = e.getElementById(t); return i && i.parentNode ? [i] : [] } }, n.filter.ID = function(t) { var e = t.replace(et, it); return function(t) { return t.getAttribute("id") === e } }) : (delete n.find.ID, n.filter.ID = function(t) { var e = t.replace(et, it); return function(t) { var i = typeof t.getAttributeNode !== C && t.getAttributeNode("id"); return i && i.value === e } }), n.find.TAG = i.getElementsByTagName ? function(t, e) { return typeof e.getElementsByTagName !== C ? e.getElementsByTagName(t) : void 0 } : function(t, e) { var i, n = [], r = 0, o = e.getElementsByTagName(t); if ("*" === t) { for (; i = o[r++];) 1 === i.nodeType && n.push(i); return n } return o }, n.find.CLASS = i.getElementsByClassName && function(t, e) { return typeof e.getElementsByClassName !== C && m ? e.getElementsByClassName(t) : void 0 }, v = [], g = [], (i.qsa = Q.test(r.querySelectorAll)) && (at((function(t) { t.innerHTML = "", t.querySelectorAll("[msallowclip^='']") .length && g.push("[*^$]=" + F + "*(?:''|\"\")"), t.querySelectorAll("[selected]") .length || g.push("\\[" + F + "*(?:value|" + k + ")"), t.querySelectorAll(":checked") .length || g.push(":checked") })), at((function(t) { var e = r.createElement("input"); e.setAttribute("type", "hidden"), t.appendChild(e) .setAttribute("name", "D"), t.querySelectorAll("[name=d]") .length && g.push("name" + F + "*[*^$|!~]?="), t.querySelectorAll(":enabled") .length || g.push(":enabled", ":disabled"), t.querySelectorAll("*,:x"), g.push(",.*:") }))), (i.matchesSelector = Q.test(y = f.matches || f.webkitMatchesSelector || f.mozMatchesSelector || f.oMatchesSelector || f.msMatchesSelector)) && at((function(t) { i.disconnectedMatch = y.call(t, "div"), y.call(t, "[s!='']:x"), v.push("!=", V) })), g = g.length && new RegExp(g.join("|")), v = v.length && new RegExp(v.join("|")), e = Q.test(f.compareDocumentPosition), b = e || Q.test(f.contains) ? function(t, e) { var i = 9 === t.nodeType ? t.documentElement : t, n = e && e.parentNode; return t === n || !(!n || 1 !== n.nodeType || !(i.contains ? i.contains(n) : t.compareDocumentPosition && 16 & t.compareDocumentPosition(n))) } : function(t, e) { if (e) for (; e = e.parentNode;) if (e === t) return !0; return !1 }, P = e ? function(t, e) { if (t === e) return c = !0, 0; var n = !t.compareDocumentPosition - !e.compareDocumentPosition; return n || (1 & (n = (t.ownerDocument || t) === (e.ownerDocument || e) ? t.compareDocumentPosition(e) : 1) || !i.sortDetached && e.compareDocumentPosition(t) === n ? t === r || t.ownerDocument === x && b(x, t) ? -1 : e === r || e.ownerDocument === x && b(x, e) ? 1 : h ? N.call(h, t) - N.call(h, e) : 0 : 4 & n ? -1 : 1) } : function(t, e) { if (t === e) return c = !0, 0; var i, n = 0, o = t.parentNode, a = e.parentNode, s = [t], l = [e]; if (!o || !a) return t === r ? -1 : e === r ? 1 : o ? -1 : a ? 1 : h ? N.call(h, t) - N.call(h, e) : 0; if (o === a) return lt(t, e); for (i = t; i = i.parentNode;) s.unshift(i); for (i = e; i = i.parentNode;) l.unshift(i); for (; s[n] === l[n];) n++; return n ? lt(s[n], l[n]) : s[n] === x ? -1 : l[n] === x ? 1 : 0 }, r) : p }, nt.matches = function(t, e) { return nt(t, null, null, e) }, nt.matchesSelector = function(t, e) { if ((t.ownerDocument || t) !== p && d(t), e = e.replace(W, "='$1']"), !(!i.matchesSelector || !m || v && v.test(e) || g && g.test(e))) try { var n = y.call(t, e); if (n || i.disconnectedMatch || t.document && 11 !== t.document.nodeType) return n } catch (t) {} return nt(e, p, null, [t]) .length > 0 }, nt.contains = function(t, e) { return (t.ownerDocument || t) !== p && d(t), b(t, e) }, nt.attr = function(t, e) { (t.ownerDocument || t) !== p && d(t); var r = n.attrHandle[e.toLowerCase()], o = r && E.call(n.attrHandle, e.toLowerCase()) ? r(t, e, !m) : void 0; return void 0 !== o ? o : i.attributes || !m ? t.getAttribute(e) : (o = t.getAttributeNode(e)) && o.specified ? o.value : null }, nt.error = function(t) { throw new Error("Syntax error, unrecognized expression: " + t) }, nt.uniqueSort = function(t) { var e, n = [], r = 0, o = 0; if (c = !i.detectDuplicates, h = !i.sortStable && t.slice(0), t.sort(P), c) { for (; e = t[o++];) e === t[o] && (r = n.push(o)); for (; r--;) t.splice(n[r], 1) } return h = null, t }, r = nt.getText = function(t) { var e, i = "", n = 0, o = t.nodeType; if (o) { if (1 === o || 9 === o || 11 === o) { if ("string" == typeof t.textContent) return t.textContent; for (t = t.firstChild; t; t = t.nextSibling) i += r(t) } else if (3 === o || 4 === o) return t.nodeValue } else for (; e = t[n++];) i += r(e); return i }, (n = nt.selectors = { cacheLength: 50, createPseudo: ot, match: X, attrHandle: {}, find: {}, relative: { ">": { dir: "parentNode", first: !0 }, " ": { dir: "parentNode" }, "+": { dir: "previousSibling", first: !0 }, "~": { dir: "previousSibling" } }, preFilter: { ATTR: function(t) { return t[1] = t[1].replace(et, it), t[3] = (t[3] || t[4] || t[5] || "") .replace(et, it), "~=" === t[2] && (t[3] = " " + t[3] + " "), t.slice(0, 4) }, CHILD: function(t) { return t[1] = t[1].toLowerCase(), "nth" === t[1].slice(0, 3) ? (t[3] || nt.error(t[0]), t[4] = +(t[4] ? t[5] + (t[6] || 1) : 2 * ("even" === t[3] || "odd" === t[3])), t[5] = +(t[7] + t[8] || "odd" === t[3])) : t[3] && nt.error(t[0]), t }, PSEUDO: function(t) { var e, i = !t[6] && t[2]; return X.CHILD.test(t[0]) ? null : (t[3] ? t[2] = t[4] || t[5] || "" : i && q.test(i) && (e = a(i, !0)) && (e = i.indexOf(")", i.length - e) - i.length) && (t[0] = t[0].slice(0, e), t[2] = i.slice(0, e)), t.slice(0, 3)) } }, filter: { TAG: function(t) { var e = t.replace(et, it) .toLowerCase(); return "*" === t ? function() { return !0 } : function(t) { return t.nodeName && t.nodeName.toLowerCase() === e } }, CLASS: function(t) { var e = S[t + " "]; return e || (e = new RegExp("(^|" + F + ")" + t + "(" + F + "|$)")) && S(t, (function(t) { return e.test("string" == typeof t.className && t.className || typeof t.getAttribute !== C && t.getAttribute("class") || "") })) }, ATTR: function(t, e, i) { return function(n) { var r = nt.attr(n, t); return null == r ? "!=" === e : !e || (r += "", "=" === e ? r === i : "!=" === e ? r !== i : "^=" === e ? i && 0 === r.indexOf(i) : "*=" === e ? i && r.indexOf(i) > -1 : "$=" === e ? i && r.slice(-i.length) === i : "~=" === e ? (" " + r + " ") .indexOf(i) > -1 : "|=" === e && (r === i || r.slice(0, i.length + 1) === i + "-")) } }, CHILD: function(t, e, i, n, r) { var o = "nth" !== t.slice(0, 3), a = "last" !== t.slice(-4), s = "of-type" === e; return 1 === n && 0 === r ? function(t) { return !!t.parentNode } : function(e, i, l) { var u, h, c, d, p, f, m = o !== a ? "nextSibling" : "previousSibling", g = e.parentNode, v = s && e.nodeName.toLowerCase(), y = !l && !s; if (g) { if (o) { for (; m;) { for (c = e; c = c[m];) if (s ? c.nodeName.toLowerCase() === v : 1 === c.nodeType) return !1; f = m = "only" === t && !f && "nextSibling" } return !0 } if (f = [a ? g.firstChild : g.lastChild], a && y) { for (p = (u = (h = g[w] || (g[w] = {}))[t] || [])[0] === M && u[1], d = u[0] === M && u[2], c = p && g.childNodes[p]; c = ++p && c && c[m] || (d = p = 0) || f.pop();) if (1 === c.nodeType && ++d && c === e) { h[t] = [M, p, d]; break } } else if (y && (u = (e[w] || (e[w] = {}))[t]) && u[0] === M) d = u[1]; else for (; (c = ++p && c && c[m] || (d = p = 0) || f.pop()) && ((s ? c.nodeName.toLowerCase() !== v : 1 !== c.nodeType) || !++d || (y && ((c[w] || (c[w] = {}))[t] = [M, d]), c !== e));); return (d -= r) === n || d % n == 0 && d / n >= 0 } } }, PSEUDO: function(t, e) { var i, r = n.pseudos[t] || n.setFilters[t.toLowerCase()] || nt.error("unsupported pseudo: " + t); return r[w] ? r(e) : r.length > 1 ? (i = [t, t, "", e], n.setFilters.hasOwnProperty(t.toLowerCase()) ? ot((function(t, i) { for (var n, o = r(t, e), a = o.length; a--;) t[n = N.call(t, o[a])] = !(i[n] = o[a]) })) : function(t) { return r(t, 0, i) }) : r } }, pseudos: { not: ot((function(t) { var e = [], i = [], n = s(t.replace(j, "$1")); return n[w] ? ot((function(t, e, i, r) { for (var o, a = n(t, null, r, []), s = t.length; s--;)(o = a[s]) && (t[s] = !(e[s] = o)) })) : function(t, r, o) { return e[0] = t, n(e, null, o, i), !i.pop() } })), has: ot((function(t) { return function(e) { return nt(t, e) .length > 0 } })), contains: ot((function(t) { return function(e) { return (e.textContent || e.innerText || r(e)) .indexOf(t) > -1 } })), lang: ot((function(t) { return Y.test(t || "") || nt.error("unsupported lang: " + t), t = t.replace(et, it) .toLowerCase(), function(e) { var i; do { if (i = m ? e.lang : e.getAttribute("xml:lang") || e.getAttribute("lang")) return (i = i.toLowerCase()) === t || 0 === i.indexOf(t + "-") } while ((e = e.parentNode) && 1 === e.nodeType); return !1 } })), target: function(e) { var i = t.location && t.location.hash; return i && i.slice(1) === e.id }, root: function(t) { return t === f }, focus: function(t) { return t === p.activeElement && (!p.hasFocus || p.hasFocus()) && !!(t.type || t.href || ~t.tabIndex) }, enabled: function(t) { return !1 === t.disabled }, disabled: function(t) { return !0 === t.disabled }, checked: function(t) { var e = t.nodeName.toLowerCase(); return "input" === e && !!t.checked || "option" === e && !!t.selected }, selected: function(t) { return t.parentNode && t.parentNode.selectedIndex, !0 === t.selected }, empty: function(t) { for (t = t.firstChild; t; t = t.nextSibling) if (t.nodeType < 6) return !1; return !0 }, parent: function(t) { return !n.pseudos.empty(t) }, header: function(t) { return K.test(t.nodeName) }, input: function(t) { return Z.test(t.nodeName) }, button: function(t) { var e = t.nodeName.toLowerCase(); return "input" === e && "button" === t.type || "button" === e }, text: function(t) { var e; return "input" === t.nodeName.toLowerCase() && "text" === t.type && (null == (e = t.getAttribute("type")) || "text" === e.toLowerCase()) }, first: ct((function() { return [0] })), last: ct((function(t, e) { return [e - 1] })), eq: ct((function(t, e, i) { return [0 > i ? i + e : i] })), even: ct((function(t, e) { for (var i = 0; e > i; i += 2) t.push(i); return t })), odd: ct((function(t, e) { for (var i = 1; e > i; i += 2) t.push(i); return t })), lt: ct((function(t, e, i) { for (var n = 0 > i ? i + e : i; --n >= 0;) t.push(n); return t })), gt: ct((function(t, e, i) { for (var n = 0 > i ? i + e : i; ++n < e;) t.push(n); return t })) } }) .pseudos.nth = n.pseudos.eq, { radio: !0, checkbox: !0, file: !0, password: !0, image: !0 }) n.pseudos[e] = ut(e); for (e in { submit: !0, reset: !0 }) n.pseudos[e] = ht(e); function pt() {} function ft(t) { for (var e = 0, i = t.length, n = ""; i > e; e++) n += t[e].value; return n } function mt(t, e, i) { var n = e.dir, r = i && "parentNode" === n, o = T++; return e.first ? function(e, i, o) { for (; e = e[n];) if (1 === e.nodeType || r) return t(e, i, o) } : function(e, i, a) { var s, l, u = [M, o]; if (a) { for (; e = e[n];) if ((1 === e.nodeType || r) && t(e, i, a)) return !0 } else for (; e = e[n];) if (1 === e.nodeType || r) { if ((s = (l = e[w] || (e[w] = {}))[n]) && s[0] === M && s[1] === o) return u[2] = s[2]; if (l[n] = u, u[2] = t(e, i, a)) return !0 } } } function gt(t) { return t.length > 1 ? function(e, i, n) { for (var r = t.length; r--;) if (!t[r](e, i, n)) return !1; return !0 } : t[0] } function vt(t, e, i, n, r) { for (var o, a = [], s = 0, l = t.length, u = null != e; l > s; s++)(o = t[s]) && (!i || i(o, n, r)) && (a.push(o), u && e.push(s)); return a } function yt(t, e, i, n, r, o) { return n && !n[w] && (n = yt(n)), r && !r[w] && (r = yt(r, o)), ot((function(o, a, s, l) { var u, h, c, d = [], p = [], f = a.length, m = o || function(t, e, i) { for (var n = 0, r = e.length; r > n; n++) nt(t, e[n], i); return i }(e || "*", s.nodeType ? [s] : s, []), g = !t || !o && e ? m : vt(m, d, t, s, l), v = i ? r || (o ? t : f || n) ? [] : a : g; if (i && i(g, v, s, l), n) for (u = vt(v, p), n(u, [], s, l), h = u.length; h--;)(c = u[h]) && (v[p[h]] = !(g[p[h]] = c)); if (o) { if (r || t) { if (r) { for (u = [], h = v.length; h--;)(c = v[h]) && u.push(g[h] = c); r(null, v = [], u, l) } for (h = v.length; h--;)(c = v[h]) && (u = r ? N.call(o, c) : d[h]) > -1 && (o[u] = !(a[u] = c)) } } else v = vt(v === a ? v.splice(f, v.length) : v), r ? r(null, a, v, l) : I.apply(a, v) })) } function bt(t) { for (var e, i, r, o = t.length, a = n.relative[t[0].type], s = a || n.relative[" "], l = a ? 1 : 0, h = mt((function(t) { return t === e }), s, !0), c = mt((function(t) { return N.call(e, t) > -1 }), s, !0), d = [function(t, i, n) { return !a && (n || i !== u) || ((e = i) .nodeType ? h(t, i, n) : c(t, i, n)) }]; o > l; l++) if (i = n.relative[t[l].type]) d = [mt(gt(d), i)]; else { if ((i = n.filter[t[l].type].apply(null, t[l].matches))[w]) { for (r = ++l; o > r && !n.relative[t[r].type]; r++); return yt(l > 1 && gt(d), l > 1 && ft(t.slice(0, l - 1) .concat({ value: " " === t[l - 2].type ? "*" : "" })) .replace(j, "$1"), i, r > l && bt(t.slice(l, r)), o > r && bt(t = t.slice(r)), o > r && ft(t)) } d.push(i) } return gt(d) } function wt(t, e) { var i = e.length > 0, r = t.length > 0, o = function(o, a, s, l, h) { var c, d, f, m = 0, g = "0", v = o && [], y = [], b = u, w = o || r && n.find.TAG("*", h), x = M += null == b ? 1 : Math.random() || .1, T = w.length; for (h && (u = a !== p && a); g !== T && null != (c = w[g]); g++) { if (r && c) { for (d = 0; f = t[d++];) if (f(c, a, s)) { l.push(c); break } h && (M = x) } i && ((c = !f && c) && m--, o && v.push(c)) } if (m += g, i && g !== m) { for (d = 0; f = e[d++];) f(v, y, a, s); if (o) { if (m > 0) for (; g--;) v[g] || y[g] || (y[g] = L.call(l)); y = vt(y) } I.apply(l, y), h && !o && y.length > 0 && m + e.length > 1 && nt.uniqueSort(l) } return h && (M = x, u = b), v }; return i ? ot(o) : o } return pt.prototype = n.filters = n.pseudos, n.setFilters = new pt, a = nt.tokenize = function(t, e) { var i, r, o, a, s, l, u, h = _[t + " "]; if (h) return e ? 0 : h.slice(0); for (s = t, l = [], u = n.preFilter; s;) { for (a in (!i || (r = H.exec(s))) && (r && (s = s.slice(r[0].length) || s), l.push(o = [])), i = !1, (r = G.exec(s)) && (i = r.shift(), o.push({ value: i, type: r[0].replace(j, " ") }), s = s.slice(i.length)), n.filter) !(r = X[a].exec(s)) || u[a] && !(r = u[a](r)) || (i = r.shift(), o.push({ value: i, type: a, matches: r }), s = s.slice(i.length)); if (!i) break } return e ? s.length : s ? nt.error(t) : _(t, l) .slice(0) }, s = nt.compile = function(t, e) { var i, n = [], r = [], o = A[t + " "]; if (!o) { for (e || (e = a(t)), i = e.length; i--;)(o = bt(e[i]))[w] ? n.push(o) : r.push(o); (o = A(t, wt(r, n))) .selector = t } return o }, l = nt.select = function(t, e, r, o) { var l, u, h, c, d, p = "function" == typeof t && t, f = !o && a(t = p.selector || t); if (r = r || [], 1 === f.length) { if ((u = f[0] = f[0].slice(0)) .length > 2 && "ID" === (h = u[0]) .type && i.getById && 9 === e.nodeType && m && n.relative[u[1].type]) { if (!(e = (n.find.ID(h.matches[0].replace(et, it), e) || [])[0])) return r; p && (e = e.parentNode), t = t.slice(u.shift() .value.length) } for (l = X.needsContext.test(t) ? 0 : u.length; l-- && (h = u[l], !n.relative[c = h.type]);) if ((d = n.find[c]) && (o = d(h.matches[0].replace(et, it), $.test(u[0].type) && dt(e.parentNode) || e))) { if (u.splice(l, 1), !(t = o.length && ft(u))) return I.apply(r, o), r; break } } return (p || s(t, f))(o, e, !m, r, $.test(t) && dt(e.parentNode) || e), r }, i.sortStable = w.split("") .sort(P) .join("") === w, i.detectDuplicates = !!c, d(), i.sortDetached = at((function(t) { return 1 & t.compareDocumentPosition(p.createElement("div")) })), at((function(t) { return t.innerHTML = "", "#" === t.firstChild.getAttribute("href") })) || st("type|href|height|width", (function(t, e, i) { return i ? void 0 : t.getAttribute(e, "type" === e.toLowerCase() ? 1 : 2) })), i.attributes && at((function(t) { return t.innerHTML = "", t.firstChild.setAttribute("value", ""), "" === t.firstChild.getAttribute("value") })) || st("value", (function(t, e, i) { return i || "input" !== t.nodeName.toLowerCase() ? void 0 : t.defaultValue })), at((function(t) { return null == t.getAttribute("disabled") })) || st(k, (function(t, e, i) { var n; return i ? void 0 : !0 === t[e] ? e.toLowerCase() : (n = t.getAttributeNode(e)) && n.specified ? n.value : null })), nt }(i); g.find = M, g.expr = M.selectors, g.expr[":"] = g.expr.pseudos, g.unique = M.uniqueSort, g.text = M.getText, g.isXMLDoc = M.isXML, g.contains = M.contains; var T = g.expr.match.needsContext, S = /^<(\w+)\s*\/?>(?:<\/\1>|)$/, _ = /^.[^:#\[\.,]*$/; function A(t, e, i) { if (g.isFunction(e)) return g.grep(t, (function(t, n) { return !!e.call(t, n, t) !== i })); if (e.nodeType) return g.grep(t, (function(t) { return t === e !== i })); if ("string" == typeof e) { if (_.test(e)) return g.filter(e, t, i); e = g.filter(e, t) } return g.grep(t, (function(t) { return u.call(e, t) >= 0 !== i })) } g.filter = function(t, e, i) { var n = e[0]; return i && (t = ":not(" + t + ")"), 1 === e.length && 1 === n.nodeType ? g.find.matchesSelector(n, t) ? [n] : [] : g.find.matches(t, g.grep(e, (function(t) { return 1 === t.nodeType }))) }, g.fn.extend({ find: function(t) { var e, i = this.length, n = [], r = this; if ("string" != typeof t) return this.pushStack(g(t) .filter((function() { for (e = 0; i > e; e++) if (g.contains(r[e], this)) return !0 }))); for (e = 0; i > e; e++) g.find(t, r[e], n); return (n = this.pushStack(i > 1 ? g.unique(n) : n)) .selector = this.selector ? this.selector + " " + t : t, n }, filter: function(t) { return this.pushStack(A(this, t || [], !1)) }, not: function(t) { return this.pushStack(A(this, t || [], !0)) }, is: function(t) { return !!A(this, "string" == typeof t && T.test(t) ? g(t) : t || [], !1) .length } }); var P, C = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/; (g.fn.init = function(t, e) { var i, n; if (!t) return this; if ("string" == typeof t) { if (!(i = "<" === t[0] && ">" === t[t.length - 1] && t.length >= 3 ? [null, t, null] : C.exec(t)) || !i[1] && e) return !e || e.jquery ? (e || P) .find(t) : this.constructor(e) .find(t); if (i[1]) { if (e = e instanceof g ? e[0] : e, g.merge(this, g.parseHTML(i[1], e && e.nodeType ? e.ownerDocument || e : f, !0)), S.test(i[1]) && g.isPlainObject(e)) for (i in e) g.isFunction(this[i]) ? this[i](e[i]) : this.attr(i, e[i]); return this } return (n = f.getElementById(i[2])) && n.parentNode && (this.length = 1, this[0] = n), this.context = f, this.selector = t, this } return t.nodeType ? (this.context = this[0] = t, this.length = 1, this) : g.isFunction(t) ? void 0 !== P.ready ? P.ready(t) : t(g) : (void 0 !== t.selector && (this.selector = t.selector, this.context = t.context), g.makeArray(t, this)) }) .prototype = g.fn, P = g(f); var E = /^(?:parents|prev(?:Until|All))/, D = { children: !0, contents: !0, next: !0, prev: !0 }; function L(t, e) { for (; (t = t[e]) && 1 !== t.nodeType;); return t } g.extend({ dir: function(t, e, i) { for (var n = [], r = void 0 !== i; (t = t[e]) && 9 !== t.nodeType;) if (1 === t.nodeType) { if (r && g(t) .is(i)) break; n.push(t) } return n }, sibling: function(t, e) { for (var i = []; t; t = t.nextSibling) 1 === t.nodeType && t !== e && i.push(t); return i } }), g.fn.extend({ has: function(t) { var e = g(t, this), i = e.length; return this.filter((function() { for (var t = 0; i > t; t++) if (g.contains(this, e[t])) return !0 })) }, closest: function(t, e) { for (var i, n = 0, r = this.length, o = [], a = T.test(t) || "string" != typeof t ? g(t, e || this.context) : 0; r > n; n++) for (i = this[n]; i && i !== e; i = i.parentNode) if (i.nodeType < 11 && (a ? a.index(i) > -1 : 1 === i.nodeType && g.find.matchesSelector(i, t))) { o.push(i); break } return this.pushStack(o.length > 1 ? g.unique(o) : o) }, index: function(t) { return t ? "string" == typeof t ? u.call(g(t), this[0]) : u.call(this, t.jquery ? t[0] : t) : this[0] && this[0].parentNode ? this.first() .prevAll() .length : -1 }, add: function(t, e) { return this.pushStack(g.unique(g.merge(this.get(), g(t, e)))) }, addBack: function(t) { return this.add(null == t ? this.prevObject : this.prevObject.filter(t)) } }), g.each({ parent: function(t) { var e = t.parentNode; return e && 11 !== e.nodeType ? e : null }, parents: function(t) { return g.dir(t, "parentNode") }, parentsUntil: function(t, e, i) { return g.dir(t, "parentNode", i) }, next: function(t) { return L(t, "nextSibling") }, prev: function(t) { return L(t, "previousSibling") }, nextAll: function(t) { return g.dir(t, "nextSibling") }, prevAll: function(t) { return g.dir(t, "previousSibling") }, nextUntil: function(t, e, i) { return g.dir(t, "nextSibling", i) }, prevUntil: function(t, e, i) { return g.dir(t, "previousSibling", i) }, siblings: function(t) { return g.sibling((t.parentNode || {}) .firstChild, t) }, children: function(t) { return g.sibling(t.firstChild) }, contents: function(t) { return t.contentDocument || g.merge([], t.childNodes) } }, (function(t, e) { g.fn[t] = function(i, n) { var r = g.map(this, e, i); return "Until" !== t.slice(-5) && (n = i), n && "string" == typeof n && (r = g.filter(n, r)), this.length > 1 && (D[t] || g.unique(r), E.test(t) && r.reverse()), this.pushStack(r) } })); var O, I = /\S+/g, R = {}; function N() { f.removeEventListener("DOMContentLoaded", N, !1), i.removeEventListener("load", N, !1), g.ready() } g.Callbacks = function(t) { t = "string" == typeof t ? R[t] || function(t) { var e = R[t] = {}; return g.each(t.match(I) || [], (function(t, i) { e[i] = !0 })), e }(t) : g.extend({}, t); var e, i, n, r, o, a, s = [], l = !t.once && [], u = function(c) { for (e = t.memory && c, i = !0, a = r || 0, r = 0, o = s.length, n = !0; s && o > a; a++) if (!1 === s[a].apply(c[0], c[1]) && t.stopOnFalse) { e = !1; break } n = !1, s && (l ? l.length && u(l.shift()) : e ? s = [] : h.disable()) }, h = { add: function() { if (s) { var i = s.length; ! function e(i) { g.each(i, (function(i, n) { var r = g.type(n); "function" === r ? t.unique && h.has(n) || s.push(n) : n && n.length && "string" !== r && e(n) })) }(arguments), n ? o = s.length : e && (r = i, u(e)) } return this }, remove: function() { return s && g.each(arguments, (function(t, e) { for (var i; (i = g.inArray(e, s, i)) > -1;) s.splice(i, 1), n && (o >= i && o--, a >= i && a--) })), this }, has: function(t) { return t ? g.inArray(t, s) > -1 : !(!s || !s.length) }, empty: function() { return s = [], o = 0, this }, disable: function() { return s = l = e = void 0, this }, disabled: function() { return !s }, lock: function() { return l = void 0, e || h.disable(), this }, locked: function() { return !l }, fireWith: function(t, e) { return !s || i && !l || (e = [t, (e = e || []) .slice ? e.slice() : e ], n ? l.push(e) : u(e)), this }, fire: function() { return h.fireWith(this, arguments), this }, fired: function() { return !!i } }; return h }, g.extend({ Deferred: function(t) { var e = [ ["resolve", "done", g.Callbacks("once memory"), "resolved"], ["reject", "fail", g.Callbacks("once memory"), "rejected"], ["notify", "progress", g.Callbacks("memory")] ], i = "pending", n = { state: function() { return i }, always: function() { return r.done(arguments) .fail(arguments), this }, then: function() { var t = arguments; return g.Deferred((function(i) { g.each(e, (function(e, o) { var a = g.isFunction(t[e]) && t[e]; r[o[1]]((function() { var t = a && a.apply(this, arguments); t && g.isFunction(t.promise) ? t.promise() .done(i.resolve) .fail(i.reject) .progress(i.notify) : i[o[0] + "With"](this === n ? i.promise() : this, a ? [t] : arguments) })) })), t = null })) .promise() }, promise: function(t) { return null != t ? g.extend(t, n) : n } }, r = {}; return n.pipe = n.then, g.each(e, (function(t, o) { var a = o[2], s = o[3]; n[o[1]] = a.add, s && a.add((function() { i = s }), e[1 ^ t][2].disable, e[2][2].lock), r[o[0]] = function() { return r[o[0] + "With"](this === r ? n : this, arguments), this }, r[o[0] + "With"] = a.fireWith })), n.promise(r), t && t.call(r, r), r }, when: function(t) { var e, i, n, r = 0, o = a.call(arguments), s = o.length, l = 1 !== s || t && g.isFunction(t.promise) ? s : 0, u = 1 === l ? t : g.Deferred(), h = function(t, i, n) { return function(r) { i[t] = this, n[t] = arguments.length > 1 ? a.call(arguments) : r, n === e ? u.notifyWith(i, n) : --l || u.resolveWith(i, n) } }; if (s > 1) for (e = new Array(s), i = new Array(s), n = new Array(s); s > r; r++) o[r] && g.isFunction(o[r].promise) ? o[r].promise() .done(h(r, n, o)) .fail(u.reject) .progress(h(r, i, e)) : --l; return l || u.resolveWith(n, o), u.promise() } }), g.fn.ready = function(t) { return g.ready.promise() .done(t), this }, g.extend({ isReady: !1, readyWait: 1, holdReady: function(t) { t ? g.readyWait++ : g.ready(!0) }, ready: function(t) { (!0 === t ? --g.readyWait : g.isReady) || (g.isReady = !0, !0 !== t && --g.readyWait > 0 || (O.resolveWith(f, [g]), g.fn.triggerHandler && (g(f) .triggerHandler("ready"), g(f) .off("ready")))) } }), g.ready.promise = function(t) { return O || (O = g.Deferred(), "complete" === f.readyState ? setTimeout(g.ready) : (f.addEventListener("DOMContentLoaded", N, !1), i.addEventListener("load", N, !1))), O.promise(t) }, g.ready.promise(); var k = g.access = function(t, e, i, n, r, o, a) { var s = 0, l = t.length, u = null == i; if ("object" === g.type(i)) for (s in r = !0, i) g.access(t, e, s, i[s], !0, o, a); else if (void 0 !== n && (r = !0, g.isFunction(n) || (a = !0), u && (a ? (e.call(t, n), e = null) : (u = e, e = function(t, e, i) { return u.call(g(t), i) })), e)) for (; l > s; s++) e(t[s], i, a ? n : n.call(t[s], s, e(t[s], i))); return r ? t : u ? e.call(t) : l ? e(t[0], i) : o }; function F() { Object.defineProperty(this.cache = {}, 0, { get: function() { return {} } }), this.expando = g.expando + Math.random() } g.acceptData = function(t) { return 1 === t.nodeType || 9 === t.nodeType || !+t.nodeType }, F.uid = 1, F.accepts = g.acceptData, F.prototype = { key: function(t) { if (!F.accepts(t)) return 0; var e = {}, i = t[this.expando]; if (!i) { i = F.uid++; try { e[this.expando] = { value: i }, Object.defineProperties(t, e) } catch (n) { e[this.expando] = i, g.extend(t, e) } } return this.cache[i] || (this.cache[i] = {}), i }, set: function(t, e, i) { var n, r = this.key(t), o = this.cache[r]; if ("string" == typeof e) o[e] = i; else if (g.isEmptyObject(o)) g.extend(this.cache[r], e); else for (n in e) o[n] = e[n]; return o }, get: function(t, e) { var i = this.cache[this.key(t)]; return void 0 === e ? i : i[e] }, access: function(t, e, i) { var n; return void 0 === e || e && "string" == typeof e && void 0 === i ? void 0 !== (n = this.get(t, e)) ? n : this.get(t, g.camelCase(e)) : (this.set(t, e, i), void 0 !== i ? i : e) }, remove: function(t, e) { var i, n, r, o = this.key(t), a = this.cache[o]; if (void 0 === e) this.cache[o] = {}; else { g.isArray(e) ? n = e.concat(e.map(g.camelCase)) : (r = g.camelCase(e), e in a ? n = [e, r] : n = (n = r) in a ? [n] : n.match(I) || []), i = n.length; for (; i--;) delete a[n[i]] } }, hasData: function(t) { return !g.isEmptyObject(this.cache[t[this.expando]] || {}) }, discard: function(t) { t[this.expando] && delete this.cache[t[this.expando]] } }; var B = new F, z = new F, U = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, V = /([A-Z])/g; function j(t, e, i) { var n; if (void 0 === i && 1 === t.nodeType) if (n = "data-" + e.replace(V, "-$1") .toLowerCase(), "string" == typeof(i = t.getAttribute(n))) { try { i = "true" === i || "false" !== i && ("null" === i ? null : +i + "" === i ? +i : U.test(i) ? g.parseJSON(i) : i) } catch (t) {} z.set(t, e, i) } else i = void 0; return i } g.extend({ hasData: function(t) { return z.hasData(t) || B.hasData(t) }, data: function(t, e, i) { return z.access(t, e, i) }, removeData: function(t, e) { z.remove(t, e) }, _data: function(t, e, i) { return B.access(t, e, i) }, _removeData: function(t, e) { B.remove(t, e) } }), g.fn.extend({ data: function(t, e) { var i, n, r, o = this[0], a = o && o.attributes; if (void 0 === t) { if (this.length && (r = z.get(o), 1 === o.nodeType && !B.get(o, "hasDataAttrs"))) { for (i = a.length; i--;) a[i] && (0 === (n = a[i].name) .indexOf("data-") && (n = g.camelCase(n.slice(5)), j(o, n, r[n]))); B.set(o, "hasDataAttrs", !0) } return r } return "object" == typeof t ? this.each((function() { z.set(this, t) })) : k(this, (function(e) { var i, n = g.camelCase(t); if (o && void 0 === e) { if (void 0 !== (i = z.get(o, t))) return i; if (void 0 !== (i = z.get(o, n))) return i; if (void 0 !== (i = j(o, n, void 0))) return i } else this.each((function() { var i = z.get(this, n); z.set(this, n, e), -1 !== t.indexOf("-") && void 0 !== i && z.set(this, t, e) })) }), null, e, arguments.length > 1, null, !0) }, removeData: function(t) { return this.each((function() { z.remove(this, t) })) } }), g.extend({ queue: function(t, e, i) { var n; return t ? (e = (e || "fx") + "queue", n = B.get(t, e), i && (!n || g.isArray(i) ? n = B.access(t, e, g.makeArray(i)) : n.push(i)), n || []) : void 0 }, dequeue: function(t, e) { e = e || "fx"; var i = g.queue(t, e), n = i.length, r = i.shift(), o = g._queueHooks(t, e); "inprogress" === r && (r = i.shift(), n--), r && ("fx" === e && i.unshift("inprogress"), delete o.stop, r.call(t, (function() { g.dequeue(t, e) }), o)), !n && o && o.empty.fire() }, _queueHooks: function(t, e) { var i = e + "queueHooks"; return B.get(t, i) || B.access(t, i, { empty: g.Callbacks("once memory") .add((function() { B.remove(t, [e + "queue", i]) })) }) } }), g.fn.extend({ queue: function(t, e) { var i = 2; return "string" != typeof t && (e = t, t = "fx", i--), arguments.length < i ? g.queue(this[0], t) : void 0 === e ? this : this.each((function() { var i = g.queue(this, t, e); g._queueHooks(this, t), "fx" === t && "inprogress" !== i[0] && g.dequeue(this, t) })) }, dequeue: function(t) { return this.each((function() { g.dequeue(this, t) })) }, clearQueue: function(t) { return this.queue(t || "fx", []) }, promise: function(t, e) { var i, n = 1, r = g.Deferred(), o = this, a = this.length, s = function() { --n || r.resolveWith(o, [o]) }; for ("string" != typeof t && (e = t, t = void 0), t = t || "fx"; a--;)(i = B.get(o[a], t + "queueHooks")) && i.empty && (n++, i.empty.add(s)); return s(), r.promise(e) } }); var H = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source, G = ["Top", "Right", "Bottom", "Left"], W = function(t, e) { return t = e || t, "none" === g.css(t, "display") || !g.contains(t.ownerDocument, t) }, q = /^(?:checkbox|radio)$/i; ! function() { var t = f.createDocumentFragment() .appendChild(f.createElement("div")), e = f.createElement("input"); e.setAttribute("type", "radio"), e.setAttribute("checked", "checked"), e.setAttribute("name", "t"), t.appendChild(e), p.checkClone = t.cloneNode(!0) .cloneNode(!0) .lastChild.checked, t.innerHTML = "", p.noCloneChecked = !!t.cloneNode(!0) .lastChild.defaultValue }(); var Y = "undefined"; p.focusinBubbles = "onfocusin" in i; var X = /^key/, Z = /^(?:mouse|pointer|contextmenu)|click/, K = /^(?:focusinfocus|focusoutblur)$/, Q = /^([^.]*)(?:\.(.+)|)$/; function J() { return !0 } function $() { return !1 } function tt() { try { return f.activeElement } catch (t) {} } g.event = { global: {}, add: function(t, e, i, n, r) { var o, a, s, l, u, h, c, d, p, f, m, v = B.get(t); if (v) for (i.handler && (i = (o = i) .handler, r = o.selector), i.guid || (i.guid = g.guid++), (l = v.events) || (l = v.events = {}), (a = v.handle) || (a = v.handle = function(e) { return typeof g !== Y && g.event.triggered !== e.type ? g.event.dispatch.apply(t, arguments) : void 0 }), u = (e = (e || "") .match(I) || [""]) .length; u--;) p = m = (s = Q.exec(e[u]) || [])[1], f = (s[2] || "") .split(".") .sort(), p && (c = g.event.special[p] || {}, p = (r ? c.delegateType : c.bindType) || p, c = g.event.special[p] || {}, h = g.extend({ type: p, origType: m, data: n, handler: i, guid: i.guid, selector: r, needsContext: r && g.expr.match.needsContext.test(r), namespace: f.join(".") }, o), (d = l[p]) || ((d = l[p] = []) .delegateCount = 0, c.setup && !1 !== c.setup.call(t, n, f, a) || t.addEventListener && t.addEventListener(p, a, !1)), c.add && (c.add.call(t, h), h.handler.guid || (h.handler.guid = i.guid)), r ? d.splice(d.delegateCount++, 0, h) : d.push(h), g.event.global[p] = !0) }, remove: function(t, e, i, n, r) { var o, a, s, l, u, h, c, d, p, f, m, v = B.hasData(t) && B.get(t); if (v && (l = v.events)) { for (u = (e = (e || "") .match(I) || [""]) .length; u--;) if (p = m = (s = Q.exec(e[u]) || [])[1], f = (s[2] || "") .split(".") .sort(), p) { for (c = g.event.special[p] || {}, d = l[p = (n ? c.delegateType : c.bindType) || p] || [], s = s[2] && new RegExp("(^|\\.)" + f.join("\\.(?:.*\\.|)") + "(\\.|$)"), a = o = d.length; o--;) h = d[o], !r && m !== h.origType || i && i.guid !== h.guid || s && !s.test(h.namespace) || n && n !== h.selector && ("**" !== n || !h.selector) || (d.splice(o, 1), h.selector && d.delegateCount--, c.remove && c.remove.call(t, h)); a && !d.length && (c.teardown && !1 !== c.teardown.call(t, f, v.handle) || g.removeEvent(t, p, v.handle), delete l[p]) } else for (p in l) g.event.remove(t, p + e[u], i, n, !0); g.isEmptyObject(l) && (delete v.handle, B.remove(t, "events")) } }, trigger: function(t, e, n, r) { var o, a, s, l, u, h, c, p = [n || f], m = d.call(t, "type") ? t.type : t, v = d.call(t, "namespace") ? t.namespace.split(".") : []; if (a = s = n = n || f, 3 !== n.nodeType && 8 !== n.nodeType && !K.test(m + g.event.triggered) && (m.indexOf(".") >= 0 && (v = m.split("."), m = v.shift(), v.sort()), u = m.indexOf(":") < 0 && "on" + m, (t = t[g.expando] ? t : new g.Event(m, "object" == typeof t && t)) .isTrigger = r ? 2 : 3, t.namespace = v.join("."), t.namespace_re = t.namespace ? new RegExp("(^|\\.)" + v.join("\\.(?:.*\\.|)") + "(\\.|$)") : null, t.result = void 0, t.target || (t.target = n), e = null == e ? [t] : g.makeArray(e, [t]), c = g.event.special[m] || {}, r || !c.trigger || !1 !== c.trigger.apply(n, e))) { if (!r && !c.noBubble && !g.isWindow(n)) { for (l = c.delegateType || m, K.test(l + m) || (a = a.parentNode); a; a = a.parentNode) p.push(a), s = a; s === (n.ownerDocument || f) && p.push(s.defaultView || s.parentWindow || i) } for (o = 0; (a = p[o++]) && !t.isPropagationStopped();) t.type = o > 1 ? l : c.bindType || m, (h = (B.get(a, "events") || {})[t.type] && B.get(a, "handle")) && h.apply(a, e), (h = u && a[u]) && h.apply && g.acceptData(a) && (t.result = h.apply(a, e), !1 === t.result && t.preventDefault()); return t.type = m, r || t.isDefaultPrevented() || c._default && !1 !== c._default.apply(p.pop(), e) || !g.acceptData(n) || u && g.isFunction(n[m]) && !g.isWindow(n) && ((s = n[u]) && (n[u] = null), g.event.triggered = m, n[m](), g.event.triggered = void 0, s && (n[u] = s)), t.result } }, dispatch: function(t) { t = g.event.fix(t); var e, i, n, r, o, s = [], l = a.call(arguments), u = (B.get(this, "events") || {})[t.type] || [], h = g.event.special[t.type] || {}; if (l[0] = t, t.delegateTarget = this, !h.preDispatch || !1 !== h.preDispatch.call(this, t)) { for (s = g.event.handlers.call(this, t, u), e = 0; (r = s[e++]) && !t.isPropagationStopped();) for (t.currentTarget = r.elem, i = 0; (o = r.handlers[i++]) && !t.isImmediatePropagationStopped();)(!t.namespace_re || t.namespace_re.test(o.namespace)) && (t.handleObj = o, t.data = o.data, void 0 !== (n = ((g.event.special[o.origType] || {}) .handle || o.handler) .apply(r.elem, l)) && !1 === (t.result = n) && (t.preventDefault(), t.stopPropagation())); return h.postDispatch && h.postDispatch.call(this, t), t.result } }, handlers: function(t, e) { var i, n, r, o, a = [], s = e.delegateCount, l = t.target; if (s && l.nodeType && (!t.button || "click" !== t.type)) for (; l !== this; l = l.parentNode || this) if (!0 !== l.disabled || "click" !== t.type) { for (n = [], i = 0; s > i; i++) void 0 === n[r = (o = e[i]) .selector + " "] && (n[r] = o.needsContext ? g(r, this) .index(l) >= 0 : g.find(r, this, null, [l]) .length), n[r] && n.push(o); n.length && a.push({ elem: l, handlers: n }) } return s < e.length && a.push({ elem: this, handlers: e.slice(s) }), a }, props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), fixHooks: {}, keyHooks: { props: "char charCode key keyCode".split(" "), filter: function(t, e) { return null == t.which && (t.which = null != e.charCode ? e.charCode : e.keyCode), t } }, mouseHooks: { props: "button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "), filter: function(t, e) { var i, n, r, o = e.button; return null == t.pageX && null != e.clientX && (n = (i = t.target.ownerDocument || f) .documentElement, r = i.body, t.pageX = e.clientX + (n && n.scrollLeft || r && r.scrollLeft || 0) - (n && n.clientLeft || r && r.clientLeft || 0), t.pageY = e.clientY + (n && n.scrollTop || r && r.scrollTop || 0) - (n && n.clientTop || r && r.clientTop || 0)), t.which || void 0 === o || (t.which = 1 & o ? 1 : 2 & o ? 3 : 4 & o ? 2 : 0), t } }, fix: function(t) { if (t[g.expando]) return t; var e, i, n, r = t.type, o = t, a = this.fixHooks[r]; for (a || (this.fixHooks[r] = a = Z.test(r) ? this.mouseHooks : X.test(r) ? this.keyHooks : {}), n = a.props ? this.props.concat(a.props) : this.props, t = new g.Event(o), e = n.length; e--;) t[i = n[e]] = o[i]; return t.target || (t.target = f), 3 === t.target.nodeType && (t.target = t.target.parentNode), a.filter ? a.filter(t, o) : t }, special: { load: { noBubble: !0 }, focus: { trigger: function() { return this !== tt() && this.focus ? (this.focus(), !1) : void 0 }, delegateType: "focusin" }, blur: { trigger: function() { return this === tt() && this.blur ? (this.blur(), !1) : void 0 }, delegateType: "focusout" }, click: { trigger: function() { return "checkbox" === this.type && this.click && g.nodeName(this, "input") ? (this.click(), !1) : void 0 }, _default: function(t) { return g.nodeName(t.target, "a") } }, beforeunload: { postDispatch: function(t) { void 0 !== t.result && t.originalEvent && (t.originalEvent.returnValue = t.result) } } }, simulate: function(t, e, i, n) { var r = g.extend(new g.Event, i, { type: t, isSimulated: !0, originalEvent: {} }); n ? g.event.trigger(r, null, e) : g.event.dispatch.call(e, r), r.isDefaultPrevented() && i.preventDefault() } }, g.removeEvent = function(t, e, i) { t.removeEventListener && t.removeEventListener(e, i, !1) }, g.Event = function(t, e) { return this instanceof g.Event ? (t && t.type ? (this.originalEvent = t, this.type = t.type, this.isDefaultPrevented = t.defaultPrevented || void 0 === t.defaultPrevented && !1 === t.returnValue ? J : $) : this.type = t, e && g.extend(this, e), this.timeStamp = t && t.timeStamp || g.now(), void(this[g.expando] = !0)) : new g.Event(t, e) }, g.Event.prototype = { isDefaultPrevented: $, isPropagationStopped: $, isImmediatePropagationStopped: $, preventDefault: function() { var t = this.originalEvent; this.isDefaultPrevented = J, t && t.preventDefault && t.preventDefault() }, stopPropagation: function() { var t = this.originalEvent; this.isPropagationStopped = J, t && t.stopPropagation && t.stopPropagation() }, stopImmediatePropagation: function() { var t = this.originalEvent; this.isImmediatePropagationStopped = J, t && t.stopImmediatePropagation && t.stopImmediatePropagation(), this.stopPropagation() } }, g.each({ mouseenter: "mouseover", mouseleave: "mouseout", pointerenter: "pointerover", pointerleave: "pointerout" }, (function(t, e) { g.event.special[t] = { delegateType: e, bindType: e, handle: function(t) { var i, n = this, r = t.relatedTarget, o = t.handleObj; return (!r || r !== n && !g.contains(n, r)) && (t.type = o.origType, i = o.handler.apply(this, arguments), t.type = e), i } } })), p.focusinBubbles || g.each({ focus: "focusin", blur: "focusout" }, (function(t, e) { var i = function(t) { g.event.simulate(e, t.target, g.event.fix(t), !0) }; g.event.special[e] = { setup: function() { var n = this.ownerDocument || this, r = B.access(n, e); r || n.addEventListener(t, i, !0), B.access(n, e, (r || 0) + 1) }, teardown: function() { var n = this.ownerDocument || this, r = B.access(n, e) - 1; r ? B.access(n, e, r) : (n.removeEventListener(t, i, !0), B.remove(n, e)) } } })), g.fn.extend({ on: function(t, e, i, n, r) { var o, a; if ("object" == typeof t) { for (a in "string" != typeof e && (i = i || e, e = void 0), t) this.on(a, e, i, t[a], r); return this } if (null == i && null == n ? (n = e, i = e = void 0) : null == n && ("string" == typeof e ? (n = i, i = void 0) : (n = i, i = e, e = void 0)), !1 === n) n = $; else if (!n) return this; return 1 === r && (o = n, (n = function(t) { return g() .off(t), o.apply(this, arguments) }) .guid = o.guid || (o.guid = g.guid++)), this.each((function() { g.event.add(this, t, n, i, e) })) }, one: function(t, e, i, n) { return this.on(t, e, i, n, 1) }, off: function(t, e, i) { var n, r; if (t && t.preventDefault && t.handleObj) return n = t.handleObj, g(t.delegateTarget) .off(n.namespace ? n.origType + "." + n.namespace : n.origType, n.selector, n.handler), this; if ("object" == typeof t) { for (r in t) this.off(r, e, t[r]); return this } return (!1 === e || "function" == typeof e) && (i = e, e = void 0), !1 === i && (i = $), this.each((function() { g.event.remove(this, t, i, e) })) }, trigger: function(t, e) { return this.each((function() { g.event.trigger(t, e, this) })) }, triggerHandler: function(t, e) { var i = this[0]; return i ? g.event.trigger(t, e, i, !0) : void 0 } }); var et = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, it = /<([\w:]+)/, nt = /<|&#?\w+;/, rt = /<(?:script|style|link)/i, ot = /checked\s*(?:[^=]|=\s*.checked.)/i, at = /^$|\/(?:java|ecma)script/i, st = /^true\/(.*)/, lt = /^\s*\s*$/g, ut = { option: [1, ""], thead: [1, "", "
"], col: [2, "", "
"], tr: [2, "", "
"], td: [3, "", "
"], _default: [0, "", ""] }; function ht(t, e) { return g.nodeName(t, "table") && g.nodeName(11 !== e.nodeType ? e : e.firstChild, "tr") ? t.getElementsByTagName("tbody")[0] || t.appendChild(t.ownerDocument.createElement("tbody")) : t } function ct(t) { return t.type = (null !== t.getAttribute("type")) + "/" + t.type, t } function dt(t) { var e = st.exec(t.type); return e ? t.type = e[1] : t.removeAttribute("type"), t } function pt(t, e) { for (var i = 0, n = t.length; n > i; i++) B.set(t[i], "globalEval", !e || B.get(e[i], "globalEval")) } function ft(t, e) { var i, n, r, o, a, s, l, u; if (1 === e.nodeType) { if (B.hasData(t) && (o = B.access(t), a = B.set(e, o), u = o.events)) for (r in delete a.handle, a.events = {}, u) for (i = 0, n = u[r].length; n > i; i++) g.event.add(e, r, u[r][i]); z.hasData(t) && (s = z.access(t), l = g.extend({}, s), z.set(e, l)) } } function mt(t, e) { var i = t.getElementsByTagName ? t.getElementsByTagName(e || "*") : t.querySelectorAll ? t.querySelectorAll(e || "*") : []; return void 0 === e || e && g.nodeName(t, e) ? g.merge([t], i) : i } function gt(t, e) { var i = e.nodeName.toLowerCase(); "input" === i && q.test(t.type) ? e.checked = t.checked : ("input" === i || "textarea" === i) && (e.defaultValue = t.defaultValue) } ut.optgroup = ut.option, ut.tbody = ut.tfoot = ut.colgroup = ut.caption = ut.thead, ut.th = ut.td, g.extend({ clone: function(t, e, i) { var n, r, o, a, s = t.cloneNode(!0), l = g.contains(t.ownerDocument, t); if (!(p.noCloneChecked || 1 !== t.nodeType && 11 !== t.nodeType || g.isXMLDoc(t))) for (a = mt(s), n = 0, r = (o = mt(t)) .length; r > n; n++) gt(o[n], a[n]); if (e) if (i) for (o = o || mt(t), a = a || mt(s), n = 0, r = o.length; r > n; n++) ft(o[n], a[n]); else ft(t, s); return (a = mt(s, "script")) .length > 0 && pt(a, !l && mt(t, "script")), s }, buildFragment: function(t, e, i, n) { for (var r, o, a, s, l, u, h = e.createDocumentFragment(), c = [], d = 0, p = t.length; p > d; d++) if ((r = t[d]) || 0 === r) if ("object" === g.type(r)) g.merge(c, r.nodeType ? [r] : r); else if (nt.test(r)) { for (o = o || h.appendChild(e.createElement("div")), a = (it.exec(r) || ["", ""])[1].toLowerCase(), s = ut[a] || ut._default, o.innerHTML = s[1] + r.replace(et, "<$1>") + s[2], u = s[0]; u--;) o = o.lastChild; g.merge(c, o.childNodes), (o = h.firstChild) .textContent = "" } else c.push(e.createTextNode(r)); for (h.textContent = "", d = 0; r = c[d++];) if ((!n || -1 === g.inArray(r, n)) && (l = g.contains(r.ownerDocument, r), o = mt(h.appendChild(r), "script"), l && pt(o), i)) for (u = 0; r = o[u++];) at.test(r.type || "") && i.push(r); return h }, cleanData: function(t) { for (var e, i, n, r, o = g.event.special, a = 0; void 0 !== (i = t[a]); a++) { if (g.acceptData(i) && ((r = i[B.expando]) && (e = B.cache[r]))) { if (e.events) for (n in e.events) o[n] ? g.event.remove(i, n) : g.removeEvent(i, n, e.handle); B.cache[r] && delete B.cache[r] } delete z.cache[i[z.expando]] } } }), g.fn.extend({ text: function(t) { return k(this, (function(t) { return void 0 === t ? g.text(this) : this.empty() .each((function() { (1 === this.nodeType || 11 === this.nodeType || 9 === this.nodeType) && (this.textContent = t) })) }), null, t, arguments.length) }, append: function() { return this.domManip(arguments, (function(t) { 1 !== this.nodeType && 11 !== this.nodeType && 9 !== this.nodeType || ht(this, t) .appendChild(t) })) }, prepend: function() { return this.domManip(arguments, (function(t) { if (1 === this.nodeType || 11 === this.nodeType || 9 === this.nodeType) { var e = ht(this, t); e.insertBefore(t, e.firstChild) } })) }, before: function() { return this.domManip(arguments, (function(t) { this.parentNode && this.parentNode.insertBefore(t, this) })) }, after: function() { return this.domManip(arguments, (function(t) { this.parentNode && this.parentNode.insertBefore(t, this.nextSibling) })) }, remove: function(t, e) { for (var i, n = t ? g.filter(t, this) : this, r = 0; null != (i = n[r]); r++) e || 1 !== i.nodeType || g.cleanData(mt(i)), i.parentNode && (e && g.contains(i.ownerDocument, i) && pt(mt(i, "script")), i.parentNode.removeChild(i)); return this }, empty: function() { for (var t, e = 0; null != (t = this[e]); e++) 1 === t.nodeType && (g.cleanData(mt(t, !1)), t.textContent = ""); return this }, clone: function(t, e) { return t = null != t && t, e = null == e ? t : e, this.map((function() { return g.clone(this, t, e) })) }, html: function(t) { return k(this, (function(t) { var e = this[0] || {}, i = 0, n = this.length; if (void 0 === t && 1 === e.nodeType) return e.innerHTML; if ("string" == typeof t && !rt.test(t) && !ut[(it.exec(t) || ["", ""])[1].toLowerCase()]) { t = t.replace(et, "<$1>"); try { for (; n > i; i++) 1 === (e = this[i] || {}) .nodeType && (g.cleanData(mt(e, !1)), e.innerHTML = t); e = 0 } catch (t) {} } e && this.empty() .append(t) }), null, t, arguments.length) }, replaceWith: function() { var t = arguments[0]; return this.domManip(arguments, (function(e) { t = this.parentNode, g.cleanData(mt(this)), t && t.replaceChild(e, this) })), t && (t.length || t.nodeType) ? this : this.remove() }, detach: function(t) { return this.remove(t, !0) }, domManip: function(t, e) { t = s.apply([], t); var i, n, r, o, a, l, u = 0, h = this.length, c = this, d = h - 1, f = t[0], m = g.isFunction(f); if (m || h > 1 && "string" == typeof f && !p.checkClone && ot.test(f)) return this.each((function(i) { var n = c.eq(i); m && (t[0] = f.call(this, i, n.html())), n.domManip(t, e) })); if (h && (n = (i = g.buildFragment(t, this[0].ownerDocument, !1, this)) .firstChild, 1 === i.childNodes.length && (i = n), n)) { for (o = (r = g.map(mt(i, "script"), ct)) .length; h > u; u++) a = i, u !== d && (a = g.clone(a, !0, !0), o && g.merge(r, mt(a, "script"))), e.call(this[u], a, u); if (o) for (l = r[r.length - 1].ownerDocument, g.map(r, dt), u = 0; o > u; u++) a = r[u], at.test(a.type || "") && !B.access(a, "globalEval") && g.contains(l, a) && (a.src ? g._evalUrl && g._evalUrl(a.src) : g.globalEval(a.textContent.replace(lt, ""))) } return this } }), g.each({ appendTo: "append", prependTo: "prepend", insertBefore: "before", insertAfter: "after", replaceAll: "replaceWith" }, (function(t, e) { g.fn[t] = function(t) { for (var i, n = [], r = g(t), o = r.length - 1, a = 0; o >= a; a++) i = a === o ? this : this.clone(!0), g(r[a])[e](i), l.apply(n, i.get()); return this.pushStack(n) } })); var vt, yt = {}; function bt(t, e) { var n, r = g(e.createElement(t)) .appendTo(e.body), o = i.getDefaultComputedStyle && (n = i.getDefaultComputedStyle(r[0])) ? n.display : g.css(r[0], "display"); return r.detach(), o } function wt(t) { var e = f, i = yt[t]; return i || ("none" !== (i = bt(t, e)) && i || ((e = (vt = (vt || g("