@realsee/five 5.0.0-alpha.181 → 5.0.0-alpha.182
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/classes/five.AnimationFrameLoop.html +1 -1
- package/docs/classes/five.BVH.html +1 -1
- package/docs/classes/five.BVHIntersect.html +1 -1
- package/docs/classes/five.BVHNode.html +1 -1
- package/docs/classes/five.BVHVector3.html +1 -1
- package/docs/classes/five.Camera.html +1 -1
- package/docs/classes/five.Clipper.html +1 -1
- package/docs/classes/five.Five.html +1 -1
- package/docs/classes/five.InternalWebGLRenderer.html +1 -1
- package/docs/classes/five.IntersectMesh.html +1 -1
- package/docs/classes/five.Model.html +1 -1
- package/docs/classes/five.NetworkSubscribe.html +1 -1
- package/docs/classes/five.PBMContainer.html +1 -1
- package/docs/classes/five.PBMGroup.html +1 -1
- package/docs/classes/five.PBMMaterial.html +1 -1
- package/docs/classes/five.PBMMesh.html +1 -1
- package/docs/classes/five.PanoCircleMesh.html +1 -1
- package/docs/classes/five.PanoCircleMeshCustom.html +1 -1
- package/docs/classes/five.PanoCircleMeshSolid.html +1 -1
- package/docs/classes/five.Scene.html +1 -1
- package/docs/classes/five.Subscribe.html +1 -1
- package/docs/classes/five.TextureLoader.html +1 -1
- package/docs/classes/five.Tile3D.html +1 -1
- package/docs/classes/five.Tile3DModel.html +1 -1
- package/docs/classes/five.TileBoundingSphere.html +1 -1
- package/docs/classes/five.TileCacheNode.html +1 -1
- package/docs/classes/five.TileCubeTextureTarget.html +1 -1
- package/docs/classes/five.TileCullingVolume.html +1 -1
- package/docs/classes/five.TileOrientedBoundingBox.html +1 -1
- package/docs/classes/five.TileRequestScheduler.html +1 -1
- package/docs/classes/five.Tileset3D.html +1 -1
- package/docs/classes/five.Tileset3DTraverser.html +1 -1
- package/docs/classes/five.TilesetCache.html +1 -1
- package/docs/classes/five.Work.html +1 -1
- package/docs/classes/five.XRButton.html +1 -1
- package/docs/classes/gltf_loader.DDSLoader.html +1 -1
- package/docs/classes/gltf_loader.DRACOLoader.html +1 -1
- package/docs/classes/gltf_loader.GLTFLoader.html +1 -1
- package/docs/classes/gltf_loader.GLTFObject.html +1 -1
- package/docs/classes/gltf_loader.GLTFParser.html +1 -1
- package/docs/classes/gltf_loader.THREEGLTFLoader.html +1 -1
- package/docs/classes/line.Line.html +1 -1
- package/docs/classes/line.LineGeometry.html +1 -1
- package/docs/classes/line.LineMaterial.html +1 -1
- package/docs/classes/line.LineSegmentsGeometry.html +1 -1
- package/docs/classes/line.THREE_Line2.html +1 -1
- package/docs/classes/line.THREE_LineSegments2.html +1 -1
- package/docs/classes/react.Store.html +1 -1
- package/docs/classes/server.BVH.html +1 -1
- package/docs/classes/server.BVHIntersect.html +1 -1
- package/docs/classes/server.BVHNode.html +1 -1
- package/docs/classes/server.BVHVector3.html +1 -1
- package/docs/classes/server.Model.html +1 -1
- package/docs/classes/server.PBMContainer.html +1 -1
- package/docs/classes/server.PBMGroup.html +1 -1
- package/docs/classes/server.PBMMesh.html +1 -1
- package/docs/classes/sticker.Sticker.html +1 -1
- package/docs/classes/vfx.Airflow.html +1 -1
- package/docs/classes/vfx.Flame.html +1 -1
- package/docs/classes/vfx.Particle.html +1 -1
- package/docs/classes/vfx.SpotLight.html +1 -1
- package/docs/index.html +1 -1
- package/docs/interfaces/five.AddableObject.html +1 -1
- package/docs/interfaces/five.AnimationFrame.html +1 -1
- package/docs/interfaces/five.CameraPose.html +1 -1
- package/docs/interfaces/five.ClipperParameter.html +1 -1
- package/docs/interfaces/five.DepthPanoramaControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/five.EventCallback.html +1 -1
- package/docs/interfaces/five.FiveInitArgs.html +1 -1
- package/docs/interfaces/five.FloorplanControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/five.ImageOptions.html +1 -1
- package/docs/interfaces/five.ImageURLMappings.html +1 -1
- package/docs/interfaces/five.ImageURLOptions.html +1 -1
- package/docs/interfaces/five.IntersectMeshInterface.html +1 -1
- package/docs/interfaces/five.Intersection.html +1 -1
- package/docs/interfaces/five.MapviewControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/five.ModelControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/five.ModelEventCallback.html +1 -1
- package/docs/interfaces/five.MotionKeyframe.html +1 -1
- package/docs/interfaces/five.MovePanoOptions.html +1 -1
- package/docs/interfaces/five.NetworkOptions.html +1 -1
- package/docs/interfaces/five.PBMPanoPicture.html +1 -1
- package/docs/interfaces/five.PBMParameters.html +1 -1
- package/docs/interfaces/five.PanoCircleMeshCustomOptions.html +1 -1
- package/docs/interfaces/five.PanoCircleMeshInterface.html +1 -1
- package/docs/interfaces/five.PanoCircleMeshOptions.html +1 -1
- package/docs/interfaces/five.PanoCircleMeshSolidOptions.html +1 -1
- package/docs/interfaces/five.PanoramaControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/five.PanoramaLikeControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/five.Pose.html +1 -1
- package/docs/interfaces/five.Scissor.html +1 -1
- package/docs/interfaces/five.State.html +1 -1
- package/docs/interfaces/five.SubscribeMixinType.emit.html +1 -1
- package/docs/interfaces/five.SubscribeMixinType.hasListener.html +1 -1
- package/docs/interfaces/five.SubscribeMixinType.off.html +1 -1
- package/docs/interfaces/five.SubscribeMixinType.on.html +1 -1
- package/docs/interfaces/five.SubscribeMixinType.once.html +1 -1
- package/docs/interfaces/five.TextureOptions.html +1 -1
- package/docs/interfaces/five.Tile3DModelLoaderOptions.html +1 -1
- package/docs/interfaces/five.TileBoundingVolume.html +1 -1
- package/docs/interfaces/five.TileContent.html +1 -1
- package/docs/interfaces/five.TileCubeNode.html +1 -1
- package/docs/interfaces/five.TileCubeTree.html +1 -1
- package/docs/interfaces/five.Tileset3dOptions.html +1 -1
- package/docs/interfaces/five.TilesetJSON.html +1 -1
- package/docs/interfaces/five.TilesetJSONNode.html +1 -1
- package/docs/interfaces/five.TopviewControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/five.VRPanoramaControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/five.WebXRSelectParams.html +1 -1
- package/docs/interfaces/five.WorkCubeImage.html +1 -1
- package/docs/interfaces/five.WorkImage.html +1 -1
- package/docs/interfaces/five.WorkInitial.html +1 -1
- package/docs/interfaces/five.WorkModel.html +1 -1
- package/docs/interfaces/five.WorkModelTiles.html +1 -1
- package/docs/interfaces/five.WorkObserver.html +1 -1
- package/docs/interfaces/five.WorkTile.html +1 -1
- package/docs/interfaces/five.WorkVideo.html +1 -1
- package/docs/interfaces/five.XRPanoramaControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/gltf_loader.DDS.html +1 -1
- package/docs/interfaces/gltf_loader.GLTF.html +1 -1
- package/docs/interfaces/gltf_loader.GLTFReference.html +1 -1
- package/docs/interfaces/gltf_loader.THREEGLTF.html +1 -1
- package/docs/interfaces/react.FiveActionReactCallbacks.html +1 -1
- package/docs/interfaces/react.FiveInjectionTypes.html +1 -1
- package/docs/interfaces/react.PropTypeOfFiveFeatures.html +1 -1
- package/docs/interfaces/server.Intersection.html +1 -1
- package/docs/interfaces/server.ModelEventCallback.html +1 -1
- package/docs/interfaces/sticker.IntersectionLike.html +1 -1
- package/docs/interfaces/vfx.ParticleArgs.html +1 -1
- package/docs/interfaces/vfx.ParticleTweenKeyframe.html +1 -1
- package/docs/interfaces/vue.FiveActionVueCallbacks.html +1 -1
- package/docs/modules/five.SubscribeMixinType.html +1 -1
- package/docs/modules/five.html +1 -1
- package/docs/modules/gltf_loader.html +1 -1
- package/docs/modules/line.html +1 -1
- package/docs/modules/react.html +1 -1
- package/docs/modules/server.html +1 -1
- package/docs/modules/sticker.html +1 -1
- package/docs/modules/vfx.html +1 -1
- package/docs/modules/vue.html +1 -1
- package/docs/modules.html +1 -1
- package/five/index.js +3 -3
- package/gltf-loader/index.js +3 -3
- package/line/index.js +3 -3
- package/package.json +1 -1
- package/react/index.js +2 -2
- package/server/index.js +2 -2
- package/sticker/index.js +3 -3
- package/umd/five-gltf-loader.js +1 -1
- package/umd/five-line.js +1 -1
- package/umd/five-sticker.js +1 -1
- package/umd/five.js +1 -1
- package/vfx/index.js +2 -2
- package/vue/index.js +2 -2
package/five/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @realsee/five
|
|
3
3
|
*
|
|
4
|
-
* Generated: 2023-02-
|
|
5
|
-
* Version: 5.0.0-alpha.
|
|
4
|
+
* Generated: 2023-02-23
|
|
5
|
+
* Version: 5.0.0-alpha.182
|
|
6
6
|
*
|
|
7
7
|
* Terms:
|
|
8
8
|
* Realsee SDK License Agreement
|
|
@@ -359,4 +359,4 @@ function(e,t){for(var i=e.toByteArray(),n=0;n<i.length&&0==i[n];)++n;if(i.length
|
|
|
359
359
|
* http://hammerjs.github.io/
|
|
360
360
|
*
|
|
361
361
|
* Copyright (c) 2016 Jorik Tangelder;
|
|
362
|
-
* Licensed under the MIT license */var qr=function(e,t,i,n){var r,o=["","webkit","Moz","MS","ms","o"],a=t.createElement?t.createElement("div"):n,s=Math.round,l=Math.abs,c=Date.now;function u(e,t,i){return setTimeout(m(e,i),t)}function h(e,t,i){return!!Array.isArray(e)&&(d(e,i[t],i),!0)}function d(e,t,i){var r;if(e)if(e.forEach)e.forEach(t,i);else if(e.length!==n)for(r=0;r<e.length;)t.call(i,e[r],r,e),r++;else for(r in e)e.hasOwnProperty(r)&&t.call(i,e[r],r,e)}function p(t,i,n){var r="DEPRECATED METHOD: "+i+"\n"+n+" AT \n";return function(){var i=new Error("get-stack-trace"),n=i&&i.stack?i.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=e.console&&(e.console.warn||e.console.log);return o&&o.call(e.console,r,n),t.apply(this,arguments)}}r="function"!=typeof Object.assign?function(e){if(e===n||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),i=1;i<arguments.length;i++){var r=arguments[i];if(r!==n&&null!==r)for(var o in r)r.hasOwnProperty(o)&&(t[o]=r[o])}return t}:Object.assign;var f=p((function(e,t,i){for(var r=Object.keys(t),o=0;o<r.length;)(!i||i&&e[r[o]]===n)&&(e[r[o]]=t[r[o]]),o++;return e}),"extend","Use `assign`."),A=p((function(e,t){return f(e,t,!0)}),"merge","Use `assign`.");function v(e,t,i){var n,o=t.prototype;(n=e.prototype=Object.create(o)).constructor=e,n._super=o,i&&r(n,i)}function m(e,t){return function(){return e.apply(t,arguments)}}function g(e,t){return"function"==typeof e?e.apply(t&&t[0]||n,t):e}function y(e,t){return e===n?t:e}function b(e,t,i){d(C(t),(function(t){e.addEventListener(t,i,!1)}))}function x(e,t,i){d(C(t),(function(t){e.removeEventListener(t,i,!1)}))}function w(e,t){for(;e;){if(e==t)return!0;e=e.parentNode}return!1}function M(e,t){return e.indexOf(t)>-1}function C(e){return e.trim().split(/\s+/g)}function E(e,t,i){if(e.indexOf&&!i)return e.indexOf(t);for(var n=0;n<e.length;){if(i&&e[n][i]==t||!i&&e[n]===t)return n;n++}return-1}function I(e){return Array.prototype.slice.call(e,0)}function S(e,t,i){for(var n=[],r=[],o=0;o<e.length;){var a=t?e[o][t]:e[o];E(r,a)<0&&n.push(e[o]),r[o]=a,o++}return i&&(n=t?n.sort((function(e,i){return e[t]>i[t]})):n.sort()),n}function B(e,t){for(var i,r,a=t[0].toUpperCase()+t.slice(1),s=0;s<o.length;){if((r=(i=o[s])?i+a:t)in e)return r;s++}return n}var T=1;function P(t){var i=t.ownerDocument||t;return i.defaultView||i.parentWindow||e}var R="ontouchstart"in e,k=B(e,"PointerEvent")!==n,Q=R&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),D="touch",F="mouse",L=24,O=["x","y"],N=["clientX","clientY"];function V(e,t){var i=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(t){g(e.options.enable,[e])&&i.handler(t)},this.init()}function U(e,t,i){var r=i.pointers.length,o=i.changedPointers.length,a=1&t&&r-o==0,s=12&t&&r-o==0;i.isFirst=!!a,i.isFinal=!!s,a&&(e.session={}),i.eventType=t,function(e,t){var i=e.session,r=t.pointers,o=r.length;i.firstInput||(i.firstInput=z(t));o>1&&!i.firstMultiple?i.firstMultiple=z(t):1===o&&(i.firstMultiple=!1);var a=i.firstInput,s=i.firstMultiple,u=s?s.center:a.center,h=t.center=q(r);t.timeStamp=c(),t.deltaTime=t.timeStamp-a.timeStamp,t.angle=j(u,h),t.distance=K(u,h),function(e,t){var i=t.center,n=e.offsetDelta||{},r=e.prevDelta||{},o=e.prevInput||{};1!==t.eventType&&4!==o.eventType||(r=e.prevDelta={x:o.deltaX||0,y:o.deltaY||0},n=e.offsetDelta={x:i.x,y:i.y});t.deltaX=r.x+(i.x-n.x),t.deltaY=r.y+(i.y-n.y)}(i,t),t.offsetDirection=_(t.deltaX,t.deltaY);var d=H(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=d.x,t.overallVelocityY=d.y,t.overallVelocity=l(d.x)>l(d.y)?d.x:d.y,t.scale=s?function(e,t){return K(t[0],t[1],N)/K(e[0],e[1],N)}(s.pointers,r):1,t.rotation=s?function(e,t){return j(t[1],t[0],N)+j(e[1],e[0],N)}(s.pointers,r):0,t.maxPointers=i.prevInput?t.pointers.length>i.prevInput.maxPointers?t.pointers.length:i.prevInput.maxPointers:t.pointers.length,function(e,t){var i,r,o,a,s=e.lastInterval||t,c=t.timeStamp-s.timeStamp;if(8!=t.eventType&&(c>25||s.velocity===n)){var u=t.deltaX-s.deltaX,h=t.deltaY-s.deltaY,d=H(c,u,h);r=d.x,o=d.y,i=l(d.x)>l(d.y)?d.x:d.y,a=_(u,h),e.lastInterval=t}else i=s.velocity,r=s.velocityX,o=s.velocityY,a=s.direction;t.velocity=i,t.velocityX=r,t.velocityY=o,t.direction=a}(i,t);var p=e.element;w(t.srcEvent.target,p)&&(p=t.srcEvent.target);t.target=p}(e,i),e.emit("hammer.input",i),e.recognize(i),e.session.prevInput=i}function z(e){for(var t=[],i=0;i<e.pointers.length;)t[i]={clientX:s(e.pointers[i].clientX),clientY:s(e.pointers[i].clientY)},i++;return{timeStamp:c(),pointers:t,center:q(t),deltaX:e.deltaX,deltaY:e.deltaY}}function q(e){var t=e.length;if(1===t)return{x:s(e[0].clientX),y:s(e[0].clientY)};for(var i=0,n=0,r=0;r<t;)i+=e[r].clientX,n+=e[r].clientY,r++;return{x:s(i/t),y:s(n/t)}}function H(e,t,i){return{x:t/e||0,y:i/e||0}}function _(e,t){return e===t?1:l(e)>=l(t)?e<0?2:4:t<0?8:16}function K(e,t,i){i||(i=O);var n=t[i[0]]-e[i[0]],r=t[i[1]]-e[i[1]];return Math.sqrt(n*n+r*r)}function j(e,t,i){i||(i=O);var n=t[i[0]]-e[i[0]],r=t[i[1]]-e[i[1]];return 180*Math.atan2(r,n)/Math.PI}V.prototype={handler:function(){},init:function(){this.evEl&&b(this.element,this.evEl,this.domHandler),this.evTarget&&b(this.target,this.evTarget,this.domHandler),this.evWin&&b(P(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&x(this.element,this.evEl,this.domHandler),this.evTarget&&x(this.target,this.evTarget,this.domHandler),this.evWin&&x(P(this.element),this.evWin,this.domHandler)}};var G={mousedown:1,mousemove:2,mouseup:4},W="mousedown",X="mousemove mouseup";function Y(){this.evEl=W,this.evWin=X,this.pressed=!1,V.apply(this,arguments)}v(Y,V,{handler:function(e){var t=G[e.type];1&t&&(0===e.button||2===e.button)&&(this.pressed=!0),2&t&&1!==e.which&&(t=4),this.pressed&&(4&t&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:F,srcEvent:e}))}});var Z={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},J={2:D,3:"pen",4:F,5:"kinect"},$="pointerdown",ee="pointermove pointerup pointercancel";function te(){this.evEl=$,this.evWin=ee,V.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}e.MSPointerEvent&&!e.PointerEvent&&($="MSPointerDown",ee="MSPointerMove MSPointerUp MSPointerCancel"),v(te,V,{handler:function(e){var t=this.store,i=!1,n=!1,r=e.type.toLowerCase().replace("ms",""),o=Z[r],a=J[e.pointerType]||e.pointerType,s=a==D,l=E(t,e.pointerId,"pointerId");1&o&&(0===e.button||2===e.button||s)?l<0&&(t.push(e),l=t.length-1):12&o?i=!0:s||0!==e.buttons||(i=!0,n=!0,o=Z.pointerup),l<0||(n||(t[l]=e),this.callback(this.manager,o,{pointers:t,changedPointers:[e],pointerType:a,srcEvent:t[l]}),i&&t.splice(l,1))}});var ie={touchstart:1,touchmove:2,touchend:4,touchcancel:8},ne="touchstart",re="touchstart touchmove touchend touchcancel";function oe(){this.evTarget=ne,this.evWin=re,this.started=!1,V.apply(this,arguments)}function ae(e,t){var i=I(e.touches),n=I(e.changedTouches);return 12&t&&(i=S(i.concat(n),"identifier",!0)),[i,n]}v(oe,V,{handler:function(e){var t=ie[e.type];if(1===t&&(this.started=!0),this.started){var i=ae.call(this,e,t);12&t&&i[0].length-i[1].length==0&&(this.started=!1),this.callback(this.manager,t,{pointers:i[0],changedPointers:i[1],pointerType:D,srcEvent:e})}}});var se={touchstart:1,touchmove:2,touchend:4,touchcancel:8},le="touchstart touchmove touchend touchcancel";function ce(){this.evTarget=le,this.targetIds={},V.apply(this,arguments)}function ue(e,t){var i=I(e.touches),n=this.targetIds;if(3&t&&1===i.length)return n[i[0].identifier]=!0,[i,i];var r,o,a=I(e.changedTouches),s=[],l=this.target;if(o=i.filter((function(e){return w(e.target,l)})),1===t)for(r=0;r<o.length;)n[o[r].identifier]=!0,r++;for(r=0;r<a.length;)n[a[r].identifier]&&s.push(a[r]),12&t&&delete n[a[r].identifier],r++;return s.length?[S(o.concat(s),"identifier",!0),s]:void 0}v(ce,V,{handler:function(e){var t=se[e.type],i=ue.call(this,e,t);i&&this.callback(this.manager,t,{pointers:i[0],changedPointers:i[1],pointerType:D,srcEvent:e})}});function he(){V.apply(this,arguments);var e=m(this.handler,this);this.touch=new ce(this.manager,e),this.mouse=new Y(this.manager,e),this.primaryTouch=null,this.lastTouches=[]}function de(e,t){1&e?(this.primaryTouch=t.changedPointers[0].identifier,pe.call(this,t)):12&e&&pe.call(this,t)}function pe(e){var t=e.changedPointers[0];if(t.identifier===this.primaryTouch){var i={x:t.clientX,y:t.clientY};this.lastTouches.push(i);var n=this.lastTouches;setTimeout((function(){var e=n.indexOf(i);e>-1&&n.splice(e,1)}),2500)}}function fe(e){for(var t=e.srcEvent.clientX,i=e.srcEvent.clientY,n=0;n<this.lastTouches.length;n++){var r=this.lastTouches[n],o=Math.abs(t-r.x),a=Math.abs(i-r.y);if(o<=25&&a<=25)return!0}return!1}v(he,V,{handler:function(e,t,i){var n=i.pointerType==D,r=i.pointerType==F;if(!(r&&i.sourceCapabilities&&i.sourceCapabilities.firesTouchEvents)){if(n)de.call(this,t,i);else if(r&&fe.call(this,i))return;this.callback(e,t,i)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var Ae=a?B(a.style,"touchAction"):n,ve=Ae!==n,me="compute",ge="auto",ye="manipulation",be="none",xe="pan-x",we="pan-y",Me=function(){if(!ve)return!1;var t={},i=e.CSS&&e.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach((function(n){t[n]=!i||e.CSS.supports("touch-action",n)})),t}();function Ce(e,t){this.manager=e,this.set(t)}Ce.prototype={set:function(e){e==me&&(e=this.compute()),ve&&this.manager.element.style&&Me[e]&&(this.manager.element.style[Ae]=e),this.actions=e.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var e=[];return d(this.manager.recognizers,(function(t){g(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))})),function(e){if(M(e,be))return be;var t=M(e,xe),i=M(e,we);if(t&&i)return be;if(t||i)return t?xe:we;if(M(e,ye))return ye;return ge}(e.join(" "))},preventDefaults:function(e){var t=e.srcEvent,i=e.offsetDirection;if(this.manager.session.prevented)t.preventDefault();else{var n=this.actions,r=M(n,be)&&!Me.none,o=M(n,we)&&!Me["pan-y"],a=M(n,xe)&&!Me["pan-x"];if(r){var s=1===e.pointers.length,l=e.distance<2,c=e.deltaTime<250;if(s&&l&&c)return}if(!a||!o)return r||o&&6&i||a&&i&L?this.preventSrc(t):void 0}},preventSrc:function(e){this.manager.session.prevented=!0,e.preventDefault()}};var Ee=32;function Ie(e){this.options=r({},this.defaults,e||{}),this.id=T++,this.manager=null,this.options.enable=y(this.options.enable,!0),this.state=1,this.simultaneous={},this.requireFail=[]}function Se(e){return 16&e?"cancel":8&e?"end":4&e?"move":2&e?"start":""}function Be(e){return 16==e?"down":8==e?"up":2==e?"left":4==e?"right":""}function Te(e,t){var i=t.manager;return i?i.get(e):e}function Pe(){Ie.apply(this,arguments)}function Re(){Pe.apply(this,arguments),this.pX=null,this.pY=null}function ke(){Pe.apply(this,arguments)}function Qe(){Ie.apply(this,arguments),this._timer=null,this._input=null}function De(){Pe.apply(this,arguments)}function Fe(){Pe.apply(this,arguments)}function Le(){Ie.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function Oe(e,t){return(t=t||{}).recognizers=y(t.recognizers,Oe.defaults.preset),new Ne(e,t)}Ie.prototype={defaults:{},set:function(e){return r(this.options,e),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(e){if(h(e,"recognizeWith",this))return this;var t=this.simultaneous;return t[(e=Te(e,this)).id]||(t[e.id]=e,e.recognizeWith(this)),this},dropRecognizeWith:function(e){return h(e,"dropRecognizeWith",this)||(e=Te(e,this),delete this.simultaneous[e.id]),this},requireFailure:function(e){if(h(e,"requireFailure",this))return this;var t=this.requireFail;return-1===E(t,e=Te(e,this))&&(t.push(e),e.requireFailure(this)),this},dropRequireFailure:function(e){if(h(e,"dropRequireFailure",this))return this;e=Te(e,this);var t=E(this.requireFail,e);return t>-1&&this.requireFail.splice(t,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(e){var t=this,i=this.state;function n(i){t.manager.emit(i,e)}i<8&&n(t.options.event+Se(i)),n(t.options.event),e.additionalEvent&&n(e.additionalEvent),i>=8&&n(t.options.event+Se(i))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=Ee},canEmit:function(){for(var e=0;e<this.requireFail.length;){if(!(33&this.requireFail[e].state))return!1;e++}return!0},recognize:function(e){var t=r({},e);if(!g(this.options.enable,[this,t]))return this.reset(),void(this.state=Ee);56&this.state&&(this.state=1),this.state=this.process(t),30&this.state&&this.tryEmit(t)},process:function(e){},getTouchAction:function(){},reset:function(){}},v(Pe,Ie,{defaults:{pointers:1},attrTest:function(e){var t=this.options.pointers;return 0===t||e.pointers.length===t},process:function(e){var t=this.state,i=e.eventType,n=6&t,r=this.attrTest(e);return n&&(8&i||!r)?16|t:n||r?4&i?8|t:2&t?4|t:2:Ee}}),v(Re,Pe,{defaults:{event:"pan",threshold:10,pointers:1,direction:30},getTouchAction:function(){var e=this.options.direction,t=[];return 6&e&&t.push(we),e&L&&t.push(xe),t},directionTest:function(e){var t=this.options,i=!0,n=e.distance,r=e.direction,o=e.deltaX,a=e.deltaY;return r&t.direction||(6&t.direction?(r=0===o?1:o<0?2:4,i=o!=this.pX,n=Math.abs(e.deltaX)):(r=0===a?1:a<0?8:16,i=a!=this.pY,n=Math.abs(e.deltaY))),e.direction=r,i&&n>t.threshold&&r&t.direction},attrTest:function(e){return Pe.prototype.attrTest.call(this,e)&&(2&this.state||!(2&this.state)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=Be(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),v(ke,Pe,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[be]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||2&this.state)},emit:function(e){if(1!==e.scale){var t=e.scale<1?"in":"out";e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}}),v(Qe,Ie,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[ge]},process:function(e){var t=this.options,i=e.pointers.length===t.pointers,n=e.distance<t.threshold,r=e.deltaTime>t.time;if(this._input=e,!n||!i||12&e.eventType&&!r)this.reset();else if(1&e.eventType)this.reset(),this._timer=u((function(){this.state=8,this.tryEmit()}),t.time,this);else if(4&e.eventType)return 8;return Ee},reset:function(){clearTimeout(this._timer)},emit:function(e){8===this.state&&(e&&4&e.eventType?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=c(),this.manager.emit(this.options.event,this._input)))}}),v(De,Pe,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[be]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||2&this.state)}}),v(Fe,Pe,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return Re.prototype.getTouchAction.call(this)},attrTest:function(e){var t,i=this.options.direction;return 30&i?t=e.overallVelocity:6&i?t=e.overallVelocityX:i&L&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&i&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&l(t)>this.options.velocity&&4&e.eventType},emit:function(e){var t=Be(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),v(Le,Ie,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[ye]},process:function(e){var t=this.options,i=e.pointers.length===t.pointers,n=e.distance<t.threshold,r=e.deltaTime<t.time;if(this.reset(),1&e.eventType&&0===this.count)return this.failTimeout();if(n&&r&&i){if(4!=e.eventType)return this.failTimeout();var o=!this.pTime||e.timeStamp-this.pTime<t.interval,a=!this.pCenter||K(this.pCenter,e.center)<t.posThreshold;if(this.pTime=e.timeStamp,this.pCenter=e.center,a&&o?this.count+=1:this.count=1,this._input=e,0===this.count%t.taps)return this.hasRequireFailures()?(this._timer=u((function(){this.state=8,this.tryEmit()}),t.interval,this),2):8}return Ee},failTimeout:function(){return this._timer=u((function(){this.state=Ee}),this.options.interval,this),Ee},reset:function(){clearTimeout(this._timer)},emit:function(){8==this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),Oe.VERSION="2.0.7",Oe.defaults={domEvents:!1,touchAction:me,enable:!0,inputTarget:null,inputClass:null,preset:[[De,{enable:!1}],[ke,{enable:!1},["rotate"]],[Fe,{direction:6}],[Re,{direction:6},["swipe"]],[Le],[Le,{event:"doubletap",taps:2},["tap"]],[Qe]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};function Ne(e,t){var i;this.options=r({},Oe.defaults,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=new((i=this).options.inputClass||(k?te:Q?ce:R?he:Y))(i,U),this.touchAction=new Ce(this,this.options.touchAction),Ve(this,!0),d(this.options.recognizers,(function(e){var t=this.add(new e[0](e[1]));e[2]&&t.recognizeWith(e[2]),e[3]&&t.requireFailure(e[3])}),this)}function Ve(e,t){var i,n=e.element;n.style&&(d(e.options.cssProps,(function(r,o){i=B(n.style,o),t?(e.oldCssProps[i]=n.style[i],n.style[i]=r):n.style[i]=e.oldCssProps[i]||""})),t||(e.oldCssProps={}))}return Ne.prototype={set:function(e){return r(this.options,e),e.touchAction&&this.touchAction.update(),e.inputTarget&&(this.input.destroy(),this.input.target=e.inputTarget,this.input.init()),this},stop:function(e){this.session.stopped=e?2:1},recognize:function(e){var t=this.session;if(!t.stopped){var i;this.touchAction.preventDefaults(e);var n=this.recognizers,r=t.curRecognizer;(!r||r&&8&r.state)&&(r=t.curRecognizer=null);for(var o=0;o<n.length;)i=n[o],2===t.stopped||r&&i!=r&&!i.canRecognizeWith(r)?i.reset():i.recognize(e),!r&&14&i.state&&(r=t.curRecognizer=i),o++}},get:function(e){if(e instanceof Ie)return e;for(var t=this.recognizers,i=0;i<t.length;i++)if(t[i].options.event==e)return t[i];return null},add:function(e){if(h(e,"add",this))return this;var t=this.get(e.options.event);return t&&this.remove(t),this.recognizers.push(e),e.manager=this,this.touchAction.update(),e},remove:function(e){if(h(e,"remove",this))return this;if(e=this.get(e)){var t=this.recognizers,i=E(t,e);-1!==i&&(t.splice(i,1),this.touchAction.update())}return this},on:function(e,t){if(e!==n&&t!==n){var i=this.handlers;return d(C(e),(function(e){i[e]=i[e]||[],i[e].push(t)})),this}},off:function(e,t){if(e!==n){var i=this.handlers;return d(C(e),(function(e){t?i[e]&&i[e].splice(E(i[e],t),1):delete i[e]})),this}},emit:function(e,i){this.options.domEvents&&function(e,i){var n=t.createEvent("Event");n.initEvent(e,!0,!0),n.gesture=i,i.target.dispatchEvent(n)}(e,i);var n=this.handlers[e]&&this.handlers[e].slice();if(n&&n.length){i.type=e,i.preventDefault=function(){i.srcEvent.preventDefault()};for(var r=0;r<n.length;)n[r](i),r++}},destroy:function(){this.element&&Ve(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},r(Oe,{INPUT_START:1,INPUT_MOVE:2,INPUT_END:4,INPUT_CANCEL:8,STATE_POSSIBLE:1,STATE_BEGAN:2,STATE_CHANGED:4,STATE_ENDED:8,STATE_RECOGNIZED:8,STATE_CANCELLED:16,STATE_FAILED:Ee,DIRECTION_NONE:1,DIRECTION_LEFT:2,DIRECTION_RIGHT:4,DIRECTION_UP:8,DIRECTION_DOWN:16,DIRECTION_HORIZONTAL:6,DIRECTION_VERTICAL:L,DIRECTION_ALL:30,Manager:Ne,Input:V,TouchAction:Ce,TouchInput:ce,MouseInput:Y,PointerEventInput:te,TouchMouseInput:he,SingleTouchInput:oe,Recognizer:Ie,AttrRecognizer:Pe,Tap:Le,Pan:Re,Swipe:Fe,Pinch:ke,Rotate:De,Press:Qe,on:b,off:x,each:d,merge:A,extend:f,assign:r,inherit:v,bindFn:m,prefixed:B}),Oe}("undefined"!=typeof window?window:{},"undefined"!=typeof document?document:{});function Hr(e,t,i){var r=t.getBoundingClientRect(),o=r.top,a=r.left,s=r.width,l=r.height;return i&&(a+=s*i.left,o+=l*(1-i.bottom-i.height),s*=i.width,l*=i.height),new n.Vector2((e.x-a)/s*2-1,-(e.y-o)/l*2+1)}var _r=new n.OrthographicCamera(-1,1,1,-1,0,1),Kr=new n.BufferGeometry;Kr.setAttribute("position",new n.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3)),Kr.setAttribute("uv",new n.Float32BufferAttribute([0,2,0,0,2,0],2));var jr=new n.Mesh(Kr),Gr=new n.Scene;Gr.add(jr);var Wr=function(){function e(e,t){var i;this.renderer=e,this.material=new n.ShaderMaterial({vertexShader:null!==(i=t.vertex)&&void 0!==i?i:"\nvarying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n",fragmentShader:t.fragment,uniforms:Object.assign({inputBuffer:new n.Uniform(null)},t.uniforms),defines:Object.assign({},t.defines),blending:n.NoBlending,depthWrite:!1,depthTest:!1})}return e.prototype.render=function(e,t){var i=this.renderer.getRenderTarget(),n=jr.material;this.material.uniforms.inputBuffer.value=e.texture,jr.material=this.material,this.renderer.setRenderTarget(t||null),this.renderer.render(Gr,_r),this.renderer.setRenderTarget(i),jr.material=n},e.prototype.dispose=function(){this.material.dispose()},e}(),Xr=function(){function e(e){this.renderer=e,this.material=new n.ShaderMaterial({vertexShader:"\nvoid main() {\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n",fragmentShader:"\nuniform vec3 inputValue;\nvoid main() {\n gl_FragColor = vec4(inputValue, 1.0);\n}\n",uniforms:Object.assign({inputValue:new n.Uniform(new n.Vector3)}),blending:n.NoBlending,depthWrite:!1,depthTest:!1})}return e.prototype.render=function(e,t){var i=this.renderer.getRenderTarget(),n=jr.material;this.material.uniforms.inputValue.value.copy(e),jr.material=this.material,this.renderer.setRenderTarget(t||null),this.renderer.render(Gr,_r),this.renderer.setRenderTarget(i),jr.material=n},e.prototype.dispose=function(){this.material.dispose()},e}(),Yr=function(e){function t(t){return e.call(this,t,{fragment:"\nuniform sampler2D inputBuffer;\nvarying vec2 vUv;\nvoid main() {\n gl_FragColor = texture2D(inputBuffer, vUv);\n}\n"})||this}return te(t,e),t}(Wr),Zr=function(){function e(e){this.enable=!0,this.renderer=e,this.copyPass=new Yr(this.renderer)}return e.prototype.render=function(e,t){this.copyPass.render(e,t)},e.prototype.dispose=function(){this.copyPass.dispose()},e}(),Jr=function(e){function t(i){var n,r=this;r=e.call(this)||this;var o=t.parseArgs(i);return r.pending=!0,r.userAction=o.initial[3],r.destroyed=!1,r.ident=o.ident,r.scene=o.scene,r.parallaxScene=o.parallaxScene,r.helper=o.helper,r.boundingMesh=o.boundingMesh,r.camera=o.camera,r.renderer=o.renderer,r.scissor=o.scissor,r.element=o.element,r.model=o.model,r.enableIOSEDR=null!==(n=o.enableIOSEDR)&&void 0!==n&&n,r.work=o.work,r.imageOptions=o.imageOptions,r.videoTexture=o.videoTexture,r.networkSubscribe=o.networkSubscribe,r.requestProxy=o.requestProxy,r.needsRender=!0,r.maxFov=120,r.minFov=40,r.maxLatitude=+Math.PI/2,r.minLatitude=-Math.PI/2,r.cameraMotion=new ur({longitude:{value:r.camera.pose.longitude,circle:[0,2*Math.PI]},latitude:r.camera.pose.latitude,fov:r.camera.pose.fov}),r.eventUnbinds=[o.element].concat(o.extraElements||[]).map((function(e){return r.bindEvents(e)})),ke.shared.add((function(){return r.initAnimation.apply(r,o.initial)}),!0),r}return te(t,e),t.parseArgs=function(e){return ie({},e)},t.initAnimationEndState=function(e){var t=this.parseArgs(e);return{longitude:t.camera.pose.longitude,latitude:t.camera.pose.latitude,fov:t.camera.pose.fov,offset:t.camera.pose.offset.clone(),distance:t.camera.pose.distance}},t.prototype.destroy=function(){var e;this.destroyed=!0,this.off(),this.cameraMotion.dispose();for(var t=0,i=this.eventUnbinds;t<i.length;t++){(0,i[t])()}this.copyEffect&&(this.copyEffect.dispose(),delete this.copyEffect),delete this.panState,null===(e=this.pressState)||void 0===e||e.stop(),delete this.pressState},t.prototype.isReady=function(){return!1===this.pending&&!0===this.cameraMotion.ended},t.prototype.bindExtraElement=function(e){for(var t=0,i=this.eventUnbinds;t<i.length;t++){if(i[t].element===e)return}this.eventUnbinds.push(this.bindEvents(e))},t.prototype.unbindExtraElement=function(e){for(var t=[],i=0,n=this.eventUnbinds;i<n.length;i++){var r=n[i];r.element===e?r():t.push(r)}this.eventUnbinds=t},t.prototype.updateRenderSize=function(){this.needsRender=!0},t.prototype.updateModel=function(e){this.model=e,this.needsRender=!0},t.prototype.updateWork=function(e,t,i,n,r){return this.work=e,this.userAction=r,!1},t.prototype.updateTime=function(e,t){if(!this.destroyed){var i={};this.cameraMotion.ended&&(this.cameraMotion.update(e),i.longitude=this.cameraMotion.value.longitude,i.latitude=this.cameraMotion.value.latitude,i.fov=this.cameraMotion.value.fov),Ur(i)&&this.setCamera(i)}},t.prototype.render=function(){this.renderer.render(this.scene,this.camera)},t.prototype.postProcessing=function(e,t){this.destroyed||(this.copyEffect||(this.copyEffect=new Zr(this.renderer)),this.copyEffect.render(e,t))},t.prototype.updateCamera=function(e,t,i){return this.userAction=i,this.cameraMotion.set(e,t).catch(le)},t.prototype.updateCameraWithKeyframes=function(e,t,i){return this.userAction=i,this.cameraMotion.setKeyframes(e,t)},t.prototype.getTargetPose=function(){var e=this.cameraMotion.getKeyFrameSegment(ue())[1];return{longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,offset:this.camera.pose.offset.clone(),distance:this.camera.pose.distance}},t.prototype.moveToPano=function(e,t,i){void 0===t&&(t={}),this.userAction=i;var n={longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov,offset:this.camera.pose.offset.clone(),distance:this.camera.pose.distance};t.moveStartCallback&&t.moveStartCallback(e,n),this.emit("moveToPano",e,this.userAction),this.emit("panoWillArrive",e,n,this.userAction),this.emit("panoArrived",e,n,this.userAction),t.moveEndCallback&&t.moveEndCallback(e,n)},t.prototype.initAnimation=function(e,t,i,n){this.pending=!1,this.userAction=n},t.prototype.setCamera=function(e){var t,i,n,r,o;void 0===e&&(e={});var a=null!==(t=e.longitude)&&void 0!==t?t:this.camera.pose.longitude,s=null!==(i=e.latitude)&&void 0!==i?i:this.camera.pose.latitude,l=null!==(n=e.fov)&&void 0!==n?n:this.camera.pose.fov,c=null!==(r=e.distance)&&void 0!==r?r:this.camera.pose.distance,u=null!==(o=e.offset)&&void 0!==o?o:this.camera.pose.offset,h=this.camera.position.clone(),d=Cr(a,this.camera.pose.longitude,2*Math.PI)||Cr(s,this.camera.pose.latitude),p=Cr(l,this.camera.pose.fov),f=Cr(c,this.camera.pose.distance),A=Ir(u,this.camera.pose.offset);this.camera.setFromPose({longitude:a,latitude:s,fov:l,distance:c,offset:u});var v=Ir(h,this.camera.position);p&&this.emit("cameraFovUpdate",l,this.userAction),d&&this.emit("cameraDirectionUpdate",{longitude:a,latitude:s},this.userAction),v&&this.emit("cameraPositionUpdate",this.camera.position.clone(),this.userAction),(p||d||A||f)&&this.emit("cameraUpdate",{longitude:a,latitude:s,fov:l,offset:u,distance:c},this.userAction),this.needsRender=!0},t.prototype.onPanGesture=function(e){var t=this.panState,i=e.pointers.length;if(e.isFinal?delete this.panState:this.panState={pointerLength:i,x:e.center.x,y:e.center.y},void 0!==t&&t.pointerLength===i){var n=e.pointers.map((function(e){return ci(e,["x","y"])}));this.emit("wantsGesture","pan",n,e.isFinal)||this.emit("gesture","pan",n,e.isFinal)}},t.prototype.onTapGesture=function(e){var t=e.pointers.map((function(e){return ci(e,["x","y"])}));this.emit("wantsGesture","tap",t,!0)||this.emit("gesture","tap",t,!0)},t.prototype.onPressGesture=function(e,t){var i,n=[e];if(this.emit("wantsGesture","press",n,t))return null===(i=this.pressState)||void 0===i||i.stop(),void delete this.pressState;this.emit("gesture","press",n,t)},t.prototype.onPinchGesture=function(e){var t=e.pointers.map((function(e){return ci(e,["x","y"])}));this.emit("wantsGesture","pinch",t,e.isFinal)||this.emit("gesture","pinch",t,e.isFinal)},t.prototype.onMouseWheel=function(e){var t=(Math.abs(e.deltaY)>Math.abs(e.deltaX)?e.deltaY:e.deltaX)/-60,i=[{x:e.clientX,y:e.clientY,delta:t}];this.emit("wantsGesture","mouseWheel",i,!1)||this.emit("gesture","mouseWheel",i,!1)},t.prototype.onMouseMove=function(e){},t.prototype.onMouseOut=function(){},t.prototype.relativeClientPosition=function(e){return Hr(e,this.element,this.scissor)},t.prototype.bindEvents=function(e){var t=this,i=function(e){var i=Hr(e,t.element,t.scissor);return!(Math.abs(i.x)>1||Math.abs(i.y)>1)},n=new qr.Manager(e),r=function(e){return e.session.firstInput||null};n.add(new qr.Pan({threshold:10,pointers:0})),n.add(new qr.Tap({interval:410})),n.add(new qr.Pinch({threshold:0,pointers:2})),n.on("panstart pan",(function(e){var o=r(n);o&&!i(o.center)||(t.onPanGesture(e),f())})),n.on("tap",(function(e){if("mouse"!==e.pointerType||0===e.srcEvent.button){var o=r(n);o&&!i(o.center)||(t.onTapGesture(e),f())}})),n.on("pinchstart pinch pinchend",(function(e){var o=r(n);o&&!i(o.center)||(t.onPinchGesture(e),f())}));var o=null,a=null,s=function(e,t,i){var n="pinchend"===e?t:t-i.deltaY/280;return{type:e,target:i.target,pointerType:"mouse",srcEvent:i,pointers:[{x:i.clientX,y:i.clientY}],isFirst:"pinchstart"===e,isFinal:"pinchend"===e,scale:Kn(n,.1,10),center:{x:i.clientX,y:i.clientY},velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0}},l=function(e){var n,r={x:e.clientX,y:e.clientY};if(i(r)){if(e.preventDefault(),e.ctrlKey){var l=null!==(n=null==o?void 0:o.prevInput.scale)&&void 0!==n?n:1,c=s(o?"pinch":"pinchstart",l,e);null===o?o={firstInput:c,prevInput:c}:o.prevInput=c,t.onPinchGesture(c),null!==a&&window.clearTimeout(a),a=window.setTimeout((function(){var i;a=null;var n=null!==(i=null==o?void 0:o.prevInput.scale)&&void 0!==i?i:1,r=s("pinchend",n,e);o=null,t.onPinchGesture(r)}),200)}else t.onMouseWheel(e);f()}},c=function(e){if(!Fr()){var n={x:e.clientX,y:e.clientY};i(n)?(t.onMouseMove(e),t.pressState&&Math.abs(e.clientX-t.pressState.x)>10&&Math.abs(e.clientY-t.pressState.y)>10&&f()):t.onMouseOut()}},u=function(){t.onMouseOut(),f()},h=function(e,n){if(i(e)){t.pressState={x:e.x,y:e.y,time:t.pressState?t.pressState.time:n,stop:le};var r=n-t.pressState.time;t.onPressGesture({x:e.x,y:e.y,delta:r},!1),t.pressState&&(t.pressState.stop=ke.shared.add((function(t){return h({x:e.x,y:e.y},t)}),!0,1))}else f()},d=function(e){f(),e.touches.length>1||e.changedTouches.length<=0||h({x:e.changedTouches[0].clientX,y:e.changedTouches[0].clientY},ue())},p=function(e){f(),h({x:e.clientX,y:e.clientY},ue())},f=function(){var e;if(t.pressState){var i=ue()-t.pressState.time;t.onPressGesture({x:t.pressState.x,y:t.pressState.y,delta:i},!0),null===(e=t.pressState)||void 0===e||e.stop(),delete t.pressState}},A=null,v=function(e){var t,i="pinch",n=!1,r=!1;switch(e.type){case"gesturestart":i="pinchstart",n=!0;break;case"gestureend":i="pinchend",r=!0}return{type:i,target:e.target,pointerType:"mouse",srcEvent:e,pointers:[{x:e.clientX,y:e.clientY}],isFirst:n,isFinal:r,scale:null!==(t=e.scale)&&void 0!==t?t:1,center:{x:e.clientX,y:e.clientY},velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0}},m=function(e){if(e.preventDefault(),!Fr()){var n=v(e),r=(A={firstInput:n}).firstInput;r&&!i(r.center)||t.onPinchGesture(n)}},g=function(e){if(e.preventDefault(),!Fr()&&A){var n=v(e),r=A.firstInput;r&&!i(r.center)||t.onPinchGesture(n)}},y=function(e){if(e.preventDefault(),!Fr()&&A){var n=v(e),r=A.firstInput;A=null,r&&!i(r.center)||t.onPinchGesture(n)}},b=function(t){if(t&&"function"==typeof t.preventDefault&&t.currentTarget===e&&t.preventDefault(),"function"==typeof getSelection){var i=getSelection();i&&i.focusNode&&(i.removeAllRanges&&i.removeAllRanges(),i.empty&&i.empty())}};e.addEventListener("wheel",l,{passive:!1}),e.addEventListener("mousemove",c,!1),e.addEventListener("mouseout",u,!1),e.addEventListener("touchstart",d,{passive:!0}),e.addEventListener("touchend",f,!1),e.addEventListener("touchcancel",f,!1),e.addEventListener("mousedown",p,!1),e.addEventListener("mouseup",f,!1),e.addEventListener("gesturestart",m,{passive:!1}),e.addEventListener("gesturechange",g,{passive:!1}),e.addEventListener("gestureend",y,{passive:!1}),e.addEventListener("touchstart",b,{passive:!1}),e.addEventListener("contextmenu",b,!1);return Object.assign((function(){n.destroy(),e.removeEventListener("wheel",l,!1),e.removeEventListener("mousemove",c,!1),e.removeEventListener("mouseout",u,!1),e.removeEventListener("touchstart",d,!1),e.removeEventListener("touchend",f,!1),e.removeEventListener("touchcancel",f,!1),e.removeEventListener("mousedown",p,!1),e.removeEventListener("mouseup",f,!1),e.removeEventListener("gesturestart",m,!1),e.removeEventListener("gesturechange",g,!1),e.removeEventListener("gestureend",y,!1),e.removeEventListener("touchstart",b,!1),e.removeEventListener("contextmenu",b,!1)}),{element:e})},t}(se),$r=function(e){function t(i){var n,r,o=this,a=t.parseArgs(i);return(o=e.call(this,a)||this).defaultLongitude=a.defaultLongitude,o.defaultLatitude=a.defaultLatitude,o.defaultFov=a.defaultFov,o.maxFov=a.maxFov,o.minFov=a.minFov,o.maxLatitude=a.maxLatitude,o.minLatitude=a.minLatitude,o.locationMotion=new ur({x:o.camera.pose.offset.x,y:o.camera.pose.offset.y,z:o.camera.pose.offset.z,distance:o.camera.pose.distance,modelAlpha:null!==(r=null===(n=o.model.getMaterial())||void 0===n?void 0:n.modelAlpha)&&void 0!==r?r:0,perspToOrtho:o.camera.perspToOrtho.x,orthoDistance:o.camera.orthoDistance}),o.currentTapPanoIndex=-1,o.intersectMeshCreator=a.intersectMeshCreator,o.intersectMesh=o.intersectMeshCreator(),o.intersectMesh.name="intersect",o.intersectMesh.visible=!1,o.helper.add(o.intersectMesh),o}return te(t,e),t.distanceFromModel=function(e,t,i){var n=e.bounding,r=Math.pow(Math.pow(n.max.x-n.min.x+1,2)+Math.pow(n.max.y-n.min.y+1,2)+Math.pow(n.max.z-n.min.z+1,2),.5),o=r/2/Math.tan(Math.PI*t/360);return i<1&&(o/=i),isNaN(o)?r:o},t.parseArgs=function(t){var i,n,r,o,a,s,l,c,u=e.parseArgs.call(this,t);return ie(ie({},u),{defaultLongitude:null!==(i=t.defaultLongitude)&&void 0!==i?i:Math.PI/4,defaultLatitude:null!==(n=t.defaultLatitude)&&void 0!==n?n:Math.PI/4,defaultFov:null!==(r=t.defaultFov)&&void 0!==r?r:80,maxFov:null!==(o=t.maxFov)&&void 0!==o?o:120,minFov:null!==(a=t.minFov)&&void 0!==a?a:40,maxLatitude:null!==(s=t.maxLatitude)&&void 0!==s?s:+Math.PI/2,minLatitude:null!==(l=t.minLatitude)&&void 0!==l?l:-Math.PI/2,intersectMeshCreator:null!==(c=t.intersectMeshCreator)&&void 0!==c?c:function(){return new wr}})},t.initAnimationEndPose=function(e){var i,r,o,a=this.parseArgs(e),s=e.initial[1];return{longitude:null!==(i=s.longitude)&&void 0!==i?i:a.defaultLongitude,latitude:Kn(null!==(r=s.latitude)&&void 0!==r?r:a.defaultLatitude,a.minLatitude,a.maxLatitude),fov:null!==(o=s.fov)&&void 0!==o?o:a.defaultFov,offset:e.model.bounding.getCenter(new n.Vector3),distance:t.distanceFromModel(a.model,a.defaultFov,a.camera.aspect)}},t.prototype.destroy=function(){e.prototype.destroy.call(this),this.locationMotion.dispose(),this.mouseWheelState&&clearTimeout(this.mouseWheelState.timer),delete this.mouseWheelState,delete this.mouseMoveState,delete this.panState,this.intersectMesh.dispose(),this.helper.remove(this.intersectMesh)},t.prototype.isReady=function(){return!1!==this.locationMotion.ended&&e.prototype.isReady.call(this)},t.prototype.updateWork=function(e,t,i,n,r){return this.work=e,this.updateCamera(i,null!=n?n:0,r),!0},t.prototype.updateModel=function(i){e.prototype.updateModel.call(this,i);var r=i.bounding.getCenter(new n.Vector3),o=t.distanceFromModel(i,this.defaultFov,this.camera.aspect);this.locationMotion.set({x:r.x,y:r.y,z:r.z,distance:o},0).catch(le)},t.prototype.updateTime=function(e,t){if(!this.destroyed){var i={},r={};this.locationMotion.ended||(this.locationMotion.update(e),i.modelAlpha=this.locationMotion.value.modelAlpha,this.camera.perspToOrtho.setScalar(Kn(this.locationMotion.value.perspToOrtho,0,1)),this.camera.orthoDistance=this.locationMotion.value.orthoDistance,r.distance=this.locationMotion.value.distance,r.offset=new n.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z)),this.cameraMotion.ended||(this.cameraMotion.update(e),r.longitude=this.cameraMotion.value.longitude,r.latitude=this.cameraMotion.value.latitude,r.fov=this.cameraMotion.value.fov),Ur(i)||this.model.setMaterial(i),Ur(r)||this.setCamera(r)}},t.prototype.getTargetPose=function(){var e=this.cameraMotion.getKeyFrameSegment(ue())[1],t=this.locationMotion.getKeyFrameSegment(ue())[1];return{longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,offset:new n.Vector3(t.value.x,t.value.y,t.value.z),distance:t.value.distance}},t.prototype.initAnimation=function(e,i,r,o){var a,s,l,c=this;if(!this.destroyed){this.pending=!1,this.userAction=o;var u={longitude:null!==(a=i.longitude)&&void 0!==a?a:this.defaultLongitude,latitude:Kn(null!==(s=i.latitude)&&void 0!==s?s:this.defaultLatitude,this.minLatitude,this.maxLatitude),fov:Kn(null!==(l=i.fov)&&void 0!==l?l:this.defaultFov,this.minFov,this.maxFov),offset:this.model.bounding.getCenter(new n.Vector3),distance:t.distanceFromModel(this.model,this.defaultFov,this.camera.aspect)},h=ci(u,["longitude","latitude","fov"]),d={x:u.offset.x,y:u.offset.y,z:u.offset.z,distance:u.distance,modelAlpha:1,perspToOrtho:0,orthoDistance:u.distance};this.emit("initAnimationWillStart",e,u,this.userAction),this.cameraMotion.set(h,r).catch(le),this.locationMotion.set(d,r).then((function(){c.emit("initAnimationEnded",e,u,c.userAction)}),(function(t){var i=zr(c.camera.pose);c.emit("initAnimationEnded",e,i,c.userAction)})).catch(le)}},t.prototype.updateRenderSize=function(){this.locationMotion.set({distance:t.distanceFromModel(this.model,this.defaultFov,this.camera.aspect)},0).catch(le)},t.prototype.getForwardPanoIndexOrNot=function(e){var t=this.work.observers.filter((function(e){return e.active})),i=this.model.intersectRaycaster(e)[0];if(!i)return null;var n=Vr(t,(function(e){return e.standingPosition.distanceTo(i.point)}),!0),r=n[0];return n[1]<10?r.panoIndex:null},t.prototype.coordinatesForOffset=function(e){var t=this.renderer.getSize(new n.Vector2);return{longitude:2*e.x/(t.x*this.scissor.width),latitude:2*e.y/(t.y*this.scissor.height)}},t.prototype.requestInteriaMovement=function(e,t){var i=this;if(!1!==this.interiaMovement){for(var n=ie({},e),r={longitude:0,latitude:0},o=0;o<t;o++)n.longitude*=.996,n.latitude*=.994008,r.longitude+=n.longitude,r.latitude+=n.latitude;var a=Rr(this.cameraMotion.value.longitude+r.longitude),s=Kn(this.cameraMotion.value.latitude+r.latitude,this.minLatitude,this.maxLatitude),l={longitude:a,latitude:s,fov:this.cameraMotion.value.fov,offset:this.camera.pose.offset.clone(),distance:this.camera.pose.distance};this.cameraMotion.set({longitude:a,latitude:s},0).catch(le);var c=n.longitude>1e-4||n.longitude<-1e-4||n.latitude>1e-4||n.latitude<-1e-4;this.emit("interiaPan",l,!c),c?ke.shared.add((function(e,t){i.requestInteriaMovement(n,0|t)}),!0,1):this.interiaMovement=!1}},t.prototype.onPanGesture=function(e){var t=this.panState,i=e.pointers.length;if(e.isFinal?delete this.panState:this.panState={pointerLength:i,x:e.center.x,y:e.center.y},void 0!==t&&t.pointerLength===i){var n=e.pointers.map((function(e){return ci(e,["x","y"])}));if(!this.emit("wantsGesture","pan",n,e.isFinal)){var r={x:e.center.x-t.x,y:e.center.y-t.y},o=this.relativeClientPosition(e.center),a=this.camera.pose.latitude<Math.PI/6||o.y<0?-1:1;r.x*=a;var s=this.coordinatesForOffset(r),l=Rr(this.cameraMotion.value.longitude+s.longitude),c=Kn(this.cameraMotion.value.latitude+s.latitude,this.minLatitude,this.maxLatitude);this.camera.aspect<1&&Math.abs(e.overallVelocityX)>.2&&Math.atan2(Math.abs(e.overallVelocityY),Math.abs(e.overallVelocityX))<Math.PI/6.923&&(c=this.cameraMotion.value.latitude);var u={longitude:l,latitude:c,fov:this.camera.pose.fov,offset:this.camera.pose.offset,distance:this.camera.pose.distance};if(!this.emit("wantsPanGesture",u,e.isFinal))if(this.emit("gesture","pan",n,e.isFinal),this.emit("panGesture",u,e.isFinal),this.userAction=!0,this.interiaMovement=!1,this.hideIntersectMesh(),this.cameraMotion.set({longitude:u.longitude,latitude:u.latitude},0).catch(le),e.isFinal)if(!this.emit("wantsInteriaPan",u)){this.interiaMovement=!0;var h=e.velocityX*a,d=e.velocityY;this.requestInteriaMovement(this.coordinatesForOffset({x:h,y:d}),0)}}}},t.prototype.onPinchGesture=function(e){var t,i=null===(t=this.pinchState)||void 0===t?void 0:t.fov,n=!1;if("pinchstart"!==e.type){if("pinchend"===e.type&&(n=!0,delete this.panState,delete this.pinchState),void 0!==i){var r=e.pointers.map((function(e){return ci(e,["x","y"])}));if(!this.emit("wantsGesture","pinch",r,n)){var o=Kn(i/e.scale,this.minFov,this.maxFov);this.emit("wantsPinchGesture",e.scale,o,n)||this.emit("wantsChangeCameraFov",o)||(this.emit("gesture","pinch",r,n),this.emit("pinchGesture",e.scale,o,n),this.userAction=!0,this.interiaMovement=!1,this.cameraMotion.set({fov:o},0).catch(le),this.onPanGesture(e))}}}else this.pinchState={fov:this.cameraMotion.value.fov}},t.prototype.onMouseMove=function(e){if(this.intersectMesh.parent&&!this.model.empty&&this.model.bvhs&&!0===this.model.bvhs.loaded&&!this.panState){var t=this.relativeClientPosition({x:e.clientX,y:e.clientY}),i=new n.Raycaster;if(i.setFromCamera(t,this.camera),this.emit("wantsShowIntersectionOnModel",i))this.hideIntersectMesh();else{var r=this.model.intersectRaycaster(i)[0];if(r&&r.face){var o=r.face.normal,a=o.clone().multiplyScalar(.05),s=r.point.clone().add(a);this.intersectMesh.position.copy(s);var l=s.clone().add(a);if(this.intersectMesh.lookAt(l),Math.abs(o.y)>.99){var c=this.camera.position.clone().sub(s);this.intersectMesh.rotation.z=-Math.atan2(c.z,c.x)}this.intersectMesh.visible=!0,this.needsRender=!0,this.emit("intersectionOnModelUpdate",r,this.intersectMesh)}else this.hideIntersectMesh();this.mouseMoveState={clientX:e.clientX,clientY:e.clientY}}}},t.prototype.onMouseOut=function(){this.intersectMesh.parent&&!0===this.intersectMesh.visible&&this.hideIntersectMesh()},t.prototype.onMouseWheel=function(e){var t=this,i=(Math.abs(e.deltaY)>Math.abs(e.deltaX)?e.deltaY:e.deltaX)/-60,n=[{x:e.clientX,y:e.clientY,delta:i}];if(!this.emit("wantsGesture","mouseWheel",n,!1)){var r=this.minFov,o=this.maxFov,a=Kn(this.camera.fov-i,r,o);this.emit("wantsMouseWheel",i,a,!1)||this.emit("wantsChangeCameraFov",a)||(this.emit("gesture","mouseWheel",n,!1),this.emit("mouseWheel",i,a,!1),this.userAction=!0,this.interiaMovement=!1,this.cameraMotion.set({fov:a},0).catch(le),this.mouseWheelState&&clearTimeout(this.mouseWheelState.timer),this.mouseWheelState={timer:window.setTimeout((function(){delete t.mouseWheelState;t.emit("wantsGesture","mouseWheel",n,!0)||t.emit("wantsMouseWheel",i,a,!0)||(t.emit("gesture","mouseWheel",n,!0),t.emit("mouseWheel",0,a,!0))}),200)})}},t.prototype.onTapGesture=function(e){var t=this,i=e.pointers.map((function(e){return ci(e,["x","y"])}));if(!this.emit("wantsGesture","tap",i,!0)){var r=this.relativeClientPosition(e.center),o=new n.Raycaster;if(o.setFromCamera(r,this.camera),!this.emit("wantsTapGesture",o,r,!0)){this.emit("gesture","tap",i,!0),this.emit("tapGesture",o,r,!0),this.interiaMovement=!1;var a=this.getForwardPanoIndexOrNot(o);if(!Un(a)){this.emit("panoSelected",a);var s={longitude:this.camera.pose.longitude,latitude:0};this.currentTapPanoIndex=a,this.preloadPano(a).then((function(e){t.currentTapPanoIndex===e&&t.emit("wantsMoveToPano",e,s,!0)}))}}}},t.prototype.onPressGesture=function(e,t){var i,r,o=[e];if(this.emit("wantsGesture","press",o,t))return null===(i=this.pressState)||void 0===i||i.stop(),void delete this.pressState;var a=this.relativeClientPosition(e),s=new n.Raycaster;if(s.setFromCamera(a,this.camera),this.emit("wantsPressGesture",s,a,e.delta,t))return null===(r=this.pressState)||void 0===r||r.stop(),void delete this.pressState;this.emit("gesture","press",o,t),this.emit("pressGesture",s,a,e.delta,t)},t.prototype.preloadPano=function(e,t){var i=this;void 0===t&&(t=le);var n=this.work.observers[e],r=this.work.allowHosts;return Promise.all(["right","left","up","down","front","back"].map((function(t){var o=ie({key:"pano.".concat(e,".").concat(t)},ci(i.imageOptions,["size","format","quality","mappings"])),a=n.images[t];return Be(i.imageOptions.transform?i.imageOptions.transform(a,o):Le(a,o),{allowHosts:r,requestProxy:i.requestProxy,networkSubscribe:i.networkSubscribe})}))).then((function(){return t(e),e}))},t.prototype.hideIntersectMesh=function(){this.intersectMesh.visible=!1,this.emit("intersectionHidden"),this.needsRender=!0},t}(Jr),eo={longitude:0,latitude:Math.PI/2},to={longitude:0,latitude:0},io={longitude:Math.PI/2,latitude:0},no={longitude:Math.PI,latitude:0},ro={longitude:1.5*Math.PI,latitude:0};var oo=function(e){function t(i){var n=t.parseArgs(i);return e.call(this,n)||this}return te(t,e),t.parseArgs=function(t){var i=[t.initial[0],ie(ie({},t.initial[1]),{longitude:0,latitude:Math.PI/2}),t.initial[2],t.initial[3]],n=ie(ie({},t),{initial:i,maxLatitude:Math.PI/2,minLatitude:Math.PI/2,defaultLongitude:0,defaultLatitude:Math.PI/2});return e.parseArgs.call(this,n)},t.initAnimationEndPose=function(t){var i=this.parseArgs(t);return e.initAnimationEndPose.call(this,i)},t.prototype.updateModel=function(e){this.model=e,this.needsRender=!0;var t=e.bounding.getCenter(new n.Vector3);this.locationMotion.set({x:t.x,y:t.y,z:t.z,distance:$r.distanceFromModel(this.model,this.defaultFov,this.camera.aspect)},0).catch(le)},t.prototype.initAnimation=function(e,t,i,r){var o,a=this;if(!this.destroyed){this.pending=!1,this.userAction=r;var s={longitude:0,latitude:Math.PI/2,fov:Kn(null!==(o=t.fov)&&void 0!==o?o:this.defaultFov,this.minFov,this.maxFov),offset:this.model.bounding.getCenter(new n.Vector3),distance:$r.distanceFromModel(this.model,this.defaultFov,this.camera.aspect)},l=ci(s,["longitude","latitude","fov"]),c={x:s.offset.x,y:s.offset.y,z:s.offset.z,distance:s.distance,modelAlpha:1,perspToOrtho:1,orthoDistance:s.distance};this.cameraMotion.set(l,i).catch(le),this.locationMotion.set(c,i).then((function(){a.emit("initAnimationEnded",e,s,a.userAction)}),(function(t){var i=zr(a.camera.pose);a.emit("initAnimationEnded",e,i,a.userAction)}))}},t.prototype.getZoomOffsetFromFov=function(e,t,i){var r=this.camera.getDirection(new n.Vector3),o=Math.tan(i/2*Math.PI/180),a=Math.tan(t.fov/2*Math.PI/180),s=(a-o)/a,l=new n.Raycaster;l.setFromCamera(e,t);var c=l.ray.direction,u=c.angleTo(r),h=$r.distanceFromModel(this.model,this.defaultFov,this.camera.aspect),d=h*Math.tan(u),p=c.clone().setLength(h*Math.cos(u)).projectOnPlane(r),f=p.length(),A=s/f*p.x*d,v=s/f*p.z*d,m=s/f*p.y*d;return new n.Vector3(A,m,v)},t.prototype.requestInteriaMovement=function(e,t){},t.prototype.onPanGesture=function(e){var t=this.panState,i=e.pointers.length;if(e.isFinal?delete this.panState:this.panState={pointerLength:i,x:e.center.x,y:e.center.y},void 0!==t&&t.pointerLength===i){var r=e.pointers.map((function(e){return ci(e,["x","y"])}));if(!this.emit("wantsGesture","pan",r,e.isFinal)){var o=e.center.x-t.x,a=e.center.y-t.y,s=new n.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),l=this.model.bounding,c=l.getCenter(new n.Vector3),u=(l.max.x-l.min.x)/this.defaultFov*this.cameraMotion.value.fov,h=(l.max.y-l.min.y)/this.defaultFov*this.cameraMotion.value.fov,d=(l.max.z-l.min.z)/this.defaultFov*this.cameraMotion.value.fov,p={left:new n.Vector3,up:new n.Vector3,cameraDirection:"y"};this.cameraMotion.value.longitude===eo.longitude&&this.cameraMotion.value.latitude===eo.latitude?(p.left.set(1,0,0),p.up.set(0,0,-1),p.cameraDirection="y"):this.cameraMotion.value.longitude===to.longitude&&this.cameraMotion.value.latitude===to.latitude?(p.left.set(1,0,0),p.up.set(0,1,0),p.cameraDirection="z"):this.cameraMotion.value.longitude===no.longitude&&this.cameraMotion.value.latitude===no.latitude?(p.left.set(1,0,0),p.up.set(0,-1,0),p.cameraDirection="z"):this.cameraMotion.value.longitude===ro.longitude&&this.cameraMotion.value.latitude===ro.latitude?(p.left.set(0,0,-1),p.up.set(0,-1,0),p.cameraDirection="x"):this.cameraMotion.value.longitude===io.longitude&&this.cameraMotion.value.latitude===io.latitude&&(p.left.set(0,0,-1),p.up.set(0,1,0),p.cameraDirection="x");var f=(this.camera.position[p.cameraDirection]-l.min[p.cameraDirection])*Math.tan(this.camera.fov/2*Math.PI/180),A=this.renderer.getSize(new n.Vector2);s.add(function(e,t){var i=(new n.Vector3).copy(t);return i.multiplyScalar(-e),i}(2*o*f/A.y,p.left)),s.add(function(e,t){var i=(new n.Vector3).copy(t);return i.multiplyScalar(e),i}(2*a*f/A.y,p.up)),s.x=Kn(s.x,c.x-u,c.x+u),s.y=Kn(s.y,c.y-h,c.y+h),s.z=Kn(s.z,c.z-d,c.z+d);var v={longitude:0,latitude:Math.PI/2,fov:this.cameraMotion.value.fov,offset:s,distance:this.locationMotion.value.distance};this.emit("wantsPanGesture",v,e.isFinal)||(this.emit("gesture","pan",r,e.isFinal),this.emit("panGesture",v,e.isFinal),this.userAction=!0,this.locationMotion.set({x:s.x,y:s.y,z:s.z},0).catch(le))}}},t.prototype.onPinchGesture=function(e){var t,i=null===(t=this.pinchState)||void 0===t?void 0:t.fov,n=!1;if("pinchstart"!==e.type){if("pinchend"===e.type&&(n=!0,delete this.pinchState),void 0!==i){var r=e.pointers.map((function(e){return ci(e,["x","y"])}));if(!this.emit("wantsGesture","pinch",r,n)){var o=Kn(i/e.scale,this.minFov,this.maxFov),a=this.relativeClientPosition({x:e.center.x,y:e.center.y}),s=this.getZoomOffsetFromFov(a,this.camera,o);this.cameraMotion.value.longitude===eo.longitude&&this.cameraMotion.value.latitude===eo.latitude?s.y=0:this.cameraMotion.value.longitude===to.longitude&&this.cameraMotion.value.latitude===to.latitude||this.cameraMotion.value.longitude===no.longitude&&this.cameraMotion.value.latitude===no.latitude?s.z=0:(this.cameraMotion.value.longitude===ro.longitude&&this.cameraMotion.value.latitude===ro.latitude||this.cameraMotion.value.longitude===io.longitude&&this.cameraMotion.value.latitude===io.latitude)&&(s.x=0);var l=this.camera.pose.offset.clone().add(s);this.emit("wantsPinchGesture",e.scale,o,n)||this.emit("wantsChangeCameraFov",o)||(this.emit("gesture","pinch",r,n),this.emit("pinchGesture",e.scale,o,n),this.userAction=!0,this.locationMotion.set({x:l.x,y:l.y,z:l.z},0).catch(le),this.cameraMotion.set({longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude,fov:o},0).catch(le),this.onPanGesture(e))}}}else this.pinchState={fov:this.cameraMotion.value.fov}},t.prototype.onMouseWheel=function(e){var t=this,i=(Math.abs(e.deltaY)>Math.abs(e.deltaX)?e.deltaY:e.deltaX)/-60,n=[{x:e.clientX,y:e.clientY,delta:i}];if(!this.emit("wantsGesture","mouseWheel",n,!1)){var r=Kn(this.cameraMotion.value.fov-i,this.minFov,this.maxFov),o=this.relativeClientPosition({x:e.clientX,y:e.clientY}),a=this.getZoomOffsetFromFov(o,this.camera,r);this.cameraMotion.value.longitude===eo.longitude&&this.cameraMotion.value.latitude===eo.latitude?a.y=0:this.cameraMotion.value.longitude===to.longitude&&this.cameraMotion.value.latitude===to.latitude||this.cameraMotion.value.longitude===no.longitude&&this.cameraMotion.value.latitude===no.latitude?a.z=0:(this.cameraMotion.value.longitude===ro.longitude&&this.cameraMotion.value.latitude===ro.latitude||this.cameraMotion.value.longitude===io.longitude&&this.cameraMotion.value.latitude===io.latitude)&&(a.x=0);var s=this.camera.pose.offset.clone().add(a);this.emit("wantsMouseWheel",i,r,!1)||this.emit("wantsChangeCameraFov",r)||(this.emit("gesture","mouseWheel",n,!1),this.emit("mouseWheel",i,r,!1),this.userAction=!0,this.locationMotion.set({x:s.x,y:s.y,z:s.z},0).catch(le),this.cameraMotion.set({longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude,fov:r},0).catch(le),this.mouseWheelState&&clearTimeout(this.mouseWheelState.timer),this.mouseWheelState={timer:window.setTimeout((function(){delete t.mouseWheelState;t.emit("wantsGesture","mouseWheel",n,!0)||t.emit("wantsMouseWheel",i,r,!0)||t.emit("wantsChangeCameraFov",r)||(t.emit("gesture","mouseWheel",n,!0),t.emit("mouseWheel",0,r,!0))}),200)})}},t}($r);function ao(e,t){void 0===t&&(t=!1);var i=typeof e;if("string"===i)return JSON.stringify(e);if(!0===e)return"true";if(!1===e)return"false";if(null===e)return"null";if(e instanceof Array){for(var n="[",r=e.length-1,o=0;o<r;o++)n+=ao(e[o],!1)+",";return r>-1&&(n+=ao(e[o],!1)),n+"]"}if(e instanceof Object){if("function"==typeof e.toJSON)return ao(e.toJSON(),t);var a=Object.keys(e).sort(),s=a.length;for(n="",o=0;o<s;){var l=a[o],c=ao(e[l],!0);void 0!==c&&(o&&""!==n&&(n+=","),n+=JSON.stringify(l)+":"+c),o++}return"{"+n+"}"}switch(i){case"function":return JSON.stringify(e.toString());case"undefined":return t?void 0:null;case"number":return e;default:return isFinite(e)?e:null}}function so(e){return"hash::".concat(ao(e,!1))}var lo,co=function(e){function t(i){var n=this,r=t.parseArgs(i);return(n=e.call(this,r)||this).defaultLongitude=r.defaultLongitude,n.defaultLatitude=r.defaultLongitude,n.defaultFov=r.defaultFov,n.maxFov=r.maxFov,n.minFov=r.minFov,n.maxLatitude=r.maxLatitude,n.minLatitude=r.minLatitude,n.moveSpeed=r.moveSpeed,n.intersectMeshCreator=r.intersectMeshCreator,n.interiaMovement=!1,n.intersectMesh=n.intersectMeshCreator(),n.intersectMesh.name="intersect",n.intersectMesh.visible=!1,n.helper.add(n.intersectMesh),n}return te(t,e),t.parseArgs=function(t){var i,n,r,o,a,s,l,c,u,h=e.parseArgs.call(this,t);return ie(ie({},h),{defaultLongitude:null!==(i=t.defaultLongitude)&&void 0!==i?i:0,defaultLatitude:null!==(n=t.defaultLatitude)&&void 0!==n?n:0,defaultFov:null!==(r=t.defaultFov)&&void 0!==r?r:90,maxFov:null!==(o=t.maxFov)&&void 0!==o?o:120,minFov:null!==(a=t.minFov)&&void 0!==a?a:40,maxLatitude:null!==(s=t.maxLatitude)&&void 0!==s?s:+Math.PI/2,minLatitude:null!==(l=t.minLatitude)&&void 0!==l?l:-Math.PI/2,moveSpeed:null!==(c=t.moveSpeed)&&void 0!==c?c:3.2,intersectMeshCreator:null!==(u=t.intersectMeshCreator)&&void 0!==u?u:function(){return new wr}})},t.initAnimationEndPose=function(e){var t,i,n,r=this.parseArgs(e),o=e.initial,a=o[0],s=o[1];return{longitude:null!==(t=s.longitude)&&void 0!==t?t:r.defaultLongitude,latitude:Kn(null!==(i=s.latitude)&&void 0!==i?i:r.defaultLatitude,r.minLatitude,r.maxLatitude),fov:Kn(null!==(n=s.fov)&&void 0!==n?n:r.defaultFov,r.minFov,r.maxFov),offset:r.work.observers[a].position.clone(),distance:0}},t.prototype.destroy=function(){e.prototype.destroy.call(this),this.interiaMovement=!1,this.intersectMesh&&(this.helper.remove(this.intersectMesh),this.intersectMesh.dispose()),this.mouseWheelState&&clearTimeout(this.mouseWheelState.timer),delete this.mouseWheelState,delete this.mouseMoveState,delete this.panState},t.prototype.isReady=function(){return!this.interiaMovement&&(!this.panState&&(!this.pinchState&&(!this.mouseWheelState&&e.prototype.isReady.call(this))))},t.prototype.calculateMovingDuration=function(e,t){switch(typeof e){case"function":return e(t,this.moveSpeed);case"number":return e;case"string":return Number(e);default:return Kn(t,2,5)/this.moveSpeed*1e3}},t.prototype.hideIntersectMesh=function(){this.intersectMesh.visible=!1,this.emit("intersectionHidden"),this.needsRender=!0},t.prototype.coordinatesForOffset=function(e){var t=this.cameraMotion.value.fov,i=this.camera.aspect,r=this.renderer.getSize(new n.Vector2);return{longitude:2*e.x/(r.x*this.scissor.width)*t/95*i,latitude:-2*e.y/(r.y*this.scissor.height)*t/95}},t.prototype.cameraBounce=function(){var e=this.cameraMotion.value,t=e.longitude,i=e.latitude,n=e.fov,r=[{progress:0,value:{longitude:t,latitude:i,fov:n}},{progress:.5,value:{longitude:t,latitude:i,fov:.98*n}},{progress:1,value:{longitude:t,latitude:i,fov:n}}];this.cameraMotion.setKeyframes(r,500).catch(le)},t.prototype.requestInteriaMovement=function(e,t){var i=this;if(!1!==this.interiaMovement){for(var n=ie({},e),r={longitude:0,latitude:0},o=0;o<t;o++)n.longitude*=.996,n.latitude*=.98604,r.longitude+=n.longitude,r.latitude+=n.latitude;var a=Rr(this.cameraMotion.value.longitude+r.longitude),s=Kn(this.cameraMotion.value.latitude+r.latitude,this.minLatitude,this.maxLatitude),l={longitude:a,latitude:s,fov:this.cameraMotion.value.fov,offset:this.camera.pose.offset.clone(),distance:this.camera.pose.distance};this.cameraMotion.set({longitude:a,latitude:s},0).catch(le);var c=n.longitude>1e-4||n.longitude<-1e-4||n.latitude>1e-4||n.latitude<-1e-4;this.emit("interiaPan",l,!c),c?ke.shared.add((function(e,t){i.requestInteriaMovement(n,0|t)}),!0,1):this.interiaMovement=!1}},t.prototype.onPanGesture=function(e){var t=this.panState,i=e.pointers.length;if(e.isFinal?delete this.panState:this.panState={pointerLength:i,x:e.center.x,y:e.center.y},void 0!==t&&t.pointerLength===i){var n=e.pointers.map((function(e){return ci(e,["x","y"])}));if(!this.emit("wantsGesture","pan",n,e.isFinal)){var r={x:e.center.x-t.x,y:e.center.y-t.y},o=this.coordinatesForOffset(r),a=Rr(this.cameraMotion.value.longitude+o.longitude),s=Kn(this.cameraMotion.value.latitude+o.latitude,this.minLatitude,this.maxLatitude);this.camera.aspect<1&&Math.abs(e.overallVelocityX)>.2&&Math.atan2(Math.abs(e.overallVelocityY),Math.abs(e.overallVelocityX))<Math.PI/6.923&&(s=this.cameraMotion.value.latitude);var l={longitude:a,latitude:s,fov:this.cameraMotion.value.fov,offset:this.camera.pose.offset.clone(),distance:this.camera.pose.distance};if(!this.emit("wantsPanGesture",l,e.isFinal)){this.emit("gesture","pan",n,e.isFinal),this.emit("panGesture",l,e.isFinal),this.userAction=!0,this.interiaMovement=!1,this.hideIntersectMesh();var c={longitude:l.longitude,latitude:l.latitude,fov:l.fov};if(this.cameraMotion.set(c,0).catch(le),e.isFinal)if(!this.emit("wantsInteriaPan",l)){this.interiaMovement=!0;var u=e.velocityX,h=.6*e.velocityY;Math.abs(h)>.5&&Math.abs(u)<.5&&(u=0),this.requestInteriaMovement(this.coordinatesForOffset({x:u,y:h}),0)}}}}},t.prototype.onPinchGesture=function(e){var t,i=null===(t=this.pinchState)||void 0===t?void 0:t.fov,n=e.scale,r=!1;if("pinchstart"!==e.type){if("pinchend"===e.type&&(r=!0,delete this.pinchState),void 0!==i){var o=e.pointers.map((function(e){return ci(e,["x","y"])}));if(!this.emit("wantsGesture","pinch",o,r)){var a=Kn(i/n,this.minFov,this.maxFov);this.emit("wantsPinchGesture",n,a,r)||this.emit("wantsChangeCameraFov",a)||(this.emit("gesture","pinch",o,r),this.emit("pinchGesture",n,a,r),this.userAction=!0,this.interiaMovement=!1,this.cameraMotion.set({fov:a},0).catch(le),this.onPanGesture(e))}}}else this.pinchState={fov:this.cameraMotion.value.fov}},t.prototype.onMouseWheel=function(e){var t=this,i=(Math.abs(e.deltaY)>Math.abs(e.deltaX)?e.deltaY:e.deltaX)/-60,n=[{x:e.clientX,y:e.clientY,delta:i}];if(!this.emit("wantsGesture","mouseWheel",n,!1)){var r=Kn(this.cameraMotion.value.fov-i,this.minFov,this.maxFov);this.emit("wantsMouseWheel",i,r,!1)||this.emit("wantsChangeCameraFov",r)||(this.emit("gesture","mouseWheel",n,!1),this.emit("mouseWheel",i,r,!1),this.userAction=!0,this.interiaMovement=!1,this.cameraMotion.set({fov:r},0).catch(le),this.mouseWheelState&&clearTimeout(this.mouseWheelState.timer),this.mouseWheelState={timer:window.setTimeout((function(){delete t.mouseWheelState;t.emit("wantsGesture","mouseWheel",n,!0)||t.emit("wantsMouseWheel",i,r,!0)||t.emit("wantsChangeCameraFov",r)||(t.emit("gesture","mouseWheel",n,!0),t.emit("mouseWheel",0,r,!0))}),200)})}},t.prototype.onMouseMove=function(e){if(this.intersectMesh.parent&&!this.model.empty&&this.model.bvhs&&!0===this.model.bvhs.loaded&&!this.panState){var t=this.relativeClientPosition({x:e.clientX,y:e.clientY}),i=new n.Raycaster;if(i.setFromCamera(t,this.camera),this.emit("wantsShowIntersectionOnModel",i))this.hideIntersectMesh();else{var r=this.model.intersectRaycaster(i)[0];if(r&&r.face){var o=r.face.normal,a=o.clone().multiplyScalar(.05),s=r.point.clone().add(a);this.intersectMesh.position.copy(s);var l=s.clone().add(a);if(this.intersectMesh.lookAt(l),Math.abs(o.y)>.99){var c=this.camera.position.clone().sub(s);this.intersectMesh.rotation.z=-Math.atan2(c.z,c.x)}this.intersectMesh.visible=!0,this.needsRender=!0,this.emit("intersectionOnModelUpdate",r,this.intersectMesh)}else this.hideIntersectMesh();this.mouseMoveState={clientX:e.clientX,clientY:e.clientY}}}},t.prototype.onMouseOut=function(){this.intersectMesh.parent&&!0===this.intersectMesh.visible&&this.hideIntersectMesh()},t.prototype.onPressGesture=function(e,t){var i,r,o=[e];if(this.emit("wantsGesture","press",o,t))return null===(i=this.pressState)||void 0===i||i.stop(),void delete this.pressState;var a=this.relativeClientPosition(e),s=new n.Raycaster;if(s.setFromCamera(a,this.camera),this.emit("wantsPressGesture",s,a,e.delta,t))return null===(r=this.pressState)||void 0===r||r.stop(),void delete this.pressState;this.emit("gesture","press",o,t),this.emit("pressGesture",s,a,e.delta,t)},t}(Jr);function uo(){return lo||(lo=new Promise((function(e){var t,i=document.createElement("video");i.muted=!0,i.src="data:video/mp4;base64,AAAAHGZ0eXBNNFYgAAACAGlzb21pc28yYXZjMQAAAAhmcmVlAAAGF21kYXTeBAAAbGliZmFhYyAxLjI4AABCAJMgBDIARwAAArEGBf//rdxF6b3m2Ui3lizYINkj7u94MjY0IC0gY29yZSAxNDIgcjIgOTU2YzhkOCAtIEguMjY0L01QRUctNCBBVkMgY29kZWMgLSBDb3B5bGVmdCAyMDAzLTIwMTQgLSBodHRwOi8vd3d3LnZpZGVvbGFuLm9yZy94MjY0Lmh0bWwgLSBvcHRpb25zOiBjYWJhYz0wIHJlZj0zIGRlYmxvY2s9MTowOjAgYW5hbHlzZT0weDE6MHgxMTEgbWU9aGV4IHN1Ym1lPTcgcHN5PTEgcHN5X3JkPTEuMDA6MC4wMCBtaXhlZF9yZWY9MSBtZV9yYW5nZT0xNiBjaHJvbWFfbWU9MSB0cmVsbGlzPTEgOHg4ZGN0PTAgY3FtPTAgZGVhZHpvbmU9MjEsMTEgZmFzdF9wc2tpcD0xIGNocm9tYV9xcF9vZmZzZXQ9LTIgdGhyZWFkcz02IGxvb2thaGVhZF90aHJlYWRzPTEgc2xpY2VkX3RocmVhZHM9MCBucj0wIGRlY2ltYXRlPTEgaW50ZXJsYWNlZD0wIGJsdXJheV9jb21wYXQ9MCBjb25zdHJhaW5lZF9pbnRyYT0wIGJmcmFtZXM9MCB3ZWlnaHRwPTAga2V5aW50PTI1MCBrZXlpbnRfb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ABAAAAAwAAAAEAAAABAAAABAAAAAIAAAABAAAABgAAAAEAAAABAAAABwAAAAIAAAABAAAACAAAAAEAAAABAAAACQAAAAIAAAABAAAACgAAAAEAAAABAAAACwAAAAIAAAABAAAADQAAAAEAAAABAAAADgAAAAIAAAABAAAADwAAAAEAAAABAAAAEAAAAAIAAAABAAAAEQAAAAEAAAABAAAAEgAAAAIAAAABAAAAFAAAAAEAAAABAAAAFQAAAAIAAAABAAAAFgAAAAEAAAABAAAAFwAAAAIAAAABAAAAGAAAAAEAAAABAAAAGQAAAAIAAAABAAAAGgAAAAEAAAABAAAAGwAAAAIAAAABAAAAHQAAAAEAAAABAAAAHgAAAAIAAAABAAAAHwAAAAQAAAABAAAA4HN0c3oAAAAAAAAAAAAAADMAAAAaAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAACMc3RjbwAAAAAAAAAfAAAALAAAA1UAAANyAAADhgAAA6IAAAO+AAAD0QAAA+0AAAQAAAAEHAAABC8AAARLAAAEZwAABHoAAASWAAAEqQAABMUAAATYAAAE9AAABRAAAAUjAAAFPwAABVIAAAVuAAAFgQAABZ0AAAWwAAAFzAAABegAAAX7AAAGFwAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTUuMzMuMTAw",i.addEventListener("timeupdate",(function n(){i.removeEventListener("timeupdate",n,!1),clearTimeout(t);var r=document.createElement("canvas");r.width=r.height=1;var o=r.getContext("2d");o?(o.drawImage(i,0,0,1,1),o.getImageData(0,0,1,1).data[3]>10?e(!0):e(!1)):e(!1)}),!1),i.addEventListener("canplay",(function e(){i.removeEventListener("canplay",e,!1),i.play()}),!1),t=window.setTimeout((function(){return e(!1)}),1e3)})))}var ho,po=function(e){function t(t,i){return void 0===i&&(i=.5),e.call(this,t,{uniforms:{inputBuffer:new n.Uniform(null),scale:new n.Uniform(i)},fragment:"\n#include <common>\nuniform sampler2D inputBuffer;\nuniform float scale;\nvarying vec2 vUv;\n\nvoid main() {\n float u = (vUv.x - 0.5) * scale + 0.5;\n float v = (vUv.y - 0.5) * scale + 0.5;\n vec3 rgb = texture2D(inputBuffer, vec2(u, v)).rgb;\n float luminance = clamp(linearToRelativeLuminance(rgb), 0.1, 0.9);\n gl_FragColor = vec4(luminance);\n}\n"})||this}return te(t,e),t}(Wr),fo=function(e){function t(t,i){void 0===i&&(i=.002);var r=e.call(this,t,{uniforms:{targetBuffer:new n.Uniform(null),inputBuffer:new n.Uniform(null),step:new n.Uniform(i)},fragment:"\n uniform sampler2D targetBuffer;\n uniform sampler2D inputBuffer;\n uniform float step;\n varying vec2 vUv;\n void main() {\n\n #ifdef GL_EXT_shader_texture_lod\n #if __VERSION__ < 300\n float target = texture2DLodEXT(targetBuffer, vUv, 5.0).r;\n #else\n float target = textureLod(targetBuffer, vUv, 5.0).r;\n #endif\n #else\n float target = texture2D(targetBuffer, vUv).r;\n #endif\n float current = texture2D(inputBuffer, vUv).r;\n\n float result;\n if (abs(target - current) < step) {\n result = target;\n } else if (target - current > 0.0) {\n result = current + step;\n } else {\n result = current - step;\n }\n gl_FragColor = vec4(result, result, result, 1.0);\n }\n "})||this;return r.material.extensions.shaderTextureLOD=!0,r}return te(t,e),Object.defineProperty(t.prototype,"targetBuffer",{get:function(){return this.material.uniforms.targetBuffer.value},set:function(e){this.material.uniforms.targetBuffer.value=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"step",{get:function(){return this.material.uniforms.step.value},set:function(e){this.material.uniforms.step.value=e},enumerable:!1,configurable:!0}),t}(Wr),Ao=function(e){function t(t){var i=e.call(this,t,{uniforms:{inputBuffer:new n.Uniform(null),luminanceAdaptiveBuffer:new n.Uniform(null),progress:new n.Uniform(0)},fragment:"\n #include <common>\n uniform sampler2D inputBuffer;\n uniform sampler2D luminanceAdaptiveBuffer;\n uniform float progress;\n varying vec2 vUv;\n\n void main() {\n float middleGrey = 1.5;\n float whitePoint = 13.0;\n float exposure = 1.4;\n vec4 inputColor = texture2D(inputBuffer, vUv);\n vec3 rgb = inputColor.rgb * exposure;\n float alpha = inputColor.a;\n float luminance = linearToRelativeLuminance(rgb);\n float lumAvg = texture2D(luminanceAdaptiveBuffer, vec2(0.5)).r;\n float lumScaled = (luminance * middleGrey) / max(lumAvg, 1e-6);\n float lumCompressed = lumScaled * (1.0 + lumScaled / (whitePoint * whitePoint));\n lumCompressed /= (1.0 + lumScaled);\n rgb = clamp(lumCompressed * rgb, 0.0, 1.0);\n gl_FragColor = mix(inputColor, vec4(rgb, alpha), progress * 0.9);\n }\n "})||this;return i.material.transparent=!0,i}return te(t,e),Object.defineProperty(t.prototype,"luminanceAdaptiveBuffer",{get:function(){return this.material.uniforms.luminanceAdaptiveBuffer.value},set:function(e){this.material.uniforms.luminanceAdaptiveBuffer.value=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"progress",{get:function(){return this.material.uniforms.progress.value},set:function(e){this.material.uniforms.progress.value=e},enumerable:!1,configurable:!0}),t}(Wr),vo=function(e){function t(t){var i=e.call(this,t)||this;return i.enableTime=ue(),i.renderer=t,i.valuePass=new Xr(i.renderer),i.luminancePass=new po(i.renderer,Math.sqrt(1/3)),i.nextStepPass=new fo(i.renderer,.01),i.luminanceAdaptivePass=new Ao(i.renderer),i}return te(t,e),t.prototype.render=function(e,t){if(!this.enable)return this.enableTime=null,void this.copyPass.render(e,t);null===this.enableTime&&(this.enableTime=ue()),this.luminanceTargetBuffer||(this.luminanceTargetBuffer=new n.WebGLRenderTarget(128,128,{minFilter:n.LinearMipmapLinearFilter,magFilter:n.LinearFilter,encoding:this.renderer.outputEncoding,stencilBuffer:!1,depthBuffer:!1,format:n.RGBAFormat,generateMipmaps:!0}),this.nextStepPass.targetBuffer=this.luminanceTargetBuffer.texture),this.luminancePass.render(e,this.luminanceTargetBuffer),this.luminancePrevBuffer||(this.luminancePrevBuffer=new n.WebGLRenderTarget(1,1,{minFilter:n.NearestFilter,magFilter:n.NearestFilter,type:n.HalfFloatType,encoding:this.renderer.outputEncoding,stencilBuffer:!1,depthBuffer:!1}),this.valuePass.render(new n.Vector3(.5,.5,.5),this.luminancePrevBuffer)),this.luminanceNextBuffer||(this.luminanceNextBuffer=new n.WebGLRenderTarget(1,1,{minFilter:n.NearestFilter,magFilter:n.NearestFilter,type:n.HalfFloatType,encoding:this.renderer.outputEncoding,stencilBuffer:!1,depthBuffer:!1}),this.valuePass.render(new n.Vector3(.5,.5,.5),this.luminanceNextBuffer),this.luminanceAdaptivePass.luminanceAdaptiveBuffer=this.luminanceNextBuffer.texture),this.copyPass.render(this.luminanceNextBuffer,this.luminancePrevBuffer),this.nextStepPass.render(this.luminancePrevBuffer,this.luminanceNextBuffer),this.luminanceAdaptivePass.progress=Math.min((ue()-this.enableTime)/100,1),this.luminanceAdaptivePass.render(e,t)},t.prototype.dispose=function(){var e,t,i;null===(e=this.luminanceTargetBuffer)||void 0===e||e.dispose(),null===(t=this.luminancePrevBuffer)||void 0===t||t.dispose(),null===(i=this.luminanceNextBuffer)||void 0===i||i.dispose(),this.copyPass.dispose(),this.luminancePass.dispose(),this.nextStepPass.dispose(),this.luminanceAdaptivePass.dispose()},t}(Zr),mo=null!==(ho=Math.SQRT1_2)&&void 0!==ho?ho:Math.sqrt(2),go={up:new n.Quaternion(mo,0,0,mo),down:new n.Quaternion(-mo,0,0,mo),left:new n.Quaternion(0,mo,0,mo),right:new n.Quaternion(0,-mo,0,mo),front:new n.Quaternion(0,0,0,1),back:new n.Quaternion(0,1,0,0)},yo=new Float32Array([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),bo=new Float32Array([0,0,1,0,0,1,1,1]),xo=new Uint8Array([0,1,2,1,3,2]),wo=new n.BufferGeometry;wo.setAttribute("position",new n.BufferAttribute(yo,3)),wo.setAttribute("uv",new n.BufferAttribute(bo,2)),wo.setIndex(new n.BufferAttribute(xo,1));var Mo=function(e){function t(){var t=e.call(this,{uniforms:{map:{value:null},luminanceMap:{value:null}},vertexShader:"\nvarying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n",fragmentShader:"\n#if defined(USE_LUMINANCE)\nuniform sampler2D luminanceMap;\n#endif\nuniform sampler2D map;\nvarying vec2 vUv;\n\nvoid main() {\n gl_FragColor = texture2D(map, vUv);\n #if defined(USE_LUMINANCE)\n gl_FragColor.a = 1.0 - texture2D(luminanceMap, vUv).r;\n #endif\n}\n"})||this;return t.depthTest=!1,t.depthWrite=!1,t.blending=n.NoBlending,t.map=t.uniforms.map.value,t.luminanceMap=t.uniforms.luminanceMap.value,Object.defineProperties(t,{map:{get:function(){return this.uniforms.map.value},set:function(e){this.uniforms.map.value=e}},luminanceMap:{get:function(){return this.uniforms.luminanceMap.value},set:function(e){this.uniforms.luminanceMap.value=e,this.defines.USE_LUMINANCE=null!==e,this.needsUpdate=!0}}}),t}return te(t,e),t}(n.ShaderMaterial),Co=function(e){function t(t,i){var r=e.call(this,wo,new Mo)||this;return t.box.getCenter(r.position),r.quaternion.multiplyQuaternions((new n.Quaternion).setFromAxisAngle(new n.Vector3(0,1,0),-Math.PI),go[t.face]),r.scale.setScalar(t.size),r.node=t,r.name="tiling:tile",r.material.visible=!1,r.activeTime=-1,r.disposed=!1,r.needsRender=!1,r.frustumCulled=!1,i.then((function(e){var t=e[0],i=e[1];r.disposed?(t.dispose(),null==i||i.dispose()):(r.material.map=t,r.material.luminanceMap=i,r.material.needsUpdate=!0,r.material.visible=!0,r.needsRender=!0)})).catch(le),r}return te(t,e),t.prototype.updateTime=function(e){},t.prototype.dispose=function(){var e;this.disposed=!0,this.material.map&&(this.material.map.dispose(),null===(e=this.material.luminanceMap)||void 0===e||e.dispose()),this.material.dispose()},t}(n.Mesh),Eo=function(e){function t(){var t=e.call(this)||this;return t.needsRender=!1,t.name="tiling",t}return te(t,e),t}(n.Group),Io=function(){function e(e,t,i){this.disposed=!1,this.textureLoader=new Et(e),this.minLevel=t,this.level=0,this.panoIndex=0,this.pedding=0,this.tileTree=Ge(this.minLevel),this.tileMeshes=new Map,this.resource=[],this.luminance=null,this.imageOptions=i,this.object=new Eo,this.object.renderOrder=-3}return e.prototype.setAllowHosts=function(e){this.textureLoader.setAllowHosts(e)},e.prototype.setRequestProxy=function(e){this.textureLoader.setRequestProxy(e)},e.prototype.setNetworkSubscribe=function(e){this.textureLoader.setNetworkSubscribe(e)},e.prototype.cleanup=function(){var e=this;this.tileMeshes.forEach((function(t){t.dispose(),e.object.remove(t),e.object.needsRender=!0})),this.tileMeshes.clear()},e.prototype.setRotation=function(e){this.disposed||this.object.quaternion.equals(e)||(this.object.quaternion.copy(e),this.object.needsRender=!0)},e.prototype.setPosition=function(e){this.disposed||this.object.position.equals(e)||(this.object.position.copy(e),this.object.needsRender=!0)},e.prototype.setResource=function(e,t){var i,n;if(!this.disposed&&(this.resource!==e||this.luminance!==t)){this.cleanup(),this.resource=e;var r=null!==(n=null===(i=e.slice().sort((function(e,t){return t.level-e.level}))[0])||void 0===i?void 0:i.level)&&void 0!==n?n:0;this.tileTree=Ge(r),this.luminance=t,this.object.needsRender=!0}},e.prototype.update=function(e,t,i){var r=this;if(!this.disposed){this.level=t;var o=e.planes[5].normal,a=[];t>=this.minLevel&&We(this.tileTree,(function(i){if(!(i.level<r.minLevel))return!(i.level>t)&&(!!e.intersectsBox(i.box)&&void a.push(i))}));var s=new n.Vector3;a.sort((function(e,t){return e.level!==t.level?e.level-t.level:e.box.getCenter(s).angleTo(o)-t.box.getCenter(s).angleTo(o)}));for(var l=new Set,c=function(e){var t=u.resource.filter((function(t){return t.level===e.level}))[0];if(!t)return"continue";if(l.add(e),u.tileMeshes.has(e))return u.tileMeshes.get(e).activeTime=i,"continue";var n=t.size,o=u.imageOptions.transform,a=Math.pow(2,e.level)*e.position.y,s=Math.pow(2,e.level)*e.position.x,c="".concat(u.panoIndex,".").concat(e.face,".").concat(e.level,".").concat(a,".").concat(s),h=ie(ie({key:"pano_tile.".concat(c)},ci(u.imageOptions,["format","size","quality","sharpen","mappings"])),{size:n*e.size==512?void 0:512,cut:[n*e.position.x,n*e.position.y,n*e.size,n*e.size]}),d=u.textureLoader.loadTexture(t[e.face],{imageURL:{transform:o,options:h}}).then((function(e){return e.body})),p=null;if(u.luminance){var f=u.luminance[e.face],A=f.match(/\/cube_(\d+)\//),v=!!A&&Number(A[1]);if(!1!==v){var m=ie(ie({},h),{size:v*e.size==256?void 0:256,cut:[v*e.position.x,v*e.position.y,v*e.size,v*e.size],key:"pano_tile_luminance.".concat(c)});p=u.textureLoader.loadTexture(f,{imageURL:{transform:u.imageOptions.transform,options:m}}).then((function(e){return e.body})).catch((function(){return null}))}}u.pedding++;var g=Promise.all([d,p]).then((function(e){return r.pedding--,e}),(function(e){return r.pedding--,Promise.reject(e)})),y=new Co(e,g);y.name="tiling:tile-".concat(c),y.activeTime=i,y.renderOrder=e.level,u.tileMeshes.set(e,y),u.object.needsRender=!0,u.object.add(y)},u=this,h=0,d=a;h<d.length;h++){c(m=d[h])}var p=[];this.tileMeshes.forEach((function(e,i){l.has(i)||p.push(i),e.visible=i.level<=t}));for(var f=p.sort((function(e,t){var i,n,o,a;return(null!==(n=null===(i=r.tileMeshes.get(t))||void 0===i?void 0:i.activeTime)&&void 0!==n?n:0)-(null!==(a=null===(o=r.tileMeshes.get(e))||void 0===o?void 0:o.activeTime)&&void 0!==a?a:0)})).slice(Math.max(0,32-l.size)),A=0,v=f;A<v.length;A++){var m=v[A],g=this.tileMeshes.get(m);g&&(g.dispose(),this.object.remove(g),this.object.needsRender=!0),this.tileMeshes.delete(m)}}},e.prototype.dispose=function(){this.cleanup(),this.resource=[],this.disposed=!0},e}(),So=new Float32Array([-1,1,1,-1,1,-1,-1,-1,1,-1,-1,-1,1,1,-1,1,1,1,1,-1,-1,1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,-1,1,-1,-1,1,1,-1,-1,-1,-1,-1,1,1,1,-1,1,1,1,-1,1,-1,-1,1,-1,1,-1,1,1,-1,-1,-1,-1,1,-1,-1]),Bo=new Uint8Array([0,2,1,2,3,1,4,6,5,6,7,5,8,10,9,10,11,9,12,14,13,14,15,13,16,18,17,18,19,17,20,22,21,22,23,21]),To=new n.BufferGeometry;To.setAttribute("position",new n.BufferAttribute(So,3)),To.setIndex(new n.BufferAttribute(Bo,1));var Po=function(){function e(){this.material=new n.ShaderMaterial({vertexShader:"\n#if defined(USE_PANO_VIDEO)\nvarying vec3 worldPosition;\n#endif\nvoid main() {\n vec4 transformed = vec4(position, 1.0);\n #if defined(USE_PANO_VIDEO)\n worldPosition = (modelMatrix * transformed).xyz;\n #endif\n gl_Position = projectionMatrix * modelViewMatrix * transformed;\n}\n",fragmentShader:"\nuniform vec2 size;\nuniform mat4 matrix;\nuniform float alpha;\nuniform sampler2D map;\n#if defined(USE_PANO_VIDEO)\nvarying vec3 worldPosition;\n#endif\n#include <common>\nvoid main() {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);\n #if defined(USE_PANO_VIDEO)\n vec3 cameraToVertex = worldPosition - cameraPosition;\n vec4 mapCoods = vec4(cameraToVertex, 1.0) * matrix;\n vec2 uv = vec2(\n 0.5 + mapCoods.x / mapCoods.z / size.x,\n 0.5 - mapCoods.y / mapCoods.z / size.y\n );\n vec4 videoColor = texture2D(map, uv);\n float match = (1.0 - step(0.0, mapCoods.z)) * (1.0 - step(0.5, abs(uv.x - 0.5))) * (1.0 - step(0.5, abs(uv.y - 0.5)));\n float blendAlpha = clamp(0.0, 1.0, 5.0 * (1.0 - clamp(distance(uv, vec2(0.5, 0.5)) / 0.55 , 0.0, 1.0)));\n gl_FragColor = vec4(videoColor.rgb, match * blendAlpha * alpha);\n #endif\n}\n",uniforms:{size:new n.Uniform(null),matrix:new n.Uniform(null),alpha:new n.Uniform(null),map:new n.Uniform(null)},depthTest:!1,depthWrite:!1,defines:{USE_PANO_VIDEO:!1},blending:n.CustomBlending,blendSrc:n.SrcAlphaFactor,blendDst:n.OneMinusSrcAlphaFactor,blendSrcAlpha:n.OneFactor,blendDstAlpha:n.OneMinusSrcAlphaFactor}),this.object=new n.Mesh(To,this.material),this.object.visible=!1,this.object.renderOrder=-1,this.object.frustumCulled=!1,this.object.name="pano-video",this.alphaMotion=new ur({alpha:0})}return e.prototype.setMaterial=function(e){e?(this.material.uniforms.size.value=e.size,this.material.uniforms.matrix.value=e.matrix,this.material.uniforms.map.value=e.map,this.alphaMotion.set({alpha:e.alpha},500).catch(le),this.material.uniforms.alpha.value=e.alpha):(this.material.uniforms.size.value=null,this.material.uniforms.matrix.value=null,this.material.uniforms.map.value=null,this.alphaMotion.set({alpha:0},0).catch(le));var t=null!==e;t!==this.material.defines.USE_PANO_VIDEO&&(this.material.defines.USE_PANO_VIDEO=t,this.material.needsUpdate=!0,this.object.visible=null!==e)},e.prototype.updateTime=function(e){this.alphaMotion.ended||(this.alphaMotion.update(e),this.material.uniforms.alpha.value=this.alphaMotion.value.alpha)},e.prototype.dispose=function(){this.material.dispose()},e}(),Ro=(new n.Matrix4).makeRotationAxis(new n.Vector3(0,1,0),Math.PI),ko=new n.Vector3(-1,1,1),Qo=function(){function e(e){void 0===e&&(e=0),this.width=e,this.pool=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.pool.length},enumerable:!1,configurable:!0}),e.prototype.create=function(){return new n.WebGLCubeRenderTarget(this.width,{stencilBuffer:!1,depthBuffer:!1})},e.prototype.pop=function(){var e=this.pool.pop();return e||this.create()},e.prototype.push=function(e){-1===this.pool.indexOf(e)&&this.pool.push(e)},e.prototype.clear=function(){for(var e=0,t=this.pool;e<t.length;e++){t[e].dispose()}this.pool.length=0},e}(),Do=function(e){function t(i){var n,r,o,a,s=this,l=t.parseArgs(i);(s=e.call(this,l)||this).TILED_CUBE_TEXTURE_LEVEL=2,s.tileLevel=0,s.initAnimationed=!1,s.forwardPanoIndex=null,s.currentPanoIndex=l.initial[0],s.maxAccessibleDistance=l.maxAccessibleDistance,s.panoTapTriggerRadius=l.panoTapTriggerRadius,s.panoCircleMeshCreator=l.panoCircleMeshCreator,s.tileLevelForFov=l.tileLevelForFov,s.luminanceAdaptiveEffectEnable=l.luminanceAdaptiveEffectEnable,s.colorCubeRenderTargetPool=new Qo,s.luminanceCubeRenderTargetPool=new Qo;var c=s.model.getMaterial()||{},u=c.pano0,h=c.pano1;u&&(null==h?void 0:h.map)!==u.map&&(s.model.setMaterial({pano0:h}),u.map.dispose(),u.map instanceof Ct&&u.map.cubeRenderTarget&&s.colorCubeRenderTargetPool.push(u.map.cubeRenderTarget),u.luminanceMap&&(u.luminanceMap.dispose(),u.luminanceMap instanceof Ct&&u.luminanceMap.cubeRenderTarget&&s.luminanceCubeRenderTargetPool.push(u.luminanceMap.cubeRenderTarget)));for(var d=s.colorCubeRenderTargetPool.size;d<2;d++){var p=Math.max(1024*s.TILED_CUBE_TEXTURE_LEVEL,512),f=s.colorCubeRenderTargetPool.create();f.setSize(p,p),et(null,f,s.renderer),s.colorCubeRenderTargetPool.push(f)}s.panoMeshes=[],s.panoMeshHitTested={},s.updatePanoMeshes(),s.locationMotion=new ur({count:0,distance:s.camera.pose.distance,modelAlpha:null!==(r=null===(n=s.model.getMaterial())||void 0===n?void 0:n.modelAlpha)&&void 0!==r?r:0,perspToOrtho:s.camera.perspToOrtho.x,orthoDistance:s.camera.orthoDistance}),s.panoResources={},s.panoResources[s.locationMotion.keyframes[0].key=s.locationMotion.keyframes[1].key=In()]={panoIndex:s.currentPanoIndex,workCode:s.work.workCode,panoPicture:null!==(a=null===(o=s.model.getMaterial())||void 0===o?void 0:o.pano1)&&void 0!==a?a:null,position:s.camera.pose.offset.clone(),effect:"fly"};var A={allowHosts:s.work.allowHosts,requestProxy:s.requestProxy,networkSubscribe:s.networkSubscribe};return s.textureLoader=new Et(A),s.tiling=new Io(A,s.TILED_CUBE_TEXTURE_LEVEL+1,s.imageOptions),s.scene.add(s.tiling.object),s.panoVideo=new Po,s.scene.add(s.panoVideo.object),s}return te(t,e),t.parseArgs=function(t){var i,n,r,o,a,s=e.parseArgs.call(this,t);return ie(ie({},s),{maxAccessibleDistance:null!==(i=t.maxAccessibleDistance)&&void 0!==i?i:5,panoTapTriggerRadius:null!==(n=t.panoTapTriggerRadius)&&void 0!==n?n:.5,panoCircleMeshCreator:null!==(r=t.panoCircleMeshCreator)&&void 0!==r?r:function(e){return new pr},tileLevelForFov:null!==(o=t.tileLevelForFov)&&void 0!==o?o:function(e,t){var i=2*Math.atan(Math.tan(e/180*Math.PI/2)*(t.width/t.height))/Math.PI*180,n=Math.max(t.width/i,t.height/e);return n>60?4:n>30?3:n>18?2:n>12?1:0},luminanceAdaptiveEffectEnable:null===(a=t.luminanceAdaptiveEffectEnable)||void 0===a||a})},t.initAnimationEndPose=function(t){var i=this.parseArgs(t);return e.initAnimationEndPose.call(this,i)},t.prototype.destroy=function(){var t,i,n=this;e.prototype.destroy.call(this),this.scene.remove(this.tiling.object),this.tiling.dispose(),this.locationMotion.dispose(),this.colorCubeRenderTargetPool.clear(),this.luminanceCubeRenderTargetPool.clear(),delete this.pendingTextureTask,this.panoMeshes&&(this.panoMeshes.forEach((function(e){n.helper.remove(e),e.dispose()})),this.panoMeshes.length=0),this.interiaMovement=!1;var r=this.videoTexture.image;r.pause(),r.oncanplay=function(){},r.ontimeupdate=function(){},this.scene.remove(this.panoVideo.object),this.panoVideo.setMaterial(null),this.panoVideo.dispose();for(var o=null!==(t=this.model.getMaterial())&&void 0!==t?t:{},a=o.pano0,s=o.pano1,l=0,c=Object.keys(this.panoResources);l<c.length;l++){var u=c[l],h=this.panoResources[u];if(h.panoPicture){var d=h.panoPicture.map;d&&d!==(null==a?void 0:a.map)&&d!==(null==s?void 0:s.map)&&(d.dispose(),null===(i=h.panoPicture.luminanceMap)||void 0===i||i.dispose(),h.panoPicture=null)}delete this.panoResources[u]}this.luminanceAdaptiveEffect&&(this.luminanceAdaptiveEffect.dispose(),delete this.luminanceAdaptiveEffect)},t.prototype.isReady=function(){return!0===this.locationMotion.ended&&e.prototype.isReady.call(this)},t.prototype.isTileReady=function(){var e,t,i,n=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),r=(null===(e=n.panoPicture)||void 0===e?void 0:e.map)instanceof Ct&&null!==(i=null===(t=n.panoPicture)||void 0===t?void 0:t.map.tilePending)&&void 0!==i?i:0,o=this.tiling.pedding;return this.initAnimationed&&r<=0&&o<=0},t.prototype.updateWork=function(e,t,i,n,r){var o=this;return this.userAction=r,this.work=e,this.currentPanoIndex=t,this.textureLoader.setAllowHosts(this.work.allowHosts),this.tiling.setAllowHosts(this.work.allowHosts),this.tiling.cleanup(),this.initAnimationed=!1,this.hideIntersectMesh(),this.updatePanoMeshes(),this.moveToPano(t,{effect:"fade",duration:n,longitude:i.longitude,latitude:i.latitude,fov:i.fov,moveEndCallback:function(){o.initAnimationed=!0},moveCancelCallback:function(){o.initAnimationed=!0}},r),!0},t.prototype.updateModel=function(e){this.model=e,this.updatePanoMeshes(!0)},t.prototype.updateTime=function(e,t){var i,r,o,a,s,l,c,u,h,d,p=this;if(!this.destroyed){var f=this.currentPanoIndex,A={},v={},m=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[0]),g=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),y=!1;if(!1===this.locationMotion.ended){this.locationMotion.update(e);var b=this.locationMotion.getKeyFrameSegment(e),x=b[0],w=b[1],M=this.panoResourceFromLocationMotionKeyframe(x),C=this.panoResourceFromLocationMotionKeyframe(w),E=(new n.Vector3).copy(M.position),I=(new n.Vector3).copy(C.position),S=this.locationMotion.value.count-w.value.count+1;A.progress=S,A.modelAlpha=this.locationMotion.value.modelAlpha,this.camera.perspToOrtho.setScalar(Kn(this.locationMotion.value.perspToOrtho,0,1)),this.camera.orthoDistance=this.locationMotion.value.orthoDistance,C.panoPicture&&(S<1?M.panoPicture&&(A.pano0=M.panoPicture):A.pano0=C.panoPicture,A.pano1=C.panoPicture),y=A.useBlackTransition="instant"===C.effect||"montage"===C.effect,"fade"!==C.effect&&"montage"!==C.effect||(A.pano0&&M.panoPicture&&(A.pano0={map:A.pano0.map,luminanceMap:A.pano0.luminanceMap,matrix:M.panoPicture.matrix.clone().setPosition(C.position)}),E.copy(I)),v.distance=this.locationMotion.value.distance,v.offset=new n.Vector3(E.x+(I.x-E.x)*S,E.y+(I.y-E.y)*S,E.z+(I.z-E.z)*S);for(var B=[],T=[],P=0,R=this.locationMotion.keyframes;P<R.length;P++){var k=R[P],Q=k.key,D=k.progress;void 0!==Q&&(B.push(Q),D>=this.locationMotion.progress&&T.push(Q))}for(var F=0,L=Object.keys(this.panoResources);F<L.length;F++){var O=L[F];if(!(T.indexOf(O)>=0)){var N=this.panoResources[O];if(N.panoPicture){var V=N.panoPicture.map,U=N.panoPicture.luminanceMap;if(V){if(V===(null===(i=A.pano0)||void 0===i?void 0:i.map))continue;if(V===(null===(r=A.pano1)||void 0===r?void 0:r.map))continue;V instanceof Ct&&V.cubeRenderTarget&&this.colorCubeRenderTargetPool.push(V.cubeRenderTarget),V.dispose(),U&&(U instanceof Ct&&U.cubeRenderTarget&&this.luminanceCubeRenderTargetPool.push(U.cubeRenderTarget),U.dispose()),N.panoPicture=null}}B.indexOf(O)>=0||delete this.panoResources[O]}}M.workCode===C.workCode?this.currentPanoIndex=S<.5?M.panoIndex:C.panoIndex:this.currentPanoIndex=C.panoIndex,this.emit("movingToPano",g.panoIndex,m.panoIndex,this.locationMotion.progress)}!1===this.cameraMotion.ended&&(this.cameraMotion.update(e),v.longitude=this.cameraMotion.value.longitude,v.latitude=this.cameraMotion.value.latitude,v.fov=this.cameraMotion.value.fov),!1===Ur(A)&&((null===(o=A.pano0)||void 0===o?void 0:o.map)&&A.pano0.map instanceof Ct&&!A.pano0.map.cubeRenderTarget&&(A.pano0.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),(null===(a=A.pano0)||void 0===a?void 0:a.luminanceMap)&&A.pano0.luminanceMap instanceof Ct&&!A.pano0.luminanceMap.cubeRenderTarget&&(A.pano0.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),(null===(s=A.pano1)||void 0===s?void 0:s.map)&&A.pano1.map instanceof Ct&&!A.pano1.map.cubeRenderTarget&&(A.pano1.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),(null===(l=A.pano1)||void 0===l?void 0:l.luminanceMap)&&A.pano1.luminanceMap instanceof Ct&&!A.pano1.luminanceMap.cubeRenderTarget&&(A.pano1.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),this.model.setMaterial(A));var z=!1;if(!1===Ur(v)&&(this.setCamera(v),z=!0),this.currentPanoIndex!==f&&(this.updatePanoMeshesVisible(),z=!0),z)if(te=this.work.observers[this.currentPanoIndex]){var q=Qt(this.camera.pose).normalize(),H=new n.Raycaster(te.position,q);this.forwardPanoIndex=this.getForwardPanoIndexOrNot(H)}if(this.camera.pose.distance>.1||y){var _=this.work.observers[this.currentPanoIndex];if(_)for(var K=0,j=Y=_.visibleNodes.concat(this.currentPanoIndex);K<j.length;K++){var G=j[K];(ee=this.panoMeshes[G])&&ee.setOpacity(0)}}else{var W=this.work.observers[this.currentPanoIndex];if(W){var X=Vr(W.visibleNodes,(function(e){return W.standingPosition.distanceTo(p.work.observers[e].standingPosition)}),!0)[1];X=Kn(X,2.5,1/0);for(var Y=W.visibleNodes.concat(this.currentPanoIndex),Z=this.camera.getDirection(new n.Vector3),J=0,$=Y;J<$.length;J++){G=$[J];var ee,te=this.work.observers[G];if(ee=this.panoMeshes[G])if(te.loadable||te.active){var ie=ee.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);ee.setCurrent(!ee.loading&&0===ee.progress&&this.forwardPanoIndex===G),ee.setOpacity(ie<.01?0:Kn(X/ie*1.2,.4,.85));var ne=this.camera.position.clone().setY(ee.position.y);q=(new n.Vector3).copy(ee.position).sub(ne).normalize();if(G===this.currentPanoIndex){var re=Kn((.5-ne.distanceTo(ee.position))/.5,0,1);q.multiplyScalar(1-re).add(Z.clone().multiplyScalar(re))}q.length()>0&&ee.quaternion.setFromEuler(new n.Euler(0,Math.atan2(q.x,q.z),0)),ee.updateTime&&ee.updateTime(e,t)}else ee.setOpacity(0)}}}var oe=this.tileLevel=function(){if(!1===p.tileLevelForFov)return 0;var e=p.renderer.getDrawingBufferSize(new n.Vector2);e.width*=p.scissor.width,e.height*=p.scissor.height;var t=g.panoIndex,i=p.work.observers[t],r=p.imageOptions.size;if(void 0===r&&i){var o=i.images.up.match(/\/cube_(\d+)\//);o&&(r=Number(o[1]))}void 0===r&&(r=2048);var a=0;r>=1024&&(a=1),r>=2048&&(a=2),r>=4096&&(a=3),r>=8192&&(a=4);var s=p.tileLevelForFov(p.camera.fov,e);return s>a?s:0}(),ae=function(){var e,t=p.camera.quaternion.clone();t.premultiply((null!==(e=p.work.observers[g.panoIndex])&&void 0!==e?e:p.work.observers[p.currentPanoIndex]).quaternion.clone().inverse());var i=(new n.Matrix4).makeRotationFromQuaternion(t),r=(new n.Matrix4).getInverse(i);return(new n.Frustum).setFromProjectionMatrix((new n.Matrix4).multiplyMatrices(p.camera.projectionMatrix,r))}();g.panoIndex===this.currentPanoIndex&&((null===(c=g.panoPicture)||void 0===c?void 0:c.map)instanceof Ct&&(g.panoPicture.map.update(ae,oe),!0===g.panoPicture.map.needsRender&&(g.panoPicture.map.needsRender=!1,this.needsRender=!0)),(null===(u=g.panoPicture)||void 0===u?void 0:u.luminanceMap)instanceof Ct&&(g.panoPicture.luminanceMap.update(ae,oe),!0===g.panoPicture.luminanceMap.needsRender&&(g.panoPicture.luminanceMap.needsRender=!1,this.needsRender=!0)));var se=this.tiling.object.visible;if(this.initAnimationed){var le=g.panoIndex,ce=this.work.observers[le];ce&&Er(this.camera.position,ce.position)&&this.locationMotion.ended?(this.tiling.object.visible=!0,this.tiling.panoIndex!==le&&this.tiling.cleanup(),this.tiling.panoIndex=le,this.tiling.setResource(null!==(d=null===(h=ce.images)||void 0===h?void 0:h.tiles)&&void 0!==d?d:[],this.enableIOSEDR&&ce.images.luminance?ce.images.luminance:null),this.tiling.setRotation(ce.quaternion),this.tiling.setPosition(ce.position),oe>this.TILED_CUBE_TEXTURE_LEVEL?this.tiling.update(ae,oe,e):this.tiling.update(ae,0,e)):this.tiling.object.visible=!1}else this.tiling.object.visible=!1;se!==this.tiling.object.visible&&(this.tiling.object.needsRender=!0),this.panoVideo.object.position.copy(this.camera.position),this.panoVideo.updateTime(e)}},t.prototype.render=function(){var t=this.work.observers[this.currentPanoIndex];t&&t.video&&(this.needsRender=!0),e.prototype.render.call(this)},t.prototype.postProcessing=function(e,t){if(!this.destroyed)return this.luminanceAdaptiveEffect||(this.luminanceAdaptiveEffect=new vo(this.renderer),this.luminanceAdaptiveEffect.enable=this.luminanceAdaptiveEffectEnable),this.luminanceAdaptiveEffect.render(e,t)},t.prototype.getTargetPose=function(){var e=this.cameraMotion.getKeyFrameSegment(ue())[1],t=this.locationMotion.getKeyFrameSegment(ue())[1],i=this.panoResourceFromLocationMotionKeyframe(t),n=this.work.observers[i.panoIndex];return{longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,offset:n?n.position.clone():this.camera.position.clone(),distance:this.locationMotion.value.distance}},t.prototype.moveToPano=function(e,t,i){var r,o,a,s,l=this,c=this.work.observers[e],u=this.imageOptions.size;if(void 0===u&&c){var h=c.images.up.match(/\/cube_(\d+)\//);h&&(u=Number(h[1]))}void 0===u&&(u=2048);var d=this.imageOptions.transform,p=ie({key:"pano.".concat(e)},ci(this.imageOptions,["format","size","quality","sharpen","mappings"])),f=c.images,A=null!==(o=null===(r=c.images.tiles)||void 0===r?void 0:r.filter((function(e){return e.size>u})))&&void 0!==o?o:null,v=d,m={key:"pano_luminance.".concat(e),size:p.size?p.size/2:1024},g=this.enableIOSEDR&&c.images.luminance?c.images.luminance:null,y=function(){if(!c.images.tiles)return null;if(!g)return null;var e=g.up.match(/\/cube_(\d+)\//),t=!!e&&Number(e[1]);return!1===t?null:null==A?void 0:A.map((function(e){return{level:e.level,size:t,back:g.back,front:g.front,left:g.left,right:g.right,up:g.up,down:g.down}}))}(),b="pano:"+so([f,p,d]);if(this.pendingTextureTask){if(this.pendingTextureTask.hash===b)return;var x=this.pendingTextureTask.panoIndex;null===(a=this.panoMeshes[x])||void 0===a||a.setProgress(0),this.emit("textureAbort",x,c),this.pendingTextureTask.onError(new Error("texture aborted"))}this.pending=!0;var w,M=this.model.getMaterial()||{},C=M.pano0,E=M.pano1;if(C&&C.map.name===b&&null!==C.luminanceMap===this.enableIOSEDR?w=C:(null==E?void 0:E.map.name)===b&&null!==E.luminanceMap===this.enableIOSEDR&&(w=E),w){var I={panoIndex:e,workCode:this.work.workCode,effect:null!==(s=t.effect)&&void 0!==s?s:"fly",panoPicture:{map:w.map,luminanceMap:w.luminanceMap,matrix:(new n.Matrix4).compose(c.position,c.quaternion,ko)},position:c.position.clone()};ke.shared.add((function(){l.pending=!1,l.emit("panoLoaded",e),l.doMoveToPano(e,I,t,i)}),!0,1)}else{this.pendingTextureTask={panoIndex:e,hash:b,onLoad:function(r,o){var a,s;if(l.pending=!1,l.destroyed)r.body.dispose();else{r.body.name=b,l.emit("panoLoaded",e);var u={panoIndex:e,workCode:l.work.workCode,effect:null!==(a=t.effect)&&void 0!==a?a:"fly",panoPicture:{map:r.body,luminanceMap:null!==(s=null==o?void 0:o.body)&&void 0!==s?s:null,matrix:(new n.Matrix4).compose(c.position,c.quaternion,ko)},position:c.position.clone()};l.doMoveToPano(e,u,t,i)}},onError:function(i){l.pending=!1,t.moveCancelCallback&&t.moveCancelCallback(),l.emit("panoLoadError",i,e),l.emit("moveToPanoCanceled",e)}};var S=this.panoMeshes[e];S&&S.tap&&S.tap(),Promise.all([this.tileLevelForFov&&A&&A.length?this.textureLoader.loadTiledCubeTexture(f,A,{tileMaxLevel:this.TILED_CUBE_TEXTURE_LEVEL,imageURL:{transform:d,options:p},format:n.RGBAFormat,viaAjax:!0},void 0,void 0,(function(t){var i,n;l.emit("textureLoading",t,e,c),(null===(i=l.pendingTextureTask)||void 0===i?void 0:i.hash)===b&&(null===(n=l.panoMeshes[e])||void 0===n||n.setProgress(t))}),this.renderer):this.textureLoader.loadCubeTexture(f,{imageURL:{transform:d,options:p},format:n.RGBAFormat,viaAjax:!0},void 0,void 0,(function(t){var i,n;l.emit("textureLoading",t,e,c),(null===(i=l.pendingTextureTask)||void 0===i?void 0:i.hash)===b&&(null===(n=l.panoMeshes[e])||void 0===n||n.setProgress(t))}),this.renderer),g?this.tileLevelForFov&&y&&y.length?this.textureLoader.loadTiledCubeTexture(g,y,{tileImageSize:256,tileMaxLevel:this.TILED_CUBE_TEXTURE_LEVEL,imageURL:{transform:v,options:m}},void 0,void 0,void 0,this.renderer).catch((function(){return null})):this.textureLoader.loadCubeTexture(g,{imageURL:{transform:v,options:m}},void 0,void 0,void 0,this.renderer).catch((function(){return null})):Promise.resolve(null)]).then((function(t){var i,n,r=t[0],o=t[1];(null===(i=l.pendingTextureTask)||void 0===i?void 0:i.hash)===b?(l.pendingTextureTask.onLoad(r,o),null===(n=l.panoMeshes[e])||void 0===n||n.setProgress(0),delete l.pendingTextureTask,l.emit("textureLoaded",e,c,r.meta)):(r.body.dispose(),null==o||o.body.dispose())})).catch((function(t){var i,n;(null===(i=l.pendingTextureTask)||void 0===i?void 0:i.hash)===b&&(l.pendingTextureTask.onError(t),null===(n=l.panoMeshes[e])||void 0===n||n.setProgress(0),delete l.pendingTextureTask,l.emit("textureError",t,e,c),l.emit("error",t))})),this.emit("textureStartLoad",e,c)}},t.prototype.initAnimation=function(e,t,i,n){var r,o,a,s=this;if(!this.destroyed){var l=!1;this.pending=!1,this.userAction=n,this.moveToPano(e,{longitude:null!==(r=t.longitude)&&void 0!==r?r:this.defaultLongitude,latitude:Kn(null!==(o=t.latitude)&&void 0!==o?o:this.defaultLatitude,this.minLatitude,this.maxLatitude),fov:Kn(null!==(a=t.fov)&&void 0!==a?a:this.defaultFov,this.minFov,this.maxFov),duration:i,moveStartCallback:function(e,t){l=!0,s.emit("initAnimationWillStart",e,t,s.userAction)},moveEndCallback:function(e,t){s.emit("initAnimationEnded",e,t,s.userAction),s.initAnimationed=!0},moveCancelCallback:function(){var e={longitude:s.camera.pose.longitude,latitude:s.camera.pose.latitude,fov:s.camera.pose.fov,offset:s.camera.pose.offset.clone(),distance:s.camera.pose.distance};!1===l&&s.emit("initAnimationWillStart",s.currentPanoIndex,e,s.userAction),s.emit("initAnimationEnded",s.currentPanoIndex,e,s.userAction),s.initAnimationed=!0}},n)}},t.prototype.panoResourceFromLocationMotionKeyframe=function(e){return this.panoResources[e.key]},t.prototype.locationMotionKeyframesLength=function(e){for(var t=0,i=1;i<e.length;i++){var n=this.panoResourceFromLocationMotionKeyframe(e[i-1]).position,r=this.panoResourceFromLocationMotionKeyframe(e[i]).position;t+=n.distanceTo(r)*(e[i].value.count-e[i-1].value.count)}return t},t.prototype.updatePanoMeshesVisible=function(e){var t=this;void 0===e&&(e=!1);for(var i=this.work.observers[this.currentPanoIndex],r=(i?i.visibleNodes:[]).concat(this.currentPanoIndex),o=[],a=0,s=this.work.observers;a<s.length;a++){var l=s[a],c=this.panoMeshes[l.panoIndex];c&&(r.indexOf(l.panoIndex)>=0?c.parent!==this.helper&&(this.helper.add(c),!0!==this.panoMeshHitTested["".concat(this.work.workCode,"_").concat(l.panoIndex)]&&o.push(l)):c.parent===this.helper&&(this.helper.remove(c),c.setOpacity(0)))}e&&(o=r.map((function(e){return t.work.observers[e]})));for(var u=0,h=o;u<h.length;u++){var d=h[u];if(this.model.loaded&&this.model.bvhs.loaded&&this.model.workCode===this.work.workCode&&r.length<=10){this.panoMeshHitTested["".concat(this.work.workCode,"_").concat(d.panoIndex)]=!0;var p=new n.Vector3(0,-1,0),f=new n.Vector3(0,.1,0).add(d.standingPosition),A=new n.Raycaster(f,p,0,.2),v=this.model.intersectRaycaster(A)[0];if(!v)continue;if(d.standingPosition.y>=v.point.y&&d.standingPosition.y-v.point.y<.1)continue;this.panoMeshes[d.panoIndex]&&this.panoMeshes[d.panoIndex].position.copy(v.point)}}},t.prototype.updatePanoMeshes=function(e){var t=this;void 0===e&&(e=!1);for(var i={},n=0,r=this.panoMeshes;n<r.length;n++){i[(f=r[n]).name]=f}this.panoMeshes.length=0,this.panoMeshHitTested={};for(var o=1,a={},s=function(e){if(e.accessibleNodes.length){var i=Vr(e.accessibleNodes,(function(i){return Kn(t.work.observers[i].standingPosition.distanceTo(e.standingPosition),1,1/0)}),!0),n=i[1];void 0===a[e.panoIndex]&&(a[e.panoIndex]=n)}},l=0,c=this.work.observers;l<c.length;l++){s(p=c[l])}var u=Object.keys(a).map((function(e){return a[e]}));u.length&&(o=Kn(.6*(u.reduce((function(e,t){return e+t}),0)/u.length),1,3));for(var h=0;h<this.work.observers.length;h++){var d="panoCircle_".concat(this.work.workCode,"_").concat(h),p=this.work.observers[h],f=void 0;i[d]?(!0===(f=i[d]).loading&&!1===p.loadable&&f.setLoading(!1),delete i[d]):(f=this.panoCircleMeshCreator(h)).name=d,f.scale.set(o,1,o),f.position.copy(p.standingPosition),this.panoMeshes[h]=f}for(var A=0,v=Object.keys(i);A<v.length;A++){var m=v[A];this.helper.remove(i[m]),i[m].dispose(),delete i[m]}this.updatePanoMeshesVisible(e)},t.prototype.doMoveToPano=function(e,t,i,r){var o,a,s,l,c=this;void 0===i&&(i={}),this.userAction=r;var u=ue(),h=In();this.tiling.cleanup(),this.panoResources[h]=t;var d,p,f;if(this.locationMotion.ended){var A=this.locationMotion.getKeyFrameSegment(u);A[0];var v=A[1],m=this.locationMotion.value,g=(null!==(o=this.panoResourceFromLocationMotionKeyframe(v))&&void 0!==o?o:this.camera).position,y=t.position;d=Math.max(g.distanceTo(y),1),p=[{key:v.key,progress:0,value:ie(ie({},m),{count:0})},{key:h,progress:1,value:{distance:0,perspToOrtho:0,orthoDistance:1,modelAlpha:0,count:1}}],f=0}else{var b=this.locationMotion.getKeyFrameSegment(u),x=b[0],w=(v=b[1],m=this.locationMotion.value,this.panoResourceFromLocationMotionKeyframe(x).position),M=(g=this.panoResourceFromLocationMotionKeyframe(v).position,y=t.position,v.value.count-m.count),C=Math.max(w.distanceTo(g),1)*M;d=C+Math.max(g.distanceTo(y),1),p=[{key:x.key,progress:0,value:ie({},m)},{key:v.key,progress:C/d,value:v.value},{key:h,progress:1,value:{count:v.value.count+1,distance:0,perspToOrtho:0,orthoDistance:1,modelAlpha:0}}];var E=this.locationMotionKeyframesLength(this.locationMotion.keyframes),I=this.locationMotionKeyframesLength(p);f=0===E||0===E?0:this.locationMotion.getProgressVelocity(u)*E/I}var S=this.calculateMovingDuration(i.duration,"fade"===i.effect||"montage"===i.effect?0:d),B={longitude:i.longitude,latitude:i.latitude,fov:i.fov},T={longitude:null!==(a=B.longitude)&&void 0!==a?a:this.camera.pose.longitude,latitude:null!==(s=B.latitude)&&void 0!==s?s:this.camera.pose.latitude,fov:null!==(l=B.fov)&&void 0!==l?l:this.camera.pose.fov,offset:t.position.clone(),distance:this.camera.pose.distance};this.emit("moveToPano",e,r),i.moveStartCallback&&i.moveStartCallback(e,T),this.emit("panoWillArrive",e,T,this.userAction),this.videoTexture&&this.videoTexture.image instanceof HTMLVideoElement&&this.videoTexture.image.getAttribute("src")&&(this.videoTexture.image.pause(),this.videoTexture.image.removeAttribute("uuid"),this.videoTexture.image.removeAttribute("src"),this.videoTexture.image.oncanplay=le,this.videoTexture.needsUpdate=!0),this.panoVideo.setMaterial(null),this.cameraMotion.set(B,S).catch(le),this.locationMotion.setKeyframes(p,S,f).then((function(){var t,o,a,s={longitude:c.camera.pose.longitude,latitude:c.camera.pose.latitude,fov:c.camera.pose.fov,offset:c.camera.pose.offset.clone(),distance:c.camera.pose.distance};i.moveEndCallback&&i.moveEndCallback(e,s),c.emit("panoArrived",e,s,r);var l=c.work.observers[c.currentPanoIndex];if(l&&l.video&&c.videoTexture&&c.videoTexture.image instanceof HTMLVideoElement){var u=Ro.clone().multiply(null!==(a=null===(o=null===(t=c.model.getMaterial())||void 0===t?void 0:t.pano1)||void 0===o?void 0:o.matrix)&&void 0!==a?a:new n.Matrix4).multiply(l.video.matrix),h={map:c.videoTexture,size:l.video.size,matrix:u,alpha:1},d=In(),p=c.videoTexture.image;p.setAttribute("uuid",d),uo().then((function(e){e&&l.video&&p.getAttribute("uuid")===d&&(p.oncanplay=function(){p.oncanplay=le,p.play()},p.ontimeupdate=function(){p.currentTime>.5&&(p.ontimeupdate=le,c.panoVideo.setMaterial(h))},p.src=l.video.source)})).catch((function(){p.removeAttribute("uuid")}))}}),(function(){i.moveCancelCallback&&i.moveCancelCallback(),c.emit("moveToPanoCanceled",e)}))},t.prototype.getForwardPanoIndexOrNot=function(e){var t=this,i=this.work.observers[this.currentPanoIndex];if(!i)return null;var r=null!=e?e:new n.Raycaster(this.camera.position.clone(),this.camera.getDirection(new n.Vector3)),o=i.standingPosition.clone();if(i.position.distanceTo(r.ray.origin)>1){var a=this.model.intersectRaycaster(new n.Raycaster(r.ray.origin,new n.Vector3(0,-1,0)))[0];a&&a.distance<=2?o.copy(a.point):o.copy(r.ray.origin).add(new n.Vector3(0,-1.5,0))}var s=this.model.intersectRaycaster(r)[0],l=(s?s.point:r.ray.origin.clone().add(r.ray.direction.clone().normalize().multiplyScalar(3))).clone().sub(o).normalize();if(0===l.length())return null;for(var c=i.accessibleNodes.filter((function(e){if(e===t.currentPanoIndex)return!1;var i=t.work.observers[e],n=i.standingPosition.clone().project(t.camera);return!(Math.abs(n.z)>1)&&(!(Math.abs(n.x)>1)&&(!(Math.abs(n.y)>1)&&(i.loadable||i.active)))})),u=c.slice().sort((function(e,i){return t.work.observers[e].standingPosition.clone().distanceTo(o)-t.work.observers[i].standingPosition.clone().distanceTo(o)})),h=0,d=[Math.PI/8,Math.PI/6,Math.PI/4,Math.PI/3];h<d.length;h++)for(var p=d[h],f=0,A=u;f<A.length;f++){var v=A[f],m=this.work.observers[v].standingPosition.clone().sub(o);if(0!==m.length()&&l.angleTo(m)<p)return v}return null},t.prototype.onTapGesture=function(e){var t=this,i=e.pointers.map((function(e){return ci(e,["x","y"])}));if(!this.emit("wantsGesture","tap",i,!0)){var r=this.relativeClientPosition(e.center),o=new n.Raycaster;if(o.setFromCamera(r,this.camera),!this.emit("wantsTapGesture",o,r,!0)){this.emit("gesture","tap",i,!0),this.emit("tapGesture",o,r,!0),this.interiaMovement=!1;var a=this.camera.getDirection(new n.Vector3).setY(0),s=null,l=this.work.observers[this.currentPanoIndex];if(l){var c=l.accessibleNodes.filter((function(e){if(e===t.currentPanoIndex)return!1;var i=t.work.observers[e];return!(i.position.distanceTo(t.camera.position)>t.maxAccessibleDistance)&&(i.loadable||i.active)})),u=this.model.intersectRaycaster(o)[0];if(u){var h=Vr(c,(function(e){return t.work.observers[e].standingPosition.clone().distanceTo(u.point)}),!0),d=h[0];h[1]<this.panoTapTriggerRadius&&(s=d)}Un(s)&&(s=this.getForwardPanoIndexOrNot(o));for(var p=0,f=this.locationMotion.keyframes;p<f.length;p++){var A=f[p],v=this.panoResourceFromLocationMotionKeyframe(A);if(!(A.progress<this.locationMotion.progress)&&v.panoIndex===s){s=null;break}}if(this.emit("panoSelected",s),Un(s))!0===this.locationMotion.ended&&this.cameraBounce();else{var m=this.work.observers[s];if(m.active){for(var g={},y=Math.PI/6,b=Math.PI/12,x=m.position.clone().setY(0).sub(l.position.clone().setY(0)).normalize(),w=[],M=0,C=m.accessibleNodes;M<C.length;M++){if((d=C[M])!==this.currentPanoIndex&&d!==s){var E=this.work.observers[d].position.clone().sub(m.position).setY(0);x.angleTo(E)<y&&w.push(E)}}var I=(w.length>0?w:ne(ne([],[],!0),[],!0)).slice().sort((function(e,t){return e.angleTo(x)-t.angleTo(x)}))[0];I&&I.angleTo(a)>b&&(g.longitude=Math.atan2(-I.x,-I.z)),this.cameraMotion.value.latitude<-Math.PI/4&&(g.latitude=Kn(0,this.minLatitude,this.maxLatitude)),this.cameraMotion.value.fov<60&&(g.fov=this.defaultFov),this.emit("wantsMoveToPano",s,g,!0)}else this.panoMeshes[s]&&(this.panoMeshes[s].setDisabled(!1),this.panoMeshes[s].setLoading(!0))}}}}},t}(co),Fo=Math.PI/180,Lo=180/Math.PI,Oo=function(){var e="undefined"!=typeof navigator&&/iPad|iPhone|iPod/.test(navigator.platform);return function(){return e}}(),No=function(){var e="undefined"!=typeof navigator&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent);return function(){return e}}(),Vo=function(){var e="undefined"!=typeof navigator&&-1!==navigator.userAgent.indexOf("Firefox")&&-1!==navigator.userAgent.indexOf("Android");return function(){return e}}(),Uo=function(){var e="undefined"!=typeof navigator?navigator.userAgent.match(/.*Chrome\/([0-9]+)/):null,t=e?parseInt(e[1],10):null;return function(){return t}}(),zo=function(){var e=!1;if(65===Uo()){var t="undefined"!=typeof navigator?navigator.userAgent.match(/.*Chrome\/([0-9\.]*)/):null;if(t){var i=t[1].split(".");i[0],i[1];var n=i[2],r=i[3];e=3325===parseInt(n,10)&&parseInt(r,10)<148}}return function(){return e}}(),qo=function(){var e=Oo()&&No()&&"undefined"!=typeof navigator&&-1!==navigator.userAgent.indexOf("13_4");return function(){return e}}(),Ho=function(){var e="undefined"!=typeof navigator&&-1!==navigator.userAgent.indexOf("R7 Build");return function(){return e}}();function _o(){var e="undefined"!=typeof window&&(90==window.orientation||-90==window.orientation);return Ho()?!e:e}var Ko,jo=(Ko={},function(e,t){void 0===Ko[e]&&(console.warn("cardboard: "+t),Ko[e]=!0)});function Go(e){var t,i=e.indexOf("://");t=-1!==i?i+3:0;var n=e.indexOf("/",t);return-1===n&&(n=e.length),e.substring(0,n)}var Wo,Xo=function(e,t,i){var n,r,o,a,s,l,c,u,h,d,p,f,A,v,m,g,y,b,x;n=e,a=(r=t)?r[0]:0,s=r?r[1]:0,l=r?r[2]:0,c=r?r[3]:1,p=a*(u=a+a),f=a*(h=s+s),A=a*(d=l+l),v=s*h,m=s*d,g=l*d,y=c*u,b=c*h,x=c*d,n[0]=1-(v+g),n[1]=f+x,n[2]=A-b,n[3]=0,n[4]=f-x,n[5]=1-(p+g),n[6]=m+y,n[7]=0,n[8]=A+b,n[9]=m-y,n[10]=1-(p+v),n[11]=0,n[12]=o?o[0]:0,n[13]=o?o[1]:0,n[14]=o?o[2]:0,n[15]=1,i&&function(e,t,i){var n,r,o,a,s,l,c,u,h,d,p,f,A=i[0],v=i[1],m=i[2];t===e?(e[12]=t[0]*A+t[4]*v+t[8]*m+t[12],e[13]=t[1]*A+t[5]*v+t[9]*m+t[13],e[14]=t[2]*A+t[6]*v+t[10]*m+t[14],e[15]=t[3]*A+t[7]*v+t[11]*m+t[15]):(n=t[0],r=t[1],o=t[2],a=t[3],s=t[4],l=t[5],c=t[6],u=t[7],h=t[8],d=t[9],p=t[10],f=t[11],e[0]=n,e[1]=r,e[2]=o,e[3]=a,e[4]=s,e[5]=l,e[6]=c,e[7]=u,e[8]=h,e[9]=d,e[10]=p,e[11]=f,e[12]=n*A+s*v+h*m+t[12],e[13]=r*A+l*v+d*m+t[13],e[14]=o*A+c*v+p*m+t[14],e[15]=a*A+u*v+f*m+t[15])}(e,e,i),function(e,t){var i=t[0],n=t[1],r=t[2],o=t[3],a=t[4],s=t[5],l=t[6],c=t[7],u=t[8],h=t[9],d=t[10],p=t[11],f=t[12],A=t[13],v=t[14],m=t[15],g=i*s-n*a,y=i*l-r*a,b=i*c-o*a,x=n*l-r*s,w=n*c-o*s,M=r*c-o*l,C=u*A-h*f,E=u*v-d*f,I=u*m-p*f,S=h*v-d*A,B=h*m-p*A,T=d*m-p*v,P=g*T-y*B+b*S+x*I-w*E+M*C;P&&(P=1/P,e[0]=(s*T-l*B+c*S)*P,e[1]=(r*B-n*T-o*S)*P,e[2]=(A*M-v*w+m*x)*P,e[3]=(d*w-h*M-p*x)*P,e[4]=(l*I-a*T-c*E)*P,e[5]=(i*T-r*I+o*E)*P,e[6]=(v*b-f*M-m*y)*P,e[7]=(u*M-d*b+p*y)*P,e[8]=(a*B-s*I+c*C)*P,e[9]=(n*I-i*B-o*C)*P,e[10]=(f*w-A*b+m*g)*P,e[11]=(h*b-u*w-p*g)*P,e[12]=(s*E-a*S-l*C)*P,e[13]=(i*S-n*E+r*C)*P,e[14]=(A*y-f*x-v*g)*P,e[15]=(u*x-h*y+d*g)*P)}(e,e)},Yo=function(){function e(e,t){void 0===e&&(e=new n.Vector3),void 0===t&&(t=0),this.sample=e,this.timestampS=t}return e.prototype.set=function(e,t){this.sample=e,this.timestampS=t},e.prototype.copy=function(e){this.set(e.sample,e.timestampS)},e}(),Zo=function(){function e(e,t){this.kFilter=e,this.isDebug=t,this.currentAccelMeasurement=new Yo,this.currentGyroMeasurement=new Yo,this.previousGyroMeasurement=new Yo,Oo()?this.filterQ=new n.Quaternion(-1,0,0,1):this.filterQ=new n.Quaternion(1,0,0,1),this.previousFilterQ=new n.Quaternion,this.previousFilterQ.copy(this.filterQ),this.accelQ=new n.Quaternion,this.isOrientationInitialized=!1,this.estimatedGravity=new n.Vector3,this.measuredGravity=new n.Vector3,this.gyroIntegralQ=new n.Quaternion}return e.prototype.addAccelMeasurement=function(e,t){this.currentAccelMeasurement.set(e,t)},e.prototype.addGyroMeasurement=function(e,t){this.currentGyroMeasurement.set(e,t);var i,n=t-this.previousGyroMeasurement.timestampS;i=n,isNaN(i)||i<=.001||i>1||this.run_(),this.previousGyroMeasurement.copy(this.currentGyroMeasurement)},e.prototype.getOrientation=function(){return this.filterQ},e.prototype.run_=function(){if(!this.isOrientationInitialized)return this.accelQ=this.accelToQuaternion_(this.currentAccelMeasurement.sample),this.previousFilterQ.copy(this.accelQ),void(this.isOrientationInitialized=!0);var e=this.currentGyroMeasurement.timestampS-this.previousGyroMeasurement.timestampS,t=this.gyroToQuaternionDelta_(this.currentGyroMeasurement.sample,e);this.gyroIntegralQ.multiply(t),this.filterQ.copy(this.previousFilterQ),this.filterQ.multiply(t);var i=new n.Quaternion;i.copy(this.filterQ),i.inverse(),this.estimatedGravity.set(0,0,-1),this.estimatedGravity.applyQuaternion(i),this.estimatedGravity.normalize(),this.measuredGravity.copy(this.currentAccelMeasurement.sample),this.measuredGravity.normalize();var r,o=new n.Quaternion;o.setFromUnitVectors(this.estimatedGravity,this.measuredGravity),o.inverse(),this.isDebug&&console.log("Delta: %d deg, G_est: (%s, %s, %s), G_meas: (%s, %s, %s)",Lo*((r=o).w>1?0:2*Math.acos(r.w)),this.estimatedGravity.x.toFixed(1),this.estimatedGravity.y.toFixed(1),this.estimatedGravity.z.toFixed(1),this.measuredGravity.x.toFixed(1),this.measuredGravity.y.toFixed(1),this.measuredGravity.z.toFixed(1));var a=new n.Quaternion;a.copy(this.filterQ),a.multiply(o),this.filterQ.slerp(a,1-this.kFilter),this.previousFilterQ.copy(this.filterQ)},e.prototype.accelToQuaternion_=function(e){var t=new n.Vector3;t.copy(e),t.normalize();var i=new n.Quaternion;return i.setFromUnitVectors(new n.Vector3(0,0,-1),t),i.inverse(),i},e.prototype.gyroToQuaternionDelta_=function(e,t){var i=new n.Quaternion,r=new n.Vector3;return r.copy(e),r.normalize(),i.setFromAxisAngle(r,e.length()*t),i},e}(),Jo=function(){function e(e,t){this.predictionTimeS=e,this.isDebug=t,this.previousQ=new n.Quaternion,this.previousTimestampS=null,this.deltaQ=new n.Quaternion,this.outQ=new n.Quaternion}return e.prototype.getPrediction=function(e,t,i){if(!this.previousTimestampS)return this.previousQ.copy(e),this.previousTimestampS=i,e;var r=new n.Vector3;r.copy(t),r.normalize();var o=t.length();if(o<20*Fo)return this.isDebug&&console.log("Moving slowly, at %s deg/s: no prediction",(Lo*o).toFixed(1)),this.outQ.copy(e),this.previousQ.copy(e),this.outQ;var a=o*this.predictionTimeS;return this.deltaQ.setFromAxisAngle(r,a),this.outQ.copy(this.previousQ),this.outQ.multiply(this.deltaQ),this.previousQ.copy(e),this.previousTimestampS=i,this.outQ},e}(),$o=function(){function e(e){this.coefficients=e}return e.prototype.distortInverse=function(e){for(var t=0,i=1,n=e-this.distort(t);Math.abs(i-t)>1e-4;){var r=e-this.distort(i),o=i-r*((i-t)/(r-n));t=i,i=o,n=r}return i},e.prototype.distort=function(e){for(var t=e*e,i=0,n=0;n<this.coefficients.length;n++)i=t*(i+this.coefficients[n]);return(i+1)*e},e}(),ea=function(){this.angularAcceleration=null,this.angularVelocity=null,this.linearAcceleration=null,this.linearVelocity=null,this.orientation=null,this.position=null},ta=function(){this.leftDegrees=0,this.rightDegrees=0,this.upDegrees=0,this.downDegrees=0},ia=function(){function e(e,t,i,r){this.viewer={id:"CardboardV1",label:"Cardboard I/O 2014",fov:40,interLensDistance:.06,baselineLensDistance:.035,screenLensDistance:.042,distortionCoefficients:[.441,.156],inverseCoefficients:[-.4410035,.42756155,-.4804439,.5460139,-.58821183,.5733938,-.48303202,.33299083,-.17573841,.0651772,-.01488963,.001559834]},this.device={widthMeters:.11,heightMeters:.062,bevelMeters:.004},this.depthNear=.01,this.depthFar=1e4,this.yawOnly=i,this.accelerometer=new n.Vector3,this.gyroscope=new n.Vector3,this.filter=new Zo(e,r),this.posePredictor=new Jo(t,r),this.isFirefoxAndroid=Vo(),this.isIOS=Oo();var o=Uo();this.isDeviceMotionInRadians=!this.isIOS&&null!==o&&o<66,this.isWithoutDeviceMotion=zo()||qo(),this.filterToWorldQ=new n.Quaternion,Oo()?this.filterToWorldQ.setFromAxisAngle(new n.Vector3(1,0,0),Math.PI/2):this.filterToWorldQ.setFromAxisAngle(new n.Vector3(1,0,0),-Math.PI/2),this.inverseWorldToScreenQ=new n.Quaternion,this.worldToScreenQ=new n.Quaternion,this.originalPoseAdjustQ=new n.Quaternion;var a="undefined"!=typeof window?-window.orientation*Math.PI/180:0;this.originalPoseAdjustQ.setFromAxisAngle(new n.Vector3(0,0,1),a),this.setScreenTransform_(),_o()&&this.filterToWorldQ.multiply(this.inverseWorldToScreenQ),this.resetQ=new n.Quaternion,this.orientationOut_=new Float32Array(4),this.previousTimestampS=Date.now()}return e.prototype.getPosition=function(){return null},e.prototype.getOrientation=function(){var e;if(this.isWithoutDeviceMotion&&this._deviceOrientationQ){this.deviceOrientationFixQ=this.deviceOrientationFixQ||(r=(new n.Quaternion).setFromAxisAngle(new n.Vector3(0,0,-1),0),o=new n.Quaternion,"undefined"!=typeof window&&-90===window.orientation?o.setFromAxisAngle(new n.Vector3(0,1,0),Math.PI/-2):o.setFromAxisAngle(new n.Vector3(0,1,0),Math.PI/2),r.multiply(o)),this.deviceOrientationFilterToWorldQ=this.deviceOrientationFilterToWorldQ||((i=new n.Quaternion).setFromAxisAngle(new n.Vector3(1,0,0),-Math.PI/2),i),e=this._deviceOrientationQ;var t=new n.Quaternion;return t.copy(e),t.multiply(this.deviceOrientationFilterToWorldQ),t.multiply(this.resetQ),t.multiply(this.worldToScreenQ),t.multiplyQuaternions(this.deviceOrientationFixQ,t),this.yawOnly&&(t.x=0,t.z=0,t.normalize()),this.orientationOut_[0]=t.x,this.orientationOut_[1]=t.y,this.orientationOut_[2]=t.z,this.orientationOut_[3]=t.w,this.orientationOut_}var i,r,o,a=this.filter.getOrientation();e=this.posePredictor.getPrediction(a,this.gyroscope,this.previousTimestampS);var s=new n.Quaternion;return s.copy(this.filterToWorldQ),s.multiply(this.resetQ),s.multiply(e),s.multiply(this.worldToScreenQ),this.yawOnly&&(s.x=0,s.z=0,s.normalize()),this.orientationOut_[0]=s.x,this.orientationOut_[1]=s.y,this.orientationOut_[2]=s.z,this.orientationOut_[3]=s.w,this.orientationOut_},e.prototype.getPose=function(){var e=new ea;return e.orientation=this.getOrientation(),e},e.prototype.resetPose=function(){this.resetQ.copy(this.filter.getOrientation()),this.resetQ.x=0,this.resetQ.y=0,this.resetQ.z*=-1,this.resetQ.normalize(),_o()&&this.resetQ.multiply(this.inverseWorldToScreenQ),this.resetQ.multiply(this.originalPoseAdjustQ)},e.prototype.getFrameData=function(e){var t=this.getOrientation(),i=this.getEyeOffset(),n=this.getEyeProjectionMatrix();return e.pose.angularAcceleration=null,e.pose.angularVelocity=null,e.pose.linearAcceleration=null,e.pose.linearVelocity=null,e.pose.orientation=t,e.pose.position=null,e.timestamp=this.previousTimestampS,e.leftProjectionMatrix.set(n.left),e.rightProjectionMatrix.set(n.right),Xo(e.leftViewMatrix,t,i.left),Xo(e.rightViewMatrix,t,i.right),e},e.prototype.start=function(){if("undefined"==typeof window)return function(){};var e=this.onDeviceMotion_.bind(this),t=this.onOrientationChange_.bind(this),i=this.onMessage_.bind(this),n=this.onDeviceOrientation_.bind(this);return Oo()&&function(){if("undefined"==typeof window)return!1;if("undefined"==typeof document)return!1;var e=window.self!==window.top,t=Go(document.referrer),i=Go(window.location.href);return e&&t!==i}()&&window.addEventListener("message",i),window.addEventListener("orientationchange",t),this.isWithoutDeviceMotion?window.addEventListener("deviceorientation",n):window.addEventListener("devicemotion",e),function(){window.removeEventListener("devicemotion",e),window.removeEventListener("deviceorientation",t),window.removeEventListener("orientationchange",t),window.removeEventListener("message",i)}},e.prototype.getEyeOffset=function(){return{left:[.5*-this.viewer.interLensDistance,0,0],right:[.5*this.viewer.interLensDistance,0,0]}},e.prototype.getEyeProjectionMatrix=function(){var e=this.getEyeFieldOfView(),t=this.depthNear,i=this.depthFar,n={left:[],right:[]},r=e.left.upDegrees*Fo,o=e.left.downDegrees*Fo,a=2/((l=e.left.leftDegrees*Fo)+(c=e.left.rightDegrees*Fo)),s=2/(r+o);n.left[0]=a,n.left[1]=0,n.left[2]=0,n.left[3]=0,n.left[4]=0,n.left[5]=s,n.left[6]=0,n.left[7]=0,n.left[8]=-(l-c)*a*.5,n.left[9]=(r-o)*s*.5,n.left[10]=i/(t-i),n.left[11]=-1,n.left[12]=0,n.left[13]=0,n.left[14]=i*t/(t-i),n.left[15]=0;var l,c;r=e.right.upDegrees*Fo,o=e.right.downDegrees*Fo,a=2/((l=e.right.leftDegrees*Fo)+(c=e.right.rightDegrees*Fo)),s=2/(r+o);return n.right[0]=a,n.right[1]=0,n.right[2]=0,n.right[3]=0,n.right[4]=0,n.right[5]=s,n.right[6]=0,n.right[7]=0,n.right[8]=-(l-c)*a*.5,n.right[9]=(r-o)*s*.5,n.right[10]=i/(t-i),n.right[11]=-1,n.right[12]=0,n.right[13]=0,n.right[14]=i*t/(t-i),n.right[15]=0,n},e.prototype.getEyeFieldOfView=function(){var e=this.viewer,t=this.device,i=new $o(e.distortionCoefficients),n=e.screenLensDistance,r=(t.widthMeters-e.interLensDistance)/2,o=e.interLensDistance/2,a=e.baselineLensDistance-t.bevelMeters,s=t.heightMeters-a,l=Lo*Math.atan(i.distort(r/n)),c=Lo*Math.atan(i.distort(o/n)),u=Lo*Math.atan(i.distort(a/n)),h=Lo*Math.atan(i.distort(s/n)),d=new ta,p=new ta;return d.leftDegrees=Math.min(l,e.fov),d.rightDegrees=Math.min(c,e.fov),d.downDegrees=Math.min(u,e.fov),d.upDegrees=Math.min(h,e.fov),p.leftDegrees=d.rightDegrees,p.rightDegrees=d.leftDegrees,p.upDegrees=d.upDegrees,p.downDegrees=d.downDegrees,{left:d,right:p}},e.prototype.onDeviceOrientation_=function(e){this._deviceOrientationQ=this._deviceOrientationQ||new n.Quaternion;var t=e.alpha,i=e.beta,r=e.gamma;t=(t||0)*Math.PI/180,i=(i||0)*Math.PI/180,r=(r||0)*Math.PI/180,this._deviceOrientationQ.setFromEuler(new n.Euler(t,i,-r,"YXZ"))},e.prototype.onDeviceMotion_=function(e){this.updateDeviceMotion_(e)},e.prototype.updateDeviceMotion_=function(e){var t=e.accelerationIncludingGravity,i=e.rotationRate,n=e.timeStamp/1e3,r=n-this.previousTimestampS;return r<0?(jo("fusion-pose-sensor:invalid:non-monotonic","Invalid timestamps detected: non-monotonic timestamp from devicemotion"),void(this.previousTimestampS=n)):r<=.001||r>1?(jo("fusion-pose-sensor:invalid:outside-threshold","Invalid timestamps detected: Timestamp from devicemotion outside expected range."),void(this.previousTimestampS=n)):(t&&(this.accelerometer.set(-t.x,-t.y,-t.z),i&&(Ho()?this.gyroscope.set(-i.beta,i.alpha,i.gamma):this.gyroscope.set(i.alpha,i.beta,i.gamma),this.isDeviceMotionInRadians||this.gyroscope.multiplyScalar(Math.PI/180),this.filter.addGyroMeasurement(this.gyroscope,n)),this.filter.addAccelMeasurement(this.accelerometer,n)),void(this.previousTimestampS=n))},e.prototype.onOrientationChange_=function(){this.setScreenTransform_()},e.prototype.onMessage_=function(e){var t=e.data;t&&t.type&&("devicemotion"===t.type.toLowerCase()&&this.updateDeviceMotion_(t.deviceMotionEvent))},e.prototype.setScreenTransform_=function(){switch(this.worldToScreenQ.set(0,0,0,1),"undefined"!=typeof window?window.orientation:0){case 0:break;case 90:this.worldToScreenQ.setFromAxisAngle(new n.Vector3(0,0,1),-Math.PI/2);break;case-90:this.worldToScreenQ.setFromAxisAngle(new n.Vector3(0,0,1),Math.PI/2)}this.inverseWorldToScreenQ.copy(this.worldToScreenQ),this.inverseWorldToScreenQ.inverse()},e}(),na=[0,0,.5,1],ra=[.5,0,.5,1],oa=function(){function e(e){var t=this;this.renderer=e,this.sensor=new ia(.98,.04,!1,!1),this.scale=1,this.cameraL=new n.PerspectiveCamera,this.cameraR=new n.PerspectiveCamera;var i=this.sensor.start();this.dispose=function(){var e=t.renderer.getSize(new n.Vector2);t.renderer.setScissor(0,0,e.width,e.height),t.renderer.setViewport(0,0,e.width,e.height),t.renderer.setScissorTest(!1),i()}}return e.prototype.render=function(e,t){var i=this.renderer.getSize(new n.Vector2);if(i.width>i.height){var r=e.autoUpdate;r&&(e.updateMatrixWorld(),e.autoUpdate=!1);var o={x:Math.round(i.width*na[0]),y:Math.round(i.height*na[1]),width:Math.round(i.width*na[2]),height:Math.round(i.height*na[3])},a={x:Math.round(i.width*ra[0]),y:Math.round(i.height*ra[1]),width:Math.round(i.width*ra[2]),height:Math.round(i.height*ra[3])};this.renderer.setScissorTest(!0),this.renderer.autoClear&&this.renderer.clear(),null===t.parent&&t.updateMatrixWorld(),t.matrixWorld.decompose(this.cameraL.position,this.cameraL.quaternion,this.cameraL.scale),t.matrixWorld.decompose(this.cameraR.position,this.cameraR.quaternion,this.cameraR.scale);var s=this.sensor.getEyeOffset();this.cameraL.translateOnAxis((new n.Vector3).fromArray(s.left),this.scale),this.cameraR.translateOnAxis((new n.Vector3).fromArray(s.right),this.scale);var l=this.sensor.getEyeProjectionMatrix();this.cameraL.projectionMatrix.elements=l.left.slice(),this.cameraR.projectionMatrix.elements=l.right.slice(),this.renderer.setViewport(o.x,o.y,o.width,o.height),this.renderer.setScissor(o.x,o.y,o.width,o.height),this.renderer.render(e,this.cameraL),this.renderer.setViewport(a.x,a.y,a.width,a.height),this.renderer.setScissor(a.x,a.y,a.width,a.height),this.renderer.render(e,this.cameraR),this.renderer.setViewport(0,0,i.width,i.height),this.renderer.setScissor(0,0,i.width,i.height),this.renderer.setScissorTest(!1),r&&(e.autoUpdate=!0)}else this.renderer.render(e,t)},e.prototype.dispose=function(){},e}(),aa={zh:{TITLE:"眼镜模式",HIT:"请将手机横屏放入 VR 眼镜中"},en:{TITLE:"GLASSES MODE",HIT:"Please put the mobile phone horizontally into the VR glasses."},ja:{TITLE:"メガネモード",HIT:"携帯電話をVRメガネに水平に入れてください。"}},sa="undefined"!=typeof navigator&&null!==(Wo=aa[navigator.language.split("-")[0]])&&void 0!==Wo?Wo:aa.zh,la="\n<style>\n.$id {\n all: initial;\n position: absolute;\n overflow: hidden;\n display: none;\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n}\n.$id-modal {\n width: 100%;\n height: 332px;\n position: absolute;\n bottom: -2px;\n left: 0;\n right: 0;\n overflow: hidden;\n pointer-events: none;\n will-change: transform;\n animation: $id-modal-fade-in 0.3s ease 1;\n}\n.$id-modal-bg {\n background: rgba(0, 0, 0, 0.75);\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n top: 0;\n}\n.$id-modal-bg-line {\n height: 1px;\n background-image: linear-gradient(\n 85deg,\n rgba(162, 177, 255, 0.3) 1%,\n rgba(120, 126, 255, 0.8) 30%,\n rgba(147, 218, 255, 0.8) 66%,\n rgba(250, 255, 184, 0.3) 92%\n );\n}\n.$id-modal-bg-wave svg {\n width: 375px;\n height: 61px;\n display: block;\n}\n.$id-modal-content {\n color: #ffffff;\n padding: 0 14px;\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n top: 0;\n overflow: hidden;\n}\n.$id-modal-content-title {\n font-size: 17px;\n font-family: sans-serif;\n line-height: 18px;\n padding: 20px 0;\n font-weight: bold;\n}\n.$id-modal-content-hit {\n font-size: 14px;\n font-family: sans-serif;\n line-height: 24px;\n opacity: 0.85;\n}\n.$id-modal-content-guide {\n position: relative;\n width: 168px;\n height: 139px;\n margin: 36px auto 0;\n}\n.$id-modal-content-guide-cardboard {\n position: absolute;\n width: 100px;\n height: 82px;\n left: 68px;\n top: 57px;\n}\n.$id-modal-content-guide-cardboard-image {\n width: 100px;\n height: 82px;\n background-image: url(".concat("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAADqCAMAAAAvZYhaAAAC/VBMVEUAAAD///99fX37+/v5+fn29vbx8fHv7+/Nzc3o6Ojq6urh4eHU1NTR0dGDg4Pl5eWSkpLHx8fj4+Pe3t7X19fAwMDZ2dnCwsKrq6uioqLb29uNjY2enp67u7t5eXmAgIC2traWlpa5ubnKysqmpqZycnKHh4eurq6ysrKKioqDg4Pd3d12dnb9/f1vb2/s7OxlZWXz8/OoqKiZmZlpaWmbm5teXl7W1tbJycnExMRiYmJsbGywsLCPj49aWlq9vb1UVFRYWFhra2t+fn7t7e1RUVFOTk6Dg4OAgICCgoKKioqEhISIiIhqamqCgoKIiIiQkJCIiIiWlp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gwGtf4iL2u+03weXYKJKi5pXE0J7FU5Bw8zz+N6Q0F4OD4EwvhWRJoX2UoZhUY9PZ2PYrNBewuAODLzDUMPjMQ8Kd6GIaMZaclxG8FfcIWsxGLkxGOzazl7AYKLn09idtd2qmP7ZiZsK24fHR20MLafPB6O2UTWAP1yGz7GpTmekAAAAAElFTkSuQmCC",");\n background-size: 100%;\n background-repeat: no-repeat;\n}\n.$id-modal-content-guide-phone {\n position: absolute;\n width: 58px;\n height: 56px;\n left: 0;\n top: 0;\n}\n.$id-modal-content-guide-phone-move-x {\n width: 100%;\n height: 100%;\n position: absolute;\n top: 0;\n left: 0;\n will-change: transform;\n animation: $id-guide-move-x 4s 0.5s infinite;\n}\n.$id-modal-content-guide-phone-move-y {\n width: 100%;\n height: 100%;\n position: absolute;\n top: 0;\n left: 0;\n will-change: transform;\n animation: $id-guide-move-y 4s cubic-bezier(0.42, 0, 0.23, 0.98) 0.5s infinite;\n}\n.$id-modal-content-guide-phone-blink {\n width: 100%;\n height: 100%;\n position: absolute;\n top: 0;\n left: 0;\n opacity: 0;\n will-change: opacity;\n animation: $id-guide-blink 4s 0.5s infinite;\n}\n.$id-modal-content-guide-phone-image {\n width: 58px;\n height: 56px;\n background-image: url(").concat("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAK4AAAClCAMAAADyFTYfAAAC+lBMVEUAAABISEhKSkpGRkZERERCQkJOTk45OTlBQUFQUFBSUlJUVFQ7OztYWFg/Pz8/Pz9aWlpkZGQ3NzdcXFxeXl5MTExHR0dhYWFJSUk9PT1WVlZMTEygoKBERERFRUVmZmZQUFA9PT1LS0tra2tPT09ubm5SUlI2NjZXV1czMzOpqalTU1O3t7dVVVVoaGhaWlpqamq1tbWhoaGenp6lpaWurq6ysrJZWVmjo6OgoKBUVFRdXV1cXFyvr6+0tLSwsLCrq6ubm5syMjKbm5twcHCQkJCLi4uGhobLy8uCgoJ9fX1ycnLPz894eHizs7NxcXFgYGCVlZWYmJh7e3umpqa3t7f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cwDofmTXiE9NqCRqDO0CpFM40MV6oFou1C1ibRatHjGDahVtJgkZE0w5QqXJoQVko1y3Wpc0lGPOBaceJBA1ql93NSfHyCD9Uil512j97HfnM7/Ea8Wn96UkNQpV2U6V0tUAaXW7jNwYswYxdL94y7VqSoKFhWiMDXnUBaHBwoQT9Prx4Szm3TyRodLupoMJHH5LyK+9es8+l/CKvDytukQQND8FSlFIOreGM0/omiATVapVo12xd0jhExKW5294RAc40RVoftY47cd2LKtMOFwkajzuAeVOlIhfJeKahLyiWJRhLr3Ai2BVzQYKG4lLYXfg8HCSI33a2nTH5OaVWmzYHJGhsdLmDuN2exAonBTzZIuzEUS+ec0ZMBQn+Ea5KlXNI4C/UAO/k6hKwBptJgn8fgmVckgFXML9YEEFLUKMvlqAp0eWyDEAL65dLqyWo6RekTZ2XNCsD6rgpTK/4p3WcrrPH1ghWJGhONC3JoGAkRHH1JKjpNEcCxOV2I8MWyiUJqNVajSVodgiWcVMVLVeSS1ATCZoc88qjVKlSc3kSLJ5c5V6rTZQAcVkGbBeuOkgCgq2CBM3MoFwGr1tvim2aMpZZqyBBc3N1UF2GX90j9SQJKCBB83OfYAcNVjFcSrvzo95WOShB83Ody5V24fqzO0nAUSzB/89Nph38VqmuOa3gticJOP9fApuHTDt4nFJ7AXdPC0lg8/gq8y5XapSrgpUgbQ0JpF5u97hS1fOC26nlJJA8Yd41Sg3fU4dtRQkKeXSN3jo4Qqm0397OmyZOGatoDrScBIWM3DFn5kXi1ZyqRSUoZtKOa1vWKArztqgEnhIHty4f9/btuEstKwGkxf+XuCT5CbTFnFRuxktuAAAAAElFTkSuQmCC",');\n background-size: 100%;\n background-repeat: no-repeat;\n}\n.$id-modal-close {\n position: absolute;\n top: 20px;\n right: 14px;\n width: 14px;\n height: 14px;\n}\n.$id-modal-close svg {\n width: 14px;\n height: 14px;\n display: block;\n}\n\n@keyframes $id-modal-fade-in {\n 0% { transform: translate3d(0, 100%, 0); opacity: 0.5; }\n 100% { transform: translate3d(0, 0, 0); opacity: 1; }\n}\n@keyframes $id-guide-blink {\n 0% { opacity: 0; }\n 7% { opacity: 0; }\n 12% { opacity: 1; }\n 29% { opacity: 1; }\n 34% { opacity: 0.3; }\n 39% { opacity: 1; }\n 44% { opacity: 0.3; }\n 49% { opacity: 1; }\n 80% { opacity: 1; }\n 100% { opacity: 0; }\n}\n@keyframes $id-guide-move-x {\n 0% { transform: translate3d(0, 0, 0); }\n 57% { transform: translate3d(0, 0, 0); }\n 80% { transform: translate3d(70px, 0, 0); }\n 100% { transform: translate3d(70px, 0, 0); }\n}\n@keyframes $id-guide-move-y {\n 0% { transform: translate3d(0, 0, 0); }\n 57% { transform: translate3d(0, 0, 0); }\n 80% { transform: translate3d(0, 58px, 0); }\n 100% { transform: translate3d(0, 58px, 0); }\n}\n@media screen and (orientation: portrait) {\n .$id {\n display: block;\n }\n}\n</style>\n<div class="$id-modal">\n <div class="$id-modal-bg">\n <div class="$id-modal-bg-line"></div>\n <div class="$id-modal-bg-wave">\n <svg width="375" height="61" viewBox="0 0 375 61" version="1.1" xmlns="http://www.w3.org/2000/svg">\n <defs>\n <linearGradient x1="0" y1="0%" x2="0" y2="100%" id="$id-2y6_dj_hgp">\n <stop stop-color="#8598FF" stop-opacity="0.15" offset="0%"></stop>\n <stop stop-color="#000" stop-opacity="0" offset="100%"></stop>\n </linearGradient>\n </defs>\n <path transform="translate(187.5, 30.5) scale(-1, 1) translate(-187.5, -30.5)" fill="url(#$id-2y6_dj_hgp)" d="\nM0,1\nC83.001,1.706 140.146,4.164 171.435,8.374\nC218.369,14.688 253.467,26.308 273.002,33\nC292.536,39.691323.501,51 343.709,56\nC357.182,59.333 367.612,61 375,61\nL375,0\nL0,0\nL0,1\nZ\n"></path>\n </svg>\n </div>\n </div>\n <div class="$id-modal-content">\n <div class="$id-modal-content-title">').concat(sa.TITLE,'</div>\n <div class="$id-modal-content-hit">').concat(sa.HIT,'</div>\n <div class="$id-modal-content-guide">\n <div class="$id-modal-content-guide-phone">\n <div class="$id-modal-content-guide-phone-move-x">\n <div class="$id-modal-content-guide-phone-move-y">\n <div class="$id-modal-content-guide-phone-blink">\n <div class="$id-modal-content-guide-phone-image"></div>\n </div>\n </div>\n </div>\n </div>\n <div class="$id-modal-content-guide-cardboard">\n <div class="$id-modal-content-guide-cardboard-image"></div>\n </div>\n </div>\n </div>\n <div class="$id-modal-close">\n <svg width="14" height="14" viewBox="0 0 14 14" version="1.1" xmlns="http://www.w3.org/2000/svg">\n <defs>\n <radialGradient cx="50%" cy="50%" fx="50%" fy="50%" r="70%" id="$id-ho0itsc4p9">\n <stop stop-color="#FFF" stop-opacity="0.75" offset="0%"></stop>\n <stop stop-color="#FFF" stop-opacity="0.22" offset="100%"></stop>\n </radialGradient>\n </defs>\n <path transform="translate(-3, -3)" fill="url(#$id-ho0itsc4p9)" fill-rule="nonzero" d="\nM16.791,3.198\nC17.044,3.438 17.067,3.814 16.860,4.080\nL16.791,4.156\nL12.144,9.331\nC11.803,9.711 11.803,10.288 12.144,10.668\nL16.791,15.843\nC17.044,16.084 17.067,16.460 16.860,16.725\nL16.791,16.801\nC16.538,17.042 16.142,17.063 15.864,16.867\nL15.784,16.801\nL10.000,11.250\nL4.215,16.801\nL4.135,16.867\nC3.857,17.063 3.461,17.042 3.208,16.801\nL3.208,16.801\nL3.139,16.725\nC2.932,16.460 2.955,16.084 3.208,15.843\nL3.208,15.843\nL7.855,10.668\nC8.196,10.288 8.196,9.711 7.855,9.331\nL7.855,9.331\nL3.208,4.156\nL3.139,4.080\nC2.932,3.814 2.955,3.438 3.208,3.198\nC3.486,2.933 3.937,2.933 4.215,3.198\nL4.215,3.198 L9.999,8.749\nL15.784,3.198\nC16.062,2.933 16.513,2.933 16.791,3.198\nZ\n"></path>\n </svg>\n </div>\n</div>\n');function ca(e){for(var t=1,i=document.getElementsByTagName("meta"),n=0;n<i.length;n++){var r=i[n];if("viewport"===r.getAttribute("name")){var o=(r.getAttribute("content")||"").match(/initial\-scale\=([\d|\.]+)/);o&&(t=Number(o[1])),isNaN(t)&&(t=1)}}return la.replace(/\n/g," ").replace(/\ +/g," ").replace(/\$id/g,e).replace(/(\d+)px/g,(function(e,i){return function(e){return Math.floor(e*t)+"px"}(Number(i))}))}var ua=new n.CircleBufferGeometry(.12,16),ha=function(e){function t(){var t=e.call(this)||this;t.progress=0,t.opacity=0,t.loading=!1,t.current=!1,t.disabled=!1,t.currentMotion=new ur({ringScale:1.1,ringOpacity:0,circleFade:0,circleOpacity:.85,circleScale:1}),t.opacityMotion=new ur({opacity:0}),t.loadingMotion=new ur({opacity:0}),t.disableMotion=new ur({opacity:0});var i={blending:n.CustomBlending,blendSrc:n.SrcAlphaFactor,blendDst:n.OneMinusSrcAlphaFactor,blendSrcAlpha:n.OneFactor,blendDstAlpha:n.OneMinusSrcAlphaFactor,depthWrite:!1,transparent:!0};return t.hitTestMesh=new n.Mesh(ua,new n.MeshBasicMaterial(ie(ie({},i),{color:0,opacity:0}))),t.hitTestMesh.scale.set(1.5,1.5,1.5),t.ringMesh=new n.Mesh(ua,new n.ShaderMaterial(ie(ie({},i),{vertexShader:"\nvarying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n",fragmentShader:"\nvarying vec2 vUv;\nuniform float opacity;\n\nfloat smoothDist = 0.01;\nvoid main() {\n vec2 center = vec2(0.5, 0.5);\n float dist = length(center - vUv);\n float outerDist = 0.49;\n float innerDist = 0.29;\n\n float outside = 1.0 - smoothstep(outerDist - smoothDist, outerDist, dist);\n float inside = smoothstep(innerDist, innerDist + smoothDist, dist);\n\n vec4 bg = vec4(0.576, 0.635, 1.0, 0.3);\n float gradientAlpha = clamp(abs(dist - (outerDist + innerDist) / 2.0) / (outerDist - innerDist) * 1.5 + 0.1, 0.0, 1.0);\n vec4 gradient = vec4(1.0, 1.0, 1.0, gradientAlpha);\n\n gl_FragColor = mix(bg, gradient, gradient.a);\n\n gl_FragColor = vec4(gl_FragColor.rgb, gl_FragColor.a * opacity * outside * inside);\n}\n",uniforms:{opacity:{value:0}}}))),t.panoMesh=new n.Mesh(ua,new n.ShaderMaterial(ie(ie({},i),{vertexShader:"\nvarying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n",fragmentShader:"\nuniform float circleScale;\nuniform float circleFade;\nuniform float circleOpacity;\nuniform float loadingAngle;\nuniform float loadingOpacity;\nuniform float opacity;\nuniform float disable;\nvarying vec2 vUv;\n\n#define PI 3.141592653589793\n#define TAU 6.283185307179586\n#define SMOOTH_DIST 0.017\n#define CENTER vec2(0.5, 0.5)\n\nfloat inside(float innerDist) {\n float dist = length(CENTER - vUv);\n return smoothstep(innerDist, innerDist + SMOOTH_DIST, dist);\n}\nfloat outside(float outerDist) {\n float dist = length(CENTER - vUv);\n return 1.0 - smoothstep(outerDist - SMOOTH_DIST, outerDist, dist);\n}\n\nvec4 create_circle() {\n float dist = length(CENTER - vUv);\n float gradient = clamp(0.98 + abs(dot(normalize(vec2(1.0, -1.0)), vUv - CENTER)) * 2.0, 0.0, 1.0);\n vec3 color = mix(vec3(0.576, 0.635, 1.0), vec3(1.0, 1.0, 1.0), circleFade * 0.5);\n return vec4(color, 1.0 * gradient * circleOpacity * outside(0.3 * circleScale));\n}\n\nvec4 create_disable() {\n float dist = length(CENTER - vUv);\n return vec4(1.0, 1.0, 1.0, 0.5 * outside(0.32 * circleScale));\n}\n\nvec4 create_loading() {\n float angle = PI - atan(CENTER.x - vUv.x, CENTER.y - vUv.y);\n angle = mod(angle + loadingAngle, TAU);\n float gradient = (1.0 - smoothstep(0.0, TAU, angle)) * 0.9 + 0.1;\n return vec4(1.0, 1.0, 1.0, gradient * loadingOpacity * inside(0.2 * circleScale) * outside(0.25 * circleScale));\n}\n\nvoid main() {\n gl_FragColor = vec4(1.0, 1.0, 1.0, 0);\n\n vec4 circleColor = create_circle();\n gl_FragColor = mix(gl_FragColor, circleColor, circleColor.a);\n\n vec4 loadingColor = create_loading();\n gl_FragColor = mix(gl_FragColor, loadingColor, loadingColor.a);\n\n gl_FragColor = mix(gl_FragColor, create_disable(), disable);\n\n gl_FragColor = vec4(gl_FragColor.rgb, gl_FragColor.a * opacity);\n}\n",uniforms:{circleScale:{value:1.1},circleFade:{value:0},circleOpacity:{value:.5},loadingAngle:{value:0},loadingOpacity:{value:0},opacity:{value:0},disable:{value:0}}}))),t.add(t.hitTestMesh),t.add(t.ringMesh),t.add(t.panoMesh),t.renderOrder=1e4,t.needsRender=!0,t}return te(t,e),t.prototype.setProgress=function(e){this.progress=e,this.setLoading(e>0)},t.prototype.setOpacity=function(e){this.opacity!==e&&(this.opacity=e=Kn(e,0,1),this.opacityMotion.set({opacity:e},30).catch(le))},t.prototype.setCurrent=function(e){if(this.current!==e){if(e){var t=[{progress:0,value:{ringScale:2,ringOpacity:0,circleFade:0,circleOpacity:.85,circleScale:1}},{progress:.05,value:{ringScale:1,ringOpacity:1,circleFade:0,circleOpacity:.85,circleScale:1}},{progress:.15,value:{ringScale:1.2,ringOpacity:1,circleFade:0,circleOpacity:.85,circleScale:1}},{progress:.25,value:{ringScale:1.1,ringOpacity:1,circleFade:0,circleOpacity:.85,circleScale:1}},{progress:.8,value:{ringScale:1.1,ringOpacity:1,circleFade:1,circleOpacity:.85,circleScale:1}},{progress:.9,value:{ringScale:1.1,ringOpacity:1,circleFade:1,circleOpacity:.65,circleScale:.8}},{progress:.92,value:{ringScale:1.1,ringOpacity:1,circleFade:1,circleOpacity:.65,circleScale:.8}},{progress:1,value:{ringScale:1.1,ringOpacity:1,circleFade:1,circleOpacity:.85,circleScale:1.1}}];this.currentMotion.setKeyframes(t,1500).catch(le)}else{t=[{progress:0,value:ie({},this.currentMotion.value)},{progress:1,value:{ringScale:1.1,ringOpacity:0,circleFade:0,circleOpacity:.85,circleScale:1}}];this.currentMotion.setKeyframes(t,200).catch(le)}this.current=e}},t.prototype.setLoading=function(e){this.loading!==e&&(e?this.loadingMotion.setKeyframes([{progress:0,value:{opacity:0}},{progress:.3,value:{opacity:0}},{progress:1,value:{opacity:.8}}],500).catch(le):this.loadingMotion.set({opacity:0},0).catch(le),this.loading=e,!0===this.disabled&&this.setDisabled(!1),this.needsRender=!0)},t.prototype.setDisabled=function(e){this.disabled!==e&&(this.disabled=e,!0===this.loading&&this.setLoading(!1),this.disableMotion.set({opacity:e?1:0},300).catch(le),this.needsRender=!0)},t.prototype.tap=function(){return Promise.resolve()},t.prototype.updateTime=function(e,t){this.opacityMotion.update(e),this.currentMotion.update(e),this.loadingMotion.update(e);var i=this.opacityMotion.value.opacity,n=this.currentMotion.value,r=n.ringScale,o=n.ringOpacity,a=n.circleFade,s=n.circleOpacity,l=n.circleScale;this.ringMesh.scale.set(r,1,r),this.ringMesh.material.uniforms.opacity.value=o*i,this.panoMesh.material.uniforms.opacity.value=i,this.panoMesh.material.uniforms.circleOpacity.value=s,this.panoMesh.material.uniforms.circleScale.value=l,this.panoMesh.material.uniforms.circleFade.value=a,this.panoMesh.material.uniforms.loadingOpacity.value=this.loadingMotion.value.opacity,this.panoMesh.material.uniforms.disable.value=this.disableMotion.value.opacity,this.panoMesh.material.uniforms.loadingAngle.value=e/120%(2*Math.PI),this.needsRender=!0},t.prototype.dispose=function(){this.hitTestMesh.material.dispose(),this.ringMesh.material.dispose(),this.panoMesh.material.dispose()},t}(n.Object3D),da=function(e){function t(i){var n=this,r=t.parseArgs(i);(n=e.call(this,r)||this).cardboard=new oa(n.renderer);var o,a,s,l=(o="five_vr_helper_"+In(),a=ca(o),(s=document.createElement("div")).className=o,s.innerHTML=a,s);n.helperElement=l;var c=new qr(l);return n.element.parentNode&&(n.element.parentNode.insertBefore(l,n.element),n.setHelperElementSize(),c.on("tap",(function(){return n.emit("vrWantsToExit")}))),n.destroyHelper=function(){c.destroy(),l.parentNode&&l.parentNode.removeChild(l),delete n.helperElement},n}return te(t,e),t.parseArgs=function(t){var i=ie(ie({},t),{maxLatitude:Math.PI/2,minLatitude:-Math.PI/2});return e.parseArgs.call(this,i)},t.initAnimationEndPose=function(t){var i=this.parseArgs(t);return e.initAnimationEndPose.call(this,i)},t.prototype.destroy=function(){e.prototype.destroy.call(this),this.cardboard.dispose(),this.destroyHelper();for(var t=0,i=this.panoMeshes;t<i.length;t++){var n=i[t];this.helper.remove(n),n.dispose()}this.panoMeshes.length=0},t.prototype.isReady=function(){return!1},t.prototype.updateRenderSize=function(){this.needsRender=!0,this.setHelperElementSize()},t.prototype.updatePanoMeshesVisible=function(){for(var e=this.work.observers[this.currentPanoIndex],t=(e?e.visibleNodes:[]).concat(this.currentPanoIndex),i=0,n=this.work.observers;i<n.length;i++){var r=n[i],o=this.panoMeshes[r.panoIndex];o&&(t.indexOf(r.panoIndex)>=0?o.parent!==this.helper&&this.helper.add(o):o.parent===this.helper&&(this.helper.remove(o),o.setOpacity(0)))}},t.prototype.updatePanoMeshes=function(){var e=this;this.panoMeshes.forEach((function(t){e.helper.remove(t),t.dispose()})),this.panoMeshes.length=0,this.panoMeshHitTested={};for(var t=0;t<this.work.observers.length;t++){var i=this.work.observers[t],n=new ha;n.name="panoSphere_".concat(this.work.workCode,"_").concat(t),n.position.copy(i.position),n.needsRender=!0,this.panoMeshes[t]=n}this.updatePanoMeshesVisible()},t.prototype.updateTime=function(e,t){var i,r,o,a,s,l;if(!this.destroyed){var c=this.currentPanoIndex;this.needsRender=!0;var u={},h={};if(!1===this.locationMotion.ended){this.locationMotion.update(e);var d=this.locationMotion.getKeyFrameSegment(e),p=d[0],f=d[1],A=this.panoResourceFromLocationMotionKeyframe(p),v=this.panoResourceFromLocationMotionKeyframe(f),m=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[0]),g=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),y=A.position,b=v.position,x=this.locationMotion.value.count-f.value.count+1;u.modelAlpha=this.locationMotion.value.modelAlpha,this.camera.perspToOrtho.setScalar(Kn(this.locationMotion.value.perspToOrtho,0,1)),this.camera.orthoDistance=this.locationMotion.value.orthoDistance,u.useBlackTransition="instant"===v.effect,v.panoPicture&&(x<1?A.panoPicture&&(u.pano0=A.panoPicture):u.pano0=v.panoPicture,u.pano1=v.panoPicture),"fade"===v.effect&&(u.pano0&&A.panoPicture&&(u.pano0={map:u.pano0.map,luminanceMap:u.pano0.luminanceMap,matrix:A.panoPicture.matrix.clone().setPosition(v.position)}),y.copy(b)),u.progress=x,h.distance=this.locationMotion.value.distance,h.offset=new n.Vector3(y.x+(b.x-y.x)*x,y.y+(b.y-y.y)*x,y.z+(b.z-y.z)*x);for(var w=[],M=[],C=0,E=this.locationMotion.keyframes;C<E.length;C++){var I=E[C],S=I.key,B=I.progress;void 0!==S&&(w.push(S),B>=this.locationMotion.progress&&M.push(S))}for(var T=0,P=Object.keys(this.panoResources);T<P.length;T++){var R=P[T];if(!(M.indexOf(R)>=0)){var k=this.panoResources[R];if(k.panoPicture){var Q=k.panoPicture.map;if(Q){if(Q===(null===(i=u.pano0)||void 0===i?void 0:i.map))continue;if(Q===(null===(r=u.pano1)||void 0===r?void 0:r.map))continue;Q.dispose(),k.panoPicture=null}}w.indexOf(R)>=0||delete this.panoResources[R]}}this.currentPanoIndex=x<.5?A.panoIndex:v.panoIndex,this.emit("movingToPano",g.panoIndex,m.panoIndex,this.locationMotion.progress)}!1===Ur(u)&&((null===(o=u.pano0)||void 0===o?void 0:o.map)&&u.pano0.map instanceof Ct&&!u.pano0.map.cubeRenderTarget&&(u.pano0.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),(null===(a=u.pano0)||void 0===a?void 0:a.luminanceMap)&&u.pano0.luminanceMap instanceof Ct&&!u.pano0.luminanceMap.cubeRenderTarget&&(u.pano0.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),(null===(s=u.pano1)||void 0===s?void 0:s.map)&&u.pano1.map instanceof Ct&&!u.pano1.map.cubeRenderTarget&&(u.pano1.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),(null===(l=u.pano1)||void 0===l?void 0:l.luminanceMap)&&u.pano1.luminanceMap instanceof Ct&&!u.pano1.luminanceMap.cubeRenderTarget&&(u.pano1.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),this.model.setMaterial(u)),h.offset&&this.camera.position.copy(h.offset),this.currentPanoIndex!==c&&this.updatePanoMeshesVisible();var D=this.camera.pose.longitude,F=this.camera.pose.latitude;this.camera.quaternion.fromArray(this.cardboard.sensor.getOrientation()),this.camera.updateMatrixWorld(),this.camera.computePose();for(var L=0,O=this.work.observers[this.currentPanoIndex].visibleNodes.concat(this.currentPanoIndex);L<O.length;L++){var N=O[L],V=this.work.observers[N],U=this.panoMeshes[N];if(V.loadable||V.active){var z=U.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);z<.05?U.setOpacity(0):U.setOpacity(Kn(1.5/z,0,1)),this.currentPanoIndex===N&&U.setOpacity(0),U.lookAt(this.camera.position)}else U.setOpacity(0)}var q=this.intersect(e);for(N=0;N<this.work.observers.length;N++){null==(U=this.panoMeshes[N])||U.setCurrent(U===q)}for(N=0;N<this.work.observers.length;N++){(U=this.panoMeshes[N])&&U.updateTime&&U.updateTime(e,t)}D===this.camera.pose.longitude&&F===this.camera.pose.latitude||(this.cameraMotion.set(ci(this.camera.pose,["longitude","latitude"]),0).catch(le),this.emit("cameraDirectionUpdate",ci(this.camera.pose,["longitude","latitude"]),!0),this.emit("cameraUpdate",zr(ci(this.camera.pose,["longitude","latitude","fov","offset","distance"])),!0))}},t.prototype.render=function(){this.cardboard.render(this.scene,this.camera)},t.prototype.setCamera=function(e){},t.prototype.destroyHelper=function(){},t.prototype.setHelperElementSize=function(){if(this.helperElement){var e=new n.Vector2(this.element.offsetWidth,this.element.offsetHeight),t=e.x*this.scissor.left,i=e.y*(1-this.scissor.bottom-this.scissor.height),r=e.x*this.scissor.width,o=e.y*this.scissor.height;this.helperElement.style.marginLeft=t+"px",this.helperElement.style.marginTop=i+"px",this.helperElement.style.width=r+"px",this.helperElement.style.height=o+"px"}},t.prototype.intersect=function(e){var t;if(!1===this.locationMotion.ended)return this.intersectMesh.visible=!1,delete this.activePanoMesh,void delete this.activeTime;if(this.activePanoMesh&&this.activeTime&&e-this.activeTime>1500){var i=this.activePanoMesh;return(c=this.panoMeshes.indexOf(i))>=0&&this.moveToPano(c,{},!0),delete this.activePanoMesh,delete this.activeTime,i}for(var r=this.camera.getDirection(new n.Vector3),o=new n.Raycaster(this.camera.position,r),a=void 0,s=[],l=this.work.observers[this.currentPanoIndex].visibleNodes,c=0;c<this.work.observers.length;c++){var u=this.panoMeshes[c];if(-1!==l.indexOf(c)){var h=o.intersectObject(null!==(t=u.hitTestMesh)&&void 0!==t?t:u,!0)[0];h&&s.push({panoMesh:u,intersection:h})}}var d=s.sort((function(e,t){return e.intersection.distance-t.intersection.distance}))[0];if(d?(a=d.intersection,this.activePanoMesh!==d.panoMesh&&(this.activePanoMesh=d.panoMesh,this.activeTime=e),this.intersectMesh.position.copy(d.panoMesh.position),this.intersectMesh.lookAt(this.camera.position),this.intersectMesh.visible=!1):(this.activePanoMesh=void 0,this.activeTime=void 0),!a)if((a=this.model.intersectRaycaster(o)[0])&&a.face){var p=a.face.normal,f=new n.Quaternion;f.setFromUnitVectors(new n.Vector3(0,0,1),p),this.intersectMesh.quaternion.copy(f);var A=p.clone().multiplyScalar(.05),v=a.point.clone().add(A);this.intersectMesh.position.copy(v),this.intersectMesh.visible=!0,this.emit("intersectionOnModelUpdate",a,this.intersectMesh)}else this.intersectMesh.visible=!1,this.emit("intersectionHidden");return null==d?void 0:d.panoMesh},t.prototype.onPanGesture=function(){},t.prototype.onTapGesture=function(){},t.prototype.onPinchGesture=function(){},t.prototype.onMouseMove=function(){},t.prototype.onMouseOut=function(){},t}(Do),pa=function(e){function t(i){var n,r,o=this,a=t.parseArgs(i);return(o=e.call(this,a)||this).currentPanoIndex=a.initial[0],o.locationMotion=new ur({x:o.camera.pose.offset.x,y:o.camera.pose.offset.y,z:o.camera.pose.offset.z,distance:o.camera.pose.distance,modelAlpha:null!==(r=null===(n=o.model.getMaterial())||void 0===n?void 0:n.modelAlpha)&&void 0!==r?r:0,perspToOrtho:o.camera.perspToOrtho.x,orthoDistance:o.camera.orthoDistance}),o}return te(t,e),t.parseArgs=function(t){return e.parseArgs.call(this,t)},t.initAnimationEndPose=function(t){var i=this.parseArgs(t);return e.initAnimationEndPose.call(this,i)},t.prototype.destroy=function(){e.prototype.destroy.call(this),this.locationMotion.dispose()},t.prototype.isReady=function(){return!1!==this.locationMotion.ended},t.prototype.updateWork=function(e,t,i,n,r){this.work=e,this.currentPanoIndex=t,this.hideIntersectMesh();var o={duration:0,longitude:i.longitude,latitude:i.latitude,fov:i.fov};return this.moveToPano(t,o,r),!0},t.prototype.updateTime=function(e,t){if(!this.destroyed){var i={},r={};if(!this.locationMotion.ended){this.locationMotion.update(e),i.modelAlpha=this.locationMotion.value.modelAlpha,this.camera.perspToOrtho.setScalar(Kn(this.locationMotion.value.perspToOrtho,0,1)),this.camera.orthoDistance=this.locationMotion.value.orthoDistance,r.distance=this.locationMotion.value.distance,r.offset=new n.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z);var o=new n.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),a=Vr(this.work.observers,(function(e){return e.position.distanceTo(o)}));this.currentPanoIndex=this.work.observers.indexOf(a)}this.cameraMotion.ended||(this.cameraMotion.update(e),r.longitude=this.cameraMotion.value.longitude,r.latitude=this.cameraMotion.value.latitude,r.fov=this.cameraMotion.value.fov),Ur(i)||this.model.setMaterial(i),Ur(r)||this.setCamera(r)}},t.prototype.initAnimation=function(e,t,i,n){var r,o,a,s=this;this.destroyed||(this.pending=!1,this.userAction=n,this.moveToPano(e,{longitude:null!==(r=t.longitude)&&void 0!==r?r:this.defaultLongitude,latitude:Kn(null!==(o=t.latitude)&&void 0!==o?o:this.defaultLatitude,this.minLatitude,this.maxLatitude),fov:Kn(null!==(a=t.fov)&&void 0!==a?a:this.defaultFov,this.minFov,this.maxFov),duration:i,moveStartCallback:function(e,t){s.emit("initAnimationWillStart",e,t,s.userAction)},moveEndCallback:function(e,t){s.emit("initAnimationEnded",e,t,s.userAction)},moveCancelCallback:function(){var e=s.currentPanoIndex,t={longitude:s.camera.pose.longitude,latitude:s.camera.pose.latitude,fov:s.camera.pose.fov,offset:s.camera.pose.offset.clone(),distance:s.camera.pose.distance};s.emit("initAnimationEnded",e,t,s.userAction)}},n))},t.prototype.getTargetPose=function(){var e=this.cameraMotion.getKeyFrameSegment(ue())[1],t=this.locationMotion.getKeyFrameSegment(ue())[1];return{longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,offset:new n.Vector3(t.value.x,t.value.y,t.value.z),distance:t.value.distance}},t.prototype.moveToPano=function(e,t,i){void 0===t&&(t={});var n=this.work.observers[e];n&&this.moveToPosition(n.position,t,i)},t.prototype.moveToPosition=function(e,t,i){var r,o,a,s=this;void 0===t&&(t={}),this.userAction=i;for(var l=ue(),c=new n.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z).distanceTo(e),u=this.locationMotion.getProgressVelocity(l),h=0,d=1;d<this.locationMotion.keyframes.length;d++){var p=this.locationMotion.keyframes[d-1].value,f=p.x,A=p.y,v=p.z,m=this.locationMotion.keyframes[d].value,g=m.x,y=m.y,b=m.z;h+=Math.sqrt(Math.pow(g-f,2)+Math.pow(y-A,2)+Math.pow(b-v,2))}var x=0===c?0:u*h/c,w=this.calculateMovingDuration(t.duration,c),M={x:e.x,y:e.y,z:e.z,distance:0,modelAlpha:1,perspToOrtho:0,orthoDistance:1},C={longitude:t.longitude,latitude:t.latitude,fov:t.fov},E={longitude:null!==(r=C.longitude)&&void 0!==r?r:this.camera.pose.longitude,latitude:null!==(o=C.latitude)&&void 0!==o?o:this.camera.pose.latitude,fov:null!==(a=C.fov)&&void 0!==a?a:this.camera.pose.fov,offset:e.clone(),distance:0},I=Vr(this.work.observers,(function(t){return t.position.distanceTo(e)})),S=this.work.observers.indexOf(I);this.emit("moveToPano",S,this.userAction),t.moveStartCallback&&t.moveStartCallback(S,E),this.emit("panoWillArrive",S,E,this.userAction),this.cameraMotion.set(C,w).catch(le),this.locationMotion.set(M,w,x).then((function(){var e=zr(s.camera.pose);t.moveEndCallback&&t.moveEndCallback(S,e),s.emit("panoArrived",S,e,s.userAction)}),(function(){t.moveCancelCallback&&t.moveCancelCallback(),s.emit("moveToPanoCanceled",S)}))},t.prototype.onTapGesture=function(e){var t=e.pointers.map((function(e){return ci(e,["x","y"])}));if(!this.emit("wantsGesture","tap",t,!0)){var i=this.relativeClientPosition(e.center),r=new n.Raycaster;if(r.setFromCamera(i,this.camera),!this.emit("wantsTapGesture",r,i,!0)){this.emit("gesture","tap",t,!0),this.emit("tapGesture",r,i,!0),this.interiaMovement=!1;var o=this.model.intersectRaycaster(r)[0];if(o&&o.face){var a=o.face.normal,s=o.point;if(new n.Vector3(0,1,0).angleTo(a)>Math.PI/3){var l=this.camera.position.clone().setY(s.y),c=s.clone().sub(l).setLength(.3),u=s.clone().sub(c);r.set(u,new n.Vector3(0,-1,0)),o=this.model.intersectRaycaster(r)[0]}}if(o){var h=o.point.clone(),d=Vr(this.work.observers.filter((function(e){return Math.abs(e.standingPosition.y-h.y)<1})),(function(e){return e.standingPosition.distanceTo(h)}));if(d)return h.y=d.position.y,void this.moveToPosition(h,{},!0)}this.cameraBounce()}}},t}(co),fa=function(){var e=113,t=126,i=0,n="";return arguments[i].split(n).map((function(n){return n.charCodeAt(i)>t?n:String.fromCharCode((n.charCodeAt(i)+e)%t)})).join(n)}("{vs|z-rp@-}n{|]|vv|{H{vs|z-znA-}n{|ZnvH{vs|z-nz}yr?Q-}n{|Qv}ynprzr{Zn}H<<{vs|z-sy|n-pnyrHn\bv{t-rp@-}n{|d|yq]|vv|{H<<-n\bv{t-sy|n-vU|yrHp|{-sy|n-]V-J-@;>A>BF?CHp|{-sy|n-aNb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{|znyv\tr5|yq]|vv|{;\b\t6-7-qvn{pr9->;=6H--tyl]|vv|{-J-}|wrpv|{Znv-7-z|qrycvrZnv-7-ry]|vv|{H\f"),Aa=function(){var e=113,t=126,i=0,n="";return arguments[i].split(n).map((function(n){return n.charCodeAt(i)>t?n:String.fromCharCode((n.charCodeAt(i)+e)%t)})).join(n)}("{vs|z-sy|n-|}npv\bH{vs|z-nz}yrPor-}n{|Zn}H{vs|z-nz}yr?Q-}n{|Qv}ynprzr{Zn}Hn\bv{t-rp@-}n{|d|yq]|vv|{H|vq-znv{56-\n--rpA-}n{|P|y|-J-rrPor5}n{|Zn}9-}n{|d|yq]|vv|{;\b\t6H--tylSntP|y|-J-rpA5}n{|P|y|;to9-|}npv\b6H\f"),va=Object.assign({opacity:new n.Uniform(1),scale:new n.Uniform(13.1),panoMap:new n.Uniform(null),panoDisplacementMap:new n.Uniform(null),panoPosition:new n.Uniform(new n.Vector3),panoMatrix:new n.Uniform(new n.Matrix4)},{emissive:new n.Uniform(new n.Color(0)),emissiveMap:new n.Uniform(null),specular:new n.Uniform(new n.Color(1118481)),specularMap:new n.Uniform(null),normalMap:new n.Uniform(null),bumpMap:new n.Uniform(null),shininess:new n.Uniform(30)},n.UniformsLib.common,n.UniformsLib.lights),ma=new n.SphereBufferGeometry(.01,128,128);var ga=function(){function e(e){void 0===e&&(e={}),this.textureLoader=new Et({allowHosts:this.allowHosts,requestProxy:this.requestProxy,networkSubscribe:this.networkSubscribe}),this.allowHosts=e.allowHosts,this.requestProxy=e.requestProxy,this.networkSubscribe=e.networkSubscribe}return e.prototype.setAllowHosts=function(e){this.allowHosts=e,this.textureLoader.setAllowHosts(e)},e.prototype.setRequestProxy=function(e){this.requestProxy=e,this.textureLoader.setRequestProxy(e)},e.prototype.setNetworkSubscribe=function(e){this.networkSubscribe=e,this.textureLoader.setNetworkSubscribe(e)},e.prototype.load=function(e,t,i,r,o,a,s,l,c){var u=[0,0],h=function(e,t){u[t]=e,l(.8*u[0]+.2*u[1])},d=[this.textureLoader.loadTexture(e,{imageURL:i,viaAjax:!0},void 0,void 0,(function(e){return h(e,1)}),c),this.textureLoader.loadCubeTexture(t,{imageURL:i,viaAjax:!0},void 0,void 0,(function(e){return h(e,0)}),c)];return Promise.all(d).then((function(e){var t=e[0],i=e[1],s=function(e,t,i,r){var o=new n.ShaderMaterial({side:n.BackSide,vertexShader:fa,fragmentShader:Aa,transparent:!0,uniforms:n.UniformsUtils.clone(va)}),a=t;return a.needsUpdate=!0,a.minFilter=n.LinearFilter,a.magFilter=n.LinearFilter,e.needsUpdate=!0,e.minFilter=n.LinearFilter,e.magFilter=n.LinearFilter,o.uniforms.opacity.value=0,o.uniforms.panoMap.value=a,o.uniforms.panoDisplacementMap.value=e,o.uniforms.panoPosition.value=i,o.uniforms.panoMatrix.value=r,Object.assign(new n.Mesh(ma,o),{frustumCulled:!1,dispose:function(){this.material instanceof n.ShaderMaterial&&(this.material.uniforms.panoDisplacementMap.value.dispose(),this.material.uniforms.panoDisplacementMap.value=null,this.material.dispose())}})}(t.body,i.body,r,o),l={body:s,meta:ne([t.meta],i.meta,!0)};return a(l),l})).catch((function(e){for(var t=0,i=d;t<i.length;t++){i[t].then((function(e){return e.body.dispose()})).catch(le)}return s(e),Promise.reject(e)}))},e}(),ya=new n.Vector3(-1,1,1),ba=function(e){function t(i){var r,o,a,s,l,c=this,u=t.parseArgs(i);return(c=e.call(this,u)||this).currentPanoIndex=u.initial[0],c.forwardPanoIndex=null,c.maxAccessibleDistance=u.maxAccessibleDistance,c.panoTapTriggerRadius=u.panoTapTriggerRadius,c.panoCircleMeshCreator=u.panoCircleMeshCreator,c.panoModelGroup=new n.Group,c.panoModelGroup.name="panoModels",c.scene.add(c.panoModelGroup),c.panoMeshes=[],c.updatePanoMeshes(),c.helper.remove(c.intersectMesh),c.locationMotion=new ur({count:0,distance:c.camera.pose.distance,modelAlpha:null!==(o=null===(r=c.model.getMaterial())||void 0===r?void 0:r.modelAlpha)&&void 0!==o?o:0,perspToOrtho:c.camera.perspToOrtho.x,orthoDistance:c.camera.orthoDistance}),c.panoResources={},c.panoResources[c.locationMotion.keyframes[0].key=c.locationMotion.keyframes[1].key=In()]={panoIndex:c.currentPanoIndex,workCode:c.work.workCode,matrix:null!==(l=null===(s=null===(a=c.model.getMaterial())||void 0===a?void 0:a.pano1)||void 0===s?void 0:s.matrix)&&void 0!==l?l:new n.Matrix4,position:c.camera.pose.offset.clone(),effect:"fly"},c.depthTextureLoader=new ga({allowHosts:c.work.allowHosts,requestProxy:c.requestProxy,networkSubscribe:c.networkSubscribe}),c}return te(t,e),t.parseArgs=function(t){var i,n,r,o=e.parseArgs.call(this,t);return ie(ie({},o),{maxAccessibleDistance:null!==(i=t.maxAccessibleDistance)&&void 0!==i?i:5,panoTapTriggerRadius:null!==(n=t.panoTapTriggerRadius)&&void 0!==n?n:1,panoCircleMeshCreator:null!==(r=t.panoCircleMeshCreator)&&void 0!==r?r:function(e){return new pr}})},t.initAnimationEndPose=function(t){var i=this.parseArgs(t);return e.initAnimationEndPose.call(this,i)},t.prototype.destroy=function(){var t,i=this;if(e.prototype.destroy.call(this),this.locationMotion.dispose(),delete this.pendingTextureTask,this.model&&(this.model.visible=!0),this.panoModelGroup){for(var n=0,r=this.panoModelGroup.children;n<r.length;n++){var o=r[n];"function"==typeof o.dispose&&o.dispose()}this.scene.remove(this.panoModelGroup)}this.panoMeshes&&(this.panoMeshes.forEach((function(e){i.helper.remove(e),e.dispose()})),this.panoMeshes.length=0);for(var a=null!==(t=this.model.getMaterial())&&void 0!==t?t:{},s=a.pano0,l=a.pano1,c=0,u=Object.keys(this.panoResources);c<u.length;c++){var h=u[c],d=this.panoResources[h];d.panoModel&&d.panoModel.material.uniforms.panoMap.value!==(null==s?void 0:s.map)&&d.panoModel.material.uniforms.panoMap.value!==(null==l?void 0:l.map)&&(this.panoModelGroup.remove(d.panoModel),d.panoModel.material.uniforms.panoMap.value.dispose(),d.panoModel.dispose(),delete d.panoModel),delete this.panoResources[h]}this.interiaMovement=!1},t.prototype.isReady=function(){return!1===this.locationMotion.ended&&e.prototype.isReady.call(this)},t.prototype.updateWork=function(e,t,i,n,r){return this.userAction=r,this.work=e,this.currentPanoIndex=t,this.depthTextureLoader.setAllowHosts(this.work.allowHosts),this.hideIntersectMesh(),this.updatePanoMeshes(),this.moveToPano(t,{effect:"fade",duration:n,longitude:i.longitude,latitude:i.latitude,fov:i.fov},r),!0},t.prototype.updateTime=function(e,t){var i,r,o=this;if(!this.destroyed){var a=this.currentPanoIndex,s={},l={},c=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[0]),u=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),h=!1;if(!1===this.locationMotion.ended){this.locationMotion.update(e);var d=this.locationMotion.getKeyFrameSegment(e),p=d[0],f=d[1],A=this.panoResourceFromLocationMotionKeyframe(p),v=this.panoResourceFromLocationMotionKeyframe(f),m=(new n.Vector3).copy(A.position),g=(new n.Vector3).copy(v.position),y=this.locationMotion.value.count-f.value.count+1;s.progress=y,s.modelAlpha=this.locationMotion.value.modelAlpha,this.camera.perspToOrtho.setScalar(Kn(this.locationMotion.value.perspToOrtho,0,1)),this.camera.orthoDistance=this.locationMotion.value.orthoDistance;for(var b=0,x=this.panoModelGroup.children;b<x.length;b++){var w=x[b];w.visible=w===A.panoModel||w===v.panoModel}A.panoModel&&(A.panoModel.material.uniforms.opacity.value=1-y,A.panoModel.material.depthTest=0!==y),v.panoModel&&(v.panoModel.material.uniforms.opacity.value=y,v.panoModel.material.depthTest=1!==y),v.panoModel&&(y<1?A.panoModel&&(s.pano0={map:A.panoModel.material.uniforms.panoMap.value,luminanceMap:null,matrix:A.matrix}):s.pano0={map:v.panoModel.material.uniforms.panoMap.value,luminanceMap:null,matrix:v.matrix},s.pano1={map:v.panoModel.material.uniforms.panoMap.value,luminanceMap:null,matrix:v.matrix}),h=s.useBlackTransition="instant"===v.effect||"montage"===v.effect,"fade"!==v.effect&&"montage"!==v.effect||(s.pano0&&(s.pano0={map:s.pano0.map,luminanceMap:null,matrix:A.matrix.clone().setPosition(v.position)}),m.copy(g)),l.distance=this.locationMotion.value.distance,l.offset=new n.Vector3(m.x+(g.x-m.x)*y,m.y+(g.y-m.y)*y,m.z+(g.z-m.z)*y);for(var M=[],C=[],E=0,I=this.locationMotion.keyframes;E<I.length;E++){var S=I[E],B=S.key,T=S.progress;void 0!==B&&(M.push(B),T>=this.locationMotion.progress&&C.push(B))}for(var P=0,R=Object.keys(this.panoResources);P<R.length;P++){var k=R[P];if(!(C.indexOf(k)>=0)){var Q=this.panoResources[k];if(Q.panoModel){if(Q.panoModel.material.uniforms.panoMap.value===(null===(i=s.pano0)||void 0===i?void 0:i.map))continue;if(Q.panoModel.material.uniforms.panoMap.value===(null===(r=s.pano1)||void 0===r?void 0:r.map))continue;this.panoModelGroup.remove(Q.panoModel),Q.panoModel.material.uniforms.panoMap.value.dispose(),Q.panoModel.dispose(),delete Q.panoModel}M.indexOf(k)>=0||delete this.panoResources[k]}}A.workCode===v.workCode?this.currentPanoIndex=y<.5?A.panoIndex:v.panoIndex:this.currentPanoIndex=v.panoIndex,this.emit("movingToPano",u.panoIndex,c.panoIndex,this.locationMotion.progress)}!1===this.cameraMotion.ended&&(this.cameraMotion.update(e),l.longitude=this.cameraMotion.value.longitude,l.latitude=this.cameraMotion.value.latitude,l.fov=this.cameraMotion.value.fov),!1===Ur(s)&&this.model.setMaterial(s);var D=!1;if(!1===Ur(l)&&(this.setCamera(l),D=!0),this.currentPanoIndex!==a&&(this.updatePanoMeshesVisible(),D=!0),D)if(W=this.work.observers[this.currentPanoIndex]){var F=Qt(this.camera.pose).normalize(),L=new n.Raycaster(W.position,F);this.forwardPanoIndex=this.getForwardPanoIndexOrNot(L)}if(this.camera.pose.distance>.1||h){var O=this.work.observers[this.currentPanoIndex];if(O)for(var N=0,V=H=O.visibleNodes.concat(this.currentPanoIndex);N<V.length;N++){var U=V[N];(G=this.panoMeshes[U])&&G.setOpacity(0)}}else{var z=this.work.observers[this.currentPanoIndex];if(z){var q=Vr(z.visibleNodes,(function(e){return z.standingPosition.distanceTo(o.work.observers[e].standingPosition)}),!0)[1];q=Kn(q,2.5,1/0);for(var H=z.visibleNodes.concat(this.currentPanoIndex),_=this.camera.getDirection(new n.Vector3),K=0,j=H;K<j.length;K++){U=j[K];var G,W=this.work.observers[U];if(G=this.panoMeshes[U])if(W.loadable||W.active){var X=G.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);G.setCurrent(!G.loading&&0===G.progress&&this.forwardPanoIndex===U),G.setOpacity(X<.01?0:Kn(q/X*1.2,.65,.98));var Y=this.camera.position.clone().setY(G.position.y);F=(new n.Vector3).copy(G.position).sub(Y).normalize();if(U===this.currentPanoIndex){var Z=Kn((.5-Y.distanceTo(G.position))/.5,0,1);F.multiplyScalar(1-Z).add(_.clone().multiplyScalar(Z))}F.length()>0&&G.quaternion.setFromEuler(new n.Euler(0,Math.atan2(F.x,F.z),0)),G.updateTime&&G.updateTime(e,t)}else G.setOpacity(0)}}}}},t.prototype.getTargetPose=function(){var e=this.cameraMotion.getKeyFrameSegment(ue())[1],t=this.locationMotion.getKeyFrameSegment(ue())[1],i=this.panoResourceFromLocationMotionKeyframe(t),n=this.work.observers[i.panoIndex];return{longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,offset:n?n.position.clone():this.camera.position.clone(),distance:0}},t.prototype.moveToPano=function(e,t,i){var r,o=this;void 0===t&&(t={});var a=this.work.observers[e].images.depth,s=ie({key:"pano.".concat(e)},ci(this.imageOptions,["format","size","quality","sharpen","mappings"])),l=this.imageOptions.transform,c=this.work.observers[e].images,u=this.work.observers[e],h=u.position,d=u.quaternion,p=(new n.Matrix4).compose(h,d,new n.Vector3(-1,1,1)),f="pano:"+so(c);if(this.pendingTextureTask){if(this.pendingTextureTask.hash===f)return;var A=this.pendingTextureTask.panoIndex;null===(r=this.panoMeshes[A])||void 0===r||r.setProgress(0),this.emit("textureAbort",A,this.work.observers[A]),this.pendingTextureTask.onError(new Error("texture aborted"))}this.pending=!0,this.pendingTextureTask={panoIndex:e,hash:f,onLoad:function(n){o.pending=!1,o.destroyed?n.body.dispose():(n.body.name=f,o.emit("panoLoaded",e),o.doMoveToPano(e,n.body,t,i))},onError:function(i){o.pending=!1,t.moveCancelCallback&&t.moveCancelCallback(),o.emit("panoLoadError",i,e),o.emit("moveToPanoCanceled",e)}};var v=this.panoMeshes[e];v&&v.tap&&v.tap(),this.depthTextureLoader.load(a,c,{transform:l,options:s},h,p,(function(t){var i,n;(null===(i=o.pendingTextureTask)||void 0===i?void 0:i.hash)===f?(o.pendingTextureTask.onLoad(t),null===(n=o.panoMeshes[e])||void 0===n||n.setProgress(0),delete o.pendingTextureTask,o.emit("textureLoaded",e,o.work.observers[e],t.meta)):t.body.dispose()}),(function(t){var i,n;(null===(i=o.pendingTextureTask)||void 0===i?void 0:i.hash)===f&&(o.pendingTextureTask.onError(t),null===(n=o.panoMeshes[e])||void 0===n||n.setProgress(0),delete o.pendingTextureTask,o.emit("textureError",t,e,o.work.observers[e]),o.emit("error",t))}),(function(t){var i,n;o.emit("textureLoading",t,e,o.work.observers[e]),(null===(i=o.pendingTextureTask)||void 0===i?void 0:i.hash)===f&&(null===(n=o.panoMeshes[e])||void 0===n||n.setProgress(t))}),this.renderer),this.emit("textureStartLoad",e,this.work.observers[e])},t.prototype.initAnimation=function(e,t,i,n){var r,o,a,s=this;if(!this.destroyed){var l=!1;this.pending=!1,this.userAction=n,this.moveToPano(e,{longitude:null!==(r=t.longitude)&&void 0!==r?r:this.defaultLongitude,latitude:Kn(null!==(o=t.latitude)&&void 0!==o?o:this.defaultLatitude,this.minLatitude,this.maxLatitude),fov:Kn(null!==(a=t.fov)&&void 0!==a?a:this.defaultFov,this.minFov,this.maxFov),duration:i,moveStartCallback:function(e,t){l=!0,s.emit("initAnimationWillStart",e,t,s.userAction)},moveEndCallback:function(e,t){s.emit("initAnimationEnded",e,t,s.userAction)},moveCancelCallback:function(){var e=zr(s.camera.pose);!1===l&&s.emit("initAnimationWillStart",s.currentPanoIndex,e,s.userAction),s.emit("initAnimationEnded",s.currentPanoIndex,e,s.userAction)}},n)}},t.prototype.panoResourceFromLocationMotionKeyframe=function(e){return this.panoResources[e.key]},t.prototype.locationMotionKeyframesLength=function(e){for(var t=0,i=1;i<e.length;i++){var n=this.panoResourceFromLocationMotionKeyframe(e[i-1]).position,r=this.panoResourceFromLocationMotionKeyframe(e[i]).position;t+=n.distanceTo(r)*(e[i].value.count-e[i-1].value.count)}return t},t.prototype.updatePanoMeshesVisible=function(){for(var e=this.work.observers[this.currentPanoIndex],t=(e?e.visibleNodes:[]).concat(this.currentPanoIndex),i=0,n=this.work.observers;i<n.length;i++){var r=n[i],o=this.panoMeshes[r.panoIndex];o&&(t.indexOf(r.panoIndex)>=0?o.parent!==this.helper&&this.helper.add(o):o.parent===this.helper&&this.helper.remove(o))}},t.prototype.updatePanoMeshes=function(){for(var e=this,t={},i=0,n=this.panoMeshes;i<n.length;i++){t[(p=n[i]).name]=p}this.panoMeshes.length=0;for(var r=1,o={},a=function(t){var i=Vr(t.accessibleNodes,(function(i){return Kn(e.work.observers[i].standingPosition.distanceTo(t.standingPosition),1,1/0)}),!0),n=i[1];void 0===o[t.panoIndex]&&(o[t.panoIndex]=n)},s=0,l=this.work.observers;s<l.length;s++){a(d=l[s])}var c=Object.keys(o).map((function(e){return o[e]}));c.length&&(r=Kn(.6*(c.reduce((function(e,t){return e+t}),0)/c.length),1,3));for(var u=0;u<this.work.observers.length;u++){var h="panoCircle_".concat(this.work.workCode,"_").concat(u),d=this.work.observers[u],p=void 0;t[h]?(!0===(p=t[h]).loading&&!1===d.loadable&&p.setLoading(!1),delete t[h]):(p=this.panoCircleMeshCreator(u)).name=h,p.scale.set(r,1,r),p.position.copy(d.standingPosition),this.panoMeshes[u]=p}for(var f=0,A=Object.keys(t);f<A.length;f++){var v=A[f];this.helper.remove(t[v]),t[v].dispose(),delete t[v]}this.updatePanoMeshesVisible()},t.prototype.doMoveToPano=function(e,t,i,r){var o,a,s,l,c=this;void 0===i&&(i={}),this.userAction=r;var u=ue(),h=In(),d=this.work.observers[e],p=this.panoResources[h]={panoIndex:e,workCode:this.work.workCode,effect:null!==(o=i.effect)&&void 0!==o?o:"fly",panoModel:t,matrix:(new n.Matrix4).compose(d.position,d.quaternion,ya),position:d.position.clone()};t.visible=!1,t.renderOrder=-1,this.panoModelGroup.add(t);var f,A,v;if(this.locationMotion.ended){var m=this.locationMotion.getKeyFrameSegment(u);m[0];var g=m[1],y=this.locationMotion.value,b=this.panoResourceFromLocationMotionKeyframe(g).position,x=p.position;f=Math.max(b.distanceTo(x),1),A=[{key:g.key,progress:0,value:ie(ie({},y),{count:0})},{key:h,progress:1,value:{distance:0,perspToOrtho:0,modelAlpha:0,orthoDistance:1,count:1}}],v=0}else{var w=this.locationMotion.getKeyFrameSegment(u),M=w[0],C=(g=w[1],y=this.locationMotion.value,this.panoResourceFromLocationMotionKeyframe(M).position),E=(b=this.panoResourceFromLocationMotionKeyframe(g).position,x=p.position,g.value.count-y.count),I=Math.max(C.distanceTo(b),1)*E;f=I+Math.max(b.distanceTo(x),1),A=[{key:M.key,progress:0,value:ie({},y)},{key:g.key,progress:I/f,value:g.value},{key:h,progress:1,value:{count:g.value.count+1,distance:0,perspToOrtho:0,orthoDistance:1,modelAlpha:0}}];var S=this.locationMotionKeyframesLength(this.locationMotion.keyframes),B=this.locationMotionKeyframesLength(A);v=0===S||0===S?0:this.locationMotion.getProgressVelocity(u)*S/B}var T=this.calculateMovingDuration(i.duration,"fade"===i.effect||"montage"===i.effect?0:f),P={longitude:i.longitude,latitude:i.latitude,fov:i.fov},R={longitude:null!==(a=P.longitude)&&void 0!==a?a:this.camera.pose.longitude,latitude:null!==(s=P.latitude)&&void 0!==s?s:this.camera.pose.latitude,fov:null!==(l=P.fov)&&void 0!==l?l:this.camera.pose.fov,offset:d.position.clone(),distance:this.camera.pose.distance};this.emit("moveToPano",e,this.userAction),i.moveStartCallback&&i.moveStartCallback(e,R),this.emit("panoWillArrive",e,R,this.userAction),this.cameraMotion.set(P,T).catch(le),this.locationMotion.setKeyframes(A,T,v).then((function(){var t={longitude:c.camera.pose.longitude,latitude:c.camera.pose.latitude,fov:c.camera.pose.fov,offset:c.camera.pose.offset.clone(),distance:c.camera.pose.distance};i.moveEndCallback&&i.moveEndCallback(e,t),c.emit("panoArrived",e,t,r)}),(function(){i.moveCancelCallback&&i.moveCancelCallback(),c.emit("moveToPanoCanceled",e)}))},t.prototype.getForwardPanoIndexOrNot=function(e){var t=this,i=this.camera.getDirection(new n.Vector3),r=this.camera.position.clone(),o=this.work.observers[this.currentPanoIndex];if(!o)return null;var a=o.accessibleNodes.filter((function(e){if(e===t.currentPanoIndex)return!1;var i=t.work.observers[e],o=i.standingPosition.clone().sub(r);return 0!==o.length()&&(!(o.angleTo(new n.Vector3(0,-1,0))<Math.PI/12)&&(i.loadable||i.active))})),s=(e?e.ray.direction.clone():i.clone()).setY(0);if(0===s.length())return null;for(var l=a.slice().sort((function(e,i){var n=t.work.observers[e].position.clone().setY(r.y),o=t.work.observers[i].position.clone().setY(r.y);return n.distanceTo(r)-o.distanceTo(r)})),c=0,u=[Math.PI/8,Math.PI/6,Math.PI/4,Math.PI/3];c<u.length;c++)for(var h=u[c],d=0,p=l;d<p.length;d++){var f=p[d],A=this.work.observers[f].position.clone().setY(r.y).sub(r);if(0!==A.length()&&s.angleTo(A)<h)return f}return null},t.prototype.onTapGesture=function(e){var t=this,i=e.pointers.map((function(e){return ci(e,["x","y"])}));if(!this.emit("wantsGesture","tap",i,!0)){var r=this.relativeClientPosition(e.center),o=new n.Raycaster;if(o.setFromCamera(r,this.camera),!this.emit("wantsTapGesture",o,r,!0)){this.emit("gesture","tap",i,!0),this.emit("tapGesture",o,r,!0),this.interiaMovement=!1;var a=this.camera.getDirection(new n.Vector3).setY(0),s=null,l=this.work.observers[this.currentPanoIndex];if(l){var c=l.accessibleNodes.filter((function(e){if(e===t.currentPanoIndex)return!1;var i=t.work.observers[e];return!(i.position.distanceTo(t.camera.position)>t.maxAccessibleDistance)&&(i.loadable||i.active)})),u=o.intersectObject(this.boundingMesh,!0)[0];if(u){var h=Vr(c,(function(e){var i=t.work.observers[e].standingPosition.clone();return i.clone().sub(t.camera.position).setY(0).angleTo(a)>Math.PI/2?1/0:i.distanceTo(u.point)}),!0),d=h[0];h[1]<this.panoTapTriggerRadius&&(s=d)}Un(s)&&(s=this.getForwardPanoIndexOrNot(o));for(var p=0,f=this.locationMotion.keyframes;p<f.length;p++){var A=f[p],v=this.panoResourceFromLocationMotionKeyframe(A);if(!(A.progress<this.locationMotion.progress)&&v.panoIndex===s){s=null;break}}if(this.emit("panoSelected",s),Un(s))!0===this.locationMotion.ended&&this.cameraBounce();else{var m=this.work.observers[s];if(m.active){for(var g={},y=Math.PI/6,b=Math.PI/12,x=new n.Vector3(0,1,0),w=m.position.clone().setY(0).sub(l.position.clone().setY(0)).normalize(),M=w.clone().applyAxisAngle(x,y),C=w.clone().applyAxisAngle(x,-y),E=[],I=[],S=[],B=0,T=m.accessibleNodes;B<T.length;B++){if((d=T[B])!==this.currentPanoIndex&&d!==s){var P=this.work.observers[d].position.clone().sub(m.position).setY(0);w.angleTo(P)<y?S.push(P):M.angleTo(P)<y?E.push(P):C.angleTo(P)<y&&I.push(P)}}var R=(S.length>0?S:ne(ne([],E,!0),I,!0)).slice().sort((function(e,t){return e.angleTo(w)-t.angleTo(w)}))[0];R&&R.angleTo(a)>b&&(g.longitude=Math.atan2(-R.x,-R.z)),this.cameraMotion.value.latitude<-Math.PI/4&&(g.latitude=Kn(0,this.minLatitude,this.maxLatitude)),this.emit("wantsMoveToPano",s,g,!0)}else this.panoMeshes[s]&&(this.panoMeshes[s].setDisabled(!1),this.panoMeshes[s].setLoading(!0))}}}}},t}(co);function xa(e,t){var i=new n.Vector3;return i.setFromMatrixColumn(t,0),i.multiplyScalar(-e),i}function wa(e,t,i){var r=new n.Vector3;return r.setFromMatrixColumn(i,0),r.crossVectors(t,r),r.multiplyScalar(e),r}var Ma=function(e){function t(i){var n,r,o=this,a=t.parseArgs(i);return(o=e.call(this,a)||this).currentPanoIndex=a.initial[0],o.defaultLongitude=a.defaultLongitude,o.defaultLatitude=a.defaultLatitude,o.defaultDistance=a.defaultDistance,o.maxLatitude=a.maxLatitude,o.minLatitude=a.minLatitude,o.maxDistance=a.maxDistance,o.minDistance=a.minDistance,o.locationMotion=new ur({x:o.camera.pose.offset.x,y:o.camera.pose.offset.y,z:o.camera.pose.offset.z,distance:o.camera.pose.distance,modelAlpha:null!==(r=null===(n=o.model.getMaterial())||void 0===n?void 0:n.modelAlpha)&&void 0!==r?r:0,perspToOrtho:o.camera.perspToOrtho.x,orthoDistance:o.camera.orthoDistance}),o}return te(t,e),t.parseArgs=function(t){var i,n,r,o,a,s,l,c=e.parseArgs.call(this,t);return ie(ie({},c),{defaultLongitude:null!==(i=t.defaultLongitude)&&void 0!==i?i:Math.PI/4,defaultLatitude:null!==(n=t.defaultLatitude)&&void 0!==n?n:Math.PI/4,defaultDistance:null!==(r=t.defaultDistance)&&void 0!==r?r:100,maxLatitude:null!==(o=t.maxLatitude)&&void 0!==o?o:+Math.PI/2,minLatitude:null!==(a=t.minLatitude)&&void 0!==a?a:0,maxDistance:null!==(s=t.maxDistance)&&void 0!==s?s:100,minDistance:null!==(l=t.minDistance)&&void 0!==l?l:2})},t.distanceFromModel=function(e,t,i){var n=e.bounding,r=Math.pow(Math.pow(n.max.x-n.min.x+1,2)+Math.pow(n.max.y-n.min.y+1,2)+Math.pow(n.max.z-n.min.z+1,2),.5),o=r/2/Math.tan(Math.PI*t/360);return i<1&&(o/=i),isNaN(o)?r:o},t.initAnimationEndPose=function(e){var i,n,r,o,a=this.parseArgs(e),s=e.initial[0],l=e.initial[1];return{longitude:null!==(i=l.longitude)&&void 0!==i?i:a.defaultLongitude,latitude:Kn(null!==(n=l.latitude)&&void 0!==n?n:a.defaultLatitude,a.minLatitude,a.maxLatitude),fov:90,offset:null!==(r=l.offset)&&void 0!==r?r:a.work.observers[s].position.clone(),distance:null!==(o=l.distance)&&void 0!==o?o:t.distanceFromModel(a.model,90,a.camera.aspect)}},t.prototype.destroy=function(){e.prototype.destroy.call(this),this.model.enableTiles=!1,this.locationMotion.dispose(),this.mouseWheelState&&clearTimeout(this.mouseWheelState.timer),delete this.mouseWheelState,delete this.panState},t.prototype.isReady=function(){return!1!==this.locationMotion.ended&&e.prototype.isReady.call(this)},t.prototype.updateWork=function(e,t,i,n,r){return this.work=e,this.updateCamera(i,n,r),!0},t.prototype.updateModel=function(t){e.prototype.updateModel.call(this,t);var i=t.bounding.getCenter(new n.Vector3);this.locationMotion.set({x:i.x,y:i.y,z:i.z},0).catch(le),this.model.enableTiles=!0},t.prototype.updateTime=function(e,t){if(!this.destroyed){var i={},r={};this.locationMotion.ended||(this.locationMotion.update(e),i.modelAlpha=this.locationMotion.value.modelAlpha,this.camera.perspToOrtho.setScalar(Kn(this.locationMotion.value.perspToOrtho,0,1)),this.camera.orthoDistance=this.locationMotion.value.orthoDistance,r.distance=this.locationMotion.value.distance,r.offset=new n.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z)),this.cameraMotion.ended||(this.cameraMotion.update(e),r.longitude=this.cameraMotion.value.longitude,r.latitude=this.cameraMotion.value.latitude,r.fov=this.cameraMotion.value.fov),Ur(i)||this.model.setMaterial(i),Ur(r)||this.setCamera(r)}},t.prototype.setCamera=function(t){e.prototype.setCamera.call(this,t);var i=this.camera.pose.offset.clone();if(this.model.bvhs.loaded){var r=new n.Raycaster(this.camera.position.clone(),this.camera.getDirection(new n.Vector3)),o=this.model.intersectRaycaster(r)[0];o&&i.copy(o.point)}var a=Vr(this.work.observers,(function(e){return e.position.distanceTo(i)})),s=this.work.observers.indexOf(a);s!==this.currentPanoIndex&&(this.emit("moveToPano",s,this.userAction),this.emit("panoWillArrive",s,zr(this.camera.pose),this.userAction),this.currentPanoIndex=s,this.emit("panoArrived",s,zr(this.camera.pose),this.userAction))},t.prototype.getTargetPose=function(){var e=this.cameraMotion.getKeyFrameSegment(ue())[1],t=this.locationMotion.getKeyFrameSegment(ue())[1];return{longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,distance:t.value.distance,offset:new n.Vector3(t.value.x,t.value.y,t.value.z)}},t.prototype.initAnimation=function(e,i,r,o){var a,s,l,c,u=this;if(!this.destroyed){this.pending=!1,this.userAction=o;var h={longitude:null!==(a=i.longitude)&&void 0!==a?a:this.defaultLongitude,latitude:Kn(null!==(s=i.latitude)&&void 0!==s?s:this.defaultLatitude,this.minLatitude,this.maxLatitude),fov:90,offset:null!==(l=i.offset)&&void 0!==l?l:this.model.bounding.getCenter(new n.Vector3),distance:null!==(c=i.distance)&&void 0!==c?c:t.distanceFromModel(this.model,90,this.camera.aspect)},d=ci(h,["longitude","latitude","fov"]),p={x:h.offset.x,y:h.offset.y,z:h.offset.z,distance:h.distance,modelAlpha:1,perspToOrtho:0,orthoDistance:h.distance};this.emit("initAnimationWillStart",e,h,this.userAction),this.cameraMotion.set(d,r).catch(le),this.locationMotion.set(p,r).then((function(){u.emit("initAnimationEnded",e,h,u.userAction)}),(function(t){var i=zr(u.camera.pose);u.emit("initAnimationEnded",e,i,u.userAction)})).then((function(){u.model.enableTiles=!0}))}},t.prototype.getForwardPanoIndexOrNot=function(e){var t=this.work.observers.filter((function(e){return e.active})),i=this.model.intersectRaycaster(e)[0];if(!i)return null;var n=Vr(t,(function(e){return e.standingPosition.distanceTo(i.point)}),!0),r=n[0];return n[1]<5?this.work.observers.indexOf(r):null},t.prototype.coordinatesForOffset=function(e){var t=this.cameraMotion.value.fov,i=this.camera.aspect,r=this.renderer.getSize(new n.Vector2);return{longitude:2*e.x/(r.x*this.scissor.width)*t/95*i,latitude:-2*e.y/(r.y*this.scissor.height)*t/95}},t.prototype.onPanGesture=function(e){var t=this.panState,i=e.pointers.length;if(e.isFinal?delete this.panState:this.panState={pointerLength:i,x:e.center.x,y:e.center.y},void 0!==t&&t.pointerLength===i){var r=e.pointers.map((function(e){return ci(e,["x","y"])}));if(!this.emit("wantsGesture","pan",r,e.isFinal))if("mouse"===e.pointerType&&2===e.srcEvent.buttons){var o={x:e.center.x-t.x,y:e.center.y-t.y},a=new n.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),s=this.model.bounding,l=s.getCenter(new n.Vector3),c={x:(s.max.x-s.min.x)/90*this.cameraMotion.value.fov,y:(s.max.y-s.min.y)/90*this.cameraMotion.value.fov,z:(s.max.z-s.min.z)/90*this.cameraMotion.value.fov},u=(this.camera.position.y-s.min.y)*Math.tan(this.camera.fov/2*Math.PI/180),h=this.renderer.getSize(new n.Vector2);a.add(xa(2*o.x*u/h.y,this.camera.matrix)),a.add(wa(2*o.y*u/h.y,this.camera.up,this.camera.matrix)),a.x=Kn(a.x,l.x-c.x,l.x+c.x),a.z=Kn(a.z,l.z-c.z,l.z+c.z);var d={longitude:0,latitude:Math.PI/2,fov:this.cameraMotion.value.fov,offset:a,distance:this.locationMotion.value.distance};if(this.emit("wantsPanGesture",d,e.isFinal))return;this.emit("gesture","pan",r,e.isFinal),this.emit("panGesture",d,e.isFinal),this.userAction=!0,this.locationMotion.set({x:a.x,y:a.y,z:a.z},0).catch(le)}else{a={x:e.center.x-t.x,y:e.center.y-t.y};var p=this.coordinatesForOffset(a),f=Rr(this.cameraMotion.value.longitude+-1*p.longitude),A=Kn(this.cameraMotion.value.latitude+-1*p.latitude,this.minLatitude,this.maxLatitude);this.camera.aspect<1&&Math.abs(e.overallVelocityX)>.2&&Math.atan2(Math.abs(e.overallVelocityY),Math.abs(e.overallVelocityX))<Math.PI/6.923&&(A=this.cameraMotion.value.latitude);d={longitude:f,latitude:A,fov:this.cameraMotion.value.fov,offset:this.camera.pose.offset.clone(),distance:this.camera.pose.distance};if(this.emit("wantsPanGesture",d,e.isFinal))return;this.emit("gesture","pan",r,e.isFinal),this.emit("panGesture",d,e.isFinal),this.userAction=!0,this.interiaMovement=!1;var v={longitude:d.longitude,latitude:d.latitude,fov:d.fov};if(this.cameraMotion.set(v,0).catch(le),e.isFinal)this.emit("wantsInteriaPan",d)||(this.interiaMovement=!0,e.velocityX,e.velocityY)}}},t.prototype.onPinchGesture=function(e){var t=this.pinchState||{},i=t.distance;t.offsetY;var r=!1;if("pinchstart"!==e.type){if("pinchend"===e.type&&(r=!0,delete this.pinchState),void 0!==i){this.pinchState={distance:i};var o=e.pointers.map((function(e){return ci(e,["x","y"])}));if(this.emit("wantsGesture","pinch",o,r))return;var a=Kn(i/e.scale,this.minDistance,this.maxDistance);if(this.emit("wantsPinchGesture",e.scale,this.camera.pose.fov,r))return;this.emit("gesture","pinch",o,r),this.emit("pinchGesture",e.scale,this.camera.pose.fov,r),this.userAction=!0,this.locationMotion.set({distance:a},0).catch(le)}var s=this.panState,l=e.pointers.length;if(e.isFinal?delete this.panState:this.panState={pointerLength:l,x:e.center.x,y:e.center.y},void 0!==s&&s.pointerLength===l){var c=e.pointers.map((function(e){return ci(e,["x","y"])}));if(!this.emit("wantsGesture","pinch",c,r)){var u=e.pointers.map((function(e){return ci(e,["x","y"])}));if(!this.emit("wantsGesture","pinch",u,r)){var h={x:e.center.x-s.x,y:e.center.y-s.y},d=new n.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),p=this.model.bounding,f=p.getCenter(new n.Vector3),A={x:(p.max.x-p.min.x)/90*this.cameraMotion.value.fov,y:(p.max.y-p.min.y)/90*this.cameraMotion.value.fov,z:(p.max.z-p.min.z)/90*this.cameraMotion.value.fov},v=(this.camera.position.y-p.min.y)*Math.tan(this.camera.fov/2*Math.PI/180),m=this.renderer.getSize(new n.Vector2);d.add(xa(2*h.x*v/m.y,this.camera.matrix)),d.add(wa(2*h.y*v/m.y,this.camera.up,this.camera.matrix)),d.x=Kn(d.x,f.x-A.x,f.x+A.x),d.z=Kn(d.z,f.z-A.z,f.z+A.z);var g={longitude:0,latitude:Math.PI/2,fov:this.cameraMotion.value.fov,offset:d,distance:this.locationMotion.value.distance};this.emit("wantsPanGesture",g,e.isFinal)||(this.emit("gesture","pan",u,e.isFinal),this.emit("panGesture",g,e.isFinal),this.userAction=!0,this.locationMotion.set({x:d.x,y:d.y,z:d.z},0).catch(le))}}}}else this.pinchState={distance:this.locationMotion.value.distance}},t.prototype.onMouseWheel=function(e){var t=this,i=(Math.abs(e.deltaY)>Math.abs(e.deltaX)?e.deltaY:e.deltaX)/-60,n=[{x:e.clientX,y:e.clientY,delta:i}];if(!this.emit("wantsGesture","mouseWheel",n,!1)){var r=Kn(this.locationMotion.value.distance-i/2,this.minDistance,this.maxDistance);this.emit("wantsMouseWheel",i,this.camera.pose.fov,!1)||(this.emit("gesture","mouseWheel",n,!1),this.emit("mouseWheel",i,this.camera.pose.fov,!1),this.userAction=!0,this.locationMotion.set({distance:r},0).catch(le),this.mouseWheelState&&clearTimeout(this.mouseWheelState.timer),this.mouseWheelState={timer:window.setTimeout((function(){delete t.mouseWheelState;t.emit("wantsGesture","mouseWheel",n,!0)||t.emit("wantsMouseWheel",i,t.camera.pose.fov,!0)||(t.emit("gesture","mouseWheel",n,!0),t.emit("mouseWheel",0,t.camera.pose.fov,!0))}),200)})}},t.prototype.onTapGesture=function(e){var t=e.pointers.map((function(e){return ci(e,["x","y"])}));if(!this.emit("wantsGesture","tap",t,!0)){var i=this.relativeClientPosition(e.center),r=new n.Raycaster;if(r.setFromCamera(i,this.camera),!this.emit("wantsTapGesture",r,i,!0)){this.emit("gesture","tap",t,!0),this.emit("tapGesture",r,i,!0),this.interiaMovement=!1;var o=this.getForwardPanoIndexOrNot(r);if(!Un(o)){this.emit("panoSelected",o);var a={longitude:this.camera.pose.longitude,latitude:0};this.emit("wantsMoveToPano",o,a,!0)}}}},t.prototype.onPressGesture=function(e,t){var i,r,o=[e];if(this.emit("wantsGesture","press",o,t))return null===(i=this.pressState)||void 0===i||i.stop(),void delete this.pressState;var a=this.relativeClientPosition(e),s=new n.Raycaster;if(s.setFromCamera(a,this.camera),this.emit("wantsPressGesture",s,a,e.delta,t))return null===(r=this.pressState)||void 0===r||r.stop(),void delete this.pressState;this.emit("gesture","press",o,t),this.emit("pressGesture",s,a,e.delta,t)},t}(Jr),Ca={type:"move"},Ea=function(){function e(){this._targetRay=null,this._grip=null,this._hand=null,this._axes=[0,0]}return e.prototype.getHandSpace=function(){return null===this._hand&&(this._hand=new n.Group,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand},e.prototype.getTargetRaySpace=function(){return null===this._targetRay&&(this._targetRay=new n.Group,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new n.Vector3,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new n.Vector3),this._targetRay},e.prototype.getGripSpace=function(){return null===this._grip&&(this._grip=new n.Group,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new n.Vector3,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new n.Vector3),this._grip},e.prototype.dispatchEvent=function(e){return null!==this._targetRay&&this._targetRay.dispatchEvent(e),null!==this._grip&&this._grip.dispatchEvent(e),null!==this._hand&&this._hand.dispatchEvent(e),this},e.prototype.disconnect=function(e){return this.dispatchEvent({type:"disconnected",data:e}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this},e.prototype.getAxes=function(){return this._axes},e.prototype.update=function(e,t,i){var r=null,o=null,a=null,s=this._targetRay,l=this._grip,c=this._hand;if(e&&e.gamepad&&e.gamepad.axes&&(this._axes=[e.gamepad.axes[2],e.gamepad.axes[3]]),e&&"visible-blurred"!==t.session.visibilityState)if(null!==s&&null!==(r=t.getPose(e.targetRaySpace,i))&&(s.matrix.fromArray(r.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),r.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(r.linearVelocity)):s.hasLinearVelocity=!1,r.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(r.angularVelocity)):s.hasAngularVelocity=!1,this.dispatchEvent(Ca)),c&&e.hand){a=!0;for(var u=0,h=e.hand.values();u<h.length;u++){var d=h[u],p=t.getJointPose(d,i);if(void 0===c.joints[d.jointName]){var f=new n.Group;f.matrixAutoUpdate=!1,f.visible=!1,c.joints[d.jointName]=f,c.add(f)}var A=c.joints[d.jointName];null!==p&&(A.matrix.fromArray(p.transform.matrix),A.matrix.decompose(A.position,A.rotation,A.scale),A.jointRadius=p.radius),A.visible=null!==p}var v=c.joints["index-finger-tip"],m=c.joints["thumb-tip"],g=v.position.distanceTo(m.position);c.inputState.pinching&&g>.025?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&g<=.015&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else null!==l&&e.gripSpace&&null!==(o=t.getPose(e.gripSpace,i))&&(l.matrix.fromArray(o.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),o.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(o.linearVelocity)):l.hasLinearVelocity=!1,o.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(o.angularVelocity)):l.hasAngularVelocity=!1);return null!==s&&(s.visible=null!==r),null!==l&&(l.visible=null!==o),null!==c&&(c.visible=null!==a),this},e}(),Ia=function(e){function t(t,i,r){var o,a,s,l=this;return(l=e.call(this)||this).isPanorama=null===(o=null==r?void 0:r.isPanorama)||void 0===o||o,l.machineType=null!==(a=null==r?void 0:r.machineType)&&void 0!==a?a:"Pico",l.renderer=t,l.gl=i,l.enabled=!1,l.session=null,l.referenceSpaceType=null!==(s=null==r?void 0:r.referenceSpaceType)&&void 0!==s?s:"local-floor",l.referenceSpace=null,l.controllers=[new Ea,new Ea],l.inputSourcesMap=new Map,l.cameraVR=new n.ArrayCamera,l.cameraL=new n.PerspectiveCamera,l.cameraR=new n.PerspectiveCamera,l.cameraL.viewport=new n.Vector4,l.cameraR.viewport=new n.Vector4,l.cameraL.layers.enable(1),l.cameraR.layers.enable(2),l.cameraVR.layers.enable(1),l.cameraVR.layers.enable(2),l.isPresenting=!1,l.currentDepthNear=null,l.currentDepthFar=null,l.cameraLPos=new n.Vector3,l.cameraRPos=new n.Vector3,l}return te(t,e),t.prototype.getController=function(e){var t=this.controllers[e];return t||console.warn("no controller find"),t.getTargetRaySpace()},t.prototype.getCameras=function(){return{cameraL:this.cameraL,cameraR:this.cameraR,cameraVR:this.cameraVR}},t.prototype.updateCamera=function(e,t){null===t?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.getInverse(e.matrixWorld)},t.prototype.setProjectionFromUnion=function(e,t,i){this.cameraLPos.setFromMatrixPosition(t.matrixWorld),this.cameraRPos.setFromMatrixPosition(i.matrixWorld);var n=this.cameraLPos.distanceTo(this.cameraRPos),r=t.projectionMatrix.elements,o=i.projectionMatrix.elements,a=r[14]/(r[10]-1),s=r[14]/(r[10]+1),l=(r[9]+1)/r[5],c=(r[9]-1)/r[5],u=(r[8]-1)/r[0],h=(o[8]+1)/o[0],d=a*u,p=a*h,f=n/(-u+h),A=f*-u;t.matrixWorld.decompose(e.position,e.quaternion,e.scale),e.translateX(A),e.translateZ(f),e.matrixWorld.compose(e.position,e.quaternion,e.scale),e.matrixWorldInverse.getInverse(e.matrixWorld);var v=a+f,m=s+f,g=d-A,y=p+(n-A),b=l*s/m*v,x=c*s/m*v;e.projectionMatrix.makePerspective(g,y,b,x,v,m)},t.prototype.getCamera=function(e){this.cameraVR.near=this.cameraR.near=this.cameraL.near=e.near,this.cameraVR.far=this.cameraR.far=this.cameraL.far=e.far,!this.session||this.currentDepthNear===this.cameraVR.near&&this.currentDepthFar===this.cameraVR.far||(this.session.updateRenderState({depthNear:this.cameraVR.near,depthFar:this.cameraVR.far}),this.currentDepthNear=this.cameraVR.near,this.currentDepthFar=this.cameraVR.far);var t=e.parent,i=this.cameraVR.cameras;this.updateCamera(this.cameraVR,t);for(var n=0;n<i.length;n++)this.updateCamera(i[n],t);e.matrixWorld.copy(this.cameraVR.matrixWorld);for(var r=e.children,o=(n=0,r.length);n<o;n++)r[n].updateMatrixWorld(!0);return 2===i.length?this.setProjectionFromUnion(this.cameraVR,this.cameraL,this.cameraR):this.cameraVR.projectionMatrix.copy(this.cameraL.projectionMatrix),this.cameraVR},t.prototype.updateInputSources=function(e){if(this.session){for(var t=this.session.inputSources,i=0;i<this.controllers.length;i++)this.inputSourcesMap.set(t[i],this.controllers[i]);for(i=0;i<e.removed.length;i++){var n=e.removed[i];(r=this.inputSourcesMap.get(n))&&(r.dispatchEvent({type:"disconnected",data:n}),this.inputSourcesMap.delete(n))}for(i=0;i<e.added.length;i++){var r;n=e.added[i];(r=this.inputSourcesMap.get(n))&&r.dispatchEvent({type:"connected",data:n})}}else console.warn("session is lose!")},t.prototype.onSessionEvent=function(e){var t=this.inputSourcesMap.get(e.inputSource);t&&t.dispatchEvent({type:e.type})},t.prototype.onSessionEnd=function(){this.inputSourcesMap.forEach((function(e,t){e.disconnect(t)})),this.inputSourcesMap.clear(),this.renderer.setFramebuffer(null),this.renderer.setRenderTarget(this.renderer.getRenderTarget()),this.isPresenting=!1,this.session=null,ke.shared.setContext(null),this.emit("webXRSessionEnd")},t.prototype.onRequestReferenceSpace=function(e){this.referenceSpace=e,this.isPresenting=!0,this.emit("webXRSessionStart")},t.prototype.setSession=function(e){var t=this;if(this.session=e,this.session){this.session.addEventListener("select",(function(e){t.onSessionEvent(e)})),this.session.addEventListener("selectstart",(function(e){t.onSessionEvent(e)})),this.session.addEventListener("selectend",(function(e){t.onSessionEvent(e)})),this.session.addEventListener("squeeze",(function(e){t.onSessionEvent(e)})),this.session.addEventListener("squeezestart",(function(e){t.onSessionEvent(e)})),this.session.addEventListener("squeezeend",(function(e){t.onSessionEvent(e)})),this.session.addEventListener("end",(function(e){t.onSessionEnd()}));var i=this.gl.getContextAttributes();this.gl.makeXRCompatible().then((function(){var e={antialias:null==i?void 0:i.antialias,alpha:null==i?void 0:i.alpha,depth:null==i?void 0:i.depth,stencil:null==i?void 0:i.stencil,framebufferScaleFactor:1};if(t.session){switch(t.machineType){case"Pico":t.session.updateRenderState({baseLayer:new XRWebGLLayer(t.session,t.gl,e)});break;case"Oculus":t.session.updateRenderState({layers:[new XRWebGLLayer(t.session,t.gl,e)]});break;default:t.machineType}t.session.requestReferenceSpace(t.referenceSpaceType).then((function(e){t.onRequestReferenceSpace(e)})),t.session.addEventListener("inputsourceschange",(function(e){t.updateInputSources(e)}))}else console.error("session is lose while set session!")}))}},t}(se),Sa=["webXRSessionStart","webXRSessionEnd"],Ba=function(e){function t(){var t=e.call(this)||this;t.type="LineSegmentsGeometry";return t.setIndex([0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5]),t.setAttribute("position",new n.Float32BufferAttribute([-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],3)),t.setAttribute("uv",new n.Float32BufferAttribute([-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],2)),t}return te(t,e),t.prototype.applyMatrix4=function(e){var t=this.attributes.instanceStart,i=this.attributes.instanceEnd;return void 0!==t&&(t.applyMatrix4(e),i.applyMatrix4(e),t.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},t.prototype.setPositions=function(e){var t;t=e instanceof Float32Array?e:Array.isArray(e)?new Float32Array(e):new Float32Array;var i=new n.InstancedInterleavedBuffer(t,6,1);return this.setAttribute("instanceStart",new n.InterleavedBufferAttribute(i,3,0)),this.setAttribute("instanceEnd",new n.InterleavedBufferAttribute(i,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this},t.prototype.setColors=function(e){var t;t=e instanceof Float32Array?e:Array.isArray(e)?new Float32Array(e):new Float32Array;var i=new n.InstancedInterleavedBuffer(t,6,1);return this.setAttribute("instanceColorStart",new n.InterleavedBufferAttribute(i,3,0)),this.setAttribute("instanceColorEnd",new n.InterleavedBufferAttribute(i,3,3)),this},t.prototype.fromWireframeGeometry=function(e){return this.setPositions(e.attributes.position.array),this},t.prototype.fromEdgesGeometry=function(e){return this.setPositions(e.attributes.position.array),this},t.prototype.fromMesh=function(e){return this.fromWireframeGeometry(new n.WireframeGeometry(e.geometry)),this},t.prototype.fromLineSegments=function(e){var t=e.geometry;if(t instanceof n.Geometry){var i=(new n.BufferGeometry).fromGeometry(t);this.setPositions(i.attributes.position.array)}else t instanceof n.BufferGeometry&&this.setPositions(t.attributes.position.array);return this},t.prototype.computeBoundingBox=function(){null===this.boundingBox&&(this.boundingBox=new n.Box3);var e=this.attributes.instanceStart,t=this.attributes.instanceEnd;if(void 0!==e&&void 0!==t){var i=new n.Box3;this.boundingBox.setFromBufferAttribute(e),i.setFromBufferAttribute(t),this.boundingBox.union(i)}},t.prototype.computeBoundingSphere=function(){null===this.boundingSphere&&(this.boundingSphere=new n.Sphere),null===this.boundingBox&&this.computeBoundingBox();var e=this.attributes.instanceStart,t=this.attributes.instanceEnd;if(void 0!==e&&void 0!==t){var i=this.boundingSphere.center;this.boundingBox.getCenter(i);for(var r=0,o=new n.Vector3,a=0,s=e.count;a<s;a++)o.fromBufferAttribute(e,a),r=Math.max(r,i.distanceToSquared(o)),o.fromBufferAttribute(t,a),r=Math.max(r,i.distanceToSquared(o));this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}},t.prototype.toJSON=function(){},t}(n.InstancedBufferGeometry);Object.assign(Ba.prototype,{isLineSegmentsGeometry:!0});var Ta={uniforms:n.UniformsUtils.merge([n.UniformsLib.common,n.UniformsLib.fog,{linewidth:{value:1},resolution:{value:new n.Vector2(1,1)},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1},opacity:{value:1}}]),vertexShader:"\n\t\t#include <common>\n\t\t#include <color_pars_vertex>\n\t\t#include <fog_pars_vertex>\n\t\t#include <logdepthbuf_pars_vertex>\n\t\t#include <clipping_planes_pars_vertex>\n\n\t\tuniform float linewidth;\n\t\tuniform vec2 resolution;\n\n\t\tattribute vec3 instanceStart;\n\t\tattribute vec3 instanceEnd;\n\n\t\tattribute vec3 instanceColorStart;\n\t\tattribute vec3 instanceColorEnd;\n\n\t\tvarying vec2 vUv;\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashScale;\n\t\t\tattribute float instanceDistanceStart;\n\t\t\tattribute float instanceDistanceEnd;\n\t\t\tvarying float vLineDistance;\n\n\t\t#endif\n\n\t\tvoid trimSegment( const in vec4 start, inout vec4 end ) {\n\n\t\t\t// trim end segment so it terminates between the camera plane and the near plane\n\n\t\t\t// conservative estimate of the near plane\n\t\t\tfloat a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column\n\t\t\tfloat b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column\n\t\t\tfloat nearEstimate = - 0.5 * b / a;\n\n\t\t\tfloat alpha = ( nearEstimate - start.z ) / ( end.z - start.z );\n\n\t\t\tend.xyz = mix( start.xyz, end.xyz, alpha );\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\t#ifdef USE_COLOR\n\n\t\t\t\tvColor.xyz = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd;\n\n\t\t\t#endif\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tvLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd;\n\n\t\t\t#endif\n\n\t\t\tfloat aspect = resolution.x / resolution.y;\n\n\t\t\tvUv = uv;\n\n\t\t\t// camera space\n\t\t\tvec4 start = modelViewMatrix * vec4( instanceStart, 1.0 );\n\t\t\tvec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 );\n\n\t\t\t// special case for perspective projection, and segments that terminate either in, or behind, the camera plane\n\t\t\t// clearly the gpu firmware has a way of addressing this issue when projecting into ndc space\n\t\t\t// but we need to perform ndc-space calculations in the shader, so we must address this issue directly\n\t\t\t// perhaps there is a more elegant solution -- WestLangley\n\n\t\t\tbool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column\n\n\t\t\tif ( perspective ) {\n\n\t\t\t\tif ( start.z < 0.0 && end.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( start, end );\n\n\t\t\t\t} else if ( end.z < 0.0 && start.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( end, start );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// clip space\n\t\t\tvec4 clipStart = projectionMatrix * start;\n\t\t\tvec4 clipEnd = projectionMatrix * end;\n\n\t\t\t// ndc space\n\t\t\tvec2 ndcStart = clipStart.xy / clipStart.w;\n\t\t\tvec2 ndcEnd = clipEnd.xy / clipEnd.w;\n\n\t\t\t// direction\n\t\t\tvec2 dir = ndcEnd - ndcStart;\n\n\t\t\t// account for clip-space aspect ratio\n\t\t\tdir.x *= aspect;\n\t\t\tdir = normalize( dir );\n\n\t\t\t// perpendicular to dir\n\t\t\tvec2 offset = vec2( dir.y, - dir.x );\n\n\t\t\t// undo aspect ratio adjustment\n\t\t\tdir.x /= aspect;\n\t\t\toffset.x /= aspect;\n\n\t\t\t// sign flip\n\t\t\tif ( position.x < 0.0 ) offset *= - 1.0;\n\n\t\t\t// endcaps\n\t\t\tif ( position.y < 0.0 ) {\n\n\t\t\t\toffset += - dir;\n\n\t\t\t} else if ( position.y > 1.0 ) {\n\n\t\t\t\toffset += dir;\n\n\t\t\t}\n\n\t\t\t// adjust for linewidth\n\t\t\toffset *= linewidth;\n\n\t\t\t// adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ...\n\t\t\toffset /= resolution.y;\n\n\t\t\t// select end\n\t\t\tvec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd;\n\n\t\t\t// back to clip space\n\t\t\toffset *= clip.w;\n\n\t\t\tclip.xy += offset;\n\n\t\t\tgl_Position = clip;\n\n\t\t\tvec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation\n\n\t\t\t#include <logdepthbuf_vertex>\n\t\t\t#include <clipping_planes_vertex>\n\t\t\t#include <fog_vertex>\n\n\t\t}\n\t\t",fragmentShader:"\n\t\tuniform vec3 diffuse;\n\t\tuniform float opacity;\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashSize;\n\t\t\tuniform float gapSize;\n\n\t\t#endif\n\n\t\tvarying float vLineDistance;\n\n\t\t#include <common>\n\t\t#include <color_pars_fragment>\n\t\t#include <fog_pars_fragment>\n\t\t#include <logdepthbuf_pars_fragment>\n\t\t#include <clipping_planes_pars_fragment>\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\t#include <clipping_planes_fragment>\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tif ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps\n\n\t\t\t\tif ( mod( vLineDistance, dashSize + gapSize ) > dashSize ) discard; // todo - FIX\n\n\t\t\t#endif\n\n\t\t\tif ( abs( vUv.y ) > 1.0 ) {\n\n\t\t\t\tfloat a = vUv.x;\n\t\t\t\tfloat b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;\n\t\t\t\tfloat len2 = a * a + b * b;\n\n\t\t\t\tif ( len2 > 1.0 ) discard;\n\n\t\t\t}\n\n\t\t\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\t\t\t#include <logdepthbuf_fragment>\n\t\t\t#include <color_fragment>\n\n\t\t\tgl_FragColor = vec4( diffuseColor.rgb, diffuseColor.a );\n\n\t\t\t#include <tonemapping_fragment>\n\t\t\t#include <fog_fragment>\n\t\t\t#include <premultiplied_alpha_fragment>\n\n\t\t}\n\t\t"},Pa=function(e){function t(t){var i=e.call(this,{uniforms:n.UniformsUtils.clone(Ta.uniforms),vertexShader:Ta.vertexShader,fragmentShader:Ta.fragmentShader,clipping:!0})||this;return i.type="LineMaterial",i.dashed=!1,Object.defineProperties(i,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(e){this.uniforms.diffuse.value=e}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(e){this.uniforms.linewidth.value=e}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(e){this.uniforms.dashScale.value=e}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(e){this.uniforms.dashSize.value=e}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(e){this.uniforms.gapSize.value=e}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(e){this.uniforms.opacity.value=e}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(e){this.uniforms.resolution.value.copy(e)}}}),i.setValues(t),i}return te(t,e),t}(n.ShaderMaterial);Object.assign(Pa.prototype,{isLineMaterial:!0});var Ra=function(e){function t(t,i){var n=e.call(this)||this;return n.type="LineSegments2",n.geometry=void 0!==t?t:new Ba,n.material=void 0!==i?i:new Pa({color:16777215*Math.random()}),n}return te(t,e),t.prototype.computeLineDistances=function(){for(var e=this.geometry,t=e.attributes.instanceStart,i=e.attributes.instanceEnd,r=new Float32Array(2*t.count),o=new n.Vector3,a=new n.Vector3,s=0,l=0,c=t.count;s<c;s++,l+=2)o.fromBufferAttribute(t,s),a.fromBufferAttribute(i,s),r[l]=0===l?0:r[l-1],r[l+1]=r[l]+o.distanceTo(a);var u=new n.InstancedInterleavedBuffer(r,2,1);return e.setAttribute("instanceDistanceStart",new n.InterleavedBufferAttribute(u,1,0)),e.setAttribute("instanceDistanceEnd",new n.InterleavedBufferAttribute(u,1,1)),this},t.prototype.raycast=function(e,t){null===e.camera&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2.');var i=e.ray,r=e.camera,o=r.projectionMatrix,a=this.geometry,s=this.material,l=s.resolution,c=s.linewidth,u=a.attributes.instanceStart,h=a.attributes.instanceEnd,d=new n.Vector4,p=new n.Vector4,f=new n.Vector4,A=new n.Vector3,v=new n.Matrix4,m=new n.Line3,g=new n.Vector3;i.at(1,f),f.w=1,f.applyMatrix4(r.matrixWorldInverse),f.applyMatrix4(o),f.multiplyScalar(1/f.w),f.x*=l.x/2,f.y*=l.y/2,f.z=0,A.copy(f);var y=this.matrixWorld;v.multiplyMatrices(r.matrixWorldInverse,y);for(var b=0,x=u.count;b<x;b++){d.fromBufferAttribute(u,b),p.fromBufferAttribute(h,b),d.w=1,p.w=1,d.applyMatrix4(v),p.applyMatrix4(v),d.applyMatrix4(o),p.applyMatrix4(o),d.multiplyScalar(1/d.w),p.multiplyScalar(1/p.w);var w=d.z<-1&&p.z<-1,M=d.z>1&&p.z>1;if(!w&&!M){d.x*=l.x/2,d.y*=l.y/2,p.x*=l.x/2,p.y*=l.y/2,m.start.copy(d),m.start.z=0,m.end.copy(p),m.end.z=0;var C=m.closestPointToPointParameter(A,!0);m.at(C,g);var E=n.MathUtils.lerp(d.z,p.z,C),I=E>=-1&&E<=1,S=A.distanceTo(g)<.5*c;if(I&&S){m.start.fromBufferAttribute(u,b),m.end.fromBufferAttribute(h,b),m.start.applyMatrix4(y),m.end.applyMatrix4(y);var B=new n.Vector3,T=new n.Vector3;i.distanceSqToSegment(m.start,m.end,T,B),t.push({point:T,pointOnLine:B,distance:i.origin.distanceTo(T),object:this,faceIndex:b})}}}},t}(n.Mesh);Object.assign(Ra.prototype,{isLineSegments2:!0});var ka=function(e){function t(t,i){var n=e.call(this,t,i)||this;return n.type="Line2",n}return te(t,e),t}(Ra);Object.assign(ka.prototype,{isLine2:!0});var Qa=function(e){function t(){var t=e.call(this)||this;return t.type="LineGeometry",t}return te(t,e),t.prototype.setPositions=function(t){for(var i=t.length-3,n=new Float32Array(2*i),r=0;r<i;r+=3)n[2*r]=t[r],n[2*r+1]=t[r+1],n[2*r+2]=t[r+2],n[2*r+3]=t[r+3],n[2*r+4]=t[r+4],n[2*r+5]=t[r+5];return e.prototype.setPositions.call(this,n),this},t.prototype.setColors=function(t){for(var i=t.length-3,n=new Float32Array(2*i),r=0;r<i;r+=3)n[2*r]=t[r],n[2*r+1]=t[r+1],n[2*r+2]=t[r+2],n[2*r+3]=t[r+3],n[2*r+4]=t[r+4],n[2*r+5]=t[r+5];return e.prototype.setColors.call(this,n),this},t.prototype.fromLine=function(e){var t=e.geometry;if(t instanceof n.Geometry){var i=(new n.BufferGeometry).fromGeometry(t);this.setPositions(i.attributes.position.array)}else t instanceof n.BufferGeometry&&this.setPositions(t.attributes.position.array);return this},t.prototype.copy=function(){return this},t}(Ba);Object.assign(Qa.prototype,{isLineGeometry:!0});var Da=null,Fa=function(e){function t(t,i){void 0===t&&(t=new n.Vector3),void 0===i&&(i=new n.Vector3);var r=e.call(this)||this;r.type="FiveLine",r.needsRender=!0;var o=new Qa,a=new Pa({color:14467195,linewidth:2,dashScale:20,dashed:!1});r.line=new ka(o,a);var s=new n.BufferGeometry,l=new n.PointsMaterial({color:14467195,size:8,map:Da||(Da=(new n.TextureLoader).load("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sHDgwCEMBJZu0AAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAABM5JREFUWMO1V0tPG2cUPZ4Hxh6DazIOrjFNqJs0FIMqWFgWQkatsmvVbtggKlSVRVf5AWz4AWz4AUSKEChll19QJYSXkECuhFxsHjEhxCYm+DWGMZ5HF72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ukBHYCuKApisdhpMpnURFEU79y503TVyKenpzOTk5M7e3t7MQKPV0Zv1gNm+awB0MvlshqLxfLb29uyJElWURSbXC4XXyvqxcXFs6mpqeTc3Nzu3t7e3wQcA7BPZ8Cov1pNlJplmQtAG8MwHV6v95tAINA5MDBwPxAIuLu6upr8fr/VAN3c3JQjkcjZ+vp6fnl5+d2bN29SuVzuNYAEpf01CdRChUL+X1VskHACuA3Ay3Fcu9vt7nA6nZ7m5uYWQRCaNE3jVVW15PP580KhIGUymWw2m00DOAJwSP4WwPtq4LX2Ao6USxNlQyS/RcQcdLGwlNIz6vEMAaZpNzCk2Pll94LK/cDYimxERiBwG10sxjgvEZBE0UpE6vxj+0Ct5bTaXthgEhRmja8QWNkkPGsuIpfdjpkK+cZUWTC0KredVmtD/gdlSl6EG4AMvQAAAABJRU5ErkJggg==")),sizeAttenuation:!1,transparent:!0});return r.points=new n.Points(s,l),r.points.renderOrder=11,r.points.frustumCulled=!1,r.setPoints(t,i),r.add(r.line,r.points),r}return te(t,e),Object.defineProperty(t,"version",{get:function(){return"5.0.0-alpha.181"},enumerable:!1,configurable:!0}),t.prototype.setPoints=function(e,t){var i=[].concat(e.toArray(),t.toArray());this.points.geometry.setAttribute("position",new n.BufferAttribute(new Float32Array(i),3)),this.line.geometry.setPositions(i),this.line.computeLineDistances(),this.needsRender=!0},t.prototype.getPoints=function(){var e=this.points.geometry.attributes.position.array;return[new n.Vector3(e[0],e[1],e[2]),new n.Vector3(e[3],e[4],e[5])]},t.prototype.setMaterial=function(e){var t=this.line.material;for(var i in e)if(e.hasOwnProperty(i)){var n=e[i];"dashed"===i?(t.dashed=n,n?t.defines.USE_DASH="":delete t.defines.USE_DASH,t.needsUpdate=!0):t[i]=e[i]}this.needsRender=!0},t.prototype.setResolution=function(e,t){var i=this.line.material.resolution;i.x===e&&i.y===t||(i.set(e,t),this.needsRender=!0)},t}(n.Object3D);Object.assign(Fa.prototype,{isFiveLine:!0});var La=(new n.Matrix4).makeRotationAxis(new n.Vector3(0,1,0),Math.PI),Oa=new n.Vector3(-1,1,1),Na=function(e){function t(t){var i=e.call(this,t)||this;i.xrManager=new Ia(i.renderer,i.renderer.getContext()),i.xrControllerRay=new n.Raycaster,i.pointerLine=new Fa,i.scene.add(i.pointerLine),i.pointerLine.line.material.depthTest=!1,i.pointerLine.points.material instanceof Array?i.pointerLine.points.material.forEach((function(e){e.depthTest=!1})):i.pointerLine.points.material.depthTest=!1,i.pointerLine.setMaterial({color:new n.Vector3(1,1,1)}),i.panoResources={},i.panoResources[i.locationMotion.keyframes[0].key=i.locationMotion.keyframes[1].key=In()]={panoIndex:i.currentPanoIndex,workCode:i.work.workCode,leftPanoPicture:null,position:i.camera.pose.offset.clone(),effect:"fade"},i.parallaxCameraMatrixs=[];var r=ke.shared.getContext();if(!r)return console.error("获取session失败,请退出重试"),i;i.xrManager.setSession(r),i.on("webXRSelected",(function(e){"Select"===e&&i.checkSelectedPano()}));for(var o=function(e){a.xrManager.on(e,(function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];i.emit.apply(i,ne([e],t,!1))}))},a=this,s=0,l=Sa;s<l.length;s++){o(l[s])}return i.xrControllerState={axes:[{left:{isTap:!1,startTime:0},right:{isTap:!1,startTime:0}},{up:{isTap:!1,startTime:0},down:{isTap:!1,startTime:0}},{left:{isTap:!1,startTime:0},right:{isTap:!1,startTime:0}},{up:{isTap:!1,startTime:0},down:{isTap:!1,startTime:0}}],select:{startTime:0,istap:!1},squeeze:{startTime:0,istap:!1},leftButtonA:{startTime:0,istap:!1},leftButtonB:{startTime:0,istap:!1},rightButtonA:{startTime:0,istap:!1},rightButtonB:{startTime:0,istap:!1}},i}return te(t,e),t.parseArgs=function(t){var i=ie(ie({},t),{maxLatitude:Math.PI/2,minLatitude:-Math.PI/2});return e.parseArgs.call(this,i)},t.initAnimationEndPose=function(t){var i=this.parseArgs(t);return e.initAnimationEndPose.call(this,i)},t.prototype.moveToPano=function(e,t,i){var r,o,a,s,l=this,c=this.work.observers[e],u=this.imageOptions.size;if(void 0===u&&c){var h=c.images.up.match(/\/cube_(\d+)\//);h&&(u=Number(h[1]))}void 0===u&&(u=2048);var d=this.imageOptions.transform,p=function(e,t){return function(e,t){if(!t)return e;var i=e.match(/\d+_[a-z].png/);return e.substring(0,i.index)+t+"/"+e.substring(i.index)}(Oe(e,d,t))},f=ie({key:"pano.".concat(e)},ci(this.imageOptions,["format","size","quality"])),A=c.images,v=null!==(o=null===(r=c.images.tiles)||void 0===r?void 0:r.filter((function(e){return e.size>u})))&&void 0!==o?o:null,m="pano:"+so([A,f,d]);if(this.pendingTextureTask){if(this.pendingTextureTask.hash===m)return;var g=this.pendingTextureTask.panoIndex;null===(a=this.panoMeshes[g])||void 0===a||a.setProgress(0),this.emit("textureAbort",g,c),this.pendingTextureTask.onError(new Error("texture aborted"))}var y,b=this.model.getMaterial()||{},x=b.pano0,w=b.pano1;if((null==x?void 0:x.map.name)===m?y=x:(null==w?void 0:w.map.name)===m&&(y=w),y){var M={panoIndex:e,workCode:this.work.workCode,effect:null!==(s=t.effect)&&void 0!==s?s:"fade",leftPanoPicture:{map:y.map,luminanceMap:y.luminanceMap,matrix:(new n.Matrix4).compose(c.position,c.quaternion,Oa)},position:c.position.clone()};this.doMoveToPano(e,M,t,i)}else this.pending=!0,this.pendingTextureTask={panoIndex:e,hash:m,onLoad:function(r){var o;if(l.pending=!1,l.destroyed)r.body.dispose();else{r.body.name=m;var a={panoIndex:e,workCode:l.work.workCode,effect:null!==(o=t.effect)&&void 0!==o?o:"fade",leftPanoPicture:{map:r.body,luminanceMap:null,matrix:(new n.Matrix4).compose(c.position,c.quaternion,Oa)},position:c.position.clone()};l.doMoveToPano(e,a,t,i)}},onError:function(i){l.pending=!1,t.moveCancelCallback&&t.moveCancelCallback(),l.emit("panoLoadError",i,e),l.emit("moveToPanoCanceled",e)}},Promise.all([this.tileLevelForFov&&v&&v.length?this.textureLoader.loadTiledCubeTexture(A,v,{tileMaxLevel:this.TILED_CUBE_TEXTURE_LEVEL,imageURL:{transform:p,options:f},format:n.RGBAFormat,viaAjax:!0},void 0,void 0,(function(t){var i,n;l.emit("textureLoading",t,e,c),(null===(i=l.pendingTextureTask)||void 0===i?void 0:i.hash)===m&&(null===(n=l.panoMeshes[e])||void 0===n||n.setProgress(t))}),this.renderer):this.textureLoader.loadCubeTexture(A,{imageURL:{transform:p,options:f},format:n.RGBAFormat},void 0,void 0,(function(t){var i,n;(null===(i=l.pendingTextureTask)||void 0===i?void 0:i.hash)===m&&(null===(n=l.panoMeshes[e])||void 0===n||n.setProgress(t)),l.emit("textureLoading",t,e,c)}),this.renderer)]).then((function(t){var i,n,r=t[0];(null===(i=l.pendingTextureTask)||void 0===i?void 0:i.hash)===m?(l.pendingTextureTask.onLoad(r),null===(n=l.panoMeshes[e])||void 0===n||n.setProgress(0),delete l.pendingTextureTask,l.emit("textureLoaded",e,c,r.meta)):r.body.dispose()})).catch((function(t){var i,n;(null===(i=l.pendingTextureTask)||void 0===i?void 0:i.hash)===m&&(l.pendingTextureTask.onError(t),null===(n=l.panoMeshes[e])||void 0===n||n.setProgress(0),delete l.pendingTextureTask,l.emit("textureError",t,e,c),l.emit("error",t))})),this.emit("textureStartLoad",e,c)},t.prototype.doMoveToPano=function(e,t,i,r){var o,a,s,l=this;void 0===i&&(i={}),this.userAction=r;var c=ue(),u=In();this.panoResources[u]=t;var h,d,p;if(this.locationMotion.ended){var f=this.locationMotion.getKeyFrameSegment(c);f[0];var A=f[1],v=this.locationMotion.value,m=this.panoResourceFromLocationMotionKeyframe(A).position,g=t.position;h=Math.max(m.distanceTo(g),1),d=[{key:A.key,progress:0,value:ie(ie({},v),{count:0})},{key:u,progress:1,value:{distance:0,perspToOrtho:0,orthoDistance:1,modelAlpha:0,count:1}}],p=0}else{var y=this.locationMotion.getKeyFrameSegment(c),b=y[0],x=(A=y[1],v=this.locationMotion.value,this.panoResourceFromLocationMotionKeyframe(b).position),w=(m=this.panoResourceFromLocationMotionKeyframe(A).position,g=t.position,A.value.count-v.count),M=Math.max(x.distanceTo(m),1)*w;h=M+Math.max(m.distanceTo(g),1),d=[{key:b.key,progress:0,value:ie({},v)},{key:A.key,progress:M/h,value:A.value},{key:u,progress:1,value:{count:A.value.count+1,distance:0,perspToOrtho:0,orthoDistance:1,modelAlpha:0}}];var C=this.locationMotionKeyframesLength(this.locationMotion.keyframes),E=this.locationMotionKeyframesLength(d);p=this.locationMotion.getProgressVelocity(c)*C/E}var I=this.calculateMovingDuration(i.duration,h),S={longitude:i.longitude,latitude:i.latitude,fov:i.fov},B={longitude:null!==(o=S.longitude)&&void 0!==o?o:this.camera.pose.longitude,latitude:null!==(a=S.latitude)&&void 0!==a?a:this.camera.pose.latitude,fov:null!==(s=S.fov)&&void 0!==s?s:this.camera.pose.fov,offset:t.position.clone(),distance:0};this.emit("moveToPano",e,this.userAction),i.moveStartCallback&&i.moveStartCallback(e,B),this.emit("panoWillArrive",e,B,this.userAction),this.videoTexture&&this.videoTexture.image instanceof HTMLVideoElement&&this.videoTexture.image.getAttribute("src")&&(this.videoTexture.image.pause(),this.videoTexture.image.removeAttribute("uuid"),this.videoTexture.image.removeAttribute("src"),this.videoTexture.image.oncanplay=le,this.videoTexture.needsUpdate=!0),this.panoVideo.setMaterial(null),this.cameraMotion.set(S,I).catch(le),this.locationMotion.setKeyframes(d,I,p).then((function(){var t,o,a,s={longitude:l.camera.pose.longitude,latitude:l.camera.pose.latitude,fov:l.camera.pose.fov,offset:l.camera.pose.offset.clone(),distance:0};i.moveEndCallback&&i.moveEndCallback(e,s),l.emit("panoArrived",e,s,r);var c=l.work.observers[l.currentPanoIndex];if(c&&c.video&&l.videoTexture&&l.videoTexture.image instanceof HTMLVideoElement){var u=La.clone().multiply(null!==(a=null===(o=null===(t=l.model.getMaterial())||void 0===t?void 0:t.pano1)||void 0===o?void 0:o.matrix)&&void 0!==a?a:new n.Matrix4).multiply(c.video.matrix),h={map:l.videoTexture,size:c.video.size,matrix:u,alpha:1},d=In(),p=l.videoTexture.image;p.setAttribute("uuid",d),uo().then((function(e){e&&c.video&&p.getAttribute("uuid")===d&&(p.oncanplay=function(){p.oncanplay=le,p.play()},p.ontimeupdate=function(){p.currentTime>.5&&(p.ontimeupdate=le,l.panoVideo.setMaterial(h))},p.src=c.video.source)})).catch((function(){p.removeAttribute("uuid")}))}}),(function(){i.moveCancelCallback&&i.moveCancelCallback(),l.emit("moveToPanoCanceled",e)}))},t.prototype.checkSelectedPano=function(){var e=this,t=this.xrControllerRay;this.interiaMovement=!1;var i=this.camera.getDirection(new n.Vector3).setY(0),r=null,o=this.work.observers[this.currentPanoIndex];if(!o)return r;var a=o.accessibleNodes.filter((function(t){if(t===e.currentPanoIndex)return!1;var i=e.work.observers[t];return!(i.position.distanceTo(e.camera.position)>e.maxAccessibleDistance)&&(i.loadable||i.active)})),s=this.model.intersectRaycaster(t)[0];if(s){var l=Vr(a,(function(t){var n=e.work.observers[t].standingPosition.clone();return n.clone().sub(e.camera.position).setY(0).angleTo(i)>Math.PI/2?1/0:n.distanceTo(s.point)}),!0),c=l[0];l[1]<this.panoTapTriggerRadius&&(r=c)}Un(r)&&(r=this.getForwardPanoIndexOrNot(t));for(var u=0,h=this.locationMotion.keyframes;u<h.length;u++){var d=h[u],p=this.panoResourceFromLocationMotionKeyframe(d);if(!(d.progress<this.locationMotion.progress)&&p.panoIndex===r){r=null;break}}if(this.emit("panoSelected",r),Un(r))return!0===this.locationMotion.ended&&this.cameraBounce(),r;var f=this.work.observers[r];if(!f.active)return this.panoMeshes[r]&&(this.panoMeshes[r].setDisabled(!1),this.panoMeshes[r].setLoading(!0)),r;for(var A={effect:"fade"},v=Math.PI/6,m=Math.PI/12,g=new n.Vector3(0,1,0),y=f.position.clone().setY(0).sub(o.position.clone().setY(0)).normalize(),b=y.clone().applyAxisAngle(g,v),x=y.clone().applyAxisAngle(g,-v),w=[],M=[],C=[],E=0,I=f.accessibleNodes;E<I.length;E++){if((c=I[E])!==this.currentPanoIndex&&c!==r){var S=this.work.observers[c].position.clone().sub(f.position).setY(0);y.angleTo(S)<v?C.push(S):b.angleTo(S)<v?w.push(S):x.angleTo(S)<v&&M.push(S)}}var B=(C.length>0?C:ne(ne([],w,!0),M,!0)).slice().sort((function(e,t){return e.angleTo(y)-t.angleTo(y)}))[0];return B&&B.angleTo(i)>m&&(A.longitude=Math.atan2(-B.x,-B.z)),this.cameraMotion.value.latitude<-Math.PI/4&&(A.latitude=Kn(0,this.minLatitude,this.maxLatitude)),this.cameraMotion.value.fov<60&&(A.fov=this.defaultFov),this.emit("wantsMoveToPano",r,A,!0),r},t.prototype.destroy=function(){e.prototype.destroy.call(this)},t.prototype.isReady=function(){return!1},t.prototype.updateTime=function(e,t){for(var i,r,o,a,s,l,c,u=this,h=[],d=2;d<arguments.length;d++)h[d-2]=arguments[d];var p=this.currentPanoIndex,f={},A={},v=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[0]),m=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),g=!1;if(!1===this.locationMotion.ended){this.locationMotion.update(e);var y=this.locationMotion.getKeyFrameSegment(e),b=y[0],x=y[1],w=this.panoResourceFromLocationMotionKeyframe(b),M=this.panoResourceFromLocationMotionKeyframe(x),C=(new n.Vector3).copy(w.position),E=(new n.Vector3).copy(M.position),I=this.locationMotion.value.count-x.value.count+1;f.progress=I,f.modelAlpha=this.locationMotion.value.modelAlpha,this.camera.perspToOrtho.setScalar(Kn(this.locationMotion.value.perspToOrtho,0,1)),this.camera.orthoDistance=this.locationMotion.value.orthoDistance,M.leftPanoPicture&&(I<1?w.leftPanoPicture&&(f.pano0=w.leftPanoPicture):f.pano0=M.leftPanoPicture,f.pano1=M.leftPanoPicture),g=f.useBlackTransition="instant"===M.effect||"montage"===M.effect,"fade"!==M.effect&&"montage"!==M.effect||(f.pano0&&w.leftPanoPicture&&(f.pano0={map:f.pano0.map,luminanceMap:f.pano0.luminanceMap,matrix:w.leftPanoPicture.matrix.clone().setPosition(M.position)}),C.copy(E)),A.distance=this.locationMotion.value.distance,A.offset=new n.Vector3(C.x+(E.x-C.x)*I,C.y+(E.y-C.y)*I,C.z+(E.z-C.z)*I);for(var S=[],B=[],T=0,P=this.locationMotion.keyframes;T<P.length;T++){var R=P[T],k=R.key,Q=R.progress;void 0!==k&&(S.push(k),Q>=this.locationMotion.progress&&B.push(k))}for(var D=0,F=Object.keys(this.panoResources);D<F.length;D++){var L=F[D];if(!(B.indexOf(L)>=0)){var O=this.panoResources[L];if(O.leftPanoPicture){var N=O.leftPanoPicture.map;if(N){if(N===(null===(i=f.pano0)||void 0===i?void 0:i.map))continue;if(N===(null===(r=f.pano1)||void 0===r?void 0:r.map))continue;N instanceof Ct&&N.cubeRenderTarget&&this.colorCubeRenderTargetPool.push(N.cubeRenderTarget),N.dispose(),O.leftPanoPicture=null}}S.indexOf(L)>=0||delete this.panoResources[L]}}w.workCode===M.workCode?this.currentPanoIndex=I<.5?w.panoIndex:M.panoIndex:this.currentPanoIndex=M.panoIndex,this.emit("movingToPano",m.panoIndex,v.panoIndex,this.locationMotion.progress)}!1===this.cameraMotion.ended&&(this.cameraMotion.update(e),A.longitude=this.cameraMotion.value.longitude,A.latitude=this.cameraMotion.value.latitude,A.fov=this.cameraMotion.value.fov),!1===Ur(f)&&((null===(o=f.pano0)||void 0===o?void 0:o.map)&&f.pano0.map instanceof Ct&&!f.pano0.map.cubeRenderTarget&&(f.pano0.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),(null===(a=f.pano1)||void 0===a?void 0:a.map)&&f.pano1.map instanceof Ct&&!f.pano1.map.cubeRenderTarget&&(f.pano1.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),this.model.setMaterial(f)),!1===Ur(A)&&this.setCamera(A);var V=h[1];if(V)if(this.xrManager.session){var U=this.xrManager.referenceSpace;if(U){var z=this.xrManager.cameraVR,q=this.xrManager.cameraL,H=this.xrManager.cameraR,_=[q,H],K=V.getViewerPose(U),j=new n.Vector3(0,0,0);if(K){var G=void 0;switch(this.xrManager.machineType){case"Pico":G=this.xrManager.session.renderState.baseLayer;break;case"Oculus":var W=this.xrManager.session.renderState.layers;W&&(G=W[0]);break;default:this.xrManager.machineType}var X=K.views;if(!G)return void console.error("no layer found");this.renderer.setFramebuffer(G.framebuffer);var Y=!1;X.length!==z.cameras.length&&(z.cameras.length=0,Y=!0),this.parallaxCameraMatrixs=[];var Z=new n.Vector3,J=new n.Vector3;(new n.Matrix4).fromArray(X[0].transform.matrix).decompose(Z,new n.Quaternion,new n.Vector3),(new n.Matrix4).fromArray(X[1].transform.matrix).decompose(J,new n.Quaternion,new n.Vector3),J.clone().sub(Z).normalize();var $=new n.Vector3,ee=new n.Quaternion,te=new n.Vector3;this.camera.matrix.decompose($,ee,te);for(var ie=0;ie<X.length;ie++){var ne=X[ie],re=G.getViewport(ne),oe=_[ie];oe.matrix.fromArray(ne.transform.matrix);var ae=new n.Vector3,se=new n.Quaternion,le=new n.Vector3;oe.matrix.decompose(ae,se,le),j.copy($),oe.position.copy($),oe.quaternion.copy(se),oe.scale.copy(le),oe.updateMatrix(),oe.projectionMatrix.fromArray(ne.projectionMatrix),oe.viewport.set(re.x,re.y,re.width,re.height),!0===Y&&z.cameras.push(oe)}}var ce=this.xrManager.session.inputSources;for(ie=0;ie<this.xrManager.controllers.length;ie++){var ue=this.xrManager.controllers[ie],he=ce[ie];ue.update(he,V,U)}var de=this.xrManager.getController(0),pe=de.position.clone().add(j).sub(new n.Vector3(0,1.35,0));this.xrControllerRay.set(pe,new n.Vector3(0,0,-1).applyEuler(de.rotation));var fe=this.model.intersectRaycaster(this.xrControllerRay);if(0===fe.length&&(fe=this.xrControllerRay.intersectObject(this.boundingMesh,!0)),fe.length>=1&&fe[0].face){this.pointerLine.setPoints(pe,fe[0].point);var Ae=fe[0].face.normal,ve=Ae.clone().multiplyScalar(.05),me=fe[0].point.clone().add(ve);this.intersectMesh.position.copy(me);var ge=me.clone().add(ve);if(this.intersectMesh.lookAt(ge),Math.abs(Ae.y)>.99){var ye=this.camera.position.clone().sub(me);this.intersectMesh.rotation.z=-Math.atan2(ye.z,ye.x)}this.intersectMesh.visible=!0,this.needsRender=!0,this.emit("intersectionOnModelUpdate",fe[0],this.intersectMesh)}if(this.currentPanoIndex!==p&&this.updatePanoMeshesVisible(),this.camera.pose.distance>.1||g){var be=this.work.observers[this.currentPanoIndex];if(be)for(var xe=0,we=Se=be.visibleNodes.concat(this.currentPanoIndex);xe<we.length;xe++){var Me=we[xe];(ke=this.panoMeshes[Me])&&ke.setOpacity(0)}}else{var Ce=this.work.observers[this.currentPanoIndex];if(Ce){var Ee=Vr(Ce.visibleNodes,(function(e){return Ce.standingPosition.distanceTo(u.work.observers[e].standingPosition)}),!0),Ie=Ee[1];Ie=Kn(Ie,2.5,1/0);for(var Se=Ce.visibleNodes.concat(this.currentPanoIndex),Be=this.getForwardPanoIndexOrNot(),Te=this.camera.getDirection(new n.Vector3),Pe=0,Re=Se;Pe<Re.length;Pe++){Me=Re[Pe];var ke,Qe=this.work.observers[Me];if(ke=this.panoMeshes[Me])if(Qe.loadable||Qe.active){var De=ke.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);ke.setCurrent(!ke.loading&&0===ke.progress&&Be===Me),ke.setOpacity(De<.01?0:Kn(Ie/De*1.2,.65,.98));var Fe=this.camera.position.clone().setY(ke.position.y),Le=(new n.Vector3).copy(ke.position).sub(Fe).normalize();if(Me===this.currentPanoIndex){var Oe=Kn((.5-Fe.distanceTo(ke.position))/.5,0,1);Le.multiplyScalar(1-Oe).add(Te.clone().multiplyScalar(Oe))}Le.length()>0&&ke.quaternion.setFromEuler(new n.Euler(0,Math.atan2(Le.x,Le.z),0)),ke.updateTime&&ke.updateTime(e,t)}else ke.setOpacity(0)}}}var Ne,Ve=function(){if(!1===u.tileLevelForFov)return 0;var e=new n.Vector2(4e3,4e3),t=m.panoIndex,i=u.work.observers[t],r=u.imageOptions.size;if(void 0===r&&i){var o=i.images.up.match(/\/cube_(\d+)\//);o&&(r=Number(o[1]))}void 0===r&&(r=2048);var a=0;r>=1024&&(a=1),r>=2048&&(a=2),r>=4096&&(a=3),r>=8192&&(a=4);var s=u.tileLevelForFov(q.fov,e);return s>a?s:0}(),Ue=((Ne=new n.PerspectiveCamera).applyMatrix4(z.matrix),Ne.position.set(0,0,0),Ne.quaternion.premultiply(u.work.observers[m.panoIndex].quaternion.clone().inverse()),Ne.updateProjectionMatrix(),Ne.updateMatrixWorld(!0),(new n.Frustum).setFromProjectionMatrix((new n.Matrix4).multiplyMatrices(Ne.projectionMatrix,Ne.matrixWorldInverse)));m.panoIndex===this.currentPanoIndex&&(null===(s=m.leftPanoPicture)||void 0===s?void 0:s.map)instanceof Ct&&(m.leftPanoPicture.map.update(Ue,Ve),!0===m.leftPanoPicture.map.needsRender&&(this.needsRender=!0));var ze=this.tiling.object.visible;if(Ve>this.TILED_CUBE_TEXTURE_LEVEL&&this.initAnimationed){var qe=m.panoIndex,He=this.work.observers[qe];He&&Er(this.camera.position,He.position)&&this.locationMotion.ended?(this.tiling.object.visible=!0,this.tiling.panoIndex!==qe&&this.tiling.cleanup(),this.tiling.panoIndex=qe,this.tiling.setResource(null!==(c=null===(l=He.images)||void 0===l?void 0:l.tiles)&&void 0!==c?c:[],this.enableIOSEDR&&He.images.luminance?He.images.luminance:null),this.tiling.setRotation(He.quaternion),this.tiling.setPosition(He.position),this.tiling.update(Ue,Ve,e)):this.tiling.object.visible=!1}else this.tiling.object.visible=!1;ze!==this.tiling.object.visible&&(this.tiling.object.needsRender=!0),this.panoVideo.object.position.copy(this.camera.position),this.panoVideo.updateTime(e);var _e=ce[0].gamepad;if((null==_e?void 0:_e.axes)&&this.emit("webXRSelected","Axes",{axes:_e.axes}),-1===(null==_e?void 0:_e.axes[2])){if(!this.xrControllerState.axes[2].left.isTap){var Ke=e-this.xrControllerState.axes[2].left.startTime;Ke>=300&&this.emit("webXRSelected","RightAxesLeftTap"),this.xrControllerState.axes[2].left.isTap=!0}}else this.xrControllerState.axes[2].left.isTap=!1,this.xrControllerState.axes[2].left.startTime=0;if(1===(null==_e?void 0:_e.axes[2])){if(!this.xrControllerState.axes[2].right.isTap){var je=e-this.xrControllerState.axes[2].right.startTime;je>=300&&this.emit("webXRSelected","RightAxesRightTap"),this.xrControllerState.axes[2].right.isTap=!0}}else this.xrControllerState.axes[2].right.isTap=!1,this.xrControllerState.axes[2].right.startTime=0;if(-1===(null==_e?void 0:_e.axes[3])){if(!this.xrControllerState.axes[3].up.isTap){var Ge=e-this.xrControllerState.axes[3].up.startTime;Ge>=300&&this.emit("webXRSelected","RightAxesUpTap"),this.xrControllerState.axes[3].up.isTap=!0}}else this.xrControllerState.axes[3].up.isTap=!1,this.xrControllerState.axes[3].up.startTime=0;if(1===(null==_e?void 0:_e.axes[3])){if(!this.xrControllerState.axes[3].down.isTap){var We=e-this.xrControllerState.axes[3].down.startTime;We>=300&&this.emit("webXRSelected","RightAxesDownTap"),this.xrControllerState.axes[3].down.isTap=!0}}else this.xrControllerState.axes[3].down.isTap=!1,this.xrControllerState.axes[3].down.startTime=0;if(null==_e?void 0:_e.buttons[0].pressed){if(!this.xrControllerState.select.isTap){var Xe=e-this.xrControllerState.select.startTime;Xe>=300&&this.emit("webXRSelected","Select",{raycaster:this.xrControllerRay}),this.xrControllerState.select.isTap=!0}}else this.xrControllerState.select.isTap=!1,this.xrControllerState.select.startTime=0;if(null==_e?void 0:_e.buttons[1].pressed){if(!this.xrControllerState.squeeze.isTap){var Ye=e-this.xrControllerState.squeeze.startTime;Ye>=300&&this.emit("webXRSelected","Squeeze",{raycaster:this.xrControllerRay}),this.xrControllerState.squeeze.isTap=!0}}else this.xrControllerState.squeeze.isTap=!1,this.xrControllerState.squeeze.startTime=0;if(null==_e?void 0:_e.buttons[2].pressed){if(!this.xrControllerState.leftButtonA.isTap){var Ze=e-this.xrControllerState.leftButtonA.startTime;Ze>=300&&this.emit("webXRSelected","LeftButtonA",{raycaster:this.xrControllerRay}),this.xrControllerState.leftButtonA.isTap=!0}}else this.xrControllerState.leftButtonA.isTap=!1,this.xrControllerState.leftButtonA.startTime=0;if(null==_e?void 0:_e.buttons[3].pressed){if(!this.xrControllerState.leftButtonB.isTap){var Je=e-this.xrControllerState.leftButtonB.startTime;Je>=300&&this.emit("webXRSelected","LeftButtonB",{raycaster:this.xrControllerRay}),this.xrControllerState.leftButtonB.isTap=!0}}else this.xrControllerState.leftButtonB.isTap=!1,this.xrControllerState.leftButtonB.startTime=0;if(null==_e?void 0:_e.buttons[4].pressed){if(!this.xrControllerState.rightButtonA.isTap){var $e=e-this.xrControllerState.rightButtonA.startTime;$e>=300&&this.emit("webXRSelected","RightButtonA",{raycaster:this.xrControllerRay}),this.xrControllerState.rightButtonA.isTap=!0}}else this.xrControllerState.rightButtonA.isTap=!1,this.xrControllerState.rightButtonA.startTime=0;if(null==_e?void 0:_e.buttons[5].pressed){if(!this.xrControllerState.rightButtonB.isTap){var et=e-this.xrControllerState.rightButtonB.startTime;et>=300&&this.emit("webXRSelected","RightButtonB",{raycaster:this.xrControllerRay}),this.xrControllerState.rightButtonB.isTap=!0}}else this.xrControllerState.rightButtonB.isTap=!1,this.xrControllerState.rightButtonB.startTime=0}}else console.error("session丢失,请重试");else console.error("xrFrame丢失,请重试")},t.prototype.render=function(){var e=this.xrManager.getCamera(this.camera);this.renderer.render(this.scene,e)},t.prototype.onPanGesture=function(){},t.prototype.onTapGesture=function(){},t.prototype.onPinchGesture=function(){},t.prototype.onMouseMove=function(){},t.prototype.onMouseOut=function(){},t.prototype.panoResourceFromLocationMotionKeyframe=function(e){return this.panoResources[e.key]},t}(Do),Va=["Panorama","DepthPanorama","Model"],Ua={Floorplan:$r,Topview:oo,Panorama:Do,VRPanorama:da,Model:pa,DepthPanorama:ba,Mapview:Ma,XRPanorama:Na};function za(e){for(var t=0,i=Va;t<i.length;t++){var n=i[t];if("string"==typeof e){if(n===e)return!0}else if(e instanceof Jr&&e instanceof Ua[n])return!0}return!1}var qa=["cameraDirectionUpdate","cameraUpdate","cameraPositionUpdate","panoSelected","moveToPano","moveToPanoCanceled","panoWillArrive","movingToPano","panoArrived","panoWillLoad","panoLoaded","panoLoadError","initAnimationEnded","initAnimationWillStart","wantsGesture","gesture","wantsTapGesture","tapGesture","wantsPressGesture","pressGesture","wantsPanGesture","wantsInteriaPan","panGesture","interiaPan","wantsPinchGesture","pinchGesture","wantsMouseWheel","mouseWheel","wantsShowIntersectionOnModel","intersectionOnModelUpdate","intersectionHidden","textureStartLoad","textureLoading","textureAbort","textureLoaded","textureError","webXRSessionStart","webXRSessionEnd","webXRSelected"];function Ha(e){for(var t,i,n={},r=0,o=e.split(/(\;|\,)/);r<o.length;r++){var a=o[r].split("="),s=null===(t=a[0])||void 0===t?void 0:t.trim(),l=null===(i=a[1])||void 0===i?void 0:i.trim();s&&l&&(n[s]=l)}return n}function _a(){for(var e,t=document.getElementsByTagName("meta"),i=0;i<t.length;i++){var n=t[i];if("viewport"===n.getAttribute("name")){var r=Ha(null!==(e=n.getAttribute("content"))&&void 0!==e?e:""),o=Number(r["initial-scale"]);if(!isNaN(o))return o}}return 1}var Ka=[351,63],ja=[20,20],Ga=new Float32Array([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),Wa=new Float32Array([0,0,1,0,0,1,1,1]),Xa=new Uint8Array([0,1,2,1,3,2]),Ya=new n.BufferGeometry;Ya.setAttribute("position",new n.BufferAttribute(Ga,3)),Ya.setAttribute("uv",new n.BufferAttribute(Wa,2)),Ya.setIndex(new n.BufferAttribute(Xa,1));var Za=new n.MeshBasicMaterial({transparent:!0,depthTest:!1,depthWrite:!1,stencilWrite:!1,fog:!1}),Ja=new n.Mesh(Ya,Za);Ja.matrixAutoUpdate=!1;var $a=new n.Scene;$a.add(Ja),$a.matrixAutoUpdate=!1;var es=new n.OrthographicCamera(-.5,.5,.5,-.5,.1,1);es.position.set(0,0,.5),es.lookAt(0,0,0),es.updateMatrixWorld(!0),es.matrixAutoUpdate=!1;var ts=new n.Vector4,is=new n.Vector4;function ns(e){if(Za.map){var t=e.getViewport(ts),i=e.getScissor(is),r=e.getScissorTest(),o=e.autoClear,a=i.x+ja[0]/3,s=i.y+ja[1]/3,l=Ka[0]/3,c=Ka[1]/3;e.setViewport(a,s,l,c),e.setScissor(a,s,l,c),e.setScissorTest(!0),e.autoClear=!1,e.render($a,es),e.setViewport(t),e.setScissor(i),e.setScissorTest(r),e.autoClear=o}else{var u=new n.Texture,h=new Image;h.onload=function(){u.image=h,u.wrapS=n.ClampToEdgeWrapping,u.wrapT=n.ClampToEdgeWrapping,u.minFilter=n.LinearFilter,u.needsUpdate=!0,u.generateMipmaps=!1,Za.needsUpdate=!0,h.onload=le},h.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAV8AAAA/CAQAAADtPwPkAAAR+0lEQVR4AezYg3LEQACH8d1cbdu23Q5qG9G47z/TN/h6tn2b/H+TUTLc7yjcOXV46OUAnUs6EbUp022ZBXc1NhoZYYd7fjDRvdcHAwrlK2QBVJ4sgoqONmY45RUT23sZ6H42F2hK5CtkMbjhZlDmUUcvq1zyieUVyjbE4I1GBfItwxG56YaUZTQwyh4P6NgJ4YYYvCuQb5kOyI03pORjiqe4Lwpq5pt1vJqfUwKWJVbSMYfppYconG+maNNQOWBZuwHTzicGel75NtFOkxr5apmV8cikcko0DrDQs863AeGl0cE0+1xy573m0/wf0cEKW6H7BWtggiMG8sy3oHRDpJMw4NWb6am/bv9znkqEzjd61t5oo5clTrjhwevO75EJRBKSRt745Z16ZEjcM73sccZplBPm8PyTcxZAkSRdHm/acJ0Z3JZhHB0BxqDHgWFZFmm0ZbCw87twI/zc3e/Cz93vPneXtU/WdQS3oTviXdY/q5PsJKfoGuQjZuO/0in1qsj85cuXrxqeAOJpGqdJOqrUutgVl2Qb0BWqp/RE8AWWVB7t2KrIzY2Wx2fWKl7yfswgxqj8lYummYa3hfwF9MuQRmbfQE4ocPDjtUWQ6Tq1M2w7gC2EcrMGtWS6xlpGK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lol7LF+E++fwirfiq2sf4cTXxc6hzxffPuLEeqSWrPGWMF58TWr5viyJAP5/4EV4KePiaSE8eNRgjDy8/tyRW+FZjhS+2tlovNJovtJovNJ0uhK6Wo64SDdxEbM//KesjwAAAABJRU5ErkJggg==",Za.map=u}}var rs=new n.Box3(new n.Vector3(-50,-50,-50),new n.Vector3(50,50,50)),os=function(e){return e.replace("//vrlab-public.ljcdn.com/","//vr-public.realsee-cdn.cn/").replace("//vrlab-image4.ljcdn.com/","//vr-image-4.realsee-cdn.cn/").replace("//vrlab-image3.ljcdn.com/","//vr-image-3.realsee-cdn.cn/").replace("//vrlab-image2.ljcdn.com/","//vr-image-2.realsee-cdn.cn/").replace("//vrlab-image1.ljcdn.com/","//vr-image-1.realsee-cdn.cn/")},as=new n.Vector2,ss=new n.Frustum,ls=new n.Matrix4,cs=new WeakMap,us=new WeakMap,hs=function(e){function t(t){void 0===t&&(t={});var i,r,o,a,s,l,c,u,h,d,p=this;if((p=e.call(this)||this).ident=In(),ds.instances[p.ident]=p,p.renderSwitch01=0,p.panoIndex=0,p.needsRender=!1,p.onlyRenderIfNeeds=null===(i=t.onlyRenderIfNeeds)||void 0===i||i,p.imageOptions=ie({},null!==(r=t.imageOptions)&&void 0!==r?r:{}),p.textureOptions=ie({},null!==(o=t.textureOptions)&&void 0!==o?o:{}),p.poweredByRealsee=null===(a=t.poweredByRealsee)||void 0===a||a,p.extraElements=[],p.controllerInits={Panorama:Object.assign({},t.panorama),Model:Object.assign({},t.model),Floorplan:Object.assign({},t.floorplan),Topview:Object.assign({},t.topview),Mapview:Object.assign({},t.mapview),DepthPanorama:Object.assign({},t.depthPanorama),VRPanorama:Object.assign({},t.vrPanorama),XRPanorama:Object.assign({},t.xrPanorama)},p.fps={testCount:0,testTime:ue()},p.modeChangeDuration=null!==(s=t.modeChangeDuration)&&void 0!==s?s:800,p.panoramaLikeSavedPose={},"undefined"!=typeof window)if(t.renderer)t.renderer instanceof Rt&&p.throwError(new Error("cannot render a internal renderer")),p.renderer=t.renderer;else try{p.renderer=new Rt({preserveDrawingBuffer:t.preserveDrawingBuffer,backgroundColor:t.backgroundColor,backgroundAlpha:t.backgroundAlpha,antialias:t.antialias,webgl2:null==t?void 0:t.webgl2});var f=_a();p.renderer.setPixelRatio(1===f?window.devicePixelRatio:1),p.renderer.setSize(512,512)}catch(e){e instanceof Error&&p.throwError(e)}p.copyEffect=new Zr(p.renderer),p.getPixelsRenderTarget=new n.WebGLRenderTarget(1,1,{encoding:null!==(c=null===(l=p.renderer)||void 0===l?void 0:l.outputEncoding)&&void 0!==c?c:n.sRGBEncoding}),p.scissor=Object.assign({left:0,bottom:0,width:1,height:1},t.scissor),p.camera=new zt(80),p.scene=new kt,p.parallaxScene=new kt,p.lastLoadWorkTask=Promise.resolve(),p.requestProxy=null!==(u=t.requestProxy)&&void 0!==u?u:os,p.networkSubscribe=new Ee,p.networkSubscribe.on("network",(function(e,t,i,n){var r;p.emit("network",e,t,i,n),null===(r=p.analysis)||void 0===r||r.network(p.work,e,t,i,n)})),p.boundingMesh=Tr(new n.Box3(new n.Vector3(-.5,-.5,-.5),new n.Vector3(.5,.5,.5))),p.scene.add(p.boundingMesh),p.model=new _n({allowHosts:[],requestProxy:p.requestProxy,networkSubscribe:p.networkSubscribe});var A=Tr(rs);A.name="model_empty",p.model.add(A),p.model.visible=!1,p.readyCallbacks=[],p.modelPending=!1,p.syncingState=!1,p.scene.add(p.model),p.helperGroup=new n.Group,p.helperGroup.name="helper",p.scene.add(p.helperGroup),p.videoTexture=new n.VideoTexture(t.videoInstance||function(){var e=document.createElement("video");e.loop=!0,e.autoplay=!0,e.playsInline=!0,e.muted=!0,e.crossOrigin="";var t=function(){document.removeEventListener("touchstart",t,!1),document.removeEventListener("mousedown",t,!1),e.muted=!1};return document.addEventListener("touchstart",t,!1),document.addEventListener("mousedown",t,!1),e}()),function(e){(t=new n.DirectionalLight(16777215,.5)).position.copy(new n.Vector3(1,1,1)),e.add(t);var t=new n.DirectionalLight(16777215,.3);e.add(t),t=new n.AmbientLight(16777215,.3),e.add(t)}(p.scene),p.state={mode:null!==(h=p.currentMode)&&void 0!==h?h:"Panorama",panoIndex:null!==(d=p.panoIndex)&&void 0!==d?d:0,longitude:p.camera.pose.longitude,latitude:p.camera.pose.latitude,fov:p.camera.pose.fov,offset:p.camera.pose.offset.clone(),distance:p.camera.pose.distance},p.stateSynced=!1,p._enableIOSEDR=!1,p.destroyed=!1,p.paused=!0,"undefined"!=typeof window&&(!1!==t.play&&p.play(),p.stopAnimationLoop=ke.shared.add((function(e,t){for(var i=[],n=2;n<arguments.length;n++)i[n-2]=arguments[n];p.updateTime.apply(p,ne([e,t],i,!1))}),!1,0,10));var v=function(){"undefined"!=typeof document&&null===document.fullscreenElement&&"VRPanorama"===p.currentMode&&p.controller.emit("vrWantsToExit")};if("undefined"!=typeof document&&document.addEventListener("fullscreenchange",v,!1),p.removeEventListeners=function(){"undefined"!=typeof document&&document.removeEventListener("fullscreenchange",v,!1)},p.plugins={},t.plugins&&t.plugins.length)for(var m=0,g=t.plugins;m<g.length;m++){var y=g[m];if("function"==typeof y)y(p);else if(Array.isArray(y)){var b=y[0],x=y[1],w=y[2];if("function"==typeof b){var M=b(p,w);"string"==typeof x&&(p.plugins[x]?p.throwError(new Error("plugin name ".concat(x," is exists."))):p.plugins[x]=M)}}}return p.gpuPickingRenderTarget=new n.WebGLRenderTarget(1,1),p.meshReplaceMaterialMap=new Map,p.meshOriginMaterialMap=new Map,p}return te(t,e),Object.defineProperty(t,"version",{get:function(){return"5.0.0-alpha.181"},enumerable:!1,configurable:!0}),t.prototype.getGPUPicking=function(e,t,i,r,o){var a=this;if(void 0===r&&(r=1),void 0===o&&(o=new n.Vector3(0,0,0)),!this.renderer)throw new Error("renderer is not initialized.");this.model.setMaterial({modelColorInfo:o}),this.scene.traverse((function(e){if(e instanceof n.Mesh&&!(e instanceof ze)){var t=Object.keys(i).filter((function(t){return t===e.uuid}))[0];if(t)if(a.meshOriginMaterialMap.set(t,e.material),a.meshReplaceMaterialMap.get(t))e.material=a.meshReplaceMaterialMap.get(t);else{var r=new n.ShaderMaterial({uniforms:{color:{value:i[t]}},vertexShader:"\n void main() {\n vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n gl_Position = projectionMatrix * mvPosition;\n }\n ",fragmentShader:"\n uniform vec3 color;\n void main() {\n gl_FragColor = vec4( color, 1.0 );\n }\n "});r.depthTest=e.material.depthTest,r.side=e.material.side,a.meshReplaceMaterialMap.set(t,r),e.material=r}}}));var s=this.renderer.getSize(new n.Vector2);this.camera.setViewOffset(s.width,s.height,e*r,t*r,1,1),this.renderer.setRenderTarget(this.gpuPickingRenderTarget),this.render();var l=new Uint8Array(4);this.renderer.readRenderTargetPixels(this.gpuPickingRenderTarget,0,0,1,1,l),this.renderer.setRenderTarget(null),this.camera.clearViewOffset(),this.scene.traverse((function(e){e instanceof n.Mesh&&!(e instanceof ze)&&a.meshOriginMaterialMap.get(e.uuid)&&(e.material=a.meshOriginMaterialMap.get(e.uuid))})),this.model.setMaterial({modelColorInfo:null});var c=Object.keys(i).filter((function(e){return i[e].equals((new n.Color).setRGB(l[0]/255,l[1]/255,l[2]/255))}))[0];return c||!1},t.prototype.dispose=function(){var e,t;if(!0!==this.destroyed){delete ds.instances[this.ident],this.emit("dispose"),this.destroyed=!0,this.pause(),this.stopAnimationLoop&&(this.stopAnimationLoop(),delete this.stopAnimationLoop),null===(e=this.renderer)||void 0===e||e.setAnimationLoop(null),this.off(),this.networkSubscribe.off(),this.controller&&(this.controller.destroy(),this.controller=void 0);var i=this.getElement();i&&i.parentNode&&i.parentNode.removeChild(i),this.scene.remove(this.model);var n=this.model.getMaterial();n&&(n.pano0&&n.pano0.map.dispose(),n.pano1&&n.pano1.map!==(null===(t=n.pano0)||void 0===t?void 0:t.map)&&n.pano1.map.dispose()),this.model.dispose(),this.diposeGPUPickingMaterial(),this.renderer instanceof Rt&&this.renderer.forceContextLoss&&this.renderer.forceContextLoss()}},t.prototype.setScissor=function(e){Object.assign(this.scissor,e),this.controller&&this.controller.updateRenderSize&&this.controller.updateRenderSize()},Object.defineProperty(t.prototype,"helperVisible",{get:function(){return this.helperGroup.visible},set:function(e){this.helperGroup.visible!==e&&(this.helperGroup.visible=e,this.emit("helpersVisibleChange",e),this.needsRender=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"enableIOSEDR",{get:function(){return this._enableIOSEDR},set:function(e){this._enableIOSEDR!==e&&(this._enableIOSEDR=e,this.currentMode&&"Panorama"===this.currentMode&&this.changeMode(this.currentMode,{},0,!1,!0))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"enablePostProcessing",{get:function(){return void 0!==this.screenBuffers},set:function(e){var t,i,r,o;if(e){if(!this.screenBuffers){var a=this.getDrawingBufferSize(as);this.screenBuffers=[new n.WebGLRenderTarget(a.x,a.y,{encoding:null!==(i=null===(t=this.renderer)||void 0===t?void 0:t.outputEncoding)&&void 0!==i?i:n.sRGBEncoding}),new n.WebGLRenderTarget(a.x,a.y,{encoding:null!==(o=null===(r=this.renderer)||void 0===r?void 0:r.outputEncoding)&&void 0!==o?o:n.sRGBEncoding})]}}else this.screenBuffers&&(this.screenBuffers[0].dispose(),this.screenBuffers[1].dispose(),delete this.screenBuffers);this.needsRender=!0},enumerable:!1,configurable:!0}),t.prototype.updateConfiguration=function(e){var t=!1;e.panorama&&(Object.assign(this.controllerInits.Panorama,e.panorama),"Panorama"===this.currentMode&&(t=!0)),e.model&&(Object.assign(this.controllerInits.Model,e.model),"Model"===this.currentMode&&(t=!0)),e.floorplan&&(Object.assign(this.controllerInits.Floorplan,e.floorplan),"Floorplan"===this.currentMode&&(t=!0)),e.topview&&(Object.assign(this.controllerInits.Topview,e.topview),"Topview"===this.currentMode&&(t=!0)),e.mapview&&(Object.assign(this.controllerInits.Mapview,e.topview),"Mapview"===this.currentMode&&(t=!0)),e.depthPanorama&&(Object.assign(this.controllerInits.DepthPanorama,e.depthPanorama),"DepthPanorama"===this.currentMode&&(t=!0)),e.vrPanorama&&(Object.assign(this.controllerInits.VRPanorama,e.vrPanorama),"VRPanorama"===this.currentMode&&(t=!0)),e.imageOptions&&(Object.assign(this.imageOptions,e.imageOptions),"Panorama"!==this.currentMode&&"DepthPanorama"!==this.currentMode&&"VRPanorama"!==this.currentMode||(t=!0)),t&&this.controller&&this.currentMode&&this.changeMode(this.currentMode,this.getCurrentState(),0,!1,!0)},t.prototype.appendTo=function(e,t){if(void 0===t&&(t={}),this.renderer)if(this.renderer instanceof Rt){var i=this.getElement();if(i){e.appendChild(i),this.refresh(t);var n=window.getComputedStyle(e).position;"relative"!==n&&"absolute"!==n&&"fixed"!==n&&"sticky"!==n&&(e.style.position="relative")}}else this.throwError(new Error("cannot call appendTo method when render a external renderer"))},t.prototype.refresh=function(e,t){if(void 0===e&&(e={}),this.renderer){var i=this.getElement();if(i){var r=i.parentNode;if(r&&r.nodeName){var o=e.width,a=void 0===o?r.offsetWidth:o,s=e.height,l=void 0===s?r.offsetHeight:s;this.renderer instanceof Rt&&(t&&this.renderer.setPixelRatio(t),this.renderer.setSize(a,l))}var c=this.renderer.getSize(new n.Vector2);this.camera.aspect=c.x*this.scissor.width/(c.y*this.scissor.height),this.camera.updateProjectionMatrix(),this.controller&&this.controller.updateRenderSize&&this.controller.updateRenderSize(),this.needsRender=!0}}},t.prototype.addExtraElement=function(e){var t=this;return-1===this.extraElements.indexOf(e)&&(this.extraElements.push(e),this.controller&&this.controller.bindExtraElement(e)),function(){return t.removeExtraElement(e)}},t.prototype.removeExtraElement=function(e){var t=this.extraElements.indexOf(e);-1!==t&&(this.extraElements.splice(t,1),this.controller&&this.controller.unbindExtraElement(e))},t.prototype.getPose=function(){var e=this.camera.copyPose(),t=e.longitude,i=e.latitude,n=e.fov,r=e.offset,o=e.distance;return{longitude:t,latitude:i,fov:n,offset:r.clone(),distance:o}},t.prototype.getSize=function(e){if(!this.renderer)throw new Error("renderer is not initialized");return this.renderer.getSize(e),e.x*=this.scissor.width,e.y*=this.scissor.height,e},t.prototype.getDrawingBufferSize=function(e){if(!this.renderer)throw new Error("renderer is not initialized");return this.renderer.getDrawingBufferSize(e),e.x*=this.scissor.width,e.y*=this.scissor.height,e},t.prototype.updateCamera=function(e,t,i){return void 0===i&&(i=!0),this.controller?this.controller.updateCamera(e,t,i):Promise.reject(new Error("controller is not initialized."))},t.prototype.updateCameraWithKeyframes=function(e,t,i){return void 0===i&&(i=!0),this.controller?this.controller.updateCameraWithKeyframes(e,t,i):Promise.reject(new Error("controller is not initialized."))},t.prototype.getLongitudeAndLatitude=function(){var e=this.getPose();return{longitude:e.longitude,latitude:e.latitude}},t.prototype.getOffset=function(){return this.getPose().offset},t.prototype.getCameraLocal=function(){if("number"==typeof this.panoIndex&&this.controller&&this.work){var e=this.work.observers[this.panoIndex],t=new n.Object3D;return t.position.copy(e.position),t.quaternion.copy(e.quaternion),t.scale.set(1,1,1),t.updateMatrixWorld(!0),function(e,t){var i=new n.Vector3(0,0,-1);i.applyQuaternion(e.quaternion);var r=t.quaternion.clone().inverse();return i.applyQuaternion(r),{theta:Math.atan2(i.x,-i.z),phi:-Math.asin(i.y),lookAtVector:i}}(this.camera,t)}},Object.defineProperty(t.prototype,"work",{get:function(){var e=us.get(this);if(e&&tr.get(e))return e},enumerable:!1,configurable:!0}),t.prototype.load=function(e,t,i,n){var r=this;if(void 0===n&&(n=!0),!this.renderer)throw new Error("renderer is not initialized");var o=this.lastLoadWorkTask.then((function(){return!(o=e)||"object"!=typeof o&&"function"!=typeof o||"function"!=typeof o.then?r.load_(e,t,i,n):e.then((function(e){return r.load_(e,t,i,n)}));var o}));return this.lastLoadWorkTask=o.catch((function(e){r.throwError(e)})),o},t.prototype.load_=function(e,i,r,o){var a,s,l,c,u,h,d,p,f,A=this;void 0===o&&(o=!0);var v,m,g,y=ar(e),b=this.work;void 0===i&&(i=b?"inherit":"initial"),"inherit"===i?(v="number"==typeof this.panoIndex&&y.observers[this.panoIndex]?this.panoIndex:y.initial.panoIndex,m=null!==(a=this.currentMode)&&void 0!==a?a:y.initial.mode,g={longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov}):"initial"===i?(m=null!==(s=this.currentMode)&&void 0!==s?s:y.initial.mode,v=y.initial.panoIndex,g=m===t.Mode.Panorama||m===t.Mode.DepthPanorama||m===t.Mode.Model||m===t.Mode.VRPanorama||m===t.Mode.XRPanorama?{longitude:y.initial.longitude,latitude:y.initial.latitude,fov:y.initial.fov}:{longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov}):(v=null!==(l=i.panoIndex)&&void 0!==l?l:y.initial.panoIndex,m=null!==(u=null!==(c=i.mode)&&void 0!==c?c:this.currentMode)&&void 0!==u?u:"Panorama",g={longitude:null!==(h=i.longitude)&&void 0!==h?h:y.initial.longitude,latitude:null!==(d=i.latitude)&&void 0!==d?d:y.initial.latitude,fov:null!==(p=i.fov)&&void 0!==p?p:y.initial.fov}),this.emit("willLoad",e,y,{panoIndex:v,mode:m,longitude:g.longitude,latitude:g.latitude,fov:g.fov});var x=function(){var t;A.panoIndex=v,A.panoramaLikeSavedPose.longitude=y.initial.longitude,A.panoramaLikeSavedPose.latitude=y.initial.latitude,A.panoramaLikeSavedPose.fov=y.initial.fov;var i=A.controller?null!=r?r:A.modeChangeDuration:0,n=ie(ie({initial:[v,g,i,o]},A.commonParams()),A.controllerInits[m]);A.controller?!1===A.controller.updateWork(y,v,g,i,o)&&(A.controller.destroy(),A.controller=A.applyController(m,n)):A.controller=A.applyController(m,n),A.emit("load",e,y,{panoIndex:v,mode:m,longitude:g.longitude,latitude:g.latitude,fov:g.fov}),null===(t=A.analysis)||void 0===t||t.work(y)},w=function(e){var t;void 0===e&&(e=le),y.model&&(A.model.name!==(null===(t=y.model)||void 0===t?void 0:t.file)?(A.emit("modelWillLoad",y.model),A.loadModel(y.workCode,y.model,y.allowHosts,e,!0)):e&&e())};us.set(this,y);for(var M=new n.Box3,C=0,E=y.observers;C<E.length;C++){var I=E[C];M.expandByPoint(I.standingPosition),M.expandByPoint((new n.Vector3).fromArray([I.position.x,2*I.position.y-I.standingPosition.y,I.position.z]))}return this.model.bounding.union(M),m===t.Mode.Floorplan||m===t.Mode.Topview||m===t.Mode.Mapview||m===t.Mode.Model?w((function(){x(),A.needsRender=!0})):(this.controller||(this.camera.setFromPose({distance:0,fov:y.initial.fov,longitude:y.initial.longitude,latitude:y.initial.latitude,offset:y.observers[y.initial.panoIndex].position}),this.needsRender=!0),x(),null===(f=this.controller)||void 0===f||f.once("panoLoaded",(function(){A.needsRender=!0,A.emit("cameraUpdate",A.camera.copyPose(),o),w()}))),this.ready().then((function(){A.emit("loaded",e,A.work)}))},t.prototype.changeMode=function(e,i,n,r,o){var a=this;if(void 0===i&&(i={}),void 0===n&&(n=this.modeChangeDuration),void 0===r&&(r=!0),void 0===o&&(o=!1),!this.renderer)throw new Error("renderer is not initialized.");return new Promise((function(s,l){if(!t.Mode.hasOwnProperty(e)){var c=new Error('mode "'.concat(e,'" is not existed'));return a.throwError(c),void l(c)}if((e===t.Mode.Floorplan||e===t.Mode.Topview||e===t.Mode.Mapview||e===t.Mode.Model)&&(Un(a.model)||!0!==a.model.loaded)){c=new Error("model is not ready.");return a.throwError(c),void l(c)}if(Un(a.controller)){c=new Error("controller is not ready.");return a.throwError(c),void l(c)}var u=a.controller,h=a.currentMode,d=function(){var c,d,p,f;if(a.emit("wantsChangeMode",e,h))l(new Error("change mode canceled."));else{if(a.controller&&!1===o&&h===e)e===t.Mode.Panorama||e===t.Mode.DepthPanorama||e===t.Mode.Model||e===t.Mode.VRPanorama||e===t.Mode.XRPanorama?"number"==typeof i.panoIndex&&i.panoIndex!==a.panoIndex?a.controller.moveToPano(null!==(d=null!==(c=i.panoIndex)&&void 0!==c?c:a.panoIndex)&&void 0!==d?d:0,ie({duration:n},i),r):a.controller.updateCamera(i,n,r).catch(le):("number"==typeof i.panoIndex&&i.panoIndex!==a.panoIndex&&(a.panoIndex=i.panoIndex),a.controller.updateCamera(i,n,r).catch(le));else{u.destroy();var A=null!==(f=null!==(p=i.panoIndex)&&void 0!==p?p:a.panoIndex)&&void 0!==f?f:0,v=za(e)?a.panoramaLikeSavedPose:{};e===t.Mode.Mapview&&(v.longitude=a.panoramaLikeSavedPose.longitude),"number"!=typeof i.longitude&&"number"!=typeof i.latitude||(v.longitude=i.longitude,v.latitude=i.latitude),"number"==typeof i.fov&&(v.fov=i.fov),"Mapview"===e&&(v.distance=i.distance,v.offset=i.offset);var m=ie(ie({initial:[A,v,n,r]},a.commonParams()),a.controllerInits[e]);a.saveControllerPose(u),a.controller=a.applyController(e,m);var g=Ua[e].initAnimationEndPose(m);a.emit("modeChange",e,h,A,g,r)}s()}};if(e===t.Mode.VRPanorama)a.requestFullscreen(),("undefined"==typeof location||"https:"!==location.protocol?Promise.reject(new Error("Request DeviceOrientation Permission denied.")):"undefined"!=typeof DeviceOrientationEvent&&"function"==typeof DeviceOrientationEvent.requestPermission?DeviceOrientationEvent.requestPermission().then((function(e){if("granted"==e)return Promise.resolve();var t=new Error("Request DeviceOrientation Permission denied.");return Promise.reject(t)})):Promise.resolve()).then((function(){return d()})).catch((function(e){e instanceof Error&&(a.exitFullscreen(),a.throwError(e),l(e))}));else if(e===t.Mode.XRPanorama){var p=ke.shared.getContext();p?p.end():function(){if("xr"in navigator)return navigator.xr.isSessionSupported("immersive-vr").then((function(e){return e?Promise.resolve():Promise.reject()})).then((function(){return navigator.xr.requestSession("immersive-vr",{optionalFeatures:["local-floor","bounded-floor"]}).then((function(e){return Promise.resolve(e)}))}));var e=new Error("Request XR Permission denied.");return Promise.reject(e)}().then((function(e){ke.shared.setContext(e),d()})).catch((function(e){e instanceof Error&&(a.throwError(e),l(e))}))}else d()}))},t.prototype.getPixels=function(e,t,i,r,o){if(void 0===o&&(o=1),!this.renderer)throw new Error("renderer is not initialized.");var a=this.getPixelsRenderTarget,s=this.renderer.getSize(new n.Vector2);e=Kn(e,Math.floor(i/2),Math.floor(s.x-i)),t=Kn(t,Math.floor(r/2),Math.floor(s.y-r)),a.setSize(i*o,r*o),this.renderer.setRenderTarget(a),this.camera.setViewOffset(s.width,s.height,e,s.height-t-r,i,r),this.controller?this.controller.render():this.renderer.render(this.scene,this.camera);var l=new Uint8Array(i*o*r*o*4);return this.renderer.readRenderTargetPixels(a,0,0,i*o,r*o,l),this.renderer.setRenderTarget(null),this.camera.clearViewOffset(),l},t.prototype.getElement=function(){var e;return null===(e=this.renderer)||void 0===e?void 0:e.domElement},t.prototype.render=function(e,t){var i,n=this;if(void 0===t&&(t=!1),!this.renderer)return null;var r=Ue.shared,o=null===(i=this.model.getMaterial())||void 0===i?void 0:i.clippers;if(o&&r.update(o,this.camera),this.model.setMaterial({clipperPlanesArray:o?r.clipperPlanes:null,clipperFloors:o?r.clipperFloors:null}),t){var a=this.renderer.getSize(as);this.scene.traverseVisible((function(e){e.setResolution&&e.setResolution(a.x,a.y)}))}if(this.controller&&this.screenBuffers&&null===this.renderer.getRenderTarget()){var s=this.getDrawingBufferSize(as);return this.screenBuffers[0].setSize(s.x,s.y),this.screenBuffers[1].setSize(s.x,s.y),this.renderer.setRenderTarget(this.screenBuffers[0]),this.controller.render(),"VRPanorama"!==this.currentMode&&"XRPanorama"!==this.currentMode&&this.poweredByRealsee&&ns(this.renderer),this.renderer.setRenderTarget(null),e&&ke.shared.add(e,!0),this.screenBuffers[0]}return this.aroundScissor((function(){n.renderer&&(n.controller?n.controller.render():n.renderer.render(n.scene,n.camera),n.poweredByRealsee&&"VRPanorama"!==n.currentMode&&"XRPanorama"!==n.currentMode&&ns(n.renderer)),e&&ke.shared.add(e,!0)})),null},t.prototype.updateTime=function(e,t){for(var i,r,o,a=this,s=[],l=2;l<arguments.length;l++)s[l-2]=arguments[l];if(!this.destroyed){this.syncingState=this.syncState(e,t),this.controller&&(i=this.controller).updateTime.apply(i,ne([e,t],s,!1)),this.syncingState=!1,this.camera.updateTime(e,t);var c=new n.Vector2(512,512),u=new n.Vector2(512,512);this.renderer&&(this.renderer.getSize(c),c.x*=this.scissor.width,c.y*=this.scissor.height,this.renderer.getDrawingBufferSize(u),u.x*=this.scissor.width,u.y*=this.scissor.height),this.renderer&&this.model.update(this.renderer,this.camera);var h=new n.Box3;this.work&&h.union(this.work.boundingBox),this.model.empty||h.union(this.model.bounding),h.max.x+=1,h.max.y+=1,h.max.z+=1,h.min.x-=1,h.min.y-=.001,h.min.z-=1,h.getCenter(this.boundingMesh.position),h.getSize(this.boundingMesh.scale),this.boundingMesh.boundingBox.copy(h);var d=null!==(r=this.model.getMaterial())&&void 0!==r?r:{},p=1-(null!==(o=d.modelAlpha)&&void 0!==o?o:0);d.opacity=Kn(4*p-3,0,1),this.boundingMesh.setMaterial(d),this.boundingMesh.setTransparent(1!==p);var f=[];ls.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),ss.setFromProjectionMatrix(ls);for(var A=0,v=this.scene.children;A<v.length;A++){var m=v[A];m!==this.model&&(m instanceof n.Object3D&&m.traverseVisible((function(t){if(t.setResolution&&t.setResolution(c.x,c.y),t.setTime&&t.setTime(e),t.mixer instanceof n.AnimationMixer){var i=cs.get(t.mixer);i||(i=new n.Clock,cs.set(t.mixer,i)),t.mixer.update(i.getDelta())}(t instanceof n.Mesh||t instanceof n.Line||t instanceof n.Points)&&(t instanceof n.ImmediateRenderObject||!t.frustumCulled||ss.intersectsObject(t))&&f.push(t)})))}if(u.width*u.height>8388608?this.renderSwitch01=1^this.renderSwitch01:this.renderSwitch01=0,this.renderer&&!1===this.paused&&0===this.renderSwitch01){var g=void 0;if(!0!==this.onlyRenderIfNeeds)g=this.render();else{if(this.controller&&!0===this.controller.needsRender&&(this.controller.needsRender=!1,this.needsRender=!0),!0===this.camera.needsRender&&(this.camera.needsRender=!1,this.needsRender=!0),!0===this.model.needsRender&&(this.model.needsRender=!1,this.needsRender=!0),!0!==this.needsRender)for(var y=0,b=f;y<b.length;y++){var x=b[y],w=function(e){!0===e.needsRender?(e.needsRender=!1,a.needsRender=!0):e.mixer&&e.mixer.stats.actions.inUse>0&&(a.needsRender=!0)};w(x),x.traverseAncestors(w)}!1!==this.needsRender&&(g=this.render())}if(this.needsRender=!1,this.controller&&this.screenBuffers){var M=this.controller,C=this.screenBuffers;this.aroundScissor((function(){M.postProcessing(C[0],C[1]),a.copyEffect.render(C[1],void 0)}))}this.hasListener("renderFrame")&&this.emit("renderFrame",void 0!==g)}this.fps.testTime&&e-this.fps.testTime<1e3?this.fps.testCount++:(this.emit("fps",this.fps.testCount),this.fps.testTime=e,this.fps.testCount=0)}},t.prototype.pause=function(){this.paused=!0,this.renderer&&this.renderer instanceof Rt&&this.renderer.clear(!0,!0,!0)},t.prototype.play=function(){this.needsRender=!0,this.paused=!1},t.prototype.moveToPano=function(e,i,n){var r=this;void 0===i&&(i={}),void 0===n&&(n=!0);var o=this,a=o.controller,s=o.currentMode,l=o.renderer;return a?l?(s===t.Mode.Floorplan||s===t.Mode.Topview||s===t.Mode.Mapview?Un(e)||(this.panoIndex=e,this.once("initAnimationWillStart",(function(e,n){r.currentMode===t.Mode.Panorama&&i.moveStartCallback&&i.moveStartCallback(e,n)})),this.once("initAnimationEnded",(function(e,n){r.currentMode===t.Mode.Panorama&&i.moveEndCallback&&i.moveEndCallback(e,n)})),this.changeMode(t.Mode.Panorama,i,void 0,n)):a.moveToPano(e,i,n),this.ready()):(this.throwError(new Error("renderer is not initialized.")),Promise.resolve()):(this.throwError(new Error("controller is not initialized.")),Promise.resolve())},t.prototype.preloadPano=function(e,t){var i=this;if(void 0===t&&(t=le),!this.work)return Promise.reject(new Error("work never loaded"));var n=this.work.observers[e],r=this.work.allowHosts,o=ue();return Promise.all(["right","left","up","down","front","back"].map((function(t){var o=ie({key:"pano.".concat(e,".").concat(t)},ci(i.imageOptions,["size","format","quality","mappings"])),a=n.images[t];return Be(i.imageOptions.transform?i.imageOptions.transform(a,o):Le(a,o),{allowHosts:r,requestProxy:i.requestProxy,networkSubscribe:i.networkSubscribe})}))).then((function(){var e=ue()-o;return t(e),e}))},t.prototype.project2d=function(e,t){if(void 0===t&&(t=!1),!this.renderer)return null;if(!1===this.model.empty&&t){var i=this.camera.position,r=e.clone().sub(i),o=new n.Raycaster(i,r.clone().normalize()),a=this.model.intersectRaycaster(o)[0];if(a&&a.distance+.01<r.length())return null}var s=e.clone().project(this.camera);if(Math.abs(s.z)>1)return null;var l=this.renderer.getSize(new n.Vector2),c=l.x*this.scissor.width,u=l.y*this.scissor.height,h=l.x*this.scissor.left+(s.x+1)/2*c,d=l.y*(1-this.scissor.bottom-this.scissor.height)+(1-s.y)/2*u;return new n.Vector2(h,d)},t.prototype.getRenderObjects=function(e){ls.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),ss.setFromProjectionMatrix(ls),e||(e=this.scene);var t=[];return e.traverseVisible((function(e){(e instanceof n.Mesh||e instanceof n.Line||e instanceof n.Points)&&(e instanceof n.ImmediateRenderObject||!e.frustumCulled||ss.intersectsObject(e))&&t.push(e)})),t},t.prototype.getCurrentState=function(){return ie(ie({},this.getPose()),{mode:this.currentMode||t.Mode.Panorama,panoIndex:this.panoIndex||0})},t.prototype.setState=function(e,i,r){var o,a,s,l,c,u,h,d,p;void 0===i&&(i=!1),void 0===r&&(r=!0),!(e=Object.assign({},e)).offset||e instanceof n.Vector3||(e.offset=new n.Vector3(e.offset.x,e.offset.y,e.offset.z));var f,A,v,m,g,y=null!==(o=e.panoIndex)&&void 0!==o?o:this.state.panoIndex,b=null!==(a=e.mode)&&void 0!==a?a:this.state.mode;if(this.work)if(this.work.observers[y])if(e.mode!==t.Mode.Floorplan&&e.mode!==t.Mode.Topview&&e.mode!==t.Mode.Mapview&&e.mode!==t.Mode.Model||!Un(this.model)&&!0===this.model.loaded){if(this.state.mode!==b){if("VRPanorama"===b)return void this.changeMode("VRPanorama",void 0,void 0,!0);var x=void 0;x=za(this.state.mode)&&za(b)?ie({},this.state):za(b)?ie({},this.panoramaLikeSavedPose):b===t.Mode.Mapview?{longitude:this.panoramaLikeSavedPose.latitude}:ie({},e),"number"==typeof e.longitude&&(x.longitude=e.longitude),"number"==typeof e.latitude&&(x.latitude=e.latitude),"number"==typeof e.fov&&(x.fov=e.fov),"number"==typeof e.distance&&"Mapview"===e.mode&&(x.distance=e.distance),e.offset instanceof n.Vector3&&"Mapview"===e.mode&&(x.offset=e.offset);var w=ie(ie({initial:[y,x,this.modeChangeDuration,!1]},this.commonParams()),this.controllerInits[b]),M=Ua[b].initAnimationEndPose(w);f=M.longitude,A=M.latitude,v=M.fov,m=M.offset,g=M.distance}else f=null!==(s=e.longitude)&&void 0!==s?s:this.state.longitude,A=null!==(l=e.latitude)&&void 0!==l?l:this.state.latitude,v=null!==(c=e.fov)&&void 0!==c?c:this.state.fov,m=null!==(u=e.offset)&&void 0!==u?u:this.state.offset,g=null!==(h=e.distance)&&void 0!==h?h:this.state.distance;var C={panoIndex:y,mode:b,longitude:f,latitude:A,fov:v,offset:m,distance:g};this.emit("setState",C),Or(this.state,C)||(this.controller&&"VRPanorama"===C.mode&&C.mode!==this.state.mode?(Lr(this.state,C),this.changeMode("VRPanorama")):this.controller&&"XRPanorama"===C.mode&&C.mode!==this.state.mode?(Lr(this.state,C),this.changeMode("XRPanorama")):(Lr(this.state,C),this.controller&&(this.controller.userAction=r),i&&this.state.mode===C.mode&&(this.syncingState=this.syncState(ue(),0,i),this.syncingState&&(null===(d=this.controller)||void 0===d||d.updateTime(ue(),0),this.syncingState=!1)),this.emit("stateChange",this.state,r),null===(p=this.analysis)||void 0===p||p.state(this.work,this.state)))}else this.throwError(new Error("model is not ready."));else this.throwError(new Error("panoIndex not found in work"));else this.throwError(new Error("work never load."))},t.prototype.aroundScissor=function(e){if(this.renderer)if("XRPanorama"!==this.state.mode){var t=new n.Vector2,i=0!==this.scissor.left||0!==this.scissor.bottom||1!==this.scissor.width||1!==this.scissor.height;if(i){this.renderer.getSize(t);var r=Math.floor(t.x*this.scissor.left),o=Math.floor(t.y*this.scissor.bottom),a=Math.floor(t.x*this.scissor.width),s=Math.floor(t.y*this.scissor.height);this.renderer.setViewport(r,o,a,s),this.renderer.setScissor(r,o,a,s),this.renderer.setScissorTest(!0)}e(),i&&(this.renderer.setViewport(0,0,t.x,t.y),this.renderer.setScissor(0,0,t.x,t.y),this.renderer.setScissorTest(!1))}else e()},t.prototype.syncState=function(e,i,r){void 0===r&&(r=!1);var o=this.stateSynced;if(this.stateSynced=!1,!this.work)return!1;if(!this.controller)return!1;if(this.state.mode!==this.currentMode){var a={mode:this.state.mode,panoIndex:this.state.panoIndex,longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset,distance:this.state.distance};return this.changeMode(this.state.mode,a,this.modeChangeDuration,this.controller.userAction),!0}if(!1===this.controller.isReady())return!1;if(this.controller instanceof Ua.Model){if(!this.camera.pose.offset.equals(this.state.offset)){var s={longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset};return this.controller.moveToPosition(this.state.offset,ie(ie({},s),{duration:r?0:void 0}),!1),!0}}else if(this.state.panoIndex!==this.panoIndex){s={longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset,distance:this.state.distance};return this.controller.moveToPano(this.state.panoIndex,s,!1),!0}if(this.controller instanceof Ua.Topview||this.controller instanceof Ua.Mapview){var l=1,c=r?this.state.fov:Dr(this.camera.pose.fov,this.state.fov,l),u=r?this.state.distance:Dr(this.camera.pose.distance,this.state.distance,.2),h=r?new n.Vector3(this.state.offset.x,this.state.offset.y,this.state.offset.z):new n.Vector3(Dr(this.camera.pose.offset.x,this.state.offset.x,.2),Dr(this.camera.pose.offset.y,this.state.offset.y,.2),Dr(this.camera.pose.offset.z,this.state.offset.z,.2));if(Cr(c,this.camera.pose.fov)||Ir(h,this.camera.pose.offset)||Cr(u,this.camera.pose.distance)){var d={x:h.x,y:h.y,z:h.z};return this.controller instanceof Ua.Mapview&&Object.assign(d,{distance:u}),this.controller.cameraMotion.set({fov:c},0).catch(le),this.controller.locationMotion.set(d,0).catch(le),!0}}else{l=1;var p=Math.PI/45,f=(c=r?this.state.fov:Dr(this.camera.pose.fov,this.state.fov,l),r?{longitude:this.state.longitude,latitude:this.state.latitude}:function(e,t,i){if(e.longitude===t.longitude&&e.latitude===t.latitude)return{longitude:t.longitude,latitude:t.latitude};var n=Rr(e.longitude),r=e.latitude,o=Rr(t.longitude),a=t.latitude;o-n>kr?n+=Qr:n-o>kr&&(n-=Qr);var s=i/Math.sqrt(Math.pow(o-n,2)+Math.pow(a-r,2));return s>=1?{longitude:t.longitude,latitude:t.latitude}:{longitude:n+(o-n)*s,latitude:r+(a-r)*s}}({longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude},{longitude:this.state.longitude,latitude:this.state.latitude},p)),A=f.longitude,v=f.latitude;if(Cr(A,this.camera.pose.longitude,2*Math.PI)||Cr(v,this.camera.pose.latitude)||Cr(c,this.camera.pose.fov))return this.controller.cameraMotion.set({longitude:A,latitude:v,fov:c},0).catch(le),!0}if(this.stateSynced=!0,!1===o&&this.emit("stateSynced",this.state),this.readyCallbacks.length&&this.stateSynced){var m=this.currentMode;if(!(m===t.Mode.Floorplan||m===t.Mode.Topview||m===t.Mode.Mapview||m===t.Mode.Model)||!this.modelPending){var g=this.readyCallbacks.slice();this.readyCallbacks.length=0;for(var y=0,b=g;y<b.length;y++){var x=b[y];this.controller instanceof Ua.Panorama?!0!==x.tile||this.controller.isTileReady()?x():this.readyCallbacks.push(x):x()}}}return!1},t.prototype.ready=function(e){var t=this;return void 0===e&&(e={}),new Promise((function(i){var n;t.readyCallbacks.push(Object.assign(i,{tile:null!==(n=e.tile)&&void 0!==n&&n}))}))},t.prototype.requestFullscreen=function(){var e;if(Fr()){var t=null===(e=this.getElement())||void 0===e?void 0:e.parentNode;t&&"requestFullscreen"in t&&"undefined"!=typeof document&&null===document.fullscreenElement&&t.requestFullscreen()}},t.prototype.exitFullscreen=function(){"undefined"!=typeof document&&document.fullscreenElement&&"exitFullscreen"in document&&document.exitFullscreen()},t.prototype.throwError=function(e){this.hasListener("error")?this.emit("error",e):console.error(e)},t.prototype.loadModel=function(e,t,i,r,o){var a=this,s=t.file;this.emit("modelWillLoad",t);var l=new _n({allowHosts:i,requestProxy:this.requestProxy,networkSubscribe:this.networkSubscribe});l.workCode=e,l.once("bvhLoaded",(function(){var e,t;a.destroyed||s===(null===(t=null===(e=a.work)||void 0===e?void 0:e.model)||void 0===t?void 0:t.file)&&a.emit("modelBvhLoaded",l)})),l.once("materialLoaded",(function(){var e,t;a.destroyed||s===(null===(t=null===(e=a.work)||void 0===e?void 0:e.model)||void 0===t?void 0:t.file)&&a.emit("modelMaterialLoaded",l)})),l.once("geometryLoaded",(function(){var e,t;a.destroyed||s===(null===(t=null===(e=a.work)||void 0===e?void 0:e.model)||void 0===t?void 0:t.file)&&(l.bounding.max.y-l.bounding.min.y<1.5&&(l.bounding.max.y=l.bounding.min.y+10),a.emit("modelGeometryLoaded",l))})),l.once("loaded",(function(){var e,t,i,n;if(!a.destroyed&&s===(null===(t=null===(e=a.work)||void 0===e?void 0:e.model)||void 0===t?void 0:t.file)){var o,c=a.model;c&&(c.show(),o=c.getMaterial()||{},a.scene.remove(c),c.dispose(),l.setTransparent(c.getTransparent())),o&&l.setMaterial(o),a.model=l,a.scene.add(l),null===(i=a.controller)||void 0===i||i.updateModel(l),null===(n=a.renderer)||void 0===n||n.compile(a.scene,a.camera),a.needsRender=!0,a.modelPending=!1,r(),a.emit("modelLoaded",l)}})),l.on("shownFloorChange",(function(e,t){var i,n;a.destroyed||s===(null===(n=null===(i=a.work)||void 0===i?void 0:i.model)||void 0===n?void 0:n.file)&&a.emit("modelShownFloorChange",e,t)})),l.on("error",(function(e){var t,i,o,c;if(!a.destroyed&&s===(null===(i=null===(t=a.work)||void 0===t?void 0:t.model)||void 0===i?void 0:i.file)){l.bounding.makeEmpty();for(var u=0,h=a.work.observers;u<h.length;u++){var d=h[u];l.bounding.expandByPoint(d.standingPosition),l.bounding.expandByPoint((new n.Vector3).fromArray([d.position.x,2*d.position.y-d.standingPosition.y,d.position.z]))}var p=Tr(l.bounding,new n.Vector3(1,0,1));p.visible=!0,p.name="model_empty",l.add(p);var f,A=a.model;A&&(A.show(),f=A.getMaterial()||{},a.scene.remove(A),A.dispose(),l.setTransparent(A.getTransparent())),f&&l.setMaterial(f),a.model=l,a.scene.add(l),null===(o=a.controller)||void 0===o||o.updateModel(l),null===(c=a.renderer)||void 0===c||c.compile(a.scene,a.camera),a.emit("modelLoadError",e,l),a.throwError(e),a.modelPending=!1,r()}})),this.modelPending=!0,l.load(t,this.textureOptions).catch(le)},t.prototype.commonParams=function(){return{ident:this.ident,scene:this.scene,parallaxScene:this.parallaxScene,helper:this.helperGroup,boundingMesh:this.boundingMesh,camera:this.camera,renderer:this.renderer,scissor:this.scissor,element:this.getElement(),model:this.model,work:this.work,imageOptions:this.imageOptions,enableIOSEDR:this._enableIOSEDR,extraElements:this.extraElements,videoTexture:this.videoTexture,networkSubscribe:this.networkSubscribe,requestProxy:this.requestProxy}},t.prototype.saveControllerPose=function(e){void 0===e&&(e=this.controller),e&&za(e)&&(this.panoramaLikeSavedPose.longitude=this.camera.pose.longitude,this.panoramaLikeSavedPose.latitude=this.camera.pose.latitude,this.panoramaLikeSavedPose.fov=this.camera.pose.fov)},t.prototype.applyController=function(e,i){var n=this;if(!this.renderer)throw new Error("renderer is not initialized.");var r=Ua[e];e===this.currentMode||this.model.empty||this.model.show(),this.model.setTransparent(e===t.Mode.Floorplan||e===t.Mode.Topview||e===t.Mode.Model||e===t.Mode.Mapview),this.currentMode=e;for(var o=new r(i),a=function(e){o.on(e,(function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];var r=n.emit.apply(n,ne([e],t,!1));if(r)return!1}))},s=0,l=qa;s<l.length;s++){a(l[s])}var c=Ua[e].initAnimationEndPose(i),u=i.initial[3],h={panoIndex:i.initial[0],mode:e,longitude:c.longitude,latitude:c.latitude,fov:c.fov,offset:c.offset,distance:c.distance};return Or(this.state,h)||(Lr(this.state,h),this.emit("stateChange",this.state,u)),this.emit("currentStateChange",this.getCurrentState(),u),o.on("cameraUpdate",(function(t,i){var r;if(n.controller){var o=ie(ie({},n.controller.getTargetPose()),{panoIndex:n.panoIndex,mode:e});i&&!1===n.syncingState&&n.state.mode===o.mode&&!Or(n.state,o)&&(Lr(n.state,o),n.emit("stateChange",n.state,i),null===(r=n.analysis)||void 0===r||r.state(n.work,n.state))}n.emit("currentStateChange",n.getCurrentState(),i)})),o.on("initAnimationWillStart",(function(t,i,r){var o,a=ie(ie({},i),{panoIndex:t,mode:e});r&&n.state.mode===a.mode&&!Or(n.state,a)&&(Lr(n.state,a),n.emit("stateChange",n.state,r),null===(o=n.analysis)||void 0===o||o.state(n.work,n.state))})),o.on("initAnimationEnded",(function(t,i,r){var o,a=ie(ie({},i),{panoIndex:t,mode:e});r&&n.state.mode===a.mode&&!Or(n.state,a)&&(Lr(n.state,a),n.emit("stateChange",n.state,r),null===(o=n.analysis)||void 0===o||o.state(n.work,n.state))})),o.on("panoWillArrive",(function(t,i,r){var o;n.panoIndex=t;var a=ie(ie({},i),{panoIndex:t,mode:e});r&&n.state.mode===a.mode&&!Or(n.state,a)&&(Lr(n.state,a),n.emit("stateChange",n.state,r),null===(o=n.analysis)||void 0===o||o.state(n.work,n.state))})),o.on("panoArrived",(function(t,i,r){var o,a=ie(ie({},i),{panoIndex:t,mode:e});r&&n.state.mode===a.mode&&!Or(n.state,a)&&(Lr(n.state,a),n.emit("stateChange",n.state,r),null===(o=n.analysis)||void 0===o||o.state(n.work,n.state))})),o.on("moveToPano",(function(e,t){n.emit("currentStateChange",n.getCurrentState(),t)})),o.on("wantsMoveToPano",(function(e,t,i){var r=n.emit("wantsMoveToPano",e,t,i);r||(r=n.emit("wantsToMoveToPano",e,t,i)),r||n.moveToPano(e,t,i)})),o.on("vrWantsToExit",(function(){n.currentMode===t.Mode.VRPanorama&&(n.exitFullscreen(),n.changeMode(t.Mode.Panorama))})),o.on("error",(function(e){return n.throwError(e)})),o},t.prototype.removeEventListeners=function(){},t.prototype.diposeGPUPickingMaterial=function(){this.meshReplaceMaterialMap.forEach((function(e){e.dispose()})),this.meshOriginMaterialMap.forEach((function(e){e.dispose()}))},t.Mode={Panorama:"Panorama",Model:"Model",Floorplan:"Floorplan",Topview:"Topview",Mapview:"Mapview",DepthPanorama:"DepthPanorama",VRPanorama:"VRPanorama",XRPanorama:"XRPanorama"},t.Line=null,t}(se),ds={instances:{},constructor:hs};"undefined"!=typeof window&&Object.assign(window,{__FIVE_DEBUG__:ds});var ps=function(){function e(){}return e.createButton=function(e){var t=document.createElement("button");function i(){t.style.display="",t.style.cursor="auto",t.style.left="calc(50% - 75px)",t.style.width="150px",t.onmouseenter=null,t.onmouseleave=null,t.onclick=null,t.textContent="VR NOT SUPPORTED"}function n(e){e.style.position="absolute",e.style.bottom="20px",e.style.padding="12px 6px",e.style.border="1px solid #fff",e.style.borderRadius="4px",e.style.background="rgba(0,0,0,0.1)",e.style.color="#fff",e.style.font="normal 13px sans-serif",e.style.textAlign="center",e.style.opacity="0.5",e.style.outline="none",e.style.zIndex="999"}if("xr"in navigator)return t.id="VRButton",t.style.display="none",n(t),navigator.xr.isSessionSupported("immersive-vr").then((function(n){n?(t.style.display="",t.style.cursor="pointer",t.style.left="calc(50% - 50px)",t.style.width="100px",t.textContent="ENTER VR",t.onmouseenter=function(){t.style.opacity="1.0"},t.onmouseleave=function(){t.style.opacity="0.5"},t.onclick=function(){e&&e()}):i()})),t;var r=document.createElement("a");return!1===window.isSecureContext?(r.href=document.location.href.replace(/^http:/,"https:"),r.innerHTML="WEBXR NEEDS HTTPS"):(r.href="https://immersiveweb.dev/",r.innerHTML="WEBXR NOT AVAILABLE"),r.style.left="calc(50% - 90px)",r.style.width="180px",r.style.textDecoration="none",n(r),r},e}();exports.AnimationFrameLoop=ke,exports.BVH=Xt,exports.BVHIntersect=_t,exports.BVHNode=Ht,exports.BVHVector3=qt,exports.Camera=zt,exports.Clipper=Ue,exports.Five=hs,exports.InternalWebGLRenderer=Rt,exports.IntersectMesh=wr,exports.Model=_n,exports.NetworkSubscribe=Ee,exports.PBMContainer=qe,exports.PBMGroup=He,exports.PBMMaterial=Pt,exports.PBMMesh=ze,exports.PROXY_CONTROLLER_EVENT_NAMES=qa,exports.PanoCircleMesh=pr,exports.PanoCircleMeshCustom=yr,exports.PanoCircleMeshSolid=vr,exports.Scene=kt,exports.Subscribe=se,exports.TextureLoader=Et,exports.Tile3D=bn,exports.Tile3DModel=Vn,exports.TileBoundingSphere=Ki,exports.TileCacheNode=Di,exports.TileCubeTextureTarget=Ct,exports.TileCullingVolume=zi,exports.TileOrientedBoundingBox=hn,exports.TileRequestScheduler=Qi,exports.Tileset3D=Cn,exports.Tileset3DTraverser=wn,exports.TilesetCache=Li,exports.Work=ir,exports.XRButton=ps,exports.defaultImageURLTransform=Le,exports.getViewportScale=_a,exports.imageSupport=function(){return Ve||(Ve=Promise.all([Ne("data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A="),Ne("data:image/webp;base64,UklGRjoAAABXRUJQVlA4IC4AAACyAgCdASoCAAIALmk0mk0iIiIiIgBoSygABc6WWgAA/veff/0PP8bA//LwYAAA")]).then((function(e){var t=e[0];return{webp:e[1],avif:t}})).catch((function(){return{webp:!1,avif:!1}})))},exports.parseWork=ar;
|
|
362
|
+
* Licensed under the MIT license */var qr=function(e,t,i,n){var r,o=["","webkit","Moz","MS","ms","o"],a=t.createElement?t.createElement("div"):n,s=Math.round,l=Math.abs,c=Date.now;function u(e,t,i){return setTimeout(m(e,i),t)}function h(e,t,i){return!!Array.isArray(e)&&(d(e,i[t],i),!0)}function d(e,t,i){var r;if(e)if(e.forEach)e.forEach(t,i);else if(e.length!==n)for(r=0;r<e.length;)t.call(i,e[r],r,e),r++;else for(r in e)e.hasOwnProperty(r)&&t.call(i,e[r],r,e)}function p(t,i,n){var r="DEPRECATED METHOD: "+i+"\n"+n+" AT \n";return function(){var i=new Error("get-stack-trace"),n=i&&i.stack?i.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=e.console&&(e.console.warn||e.console.log);return o&&o.call(e.console,r,n),t.apply(this,arguments)}}r="function"!=typeof Object.assign?function(e){if(e===n||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),i=1;i<arguments.length;i++){var r=arguments[i];if(r!==n&&null!==r)for(var o in r)r.hasOwnProperty(o)&&(t[o]=r[o])}return t}:Object.assign;var f=p((function(e,t,i){for(var r=Object.keys(t),o=0;o<r.length;)(!i||i&&e[r[o]]===n)&&(e[r[o]]=t[r[o]]),o++;return e}),"extend","Use `assign`."),A=p((function(e,t){return f(e,t,!0)}),"merge","Use `assign`.");function v(e,t,i){var n,o=t.prototype;(n=e.prototype=Object.create(o)).constructor=e,n._super=o,i&&r(n,i)}function m(e,t){return function(){return e.apply(t,arguments)}}function g(e,t){return"function"==typeof e?e.apply(t&&t[0]||n,t):e}function y(e,t){return e===n?t:e}function b(e,t,i){d(C(t),(function(t){e.addEventListener(t,i,!1)}))}function x(e,t,i){d(C(t),(function(t){e.removeEventListener(t,i,!1)}))}function w(e,t){for(;e;){if(e==t)return!0;e=e.parentNode}return!1}function M(e,t){return e.indexOf(t)>-1}function C(e){return e.trim().split(/\s+/g)}function E(e,t,i){if(e.indexOf&&!i)return e.indexOf(t);for(var n=0;n<e.length;){if(i&&e[n][i]==t||!i&&e[n]===t)return n;n++}return-1}function I(e){return Array.prototype.slice.call(e,0)}function S(e,t,i){for(var n=[],r=[],o=0;o<e.length;){var a=t?e[o][t]:e[o];E(r,a)<0&&n.push(e[o]),r[o]=a,o++}return i&&(n=t?n.sort((function(e,i){return e[t]>i[t]})):n.sort()),n}function B(e,t){for(var i,r,a=t[0].toUpperCase()+t.slice(1),s=0;s<o.length;){if((r=(i=o[s])?i+a:t)in e)return r;s++}return n}var T=1;function P(t){var i=t.ownerDocument||t;return i.defaultView||i.parentWindow||e}var R="ontouchstart"in e,k=B(e,"PointerEvent")!==n,Q=R&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),D="touch",F="mouse",L=24,O=["x","y"],N=["clientX","clientY"];function V(e,t){var i=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(t){g(e.options.enable,[e])&&i.handler(t)},this.init()}function U(e,t,i){var r=i.pointers.length,o=i.changedPointers.length,a=1&t&&r-o==0,s=12&t&&r-o==0;i.isFirst=!!a,i.isFinal=!!s,a&&(e.session={}),i.eventType=t,function(e,t){var i=e.session,r=t.pointers,o=r.length;i.firstInput||(i.firstInput=z(t));o>1&&!i.firstMultiple?i.firstMultiple=z(t):1===o&&(i.firstMultiple=!1);var a=i.firstInput,s=i.firstMultiple,u=s?s.center:a.center,h=t.center=q(r);t.timeStamp=c(),t.deltaTime=t.timeStamp-a.timeStamp,t.angle=j(u,h),t.distance=K(u,h),function(e,t){var i=t.center,n=e.offsetDelta||{},r=e.prevDelta||{},o=e.prevInput||{};1!==t.eventType&&4!==o.eventType||(r=e.prevDelta={x:o.deltaX||0,y:o.deltaY||0},n=e.offsetDelta={x:i.x,y:i.y});t.deltaX=r.x+(i.x-n.x),t.deltaY=r.y+(i.y-n.y)}(i,t),t.offsetDirection=_(t.deltaX,t.deltaY);var d=H(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=d.x,t.overallVelocityY=d.y,t.overallVelocity=l(d.x)>l(d.y)?d.x:d.y,t.scale=s?function(e,t){return K(t[0],t[1],N)/K(e[0],e[1],N)}(s.pointers,r):1,t.rotation=s?function(e,t){return j(t[1],t[0],N)+j(e[1],e[0],N)}(s.pointers,r):0,t.maxPointers=i.prevInput?t.pointers.length>i.prevInput.maxPointers?t.pointers.length:i.prevInput.maxPointers:t.pointers.length,function(e,t){var i,r,o,a,s=e.lastInterval||t,c=t.timeStamp-s.timeStamp;if(8!=t.eventType&&(c>25||s.velocity===n)){var u=t.deltaX-s.deltaX,h=t.deltaY-s.deltaY,d=H(c,u,h);r=d.x,o=d.y,i=l(d.x)>l(d.y)?d.x:d.y,a=_(u,h),e.lastInterval=t}else i=s.velocity,r=s.velocityX,o=s.velocityY,a=s.direction;t.velocity=i,t.velocityX=r,t.velocityY=o,t.direction=a}(i,t);var p=e.element;w(t.srcEvent.target,p)&&(p=t.srcEvent.target);t.target=p}(e,i),e.emit("hammer.input",i),e.recognize(i),e.session.prevInput=i}function z(e){for(var t=[],i=0;i<e.pointers.length;)t[i]={clientX:s(e.pointers[i].clientX),clientY:s(e.pointers[i].clientY)},i++;return{timeStamp:c(),pointers:t,center:q(t),deltaX:e.deltaX,deltaY:e.deltaY}}function q(e){var t=e.length;if(1===t)return{x:s(e[0].clientX),y:s(e[0].clientY)};for(var i=0,n=0,r=0;r<t;)i+=e[r].clientX,n+=e[r].clientY,r++;return{x:s(i/t),y:s(n/t)}}function H(e,t,i){return{x:t/e||0,y:i/e||0}}function _(e,t){return e===t?1:l(e)>=l(t)?e<0?2:4:t<0?8:16}function K(e,t,i){i||(i=O);var n=t[i[0]]-e[i[0]],r=t[i[1]]-e[i[1]];return Math.sqrt(n*n+r*r)}function j(e,t,i){i||(i=O);var n=t[i[0]]-e[i[0]],r=t[i[1]]-e[i[1]];return 180*Math.atan2(r,n)/Math.PI}V.prototype={handler:function(){},init:function(){this.evEl&&b(this.element,this.evEl,this.domHandler),this.evTarget&&b(this.target,this.evTarget,this.domHandler),this.evWin&&b(P(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&x(this.element,this.evEl,this.domHandler),this.evTarget&&x(this.target,this.evTarget,this.domHandler),this.evWin&&x(P(this.element),this.evWin,this.domHandler)}};var G={mousedown:1,mousemove:2,mouseup:4},W="mousedown",X="mousemove mouseup";function Y(){this.evEl=W,this.evWin=X,this.pressed=!1,V.apply(this,arguments)}v(Y,V,{handler:function(e){var t=G[e.type];1&t&&(0===e.button||2===e.button)&&(this.pressed=!0),2&t&&1!==e.which&&(t=4),this.pressed&&(4&t&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:F,srcEvent:e}))}});var Z={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},J={2:D,3:"pen",4:F,5:"kinect"},$="pointerdown",ee="pointermove pointerup pointercancel";function te(){this.evEl=$,this.evWin=ee,V.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}e.MSPointerEvent&&!e.PointerEvent&&($="MSPointerDown",ee="MSPointerMove MSPointerUp MSPointerCancel"),v(te,V,{handler:function(e){var t=this.store,i=!1,n=!1,r=e.type.toLowerCase().replace("ms",""),o=Z[r],a=J[e.pointerType]||e.pointerType,s=a==D,l=E(t,e.pointerId,"pointerId");1&o&&(0===e.button||2===e.button||s)?l<0&&(t.push(e),l=t.length-1):12&o?i=!0:s||0!==e.buttons||(i=!0,n=!0,o=Z.pointerup),l<0||(n||(t[l]=e),this.callback(this.manager,o,{pointers:t,changedPointers:[e],pointerType:a,srcEvent:t[l]}),i&&t.splice(l,1))}});var ie={touchstart:1,touchmove:2,touchend:4,touchcancel:8},ne="touchstart",re="touchstart touchmove touchend touchcancel";function oe(){this.evTarget=ne,this.evWin=re,this.started=!1,V.apply(this,arguments)}function ae(e,t){var i=I(e.touches),n=I(e.changedTouches);return 12&t&&(i=S(i.concat(n),"identifier",!0)),[i,n]}v(oe,V,{handler:function(e){var t=ie[e.type];if(1===t&&(this.started=!0),this.started){var i=ae.call(this,e,t);12&t&&i[0].length-i[1].length==0&&(this.started=!1),this.callback(this.manager,t,{pointers:i[0],changedPointers:i[1],pointerType:D,srcEvent:e})}}});var se={touchstart:1,touchmove:2,touchend:4,touchcancel:8},le="touchstart touchmove touchend touchcancel";function ce(){this.evTarget=le,this.targetIds={},V.apply(this,arguments)}function ue(e,t){var i=I(e.touches),n=this.targetIds;if(3&t&&1===i.length)return n[i[0].identifier]=!0,[i,i];var r,o,a=I(e.changedTouches),s=[],l=this.target;if(o=i.filter((function(e){return w(e.target,l)})),1===t)for(r=0;r<o.length;)n[o[r].identifier]=!0,r++;for(r=0;r<a.length;)n[a[r].identifier]&&s.push(a[r]),12&t&&delete n[a[r].identifier],r++;return s.length?[S(o.concat(s),"identifier",!0),s]:void 0}v(ce,V,{handler:function(e){var t=se[e.type],i=ue.call(this,e,t);i&&this.callback(this.manager,t,{pointers:i[0],changedPointers:i[1],pointerType:D,srcEvent:e})}});function he(){V.apply(this,arguments);var e=m(this.handler,this);this.touch=new ce(this.manager,e),this.mouse=new Y(this.manager,e),this.primaryTouch=null,this.lastTouches=[]}function de(e,t){1&e?(this.primaryTouch=t.changedPointers[0].identifier,pe.call(this,t)):12&e&&pe.call(this,t)}function pe(e){var t=e.changedPointers[0];if(t.identifier===this.primaryTouch){var i={x:t.clientX,y:t.clientY};this.lastTouches.push(i);var n=this.lastTouches;setTimeout((function(){var e=n.indexOf(i);e>-1&&n.splice(e,1)}),2500)}}function fe(e){for(var t=e.srcEvent.clientX,i=e.srcEvent.clientY,n=0;n<this.lastTouches.length;n++){var r=this.lastTouches[n],o=Math.abs(t-r.x),a=Math.abs(i-r.y);if(o<=25&&a<=25)return!0}return!1}v(he,V,{handler:function(e,t,i){var n=i.pointerType==D,r=i.pointerType==F;if(!(r&&i.sourceCapabilities&&i.sourceCapabilities.firesTouchEvents)){if(n)de.call(this,t,i);else if(r&&fe.call(this,i))return;this.callback(e,t,i)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var Ae=a?B(a.style,"touchAction"):n,ve=Ae!==n,me="compute",ge="auto",ye="manipulation",be="none",xe="pan-x",we="pan-y",Me=function(){if(!ve)return!1;var t={},i=e.CSS&&e.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach((function(n){t[n]=!i||e.CSS.supports("touch-action",n)})),t}();function Ce(e,t){this.manager=e,this.set(t)}Ce.prototype={set:function(e){e==me&&(e=this.compute()),ve&&this.manager.element.style&&Me[e]&&(this.manager.element.style[Ae]=e),this.actions=e.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var e=[];return d(this.manager.recognizers,(function(t){g(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))})),function(e){if(M(e,be))return be;var t=M(e,xe),i=M(e,we);if(t&&i)return be;if(t||i)return t?xe:we;if(M(e,ye))return ye;return ge}(e.join(" "))},preventDefaults:function(e){var t=e.srcEvent,i=e.offsetDirection;if(this.manager.session.prevented)t.preventDefault();else{var n=this.actions,r=M(n,be)&&!Me.none,o=M(n,we)&&!Me["pan-y"],a=M(n,xe)&&!Me["pan-x"];if(r){var s=1===e.pointers.length,l=e.distance<2,c=e.deltaTime<250;if(s&&l&&c)return}if(!a||!o)return r||o&&6&i||a&&i&L?this.preventSrc(t):void 0}},preventSrc:function(e){this.manager.session.prevented=!0,e.preventDefault()}};var Ee=32;function Ie(e){this.options=r({},this.defaults,e||{}),this.id=T++,this.manager=null,this.options.enable=y(this.options.enable,!0),this.state=1,this.simultaneous={},this.requireFail=[]}function Se(e){return 16&e?"cancel":8&e?"end":4&e?"move":2&e?"start":""}function Be(e){return 16==e?"down":8==e?"up":2==e?"left":4==e?"right":""}function Te(e,t){var i=t.manager;return i?i.get(e):e}function Pe(){Ie.apply(this,arguments)}function Re(){Pe.apply(this,arguments),this.pX=null,this.pY=null}function ke(){Pe.apply(this,arguments)}function Qe(){Ie.apply(this,arguments),this._timer=null,this._input=null}function De(){Pe.apply(this,arguments)}function Fe(){Pe.apply(this,arguments)}function Le(){Ie.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function Oe(e,t){return(t=t||{}).recognizers=y(t.recognizers,Oe.defaults.preset),new Ne(e,t)}Ie.prototype={defaults:{},set:function(e){return r(this.options,e),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(e){if(h(e,"recognizeWith",this))return this;var t=this.simultaneous;return t[(e=Te(e,this)).id]||(t[e.id]=e,e.recognizeWith(this)),this},dropRecognizeWith:function(e){return h(e,"dropRecognizeWith",this)||(e=Te(e,this),delete this.simultaneous[e.id]),this},requireFailure:function(e){if(h(e,"requireFailure",this))return this;var t=this.requireFail;return-1===E(t,e=Te(e,this))&&(t.push(e),e.requireFailure(this)),this},dropRequireFailure:function(e){if(h(e,"dropRequireFailure",this))return this;e=Te(e,this);var t=E(this.requireFail,e);return t>-1&&this.requireFail.splice(t,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(e){var t=this,i=this.state;function n(i){t.manager.emit(i,e)}i<8&&n(t.options.event+Se(i)),n(t.options.event),e.additionalEvent&&n(e.additionalEvent),i>=8&&n(t.options.event+Se(i))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=Ee},canEmit:function(){for(var e=0;e<this.requireFail.length;){if(!(33&this.requireFail[e].state))return!1;e++}return!0},recognize:function(e){var t=r({},e);if(!g(this.options.enable,[this,t]))return this.reset(),void(this.state=Ee);56&this.state&&(this.state=1),this.state=this.process(t),30&this.state&&this.tryEmit(t)},process:function(e){},getTouchAction:function(){},reset:function(){}},v(Pe,Ie,{defaults:{pointers:1},attrTest:function(e){var t=this.options.pointers;return 0===t||e.pointers.length===t},process:function(e){var t=this.state,i=e.eventType,n=6&t,r=this.attrTest(e);return n&&(8&i||!r)?16|t:n||r?4&i?8|t:2&t?4|t:2:Ee}}),v(Re,Pe,{defaults:{event:"pan",threshold:10,pointers:1,direction:30},getTouchAction:function(){var e=this.options.direction,t=[];return 6&e&&t.push(we),e&L&&t.push(xe),t},directionTest:function(e){var t=this.options,i=!0,n=e.distance,r=e.direction,o=e.deltaX,a=e.deltaY;return r&t.direction||(6&t.direction?(r=0===o?1:o<0?2:4,i=o!=this.pX,n=Math.abs(e.deltaX)):(r=0===a?1:a<0?8:16,i=a!=this.pY,n=Math.abs(e.deltaY))),e.direction=r,i&&n>t.threshold&&r&t.direction},attrTest:function(e){return Pe.prototype.attrTest.call(this,e)&&(2&this.state||!(2&this.state)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=Be(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),v(ke,Pe,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[be]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||2&this.state)},emit:function(e){if(1!==e.scale){var t=e.scale<1?"in":"out";e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}}),v(Qe,Ie,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[ge]},process:function(e){var t=this.options,i=e.pointers.length===t.pointers,n=e.distance<t.threshold,r=e.deltaTime>t.time;if(this._input=e,!n||!i||12&e.eventType&&!r)this.reset();else if(1&e.eventType)this.reset(),this._timer=u((function(){this.state=8,this.tryEmit()}),t.time,this);else if(4&e.eventType)return 8;return Ee},reset:function(){clearTimeout(this._timer)},emit:function(e){8===this.state&&(e&&4&e.eventType?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=c(),this.manager.emit(this.options.event,this._input)))}}),v(De,Pe,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[be]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||2&this.state)}}),v(Fe,Pe,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return Re.prototype.getTouchAction.call(this)},attrTest:function(e){var t,i=this.options.direction;return 30&i?t=e.overallVelocity:6&i?t=e.overallVelocityX:i&L&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&i&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&l(t)>this.options.velocity&&4&e.eventType},emit:function(e){var t=Be(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),v(Le,Ie,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[ye]},process:function(e){var t=this.options,i=e.pointers.length===t.pointers,n=e.distance<t.threshold,r=e.deltaTime<t.time;if(this.reset(),1&e.eventType&&0===this.count)return this.failTimeout();if(n&&r&&i){if(4!=e.eventType)return this.failTimeout();var o=!this.pTime||e.timeStamp-this.pTime<t.interval,a=!this.pCenter||K(this.pCenter,e.center)<t.posThreshold;if(this.pTime=e.timeStamp,this.pCenter=e.center,a&&o?this.count+=1:this.count=1,this._input=e,0===this.count%t.taps)return this.hasRequireFailures()?(this._timer=u((function(){this.state=8,this.tryEmit()}),t.interval,this),2):8}return Ee},failTimeout:function(){return this._timer=u((function(){this.state=Ee}),this.options.interval,this),Ee},reset:function(){clearTimeout(this._timer)},emit:function(){8==this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),Oe.VERSION="2.0.7",Oe.defaults={domEvents:!1,touchAction:me,enable:!0,inputTarget:null,inputClass:null,preset:[[De,{enable:!1}],[ke,{enable:!1},["rotate"]],[Fe,{direction:6}],[Re,{direction:6},["swipe"]],[Le],[Le,{event:"doubletap",taps:2},["tap"]],[Qe]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};function Ne(e,t){var i;this.options=r({},Oe.defaults,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=new((i=this).options.inputClass||(k?te:Q?ce:R?he:Y))(i,U),this.touchAction=new Ce(this,this.options.touchAction),Ve(this,!0),d(this.options.recognizers,(function(e){var t=this.add(new e[0](e[1]));e[2]&&t.recognizeWith(e[2]),e[3]&&t.requireFailure(e[3])}),this)}function Ve(e,t){var i,n=e.element;n.style&&(d(e.options.cssProps,(function(r,o){i=B(n.style,o),t?(e.oldCssProps[i]=n.style[i],n.style[i]=r):n.style[i]=e.oldCssProps[i]||""})),t||(e.oldCssProps={}))}return Ne.prototype={set:function(e){return r(this.options,e),e.touchAction&&this.touchAction.update(),e.inputTarget&&(this.input.destroy(),this.input.target=e.inputTarget,this.input.init()),this},stop:function(e){this.session.stopped=e?2:1},recognize:function(e){var t=this.session;if(!t.stopped){var i;this.touchAction.preventDefaults(e);var n=this.recognizers,r=t.curRecognizer;(!r||r&&8&r.state)&&(r=t.curRecognizer=null);for(var o=0;o<n.length;)i=n[o],2===t.stopped||r&&i!=r&&!i.canRecognizeWith(r)?i.reset():i.recognize(e),!r&&14&i.state&&(r=t.curRecognizer=i),o++}},get:function(e){if(e instanceof Ie)return e;for(var t=this.recognizers,i=0;i<t.length;i++)if(t[i].options.event==e)return t[i];return null},add:function(e){if(h(e,"add",this))return this;var t=this.get(e.options.event);return t&&this.remove(t),this.recognizers.push(e),e.manager=this,this.touchAction.update(),e},remove:function(e){if(h(e,"remove",this))return this;if(e=this.get(e)){var t=this.recognizers,i=E(t,e);-1!==i&&(t.splice(i,1),this.touchAction.update())}return this},on:function(e,t){if(e!==n&&t!==n){var i=this.handlers;return d(C(e),(function(e){i[e]=i[e]||[],i[e].push(t)})),this}},off:function(e,t){if(e!==n){var i=this.handlers;return d(C(e),(function(e){t?i[e]&&i[e].splice(E(i[e],t),1):delete i[e]})),this}},emit:function(e,i){this.options.domEvents&&function(e,i){var n=t.createEvent("Event");n.initEvent(e,!0,!0),n.gesture=i,i.target.dispatchEvent(n)}(e,i);var n=this.handlers[e]&&this.handlers[e].slice();if(n&&n.length){i.type=e,i.preventDefault=function(){i.srcEvent.preventDefault()};for(var r=0;r<n.length;)n[r](i),r++}},destroy:function(){this.element&&Ve(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},r(Oe,{INPUT_START:1,INPUT_MOVE:2,INPUT_END:4,INPUT_CANCEL:8,STATE_POSSIBLE:1,STATE_BEGAN:2,STATE_CHANGED:4,STATE_ENDED:8,STATE_RECOGNIZED:8,STATE_CANCELLED:16,STATE_FAILED:Ee,DIRECTION_NONE:1,DIRECTION_LEFT:2,DIRECTION_RIGHT:4,DIRECTION_UP:8,DIRECTION_DOWN:16,DIRECTION_HORIZONTAL:6,DIRECTION_VERTICAL:L,DIRECTION_ALL:30,Manager:Ne,Input:V,TouchAction:Ce,TouchInput:ce,MouseInput:Y,PointerEventInput:te,TouchMouseInput:he,SingleTouchInput:oe,Recognizer:Ie,AttrRecognizer:Pe,Tap:Le,Pan:Re,Swipe:Fe,Pinch:ke,Rotate:De,Press:Qe,on:b,off:x,each:d,merge:A,extend:f,assign:r,inherit:v,bindFn:m,prefixed:B}),Oe}("undefined"!=typeof window?window:{},"undefined"!=typeof document?document:{});function Hr(e,t,i){var r=t.getBoundingClientRect(),o=r.top,a=r.left,s=r.width,l=r.height;return i&&(a+=s*i.left,o+=l*(1-i.bottom-i.height),s*=i.width,l*=i.height),new n.Vector2((e.x-a)/s*2-1,-(e.y-o)/l*2+1)}var _r=new n.OrthographicCamera(-1,1,1,-1,0,1),Kr=new n.BufferGeometry;Kr.setAttribute("position",new n.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3)),Kr.setAttribute("uv",new n.Float32BufferAttribute([0,2,0,0,2,0],2));var jr=new n.Mesh(Kr),Gr=new n.Scene;Gr.add(jr);var Wr=function(){function e(e,t){var i;this.renderer=e,this.material=new n.ShaderMaterial({vertexShader:null!==(i=t.vertex)&&void 0!==i?i:"\nvarying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n",fragmentShader:t.fragment,uniforms:Object.assign({inputBuffer:new n.Uniform(null)},t.uniforms),defines:Object.assign({},t.defines),blending:n.NoBlending,depthWrite:!1,depthTest:!1})}return e.prototype.render=function(e,t){var i=this.renderer.getRenderTarget(),n=jr.material;this.material.uniforms.inputBuffer.value=e.texture,jr.material=this.material,this.renderer.setRenderTarget(t||null),this.renderer.render(Gr,_r),this.renderer.setRenderTarget(i),jr.material=n},e.prototype.dispose=function(){this.material.dispose()},e}(),Xr=function(){function e(e){this.renderer=e,this.material=new n.ShaderMaterial({vertexShader:"\nvoid main() {\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n",fragmentShader:"\nuniform vec3 inputValue;\nvoid main() {\n gl_FragColor = vec4(inputValue, 1.0);\n}\n",uniforms:Object.assign({inputValue:new n.Uniform(new n.Vector3)}),blending:n.NoBlending,depthWrite:!1,depthTest:!1})}return e.prototype.render=function(e,t){var i=this.renderer.getRenderTarget(),n=jr.material;this.material.uniforms.inputValue.value.copy(e),jr.material=this.material,this.renderer.setRenderTarget(t||null),this.renderer.render(Gr,_r),this.renderer.setRenderTarget(i),jr.material=n},e.prototype.dispose=function(){this.material.dispose()},e}(),Yr=function(e){function t(t){return e.call(this,t,{fragment:"\nuniform sampler2D inputBuffer;\nvarying vec2 vUv;\nvoid main() {\n gl_FragColor = texture2D(inputBuffer, vUv);\n}\n"})||this}return te(t,e),t}(Wr),Zr=function(){function e(e){this.enable=!0,this.renderer=e,this.copyPass=new Yr(this.renderer)}return e.prototype.render=function(e,t){this.copyPass.render(e,t)},e.prototype.dispose=function(){this.copyPass.dispose()},e}(),Jr=function(e){function t(i){var n,r=this;r=e.call(this)||this;var o=t.parseArgs(i);return r.pending=!0,r.userAction=o.initial[3],r.destroyed=!1,r.ident=o.ident,r.scene=o.scene,r.parallaxScene=o.parallaxScene,r.helper=o.helper,r.boundingMesh=o.boundingMesh,r.camera=o.camera,r.renderer=o.renderer,r.scissor=o.scissor,r.element=o.element,r.model=o.model,r.enableIOSEDR=null!==(n=o.enableIOSEDR)&&void 0!==n&&n,r.work=o.work,r.imageOptions=o.imageOptions,r.videoTexture=o.videoTexture,r.networkSubscribe=o.networkSubscribe,r.requestProxy=o.requestProxy,r.needsRender=!0,r.maxFov=120,r.minFov=40,r.maxLatitude=+Math.PI/2,r.minLatitude=-Math.PI/2,r.cameraMotion=new ur({longitude:{value:r.camera.pose.longitude,circle:[0,2*Math.PI]},latitude:r.camera.pose.latitude,fov:r.camera.pose.fov}),r.eventUnbinds=[o.element].concat(o.extraElements||[]).map((function(e){return r.bindEvents(e)})),ke.shared.add((function(){return r.initAnimation.apply(r,o.initial)}),!0),r}return te(t,e),t.parseArgs=function(e){return ie({},e)},t.initAnimationEndState=function(e){var t=this.parseArgs(e);return{longitude:t.camera.pose.longitude,latitude:t.camera.pose.latitude,fov:t.camera.pose.fov,offset:t.camera.pose.offset.clone(),distance:t.camera.pose.distance}},t.prototype.destroy=function(){var e;this.destroyed=!0,this.off(),this.cameraMotion.dispose();for(var t=0,i=this.eventUnbinds;t<i.length;t++){(0,i[t])()}this.copyEffect&&(this.copyEffect.dispose(),delete this.copyEffect),delete this.panState,null===(e=this.pressState)||void 0===e||e.stop(),delete this.pressState},t.prototype.isReady=function(){return!1===this.pending&&!0===this.cameraMotion.ended},t.prototype.bindExtraElement=function(e){for(var t=0,i=this.eventUnbinds;t<i.length;t++){if(i[t].element===e)return}this.eventUnbinds.push(this.bindEvents(e))},t.prototype.unbindExtraElement=function(e){for(var t=[],i=0,n=this.eventUnbinds;i<n.length;i++){var r=n[i];r.element===e?r():t.push(r)}this.eventUnbinds=t},t.prototype.updateRenderSize=function(){this.needsRender=!0},t.prototype.updateModel=function(e){this.model=e,this.needsRender=!0},t.prototype.updateWork=function(e,t,i,n,r){return this.work=e,this.userAction=r,!1},t.prototype.updateTime=function(e,t){if(!this.destroyed){var i={};this.cameraMotion.ended&&(this.cameraMotion.update(e),i.longitude=this.cameraMotion.value.longitude,i.latitude=this.cameraMotion.value.latitude,i.fov=this.cameraMotion.value.fov),Ur(i)&&this.setCamera(i)}},t.prototype.render=function(){this.renderer.render(this.scene,this.camera)},t.prototype.postProcessing=function(e,t){this.destroyed||(this.copyEffect||(this.copyEffect=new Zr(this.renderer)),this.copyEffect.render(e,t))},t.prototype.updateCamera=function(e,t,i){return this.userAction=i,this.cameraMotion.set(e,t).catch(le)},t.prototype.updateCameraWithKeyframes=function(e,t,i){return this.userAction=i,this.cameraMotion.setKeyframes(e,t)},t.prototype.getTargetPose=function(){var e=this.cameraMotion.getKeyFrameSegment(ue())[1];return{longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,offset:this.camera.pose.offset.clone(),distance:this.camera.pose.distance}},t.prototype.moveToPano=function(e,t,i){void 0===t&&(t={}),this.userAction=i;var n={longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov,offset:this.camera.pose.offset.clone(),distance:this.camera.pose.distance};t.moveStartCallback&&t.moveStartCallback(e,n),this.emit("moveToPano",e,this.userAction),this.emit("panoWillArrive",e,n,this.userAction),this.emit("panoArrived",e,n,this.userAction),t.moveEndCallback&&t.moveEndCallback(e,n)},t.prototype.initAnimation=function(e,t,i,n){this.pending=!1,this.userAction=n},t.prototype.setCamera=function(e){var t,i,n,r,o;void 0===e&&(e={});var a=null!==(t=e.longitude)&&void 0!==t?t:this.camera.pose.longitude,s=null!==(i=e.latitude)&&void 0!==i?i:this.camera.pose.latitude,l=null!==(n=e.fov)&&void 0!==n?n:this.camera.pose.fov,c=null!==(r=e.distance)&&void 0!==r?r:this.camera.pose.distance,u=null!==(o=e.offset)&&void 0!==o?o:this.camera.pose.offset,h=this.camera.position.clone(),d=Cr(a,this.camera.pose.longitude,2*Math.PI)||Cr(s,this.camera.pose.latitude),p=Cr(l,this.camera.pose.fov),f=Cr(c,this.camera.pose.distance),A=Ir(u,this.camera.pose.offset);this.camera.setFromPose({longitude:a,latitude:s,fov:l,distance:c,offset:u});var v=Ir(h,this.camera.position);p&&this.emit("cameraFovUpdate",l,this.userAction),d&&this.emit("cameraDirectionUpdate",{longitude:a,latitude:s},this.userAction),v&&this.emit("cameraPositionUpdate",this.camera.position.clone(),this.userAction),(p||d||A||f)&&this.emit("cameraUpdate",{longitude:a,latitude:s,fov:l,offset:u,distance:c},this.userAction),this.needsRender=!0},t.prototype.onPanGesture=function(e){var t=this.panState,i=e.pointers.length;if(e.isFinal?delete this.panState:this.panState={pointerLength:i,x:e.center.x,y:e.center.y},void 0!==t&&t.pointerLength===i){var n=e.pointers.map((function(e){return ci(e,["x","y"])}));this.emit("wantsGesture","pan",n,e.isFinal)||this.emit("gesture","pan",n,e.isFinal)}},t.prototype.onTapGesture=function(e){var t=e.pointers.map((function(e){return ci(e,["x","y"])}));this.emit("wantsGesture","tap",t,!0)||this.emit("gesture","tap",t,!0)},t.prototype.onPressGesture=function(e,t){var i,n=[e];if(this.emit("wantsGesture","press",n,t))return null===(i=this.pressState)||void 0===i||i.stop(),void delete this.pressState;this.emit("gesture","press",n,t)},t.prototype.onPinchGesture=function(e){var t=e.pointers.map((function(e){return ci(e,["x","y"])}));this.emit("wantsGesture","pinch",t,e.isFinal)||this.emit("gesture","pinch",t,e.isFinal)},t.prototype.onMouseWheel=function(e){var t=(Math.abs(e.deltaY)>Math.abs(e.deltaX)?e.deltaY:e.deltaX)/-60,i=[{x:e.clientX,y:e.clientY,delta:t}];this.emit("wantsGesture","mouseWheel",i,!1)||this.emit("gesture","mouseWheel",i,!1)},t.prototype.onMouseMove=function(e){},t.prototype.onMouseOut=function(){},t.prototype.relativeClientPosition=function(e){return Hr(e,this.element,this.scissor)},t.prototype.bindEvents=function(e){var t=this,i=function(e){var i=Hr(e,t.element,t.scissor);return!(Math.abs(i.x)>1||Math.abs(i.y)>1)},n=new qr.Manager(e),r=function(e){return e.session.firstInput||null};n.add(new qr.Pan({threshold:10,pointers:0})),n.add(new qr.Tap({interval:410})),n.add(new qr.Pinch({threshold:0,pointers:2})),n.on("panstart pan",(function(e){var o=r(n);o&&!i(o.center)||(t.onPanGesture(e),f())})),n.on("tap",(function(e){if("mouse"!==e.pointerType||0===e.srcEvent.button){var o=r(n);o&&!i(o.center)||(t.onTapGesture(e),f())}})),n.on("pinchstart pinch pinchend",(function(e){var o=r(n);o&&!i(o.center)||(t.onPinchGesture(e),f())}));var o=null,a=null,s=function(e,t,i){var n="pinchend"===e?t:t-i.deltaY/280;return{type:e,target:i.target,pointerType:"mouse",srcEvent:i,pointers:[{x:i.clientX,y:i.clientY}],isFirst:"pinchstart"===e,isFinal:"pinchend"===e,scale:Kn(n,.1,10),center:{x:i.clientX,y:i.clientY},velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0}},l=function(e){var n,r={x:e.clientX,y:e.clientY};if(i(r)){if(e.preventDefault(),e.ctrlKey){var l=null!==(n=null==o?void 0:o.prevInput.scale)&&void 0!==n?n:1,c=s(o?"pinch":"pinchstart",l,e);null===o?o={firstInput:c,prevInput:c}:o.prevInput=c,t.onPinchGesture(c),null!==a&&window.clearTimeout(a),a=window.setTimeout((function(){var i;a=null;var n=null!==(i=null==o?void 0:o.prevInput.scale)&&void 0!==i?i:1,r=s("pinchend",n,e);o=null,t.onPinchGesture(r)}),200)}else t.onMouseWheel(e);f()}},c=function(e){if(!Fr()){var n={x:e.clientX,y:e.clientY};i(n)?(t.onMouseMove(e),t.pressState&&Math.abs(e.clientX-t.pressState.x)>10&&Math.abs(e.clientY-t.pressState.y)>10&&f()):t.onMouseOut()}},u=function(){t.onMouseOut(),f()},h=function(e,n){if(i(e)){t.pressState={x:e.x,y:e.y,time:t.pressState?t.pressState.time:n,stop:le};var r=n-t.pressState.time;t.onPressGesture({x:e.x,y:e.y,delta:r},!1),t.pressState&&(t.pressState.stop=ke.shared.add((function(t){return h({x:e.x,y:e.y},t)}),!0,1))}else f()},d=function(e){f(),e.touches.length>1||e.changedTouches.length<=0||h({x:e.changedTouches[0].clientX,y:e.changedTouches[0].clientY},ue())},p=function(e){f(),h({x:e.clientX,y:e.clientY},ue())},f=function(){var e;if(t.pressState){var i=ue()-t.pressState.time;t.onPressGesture({x:t.pressState.x,y:t.pressState.y,delta:i},!0),null===(e=t.pressState)||void 0===e||e.stop(),delete t.pressState}},A=null,v=function(e){var t,i="pinch",n=!1,r=!1;switch(e.type){case"gesturestart":i="pinchstart",n=!0;break;case"gestureend":i="pinchend",r=!0}return{type:i,target:e.target,pointerType:"mouse",srcEvent:e,pointers:[{x:e.clientX,y:e.clientY}],isFirst:n,isFinal:r,scale:null!==(t=e.scale)&&void 0!==t?t:1,center:{x:e.clientX,y:e.clientY},velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0}},m=function(e){if(e.preventDefault(),!Fr()){var n=v(e),r=(A={firstInput:n}).firstInput;r&&!i(r.center)||t.onPinchGesture(n)}},g=function(e){if(e.preventDefault(),!Fr()&&A){var n=v(e),r=A.firstInput;r&&!i(r.center)||t.onPinchGesture(n)}},y=function(e){if(e.preventDefault(),!Fr()&&A){var n=v(e),r=A.firstInput;A=null,r&&!i(r.center)||t.onPinchGesture(n)}},b=function(t){if(t&&"function"==typeof t.preventDefault&&t.currentTarget===e&&t.preventDefault(),"function"==typeof getSelection){var i=getSelection();i&&i.focusNode&&(i.removeAllRanges&&i.removeAllRanges(),i.empty&&i.empty())}};e.addEventListener("wheel",l,{passive:!1}),e.addEventListener("mousemove",c,!1),e.addEventListener("mouseout",u,!1),e.addEventListener("touchstart",d,{passive:!0}),e.addEventListener("touchend",f,!1),e.addEventListener("touchcancel",f,!1),e.addEventListener("mousedown",p,!1),e.addEventListener("mouseup",f,!1),e.addEventListener("gesturestart",m,{passive:!1}),e.addEventListener("gesturechange",g,{passive:!1}),e.addEventListener("gestureend",y,{passive:!1}),e.addEventListener("touchstart",b,{passive:!1}),e.addEventListener("contextmenu",b,!1);return Object.assign((function(){n.destroy(),e.removeEventListener("wheel",l,!1),e.removeEventListener("mousemove",c,!1),e.removeEventListener("mouseout",u,!1),e.removeEventListener("touchstart",d,!1),e.removeEventListener("touchend",f,!1),e.removeEventListener("touchcancel",f,!1),e.removeEventListener("mousedown",p,!1),e.removeEventListener("mouseup",f,!1),e.removeEventListener("gesturestart",m,!1),e.removeEventListener("gesturechange",g,!1),e.removeEventListener("gestureend",y,!1),e.removeEventListener("touchstart",b,!1),e.removeEventListener("contextmenu",b,!1)}),{element:e})},t}(se),$r=function(e){function t(i){var n,r,o=this,a=t.parseArgs(i);return(o=e.call(this,a)||this).defaultLongitude=a.defaultLongitude,o.defaultLatitude=a.defaultLatitude,o.defaultFov=a.defaultFov,o.maxFov=a.maxFov,o.minFov=a.minFov,o.maxLatitude=a.maxLatitude,o.minLatitude=a.minLatitude,o.locationMotion=new ur({x:o.camera.pose.offset.x,y:o.camera.pose.offset.y,z:o.camera.pose.offset.z,distance:o.camera.pose.distance,modelAlpha:null!==(r=null===(n=o.model.getMaterial())||void 0===n?void 0:n.modelAlpha)&&void 0!==r?r:0,perspToOrtho:o.camera.perspToOrtho.x,orthoDistance:o.camera.orthoDistance}),o.currentTapPanoIndex=-1,o.intersectMeshCreator=a.intersectMeshCreator,o.intersectMesh=o.intersectMeshCreator(),o.intersectMesh.name="intersect",o.intersectMesh.visible=!1,o.helper.add(o.intersectMesh),o}return te(t,e),t.distanceFromModel=function(e,t,i){var n=e.bounding,r=Math.pow(Math.pow(n.max.x-n.min.x+1,2)+Math.pow(n.max.y-n.min.y+1,2)+Math.pow(n.max.z-n.min.z+1,2),.5),o=r/2/Math.tan(Math.PI*t/360);return i<1&&(o/=i),isNaN(o)?r:o},t.parseArgs=function(t){var i,n,r,o,a,s,l,c,u=e.parseArgs.call(this,t);return ie(ie({},u),{defaultLongitude:null!==(i=t.defaultLongitude)&&void 0!==i?i:Math.PI/4,defaultLatitude:null!==(n=t.defaultLatitude)&&void 0!==n?n:Math.PI/4,defaultFov:null!==(r=t.defaultFov)&&void 0!==r?r:80,maxFov:null!==(o=t.maxFov)&&void 0!==o?o:120,minFov:null!==(a=t.minFov)&&void 0!==a?a:40,maxLatitude:null!==(s=t.maxLatitude)&&void 0!==s?s:+Math.PI/2,minLatitude:null!==(l=t.minLatitude)&&void 0!==l?l:-Math.PI/2,intersectMeshCreator:null!==(c=t.intersectMeshCreator)&&void 0!==c?c:function(){return new wr}})},t.initAnimationEndPose=function(e){var i,r,o,a=this.parseArgs(e),s=e.initial[1];return{longitude:null!==(i=s.longitude)&&void 0!==i?i:a.defaultLongitude,latitude:Kn(null!==(r=s.latitude)&&void 0!==r?r:a.defaultLatitude,a.minLatitude,a.maxLatitude),fov:null!==(o=s.fov)&&void 0!==o?o:a.defaultFov,offset:e.model.bounding.getCenter(new n.Vector3),distance:t.distanceFromModel(a.model,a.defaultFov,a.camera.aspect)}},t.prototype.destroy=function(){e.prototype.destroy.call(this),this.locationMotion.dispose(),this.mouseWheelState&&clearTimeout(this.mouseWheelState.timer),delete this.mouseWheelState,delete this.mouseMoveState,delete this.panState,this.intersectMesh.dispose(),this.helper.remove(this.intersectMesh)},t.prototype.isReady=function(){return!1!==this.locationMotion.ended&&e.prototype.isReady.call(this)},t.prototype.updateWork=function(e,t,i,n,r){return this.work=e,this.updateCamera(i,null!=n?n:0,r),!0},t.prototype.updateModel=function(i){e.prototype.updateModel.call(this,i);var r=i.bounding.getCenter(new n.Vector3),o=t.distanceFromModel(i,this.defaultFov,this.camera.aspect);this.locationMotion.set({x:r.x,y:r.y,z:r.z,distance:o},0).catch(le)},t.prototype.updateTime=function(e,t){if(!this.destroyed){var i={},r={};this.locationMotion.ended||(this.locationMotion.update(e),i.modelAlpha=this.locationMotion.value.modelAlpha,this.camera.perspToOrtho.setScalar(Kn(this.locationMotion.value.perspToOrtho,0,1)),this.camera.orthoDistance=this.locationMotion.value.orthoDistance,r.distance=this.locationMotion.value.distance,r.offset=new n.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z)),this.cameraMotion.ended||(this.cameraMotion.update(e),r.longitude=this.cameraMotion.value.longitude,r.latitude=this.cameraMotion.value.latitude,r.fov=this.cameraMotion.value.fov),Ur(i)||this.model.setMaterial(i),Ur(r)||this.setCamera(r)}},t.prototype.getTargetPose=function(){var e=this.cameraMotion.getKeyFrameSegment(ue())[1],t=this.locationMotion.getKeyFrameSegment(ue())[1];return{longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,offset:new n.Vector3(t.value.x,t.value.y,t.value.z),distance:t.value.distance}},t.prototype.initAnimation=function(e,i,r,o){var a,s,l,c=this;if(!this.destroyed){this.pending=!1,this.userAction=o;var u={longitude:null!==(a=i.longitude)&&void 0!==a?a:this.defaultLongitude,latitude:Kn(null!==(s=i.latitude)&&void 0!==s?s:this.defaultLatitude,this.minLatitude,this.maxLatitude),fov:Kn(null!==(l=i.fov)&&void 0!==l?l:this.defaultFov,this.minFov,this.maxFov),offset:this.model.bounding.getCenter(new n.Vector3),distance:t.distanceFromModel(this.model,this.defaultFov,this.camera.aspect)},h=ci(u,["longitude","latitude","fov"]),d={x:u.offset.x,y:u.offset.y,z:u.offset.z,distance:u.distance,modelAlpha:1,perspToOrtho:0,orthoDistance:u.distance};this.emit("initAnimationWillStart",e,u,this.userAction),this.cameraMotion.set(h,r).catch(le),this.locationMotion.set(d,r).then((function(){c.emit("initAnimationEnded",e,u,c.userAction)}),(function(t){var i=zr(c.camera.pose);c.emit("initAnimationEnded",e,i,c.userAction)})).catch(le)}},t.prototype.updateRenderSize=function(){this.locationMotion.set({distance:t.distanceFromModel(this.model,this.defaultFov,this.camera.aspect)},0).catch(le)},t.prototype.getForwardPanoIndexOrNot=function(e){var t=this.work.observers.filter((function(e){return e.active})),i=this.model.intersectRaycaster(e)[0];if(!i)return null;var n=Vr(t,(function(e){return e.standingPosition.distanceTo(i.point)}),!0),r=n[0];return n[1]<10?r.panoIndex:null},t.prototype.coordinatesForOffset=function(e){var t=this.renderer.getSize(new n.Vector2);return{longitude:2*e.x/(t.x*this.scissor.width),latitude:2*e.y/(t.y*this.scissor.height)}},t.prototype.requestInteriaMovement=function(e,t){var i=this;if(!1!==this.interiaMovement){for(var n=ie({},e),r={longitude:0,latitude:0},o=0;o<t;o++)n.longitude*=.996,n.latitude*=.994008,r.longitude+=n.longitude,r.latitude+=n.latitude;var a=Rr(this.cameraMotion.value.longitude+r.longitude),s=Kn(this.cameraMotion.value.latitude+r.latitude,this.minLatitude,this.maxLatitude),l={longitude:a,latitude:s,fov:this.cameraMotion.value.fov,offset:this.camera.pose.offset.clone(),distance:this.camera.pose.distance};this.cameraMotion.set({longitude:a,latitude:s},0).catch(le);var c=n.longitude>1e-4||n.longitude<-1e-4||n.latitude>1e-4||n.latitude<-1e-4;this.emit("interiaPan",l,!c),c?ke.shared.add((function(e,t){i.requestInteriaMovement(n,0|t)}),!0,1):this.interiaMovement=!1}},t.prototype.onPanGesture=function(e){var t=this.panState,i=e.pointers.length;if(e.isFinal?delete this.panState:this.panState={pointerLength:i,x:e.center.x,y:e.center.y},void 0!==t&&t.pointerLength===i){var n=e.pointers.map((function(e){return ci(e,["x","y"])}));if(!this.emit("wantsGesture","pan",n,e.isFinal)){var r={x:e.center.x-t.x,y:e.center.y-t.y},o=this.relativeClientPosition(e.center),a=this.camera.pose.latitude<Math.PI/6||o.y<0?-1:1;r.x*=a;var s=this.coordinatesForOffset(r),l=Rr(this.cameraMotion.value.longitude+s.longitude),c=Kn(this.cameraMotion.value.latitude+s.latitude,this.minLatitude,this.maxLatitude);this.camera.aspect<1&&Math.abs(e.overallVelocityX)>.2&&Math.atan2(Math.abs(e.overallVelocityY),Math.abs(e.overallVelocityX))<Math.PI/6.923&&(c=this.cameraMotion.value.latitude);var u={longitude:l,latitude:c,fov:this.camera.pose.fov,offset:this.camera.pose.offset,distance:this.camera.pose.distance};if(!this.emit("wantsPanGesture",u,e.isFinal))if(this.emit("gesture","pan",n,e.isFinal),this.emit("panGesture",u,e.isFinal),this.userAction=!0,this.interiaMovement=!1,this.hideIntersectMesh(),this.cameraMotion.set({longitude:u.longitude,latitude:u.latitude},0).catch(le),e.isFinal)if(!this.emit("wantsInteriaPan",u)){this.interiaMovement=!0;var h=e.velocityX*a,d=e.velocityY;this.requestInteriaMovement(this.coordinatesForOffset({x:h,y:d}),0)}}}},t.prototype.onPinchGesture=function(e){var t,i=null===(t=this.pinchState)||void 0===t?void 0:t.fov,n=!1;if("pinchstart"!==e.type){if("pinchend"===e.type&&(n=!0,delete this.panState,delete this.pinchState),void 0!==i){var r=e.pointers.map((function(e){return ci(e,["x","y"])}));if(!this.emit("wantsGesture","pinch",r,n)){var o=Kn(i/e.scale,this.minFov,this.maxFov);this.emit("wantsPinchGesture",e.scale,o,n)||this.emit("wantsChangeCameraFov",o)||(this.emit("gesture","pinch",r,n),this.emit("pinchGesture",e.scale,o,n),this.userAction=!0,this.interiaMovement=!1,this.cameraMotion.set({fov:o},0).catch(le),this.onPanGesture(e))}}}else this.pinchState={fov:this.cameraMotion.value.fov}},t.prototype.onMouseMove=function(e){if(this.intersectMesh.parent&&!this.model.empty&&this.model.bvhs&&!0===this.model.bvhs.loaded&&!this.panState){var t=this.relativeClientPosition({x:e.clientX,y:e.clientY}),i=new n.Raycaster;if(i.setFromCamera(t,this.camera),this.emit("wantsShowIntersectionOnModel",i))this.hideIntersectMesh();else{var r=this.model.intersectRaycaster(i)[0];if(r&&r.face){var o=r.face.normal,a=o.clone().multiplyScalar(.05),s=r.point.clone().add(a);this.intersectMesh.position.copy(s);var l=s.clone().add(a);if(this.intersectMesh.lookAt(l),Math.abs(o.y)>.99){var c=this.camera.position.clone().sub(s);this.intersectMesh.rotation.z=-Math.atan2(c.z,c.x)}this.intersectMesh.visible=!0,this.needsRender=!0,this.emit("intersectionOnModelUpdate",r,this.intersectMesh)}else this.hideIntersectMesh();this.mouseMoveState={clientX:e.clientX,clientY:e.clientY}}}},t.prototype.onMouseOut=function(){this.intersectMesh.parent&&!0===this.intersectMesh.visible&&this.hideIntersectMesh()},t.prototype.onMouseWheel=function(e){var t=this,i=(Math.abs(e.deltaY)>Math.abs(e.deltaX)?e.deltaY:e.deltaX)/-60,n=[{x:e.clientX,y:e.clientY,delta:i}];if(!this.emit("wantsGesture","mouseWheel",n,!1)){var r=this.minFov,o=this.maxFov,a=Kn(this.camera.fov-i,r,o);this.emit("wantsMouseWheel",i,a,!1)||this.emit("wantsChangeCameraFov",a)||(this.emit("gesture","mouseWheel",n,!1),this.emit("mouseWheel",i,a,!1),this.userAction=!0,this.interiaMovement=!1,this.cameraMotion.set({fov:a},0).catch(le),this.mouseWheelState&&clearTimeout(this.mouseWheelState.timer),this.mouseWheelState={timer:window.setTimeout((function(){delete t.mouseWheelState;t.emit("wantsGesture","mouseWheel",n,!0)||t.emit("wantsMouseWheel",i,a,!0)||(t.emit("gesture","mouseWheel",n,!0),t.emit("mouseWheel",0,a,!0))}),200)})}},t.prototype.onTapGesture=function(e){var t=this,i=e.pointers.map((function(e){return ci(e,["x","y"])}));if(!this.emit("wantsGesture","tap",i,!0)){var r=this.relativeClientPosition(e.center),o=new n.Raycaster;if(o.setFromCamera(r,this.camera),!this.emit("wantsTapGesture",o,r,!0)){this.emit("gesture","tap",i,!0),this.emit("tapGesture",o,r,!0),this.interiaMovement=!1;var a=this.getForwardPanoIndexOrNot(o);if(!Un(a)){this.emit("panoSelected",a);var s={longitude:this.camera.pose.longitude,latitude:0};this.currentTapPanoIndex=a,this.preloadPano(a).then((function(e){t.currentTapPanoIndex===e&&t.emit("wantsMoveToPano",e,s,!0)}))}}}},t.prototype.onPressGesture=function(e,t){var i,r,o=[e];if(this.emit("wantsGesture","press",o,t))return null===(i=this.pressState)||void 0===i||i.stop(),void delete this.pressState;var a=this.relativeClientPosition(e),s=new n.Raycaster;if(s.setFromCamera(a,this.camera),this.emit("wantsPressGesture",s,a,e.delta,t))return null===(r=this.pressState)||void 0===r||r.stop(),void delete this.pressState;this.emit("gesture","press",o,t),this.emit("pressGesture",s,a,e.delta,t)},t.prototype.preloadPano=function(e,t){var i=this;void 0===t&&(t=le);var n=this.work.observers[e],r=this.work.allowHosts;return Promise.all(["right","left","up","down","front","back"].map((function(t){var o=ie({key:"pano.".concat(e,".").concat(t)},ci(i.imageOptions,["size","format","quality","mappings"])),a=n.images[t];return Be(i.imageOptions.transform?i.imageOptions.transform(a,o):Le(a,o),{allowHosts:r,requestProxy:i.requestProxy,networkSubscribe:i.networkSubscribe})}))).then((function(){return t(e),e}))},t.prototype.hideIntersectMesh=function(){this.intersectMesh.visible=!1,this.emit("intersectionHidden"),this.needsRender=!0},t}(Jr),eo={longitude:0,latitude:Math.PI/2},to={longitude:0,latitude:0},io={longitude:Math.PI/2,latitude:0},no={longitude:Math.PI,latitude:0},ro={longitude:1.5*Math.PI,latitude:0};var oo=function(e){function t(i){var n=t.parseArgs(i);return e.call(this,n)||this}return te(t,e),t.parseArgs=function(t){var i=[t.initial[0],ie(ie({},t.initial[1]),{longitude:0,latitude:Math.PI/2}),t.initial[2],t.initial[3]],n=ie(ie({},t),{initial:i,maxLatitude:Math.PI/2,minLatitude:Math.PI/2,defaultLongitude:0,defaultLatitude:Math.PI/2});return e.parseArgs.call(this,n)},t.initAnimationEndPose=function(t){var i=this.parseArgs(t);return e.initAnimationEndPose.call(this,i)},t.prototype.updateModel=function(e){this.model=e,this.needsRender=!0;var t=e.bounding.getCenter(new n.Vector3);this.locationMotion.set({x:t.x,y:t.y,z:t.z,distance:$r.distanceFromModel(this.model,this.defaultFov,this.camera.aspect)},0).catch(le)},t.prototype.initAnimation=function(e,t,i,r){var o,a=this;if(!this.destroyed){this.pending=!1,this.userAction=r;var s={longitude:0,latitude:Math.PI/2,fov:Kn(null!==(o=t.fov)&&void 0!==o?o:this.defaultFov,this.minFov,this.maxFov),offset:this.model.bounding.getCenter(new n.Vector3),distance:$r.distanceFromModel(this.model,this.defaultFov,this.camera.aspect)},l=ci(s,["longitude","latitude","fov"]),c={x:s.offset.x,y:s.offset.y,z:s.offset.z,distance:s.distance,modelAlpha:1,perspToOrtho:1,orthoDistance:s.distance};this.cameraMotion.set(l,i).catch(le),this.locationMotion.set(c,i).then((function(){a.emit("initAnimationEnded",e,s,a.userAction)}),(function(t){var i=zr(a.camera.pose);a.emit("initAnimationEnded",e,i,a.userAction)}))}},t.prototype.getZoomOffsetFromFov=function(e,t,i){var r=this.camera.getDirection(new n.Vector3),o=Math.tan(i/2*Math.PI/180),a=Math.tan(t.fov/2*Math.PI/180),s=(a-o)/a,l=new n.Raycaster;l.setFromCamera(e,t);var c=l.ray.direction,u=c.angleTo(r),h=$r.distanceFromModel(this.model,this.defaultFov,this.camera.aspect),d=h*Math.tan(u),p=c.clone().setLength(h*Math.cos(u)).projectOnPlane(r),f=p.length(),A=s/f*p.x*d,v=s/f*p.z*d,m=s/f*p.y*d;return new n.Vector3(A,m,v)},t.prototype.requestInteriaMovement=function(e,t){},t.prototype.onPanGesture=function(e){var t=this.panState,i=e.pointers.length;if(e.isFinal?delete this.panState:this.panState={pointerLength:i,x:e.center.x,y:e.center.y},void 0!==t&&t.pointerLength===i){var r=e.pointers.map((function(e){return ci(e,["x","y"])}));if(!this.emit("wantsGesture","pan",r,e.isFinal)){var o=e.center.x-t.x,a=e.center.y-t.y,s=new n.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),l=this.model.bounding,c=l.getCenter(new n.Vector3),u=(l.max.x-l.min.x)/this.defaultFov*this.cameraMotion.value.fov,h=(l.max.y-l.min.y)/this.defaultFov*this.cameraMotion.value.fov,d=(l.max.z-l.min.z)/this.defaultFov*this.cameraMotion.value.fov,p={left:new n.Vector3,up:new n.Vector3,cameraDirection:"y"};this.cameraMotion.value.longitude===eo.longitude&&this.cameraMotion.value.latitude===eo.latitude?(p.left.set(1,0,0),p.up.set(0,0,-1),p.cameraDirection="y"):this.cameraMotion.value.longitude===to.longitude&&this.cameraMotion.value.latitude===to.latitude?(p.left.set(1,0,0),p.up.set(0,1,0),p.cameraDirection="z"):this.cameraMotion.value.longitude===no.longitude&&this.cameraMotion.value.latitude===no.latitude?(p.left.set(1,0,0),p.up.set(0,-1,0),p.cameraDirection="z"):this.cameraMotion.value.longitude===ro.longitude&&this.cameraMotion.value.latitude===ro.latitude?(p.left.set(0,0,-1),p.up.set(0,-1,0),p.cameraDirection="x"):this.cameraMotion.value.longitude===io.longitude&&this.cameraMotion.value.latitude===io.latitude&&(p.left.set(0,0,-1),p.up.set(0,1,0),p.cameraDirection="x");var f=(this.camera.position[p.cameraDirection]-l.min[p.cameraDirection])*Math.tan(this.camera.fov/2*Math.PI/180),A=this.renderer.getSize(new n.Vector2);s.add(function(e,t){var i=(new n.Vector3).copy(t);return i.multiplyScalar(-e),i}(2*o*f/A.y,p.left)),s.add(function(e,t){var i=(new n.Vector3).copy(t);return i.multiplyScalar(e),i}(2*a*f/A.y,p.up)),s.x=Kn(s.x,c.x-u,c.x+u),s.y=Kn(s.y,c.y-h,c.y+h),s.z=Kn(s.z,c.z-d,c.z+d);var v={longitude:0,latitude:Math.PI/2,fov:this.cameraMotion.value.fov,offset:s,distance:this.locationMotion.value.distance};this.emit("wantsPanGesture",v,e.isFinal)||(this.emit("gesture","pan",r,e.isFinal),this.emit("panGesture",v,e.isFinal),this.userAction=!0,this.locationMotion.set({x:s.x,y:s.y,z:s.z},0).catch(le))}}},t.prototype.onPinchGesture=function(e){var t,i=null===(t=this.pinchState)||void 0===t?void 0:t.fov,n=!1;if("pinchstart"!==e.type){if("pinchend"===e.type&&(n=!0,delete this.pinchState),void 0!==i){var r=e.pointers.map((function(e){return ci(e,["x","y"])}));if(!this.emit("wantsGesture","pinch",r,n)){var o=Kn(i/e.scale,this.minFov,this.maxFov),a=this.relativeClientPosition({x:e.center.x,y:e.center.y}),s=this.getZoomOffsetFromFov(a,this.camera,o);this.cameraMotion.value.longitude===eo.longitude&&this.cameraMotion.value.latitude===eo.latitude?s.y=0:this.cameraMotion.value.longitude===to.longitude&&this.cameraMotion.value.latitude===to.latitude||this.cameraMotion.value.longitude===no.longitude&&this.cameraMotion.value.latitude===no.latitude?s.z=0:(this.cameraMotion.value.longitude===ro.longitude&&this.cameraMotion.value.latitude===ro.latitude||this.cameraMotion.value.longitude===io.longitude&&this.cameraMotion.value.latitude===io.latitude)&&(s.x=0);var l=this.camera.pose.offset.clone().add(s);this.emit("wantsPinchGesture",e.scale,o,n)||this.emit("wantsChangeCameraFov",o)||(this.emit("gesture","pinch",r,n),this.emit("pinchGesture",e.scale,o,n),this.userAction=!0,this.locationMotion.set({x:l.x,y:l.y,z:l.z},0).catch(le),this.cameraMotion.set({longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude,fov:o},0).catch(le),this.onPanGesture(e))}}}else this.pinchState={fov:this.cameraMotion.value.fov}},t.prototype.onMouseWheel=function(e){var t=this,i=(Math.abs(e.deltaY)>Math.abs(e.deltaX)?e.deltaY:e.deltaX)/-60,n=[{x:e.clientX,y:e.clientY,delta:i}];if(!this.emit("wantsGesture","mouseWheel",n,!1)){var r=Kn(this.cameraMotion.value.fov-i,this.minFov,this.maxFov),o=this.relativeClientPosition({x:e.clientX,y:e.clientY}),a=this.getZoomOffsetFromFov(o,this.camera,r);this.cameraMotion.value.longitude===eo.longitude&&this.cameraMotion.value.latitude===eo.latitude?a.y=0:this.cameraMotion.value.longitude===to.longitude&&this.cameraMotion.value.latitude===to.latitude||this.cameraMotion.value.longitude===no.longitude&&this.cameraMotion.value.latitude===no.latitude?a.z=0:(this.cameraMotion.value.longitude===ro.longitude&&this.cameraMotion.value.latitude===ro.latitude||this.cameraMotion.value.longitude===io.longitude&&this.cameraMotion.value.latitude===io.latitude)&&(a.x=0);var s=this.camera.pose.offset.clone().add(a);this.emit("wantsMouseWheel",i,r,!1)||this.emit("wantsChangeCameraFov",r)||(this.emit("gesture","mouseWheel",n,!1),this.emit("mouseWheel",i,r,!1),this.userAction=!0,this.locationMotion.set({x:s.x,y:s.y,z:s.z},0).catch(le),this.cameraMotion.set({longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude,fov:r},0).catch(le),this.mouseWheelState&&clearTimeout(this.mouseWheelState.timer),this.mouseWheelState={timer:window.setTimeout((function(){delete t.mouseWheelState;t.emit("wantsGesture","mouseWheel",n,!0)||t.emit("wantsMouseWheel",i,r,!0)||t.emit("wantsChangeCameraFov",r)||(t.emit("gesture","mouseWheel",n,!0),t.emit("mouseWheel",0,r,!0))}),200)})}},t}($r);function ao(e,t){void 0===t&&(t=!1);var i=typeof e;if("string"===i)return JSON.stringify(e);if(!0===e)return"true";if(!1===e)return"false";if(null===e)return"null";if(e instanceof Array){for(var n="[",r=e.length-1,o=0;o<r;o++)n+=ao(e[o],!1)+",";return r>-1&&(n+=ao(e[o],!1)),n+"]"}if(e instanceof Object){if("function"==typeof e.toJSON)return ao(e.toJSON(),t);var a=Object.keys(e).sort(),s=a.length;for(n="",o=0;o<s;){var l=a[o],c=ao(e[l],!0);void 0!==c&&(o&&""!==n&&(n+=","),n+=JSON.stringify(l)+":"+c),o++}return"{"+n+"}"}switch(i){case"function":return JSON.stringify(e.toString());case"undefined":return t?void 0:null;case"number":return e;default:return isFinite(e)?e:null}}function so(e){return"hash::".concat(ao(e,!1))}var lo,co=function(e){function t(i){var n=this,r=t.parseArgs(i);return(n=e.call(this,r)||this).defaultLongitude=r.defaultLongitude,n.defaultLatitude=r.defaultLongitude,n.defaultFov=r.defaultFov,n.maxFov=r.maxFov,n.minFov=r.minFov,n.maxLatitude=r.maxLatitude,n.minLatitude=r.minLatitude,n.moveSpeed=r.moveSpeed,n.intersectMeshCreator=r.intersectMeshCreator,n.interiaMovement=!1,n.intersectMesh=n.intersectMeshCreator(),n.intersectMesh.name="intersect",n.intersectMesh.visible=!1,n.helper.add(n.intersectMesh),n}return te(t,e),t.parseArgs=function(t){var i,n,r,o,a,s,l,c,u,h=e.parseArgs.call(this,t);return ie(ie({},h),{defaultLongitude:null!==(i=t.defaultLongitude)&&void 0!==i?i:0,defaultLatitude:null!==(n=t.defaultLatitude)&&void 0!==n?n:0,defaultFov:null!==(r=t.defaultFov)&&void 0!==r?r:90,maxFov:null!==(o=t.maxFov)&&void 0!==o?o:120,minFov:null!==(a=t.minFov)&&void 0!==a?a:40,maxLatitude:null!==(s=t.maxLatitude)&&void 0!==s?s:+Math.PI/2,minLatitude:null!==(l=t.minLatitude)&&void 0!==l?l:-Math.PI/2,moveSpeed:null!==(c=t.moveSpeed)&&void 0!==c?c:3.2,intersectMeshCreator:null!==(u=t.intersectMeshCreator)&&void 0!==u?u:function(){return new wr}})},t.initAnimationEndPose=function(e){var t,i,n,r=this.parseArgs(e),o=e.initial,a=o[0],s=o[1];return{longitude:null!==(t=s.longitude)&&void 0!==t?t:r.defaultLongitude,latitude:Kn(null!==(i=s.latitude)&&void 0!==i?i:r.defaultLatitude,r.minLatitude,r.maxLatitude),fov:Kn(null!==(n=s.fov)&&void 0!==n?n:r.defaultFov,r.minFov,r.maxFov),offset:r.work.observers[a].position.clone(),distance:0}},t.prototype.destroy=function(){e.prototype.destroy.call(this),this.interiaMovement=!1,this.intersectMesh&&(this.helper.remove(this.intersectMesh),this.intersectMesh.dispose()),this.mouseWheelState&&clearTimeout(this.mouseWheelState.timer),delete this.mouseWheelState,delete this.mouseMoveState,delete this.panState},t.prototype.isReady=function(){return!this.interiaMovement&&(!this.panState&&(!this.pinchState&&(!this.mouseWheelState&&e.prototype.isReady.call(this))))},t.prototype.calculateMovingDuration=function(e,t){switch(typeof e){case"function":return e(t,this.moveSpeed);case"number":return e;case"string":return Number(e);default:return Kn(t,2,5)/this.moveSpeed*1e3}},t.prototype.hideIntersectMesh=function(){this.intersectMesh.visible=!1,this.emit("intersectionHidden"),this.needsRender=!0},t.prototype.coordinatesForOffset=function(e){var t=this.cameraMotion.value.fov,i=this.camera.aspect,r=this.renderer.getSize(new n.Vector2);return{longitude:2*e.x/(r.x*this.scissor.width)*t/95*i,latitude:-2*e.y/(r.y*this.scissor.height)*t/95}},t.prototype.cameraBounce=function(){var e=this.cameraMotion.value,t=e.longitude,i=e.latitude,n=e.fov,r=[{progress:0,value:{longitude:t,latitude:i,fov:n}},{progress:.5,value:{longitude:t,latitude:i,fov:.98*n}},{progress:1,value:{longitude:t,latitude:i,fov:n}}];this.cameraMotion.setKeyframes(r,500).catch(le)},t.prototype.requestInteriaMovement=function(e,t){var i=this;if(!1!==this.interiaMovement){for(var n=ie({},e),r={longitude:0,latitude:0},o=0;o<t;o++)n.longitude*=.996,n.latitude*=.98604,r.longitude+=n.longitude,r.latitude+=n.latitude;var a=Rr(this.cameraMotion.value.longitude+r.longitude),s=Kn(this.cameraMotion.value.latitude+r.latitude,this.minLatitude,this.maxLatitude),l={longitude:a,latitude:s,fov:this.cameraMotion.value.fov,offset:this.camera.pose.offset.clone(),distance:this.camera.pose.distance};this.cameraMotion.set({longitude:a,latitude:s},0).catch(le);var c=n.longitude>1e-4||n.longitude<-1e-4||n.latitude>1e-4||n.latitude<-1e-4;this.emit("interiaPan",l,!c),c?ke.shared.add((function(e,t){i.requestInteriaMovement(n,0|t)}),!0,1):this.interiaMovement=!1}},t.prototype.onPanGesture=function(e){var t=this.panState,i=e.pointers.length;if(e.isFinal?delete this.panState:this.panState={pointerLength:i,x:e.center.x,y:e.center.y},void 0!==t&&t.pointerLength===i){var n=e.pointers.map((function(e){return ci(e,["x","y"])}));if(!this.emit("wantsGesture","pan",n,e.isFinal)){var r={x:e.center.x-t.x,y:e.center.y-t.y},o=this.coordinatesForOffset(r),a=Rr(this.cameraMotion.value.longitude+o.longitude),s=Kn(this.cameraMotion.value.latitude+o.latitude,this.minLatitude,this.maxLatitude);this.camera.aspect<1&&Math.abs(e.overallVelocityX)>.2&&Math.atan2(Math.abs(e.overallVelocityY),Math.abs(e.overallVelocityX))<Math.PI/6.923&&(s=this.cameraMotion.value.latitude);var l={longitude:a,latitude:s,fov:this.cameraMotion.value.fov,offset:this.camera.pose.offset.clone(),distance:this.camera.pose.distance};if(!this.emit("wantsPanGesture",l,e.isFinal)){this.emit("gesture","pan",n,e.isFinal),this.emit("panGesture",l,e.isFinal),this.userAction=!0,this.interiaMovement=!1,this.hideIntersectMesh();var c={longitude:l.longitude,latitude:l.latitude,fov:l.fov};if(this.cameraMotion.set(c,0).catch(le),e.isFinal)if(!this.emit("wantsInteriaPan",l)){this.interiaMovement=!0;var u=e.velocityX,h=.6*e.velocityY;Math.abs(h)>.5&&Math.abs(u)<.5&&(u=0),this.requestInteriaMovement(this.coordinatesForOffset({x:u,y:h}),0)}}}}},t.prototype.onPinchGesture=function(e){var t,i=null===(t=this.pinchState)||void 0===t?void 0:t.fov,n=e.scale,r=!1;if("pinchstart"!==e.type){if("pinchend"===e.type&&(r=!0,delete this.pinchState),void 0!==i){var o=e.pointers.map((function(e){return ci(e,["x","y"])}));if(!this.emit("wantsGesture","pinch",o,r)){var a=Kn(i/n,this.minFov,this.maxFov);this.emit("wantsPinchGesture",n,a,r)||this.emit("wantsChangeCameraFov",a)||(this.emit("gesture","pinch",o,r),this.emit("pinchGesture",n,a,r),this.userAction=!0,this.interiaMovement=!1,this.cameraMotion.set({fov:a},0).catch(le),this.onPanGesture(e))}}}else this.pinchState={fov:this.cameraMotion.value.fov}},t.prototype.onMouseWheel=function(e){var t=this,i=(Math.abs(e.deltaY)>Math.abs(e.deltaX)?e.deltaY:e.deltaX)/-60,n=[{x:e.clientX,y:e.clientY,delta:i}];if(!this.emit("wantsGesture","mouseWheel",n,!1)){var r=Kn(this.cameraMotion.value.fov-i,this.minFov,this.maxFov);this.emit("wantsMouseWheel",i,r,!1)||this.emit("wantsChangeCameraFov",r)||(this.emit("gesture","mouseWheel",n,!1),this.emit("mouseWheel",i,r,!1),this.userAction=!0,this.interiaMovement=!1,this.cameraMotion.set({fov:r},0).catch(le),this.mouseWheelState&&clearTimeout(this.mouseWheelState.timer),this.mouseWheelState={timer:window.setTimeout((function(){delete t.mouseWheelState;t.emit("wantsGesture","mouseWheel",n,!0)||t.emit("wantsMouseWheel",i,r,!0)||t.emit("wantsChangeCameraFov",r)||(t.emit("gesture","mouseWheel",n,!0),t.emit("mouseWheel",0,r,!0))}),200)})}},t.prototype.onMouseMove=function(e){if(this.intersectMesh.parent&&!this.model.empty&&this.model.bvhs&&!0===this.model.bvhs.loaded&&!this.panState){var t=this.relativeClientPosition({x:e.clientX,y:e.clientY}),i=new n.Raycaster;if(i.setFromCamera(t,this.camera),this.emit("wantsShowIntersectionOnModel",i))this.hideIntersectMesh();else{var r=this.model.intersectRaycaster(i)[0];if(r&&r.face){var o=r.face.normal,a=o.clone().multiplyScalar(.05),s=r.point.clone().add(a);this.intersectMesh.position.copy(s);var l=s.clone().add(a);if(this.intersectMesh.lookAt(l),Math.abs(o.y)>.99){var c=this.camera.position.clone().sub(s);this.intersectMesh.rotation.z=-Math.atan2(c.z,c.x)}this.intersectMesh.visible=!0,this.needsRender=!0,this.emit("intersectionOnModelUpdate",r,this.intersectMesh)}else this.hideIntersectMesh();this.mouseMoveState={clientX:e.clientX,clientY:e.clientY}}}},t.prototype.onMouseOut=function(){this.intersectMesh.parent&&!0===this.intersectMesh.visible&&this.hideIntersectMesh()},t.prototype.onPressGesture=function(e,t){var i,r,o=[e];if(this.emit("wantsGesture","press",o,t))return null===(i=this.pressState)||void 0===i||i.stop(),void delete this.pressState;var a=this.relativeClientPosition(e),s=new n.Raycaster;if(s.setFromCamera(a,this.camera),this.emit("wantsPressGesture",s,a,e.delta,t))return null===(r=this.pressState)||void 0===r||r.stop(),void delete this.pressState;this.emit("gesture","press",o,t),this.emit("pressGesture",s,a,e.delta,t)},t}(Jr);function uo(){return lo||(lo=new Promise((function(e){var t,i=document.createElement("video");i.muted=!0,i.src="data:video/mp4;base64,AAAAHGZ0eXBNNFYgAAACAGlzb21pc28yYXZjMQAAAAhmcmVlAAAGF21kYXTeBAAAbGliZmFhYyAxLjI4AABCAJMgBDIARwAAArEGBf//rdxF6b3m2Ui3lizYINkj7u94MjY0IC0gY29yZSAxN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AAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAACMc3RjbwAAAAAAAAAfAAAALAAAA1UAAANyAAADhgAAA6IAAAO+AAAD0QAAA+0AAAQAAAAEHAAABC8AAARLAAAEZwAABHoAAASWAAAEqQAABMUAAATYAAAE9AAABRAAAAUjAAAFPwAABVIAAAVuAAAFgQAABZ0AAAWwAAAFzAAABegAAAX7AAAGFwAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTUuMzMuMTAw",i.addEventListener("timeupdate",(function n(){i.removeEventListener("timeupdate",n,!1),clearTimeout(t);var r=document.createElement("canvas");r.width=r.height=1;var o=r.getContext("2d");o?(o.drawImage(i,0,0,1,1),o.getImageData(0,0,1,1).data[3]>10?e(!0):e(!1)):e(!1)}),!1),i.addEventListener("canplay",(function e(){i.removeEventListener("canplay",e,!1),i.play()}),!1),t=window.setTimeout((function(){return e(!1)}),1e3)})))}var ho,po=function(e){function t(t,i){return void 0===i&&(i=.5),e.call(this,t,{uniforms:{inputBuffer:new n.Uniform(null),scale:new n.Uniform(i)},fragment:"\n#include <common>\nuniform sampler2D inputBuffer;\nuniform float scale;\nvarying vec2 vUv;\n\nvoid main() {\n float u = (vUv.x - 0.5) * scale + 0.5;\n float v = (vUv.y - 0.5) * scale + 0.5;\n vec3 rgb = texture2D(inputBuffer, vec2(u, v)).rgb;\n float luminance = clamp(linearToRelativeLuminance(rgb), 0.1, 0.9);\n gl_FragColor = vec4(luminance);\n}\n"})||this}return te(t,e),t}(Wr),fo=function(e){function t(t,i){void 0===i&&(i=.002);var r=e.call(this,t,{uniforms:{targetBuffer:new n.Uniform(null),inputBuffer:new n.Uniform(null),step:new n.Uniform(i)},fragment:"\n uniform sampler2D targetBuffer;\n uniform sampler2D inputBuffer;\n uniform float step;\n varying vec2 vUv;\n void main() {\n\n #ifdef GL_EXT_shader_texture_lod\n #if __VERSION__ < 300\n float target = texture2DLodEXT(targetBuffer, vUv, 5.0).r;\n #else\n float target = textureLod(targetBuffer, vUv, 5.0).r;\n #endif\n #else\n float target = texture2D(targetBuffer, vUv).r;\n #endif\n float current = texture2D(inputBuffer, vUv).r;\n\n float result;\n if (abs(target - current) < step) {\n result = target;\n } else if (target - current > 0.0) {\n result = current + step;\n } else {\n result = current - step;\n }\n gl_FragColor = vec4(result, result, result, 1.0);\n }\n "})||this;return r.material.extensions.shaderTextureLOD=!0,r}return te(t,e),Object.defineProperty(t.prototype,"targetBuffer",{get:function(){return this.material.uniforms.targetBuffer.value},set:function(e){this.material.uniforms.targetBuffer.value=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"step",{get:function(){return this.material.uniforms.step.value},set:function(e){this.material.uniforms.step.value=e},enumerable:!1,configurable:!0}),t}(Wr),Ao=function(e){function t(t){var i=e.call(this,t,{uniforms:{inputBuffer:new n.Uniform(null),luminanceAdaptiveBuffer:new n.Uniform(null),progress:new n.Uniform(0)},fragment:"\n #include <common>\n uniform sampler2D inputBuffer;\n uniform sampler2D luminanceAdaptiveBuffer;\n uniform float progress;\n varying vec2 vUv;\n\n void main() {\n float middleGrey = 1.5;\n float whitePoint = 13.0;\n float exposure = 1.4;\n vec4 inputColor = texture2D(inputBuffer, vUv);\n vec3 rgb = inputColor.rgb * exposure;\n float alpha = inputColor.a;\n float luminance = linearToRelativeLuminance(rgb);\n float lumAvg = texture2D(luminanceAdaptiveBuffer, vec2(0.5)).r;\n float lumScaled = (luminance * middleGrey) / max(lumAvg, 1e-6);\n float lumCompressed = lumScaled * (1.0 + lumScaled / (whitePoint * whitePoint));\n lumCompressed /= (1.0 + lumScaled);\n rgb = clamp(lumCompressed * rgb, 0.0, 1.0);\n gl_FragColor = mix(inputColor, vec4(rgb, alpha), progress * 0.9);\n }\n "})||this;return i.material.transparent=!0,i}return te(t,e),Object.defineProperty(t.prototype,"luminanceAdaptiveBuffer",{get:function(){return this.material.uniforms.luminanceAdaptiveBuffer.value},set:function(e){this.material.uniforms.luminanceAdaptiveBuffer.value=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"progress",{get:function(){return this.material.uniforms.progress.value},set:function(e){this.material.uniforms.progress.value=e},enumerable:!1,configurable:!0}),t}(Wr),vo=function(e){function t(t){var i=e.call(this,t)||this;return i.enableTime=ue(),i.renderer=t,i.valuePass=new Xr(i.renderer),i.luminancePass=new po(i.renderer,Math.sqrt(1/3)),i.nextStepPass=new fo(i.renderer,.01),i.luminanceAdaptivePass=new Ao(i.renderer),i}return te(t,e),t.prototype.render=function(e,t){if(!this.enable)return this.enableTime=null,void this.copyPass.render(e,t);null===this.enableTime&&(this.enableTime=ue()),this.luminanceTargetBuffer||(this.luminanceTargetBuffer=new n.WebGLRenderTarget(128,128,{minFilter:n.LinearMipmapLinearFilter,magFilter:n.LinearFilter,encoding:this.renderer.outputEncoding,stencilBuffer:!1,depthBuffer:!1,format:n.RGBAFormat,generateMipmaps:!0}),this.nextStepPass.targetBuffer=this.luminanceTargetBuffer.texture),this.luminancePass.render(e,this.luminanceTargetBuffer),this.luminancePrevBuffer||(this.luminancePrevBuffer=new n.WebGLRenderTarget(1,1,{minFilter:n.NearestFilter,magFilter:n.NearestFilter,type:n.HalfFloatType,encoding:this.renderer.outputEncoding,stencilBuffer:!1,depthBuffer:!1}),this.valuePass.render(new n.Vector3(.5,.5,.5),this.luminancePrevBuffer)),this.luminanceNextBuffer||(this.luminanceNextBuffer=new n.WebGLRenderTarget(1,1,{minFilter:n.NearestFilter,magFilter:n.NearestFilter,type:n.HalfFloatType,encoding:this.renderer.outputEncoding,stencilBuffer:!1,depthBuffer:!1}),this.valuePass.render(new n.Vector3(.5,.5,.5),this.luminanceNextBuffer),this.luminanceAdaptivePass.luminanceAdaptiveBuffer=this.luminanceNextBuffer.texture),this.copyPass.render(this.luminanceNextBuffer,this.luminancePrevBuffer),this.nextStepPass.render(this.luminancePrevBuffer,this.luminanceNextBuffer),this.luminanceAdaptivePass.progress=Math.min((ue()-this.enableTime)/100,1),this.luminanceAdaptivePass.render(e,t)},t.prototype.dispose=function(){var e,t,i;null===(e=this.luminanceTargetBuffer)||void 0===e||e.dispose(),null===(t=this.luminancePrevBuffer)||void 0===t||t.dispose(),null===(i=this.luminanceNextBuffer)||void 0===i||i.dispose(),this.copyPass.dispose(),this.luminancePass.dispose(),this.nextStepPass.dispose(),this.luminanceAdaptivePass.dispose()},t}(Zr),mo=null!==(ho=Math.SQRT1_2)&&void 0!==ho?ho:Math.sqrt(2),go={up:new n.Quaternion(mo,0,0,mo),down:new n.Quaternion(-mo,0,0,mo),left:new n.Quaternion(0,mo,0,mo),right:new n.Quaternion(0,-mo,0,mo),front:new n.Quaternion(0,0,0,1),back:new n.Quaternion(0,1,0,0)},yo=new Float32Array([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),bo=new Float32Array([0,0,1,0,0,1,1,1]),xo=new Uint8Array([0,1,2,1,3,2]),wo=new n.BufferGeometry;wo.setAttribute("position",new n.BufferAttribute(yo,3)),wo.setAttribute("uv",new n.BufferAttribute(bo,2)),wo.setIndex(new n.BufferAttribute(xo,1));var Mo=function(e){function t(){var t=e.call(this,{uniforms:{map:{value:null},luminanceMap:{value:null}},vertexShader:"\nvarying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n",fragmentShader:"\n#if defined(USE_LUMINANCE)\nuniform sampler2D luminanceMap;\n#endif\nuniform sampler2D map;\nvarying vec2 vUv;\n\nvoid main() {\n gl_FragColor = texture2D(map, vUv);\n #if defined(USE_LUMINANCE)\n gl_FragColor.a = 1.0 - texture2D(luminanceMap, vUv).r;\n #endif\n}\n"})||this;return t.depthTest=!1,t.depthWrite=!1,t.blending=n.NoBlending,t.map=t.uniforms.map.value,t.luminanceMap=t.uniforms.luminanceMap.value,Object.defineProperties(t,{map:{get:function(){return this.uniforms.map.value},set:function(e){this.uniforms.map.value=e}},luminanceMap:{get:function(){return this.uniforms.luminanceMap.value},set:function(e){this.uniforms.luminanceMap.value=e,this.defines.USE_LUMINANCE=null!==e,this.needsUpdate=!0}}}),t}return te(t,e),t}(n.ShaderMaterial),Co=function(e){function t(t,i){var r=e.call(this,wo,new Mo)||this;return t.box.getCenter(r.position),r.quaternion.multiplyQuaternions((new n.Quaternion).setFromAxisAngle(new n.Vector3(0,1,0),-Math.PI),go[t.face]),r.scale.setScalar(t.size),r.node=t,r.name="tiling:tile",r.material.visible=!1,r.activeTime=-1,r.disposed=!1,r.needsRender=!1,r.frustumCulled=!1,i.then((function(e){var t=e[0],i=e[1];r.disposed?(t.dispose(),null==i||i.dispose()):(r.material.map=t,r.material.luminanceMap=i,r.material.needsUpdate=!0,r.material.visible=!0,r.needsRender=!0)})).catch(le),r}return te(t,e),t.prototype.updateTime=function(e){},t.prototype.dispose=function(){var e;this.disposed=!0,this.material.map&&(this.material.map.dispose(),null===(e=this.material.luminanceMap)||void 0===e||e.dispose()),this.material.dispose()},t}(n.Mesh),Eo=function(e){function t(){var t=e.call(this)||this;return t.needsRender=!1,t.name="tiling",t}return te(t,e),t}(n.Group),Io=function(){function e(e,t,i){this.disposed=!1,this.textureLoader=new Et(e),this.minLevel=t,this.level=0,this.panoIndex=0,this.pedding=0,this.tileTree=Ge(this.minLevel),this.tileMeshes=new Map,this.resource=[],this.luminance=null,this.imageOptions=i,this.object=new Eo,this.object.renderOrder=-3}return e.prototype.setAllowHosts=function(e){this.textureLoader.setAllowHosts(e)},e.prototype.setRequestProxy=function(e){this.textureLoader.setRequestProxy(e)},e.prototype.setNetworkSubscribe=function(e){this.textureLoader.setNetworkSubscribe(e)},e.prototype.cleanup=function(){var e=this;this.tileMeshes.forEach((function(t){t.dispose(),e.object.remove(t),e.object.needsRender=!0})),this.tileMeshes.clear()},e.prototype.setRotation=function(e){this.disposed||this.object.quaternion.equals(e)||(this.object.quaternion.copy(e),this.object.needsRender=!0)},e.prototype.setPosition=function(e){this.disposed||this.object.position.equals(e)||(this.object.position.copy(e),this.object.needsRender=!0)},e.prototype.setResource=function(e,t){var i,n;if(!this.disposed&&(this.resource!==e||this.luminance!==t)){this.cleanup(),this.resource=e;var r=null!==(n=null===(i=e.slice().sort((function(e,t){return t.level-e.level}))[0])||void 0===i?void 0:i.level)&&void 0!==n?n:0;this.tileTree=Ge(r),this.luminance=t,this.object.needsRender=!0}},e.prototype.update=function(e,t,i){var r=this;if(!this.disposed){this.level=t;var o=e.planes[5].normal,a=[];t>=this.minLevel&&We(this.tileTree,(function(i){if(!(i.level<r.minLevel))return!(i.level>t)&&(!!e.intersectsBox(i.box)&&void a.push(i))}));var s=new n.Vector3;a.sort((function(e,t){return e.level!==t.level?e.level-t.level:e.box.getCenter(s).angleTo(o)-t.box.getCenter(s).angleTo(o)}));for(var l=new Set,c=function(e){var t=u.resource.filter((function(t){return t.level===e.level}))[0];if(!t)return"continue";if(l.add(e),u.tileMeshes.has(e))return u.tileMeshes.get(e).activeTime=i,"continue";var n=t.size,o=u.imageOptions.transform,a=Math.pow(2,e.level)*e.position.y,s=Math.pow(2,e.level)*e.position.x,c="".concat(u.panoIndex,".").concat(e.face,".").concat(e.level,".").concat(a,".").concat(s),h=ie(ie({key:"pano_tile.".concat(c)},ci(u.imageOptions,["format","size","quality","sharpen","mappings"])),{size:n*e.size==512?void 0:512,cut:[n*e.position.x,n*e.position.y,n*e.size,n*e.size]}),d=u.textureLoader.loadTexture(t[e.face],{imageURL:{transform:o,options:h}}).then((function(e){return e.body})),p=null;if(u.luminance){var f=u.luminance[e.face],A=f.match(/\/cube_(\d+)\//),v=!!A&&Number(A[1]);if(!1!==v){var m=ie(ie({},h),{size:v*e.size==256?void 0:256,cut:[v*e.position.x,v*e.position.y,v*e.size,v*e.size],key:"pano_tile_luminance.".concat(c)});p=u.textureLoader.loadTexture(f,{imageURL:{transform:u.imageOptions.transform,options:m}}).then((function(e){return e.body})).catch((function(){return null}))}}u.pedding++;var g=Promise.all([d,p]).then((function(e){return r.pedding--,e}),(function(e){return r.pedding--,Promise.reject(e)})),y=new Co(e,g);y.name="tiling:tile-".concat(c),y.activeTime=i,y.renderOrder=e.level,u.tileMeshes.set(e,y),u.object.needsRender=!0,u.object.add(y)},u=this,h=0,d=a;h<d.length;h++){c(m=d[h])}var p=[];this.tileMeshes.forEach((function(e,i){l.has(i)||p.push(i),e.visible=i.level<=t}));for(var f=p.sort((function(e,t){var i,n,o,a;return(null!==(n=null===(i=r.tileMeshes.get(t))||void 0===i?void 0:i.activeTime)&&void 0!==n?n:0)-(null!==(a=null===(o=r.tileMeshes.get(e))||void 0===o?void 0:o.activeTime)&&void 0!==a?a:0)})).slice(Math.max(0,32-l.size)),A=0,v=f;A<v.length;A++){var m=v[A],g=this.tileMeshes.get(m);g&&(g.dispose(),this.object.remove(g),this.object.needsRender=!0),this.tileMeshes.delete(m)}}},e.prototype.dispose=function(){this.cleanup(),this.resource=[],this.disposed=!0},e}(),So=new Float32Array([-1,1,1,-1,1,-1,-1,-1,1,-1,-1,-1,1,1,-1,1,1,1,1,-1,-1,1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,-1,1,-1,-1,1,1,-1,-1,-1,-1,-1,1,1,1,-1,1,1,1,-1,1,-1,-1,1,-1,1,-1,1,1,-1,-1,-1,-1,1,-1,-1]),Bo=new Uint8Array([0,2,1,2,3,1,4,6,5,6,7,5,8,10,9,10,11,9,12,14,13,14,15,13,16,18,17,18,19,17,20,22,21,22,23,21]),To=new n.BufferGeometry;To.setAttribute("position",new n.BufferAttribute(So,3)),To.setIndex(new n.BufferAttribute(Bo,1));var Po=function(){function e(){this.material=new n.ShaderMaterial({vertexShader:"\n#if defined(USE_PANO_VIDEO)\nvarying vec3 worldPosition;\n#endif\nvoid main() {\n vec4 transformed = vec4(position, 1.0);\n #if defined(USE_PANO_VIDEO)\n worldPosition = (modelMatrix * transformed).xyz;\n #endif\n gl_Position = projectionMatrix * modelViewMatrix * transformed;\n}\n",fragmentShader:"\nuniform vec2 size;\nuniform mat4 matrix;\nuniform float alpha;\nuniform sampler2D map;\n#if defined(USE_PANO_VIDEO)\nvarying vec3 worldPosition;\n#endif\n#include <common>\nvoid main() {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);\n #if defined(USE_PANO_VIDEO)\n vec3 cameraToVertex = worldPosition - cameraPosition;\n vec4 mapCoods = vec4(cameraToVertex, 1.0) * matrix;\n vec2 uv = vec2(\n 0.5 + mapCoods.x / mapCoods.z / size.x,\n 0.5 - mapCoods.y / mapCoods.z / size.y\n );\n vec4 videoColor = texture2D(map, uv);\n float match = (1.0 - step(0.0, mapCoods.z)) * (1.0 - step(0.5, abs(uv.x - 0.5))) * (1.0 - step(0.5, abs(uv.y - 0.5)));\n float blendAlpha = clamp(0.0, 1.0, 5.0 * (1.0 - clamp(distance(uv, vec2(0.5, 0.5)) / 0.55 , 0.0, 1.0)));\n gl_FragColor = vec4(videoColor.rgb, match * blendAlpha * alpha);\n #endif\n}\n",uniforms:{size:new n.Uniform(null),matrix:new n.Uniform(null),alpha:new n.Uniform(null),map:new n.Uniform(null)},depthTest:!1,depthWrite:!1,defines:{USE_PANO_VIDEO:!1},blending:n.CustomBlending,blendSrc:n.SrcAlphaFactor,blendDst:n.OneMinusSrcAlphaFactor,blendSrcAlpha:n.OneFactor,blendDstAlpha:n.OneMinusSrcAlphaFactor}),this.object=new n.Mesh(To,this.material),this.object.visible=!1,this.object.renderOrder=-1,this.object.frustumCulled=!1,this.object.name="pano-video",this.alphaMotion=new ur({alpha:0})}return e.prototype.setMaterial=function(e){e?(this.material.uniforms.size.value=e.size,this.material.uniforms.matrix.value=e.matrix,this.material.uniforms.map.value=e.map,this.alphaMotion.set({alpha:e.alpha},500).catch(le),this.material.uniforms.alpha.value=e.alpha):(this.material.uniforms.size.value=null,this.material.uniforms.matrix.value=null,this.material.uniforms.map.value=null,this.alphaMotion.set({alpha:0},0).catch(le));var t=null!==e;t!==this.material.defines.USE_PANO_VIDEO&&(this.material.defines.USE_PANO_VIDEO=t,this.material.needsUpdate=!0,this.object.visible=null!==e)},e.prototype.updateTime=function(e){this.alphaMotion.ended||(this.alphaMotion.update(e),this.material.uniforms.alpha.value=this.alphaMotion.value.alpha)},e.prototype.dispose=function(){this.material.dispose()},e}(),Ro=(new n.Matrix4).makeRotationAxis(new n.Vector3(0,1,0),Math.PI),ko=new n.Vector3(-1,1,1),Qo=function(){function e(e){void 0===e&&(e=0),this.width=e,this.pool=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.pool.length},enumerable:!1,configurable:!0}),e.prototype.create=function(){return new n.WebGLCubeRenderTarget(this.width,{stencilBuffer:!1,depthBuffer:!1})},e.prototype.pop=function(){var e=this.pool.pop();return e||this.create()},e.prototype.push=function(e){-1===this.pool.indexOf(e)&&this.pool.push(e)},e.prototype.clear=function(){for(var e=0,t=this.pool;e<t.length;e++){t[e].dispose()}this.pool.length=0},e}(),Do=function(e){function t(i){var n,r,o,a,s=this,l=t.parseArgs(i);(s=e.call(this,l)||this).TILED_CUBE_TEXTURE_LEVEL=2,s.tileLevel=0,s.initAnimationed=!1,s.forwardPanoIndex=null,s.currentPanoIndex=l.initial[0],s.maxAccessibleDistance=l.maxAccessibleDistance,s.panoTapTriggerRadius=l.panoTapTriggerRadius,s.panoCircleMeshCreator=l.panoCircleMeshCreator,s.tileLevelForFov=l.tileLevelForFov,s.luminanceAdaptiveEffectEnable=l.luminanceAdaptiveEffectEnable,s.colorCubeRenderTargetPool=new Qo,s.luminanceCubeRenderTargetPool=new Qo;var c=s.model.getMaterial()||{},u=c.pano0,h=c.pano1;u&&(null==h?void 0:h.map)!==u.map&&(s.model.setMaterial({pano0:h}),u.map.dispose(),u.map instanceof Ct&&u.map.cubeRenderTarget&&s.colorCubeRenderTargetPool.push(u.map.cubeRenderTarget),u.luminanceMap&&(u.luminanceMap.dispose(),u.luminanceMap instanceof Ct&&u.luminanceMap.cubeRenderTarget&&s.luminanceCubeRenderTargetPool.push(u.luminanceMap.cubeRenderTarget)));for(var d=s.colorCubeRenderTargetPool.size;d<2;d++){var p=Math.max(1024*s.TILED_CUBE_TEXTURE_LEVEL,512),f=s.colorCubeRenderTargetPool.create();f.setSize(p,p),et(null,f,s.renderer),s.colorCubeRenderTargetPool.push(f)}s.panoMeshes=[],s.panoMeshHitTested={},s.updatePanoMeshes(),s.locationMotion=new ur({count:0,distance:s.camera.pose.distance,modelAlpha:null!==(r=null===(n=s.model.getMaterial())||void 0===n?void 0:n.modelAlpha)&&void 0!==r?r:0,perspToOrtho:s.camera.perspToOrtho.x,orthoDistance:s.camera.orthoDistance}),s.panoResources={},s.panoResources[s.locationMotion.keyframes[0].key=s.locationMotion.keyframes[1].key=In()]={panoIndex:s.currentPanoIndex,workCode:s.work.workCode,panoPicture:null!==(a=null===(o=s.model.getMaterial())||void 0===o?void 0:o.pano1)&&void 0!==a?a:null,position:s.camera.pose.offset.clone(),effect:"fly"};var A={allowHosts:s.work.allowHosts,requestProxy:s.requestProxy,networkSubscribe:s.networkSubscribe};return s.textureLoader=new Et(A),s.tiling=new Io(A,s.TILED_CUBE_TEXTURE_LEVEL+1,s.imageOptions),s.scene.add(s.tiling.object),s.panoVideo=new Po,s.scene.add(s.panoVideo.object),s}return te(t,e),t.parseArgs=function(t){var i,n,r,o,a,s=e.parseArgs.call(this,t);return ie(ie({},s),{maxAccessibleDistance:null!==(i=t.maxAccessibleDistance)&&void 0!==i?i:5,panoTapTriggerRadius:null!==(n=t.panoTapTriggerRadius)&&void 0!==n?n:.5,panoCircleMeshCreator:null!==(r=t.panoCircleMeshCreator)&&void 0!==r?r:function(e){return new pr},tileLevelForFov:null!==(o=t.tileLevelForFov)&&void 0!==o?o:function(e,t){var i=2*Math.atan(Math.tan(e/180*Math.PI/2)*(t.width/t.height))/Math.PI*180,n=Math.max(t.width/i,t.height/e);return n>60?4:n>30?3:n>18?2:n>12?1:0},luminanceAdaptiveEffectEnable:null===(a=t.luminanceAdaptiveEffectEnable)||void 0===a||a})},t.initAnimationEndPose=function(t){var i=this.parseArgs(t);return e.initAnimationEndPose.call(this,i)},t.prototype.destroy=function(){var t,i,n=this;e.prototype.destroy.call(this),this.scene.remove(this.tiling.object),this.tiling.dispose(),this.locationMotion.dispose(),this.colorCubeRenderTargetPool.clear(),this.luminanceCubeRenderTargetPool.clear(),delete this.pendingTextureTask,this.panoMeshes&&(this.panoMeshes.forEach((function(e){n.helper.remove(e),e.dispose()})),this.panoMeshes.length=0),this.interiaMovement=!1;var r=this.videoTexture.image;r.pause(),r.oncanplay=function(){},r.ontimeupdate=function(){},this.scene.remove(this.panoVideo.object),this.panoVideo.setMaterial(null),this.panoVideo.dispose();for(var o=null!==(t=this.model.getMaterial())&&void 0!==t?t:{},a=o.pano0,s=o.pano1,l=0,c=Object.keys(this.panoResources);l<c.length;l++){var u=c[l],h=this.panoResources[u];if(h.panoPicture){var d=h.panoPicture.map;d&&d!==(null==a?void 0:a.map)&&d!==(null==s?void 0:s.map)&&(d.dispose(),null===(i=h.panoPicture.luminanceMap)||void 0===i||i.dispose(),h.panoPicture=null)}delete this.panoResources[u]}this.luminanceAdaptiveEffect&&(this.luminanceAdaptiveEffect.dispose(),delete this.luminanceAdaptiveEffect)},t.prototype.isReady=function(){return!0===this.locationMotion.ended&&e.prototype.isReady.call(this)},t.prototype.isTileReady=function(){var e,t,i,n=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),r=(null===(e=n.panoPicture)||void 0===e?void 0:e.map)instanceof Ct&&null!==(i=null===(t=n.panoPicture)||void 0===t?void 0:t.map.tilePending)&&void 0!==i?i:0,o=this.tiling.pedding;return this.initAnimationed&&r<=0&&o<=0},t.prototype.updateWork=function(e,t,i,n,r){var o=this;return this.userAction=r,this.work=e,this.currentPanoIndex=t,this.textureLoader.setAllowHosts(this.work.allowHosts),this.tiling.setAllowHosts(this.work.allowHosts),this.tiling.cleanup(),this.initAnimationed=!1,this.hideIntersectMesh(),this.updatePanoMeshes(),this.moveToPano(t,{effect:"fade",duration:n,longitude:i.longitude,latitude:i.latitude,fov:i.fov,moveEndCallback:function(){o.initAnimationed=!0},moveCancelCallback:function(){o.initAnimationed=!0}},r),!0},t.prototype.updateModel=function(e){this.model=e,this.updatePanoMeshes(!0)},t.prototype.updateTime=function(e,t){var i,r,o,a,s,l,c,u,h,d,p=this;if(!this.destroyed){var f=this.currentPanoIndex,A={},v={},m=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[0]),g=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),y=!1;if(!1===this.locationMotion.ended){this.locationMotion.update(e);var b=this.locationMotion.getKeyFrameSegment(e),x=b[0],w=b[1],M=this.panoResourceFromLocationMotionKeyframe(x),C=this.panoResourceFromLocationMotionKeyframe(w),E=(new n.Vector3).copy(M.position),I=(new n.Vector3).copy(C.position),S=this.locationMotion.value.count-w.value.count+1;A.progress=S,A.modelAlpha=this.locationMotion.value.modelAlpha,this.camera.perspToOrtho.setScalar(Kn(this.locationMotion.value.perspToOrtho,0,1)),this.camera.orthoDistance=this.locationMotion.value.orthoDistance,C.panoPicture&&(S<1?M.panoPicture&&(A.pano0=M.panoPicture):A.pano0=C.panoPicture,A.pano1=C.panoPicture),y=A.useBlackTransition="instant"===C.effect||"montage"===C.effect,"fade"!==C.effect&&"montage"!==C.effect||(A.pano0&&M.panoPicture&&(A.pano0={map:A.pano0.map,luminanceMap:A.pano0.luminanceMap,matrix:M.panoPicture.matrix.clone().setPosition(C.position)}),E.copy(I)),v.distance=this.locationMotion.value.distance,v.offset=new n.Vector3(E.x+(I.x-E.x)*S,E.y+(I.y-E.y)*S,E.z+(I.z-E.z)*S);for(var B=[],T=[],P=0,R=this.locationMotion.keyframes;P<R.length;P++){var k=R[P],Q=k.key,D=k.progress;void 0!==Q&&(B.push(Q),D>=this.locationMotion.progress&&T.push(Q))}for(var F=0,L=Object.keys(this.panoResources);F<L.length;F++){var O=L[F];if(!(T.indexOf(O)>=0)){var N=this.panoResources[O];if(N.panoPicture){var V=N.panoPicture.map,U=N.panoPicture.luminanceMap;if(V){if(V===(null===(i=A.pano0)||void 0===i?void 0:i.map))continue;if(V===(null===(r=A.pano1)||void 0===r?void 0:r.map))continue;V instanceof Ct&&V.cubeRenderTarget&&this.colorCubeRenderTargetPool.push(V.cubeRenderTarget),V.dispose(),U&&(U instanceof Ct&&U.cubeRenderTarget&&this.luminanceCubeRenderTargetPool.push(U.cubeRenderTarget),U.dispose()),N.panoPicture=null}}B.indexOf(O)>=0||delete this.panoResources[O]}}M.workCode===C.workCode?this.currentPanoIndex=S<.5?M.panoIndex:C.panoIndex:this.currentPanoIndex=C.panoIndex,this.emit("movingToPano",g.panoIndex,m.panoIndex,this.locationMotion.progress)}!1===this.cameraMotion.ended&&(this.cameraMotion.update(e),v.longitude=this.cameraMotion.value.longitude,v.latitude=this.cameraMotion.value.latitude,v.fov=this.cameraMotion.value.fov),!1===Ur(A)&&((null===(o=A.pano0)||void 0===o?void 0:o.map)&&A.pano0.map instanceof Ct&&!A.pano0.map.cubeRenderTarget&&(A.pano0.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),(null===(a=A.pano0)||void 0===a?void 0:a.luminanceMap)&&A.pano0.luminanceMap instanceof Ct&&!A.pano0.luminanceMap.cubeRenderTarget&&(A.pano0.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),(null===(s=A.pano1)||void 0===s?void 0:s.map)&&A.pano1.map instanceof Ct&&!A.pano1.map.cubeRenderTarget&&(A.pano1.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),(null===(l=A.pano1)||void 0===l?void 0:l.luminanceMap)&&A.pano1.luminanceMap instanceof Ct&&!A.pano1.luminanceMap.cubeRenderTarget&&(A.pano1.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),this.model.setMaterial(A));var z=!1;if(!1===Ur(v)&&(this.setCamera(v),z=!0),this.currentPanoIndex!==f&&(this.updatePanoMeshesVisible(),z=!0),z)if(te=this.work.observers[this.currentPanoIndex]){var q=Qt(this.camera.pose).normalize(),H=new n.Raycaster(te.position,q);this.forwardPanoIndex=this.getForwardPanoIndexOrNot(H)}if(this.camera.pose.distance>.1||y){var _=this.work.observers[this.currentPanoIndex];if(_)for(var K=0,j=Y=_.visibleNodes.concat(this.currentPanoIndex);K<j.length;K++){var G=j[K];(ee=this.panoMeshes[G])&&ee.setOpacity(0)}}else{var W=this.work.observers[this.currentPanoIndex];if(W){var X=Vr(W.visibleNodes,(function(e){return W.standingPosition.distanceTo(p.work.observers[e].standingPosition)}),!0)[1];X=Kn(X,2.5,1/0);for(var Y=W.visibleNodes.concat(this.currentPanoIndex),Z=this.camera.getDirection(new n.Vector3),J=0,$=Y;J<$.length;J++){G=$[J];var ee,te=this.work.observers[G];if(ee=this.panoMeshes[G])if(te.loadable||te.active){var ie=ee.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);ee.setCurrent(!ee.loading&&0===ee.progress&&this.forwardPanoIndex===G),ee.setOpacity(ie<.01?0:Kn(X/ie*1.2,.4,.85));var ne=this.camera.position.clone().setY(ee.position.y);q=(new n.Vector3).copy(ee.position).sub(ne).normalize();if(G===this.currentPanoIndex){var re=Kn((.5-ne.distanceTo(ee.position))/.5,0,1);q.multiplyScalar(1-re).add(Z.clone().multiplyScalar(re))}q.length()>0&&ee.quaternion.setFromEuler(new n.Euler(0,Math.atan2(q.x,q.z),0)),ee.updateTime&&ee.updateTime(e,t)}else ee.setOpacity(0)}}}var oe=this.tileLevel=function(){if(!1===p.tileLevelForFov)return 0;var e=p.renderer.getDrawingBufferSize(new n.Vector2);e.width*=p.scissor.width,e.height*=p.scissor.height;var t=g.panoIndex,i=p.work.observers[t],r=p.imageOptions.size;if(void 0===r&&i){var o=i.images.up.match(/\/cube_(\d+)\//);o&&(r=Number(o[1]))}void 0===r&&(r=2048);var a=0;r>=1024&&(a=1),r>=2048&&(a=2),r>=4096&&(a=3),r>=8192&&(a=4);var s=p.tileLevelForFov(p.camera.fov,e);return s>a?s:0}(),ae=function(){var e,t=p.camera.quaternion.clone();t.premultiply((null!==(e=p.work.observers[g.panoIndex])&&void 0!==e?e:p.work.observers[p.currentPanoIndex]).quaternion.clone().inverse());var i=(new n.Matrix4).makeRotationFromQuaternion(t),r=(new n.Matrix4).getInverse(i);return(new n.Frustum).setFromProjectionMatrix((new n.Matrix4).multiplyMatrices(p.camera.projectionMatrix,r))}();g.panoIndex===this.currentPanoIndex&&((null===(c=g.panoPicture)||void 0===c?void 0:c.map)instanceof Ct&&(g.panoPicture.map.update(ae,oe),!0===g.panoPicture.map.needsRender&&(g.panoPicture.map.needsRender=!1,this.needsRender=!0)),(null===(u=g.panoPicture)||void 0===u?void 0:u.luminanceMap)instanceof Ct&&(g.panoPicture.luminanceMap.update(ae,oe),!0===g.panoPicture.luminanceMap.needsRender&&(g.panoPicture.luminanceMap.needsRender=!1,this.needsRender=!0)));var se=this.tiling.object.visible;if(this.initAnimationed){var le=g.panoIndex,ce=this.work.observers[le];ce&&Er(this.camera.position,ce.position)&&this.locationMotion.ended?(this.tiling.object.visible=!0,this.tiling.panoIndex!==le&&this.tiling.cleanup(),this.tiling.panoIndex=le,this.tiling.setResource(null!==(d=null===(h=ce.images)||void 0===h?void 0:h.tiles)&&void 0!==d?d:[],this.enableIOSEDR&&ce.images.luminance?ce.images.luminance:null),this.tiling.setRotation(ce.quaternion),this.tiling.setPosition(ce.position),oe>this.TILED_CUBE_TEXTURE_LEVEL?this.tiling.update(ae,oe,e):this.tiling.update(ae,0,e)):this.tiling.object.visible=!1}else this.tiling.object.visible=!1;se!==this.tiling.object.visible&&(this.tiling.object.needsRender=!0),this.panoVideo.object.position.copy(this.camera.position),this.panoVideo.updateTime(e)}},t.prototype.render=function(){var t=this.work.observers[this.currentPanoIndex];t&&t.video&&(this.needsRender=!0),e.prototype.render.call(this)},t.prototype.postProcessing=function(e,t){if(!this.destroyed)return this.luminanceAdaptiveEffect||(this.luminanceAdaptiveEffect=new vo(this.renderer),this.luminanceAdaptiveEffect.enable=this.luminanceAdaptiveEffectEnable),this.luminanceAdaptiveEffect.render(e,t)},t.prototype.getTargetPose=function(){var e=this.cameraMotion.getKeyFrameSegment(ue())[1],t=this.locationMotion.getKeyFrameSegment(ue())[1],i=this.panoResourceFromLocationMotionKeyframe(t),n=this.work.observers[i.panoIndex];return{longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,offset:n?n.position.clone():this.camera.position.clone(),distance:this.locationMotion.value.distance}},t.prototype.moveToPano=function(e,t,i){var r,o,a,s,l=this,c=this.work.observers[e],u=this.imageOptions.size;if(void 0===u&&c){var h=c.images.up.match(/\/cube_(\d+)\//);h&&(u=Number(h[1]))}void 0===u&&(u=2048);var d=this.imageOptions.transform,p=ie({key:"pano.".concat(e)},ci(this.imageOptions,["format","size","quality","sharpen","mappings"])),f=c.images,A=null!==(o=null===(r=c.images.tiles)||void 0===r?void 0:r.filter((function(e){return e.size>u})))&&void 0!==o?o:null,v=d,m={key:"pano_luminance.".concat(e),size:p.size?p.size/2:1024},g=this.enableIOSEDR&&c.images.luminance?c.images.luminance:null,y=function(){if(!c.images.tiles)return null;if(!g)return null;var e=g.up.match(/\/cube_(\d+)\//),t=!!e&&Number(e[1]);return!1===t?null:null==A?void 0:A.map((function(e){return{level:e.level,size:t,back:g.back,front:g.front,left:g.left,right:g.right,up:g.up,down:g.down}}))}(),b="pano:"+so([f,p,d]);if(this.pendingTextureTask){if(this.pendingTextureTask.hash===b)return;var x=this.pendingTextureTask.panoIndex;null===(a=this.panoMeshes[x])||void 0===a||a.setProgress(0),this.emit("textureAbort",x,c),this.pendingTextureTask.onError(new Error("texture aborted"))}this.pending=!0;var w,M=this.model.getMaterial()||{},C=M.pano0,E=M.pano1;if(C&&C.map.name===b&&null!==C.luminanceMap===this.enableIOSEDR?w=C:(null==E?void 0:E.map.name)===b&&null!==E.luminanceMap===this.enableIOSEDR&&(w=E),w){var I={panoIndex:e,workCode:this.work.workCode,effect:null!==(s=t.effect)&&void 0!==s?s:"fly",panoPicture:{map:w.map,luminanceMap:w.luminanceMap,matrix:(new n.Matrix4).compose(c.position,c.quaternion,ko)},position:c.position.clone()};ke.shared.add((function(){l.pending=!1,l.emit("panoLoaded",e),l.doMoveToPano(e,I,t,i)}),!0,1)}else{this.pendingTextureTask={panoIndex:e,hash:b,onLoad:function(r,o){var a,s;if(l.pending=!1,l.destroyed)r.body.dispose();else{r.body.name=b,l.emit("panoLoaded",e);var u={panoIndex:e,workCode:l.work.workCode,effect:null!==(a=t.effect)&&void 0!==a?a:"fly",panoPicture:{map:r.body,luminanceMap:null!==(s=null==o?void 0:o.body)&&void 0!==s?s:null,matrix:(new n.Matrix4).compose(c.position,c.quaternion,ko)},position:c.position.clone()};l.doMoveToPano(e,u,t,i)}},onError:function(i){l.pending=!1,t.moveCancelCallback&&t.moveCancelCallback(),l.emit("panoLoadError",i,e),l.emit("moveToPanoCanceled",e)}};var S=this.panoMeshes[e];S&&S.tap&&S.tap(),Promise.all([this.tileLevelForFov&&A&&A.length?this.textureLoader.loadTiledCubeTexture(f,A,{tileMaxLevel:this.TILED_CUBE_TEXTURE_LEVEL,imageURL:{transform:d,options:p},format:n.RGBAFormat,viaAjax:!0},void 0,void 0,(function(t){var i,n;l.emit("textureLoading",t,e,c),(null===(i=l.pendingTextureTask)||void 0===i?void 0:i.hash)===b&&(null===(n=l.panoMeshes[e])||void 0===n||n.setProgress(t))}),this.renderer):this.textureLoader.loadCubeTexture(f,{imageURL:{transform:d,options:p},format:n.RGBAFormat,viaAjax:!0},void 0,void 0,(function(t){var i,n;l.emit("textureLoading",t,e,c),(null===(i=l.pendingTextureTask)||void 0===i?void 0:i.hash)===b&&(null===(n=l.panoMeshes[e])||void 0===n||n.setProgress(t))}),this.renderer),g?this.tileLevelForFov&&y&&y.length?this.textureLoader.loadTiledCubeTexture(g,y,{tileImageSize:256,tileMaxLevel:this.TILED_CUBE_TEXTURE_LEVEL,imageURL:{transform:v,options:m}},void 0,void 0,void 0,this.renderer).catch((function(){return null})):this.textureLoader.loadCubeTexture(g,{imageURL:{transform:v,options:m}},void 0,void 0,void 0,this.renderer).catch((function(){return null})):Promise.resolve(null)]).then((function(t){var i,n,r=t[0],o=t[1];(null===(i=l.pendingTextureTask)||void 0===i?void 0:i.hash)===b?(l.pendingTextureTask.onLoad(r,o),null===(n=l.panoMeshes[e])||void 0===n||n.setProgress(0),delete l.pendingTextureTask,l.emit("textureLoaded",e,c,r.meta)):(r.body.dispose(),null==o||o.body.dispose())})).catch((function(t){var i,n;(null===(i=l.pendingTextureTask)||void 0===i?void 0:i.hash)===b&&(l.pendingTextureTask.onError(t),null===(n=l.panoMeshes[e])||void 0===n||n.setProgress(0),delete l.pendingTextureTask,l.emit("textureError",t,e,c),l.emit("error",t))})),this.emit("textureStartLoad",e,c)}},t.prototype.initAnimation=function(e,t,i,n){var r,o,a,s=this;if(!this.destroyed){var l=!1;this.pending=!1,this.userAction=n,this.moveToPano(e,{longitude:null!==(r=t.longitude)&&void 0!==r?r:this.defaultLongitude,latitude:Kn(null!==(o=t.latitude)&&void 0!==o?o:this.defaultLatitude,this.minLatitude,this.maxLatitude),fov:Kn(null!==(a=t.fov)&&void 0!==a?a:this.defaultFov,this.minFov,this.maxFov),duration:i,moveStartCallback:function(e,t){l=!0,s.emit("initAnimationWillStart",e,t,s.userAction)},moveEndCallback:function(e,t){s.emit("initAnimationEnded",e,t,s.userAction),s.initAnimationed=!0},moveCancelCallback:function(){var e={longitude:s.camera.pose.longitude,latitude:s.camera.pose.latitude,fov:s.camera.pose.fov,offset:s.camera.pose.offset.clone(),distance:s.camera.pose.distance};!1===l&&s.emit("initAnimationWillStart",s.currentPanoIndex,e,s.userAction),s.emit("initAnimationEnded",s.currentPanoIndex,e,s.userAction),s.initAnimationed=!0}},n)}},t.prototype.panoResourceFromLocationMotionKeyframe=function(e){return this.panoResources[e.key]},t.prototype.locationMotionKeyframesLength=function(e){for(var t=0,i=1;i<e.length;i++){var n=this.panoResourceFromLocationMotionKeyframe(e[i-1]).position,r=this.panoResourceFromLocationMotionKeyframe(e[i]).position;t+=n.distanceTo(r)*(e[i].value.count-e[i-1].value.count)}return t},t.prototype.updatePanoMeshesVisible=function(e){var t=this;void 0===e&&(e=!1);for(var i=this.work.observers[this.currentPanoIndex],r=(i?i.visibleNodes:[]).concat(this.currentPanoIndex),o=[],a=0,s=this.work.observers;a<s.length;a++){var l=s[a],c=this.panoMeshes[l.panoIndex];c&&(r.indexOf(l.panoIndex)>=0?c.parent!==this.helper&&(this.helper.add(c),!0!==this.panoMeshHitTested["".concat(this.work.workCode,"_").concat(l.panoIndex)]&&o.push(l)):c.parent===this.helper&&(this.helper.remove(c),c.setOpacity(0)))}e&&(o=r.map((function(e){return t.work.observers[e]})));for(var u=0,h=o;u<h.length;u++){var d=h[u];if(this.model.loaded&&this.model.bvhs.loaded&&this.model.workCode===this.work.workCode&&r.length<=10){this.panoMeshHitTested["".concat(this.work.workCode,"_").concat(d.panoIndex)]=!0;var p=new n.Vector3(0,-1,0),f=new n.Vector3(0,.1,0).add(d.standingPosition),A=new n.Raycaster(f,p,0,.2),v=this.model.intersectRaycaster(A)[0];if(!v)continue;if(d.standingPosition.y>=v.point.y&&d.standingPosition.y-v.point.y<.1)continue;this.panoMeshes[d.panoIndex]&&this.panoMeshes[d.panoIndex].position.copy(v.point)}}},t.prototype.updatePanoMeshes=function(e){var t=this;void 0===e&&(e=!1);for(var i={},n=0,r=this.panoMeshes;n<r.length;n++){i[(f=r[n]).name]=f}this.panoMeshes.length=0,this.panoMeshHitTested={};for(var o=1,a={},s=function(e){if(e.accessibleNodes.length){var i=Vr(e.accessibleNodes,(function(i){return Kn(t.work.observers[i].standingPosition.distanceTo(e.standingPosition),1,1/0)}),!0),n=i[1];void 0===a[e.panoIndex]&&(a[e.panoIndex]=n)}},l=0,c=this.work.observers;l<c.length;l++){s(p=c[l])}var u=Object.keys(a).map((function(e){return a[e]}));u.length&&(o=Kn(.6*(u.reduce((function(e,t){return e+t}),0)/u.length),1,3));for(var h=0;h<this.work.observers.length;h++){var d="panoCircle_".concat(this.work.workCode,"_").concat(h),p=this.work.observers[h],f=void 0;i[d]?(!0===(f=i[d]).loading&&!1===p.loadable&&f.setLoading(!1),delete i[d]):(f=this.panoCircleMeshCreator(h)).name=d,f.scale.set(o,1,o),f.position.copy(p.standingPosition),this.panoMeshes[h]=f}for(var A=0,v=Object.keys(i);A<v.length;A++){var m=v[A];this.helper.remove(i[m]),i[m].dispose(),delete i[m]}this.updatePanoMeshesVisible(e)},t.prototype.doMoveToPano=function(e,t,i,r){var o,a,s,l,c=this;void 0===i&&(i={}),this.userAction=r;var u=ue(),h=In();this.tiling.cleanup(),this.panoResources[h]=t;var d,p,f;if(this.locationMotion.ended){var A=this.locationMotion.getKeyFrameSegment(u);A[0];var v=A[1],m=this.locationMotion.value,g=(null!==(o=this.panoResourceFromLocationMotionKeyframe(v))&&void 0!==o?o:this.camera).position,y=t.position;d=Math.max(g.distanceTo(y),1),p=[{key:v.key,progress:0,value:ie(ie({},m),{count:0})},{key:h,progress:1,value:{distance:0,perspToOrtho:0,orthoDistance:1,modelAlpha:0,count:1}}],f=0}else{var b=this.locationMotion.getKeyFrameSegment(u),x=b[0],w=(v=b[1],m=this.locationMotion.value,this.panoResourceFromLocationMotionKeyframe(x).position),M=(g=this.panoResourceFromLocationMotionKeyframe(v).position,y=t.position,v.value.count-m.count),C=Math.max(w.distanceTo(g),1)*M;d=C+Math.max(g.distanceTo(y),1),p=[{key:x.key,progress:0,value:ie({},m)},{key:v.key,progress:C/d,value:v.value},{key:h,progress:1,value:{count:v.value.count+1,distance:0,perspToOrtho:0,orthoDistance:1,modelAlpha:0}}];var E=this.locationMotionKeyframesLength(this.locationMotion.keyframes),I=this.locationMotionKeyframesLength(p);f=0===E||0===E?0:this.locationMotion.getProgressVelocity(u)*E/I}var S=this.calculateMovingDuration(i.duration,"fade"===i.effect||"montage"===i.effect?0:d),B={longitude:i.longitude,latitude:i.latitude,fov:i.fov},T={longitude:null!==(a=B.longitude)&&void 0!==a?a:this.camera.pose.longitude,latitude:null!==(s=B.latitude)&&void 0!==s?s:this.camera.pose.latitude,fov:null!==(l=B.fov)&&void 0!==l?l:this.camera.pose.fov,offset:t.position.clone(),distance:this.camera.pose.distance};this.emit("moveToPano",e,r),i.moveStartCallback&&i.moveStartCallback(e,T),this.emit("panoWillArrive",e,T,this.userAction),this.videoTexture&&this.videoTexture.image instanceof HTMLVideoElement&&this.videoTexture.image.getAttribute("src")&&(this.videoTexture.image.pause(),this.videoTexture.image.removeAttribute("uuid"),this.videoTexture.image.removeAttribute("src"),this.videoTexture.image.oncanplay=le,this.videoTexture.needsUpdate=!0),this.panoVideo.setMaterial(null),this.cameraMotion.set(B,S).catch(le),this.locationMotion.setKeyframes(p,S,f).then((function(){var t,o,a,s={longitude:c.camera.pose.longitude,latitude:c.camera.pose.latitude,fov:c.camera.pose.fov,offset:c.camera.pose.offset.clone(),distance:c.camera.pose.distance};i.moveEndCallback&&i.moveEndCallback(e,s),c.emit("panoArrived",e,s,r);var l=c.work.observers[c.currentPanoIndex];if(l&&l.video&&c.videoTexture&&c.videoTexture.image instanceof HTMLVideoElement){var u=Ro.clone().multiply(null!==(a=null===(o=null===(t=c.model.getMaterial())||void 0===t?void 0:t.pano1)||void 0===o?void 0:o.matrix)&&void 0!==a?a:new n.Matrix4).multiply(l.video.matrix),h={map:c.videoTexture,size:l.video.size,matrix:u,alpha:1},d=In(),p=c.videoTexture.image;p.setAttribute("uuid",d),uo().then((function(e){e&&l.video&&p.getAttribute("uuid")===d&&(p.oncanplay=function(){p.oncanplay=le,p.play()},p.ontimeupdate=function(){p.currentTime>.5&&(p.ontimeupdate=le,c.panoVideo.setMaterial(h))},p.src=l.video.source)})).catch((function(){p.removeAttribute("uuid")}))}}),(function(){i.moveCancelCallback&&i.moveCancelCallback(),c.emit("moveToPanoCanceled",e)}))},t.prototype.getForwardPanoIndexOrNot=function(e){var t=this,i=this.work.observers[this.currentPanoIndex];if(!i)return null;var r=null!=e?e:new n.Raycaster(this.camera.position.clone(),this.camera.getDirection(new n.Vector3)),o=i.standingPosition.clone();if(i.position.distanceTo(r.ray.origin)>1){var a=this.model.intersectRaycaster(new n.Raycaster(r.ray.origin,new n.Vector3(0,-1,0)))[0];a&&a.distance<=2?o.copy(a.point):o.copy(r.ray.origin).add(new n.Vector3(0,-1.5,0))}var s=this.model.intersectRaycaster(r)[0],l=(s?s.point:r.ray.origin.clone().add(r.ray.direction.clone().normalize().multiplyScalar(3))).clone().sub(o).normalize();if(0===l.length())return null;for(var c=i.accessibleNodes.filter((function(e){if(e===t.currentPanoIndex)return!1;var i=t.work.observers[e],n=i.standingPosition.clone().project(t.camera);return!(Math.abs(n.z)>1)&&(!(Math.abs(n.x)>1)&&(!(Math.abs(n.y)>1)&&(i.loadable||i.active)))})),u=c.slice().sort((function(e,i){return t.work.observers[e].standingPosition.clone().distanceTo(o)-t.work.observers[i].standingPosition.clone().distanceTo(o)})),h=0,d=[Math.PI/8,Math.PI/6,Math.PI/4,Math.PI/3];h<d.length;h++)for(var p=d[h],f=0,A=u;f<A.length;f++){var v=A[f],m=this.work.observers[v].standingPosition.clone().sub(o);if(0!==m.length()&&l.angleTo(m)<p)return v}return null},t.prototype.onTapGesture=function(e){var t=this,i=e.pointers.map((function(e){return ci(e,["x","y"])}));if(!this.emit("wantsGesture","tap",i,!0)){var r=this.relativeClientPosition(e.center),o=new n.Raycaster;if(o.setFromCamera(r,this.camera),!this.emit("wantsTapGesture",o,r,!0)){this.emit("gesture","tap",i,!0),this.emit("tapGesture",o,r,!0),this.interiaMovement=!1;var a=this.camera.getDirection(new n.Vector3).setY(0),s=null,l=this.work.observers[this.currentPanoIndex];if(l){var c=l.accessibleNodes.filter((function(e){if(e===t.currentPanoIndex)return!1;var i=t.work.observers[e];return!(i.position.distanceTo(t.camera.position)>t.maxAccessibleDistance)&&(i.loadable||i.active)})),u=this.model.intersectRaycaster(o)[0];if(u){var h=Vr(c,(function(e){return t.work.observers[e].standingPosition.clone().distanceTo(u.point)}),!0),d=h[0];h[1]<this.panoTapTriggerRadius&&(s=d)}Un(s)&&(s=this.getForwardPanoIndexOrNot(o));for(var p=0,f=this.locationMotion.keyframes;p<f.length;p++){var A=f[p],v=this.panoResourceFromLocationMotionKeyframe(A);if(!(A.progress<this.locationMotion.progress)&&v.panoIndex===s){s=null;break}}if(this.emit("panoSelected",s),Un(s))!0===this.locationMotion.ended&&this.cameraBounce();else{var m=this.work.observers[s];if(m.active){for(var g={},y=Math.PI/6,b=Math.PI/12,x=m.position.clone().setY(0).sub(l.position.clone().setY(0)).normalize(),w=[],M=0,C=m.accessibleNodes;M<C.length;M++){if((d=C[M])!==this.currentPanoIndex&&d!==s){var E=this.work.observers[d].position.clone().sub(m.position).setY(0);x.angleTo(E)<y&&w.push(E)}}var I=(w.length>0?w:ne(ne([],[],!0),[],!0)).slice().sort((function(e,t){return e.angleTo(x)-t.angleTo(x)}))[0];I&&I.angleTo(a)>b&&(g.longitude=Math.atan2(-I.x,-I.z)),this.cameraMotion.value.latitude<-Math.PI/4&&(g.latitude=Kn(0,this.minLatitude,this.maxLatitude)),this.cameraMotion.value.fov<60&&(g.fov=this.defaultFov),this.emit("wantsMoveToPano",s,g,!0)}else this.panoMeshes[s]&&(this.panoMeshes[s].setDisabled(!1),this.panoMeshes[s].setLoading(!0))}}}}},t}(co),Fo=Math.PI/180,Lo=180/Math.PI,Oo=function(){var e="undefined"!=typeof navigator&&/iPad|iPhone|iPod/.test(navigator.platform);return function(){return e}}(),No=function(){var e="undefined"!=typeof navigator&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent);return function(){return e}}(),Vo=function(){var e="undefined"!=typeof navigator&&-1!==navigator.userAgent.indexOf("Firefox")&&-1!==navigator.userAgent.indexOf("Android");return function(){return e}}(),Uo=function(){var e="undefined"!=typeof navigator?navigator.userAgent.match(/.*Chrome\/([0-9]+)/):null,t=e?parseInt(e[1],10):null;return function(){return t}}(),zo=function(){var e=!1;if(65===Uo()){var t="undefined"!=typeof navigator?navigator.userAgent.match(/.*Chrome\/([0-9\.]*)/):null;if(t){var i=t[1].split(".");i[0],i[1];var n=i[2],r=i[3];e=3325===parseInt(n,10)&&parseInt(r,10)<148}}return function(){return e}}(),qo=function(){var e=Oo()&&No()&&"undefined"!=typeof navigator&&-1!==navigator.userAgent.indexOf("13_4");return function(){return e}}(),Ho=function(){var e="undefined"!=typeof navigator&&-1!==navigator.userAgent.indexOf("R7 Build");return function(){return e}}();function _o(){var e="undefined"!=typeof window&&(90==window.orientation||-90==window.orientation);return Ho()?!e:e}var Ko,jo=(Ko={},function(e,t){void 0===Ko[e]&&(console.warn("cardboard: "+t),Ko[e]=!0)});function Go(e){var t,i=e.indexOf("://");t=-1!==i?i+3:0;var n=e.indexOf("/",t);return-1===n&&(n=e.length),e.substring(0,n)}var Wo,Xo=function(e,t,i){var n,r,o,a,s,l,c,u,h,d,p,f,A,v,m,g,y,b,x;n=e,a=(r=t)?r[0]:0,s=r?r[1]:0,l=r?r[2]:0,c=r?r[3]:1,p=a*(u=a+a),f=a*(h=s+s),A=a*(d=l+l),v=s*h,m=s*d,g=l*d,y=c*u,b=c*h,x=c*d,n[0]=1-(v+g),n[1]=f+x,n[2]=A-b,n[3]=0,n[4]=f-x,n[5]=1-(p+g),n[6]=m+y,n[7]=0,n[8]=A+b,n[9]=m-y,n[10]=1-(p+v),n[11]=0,n[12]=o?o[0]:0,n[13]=o?o[1]:0,n[14]=o?o[2]:0,n[15]=1,i&&function(e,t,i){var n,r,o,a,s,l,c,u,h,d,p,f,A=i[0],v=i[1],m=i[2];t===e?(e[12]=t[0]*A+t[4]*v+t[8]*m+t[12],e[13]=t[1]*A+t[5]*v+t[9]*m+t[13],e[14]=t[2]*A+t[6]*v+t[10]*m+t[14],e[15]=t[3]*A+t[7]*v+t[11]*m+t[15]):(n=t[0],r=t[1],o=t[2],a=t[3],s=t[4],l=t[5],c=t[6],u=t[7],h=t[8],d=t[9],p=t[10],f=t[11],e[0]=n,e[1]=r,e[2]=o,e[3]=a,e[4]=s,e[5]=l,e[6]=c,e[7]=u,e[8]=h,e[9]=d,e[10]=p,e[11]=f,e[12]=n*A+s*v+h*m+t[12],e[13]=r*A+l*v+d*m+t[13],e[14]=o*A+c*v+p*m+t[14],e[15]=a*A+u*v+f*m+t[15])}(e,e,i),function(e,t){var i=t[0],n=t[1],r=t[2],o=t[3],a=t[4],s=t[5],l=t[6],c=t[7],u=t[8],h=t[9],d=t[10],p=t[11],f=t[12],A=t[13],v=t[14],m=t[15],g=i*s-n*a,y=i*l-r*a,b=i*c-o*a,x=n*l-r*s,w=n*c-o*s,M=r*c-o*l,C=u*A-h*f,E=u*v-d*f,I=u*m-p*f,S=h*v-d*A,B=h*m-p*A,T=d*m-p*v,P=g*T-y*B+b*S+x*I-w*E+M*C;P&&(P=1/P,e[0]=(s*T-l*B+c*S)*P,e[1]=(r*B-n*T-o*S)*P,e[2]=(A*M-v*w+m*x)*P,e[3]=(d*w-h*M-p*x)*P,e[4]=(l*I-a*T-c*E)*P,e[5]=(i*T-r*I+o*E)*P,e[6]=(v*b-f*M-m*y)*P,e[7]=(u*M-d*b+p*y)*P,e[8]=(a*B-s*I+c*C)*P,e[9]=(n*I-i*B-o*C)*P,e[10]=(f*w-A*b+m*g)*P,e[11]=(h*b-u*w-p*g)*P,e[12]=(s*E-a*S-l*C)*P,e[13]=(i*S-n*E+r*C)*P,e[14]=(A*y-f*x-v*g)*P,e[15]=(u*x-h*y+d*g)*P)}(e,e)},Yo=function(){function e(e,t){void 0===e&&(e=new n.Vector3),void 0===t&&(t=0),this.sample=e,this.timestampS=t}return e.prototype.set=function(e,t){this.sample=e,this.timestampS=t},e.prototype.copy=function(e){this.set(e.sample,e.timestampS)},e}(),Zo=function(){function e(e,t){this.kFilter=e,this.isDebug=t,this.currentAccelMeasurement=new Yo,this.currentGyroMeasurement=new Yo,this.previousGyroMeasurement=new Yo,Oo()?this.filterQ=new n.Quaternion(-1,0,0,1):this.filterQ=new n.Quaternion(1,0,0,1),this.previousFilterQ=new n.Quaternion,this.previousFilterQ.copy(this.filterQ),this.accelQ=new n.Quaternion,this.isOrientationInitialized=!1,this.estimatedGravity=new n.Vector3,this.measuredGravity=new n.Vector3,this.gyroIntegralQ=new n.Quaternion}return e.prototype.addAccelMeasurement=function(e,t){this.currentAccelMeasurement.set(e,t)},e.prototype.addGyroMeasurement=function(e,t){this.currentGyroMeasurement.set(e,t);var i,n=t-this.previousGyroMeasurement.timestampS;i=n,isNaN(i)||i<=.001||i>1||this.run_(),this.previousGyroMeasurement.copy(this.currentGyroMeasurement)},e.prototype.getOrientation=function(){return this.filterQ},e.prototype.run_=function(){if(!this.isOrientationInitialized)return this.accelQ=this.accelToQuaternion_(this.currentAccelMeasurement.sample),this.previousFilterQ.copy(this.accelQ),void(this.isOrientationInitialized=!0);var e=this.currentGyroMeasurement.timestampS-this.previousGyroMeasurement.timestampS,t=this.gyroToQuaternionDelta_(this.currentGyroMeasurement.sample,e);this.gyroIntegralQ.multiply(t),this.filterQ.copy(this.previousFilterQ),this.filterQ.multiply(t);var i=new n.Quaternion;i.copy(this.filterQ),i.inverse(),this.estimatedGravity.set(0,0,-1),this.estimatedGravity.applyQuaternion(i),this.estimatedGravity.normalize(),this.measuredGravity.copy(this.currentAccelMeasurement.sample),this.measuredGravity.normalize();var r,o=new n.Quaternion;o.setFromUnitVectors(this.estimatedGravity,this.measuredGravity),o.inverse(),this.isDebug&&console.log("Delta: %d deg, G_est: (%s, %s, %s), G_meas: (%s, %s, %s)",Lo*((r=o).w>1?0:2*Math.acos(r.w)),this.estimatedGravity.x.toFixed(1),this.estimatedGravity.y.toFixed(1),this.estimatedGravity.z.toFixed(1),this.measuredGravity.x.toFixed(1),this.measuredGravity.y.toFixed(1),this.measuredGravity.z.toFixed(1));var a=new n.Quaternion;a.copy(this.filterQ),a.multiply(o),this.filterQ.slerp(a,1-this.kFilter),this.previousFilterQ.copy(this.filterQ)},e.prototype.accelToQuaternion_=function(e){var t=new n.Vector3;t.copy(e),t.normalize();var i=new n.Quaternion;return i.setFromUnitVectors(new n.Vector3(0,0,-1),t),i.inverse(),i},e.prototype.gyroToQuaternionDelta_=function(e,t){var i=new n.Quaternion,r=new n.Vector3;return r.copy(e),r.normalize(),i.setFromAxisAngle(r,e.length()*t),i},e}(),Jo=function(){function e(e,t){this.predictionTimeS=e,this.isDebug=t,this.previousQ=new n.Quaternion,this.previousTimestampS=null,this.deltaQ=new n.Quaternion,this.outQ=new n.Quaternion}return e.prototype.getPrediction=function(e,t,i){if(!this.previousTimestampS)return this.previousQ.copy(e),this.previousTimestampS=i,e;var r=new n.Vector3;r.copy(t),r.normalize();var o=t.length();if(o<20*Fo)return this.isDebug&&console.log("Moving slowly, at %s deg/s: no prediction",(Lo*o).toFixed(1)),this.outQ.copy(e),this.previousQ.copy(e),this.outQ;var a=o*this.predictionTimeS;return this.deltaQ.setFromAxisAngle(r,a),this.outQ.copy(this.previousQ),this.outQ.multiply(this.deltaQ),this.previousQ.copy(e),this.previousTimestampS=i,this.outQ},e}(),$o=function(){function e(e){this.coefficients=e}return e.prototype.distortInverse=function(e){for(var t=0,i=1,n=e-this.distort(t);Math.abs(i-t)>1e-4;){var r=e-this.distort(i),o=i-r*((i-t)/(r-n));t=i,i=o,n=r}return i},e.prototype.distort=function(e){for(var t=e*e,i=0,n=0;n<this.coefficients.length;n++)i=t*(i+this.coefficients[n]);return(i+1)*e},e}(),ea=function(){this.angularAcceleration=null,this.angularVelocity=null,this.linearAcceleration=null,this.linearVelocity=null,this.orientation=null,this.position=null},ta=function(){this.leftDegrees=0,this.rightDegrees=0,this.upDegrees=0,this.downDegrees=0},ia=function(){function e(e,t,i,r){this.viewer={id:"CardboardV1",label:"Cardboard I/O 2014",fov:40,interLensDistance:.06,baselineLensDistance:.035,screenLensDistance:.042,distortionCoefficients:[.441,.156],inverseCoefficients:[-.4410035,.42756155,-.4804439,.5460139,-.58821183,.5733938,-.48303202,.33299083,-.17573841,.0651772,-.01488963,.001559834]},this.device={widthMeters:.11,heightMeters:.062,bevelMeters:.004},this.depthNear=.01,this.depthFar=1e4,this.yawOnly=i,this.accelerometer=new n.Vector3,this.gyroscope=new n.Vector3,this.filter=new Zo(e,r),this.posePredictor=new Jo(t,r),this.isFirefoxAndroid=Vo(),this.isIOS=Oo();var o=Uo();this.isDeviceMotionInRadians=!this.isIOS&&null!==o&&o<66,this.isWithoutDeviceMotion=zo()||qo(),this.filterToWorldQ=new n.Quaternion,Oo()?this.filterToWorldQ.setFromAxisAngle(new n.Vector3(1,0,0),Math.PI/2):this.filterToWorldQ.setFromAxisAngle(new n.Vector3(1,0,0),-Math.PI/2),this.inverseWorldToScreenQ=new n.Quaternion,this.worldToScreenQ=new n.Quaternion,this.originalPoseAdjustQ=new n.Quaternion;var a="undefined"!=typeof window?-window.orientation*Math.PI/180:0;this.originalPoseAdjustQ.setFromAxisAngle(new n.Vector3(0,0,1),a),this.setScreenTransform_(),_o()&&this.filterToWorldQ.multiply(this.inverseWorldToScreenQ),this.resetQ=new n.Quaternion,this.orientationOut_=new Float32Array(4),this.previousTimestampS=Date.now()}return e.prototype.getPosition=function(){return null},e.prototype.getOrientation=function(){var e;if(this.isWithoutDeviceMotion&&this._deviceOrientationQ){this.deviceOrientationFixQ=this.deviceOrientationFixQ||(r=(new n.Quaternion).setFromAxisAngle(new n.Vector3(0,0,-1),0),o=new n.Quaternion,"undefined"!=typeof window&&-90===window.orientation?o.setFromAxisAngle(new n.Vector3(0,1,0),Math.PI/-2):o.setFromAxisAngle(new n.Vector3(0,1,0),Math.PI/2),r.multiply(o)),this.deviceOrientationFilterToWorldQ=this.deviceOrientationFilterToWorldQ||((i=new n.Quaternion).setFromAxisAngle(new n.Vector3(1,0,0),-Math.PI/2),i),e=this._deviceOrientationQ;var t=new n.Quaternion;return t.copy(e),t.multiply(this.deviceOrientationFilterToWorldQ),t.multiply(this.resetQ),t.multiply(this.worldToScreenQ),t.multiplyQuaternions(this.deviceOrientationFixQ,t),this.yawOnly&&(t.x=0,t.z=0,t.normalize()),this.orientationOut_[0]=t.x,this.orientationOut_[1]=t.y,this.orientationOut_[2]=t.z,this.orientationOut_[3]=t.w,this.orientationOut_}var i,r,o,a=this.filter.getOrientation();e=this.posePredictor.getPrediction(a,this.gyroscope,this.previousTimestampS);var s=new n.Quaternion;return s.copy(this.filterToWorldQ),s.multiply(this.resetQ),s.multiply(e),s.multiply(this.worldToScreenQ),this.yawOnly&&(s.x=0,s.z=0,s.normalize()),this.orientationOut_[0]=s.x,this.orientationOut_[1]=s.y,this.orientationOut_[2]=s.z,this.orientationOut_[3]=s.w,this.orientationOut_},e.prototype.getPose=function(){var e=new ea;return e.orientation=this.getOrientation(),e},e.prototype.resetPose=function(){this.resetQ.copy(this.filter.getOrientation()),this.resetQ.x=0,this.resetQ.y=0,this.resetQ.z*=-1,this.resetQ.normalize(),_o()&&this.resetQ.multiply(this.inverseWorldToScreenQ),this.resetQ.multiply(this.originalPoseAdjustQ)},e.prototype.getFrameData=function(e){var t=this.getOrientation(),i=this.getEyeOffset(),n=this.getEyeProjectionMatrix();return e.pose.angularAcceleration=null,e.pose.angularVelocity=null,e.pose.linearAcceleration=null,e.pose.linearVelocity=null,e.pose.orientation=t,e.pose.position=null,e.timestamp=this.previousTimestampS,e.leftProjectionMatrix.set(n.left),e.rightProjectionMatrix.set(n.right),Xo(e.leftViewMatrix,t,i.left),Xo(e.rightViewMatrix,t,i.right),e},e.prototype.start=function(){if("undefined"==typeof window)return function(){};var e=this.onDeviceMotion_.bind(this),t=this.onOrientationChange_.bind(this),i=this.onMessage_.bind(this),n=this.onDeviceOrientation_.bind(this);return Oo()&&function(){if("undefined"==typeof window)return!1;if("undefined"==typeof document)return!1;var e=window.self!==window.top,t=Go(document.referrer),i=Go(window.location.href);return e&&t!==i}()&&window.addEventListener("message",i),window.addEventListener("orientationchange",t),this.isWithoutDeviceMotion?window.addEventListener("deviceorientation",n):window.addEventListener("devicemotion",e),function(){window.removeEventListener("devicemotion",e),window.removeEventListener("deviceorientation",t),window.removeEventListener("orientationchange",t),window.removeEventListener("message",i)}},e.prototype.getEyeOffset=function(){return{left:[.5*-this.viewer.interLensDistance,0,0],right:[.5*this.viewer.interLensDistance,0,0]}},e.prototype.getEyeProjectionMatrix=function(){var e=this.getEyeFieldOfView(),t=this.depthNear,i=this.depthFar,n={left:[],right:[]},r=e.left.upDegrees*Fo,o=e.left.downDegrees*Fo,a=2/((l=e.left.leftDegrees*Fo)+(c=e.left.rightDegrees*Fo)),s=2/(r+o);n.left[0]=a,n.left[1]=0,n.left[2]=0,n.left[3]=0,n.left[4]=0,n.left[5]=s,n.left[6]=0,n.left[7]=0,n.left[8]=-(l-c)*a*.5,n.left[9]=(r-o)*s*.5,n.left[10]=i/(t-i),n.left[11]=-1,n.left[12]=0,n.left[13]=0,n.left[14]=i*t/(t-i),n.left[15]=0;var l,c;r=e.right.upDegrees*Fo,o=e.right.downDegrees*Fo,a=2/((l=e.right.leftDegrees*Fo)+(c=e.right.rightDegrees*Fo)),s=2/(r+o);return n.right[0]=a,n.right[1]=0,n.right[2]=0,n.right[3]=0,n.right[4]=0,n.right[5]=s,n.right[6]=0,n.right[7]=0,n.right[8]=-(l-c)*a*.5,n.right[9]=(r-o)*s*.5,n.right[10]=i/(t-i),n.right[11]=-1,n.right[12]=0,n.right[13]=0,n.right[14]=i*t/(t-i),n.right[15]=0,n},e.prototype.getEyeFieldOfView=function(){var e=this.viewer,t=this.device,i=new $o(e.distortionCoefficients),n=e.screenLensDistance,r=(t.widthMeters-e.interLensDistance)/2,o=e.interLensDistance/2,a=e.baselineLensDistance-t.bevelMeters,s=t.heightMeters-a,l=Lo*Math.atan(i.distort(r/n)),c=Lo*Math.atan(i.distort(o/n)),u=Lo*Math.atan(i.distort(a/n)),h=Lo*Math.atan(i.distort(s/n)),d=new ta,p=new ta;return d.leftDegrees=Math.min(l,e.fov),d.rightDegrees=Math.min(c,e.fov),d.downDegrees=Math.min(u,e.fov),d.upDegrees=Math.min(h,e.fov),p.leftDegrees=d.rightDegrees,p.rightDegrees=d.leftDegrees,p.upDegrees=d.upDegrees,p.downDegrees=d.downDegrees,{left:d,right:p}},e.prototype.onDeviceOrientation_=function(e){this._deviceOrientationQ=this._deviceOrientationQ||new n.Quaternion;var t=e.alpha,i=e.beta,r=e.gamma;t=(t||0)*Math.PI/180,i=(i||0)*Math.PI/180,r=(r||0)*Math.PI/180,this._deviceOrientationQ.setFromEuler(new n.Euler(t,i,-r,"YXZ"))},e.prototype.onDeviceMotion_=function(e){this.updateDeviceMotion_(e)},e.prototype.updateDeviceMotion_=function(e){var t=e.accelerationIncludingGravity,i=e.rotationRate,n=e.timeStamp/1e3,r=n-this.previousTimestampS;return r<0?(jo("fusion-pose-sensor:invalid:non-monotonic","Invalid timestamps detected: non-monotonic timestamp from devicemotion"),void(this.previousTimestampS=n)):r<=.001||r>1?(jo("fusion-pose-sensor:invalid:outside-threshold","Invalid timestamps detected: Timestamp from devicemotion outside expected range."),void(this.previousTimestampS=n)):(t&&(this.accelerometer.set(-t.x,-t.y,-t.z),i&&(Ho()?this.gyroscope.set(-i.beta,i.alpha,i.gamma):this.gyroscope.set(i.alpha,i.beta,i.gamma),this.isDeviceMotionInRadians||this.gyroscope.multiplyScalar(Math.PI/180),this.filter.addGyroMeasurement(this.gyroscope,n)),this.filter.addAccelMeasurement(this.accelerometer,n)),void(this.previousTimestampS=n))},e.prototype.onOrientationChange_=function(){this.setScreenTransform_()},e.prototype.onMessage_=function(e){var t=e.data;t&&t.type&&("devicemotion"===t.type.toLowerCase()&&this.updateDeviceMotion_(t.deviceMotionEvent))},e.prototype.setScreenTransform_=function(){switch(this.worldToScreenQ.set(0,0,0,1),"undefined"!=typeof window?window.orientation:0){case 0:break;case 90:this.worldToScreenQ.setFromAxisAngle(new n.Vector3(0,0,1),-Math.PI/2);break;case-90:this.worldToScreenQ.setFromAxisAngle(new n.Vector3(0,0,1),Math.PI/2)}this.inverseWorldToScreenQ.copy(this.worldToScreenQ),this.inverseWorldToScreenQ.inverse()},e}(),na=[0,0,.5,1],ra=[.5,0,.5,1],oa=function(){function e(e){var t=this;this.renderer=e,this.sensor=new ia(.98,.04,!1,!1),this.scale=1,this.cameraL=new n.PerspectiveCamera,this.cameraR=new n.PerspectiveCamera;var i=this.sensor.start();this.dispose=function(){var e=t.renderer.getSize(new n.Vector2);t.renderer.setScissor(0,0,e.width,e.height),t.renderer.setViewport(0,0,e.width,e.height),t.renderer.setScissorTest(!1),i()}}return e.prototype.render=function(e,t){var i=this.renderer.getSize(new n.Vector2);if(i.width>i.height){var r=e.autoUpdate;r&&(e.updateMatrixWorld(),e.autoUpdate=!1);var o={x:Math.round(i.width*na[0]),y:Math.round(i.height*na[1]),width:Math.round(i.width*na[2]),height:Math.round(i.height*na[3])},a={x:Math.round(i.width*ra[0]),y:Math.round(i.height*ra[1]),width:Math.round(i.width*ra[2]),height:Math.round(i.height*ra[3])};this.renderer.setScissorTest(!0),this.renderer.autoClear&&this.renderer.clear(),null===t.parent&&t.updateMatrixWorld(),t.matrixWorld.decompose(this.cameraL.position,this.cameraL.quaternion,this.cameraL.scale),t.matrixWorld.decompose(this.cameraR.position,this.cameraR.quaternion,this.cameraR.scale);var s=this.sensor.getEyeOffset();this.cameraL.translateOnAxis((new n.Vector3).fromArray(s.left),this.scale),this.cameraR.translateOnAxis((new n.Vector3).fromArray(s.right),this.scale);var l=this.sensor.getEyeProjectionMatrix();this.cameraL.projectionMatrix.elements=l.left.slice(),this.cameraR.projectionMatrix.elements=l.right.slice(),this.renderer.setViewport(o.x,o.y,o.width,o.height),this.renderer.setScissor(o.x,o.y,o.width,o.height),this.renderer.render(e,this.cameraL),this.renderer.setViewport(a.x,a.y,a.width,a.height),this.renderer.setScissor(a.x,a.y,a.width,a.height),this.renderer.render(e,this.cameraR),this.renderer.setViewport(0,0,i.width,i.height),this.renderer.setScissor(0,0,i.width,i.height),this.renderer.setScissorTest(!1),r&&(e.autoUpdate=!0)}else this.renderer.render(e,t)},e.prototype.dispose=function(){},e}(),aa={zh:{TITLE:"眼镜模式",HIT:"请将手机横屏放入 VR 眼镜中"},en:{TITLE:"GLASSES MODE",HIT:"Please put the mobile phone horizontally into the VR glasses."},ja:{TITLE:"メガネモード",HIT:"携帯電話をVRメガネに水平に入れてください。"}},sa="undefined"!=typeof navigator&&null!==(Wo=aa[navigator.language.split("-")[0]])&&void 0!==Wo?Wo:aa.zh,la="\n<style>\n.$id {\n all: initial;\n position: absolute;\n overflow: hidden;\n display: none;\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n}\n.$id-modal {\n width: 100%;\n height: 332px;\n position: absolute;\n bottom: -2px;\n left: 0;\n right: 0;\n overflow: hidden;\n pointer-events: none;\n will-change: transform;\n animation: $id-modal-fade-in 0.3s ease 1;\n}\n.$id-modal-bg {\n background: rgba(0, 0, 0, 0.75);\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n top: 0;\n}\n.$id-modal-bg-line {\n height: 1px;\n background-image: linear-gradient(\n 85deg,\n rgba(162, 177, 255, 0.3) 1%,\n rgba(120, 126, 255, 0.8) 30%,\n rgba(147, 218, 255, 0.8) 66%,\n rgba(250, 255, 184, 0.3) 92%\n );\n}\n.$id-modal-bg-wave svg {\n width: 375px;\n height: 61px;\n display: block;\n}\n.$id-modal-content {\n color: #ffffff;\n padding: 0 14px;\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n top: 0;\n overflow: hidden;\n}\n.$id-modal-content-title {\n font-size: 17px;\n font-family: sans-serif;\n line-height: 18px;\n padding: 20px 0;\n font-weight: bold;\n}\n.$id-modal-content-hit {\n font-size: 14px;\n font-family: sans-serif;\n line-height: 24px;\n opacity: 0.85;\n}\n.$id-modal-content-guide {\n position: relative;\n width: 168px;\n height: 139px;\n margin: 36px auto 0;\n}\n.$id-modal-content-guide-cardboard {\n position: absolute;\n width: 100px;\n height: 82px;\n left: 68px;\n top: 57px;\n}\n.$id-modal-content-guide-cardboard-image {\n width: 100px;\n height: 82px;\n background-image: url(".concat("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAADqCAMAAAAvZYhaAAAC/VBMVEUAAAD///99fX37+/v5+fn29vbx8fHv7+/Nzc3o6Ojq6urh4eHU1NTR0dGDg4Pl5eWSkpLHx8fj4+Pe3t7X19fAwMDZ2dnCwsKrq6uioqLb29uNjY2enp67u7t5eXmAgIC2traWlpa5ubnKysqmpqZycnKHh4eurq6ysrKKioqDg4Pd3d12dnb9/f1vb2/s7OxlZWXz8/OoqKiZmZlpaWmbm5teXl7W1tbJycnExMRiYmJsbGywsLCPj49aWlq9vb1UVFRYWFhra2t+fn7t7e1RUVFOTk6Dg4OAgICCgoKKioqEhISIiIhqamqCgoKIiIiQkJCIiIiWlpawsLBmZmaAgICenp6Li4uBgYGTk5OMjIyVlZWFhYWCgoKvr6+Ojo59fX2SkpKvr6+Ojo6QkJCurq6BgYGxsbF8fHx4eHitra2enp6srKyJiYmurq54eHj5+fl+fn57e3v////5+fnS0tLAwMCVlZWwsLCurq5QUFCtra2EhISUlJSwsLCUlJSUlJSlpaWVlZW3t7diYmLAwMCFhYV3d3f///+tra3///9XV1eampqnp6d8fHz///////9VVVVlZWVtbW3+/v5SUlKcnJytra28vLzGxsbR0dHX19doaGiWlpafn5/Hx8ezs7Nzc3Nubm7AwMCIiIjj4+NTU1P29vZbW1vl5eVkZGTMzMxYWFjq6upfX1/k5OT////4+PjV1dWkpKRoaGj4+Pizs7Pm5ubAwMCfn5+vr6+urq4wMDCxsbG2tra5ubliYmIuLi6zs7NHR0empqY0NDRCQkKqqqo5OTmoqKg7Ozt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KBZJBlD5YpucPh8c/aRLeeHSOK/vgFHzBak93bsgaY3ZIVUl+eQCgVdZPcTsE5RCJqs+/lSrSJUvrhFkBX+RkJdmBXCFr1bRA+drjpp52uS35fPPDWxYQnzFbuJo6zhPnIOt6g5s06QxEfN8PAPGytQUf0JbQRbK+x4YjlR9eDpg9dOdOFjEPv0hXiMgOoJXWe7rblnIbLuWms8mz+oX2kozqEOdrLC1hSpJWVjZB+HS1TSjbgDyWZALPmXXwhdNxOvhCWz20JVyluoIYQKiiyRhqNwG/RvLsiGdW18WI2chw2pEkpRWgLEUICk9V1zf6X56bMKMqz6s+s5QrpWuc2PIlQbBSogAO+XR1Ky6afvy0AuGKniXhPWIWI3U5vdRW4AcCkJArJN7d7SLtlx9VW8pXbdfN/6frfJPYUq58cqWivBpIlTrFRcJOObOe4SKx1Vsj20Cwjam01JODjiUpcbaE9jL4W9Hkla7tNgTI9XgxmtChiMie0F5G/930+vX6wOOsKvinKDlaFdrL4XOcipIACOpcxco820J7BfhsLH1F+jyUQxE2hvYqdEezo8lk8hQIavQFwiwN7ZV5Awa0+Mnh1nen/Z44BkLv9DljYHVorwbfgwGtf4iL2u+03weXYKJKi5pXE0J7FU5Bw8zz+N6Q0F4OD4EwvhWRJoX2UoZhUY9PZ2PYrNBewuAODLzDUMPjMQ8Kd6GIaMZaclxG8FfcIWsxGLkxGOzazl7AYKLn09idtd2qmP7ZiZsK24fHR20MLafPB6O2UTWAP1yGz7GpTmekAAAAAElFTkSuQmCC",");\n background-size: 100%;\n background-repeat: no-repeat;\n}\n.$id-modal-content-guide-phone {\n position: absolute;\n width: 58px;\n height: 56px;\n left: 0;\n top: 0;\n}\n.$id-modal-content-guide-phone-move-x {\n width: 100%;\n height: 100%;\n position: absolute;\n top: 0;\n left: 0;\n will-change: transform;\n animation: $id-guide-move-x 4s 0.5s infinite;\n}\n.$id-modal-content-guide-phone-move-y {\n width: 100%;\n height: 100%;\n position: absolute;\n top: 0;\n left: 0;\n will-change: transform;\n animation: $id-guide-move-y 4s cubic-bezier(0.42, 0, 0.23, 0.98) 0.5s infinite;\n}\n.$id-modal-content-guide-phone-blink {\n width: 100%;\n height: 100%;\n position: absolute;\n top: 0;\n left: 0;\n opacity: 0;\n will-change: opacity;\n animation: $id-guide-blink 4s 0.5s infinite;\n}\n.$id-modal-content-guide-phone-image {\n width: 58px;\n height: 56px;\n background-image: url(").concat("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAK4AAAClCAMAAADyFTYfAAAC+lBMVEUAAABISEhKSkpGRkZERERCQkJOTk45OTlBQUFQUFBSUlJUVFQ7OztYWFg/Pz8/Pz9aWlpkZGQ3NzdcXFxeXl5MTExHR0dhYWFJSUk9PT1WVlZMTEygoKBERERFRUVmZmZQUFA9PT1LS0tra2tPT09ubm5SUlI2NjZXV1czMzOpqalTU1O3t7dVVVVoaGhaWlpqamq1tbWhoaGenp6lpaWurq6ysrJZWVmjo6OgoKBUVFRdXV1cXFyvr6+0tLSwsLCrq6ubm5syMjKbm5twcHCQkJCLi4uGhobLy8uCgoJ9fX1ycnLPz894eHizs7NxcXFgYGCVlZWYmJh7e3umpqa3t7fOzs7JycnFxcWvr6+JiYl0dHRra2uSkpKNjY2IiIi4uLiUlJSsrKx3d3fDw8OHh4eQkJB9fX2dnZ2UlJR/f3++vr6RkZFzc3ODg4OioqKcnJyUlJSCgoJ4eHirq6u4uLh4eHiBgYF2dnaLi4uMjIyjo6OZmZm1tbWwsLCcnJyxsbF6enqAgICwsLC9vb26urqjo6OKioqsrKyWlpaoqKhbW1u2traCgoJ6enqZmZmbm5t+fn6JiYmgoKC0tLS4uLhmZma0tLSYmJhxcXF1dXWlpaWfn5+IiIicnJyzs7Ofn5+xsbGampq7u7vAwMCMjIxgYGChoaGgoKCQkJCOjo5vb2+RkZG1tbWOjo6Hh4d6enq1tbV8fHzGxsZubm5mZmanp6eZmZmvr6+Hh4eTk5Ojo6NwcHCenp6mpqZ6enqlpaWWlpaJiYmlpaVjY2OcnJyKiop9f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crrPH1ghWJGhONC3JoGAkRHH1JKjpNEcCxOV2I8MWyiUJqNVajSVodgiWcVMVLVeSS1ATCZoc88qjVKlSc3kSLJ5c5V6rTZQAcVkGbBeuOkgCgq2CBM3MoFwGr1tvim2aMpZZqyBBc3N1UF2GX90j9SQJKCBB83OfYAcNVjFcSrvzo95WOShB83Ody5V24fqzO0nAUSzB/89Nph38VqmuOa3gticJOP9fApuHTDt4nFJ7AXdPC0lg8/gq8y5XapSrgpUgbQ0JpF5u97hS1fOC26nlJJA8Yd41Sg3fU4dtRQkKeXSN3jo4Qqm0397OmyZOGatoDrScBIWM3DFn5kXi1ZyqRSUoZtKOa1vWKArztqgEnhIHty4f9/btuEstKwGkxf+XuCT5CbTFnFRuxktuAAAAAElFTkSuQmCC",');\n background-size: 100%;\n background-repeat: no-repeat;\n}\n.$id-modal-close {\n position: absolute;\n top: 20px;\n right: 14px;\n width: 14px;\n height: 14px;\n}\n.$id-modal-close svg {\n width: 14px;\n height: 14px;\n display: block;\n}\n\n@keyframes $id-modal-fade-in {\n 0% { transform: translate3d(0, 100%, 0); opacity: 0.5; }\n 100% { transform: translate3d(0, 0, 0); opacity: 1; }\n}\n@keyframes $id-guide-blink {\n 0% { opacity: 0; }\n 7% { opacity: 0; }\n 12% { opacity: 1; }\n 29% { opacity: 1; }\n 34% { opacity: 0.3; }\n 39% { opacity: 1; }\n 44% { opacity: 0.3; }\n 49% { opacity: 1; }\n 80% { opacity: 1; }\n 100% { opacity: 0; }\n}\n@keyframes $id-guide-move-x {\n 0% { transform: translate3d(0, 0, 0); }\n 57% { transform: translate3d(0, 0, 0); }\n 80% { transform: translate3d(70px, 0, 0); }\n 100% { transform: translate3d(70px, 0, 0); }\n}\n@keyframes $id-guide-move-y {\n 0% { transform: translate3d(0, 0, 0); }\n 57% { transform: translate3d(0, 0, 0); }\n 80% { transform: translate3d(0, 58px, 0); }\n 100% { transform: translate3d(0, 58px, 0); }\n}\n@media screen and (orientation: portrait) {\n .$id {\n display: block;\n }\n}\n</style>\n<div class="$id-modal">\n <div class="$id-modal-bg">\n <div class="$id-modal-bg-line"></div>\n <div class="$id-modal-bg-wave">\n <svg width="375" height="61" viewBox="0 0 375 61" version="1.1" xmlns="http://www.w3.org/2000/svg">\n <defs>\n <linearGradient x1="0" y1="0%" x2="0" y2="100%" id="$id-2y6_dj_hgp">\n <stop stop-color="#8598FF" stop-opacity="0.15" offset="0%"></stop>\n <stop stop-color="#000" stop-opacity="0" offset="100%"></stop>\n </linearGradient>\n </defs>\n <path transform="translate(187.5, 30.5) scale(-1, 1) translate(-187.5, -30.5)" fill="url(#$id-2y6_dj_hgp)" d="\nM0,1\nC83.001,1.706 140.146,4.164 171.435,8.374\nC218.369,14.688 253.467,26.308 273.002,33\nC292.536,39.691323.501,51 343.709,56\nC357.182,59.333 367.612,61 375,61\nL375,0\nL0,0\nL0,1\nZ\n"></path>\n </svg>\n </div>\n </div>\n <div class="$id-modal-content">\n <div class="$id-modal-content-title">').concat(sa.TITLE,'</div>\n <div class="$id-modal-content-hit">').concat(sa.HIT,'</div>\n <div class="$id-modal-content-guide">\n <div class="$id-modal-content-guide-phone">\n <div class="$id-modal-content-guide-phone-move-x">\n <div class="$id-modal-content-guide-phone-move-y">\n <div class="$id-modal-content-guide-phone-blink">\n <div class="$id-modal-content-guide-phone-image"></div>\n </div>\n </div>\n </div>\n </div>\n <div class="$id-modal-content-guide-cardboard">\n <div class="$id-modal-content-guide-cardboard-image"></div>\n </div>\n </div>\n </div>\n <div class="$id-modal-close">\n <svg width="14" height="14" viewBox="0 0 14 14" version="1.1" xmlns="http://www.w3.org/2000/svg">\n <defs>\n <radialGradient cx="50%" cy="50%" fx="50%" fy="50%" r="70%" id="$id-ho0itsc4p9">\n <stop stop-color="#FFF" stop-opacity="0.75" offset="0%"></stop>\n <stop stop-color="#FFF" stop-opacity="0.22" offset="100%"></stop>\n </radialGradient>\n </defs>\n <path transform="translate(-3, -3)" fill="url(#$id-ho0itsc4p9)" fill-rule="nonzero" d="\nM16.791,3.198\nC17.044,3.438 17.067,3.814 16.860,4.080\nL16.791,4.156\nL12.144,9.331\nC11.803,9.711 11.803,10.288 12.144,10.668\nL16.791,15.843\nC17.044,16.084 17.067,16.460 16.860,16.725\nL16.791,16.801\nC16.538,17.042 16.142,17.063 15.864,16.867\nL15.784,16.801\nL10.000,11.250\nL4.215,16.801\nL4.135,16.867\nC3.857,17.063 3.461,17.042 3.208,16.801\nL3.208,16.801\nL3.139,16.725\nC2.932,16.460 2.955,16.084 3.208,15.843\nL3.208,15.843\nL7.855,10.668\nC8.196,10.288 8.196,9.711 7.855,9.331\nL7.855,9.331\nL3.208,4.156\nL3.139,4.080\nC2.932,3.814 2.955,3.438 3.208,3.198\nC3.486,2.933 3.937,2.933 4.215,3.198\nL4.215,3.198 L9.999,8.749\nL15.784,3.198\nC16.062,2.933 16.513,2.933 16.791,3.198\nZ\n"></path>\n </svg>\n </div>\n</div>\n');function ca(e){for(var t=1,i=document.getElementsByTagName("meta"),n=0;n<i.length;n++){var r=i[n];if("viewport"===r.getAttribute("name")){var o=(r.getAttribute("content")||"").match(/initial\-scale\=([\d|\.]+)/);o&&(t=Number(o[1])),isNaN(t)&&(t=1)}}return la.replace(/\n/g," ").replace(/\ +/g," ").replace(/\$id/g,e).replace(/(\d+)px/g,(function(e,i){return function(e){return Math.floor(e*t)+"px"}(Number(i))}))}var ua=new n.CircleBufferGeometry(.12,16),ha=function(e){function t(){var t=e.call(this)||this;t.progress=0,t.opacity=0,t.loading=!1,t.current=!1,t.disabled=!1,t.currentMotion=new ur({ringScale:1.1,ringOpacity:0,circleFade:0,circleOpacity:.85,circleScale:1}),t.opacityMotion=new ur({opacity:0}),t.loadingMotion=new ur({opacity:0}),t.disableMotion=new ur({opacity:0});var i={blending:n.CustomBlending,blendSrc:n.SrcAlphaFactor,blendDst:n.OneMinusSrcAlphaFactor,blendSrcAlpha:n.OneFactor,blendDstAlpha:n.OneMinusSrcAlphaFactor,depthWrite:!1,transparent:!0};return t.hitTestMesh=new n.Mesh(ua,new n.MeshBasicMaterial(ie(ie({},i),{color:0,opacity:0}))),t.hitTestMesh.scale.set(1.5,1.5,1.5),t.ringMesh=new n.Mesh(ua,new n.ShaderMaterial(ie(ie({},i),{vertexShader:"\nvarying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n",fragmentShader:"\nvarying vec2 vUv;\nuniform float opacity;\n\nfloat smoothDist = 0.01;\nvoid main() {\n vec2 center = vec2(0.5, 0.5);\n float dist = length(center - vUv);\n float outerDist = 0.49;\n float innerDist = 0.29;\n\n float outside = 1.0 - smoothstep(outerDist - smoothDist, outerDist, dist);\n float inside = smoothstep(innerDist, innerDist + smoothDist, dist);\n\n vec4 bg = vec4(0.576, 0.635, 1.0, 0.3);\n float gradientAlpha = clamp(abs(dist - (outerDist + innerDist) / 2.0) / (outerDist - innerDist) * 1.5 + 0.1, 0.0, 1.0);\n vec4 gradient = vec4(1.0, 1.0, 1.0, gradientAlpha);\n\n gl_FragColor = mix(bg, gradient, gradient.a);\n\n gl_FragColor = vec4(gl_FragColor.rgb, gl_FragColor.a * opacity * outside * inside);\n}\n",uniforms:{opacity:{value:0}}}))),t.panoMesh=new n.Mesh(ua,new n.ShaderMaterial(ie(ie({},i),{vertexShader:"\nvarying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n",fragmentShader:"\nuniform float circleScale;\nuniform float circleFade;\nuniform float circleOpacity;\nuniform float loadingAngle;\nuniform float loadingOpacity;\nuniform float opacity;\nuniform float disable;\nvarying vec2 vUv;\n\n#define PI 3.141592653589793\n#define TAU 6.283185307179586\n#define SMOOTH_DIST 0.017\n#define CENTER vec2(0.5, 0.5)\n\nfloat inside(float innerDist) {\n float dist = length(CENTER - vUv);\n return smoothstep(innerDist, innerDist + SMOOTH_DIST, dist);\n}\nfloat outside(float outerDist) {\n float dist = length(CENTER - vUv);\n return 1.0 - smoothstep(outerDist - SMOOTH_DIST, outerDist, dist);\n}\n\nvec4 create_circle() {\n float dist = length(CENTER - vUv);\n float gradient = clamp(0.98 + abs(dot(normalize(vec2(1.0, -1.0)), vUv - CENTER)) * 2.0, 0.0, 1.0);\n vec3 color = mix(vec3(0.576, 0.635, 1.0), vec3(1.0, 1.0, 1.0), circleFade * 0.5);\n return vec4(color, 1.0 * gradient * circleOpacity * outside(0.3 * circleScale));\n}\n\nvec4 create_disable() {\n float dist = length(CENTER - vUv);\n return vec4(1.0, 1.0, 1.0, 0.5 * outside(0.32 * circleScale));\n}\n\nvec4 create_loading() {\n float angle = PI - atan(CENTER.x - vUv.x, CENTER.y - vUv.y);\n angle = mod(angle + loadingAngle, TAU);\n float gradient = (1.0 - smoothstep(0.0, TAU, angle)) * 0.9 + 0.1;\n return vec4(1.0, 1.0, 1.0, gradient * loadingOpacity * inside(0.2 * circleScale) * outside(0.25 * circleScale));\n}\n\nvoid main() {\n gl_FragColor = vec4(1.0, 1.0, 1.0, 0);\n\n vec4 circleColor = create_circle();\n gl_FragColor = mix(gl_FragColor, circleColor, circleColor.a);\n\n vec4 loadingColor = create_loading();\n gl_FragColor = mix(gl_FragColor, loadingColor, loadingColor.a);\n\n gl_FragColor = mix(gl_FragColor, create_disable(), disable);\n\n gl_FragColor = vec4(gl_FragColor.rgb, gl_FragColor.a * opacity);\n}\n",uniforms:{circleScale:{value:1.1},circleFade:{value:0},circleOpacity:{value:.5},loadingAngle:{value:0},loadingOpacity:{value:0},opacity:{value:0},disable:{value:0}}}))),t.add(t.hitTestMesh),t.add(t.ringMesh),t.add(t.panoMesh),t.renderOrder=1e4,t.needsRender=!0,t}return te(t,e),t.prototype.setProgress=function(e){this.progress=e,this.setLoading(e>0)},t.prototype.setOpacity=function(e){this.opacity!==e&&(this.opacity=e=Kn(e,0,1),this.opacityMotion.set({opacity:e},30).catch(le))},t.prototype.setCurrent=function(e){if(this.current!==e){if(e){var t=[{progress:0,value:{ringScale:2,ringOpacity:0,circleFade:0,circleOpacity:.85,circleScale:1}},{progress:.05,value:{ringScale:1,ringOpacity:1,circleFade:0,circleOpacity:.85,circleScale:1}},{progress:.15,value:{ringScale:1.2,ringOpacity:1,circleFade:0,circleOpacity:.85,circleScale:1}},{progress:.25,value:{ringScale:1.1,ringOpacity:1,circleFade:0,circleOpacity:.85,circleScale:1}},{progress:.8,value:{ringScale:1.1,ringOpacity:1,circleFade:1,circleOpacity:.85,circleScale:1}},{progress:.9,value:{ringScale:1.1,ringOpacity:1,circleFade:1,circleOpacity:.65,circleScale:.8}},{progress:.92,value:{ringScale:1.1,ringOpacity:1,circleFade:1,circleOpacity:.65,circleScale:.8}},{progress:1,value:{ringScale:1.1,ringOpacity:1,circleFade:1,circleOpacity:.85,circleScale:1.1}}];this.currentMotion.setKeyframes(t,1500).catch(le)}else{t=[{progress:0,value:ie({},this.currentMotion.value)},{progress:1,value:{ringScale:1.1,ringOpacity:0,circleFade:0,circleOpacity:.85,circleScale:1}}];this.currentMotion.setKeyframes(t,200).catch(le)}this.current=e}},t.prototype.setLoading=function(e){this.loading!==e&&(e?this.loadingMotion.setKeyframes([{progress:0,value:{opacity:0}},{progress:.3,value:{opacity:0}},{progress:1,value:{opacity:.8}}],500).catch(le):this.loadingMotion.set({opacity:0},0).catch(le),this.loading=e,!0===this.disabled&&this.setDisabled(!1),this.needsRender=!0)},t.prototype.setDisabled=function(e){this.disabled!==e&&(this.disabled=e,!0===this.loading&&this.setLoading(!1),this.disableMotion.set({opacity:e?1:0},300).catch(le),this.needsRender=!0)},t.prototype.tap=function(){return Promise.resolve()},t.prototype.updateTime=function(e,t){this.opacityMotion.update(e),this.currentMotion.update(e),this.loadingMotion.update(e);var i=this.opacityMotion.value.opacity,n=this.currentMotion.value,r=n.ringScale,o=n.ringOpacity,a=n.circleFade,s=n.circleOpacity,l=n.circleScale;this.ringMesh.scale.set(r,1,r),this.ringMesh.material.uniforms.opacity.value=o*i,this.panoMesh.material.uniforms.opacity.value=i,this.panoMesh.material.uniforms.circleOpacity.value=s,this.panoMesh.material.uniforms.circleScale.value=l,this.panoMesh.material.uniforms.circleFade.value=a,this.panoMesh.material.uniforms.loadingOpacity.value=this.loadingMotion.value.opacity,this.panoMesh.material.uniforms.disable.value=this.disableMotion.value.opacity,this.panoMesh.material.uniforms.loadingAngle.value=e/120%(2*Math.PI),this.needsRender=!0},t.prototype.dispose=function(){this.hitTestMesh.material.dispose(),this.ringMesh.material.dispose(),this.panoMesh.material.dispose()},t}(n.Object3D),da=function(e){function t(i){var n=this,r=t.parseArgs(i);(n=e.call(this,r)||this).cardboard=new oa(n.renderer);var o,a,s,l=(o="five_vr_helper_"+In(),a=ca(o),(s=document.createElement("div")).className=o,s.innerHTML=a,s);n.helperElement=l;var c=new qr(l);return n.element.parentNode&&(n.element.parentNode.insertBefore(l,n.element),n.setHelperElementSize(),c.on("tap",(function(){return n.emit("vrWantsToExit")}))),n.destroyHelper=function(){c.destroy(),l.parentNode&&l.parentNode.removeChild(l),delete n.helperElement},n}return te(t,e),t.parseArgs=function(t){var i=ie(ie({},t),{maxLatitude:Math.PI/2,minLatitude:-Math.PI/2});return e.parseArgs.call(this,i)},t.initAnimationEndPose=function(t){var i=this.parseArgs(t);return e.initAnimationEndPose.call(this,i)},t.prototype.destroy=function(){e.prototype.destroy.call(this),this.cardboard.dispose(),this.destroyHelper();for(var t=0,i=this.panoMeshes;t<i.length;t++){var n=i[t];this.helper.remove(n),n.dispose()}this.panoMeshes.length=0},t.prototype.isReady=function(){return!1},t.prototype.updateRenderSize=function(){this.needsRender=!0,this.setHelperElementSize()},t.prototype.updatePanoMeshesVisible=function(){for(var e=this.work.observers[this.currentPanoIndex],t=(e?e.visibleNodes:[]).concat(this.currentPanoIndex),i=0,n=this.work.observers;i<n.length;i++){var r=n[i],o=this.panoMeshes[r.panoIndex];o&&(t.indexOf(r.panoIndex)>=0?o.parent!==this.helper&&this.helper.add(o):o.parent===this.helper&&(this.helper.remove(o),o.setOpacity(0)))}},t.prototype.updatePanoMeshes=function(){var e=this;this.panoMeshes.forEach((function(t){e.helper.remove(t),t.dispose()})),this.panoMeshes.length=0,this.panoMeshHitTested={};for(var t=0;t<this.work.observers.length;t++){var i=this.work.observers[t],n=new ha;n.name="panoSphere_".concat(this.work.workCode,"_").concat(t),n.position.copy(i.position),n.needsRender=!0,this.panoMeshes[t]=n}this.updatePanoMeshesVisible()},t.prototype.updateTime=function(e,t){var i,r,o,a,s,l;if(!this.destroyed){var c=this.currentPanoIndex;this.needsRender=!0;var u={},h={};if(!1===this.locationMotion.ended){this.locationMotion.update(e);var d=this.locationMotion.getKeyFrameSegment(e),p=d[0],f=d[1],A=this.panoResourceFromLocationMotionKeyframe(p),v=this.panoResourceFromLocationMotionKeyframe(f),m=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[0]),g=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),y=A.position,b=v.position,x=this.locationMotion.value.count-f.value.count+1;u.modelAlpha=this.locationMotion.value.modelAlpha,this.camera.perspToOrtho.setScalar(Kn(this.locationMotion.value.perspToOrtho,0,1)),this.camera.orthoDistance=this.locationMotion.value.orthoDistance,u.useBlackTransition="instant"===v.effect,v.panoPicture&&(x<1?A.panoPicture&&(u.pano0=A.panoPicture):u.pano0=v.panoPicture,u.pano1=v.panoPicture),"fade"===v.effect&&(u.pano0&&A.panoPicture&&(u.pano0={map:u.pano0.map,luminanceMap:u.pano0.luminanceMap,matrix:A.panoPicture.matrix.clone().setPosition(v.position)}),y.copy(b)),u.progress=x,h.distance=this.locationMotion.value.distance,h.offset=new n.Vector3(y.x+(b.x-y.x)*x,y.y+(b.y-y.y)*x,y.z+(b.z-y.z)*x);for(var w=[],M=[],C=0,E=this.locationMotion.keyframes;C<E.length;C++){var I=E[C],S=I.key,B=I.progress;void 0!==S&&(w.push(S),B>=this.locationMotion.progress&&M.push(S))}for(var T=0,P=Object.keys(this.panoResources);T<P.length;T++){var R=P[T];if(!(M.indexOf(R)>=0)){var k=this.panoResources[R];if(k.panoPicture){var Q=k.panoPicture.map;if(Q){if(Q===(null===(i=u.pano0)||void 0===i?void 0:i.map))continue;if(Q===(null===(r=u.pano1)||void 0===r?void 0:r.map))continue;Q.dispose(),k.panoPicture=null}}w.indexOf(R)>=0||delete this.panoResources[R]}}this.currentPanoIndex=x<.5?A.panoIndex:v.panoIndex,this.emit("movingToPano",g.panoIndex,m.panoIndex,this.locationMotion.progress)}!1===Ur(u)&&((null===(o=u.pano0)||void 0===o?void 0:o.map)&&u.pano0.map instanceof Ct&&!u.pano0.map.cubeRenderTarget&&(u.pano0.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),(null===(a=u.pano0)||void 0===a?void 0:a.luminanceMap)&&u.pano0.luminanceMap instanceof Ct&&!u.pano0.luminanceMap.cubeRenderTarget&&(u.pano0.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),(null===(s=u.pano1)||void 0===s?void 0:s.map)&&u.pano1.map instanceof Ct&&!u.pano1.map.cubeRenderTarget&&(u.pano1.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),(null===(l=u.pano1)||void 0===l?void 0:l.luminanceMap)&&u.pano1.luminanceMap instanceof Ct&&!u.pano1.luminanceMap.cubeRenderTarget&&(u.pano1.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),this.model.setMaterial(u)),h.offset&&this.camera.position.copy(h.offset),this.currentPanoIndex!==c&&this.updatePanoMeshesVisible();var D=this.camera.pose.longitude,F=this.camera.pose.latitude;this.camera.quaternion.fromArray(this.cardboard.sensor.getOrientation()),this.camera.updateMatrixWorld(),this.camera.computePose();for(var L=0,O=this.work.observers[this.currentPanoIndex].visibleNodes.concat(this.currentPanoIndex);L<O.length;L++){var N=O[L],V=this.work.observers[N],U=this.panoMeshes[N];if(V.loadable||V.active){var z=U.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);z<.05?U.setOpacity(0):U.setOpacity(Kn(1.5/z,0,1)),this.currentPanoIndex===N&&U.setOpacity(0),U.lookAt(this.camera.position)}else U.setOpacity(0)}var q=this.intersect(e);for(N=0;N<this.work.observers.length;N++){null==(U=this.panoMeshes[N])||U.setCurrent(U===q)}for(N=0;N<this.work.observers.length;N++){(U=this.panoMeshes[N])&&U.updateTime&&U.updateTime(e,t)}D===this.camera.pose.longitude&&F===this.camera.pose.latitude||(this.cameraMotion.set(ci(this.camera.pose,["longitude","latitude"]),0).catch(le),this.emit("cameraDirectionUpdate",ci(this.camera.pose,["longitude","latitude"]),!0),this.emit("cameraUpdate",zr(ci(this.camera.pose,["longitude","latitude","fov","offset","distance"])),!0))}},t.prototype.render=function(){this.cardboard.render(this.scene,this.camera)},t.prototype.setCamera=function(e){},t.prototype.destroyHelper=function(){},t.prototype.setHelperElementSize=function(){if(this.helperElement){var e=new n.Vector2(this.element.offsetWidth,this.element.offsetHeight),t=e.x*this.scissor.left,i=e.y*(1-this.scissor.bottom-this.scissor.height),r=e.x*this.scissor.width,o=e.y*this.scissor.height;this.helperElement.style.marginLeft=t+"px",this.helperElement.style.marginTop=i+"px",this.helperElement.style.width=r+"px",this.helperElement.style.height=o+"px"}},t.prototype.intersect=function(e){var t;if(!1===this.locationMotion.ended)return this.intersectMesh.visible=!1,delete this.activePanoMesh,void delete this.activeTime;if(this.activePanoMesh&&this.activeTime&&e-this.activeTime>1500){var i=this.activePanoMesh;return(c=this.panoMeshes.indexOf(i))>=0&&this.moveToPano(c,{},!0),delete this.activePanoMesh,delete this.activeTime,i}for(var r=this.camera.getDirection(new n.Vector3),o=new n.Raycaster(this.camera.position,r),a=void 0,s=[],l=this.work.observers[this.currentPanoIndex].visibleNodes,c=0;c<this.work.observers.length;c++){var u=this.panoMeshes[c];if(-1!==l.indexOf(c)){var h=o.intersectObject(null!==(t=u.hitTestMesh)&&void 0!==t?t:u,!0)[0];h&&s.push({panoMesh:u,intersection:h})}}var d=s.sort((function(e,t){return e.intersection.distance-t.intersection.distance}))[0];if(d?(a=d.intersection,this.activePanoMesh!==d.panoMesh&&(this.activePanoMesh=d.panoMesh,this.activeTime=e),this.intersectMesh.position.copy(d.panoMesh.position),this.intersectMesh.lookAt(this.camera.position),this.intersectMesh.visible=!1):(this.activePanoMesh=void 0,this.activeTime=void 0),!a)if((a=this.model.intersectRaycaster(o)[0])&&a.face){var p=a.face.normal,f=new n.Quaternion;f.setFromUnitVectors(new n.Vector3(0,0,1),p),this.intersectMesh.quaternion.copy(f);var A=p.clone().multiplyScalar(.05),v=a.point.clone().add(A);this.intersectMesh.position.copy(v),this.intersectMesh.visible=!0,this.emit("intersectionOnModelUpdate",a,this.intersectMesh)}else this.intersectMesh.visible=!1,this.emit("intersectionHidden");return null==d?void 0:d.panoMesh},t.prototype.onPanGesture=function(){},t.prototype.onTapGesture=function(){},t.prototype.onPinchGesture=function(){},t.prototype.onMouseMove=function(){},t.prototype.onMouseOut=function(){},t}(Do),pa=function(e){function t(i){var n,r,o=this,a=t.parseArgs(i);return(o=e.call(this,a)||this).currentPanoIndex=a.initial[0],o.locationMotion=new ur({x:o.camera.pose.offset.x,y:o.camera.pose.offset.y,z:o.camera.pose.offset.z,distance:o.camera.pose.distance,modelAlpha:null!==(r=null===(n=o.model.getMaterial())||void 0===n?void 0:n.modelAlpha)&&void 0!==r?r:0,perspToOrtho:o.camera.perspToOrtho.x,orthoDistance:o.camera.orthoDistance}),o}return te(t,e),t.parseArgs=function(t){return e.parseArgs.call(this,t)},t.initAnimationEndPose=function(t){var i=this.parseArgs(t);return e.initAnimationEndPose.call(this,i)},t.prototype.destroy=function(){e.prototype.destroy.call(this),this.locationMotion.dispose()},t.prototype.isReady=function(){return!1!==this.locationMotion.ended},t.prototype.updateWork=function(e,t,i,n,r){this.work=e,this.currentPanoIndex=t,this.hideIntersectMesh();var o={duration:0,longitude:i.longitude,latitude:i.latitude,fov:i.fov};return this.moveToPano(t,o,r),!0},t.prototype.updateTime=function(e,t){if(!this.destroyed){var i={},r={};if(!this.locationMotion.ended){this.locationMotion.update(e),i.modelAlpha=this.locationMotion.value.modelAlpha,this.camera.perspToOrtho.setScalar(Kn(this.locationMotion.value.perspToOrtho,0,1)),this.camera.orthoDistance=this.locationMotion.value.orthoDistance,r.distance=this.locationMotion.value.distance,r.offset=new n.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z);var o=new n.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),a=Vr(this.work.observers,(function(e){return e.position.distanceTo(o)}));this.currentPanoIndex=this.work.observers.indexOf(a)}this.cameraMotion.ended||(this.cameraMotion.update(e),r.longitude=this.cameraMotion.value.longitude,r.latitude=this.cameraMotion.value.latitude,r.fov=this.cameraMotion.value.fov),Ur(i)||this.model.setMaterial(i),Ur(r)||this.setCamera(r)}},t.prototype.initAnimation=function(e,t,i,n){var r,o,a,s=this;this.destroyed||(this.pending=!1,this.userAction=n,this.moveToPano(e,{longitude:null!==(r=t.longitude)&&void 0!==r?r:this.defaultLongitude,latitude:Kn(null!==(o=t.latitude)&&void 0!==o?o:this.defaultLatitude,this.minLatitude,this.maxLatitude),fov:Kn(null!==(a=t.fov)&&void 0!==a?a:this.defaultFov,this.minFov,this.maxFov),duration:i,moveStartCallback:function(e,t){s.emit("initAnimationWillStart",e,t,s.userAction)},moveEndCallback:function(e,t){s.emit("initAnimationEnded",e,t,s.userAction)},moveCancelCallback:function(){var e=s.currentPanoIndex,t={longitude:s.camera.pose.longitude,latitude:s.camera.pose.latitude,fov:s.camera.pose.fov,offset:s.camera.pose.offset.clone(),distance:s.camera.pose.distance};s.emit("initAnimationEnded",e,t,s.userAction)}},n))},t.prototype.getTargetPose=function(){var e=this.cameraMotion.getKeyFrameSegment(ue())[1],t=this.locationMotion.getKeyFrameSegment(ue())[1];return{longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,offset:new n.Vector3(t.value.x,t.value.y,t.value.z),distance:t.value.distance}},t.prototype.moveToPano=function(e,t,i){void 0===t&&(t={});var n=this.work.observers[e];n&&this.moveToPosition(n.position,t,i)},t.prototype.moveToPosition=function(e,t,i){var r,o,a,s=this;void 0===t&&(t={}),this.userAction=i;for(var l=ue(),c=new n.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z).distanceTo(e),u=this.locationMotion.getProgressVelocity(l),h=0,d=1;d<this.locationMotion.keyframes.length;d++){var p=this.locationMotion.keyframes[d-1].value,f=p.x,A=p.y,v=p.z,m=this.locationMotion.keyframes[d].value,g=m.x,y=m.y,b=m.z;h+=Math.sqrt(Math.pow(g-f,2)+Math.pow(y-A,2)+Math.pow(b-v,2))}var x=0===c?0:u*h/c,w=this.calculateMovingDuration(t.duration,c),M={x:e.x,y:e.y,z:e.z,distance:0,modelAlpha:1,perspToOrtho:0,orthoDistance:1},C={longitude:t.longitude,latitude:t.latitude,fov:t.fov},E={longitude:null!==(r=C.longitude)&&void 0!==r?r:this.camera.pose.longitude,latitude:null!==(o=C.latitude)&&void 0!==o?o:this.camera.pose.latitude,fov:null!==(a=C.fov)&&void 0!==a?a:this.camera.pose.fov,offset:e.clone(),distance:0},I=Vr(this.work.observers,(function(t){return t.position.distanceTo(e)})),S=this.work.observers.indexOf(I);this.emit("moveToPano",S,this.userAction),t.moveStartCallback&&t.moveStartCallback(S,E),this.emit("panoWillArrive",S,E,this.userAction),this.cameraMotion.set(C,w).catch(le),this.locationMotion.set(M,w,x).then((function(){var e=zr(s.camera.pose);t.moveEndCallback&&t.moveEndCallback(S,e),s.emit("panoArrived",S,e,s.userAction)}),(function(){t.moveCancelCallback&&t.moveCancelCallback(),s.emit("moveToPanoCanceled",S)}))},t.prototype.onTapGesture=function(e){var t=e.pointers.map((function(e){return ci(e,["x","y"])}));if(!this.emit("wantsGesture","tap",t,!0)){var i=this.relativeClientPosition(e.center),r=new n.Raycaster;if(r.setFromCamera(i,this.camera),!this.emit("wantsTapGesture",r,i,!0)){this.emit("gesture","tap",t,!0),this.emit("tapGesture",r,i,!0),this.interiaMovement=!1;var o=this.model.intersectRaycaster(r)[0];if(o&&o.face){var a=o.face.normal,s=o.point;if(new n.Vector3(0,1,0).angleTo(a)>Math.PI/3){var l=this.camera.position.clone().setY(s.y),c=s.clone().sub(l).setLength(.3),u=s.clone().sub(c);r.set(u,new n.Vector3(0,-1,0)),o=this.model.intersectRaycaster(r)[0]}}if(o){var h=o.point.clone(),d=Vr(this.work.observers.filter((function(e){return Math.abs(e.standingPosition.y-h.y)<1})),(function(e){return e.standingPosition.distanceTo(h)}));if(d)return h.y=d.position.y,void this.moveToPosition(h,{},!0)}this.cameraBounce()}}},t}(co),fa=function(){var e=113,t=126,i=0,n="";return arguments[i].split(n).map((function(n){return n.charCodeAt(i)>t?n:String.fromCharCode((n.charCodeAt(i)+e)%t)})).join(n)}("{vs|z-rp@-}n{|]|vv|{H{vs|z-znA-}n{|ZnvH{vs|z-nz}yr?Q-}n{|Qv}ynprzr{Zn}H<<{vs|z-sy|n-pnyrHn\bv{t-rp@-}n{|d|yq]|vv|{H<<-n\bv{t-sy|n-vU|yrHp|{-sy|n-]V-J-@;>A>BF?CHp|{-sy|n-aNb-J-C;?E@>EB?Hp|{-sy|n-pnyr-J->@;>Hrp?-|P||q5rp@-rp|6-\n--sy|n--J-yr{tu5rp|6H--sy|n-urn-J-np|5:rp|;\b-<-6H--sy|n-}uv-J-nn{5rp|;9-rp|;\t6H--r{-rp?5=;B-8-}uv-<-aNb9-urn-<-]V6H\f|vq-znv{56-\n--rpA-|yq]|vv|{-J-z|qryZnv-7-rpA5}|vv|{9->;=6H--}n{|d|yq]|vv|{-J-5rpA5|yq]|vv|{;\b\t9->;=6-7-}n{|Znv6;\b\tH--rp?-p||q-J-|P||q5}n{|d|yq]|vv|{6H--sy|n-qvn{pr-J-pnyrH--vs-5p||q;\b-I-=;>B6-\n----rp?-n{s|zrqP||q-J-rp?5p||q;9-=;=6H----rpA-}n{|Qv}ynprzr{-J-rr?Q5}n{|Qv}ynprzr{Zn}9-n{s|zrqP||q6H----qvn{pr-J-pnyr-7-}n{|Qv}ynprzr{;H----qvn{pr-J-qvn{pr-7-p|5]V-7-5=;>B-:-p||q;\b66H----qvn{pr-J-pnyrH--\f-ryr-vs-5p||q;\b-KJ-=;>B-33-p||q;\b-IJ-=;EB6-\n----rp?-n{s|zrqP||q-J-rp?5p||q;9-5p||q;\b-:-=;>B6-<-=;D6H----rpA-}n{|Qv}ynprzr{-J-rr?Q5}n{|Qv}ynprzr{Zn}9-n{s|zrqP||q6H----vs5-}n{|Qv}ynprzr{;-JJ-=;=6\n------qvn{pr-J-pnyrH----\fryr\n------qvn{pr-J-pnyr-7-}n{|Qv}ynprzr{;H----\f--\f-ryr-\n----rp?-n{s|zrqP||q-J-rp?5p||q;9->;=6H----rpA-}n{|Qv}ynprzr{-J-rr?Q5}n{|Qv}ynprzr{Zn}9-n{s|zrqP||q6H----qvn{pr-J-pnyr-7-}n{|Qv}ynprzr{;H----qvn{pr-J-qvn{pr-7-p|5]V-7-5p||q;\b-:-=;EB66H----qvn{pr-J-pnyrH--\f--rpA-ry]|vv|{-J-rpA5}|vv|{-8-}n{|]|vv|{-8-{|znyv\tr5|yq]|vv|{;\b\t6-7-qvn{pr9->;=6H--tyl]|vv|{-J-}|wrpv|{Znv-7-z|qrycvrZnv-7-ry]|vv|{H\f"),Aa=function(){var e=113,t=126,i=0,n="";return arguments[i].split(n).map((function(n){return n.charCodeAt(i)>t?n:String.fromCharCode((n.charCodeAt(i)+e)%t)})).join(n)}("{vs|z-sy|n-|}npv\bH{vs|z-nz}yrPor-}n{|Zn}H{vs|z-nz}yr?Q-}n{|Qv}ynprzr{Zn}Hn\bv{t-rp@-}n{|d|yq]|vv|{H|vq-znv{56-\n--rpA-}n{|P|y|-J-rrPor5}n{|Zn}9-}n{|d|yq]|vv|{;\b\t6H--tylSntP|y|-J-rpA5}n{|P|y|;to9-|}npv\b6H\f"),va=Object.assign({opacity:new n.Uniform(1),scale:new n.Uniform(13.1),panoMap:new n.Uniform(null),panoDisplacementMap:new n.Uniform(null),panoPosition:new n.Uniform(new n.Vector3),panoMatrix:new n.Uniform(new n.Matrix4)},{emissive:new n.Uniform(new n.Color(0)),emissiveMap:new n.Uniform(null),specular:new n.Uniform(new n.Color(1118481)),specularMap:new n.Uniform(null),normalMap:new n.Uniform(null),bumpMap:new n.Uniform(null),shininess:new n.Uniform(30)},n.UniformsLib.common,n.UniformsLib.lights),ma=new n.SphereBufferGeometry(.01,128,128);var ga=function(){function e(e){void 0===e&&(e={}),this.textureLoader=new Et({allowHosts:this.allowHosts,requestProxy:this.requestProxy,networkSubscribe:this.networkSubscribe}),this.allowHosts=e.allowHosts,this.requestProxy=e.requestProxy,this.networkSubscribe=e.networkSubscribe}return e.prototype.setAllowHosts=function(e){this.allowHosts=e,this.textureLoader.setAllowHosts(e)},e.prototype.setRequestProxy=function(e){this.requestProxy=e,this.textureLoader.setRequestProxy(e)},e.prototype.setNetworkSubscribe=function(e){this.networkSubscribe=e,this.textureLoader.setNetworkSubscribe(e)},e.prototype.load=function(e,t,i,r,o,a,s,l,c){var u=[0,0],h=function(e,t){u[t]=e,l(.8*u[0]+.2*u[1])},d=[this.textureLoader.loadTexture(e,{imageURL:i,viaAjax:!0},void 0,void 0,(function(e){return h(e,1)}),c),this.textureLoader.loadCubeTexture(t,{imageURL:i,viaAjax:!0},void 0,void 0,(function(e){return h(e,0)}),c)];return Promise.all(d).then((function(e){var t=e[0],i=e[1],s=function(e,t,i,r){var o=new n.ShaderMaterial({side:n.BackSide,vertexShader:fa,fragmentShader:Aa,transparent:!0,uniforms:n.UniformsUtils.clone(va)}),a=t;return a.needsUpdate=!0,a.minFilter=n.LinearFilter,a.magFilter=n.LinearFilter,e.needsUpdate=!0,e.minFilter=n.LinearFilter,e.magFilter=n.LinearFilter,o.uniforms.opacity.value=0,o.uniforms.panoMap.value=a,o.uniforms.panoDisplacementMap.value=e,o.uniforms.panoPosition.value=i,o.uniforms.panoMatrix.value=r,Object.assign(new n.Mesh(ma,o),{frustumCulled:!1,dispose:function(){this.material instanceof n.ShaderMaterial&&(this.material.uniforms.panoDisplacementMap.value.dispose(),this.material.uniforms.panoDisplacementMap.value=null,this.material.dispose())}})}(t.body,i.body,r,o),l={body:s,meta:ne([t.meta],i.meta,!0)};return a(l),l})).catch((function(e){for(var t=0,i=d;t<i.length;t++){i[t].then((function(e){return e.body.dispose()})).catch(le)}return s(e),Promise.reject(e)}))},e}(),ya=new n.Vector3(-1,1,1),ba=function(e){function t(i){var r,o,a,s,l,c=this,u=t.parseArgs(i);return(c=e.call(this,u)||this).currentPanoIndex=u.initial[0],c.forwardPanoIndex=null,c.maxAccessibleDistance=u.maxAccessibleDistance,c.panoTapTriggerRadius=u.panoTapTriggerRadius,c.panoCircleMeshCreator=u.panoCircleMeshCreator,c.panoModelGroup=new n.Group,c.panoModelGroup.name="panoModels",c.scene.add(c.panoModelGroup),c.panoMeshes=[],c.updatePanoMeshes(),c.helper.remove(c.intersectMesh),c.locationMotion=new ur({count:0,distance:c.camera.pose.distance,modelAlpha:null!==(o=null===(r=c.model.getMaterial())||void 0===r?void 0:r.modelAlpha)&&void 0!==o?o:0,perspToOrtho:c.camera.perspToOrtho.x,orthoDistance:c.camera.orthoDistance}),c.panoResources={},c.panoResources[c.locationMotion.keyframes[0].key=c.locationMotion.keyframes[1].key=In()]={panoIndex:c.currentPanoIndex,workCode:c.work.workCode,matrix:null!==(l=null===(s=null===(a=c.model.getMaterial())||void 0===a?void 0:a.pano1)||void 0===s?void 0:s.matrix)&&void 0!==l?l:new n.Matrix4,position:c.camera.pose.offset.clone(),effect:"fly"},c.depthTextureLoader=new ga({allowHosts:c.work.allowHosts,requestProxy:c.requestProxy,networkSubscribe:c.networkSubscribe}),c}return te(t,e),t.parseArgs=function(t){var i,n,r,o=e.parseArgs.call(this,t);return ie(ie({},o),{maxAccessibleDistance:null!==(i=t.maxAccessibleDistance)&&void 0!==i?i:5,panoTapTriggerRadius:null!==(n=t.panoTapTriggerRadius)&&void 0!==n?n:1,panoCircleMeshCreator:null!==(r=t.panoCircleMeshCreator)&&void 0!==r?r:function(e){return new pr}})},t.initAnimationEndPose=function(t){var i=this.parseArgs(t);return e.initAnimationEndPose.call(this,i)},t.prototype.destroy=function(){var t,i=this;if(e.prototype.destroy.call(this),this.locationMotion.dispose(),delete this.pendingTextureTask,this.model&&(this.model.visible=!0),this.panoModelGroup){for(var n=0,r=this.panoModelGroup.children;n<r.length;n++){var o=r[n];"function"==typeof o.dispose&&o.dispose()}this.scene.remove(this.panoModelGroup)}this.panoMeshes&&(this.panoMeshes.forEach((function(e){i.helper.remove(e),e.dispose()})),this.panoMeshes.length=0);for(var a=null!==(t=this.model.getMaterial())&&void 0!==t?t:{},s=a.pano0,l=a.pano1,c=0,u=Object.keys(this.panoResources);c<u.length;c++){var h=u[c],d=this.panoResources[h];d.panoModel&&d.panoModel.material.uniforms.panoMap.value!==(null==s?void 0:s.map)&&d.panoModel.material.uniforms.panoMap.value!==(null==l?void 0:l.map)&&(this.panoModelGroup.remove(d.panoModel),d.panoModel.material.uniforms.panoMap.value.dispose(),d.panoModel.dispose(),delete d.panoModel),delete this.panoResources[h]}this.interiaMovement=!1},t.prototype.isReady=function(){return!1===this.locationMotion.ended&&e.prototype.isReady.call(this)},t.prototype.updateWork=function(e,t,i,n,r){return this.userAction=r,this.work=e,this.currentPanoIndex=t,this.depthTextureLoader.setAllowHosts(this.work.allowHosts),this.hideIntersectMesh(),this.updatePanoMeshes(),this.moveToPano(t,{effect:"fade",duration:n,longitude:i.longitude,latitude:i.latitude,fov:i.fov},r),!0},t.prototype.updateTime=function(e,t){var i,r,o=this;if(!this.destroyed){var a=this.currentPanoIndex,s={},l={},c=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[0]),u=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),h=!1;if(!1===this.locationMotion.ended){this.locationMotion.update(e);var d=this.locationMotion.getKeyFrameSegment(e),p=d[0],f=d[1],A=this.panoResourceFromLocationMotionKeyframe(p),v=this.panoResourceFromLocationMotionKeyframe(f),m=(new n.Vector3).copy(A.position),g=(new n.Vector3).copy(v.position),y=this.locationMotion.value.count-f.value.count+1;s.progress=y,s.modelAlpha=this.locationMotion.value.modelAlpha,this.camera.perspToOrtho.setScalar(Kn(this.locationMotion.value.perspToOrtho,0,1)),this.camera.orthoDistance=this.locationMotion.value.orthoDistance;for(var b=0,x=this.panoModelGroup.children;b<x.length;b++){var w=x[b];w.visible=w===A.panoModel||w===v.panoModel}A.panoModel&&(A.panoModel.material.uniforms.opacity.value=1-y,A.panoModel.material.depthTest=0!==y),v.panoModel&&(v.panoModel.material.uniforms.opacity.value=y,v.panoModel.material.depthTest=1!==y),v.panoModel&&(y<1?A.panoModel&&(s.pano0={map:A.panoModel.material.uniforms.panoMap.value,luminanceMap:null,matrix:A.matrix}):s.pano0={map:v.panoModel.material.uniforms.panoMap.value,luminanceMap:null,matrix:v.matrix},s.pano1={map:v.panoModel.material.uniforms.panoMap.value,luminanceMap:null,matrix:v.matrix}),h=s.useBlackTransition="instant"===v.effect||"montage"===v.effect,"fade"!==v.effect&&"montage"!==v.effect||(s.pano0&&(s.pano0={map:s.pano0.map,luminanceMap:null,matrix:A.matrix.clone().setPosition(v.position)}),m.copy(g)),l.distance=this.locationMotion.value.distance,l.offset=new n.Vector3(m.x+(g.x-m.x)*y,m.y+(g.y-m.y)*y,m.z+(g.z-m.z)*y);for(var M=[],C=[],E=0,I=this.locationMotion.keyframes;E<I.length;E++){var S=I[E],B=S.key,T=S.progress;void 0!==B&&(M.push(B),T>=this.locationMotion.progress&&C.push(B))}for(var P=0,R=Object.keys(this.panoResources);P<R.length;P++){var k=R[P];if(!(C.indexOf(k)>=0)){var Q=this.panoResources[k];if(Q.panoModel){if(Q.panoModel.material.uniforms.panoMap.value===(null===(i=s.pano0)||void 0===i?void 0:i.map))continue;if(Q.panoModel.material.uniforms.panoMap.value===(null===(r=s.pano1)||void 0===r?void 0:r.map))continue;this.panoModelGroup.remove(Q.panoModel),Q.panoModel.material.uniforms.panoMap.value.dispose(),Q.panoModel.dispose(),delete Q.panoModel}M.indexOf(k)>=0||delete this.panoResources[k]}}A.workCode===v.workCode?this.currentPanoIndex=y<.5?A.panoIndex:v.panoIndex:this.currentPanoIndex=v.panoIndex,this.emit("movingToPano",u.panoIndex,c.panoIndex,this.locationMotion.progress)}!1===this.cameraMotion.ended&&(this.cameraMotion.update(e),l.longitude=this.cameraMotion.value.longitude,l.latitude=this.cameraMotion.value.latitude,l.fov=this.cameraMotion.value.fov),!1===Ur(s)&&this.model.setMaterial(s);var D=!1;if(!1===Ur(l)&&(this.setCamera(l),D=!0),this.currentPanoIndex!==a&&(this.updatePanoMeshesVisible(),D=!0),D)if(W=this.work.observers[this.currentPanoIndex]){var F=Qt(this.camera.pose).normalize(),L=new n.Raycaster(W.position,F);this.forwardPanoIndex=this.getForwardPanoIndexOrNot(L)}if(this.camera.pose.distance>.1||h){var O=this.work.observers[this.currentPanoIndex];if(O)for(var N=0,V=H=O.visibleNodes.concat(this.currentPanoIndex);N<V.length;N++){var U=V[N];(G=this.panoMeshes[U])&&G.setOpacity(0)}}else{var z=this.work.observers[this.currentPanoIndex];if(z){var q=Vr(z.visibleNodes,(function(e){return z.standingPosition.distanceTo(o.work.observers[e].standingPosition)}),!0)[1];q=Kn(q,2.5,1/0);for(var H=z.visibleNodes.concat(this.currentPanoIndex),_=this.camera.getDirection(new n.Vector3),K=0,j=H;K<j.length;K++){U=j[K];var G,W=this.work.observers[U];if(G=this.panoMeshes[U])if(W.loadable||W.active){var X=G.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);G.setCurrent(!G.loading&&0===G.progress&&this.forwardPanoIndex===U),G.setOpacity(X<.01?0:Kn(q/X*1.2,.65,.98));var Y=this.camera.position.clone().setY(G.position.y);F=(new n.Vector3).copy(G.position).sub(Y).normalize();if(U===this.currentPanoIndex){var Z=Kn((.5-Y.distanceTo(G.position))/.5,0,1);F.multiplyScalar(1-Z).add(_.clone().multiplyScalar(Z))}F.length()>0&&G.quaternion.setFromEuler(new n.Euler(0,Math.atan2(F.x,F.z),0)),G.updateTime&&G.updateTime(e,t)}else G.setOpacity(0)}}}}},t.prototype.getTargetPose=function(){var e=this.cameraMotion.getKeyFrameSegment(ue())[1],t=this.locationMotion.getKeyFrameSegment(ue())[1],i=this.panoResourceFromLocationMotionKeyframe(t),n=this.work.observers[i.panoIndex];return{longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,offset:n?n.position.clone():this.camera.position.clone(),distance:0}},t.prototype.moveToPano=function(e,t,i){var r,o=this;void 0===t&&(t={});var a=this.work.observers[e].images.depth,s=ie({key:"pano.".concat(e)},ci(this.imageOptions,["format","size","quality","sharpen","mappings"])),l=this.imageOptions.transform,c=this.work.observers[e].images,u=this.work.observers[e],h=u.position,d=u.quaternion,p=(new n.Matrix4).compose(h,d,new n.Vector3(-1,1,1)),f="pano:"+so(c);if(this.pendingTextureTask){if(this.pendingTextureTask.hash===f)return;var A=this.pendingTextureTask.panoIndex;null===(r=this.panoMeshes[A])||void 0===r||r.setProgress(0),this.emit("textureAbort",A,this.work.observers[A]),this.pendingTextureTask.onError(new Error("texture aborted"))}this.pending=!0,this.pendingTextureTask={panoIndex:e,hash:f,onLoad:function(n){o.pending=!1,o.destroyed?n.body.dispose():(n.body.name=f,o.emit("panoLoaded",e),o.doMoveToPano(e,n.body,t,i))},onError:function(i){o.pending=!1,t.moveCancelCallback&&t.moveCancelCallback(),o.emit("panoLoadError",i,e),o.emit("moveToPanoCanceled",e)}};var v=this.panoMeshes[e];v&&v.tap&&v.tap(),this.depthTextureLoader.load(a,c,{transform:l,options:s},h,p,(function(t){var i,n;(null===(i=o.pendingTextureTask)||void 0===i?void 0:i.hash)===f?(o.pendingTextureTask.onLoad(t),null===(n=o.panoMeshes[e])||void 0===n||n.setProgress(0),delete o.pendingTextureTask,o.emit("textureLoaded",e,o.work.observers[e],t.meta)):t.body.dispose()}),(function(t){var i,n;(null===(i=o.pendingTextureTask)||void 0===i?void 0:i.hash)===f&&(o.pendingTextureTask.onError(t),null===(n=o.panoMeshes[e])||void 0===n||n.setProgress(0),delete o.pendingTextureTask,o.emit("textureError",t,e,o.work.observers[e]),o.emit("error",t))}),(function(t){var i,n;o.emit("textureLoading",t,e,o.work.observers[e]),(null===(i=o.pendingTextureTask)||void 0===i?void 0:i.hash)===f&&(null===(n=o.panoMeshes[e])||void 0===n||n.setProgress(t))}),this.renderer),this.emit("textureStartLoad",e,this.work.observers[e])},t.prototype.initAnimation=function(e,t,i,n){var r,o,a,s=this;if(!this.destroyed){var l=!1;this.pending=!1,this.userAction=n,this.moveToPano(e,{longitude:null!==(r=t.longitude)&&void 0!==r?r:this.defaultLongitude,latitude:Kn(null!==(o=t.latitude)&&void 0!==o?o:this.defaultLatitude,this.minLatitude,this.maxLatitude),fov:Kn(null!==(a=t.fov)&&void 0!==a?a:this.defaultFov,this.minFov,this.maxFov),duration:i,moveStartCallback:function(e,t){l=!0,s.emit("initAnimationWillStart",e,t,s.userAction)},moveEndCallback:function(e,t){s.emit("initAnimationEnded",e,t,s.userAction)},moveCancelCallback:function(){var e=zr(s.camera.pose);!1===l&&s.emit("initAnimationWillStart",s.currentPanoIndex,e,s.userAction),s.emit("initAnimationEnded",s.currentPanoIndex,e,s.userAction)}},n)}},t.prototype.panoResourceFromLocationMotionKeyframe=function(e){return this.panoResources[e.key]},t.prototype.locationMotionKeyframesLength=function(e){for(var t=0,i=1;i<e.length;i++){var n=this.panoResourceFromLocationMotionKeyframe(e[i-1]).position,r=this.panoResourceFromLocationMotionKeyframe(e[i]).position;t+=n.distanceTo(r)*(e[i].value.count-e[i-1].value.count)}return t},t.prototype.updatePanoMeshesVisible=function(){for(var e=this.work.observers[this.currentPanoIndex],t=(e?e.visibleNodes:[]).concat(this.currentPanoIndex),i=0,n=this.work.observers;i<n.length;i++){var r=n[i],o=this.panoMeshes[r.panoIndex];o&&(t.indexOf(r.panoIndex)>=0?o.parent!==this.helper&&this.helper.add(o):o.parent===this.helper&&this.helper.remove(o))}},t.prototype.updatePanoMeshes=function(){for(var e=this,t={},i=0,n=this.panoMeshes;i<n.length;i++){t[(p=n[i]).name]=p}this.panoMeshes.length=0;for(var r=1,o={},a=function(t){var i=Vr(t.accessibleNodes,(function(i){return Kn(e.work.observers[i].standingPosition.distanceTo(t.standingPosition),1,1/0)}),!0),n=i[1];void 0===o[t.panoIndex]&&(o[t.panoIndex]=n)},s=0,l=this.work.observers;s<l.length;s++){a(d=l[s])}var c=Object.keys(o).map((function(e){return o[e]}));c.length&&(r=Kn(.6*(c.reduce((function(e,t){return e+t}),0)/c.length),1,3));for(var u=0;u<this.work.observers.length;u++){var h="panoCircle_".concat(this.work.workCode,"_").concat(u),d=this.work.observers[u],p=void 0;t[h]?(!0===(p=t[h]).loading&&!1===d.loadable&&p.setLoading(!1),delete t[h]):(p=this.panoCircleMeshCreator(u)).name=h,p.scale.set(r,1,r),p.position.copy(d.standingPosition),this.panoMeshes[u]=p}for(var f=0,A=Object.keys(t);f<A.length;f++){var v=A[f];this.helper.remove(t[v]),t[v].dispose(),delete t[v]}this.updatePanoMeshesVisible()},t.prototype.doMoveToPano=function(e,t,i,r){var o,a,s,l,c=this;void 0===i&&(i={}),this.userAction=r;var u=ue(),h=In(),d=this.work.observers[e],p=this.panoResources[h]={panoIndex:e,workCode:this.work.workCode,effect:null!==(o=i.effect)&&void 0!==o?o:"fly",panoModel:t,matrix:(new n.Matrix4).compose(d.position,d.quaternion,ya),position:d.position.clone()};t.visible=!1,t.renderOrder=-1,this.panoModelGroup.add(t);var f,A,v;if(this.locationMotion.ended){var m=this.locationMotion.getKeyFrameSegment(u);m[0];var g=m[1],y=this.locationMotion.value,b=this.panoResourceFromLocationMotionKeyframe(g).position,x=p.position;f=Math.max(b.distanceTo(x),1),A=[{key:g.key,progress:0,value:ie(ie({},y),{count:0})},{key:h,progress:1,value:{distance:0,perspToOrtho:0,modelAlpha:0,orthoDistance:1,count:1}}],v=0}else{var w=this.locationMotion.getKeyFrameSegment(u),M=w[0],C=(g=w[1],y=this.locationMotion.value,this.panoResourceFromLocationMotionKeyframe(M).position),E=(b=this.panoResourceFromLocationMotionKeyframe(g).position,x=p.position,g.value.count-y.count),I=Math.max(C.distanceTo(b),1)*E;f=I+Math.max(b.distanceTo(x),1),A=[{key:M.key,progress:0,value:ie({},y)},{key:g.key,progress:I/f,value:g.value},{key:h,progress:1,value:{count:g.value.count+1,distance:0,perspToOrtho:0,orthoDistance:1,modelAlpha:0}}];var S=this.locationMotionKeyframesLength(this.locationMotion.keyframes),B=this.locationMotionKeyframesLength(A);v=0===S||0===S?0:this.locationMotion.getProgressVelocity(u)*S/B}var T=this.calculateMovingDuration(i.duration,"fade"===i.effect||"montage"===i.effect?0:f),P={longitude:i.longitude,latitude:i.latitude,fov:i.fov},R={longitude:null!==(a=P.longitude)&&void 0!==a?a:this.camera.pose.longitude,latitude:null!==(s=P.latitude)&&void 0!==s?s:this.camera.pose.latitude,fov:null!==(l=P.fov)&&void 0!==l?l:this.camera.pose.fov,offset:d.position.clone(),distance:this.camera.pose.distance};this.emit("moveToPano",e,this.userAction),i.moveStartCallback&&i.moveStartCallback(e,R),this.emit("panoWillArrive",e,R,this.userAction),this.cameraMotion.set(P,T).catch(le),this.locationMotion.setKeyframes(A,T,v).then((function(){var t={longitude:c.camera.pose.longitude,latitude:c.camera.pose.latitude,fov:c.camera.pose.fov,offset:c.camera.pose.offset.clone(),distance:c.camera.pose.distance};i.moveEndCallback&&i.moveEndCallback(e,t),c.emit("panoArrived",e,t,r)}),(function(){i.moveCancelCallback&&i.moveCancelCallback(),c.emit("moveToPanoCanceled",e)}))},t.prototype.getForwardPanoIndexOrNot=function(e){var t=this,i=this.camera.getDirection(new n.Vector3),r=this.camera.position.clone(),o=this.work.observers[this.currentPanoIndex];if(!o)return null;var a=o.accessibleNodes.filter((function(e){if(e===t.currentPanoIndex)return!1;var i=t.work.observers[e],o=i.standingPosition.clone().sub(r);return 0!==o.length()&&(!(o.angleTo(new n.Vector3(0,-1,0))<Math.PI/12)&&(i.loadable||i.active))})),s=(e?e.ray.direction.clone():i.clone()).setY(0);if(0===s.length())return null;for(var l=a.slice().sort((function(e,i){var n=t.work.observers[e].position.clone().setY(r.y),o=t.work.observers[i].position.clone().setY(r.y);return n.distanceTo(r)-o.distanceTo(r)})),c=0,u=[Math.PI/8,Math.PI/6,Math.PI/4,Math.PI/3];c<u.length;c++)for(var h=u[c],d=0,p=l;d<p.length;d++){var f=p[d],A=this.work.observers[f].position.clone().setY(r.y).sub(r);if(0!==A.length()&&s.angleTo(A)<h)return f}return null},t.prototype.onTapGesture=function(e){var t=this,i=e.pointers.map((function(e){return ci(e,["x","y"])}));if(!this.emit("wantsGesture","tap",i,!0)){var r=this.relativeClientPosition(e.center),o=new n.Raycaster;if(o.setFromCamera(r,this.camera),!this.emit("wantsTapGesture",o,r,!0)){this.emit("gesture","tap",i,!0),this.emit("tapGesture",o,r,!0),this.interiaMovement=!1;var a=this.camera.getDirection(new n.Vector3).setY(0),s=null,l=this.work.observers[this.currentPanoIndex];if(l){var c=l.accessibleNodes.filter((function(e){if(e===t.currentPanoIndex)return!1;var i=t.work.observers[e];return!(i.position.distanceTo(t.camera.position)>t.maxAccessibleDistance)&&(i.loadable||i.active)})),u=o.intersectObject(this.boundingMesh,!0)[0];if(u){var h=Vr(c,(function(e){var i=t.work.observers[e].standingPosition.clone();return i.clone().sub(t.camera.position).setY(0).angleTo(a)>Math.PI/2?1/0:i.distanceTo(u.point)}),!0),d=h[0];h[1]<this.panoTapTriggerRadius&&(s=d)}Un(s)&&(s=this.getForwardPanoIndexOrNot(o));for(var p=0,f=this.locationMotion.keyframes;p<f.length;p++){var A=f[p],v=this.panoResourceFromLocationMotionKeyframe(A);if(!(A.progress<this.locationMotion.progress)&&v.panoIndex===s){s=null;break}}if(this.emit("panoSelected",s),Un(s))!0===this.locationMotion.ended&&this.cameraBounce();else{var m=this.work.observers[s];if(m.active){for(var g={},y=Math.PI/6,b=Math.PI/12,x=new n.Vector3(0,1,0),w=m.position.clone().setY(0).sub(l.position.clone().setY(0)).normalize(),M=w.clone().applyAxisAngle(x,y),C=w.clone().applyAxisAngle(x,-y),E=[],I=[],S=[],B=0,T=m.accessibleNodes;B<T.length;B++){if((d=T[B])!==this.currentPanoIndex&&d!==s){var P=this.work.observers[d].position.clone().sub(m.position).setY(0);w.angleTo(P)<y?S.push(P):M.angleTo(P)<y?E.push(P):C.angleTo(P)<y&&I.push(P)}}var R=(S.length>0?S:ne(ne([],E,!0),I,!0)).slice().sort((function(e,t){return e.angleTo(w)-t.angleTo(w)}))[0];R&&R.angleTo(a)>b&&(g.longitude=Math.atan2(-R.x,-R.z)),this.cameraMotion.value.latitude<-Math.PI/4&&(g.latitude=Kn(0,this.minLatitude,this.maxLatitude)),this.emit("wantsMoveToPano",s,g,!0)}else this.panoMeshes[s]&&(this.panoMeshes[s].setDisabled(!1),this.panoMeshes[s].setLoading(!0))}}}}},t}(co);function xa(e,t){var i=new n.Vector3;return i.setFromMatrixColumn(t,0),i.multiplyScalar(-e),i}function wa(e,t,i){var r=new n.Vector3;return r.setFromMatrixColumn(i,0),r.crossVectors(t,r),r.multiplyScalar(e),r}var Ma=function(e){function t(i){var n,r,o=this,a=t.parseArgs(i);return(o=e.call(this,a)||this).currentPanoIndex=a.initial[0],o.defaultLongitude=a.defaultLongitude,o.defaultLatitude=a.defaultLatitude,o.defaultDistance=a.defaultDistance,o.maxLatitude=a.maxLatitude,o.minLatitude=a.minLatitude,o.maxDistance=a.maxDistance,o.minDistance=a.minDistance,o.locationMotion=new ur({x:o.camera.pose.offset.x,y:o.camera.pose.offset.y,z:o.camera.pose.offset.z,distance:o.camera.pose.distance,modelAlpha:null!==(r=null===(n=o.model.getMaterial())||void 0===n?void 0:n.modelAlpha)&&void 0!==r?r:0,perspToOrtho:o.camera.perspToOrtho.x,orthoDistance:o.camera.orthoDistance}),o}return te(t,e),t.parseArgs=function(t){var i,n,r,o,a,s,l,c=e.parseArgs.call(this,t);return ie(ie({},c),{defaultLongitude:null!==(i=t.defaultLongitude)&&void 0!==i?i:Math.PI/4,defaultLatitude:null!==(n=t.defaultLatitude)&&void 0!==n?n:Math.PI/4,defaultDistance:null!==(r=t.defaultDistance)&&void 0!==r?r:100,maxLatitude:null!==(o=t.maxLatitude)&&void 0!==o?o:+Math.PI/2,minLatitude:null!==(a=t.minLatitude)&&void 0!==a?a:0,maxDistance:null!==(s=t.maxDistance)&&void 0!==s?s:100,minDistance:null!==(l=t.minDistance)&&void 0!==l?l:2})},t.distanceFromModel=function(e,t,i){var n=e.bounding,r=Math.pow(Math.pow(n.max.x-n.min.x+1,2)+Math.pow(n.max.y-n.min.y+1,2)+Math.pow(n.max.z-n.min.z+1,2),.5),o=r/2/Math.tan(Math.PI*t/360);return i<1&&(o/=i),isNaN(o)?r:o},t.initAnimationEndPose=function(e){var i,n,r,o,a=this.parseArgs(e),s=e.initial[0],l=e.initial[1];return{longitude:null!==(i=l.longitude)&&void 0!==i?i:a.defaultLongitude,latitude:Kn(null!==(n=l.latitude)&&void 0!==n?n:a.defaultLatitude,a.minLatitude,a.maxLatitude),fov:90,offset:null!==(r=l.offset)&&void 0!==r?r:a.work.observers[s].position.clone(),distance:null!==(o=l.distance)&&void 0!==o?o:t.distanceFromModel(a.model,90,a.camera.aspect)}},t.prototype.destroy=function(){e.prototype.destroy.call(this),this.model.enableTiles=!1,this.locationMotion.dispose(),this.mouseWheelState&&clearTimeout(this.mouseWheelState.timer),delete this.mouseWheelState,delete this.panState},t.prototype.isReady=function(){return!1!==this.locationMotion.ended&&e.prototype.isReady.call(this)},t.prototype.updateWork=function(e,t,i,n,r){return this.work=e,this.updateCamera(i,n,r),!0},t.prototype.updateModel=function(t){e.prototype.updateModel.call(this,t);var i=t.bounding.getCenter(new n.Vector3);this.locationMotion.set({x:i.x,y:i.y,z:i.z},0).catch(le),this.model.enableTiles=!0},t.prototype.updateTime=function(e,t){if(!this.destroyed){var i={},r={};this.locationMotion.ended||(this.locationMotion.update(e),i.modelAlpha=this.locationMotion.value.modelAlpha,this.camera.perspToOrtho.setScalar(Kn(this.locationMotion.value.perspToOrtho,0,1)),this.camera.orthoDistance=this.locationMotion.value.orthoDistance,r.distance=this.locationMotion.value.distance,r.offset=new n.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z)),this.cameraMotion.ended||(this.cameraMotion.update(e),r.longitude=this.cameraMotion.value.longitude,r.latitude=this.cameraMotion.value.latitude,r.fov=this.cameraMotion.value.fov),Ur(i)||this.model.setMaterial(i),Ur(r)||this.setCamera(r)}},t.prototype.setCamera=function(t){e.prototype.setCamera.call(this,t);var i=this.camera.pose.offset.clone();if(this.model.bvhs.loaded){var r=new n.Raycaster(this.camera.position.clone(),this.camera.getDirection(new n.Vector3)),o=this.model.intersectRaycaster(r)[0];o&&i.copy(o.point)}var a=Vr(this.work.observers,(function(e){return e.position.distanceTo(i)})),s=this.work.observers.indexOf(a);s!==this.currentPanoIndex&&(this.emit("moveToPano",s,this.userAction),this.emit("panoWillArrive",s,zr(this.camera.pose),this.userAction),this.currentPanoIndex=s,this.emit("panoArrived",s,zr(this.camera.pose),this.userAction))},t.prototype.getTargetPose=function(){var e=this.cameraMotion.getKeyFrameSegment(ue())[1],t=this.locationMotion.getKeyFrameSegment(ue())[1];return{longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,distance:t.value.distance,offset:new n.Vector3(t.value.x,t.value.y,t.value.z)}},t.prototype.initAnimation=function(e,i,r,o){var a,s,l,c,u=this;if(!this.destroyed){this.pending=!1,this.userAction=o;var h={longitude:null!==(a=i.longitude)&&void 0!==a?a:this.defaultLongitude,latitude:Kn(null!==(s=i.latitude)&&void 0!==s?s:this.defaultLatitude,this.minLatitude,this.maxLatitude),fov:90,offset:null!==(l=i.offset)&&void 0!==l?l:this.model.bounding.getCenter(new n.Vector3),distance:null!==(c=i.distance)&&void 0!==c?c:t.distanceFromModel(this.model,90,this.camera.aspect)},d=ci(h,["longitude","latitude","fov"]),p={x:h.offset.x,y:h.offset.y,z:h.offset.z,distance:h.distance,modelAlpha:1,perspToOrtho:0,orthoDistance:h.distance};this.emit("initAnimationWillStart",e,h,this.userAction),this.cameraMotion.set(d,r).catch(le),this.locationMotion.set(p,r).then((function(){u.emit("initAnimationEnded",e,h,u.userAction)}),(function(t){var i=zr(u.camera.pose);u.emit("initAnimationEnded",e,i,u.userAction)})).then((function(){u.model.enableTiles=!0}))}},t.prototype.getForwardPanoIndexOrNot=function(e){var t=this.work.observers.filter((function(e){return e.active})),i=this.model.intersectRaycaster(e)[0];if(!i)return null;var n=Vr(t,(function(e){return e.standingPosition.distanceTo(i.point)}),!0),r=n[0];return n[1]<5?this.work.observers.indexOf(r):null},t.prototype.coordinatesForOffset=function(e){var t=this.cameraMotion.value.fov,i=this.camera.aspect,r=this.renderer.getSize(new n.Vector2);return{longitude:2*e.x/(r.x*this.scissor.width)*t/95*i,latitude:-2*e.y/(r.y*this.scissor.height)*t/95}},t.prototype.onPanGesture=function(e){var t=this.panState,i=e.pointers.length;if(e.isFinal?delete this.panState:this.panState={pointerLength:i,x:e.center.x,y:e.center.y},void 0!==t&&t.pointerLength===i){var r=e.pointers.map((function(e){return ci(e,["x","y"])}));if(!this.emit("wantsGesture","pan",r,e.isFinal))if("mouse"===e.pointerType&&2===e.srcEvent.buttons){var o={x:e.center.x-t.x,y:e.center.y-t.y},a=new n.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),s=this.model.bounding,l=s.getCenter(new n.Vector3),c={x:(s.max.x-s.min.x)/90*this.cameraMotion.value.fov,y:(s.max.y-s.min.y)/90*this.cameraMotion.value.fov,z:(s.max.z-s.min.z)/90*this.cameraMotion.value.fov},u=(this.camera.position.y-s.min.y)*Math.tan(this.camera.fov/2*Math.PI/180),h=this.renderer.getSize(new n.Vector2);a.add(xa(2*o.x*u/h.y,this.camera.matrix)),a.add(wa(2*o.y*u/h.y,this.camera.up,this.camera.matrix)),a.x=Kn(a.x,l.x-c.x,l.x+c.x),a.z=Kn(a.z,l.z-c.z,l.z+c.z);var d={longitude:0,latitude:Math.PI/2,fov:this.cameraMotion.value.fov,offset:a,distance:this.locationMotion.value.distance};if(this.emit("wantsPanGesture",d,e.isFinal))return;this.emit("gesture","pan",r,e.isFinal),this.emit("panGesture",d,e.isFinal),this.userAction=!0,this.locationMotion.set({x:a.x,y:a.y,z:a.z},0).catch(le)}else{a={x:e.center.x-t.x,y:e.center.y-t.y};var p=this.coordinatesForOffset(a),f=Rr(this.cameraMotion.value.longitude+-1*p.longitude),A=Kn(this.cameraMotion.value.latitude+-1*p.latitude,this.minLatitude,this.maxLatitude);this.camera.aspect<1&&Math.abs(e.overallVelocityX)>.2&&Math.atan2(Math.abs(e.overallVelocityY),Math.abs(e.overallVelocityX))<Math.PI/6.923&&(A=this.cameraMotion.value.latitude);d={longitude:f,latitude:A,fov:this.cameraMotion.value.fov,offset:this.camera.pose.offset.clone(),distance:this.camera.pose.distance};if(this.emit("wantsPanGesture",d,e.isFinal))return;this.emit("gesture","pan",r,e.isFinal),this.emit("panGesture",d,e.isFinal),this.userAction=!0,this.interiaMovement=!1;var v={longitude:d.longitude,latitude:d.latitude,fov:d.fov};if(this.cameraMotion.set(v,0).catch(le),e.isFinal)this.emit("wantsInteriaPan",d)||(this.interiaMovement=!0,e.velocityX,e.velocityY)}}},t.prototype.onPinchGesture=function(e){var t=this.pinchState||{},i=t.distance;t.offsetY;var r=!1;if("pinchstart"!==e.type){if("pinchend"===e.type&&(r=!0,delete this.pinchState),void 0!==i){this.pinchState={distance:i};var o=e.pointers.map((function(e){return ci(e,["x","y"])}));if(this.emit("wantsGesture","pinch",o,r))return;var a=Kn(i/e.scale,this.minDistance,this.maxDistance);if(this.emit("wantsPinchGesture",e.scale,this.camera.pose.fov,r))return;this.emit("gesture","pinch",o,r),this.emit("pinchGesture",e.scale,this.camera.pose.fov,r),this.userAction=!0,this.locationMotion.set({distance:a},0).catch(le)}var s=this.panState,l=e.pointers.length;if(e.isFinal?delete this.panState:this.panState={pointerLength:l,x:e.center.x,y:e.center.y},void 0!==s&&s.pointerLength===l){var c=e.pointers.map((function(e){return ci(e,["x","y"])}));if(!this.emit("wantsGesture","pinch",c,r)){var u=e.pointers.map((function(e){return ci(e,["x","y"])}));if(!this.emit("wantsGesture","pinch",u,r)){var h={x:e.center.x-s.x,y:e.center.y-s.y},d=new n.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),p=this.model.bounding,f=p.getCenter(new n.Vector3),A={x:(p.max.x-p.min.x)/90*this.cameraMotion.value.fov,y:(p.max.y-p.min.y)/90*this.cameraMotion.value.fov,z:(p.max.z-p.min.z)/90*this.cameraMotion.value.fov},v=(this.camera.position.y-p.min.y)*Math.tan(this.camera.fov/2*Math.PI/180),m=this.renderer.getSize(new n.Vector2);d.add(xa(2*h.x*v/m.y,this.camera.matrix)),d.add(wa(2*h.y*v/m.y,this.camera.up,this.camera.matrix)),d.x=Kn(d.x,f.x-A.x,f.x+A.x),d.z=Kn(d.z,f.z-A.z,f.z+A.z);var g={longitude:0,latitude:Math.PI/2,fov:this.cameraMotion.value.fov,offset:d,distance:this.locationMotion.value.distance};this.emit("wantsPanGesture",g,e.isFinal)||(this.emit("gesture","pan",u,e.isFinal),this.emit("panGesture",g,e.isFinal),this.userAction=!0,this.locationMotion.set({x:d.x,y:d.y,z:d.z},0).catch(le))}}}}else this.pinchState={distance:this.locationMotion.value.distance}},t.prototype.onMouseWheel=function(e){var t=this,i=(Math.abs(e.deltaY)>Math.abs(e.deltaX)?e.deltaY:e.deltaX)/-60,n=[{x:e.clientX,y:e.clientY,delta:i}];if(!this.emit("wantsGesture","mouseWheel",n,!1)){var r=Kn(this.locationMotion.value.distance-i/2,this.minDistance,this.maxDistance);this.emit("wantsMouseWheel",i,this.camera.pose.fov,!1)||(this.emit("gesture","mouseWheel",n,!1),this.emit("mouseWheel",i,this.camera.pose.fov,!1),this.userAction=!0,this.locationMotion.set({distance:r},0).catch(le),this.mouseWheelState&&clearTimeout(this.mouseWheelState.timer),this.mouseWheelState={timer:window.setTimeout((function(){delete t.mouseWheelState;t.emit("wantsGesture","mouseWheel",n,!0)||t.emit("wantsMouseWheel",i,t.camera.pose.fov,!0)||(t.emit("gesture","mouseWheel",n,!0),t.emit("mouseWheel",0,t.camera.pose.fov,!0))}),200)})}},t.prototype.onTapGesture=function(e){var t=e.pointers.map((function(e){return ci(e,["x","y"])}));if(!this.emit("wantsGesture","tap",t,!0)){var i=this.relativeClientPosition(e.center),r=new n.Raycaster;if(r.setFromCamera(i,this.camera),!this.emit("wantsTapGesture",r,i,!0)){this.emit("gesture","tap",t,!0),this.emit("tapGesture",r,i,!0),this.interiaMovement=!1;var o=this.getForwardPanoIndexOrNot(r);if(!Un(o)){this.emit("panoSelected",o);var a={longitude:this.camera.pose.longitude,latitude:0};this.emit("wantsMoveToPano",o,a,!0)}}}},t.prototype.onPressGesture=function(e,t){var i,r,o=[e];if(this.emit("wantsGesture","press",o,t))return null===(i=this.pressState)||void 0===i||i.stop(),void delete this.pressState;var a=this.relativeClientPosition(e),s=new n.Raycaster;if(s.setFromCamera(a,this.camera),this.emit("wantsPressGesture",s,a,e.delta,t))return null===(r=this.pressState)||void 0===r||r.stop(),void delete this.pressState;this.emit("gesture","press",o,t),this.emit("pressGesture",s,a,e.delta,t)},t}(Jr),Ca={type:"move"},Ea=function(){function e(){this._targetRay=null,this._grip=null,this._hand=null,this._axes=[0,0]}return e.prototype.getHandSpace=function(){return null===this._hand&&(this._hand=new n.Group,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand},e.prototype.getTargetRaySpace=function(){return null===this._targetRay&&(this._targetRay=new n.Group,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new n.Vector3,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new n.Vector3),this._targetRay},e.prototype.getGripSpace=function(){return null===this._grip&&(this._grip=new n.Group,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new n.Vector3,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new n.Vector3),this._grip},e.prototype.dispatchEvent=function(e){return null!==this._targetRay&&this._targetRay.dispatchEvent(e),null!==this._grip&&this._grip.dispatchEvent(e),null!==this._hand&&this._hand.dispatchEvent(e),this},e.prototype.disconnect=function(e){return this.dispatchEvent({type:"disconnected",data:e}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this},e.prototype.getAxes=function(){return this._axes},e.prototype.update=function(e,t,i){var r=null,o=null,a=null,s=this._targetRay,l=this._grip,c=this._hand;if(e&&e.gamepad&&e.gamepad.axes&&(this._axes=[e.gamepad.axes[2],e.gamepad.axes[3]]),e&&"visible-blurred"!==t.session.visibilityState)if(null!==s&&null!==(r=t.getPose(e.targetRaySpace,i))&&(s.matrix.fromArray(r.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),r.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(r.linearVelocity)):s.hasLinearVelocity=!1,r.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(r.angularVelocity)):s.hasAngularVelocity=!1,this.dispatchEvent(Ca)),c&&e.hand){a=!0;for(var u=0,h=e.hand.values();u<h.length;u++){var d=h[u],p=t.getJointPose(d,i);if(void 0===c.joints[d.jointName]){var f=new n.Group;f.matrixAutoUpdate=!1,f.visible=!1,c.joints[d.jointName]=f,c.add(f)}var A=c.joints[d.jointName];null!==p&&(A.matrix.fromArray(p.transform.matrix),A.matrix.decompose(A.position,A.rotation,A.scale),A.jointRadius=p.radius),A.visible=null!==p}var v=c.joints["index-finger-tip"],m=c.joints["thumb-tip"],g=v.position.distanceTo(m.position);c.inputState.pinching&&g>.025?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&g<=.015&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else null!==l&&e.gripSpace&&null!==(o=t.getPose(e.gripSpace,i))&&(l.matrix.fromArray(o.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),o.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(o.linearVelocity)):l.hasLinearVelocity=!1,o.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(o.angularVelocity)):l.hasAngularVelocity=!1);return null!==s&&(s.visible=null!==r),null!==l&&(l.visible=null!==o),null!==c&&(c.visible=null!==a),this},e}(),Ia=function(e){function t(t,i,r){var o,a,s,l=this;return(l=e.call(this)||this).isPanorama=null===(o=null==r?void 0:r.isPanorama)||void 0===o||o,l.machineType=null!==(a=null==r?void 0:r.machineType)&&void 0!==a?a:"Pico",l.renderer=t,l.gl=i,l.enabled=!1,l.session=null,l.referenceSpaceType=null!==(s=null==r?void 0:r.referenceSpaceType)&&void 0!==s?s:"local-floor",l.referenceSpace=null,l.controllers=[new Ea,new Ea],l.inputSourcesMap=new Map,l.cameraVR=new n.ArrayCamera,l.cameraL=new n.PerspectiveCamera,l.cameraR=new n.PerspectiveCamera,l.cameraL.viewport=new n.Vector4,l.cameraR.viewport=new n.Vector4,l.cameraL.layers.enable(1),l.cameraR.layers.enable(2),l.cameraVR.layers.enable(1),l.cameraVR.layers.enable(2),l.isPresenting=!1,l.currentDepthNear=null,l.currentDepthFar=null,l.cameraLPos=new n.Vector3,l.cameraRPos=new n.Vector3,l}return te(t,e),t.prototype.getController=function(e){var t=this.controllers[e];return t||console.warn("no controller find"),t.getTargetRaySpace()},t.prototype.getCameras=function(){return{cameraL:this.cameraL,cameraR:this.cameraR,cameraVR:this.cameraVR}},t.prototype.updateCamera=function(e,t){null===t?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.getInverse(e.matrixWorld)},t.prototype.setProjectionFromUnion=function(e,t,i){this.cameraLPos.setFromMatrixPosition(t.matrixWorld),this.cameraRPos.setFromMatrixPosition(i.matrixWorld);var n=this.cameraLPos.distanceTo(this.cameraRPos),r=t.projectionMatrix.elements,o=i.projectionMatrix.elements,a=r[14]/(r[10]-1),s=r[14]/(r[10]+1),l=(r[9]+1)/r[5],c=(r[9]-1)/r[5],u=(r[8]-1)/r[0],h=(o[8]+1)/o[0],d=a*u,p=a*h,f=n/(-u+h),A=f*-u;t.matrixWorld.decompose(e.position,e.quaternion,e.scale),e.translateX(A),e.translateZ(f),e.matrixWorld.compose(e.position,e.quaternion,e.scale),e.matrixWorldInverse.getInverse(e.matrixWorld);var v=a+f,m=s+f,g=d-A,y=p+(n-A),b=l*s/m*v,x=c*s/m*v;e.projectionMatrix.makePerspective(g,y,b,x,v,m)},t.prototype.getCamera=function(e){this.cameraVR.near=this.cameraR.near=this.cameraL.near=e.near,this.cameraVR.far=this.cameraR.far=this.cameraL.far=e.far,!this.session||this.currentDepthNear===this.cameraVR.near&&this.currentDepthFar===this.cameraVR.far||(this.session.updateRenderState({depthNear:this.cameraVR.near,depthFar:this.cameraVR.far}),this.currentDepthNear=this.cameraVR.near,this.currentDepthFar=this.cameraVR.far);var t=e.parent,i=this.cameraVR.cameras;this.updateCamera(this.cameraVR,t);for(var n=0;n<i.length;n++)this.updateCamera(i[n],t);e.matrixWorld.copy(this.cameraVR.matrixWorld);for(var r=e.children,o=(n=0,r.length);n<o;n++)r[n].updateMatrixWorld(!0);return 2===i.length?this.setProjectionFromUnion(this.cameraVR,this.cameraL,this.cameraR):this.cameraVR.projectionMatrix.copy(this.cameraL.projectionMatrix),this.cameraVR},t.prototype.updateInputSources=function(e){if(this.session){for(var t=this.session.inputSources,i=0;i<this.controllers.length;i++)this.inputSourcesMap.set(t[i],this.controllers[i]);for(i=0;i<e.removed.length;i++){var n=e.removed[i];(r=this.inputSourcesMap.get(n))&&(r.dispatchEvent({type:"disconnected",data:n}),this.inputSourcesMap.delete(n))}for(i=0;i<e.added.length;i++){var r;n=e.added[i];(r=this.inputSourcesMap.get(n))&&r.dispatchEvent({type:"connected",data:n})}}else console.warn("session is lose!")},t.prototype.onSessionEvent=function(e){var t=this.inputSourcesMap.get(e.inputSource);t&&t.dispatchEvent({type:e.type})},t.prototype.onSessionEnd=function(){this.inputSourcesMap.forEach((function(e,t){e.disconnect(t)})),this.inputSourcesMap.clear(),this.renderer.setFramebuffer(null),this.renderer.setRenderTarget(this.renderer.getRenderTarget()),this.isPresenting=!1,this.session=null,ke.shared.setContext(null),this.emit("webXRSessionEnd")},t.prototype.onRequestReferenceSpace=function(e){this.referenceSpace=e,this.isPresenting=!0,this.emit("webXRSessionStart")},t.prototype.setSession=function(e){var t=this;if(this.session=e,this.session){this.session.addEventListener("select",(function(e){t.onSessionEvent(e)})),this.session.addEventListener("selectstart",(function(e){t.onSessionEvent(e)})),this.session.addEventListener("selectend",(function(e){t.onSessionEvent(e)})),this.session.addEventListener("squeeze",(function(e){t.onSessionEvent(e)})),this.session.addEventListener("squeezestart",(function(e){t.onSessionEvent(e)})),this.session.addEventListener("squeezeend",(function(e){t.onSessionEvent(e)})),this.session.addEventListener("end",(function(e){t.onSessionEnd()}));var i=this.gl.getContextAttributes();this.gl.makeXRCompatible().then((function(){var e={antialias:null==i?void 0:i.antialias,alpha:null==i?void 0:i.alpha,depth:null==i?void 0:i.depth,stencil:null==i?void 0:i.stencil,framebufferScaleFactor:1};if(t.session){switch(t.machineType){case"Pico":t.session.updateRenderState({baseLayer:new XRWebGLLayer(t.session,t.gl,e)});break;case"Oculus":t.session.updateRenderState({layers:[new XRWebGLLayer(t.session,t.gl,e)]});break;default:t.machineType}t.session.requestReferenceSpace(t.referenceSpaceType).then((function(e){t.onRequestReferenceSpace(e)})),t.session.addEventListener("inputsourceschange",(function(e){t.updateInputSources(e)}))}else console.error("session is lose while set session!")}))}},t}(se),Sa=["webXRSessionStart","webXRSessionEnd"],Ba=function(e){function t(){var t=e.call(this)||this;t.type="LineSegmentsGeometry";return t.setIndex([0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5]),t.setAttribute("position",new n.Float32BufferAttribute([-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],3)),t.setAttribute("uv",new n.Float32BufferAttribute([-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],2)),t}return te(t,e),t.prototype.applyMatrix4=function(e){var t=this.attributes.instanceStart,i=this.attributes.instanceEnd;return void 0!==t&&(t.applyMatrix4(e),i.applyMatrix4(e),t.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},t.prototype.setPositions=function(e){var t;t=e instanceof Float32Array?e:Array.isArray(e)?new Float32Array(e):new Float32Array;var i=new n.InstancedInterleavedBuffer(t,6,1);return this.setAttribute("instanceStart",new n.InterleavedBufferAttribute(i,3,0)),this.setAttribute("instanceEnd",new n.InterleavedBufferAttribute(i,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this},t.prototype.setColors=function(e){var t;t=e instanceof Float32Array?e:Array.isArray(e)?new Float32Array(e):new Float32Array;var i=new n.InstancedInterleavedBuffer(t,6,1);return this.setAttribute("instanceColorStart",new n.InterleavedBufferAttribute(i,3,0)),this.setAttribute("instanceColorEnd",new n.InterleavedBufferAttribute(i,3,3)),this},t.prototype.fromWireframeGeometry=function(e){return this.setPositions(e.attributes.position.array),this},t.prototype.fromEdgesGeometry=function(e){return this.setPositions(e.attributes.position.array),this},t.prototype.fromMesh=function(e){return this.fromWireframeGeometry(new n.WireframeGeometry(e.geometry)),this},t.prototype.fromLineSegments=function(e){var t=e.geometry;if(t instanceof n.Geometry){var i=(new n.BufferGeometry).fromGeometry(t);this.setPositions(i.attributes.position.array)}else t instanceof n.BufferGeometry&&this.setPositions(t.attributes.position.array);return this},t.prototype.computeBoundingBox=function(){null===this.boundingBox&&(this.boundingBox=new n.Box3);var e=this.attributes.instanceStart,t=this.attributes.instanceEnd;if(void 0!==e&&void 0!==t){var i=new n.Box3;this.boundingBox.setFromBufferAttribute(e),i.setFromBufferAttribute(t),this.boundingBox.union(i)}},t.prototype.computeBoundingSphere=function(){null===this.boundingSphere&&(this.boundingSphere=new n.Sphere),null===this.boundingBox&&this.computeBoundingBox();var e=this.attributes.instanceStart,t=this.attributes.instanceEnd;if(void 0!==e&&void 0!==t){var i=this.boundingSphere.center;this.boundingBox.getCenter(i);for(var r=0,o=new n.Vector3,a=0,s=e.count;a<s;a++)o.fromBufferAttribute(e,a),r=Math.max(r,i.distanceToSquared(o)),o.fromBufferAttribute(t,a),r=Math.max(r,i.distanceToSquared(o));this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}},t.prototype.toJSON=function(){},t}(n.InstancedBufferGeometry);Object.assign(Ba.prototype,{isLineSegmentsGeometry:!0});var Ta={uniforms:n.UniformsUtils.merge([n.UniformsLib.common,n.UniformsLib.fog,{linewidth:{value:1},resolution:{value:new n.Vector2(1,1)},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1},opacity:{value:1}}]),vertexShader:"\n\t\t#include <common>\n\t\t#include <color_pars_vertex>\n\t\t#include <fog_pars_vertex>\n\t\t#include <logdepthbuf_pars_vertex>\n\t\t#include <clipping_planes_pars_vertex>\n\n\t\tuniform float linewidth;\n\t\tuniform vec2 resolution;\n\n\t\tattribute vec3 instanceStart;\n\t\tattribute vec3 instanceEnd;\n\n\t\tattribute vec3 instanceColorStart;\n\t\tattribute vec3 instanceColorEnd;\n\n\t\tvarying vec2 vUv;\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashScale;\n\t\t\tattribute float instanceDistanceStart;\n\t\t\tattribute float instanceDistanceEnd;\n\t\t\tvarying float vLineDistance;\n\n\t\t#endif\n\n\t\tvoid trimSegment( const in vec4 start, inout vec4 end ) {\n\n\t\t\t// trim end segment so it terminates between the camera plane and the near plane\n\n\t\t\t// conservative estimate of the near plane\n\t\t\tfloat a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column\n\t\t\tfloat b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column\n\t\t\tfloat nearEstimate = - 0.5 * b / a;\n\n\t\t\tfloat alpha = ( nearEstimate - start.z ) / ( end.z - start.z );\n\n\t\t\tend.xyz = mix( start.xyz, end.xyz, alpha );\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\t#ifdef USE_COLOR\n\n\t\t\t\tvColor.xyz = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd;\n\n\t\t\t#endif\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tvLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd;\n\n\t\t\t#endif\n\n\t\t\tfloat aspect = resolution.x / resolution.y;\n\n\t\t\tvUv = uv;\n\n\t\t\t// camera space\n\t\t\tvec4 start = modelViewMatrix * vec4( instanceStart, 1.0 );\n\t\t\tvec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 );\n\n\t\t\t// special case for perspective projection, and segments that terminate either in, or behind, the camera plane\n\t\t\t// clearly the gpu firmware has a way of addressing this issue when projecting into ndc space\n\t\t\t// but we need to perform ndc-space calculations in the shader, so we must address this issue directly\n\t\t\t// perhaps there is a more elegant solution -- WestLangley\n\n\t\t\tbool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column\n\n\t\t\tif ( perspective ) {\n\n\t\t\t\tif ( start.z < 0.0 && end.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( start, end );\n\n\t\t\t\t} else if ( end.z < 0.0 && start.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( end, start );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// clip space\n\t\t\tvec4 clipStart = projectionMatrix * start;\n\t\t\tvec4 clipEnd = projectionMatrix * end;\n\n\t\t\t// ndc space\n\t\t\tvec2 ndcStart = clipStart.xy / clipStart.w;\n\t\t\tvec2 ndcEnd = clipEnd.xy / clipEnd.w;\n\n\t\t\t// direction\n\t\t\tvec2 dir = ndcEnd - ndcStart;\n\n\t\t\t// account for clip-space aspect ratio\n\t\t\tdir.x *= aspect;\n\t\t\tdir = normalize( dir );\n\n\t\t\t// perpendicular to dir\n\t\t\tvec2 offset = vec2( dir.y, - dir.x );\n\n\t\t\t// undo aspect ratio adjustment\n\t\t\tdir.x /= aspect;\n\t\t\toffset.x /= aspect;\n\n\t\t\t// sign flip\n\t\t\tif ( position.x < 0.0 ) offset *= - 1.0;\n\n\t\t\t// endcaps\n\t\t\tif ( position.y < 0.0 ) {\n\n\t\t\t\toffset += - dir;\n\n\t\t\t} else if ( position.y > 1.0 ) {\n\n\t\t\t\toffset += dir;\n\n\t\t\t}\n\n\t\t\t// adjust for linewidth\n\t\t\toffset *= linewidth;\n\n\t\t\t// adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ...\n\t\t\toffset /= resolution.y;\n\n\t\t\t// select end\n\t\t\tvec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd;\n\n\t\t\t// back to clip space\n\t\t\toffset *= clip.w;\n\n\t\t\tclip.xy += offset;\n\n\t\t\tgl_Position = clip;\n\n\t\t\tvec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation\n\n\t\t\t#include <logdepthbuf_vertex>\n\t\t\t#include <clipping_planes_vertex>\n\t\t\t#include <fog_vertex>\n\n\t\t}\n\t\t",fragmentShader:"\n\t\tuniform vec3 diffuse;\n\t\tuniform float opacity;\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashSize;\n\t\t\tuniform float gapSize;\n\n\t\t#endif\n\n\t\tvarying float vLineDistance;\n\n\t\t#include <common>\n\t\t#include <color_pars_fragment>\n\t\t#include <fog_pars_fragment>\n\t\t#include <logdepthbuf_pars_fragment>\n\t\t#include <clipping_planes_pars_fragment>\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\t#include <clipping_planes_fragment>\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tif ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps\n\n\t\t\t\tif ( mod( vLineDistance, dashSize + gapSize ) > dashSize ) discard; // todo - FIX\n\n\t\t\t#endif\n\n\t\t\tif ( abs( vUv.y ) > 1.0 ) {\n\n\t\t\t\tfloat a = vUv.x;\n\t\t\t\tfloat b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;\n\t\t\t\tfloat len2 = a * a + b * b;\n\n\t\t\t\tif ( len2 > 1.0 ) discard;\n\n\t\t\t}\n\n\t\t\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\t\t\t#include <logdepthbuf_fragment>\n\t\t\t#include <color_fragment>\n\n\t\t\tgl_FragColor = vec4( diffuseColor.rgb, diffuseColor.a );\n\n\t\t\t#include <tonemapping_fragment>\n\t\t\t#include <fog_fragment>\n\t\t\t#include <premultiplied_alpha_fragment>\n\n\t\t}\n\t\t"},Pa=function(e){function t(t){var i=e.call(this,{uniforms:n.UniformsUtils.clone(Ta.uniforms),vertexShader:Ta.vertexShader,fragmentShader:Ta.fragmentShader,clipping:!0})||this;return i.type="LineMaterial",i.dashed=!1,Object.defineProperties(i,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(e){this.uniforms.diffuse.value=e}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(e){this.uniforms.linewidth.value=e}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(e){this.uniforms.dashScale.value=e}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(e){this.uniforms.dashSize.value=e}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(e){this.uniforms.gapSize.value=e}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(e){this.uniforms.opacity.value=e}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(e){this.uniforms.resolution.value.copy(e)}}}),i.setValues(t),i}return te(t,e),t}(n.ShaderMaterial);Object.assign(Pa.prototype,{isLineMaterial:!0});var Ra=function(e){function t(t,i){var n=e.call(this)||this;return n.type="LineSegments2",n.geometry=void 0!==t?t:new Ba,n.material=void 0!==i?i:new Pa({color:16777215*Math.random()}),n}return te(t,e),t.prototype.computeLineDistances=function(){for(var e=this.geometry,t=e.attributes.instanceStart,i=e.attributes.instanceEnd,r=new Float32Array(2*t.count),o=new n.Vector3,a=new n.Vector3,s=0,l=0,c=t.count;s<c;s++,l+=2)o.fromBufferAttribute(t,s),a.fromBufferAttribute(i,s),r[l]=0===l?0:r[l-1],r[l+1]=r[l]+o.distanceTo(a);var u=new n.InstancedInterleavedBuffer(r,2,1);return e.setAttribute("instanceDistanceStart",new n.InterleavedBufferAttribute(u,1,0)),e.setAttribute("instanceDistanceEnd",new n.InterleavedBufferAttribute(u,1,1)),this},t.prototype.raycast=function(e,t){null===e.camera&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2.');var i=e.ray,r=e.camera,o=r.projectionMatrix,a=this.geometry,s=this.material,l=s.resolution,c=s.linewidth,u=a.attributes.instanceStart,h=a.attributes.instanceEnd,d=new n.Vector4,p=new n.Vector4,f=new n.Vector4,A=new n.Vector3,v=new n.Matrix4,m=new n.Line3,g=new n.Vector3;i.at(1,f),f.w=1,f.applyMatrix4(r.matrixWorldInverse),f.applyMatrix4(o),f.multiplyScalar(1/f.w),f.x*=l.x/2,f.y*=l.y/2,f.z=0,A.copy(f);var y=this.matrixWorld;v.multiplyMatrices(r.matrixWorldInverse,y);for(var b=0,x=u.count;b<x;b++){d.fromBufferAttribute(u,b),p.fromBufferAttribute(h,b),d.w=1,p.w=1,d.applyMatrix4(v),p.applyMatrix4(v),d.applyMatrix4(o),p.applyMatrix4(o),d.multiplyScalar(1/d.w),p.multiplyScalar(1/p.w);var w=d.z<-1&&p.z<-1,M=d.z>1&&p.z>1;if(!w&&!M){d.x*=l.x/2,d.y*=l.y/2,p.x*=l.x/2,p.y*=l.y/2,m.start.copy(d),m.start.z=0,m.end.copy(p),m.end.z=0;var C=m.closestPointToPointParameter(A,!0);m.at(C,g);var E=n.MathUtils.lerp(d.z,p.z,C),I=E>=-1&&E<=1,S=A.distanceTo(g)<.5*c;if(I&&S){m.start.fromBufferAttribute(u,b),m.end.fromBufferAttribute(h,b),m.start.applyMatrix4(y),m.end.applyMatrix4(y);var B=new n.Vector3,T=new n.Vector3;i.distanceSqToSegment(m.start,m.end,T,B),t.push({point:T,pointOnLine:B,distance:i.origin.distanceTo(T),object:this,faceIndex:b})}}}},t}(n.Mesh);Object.assign(Ra.prototype,{isLineSegments2:!0});var ka=function(e){function t(t,i){var n=e.call(this,t,i)||this;return n.type="Line2",n}return te(t,e),t}(Ra);Object.assign(ka.prototype,{isLine2:!0});var Qa=function(e){function t(){var t=e.call(this)||this;return t.type="LineGeometry",t}return te(t,e),t.prototype.setPositions=function(t){for(var i=t.length-3,n=new Float32Array(2*i),r=0;r<i;r+=3)n[2*r]=t[r],n[2*r+1]=t[r+1],n[2*r+2]=t[r+2],n[2*r+3]=t[r+3],n[2*r+4]=t[r+4],n[2*r+5]=t[r+5];return e.prototype.setPositions.call(this,n),this},t.prototype.setColors=function(t){for(var i=t.length-3,n=new Float32Array(2*i),r=0;r<i;r+=3)n[2*r]=t[r],n[2*r+1]=t[r+1],n[2*r+2]=t[r+2],n[2*r+3]=t[r+3],n[2*r+4]=t[r+4],n[2*r+5]=t[r+5];return e.prototype.setColors.call(this,n),this},t.prototype.fromLine=function(e){var t=e.geometry;if(t instanceof n.Geometry){var i=(new n.BufferGeometry).fromGeometry(t);this.setPositions(i.attributes.position.array)}else t instanceof n.BufferGeometry&&this.setPositions(t.attributes.position.array);return this},t.prototype.copy=function(){return this},t}(Ba);Object.assign(Qa.prototype,{isLineGeometry:!0});var Da=null,Fa=function(e){function t(t,i){void 0===t&&(t=new n.Vector3),void 0===i&&(i=new n.Vector3);var r=e.call(this)||this;r.type="FiveLine",r.needsRender=!0;var o=new Qa,a=new Pa({color:14467195,linewidth:2,dashScale:20,dashed:!1});r.line=new ka(o,a);var s=new n.BufferGeometry,l=new n.PointsMaterial({color:14467195,size:8,map:Da||(Da=(new n.TextureLoader).load("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sHDgwCEMBJZu0AAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAABM5JREFUWMO1V0tPG2cUPZ4Hxh6DazIOrjFNqJs0FIMqWFgWQkatsmvVbtggKlSVRVf5AWz4AWz4AUSKEChll19QJYSXkECuhFxsHjEhxCYm+DWGMZ5HF72DJq4bAzFXurI0M/I5997v3u9cC65vTJVn2lX/xHINQOYSBLTLEuIuCWw4Z3IGAEvf6ASmVHjNzHCXBG4A0AjACsAOwEbO0nsFQBnAGYASAIl+ZRMR7SolMEdsByD09fV5R0ZGgg8ePPjW5/N1iqLYpuu6RZblciKR2I9Go69evnwZnZ+fjwI4IS8AKBIRzeQfJWCANwKwh0KhtrGxsYehUOin1tbW+zzP23ietzY2NnIAoGmaLsuyUiqVyvl8XtrY2NiamZn589mzZxsAUgCOAeQAnFI2tI+VxIjaAeDzoaGh7xYWFuZOTk6OZVk+12uYqqq6JEnn0Wg0OT4+/geAXwGEAdwDIFJQXC1wO4DWR48e/RCPxxclSSroVzRFUbSDg4P848ePFwH8DuAhkWih83TRQWxFOXgAwvDwcOfo6OhvXV1d39tsNtuVBwTDWBwOh1UUxVsMw1hXVlbS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Attenuation:!1,transparent:!0});return r.points=new n.Points(s,l),r.points.renderOrder=11,r.points.frustumCulled=!1,r.setPoints(t,i),r.add(r.line,r.points),r}return te(t,e),Object.defineProperty(t,"version",{get:function(){return"5.0.0-alpha.182"},enumerable:!1,configurable:!0}),t.prototype.setPoints=function(e,t){var i=[].concat(e.toArray(),t.toArray());this.points.geometry.setAttribute("position",new n.BufferAttribute(new Float32Array(i),3)),this.line.geometry.setPositions(i),this.line.computeLineDistances(),this.needsRender=!0},t.prototype.getPoints=function(){var e=this.points.geometry.attributes.position.array;return[new n.Vector3(e[0],e[1],e[2]),new n.Vector3(e[3],e[4],e[5])]},t.prototype.setMaterial=function(e){var t=this.line.material;for(var i in e)if(e.hasOwnProperty(i)){var n=e[i];"dashed"===i?(t.dashed=n,n?t.defines.USE_DASH="":delete t.defines.USE_DASH,t.needsUpdate=!0):t[i]=e[i]}this.needsRender=!0},t.prototype.setResolution=function(e,t){var i=this.line.material.resolution;i.x===e&&i.y===t||(i.set(e,t),this.needsRender=!0)},t}(n.Object3D);Object.assign(Fa.prototype,{isFiveLine:!0});var La=(new n.Matrix4).makeRotationAxis(new n.Vector3(0,1,0),Math.PI),Oa=new n.Vector3(-1,1,1),Na=function(e){function t(t){var i=e.call(this,t)||this;i.xrManager=new Ia(i.renderer,i.renderer.getContext()),i.xrControllerRay=new n.Raycaster,i.pointerLine=new Fa,i.scene.add(i.pointerLine),i.pointerLine.line.material.depthTest=!1,i.pointerLine.points.material instanceof Array?i.pointerLine.points.material.forEach((function(e){e.depthTest=!1})):i.pointerLine.points.material.depthTest=!1,i.pointerLine.setMaterial({color:new n.Vector3(1,1,1)}),i.panoResources={},i.panoResources[i.locationMotion.keyframes[0].key=i.locationMotion.keyframes[1].key=In()]={panoIndex:i.currentPanoIndex,workCode:i.work.workCode,leftPanoPicture:null,position:i.camera.pose.offset.clone(),effect:"fade"},i.parallaxCameraMatrixs=[];var r=ke.shared.getContext();if(!r)return console.error("获取session失败,请退出重试"),i;i.xrManager.setSession(r),i.on("webXRSelected",(function(e){"Select"===e&&i.checkSelectedPano()}));for(var o=function(e){a.xrManager.on(e,(function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];i.emit.apply(i,ne([e],t,!1))}))},a=this,s=0,l=Sa;s<l.length;s++){o(l[s])}return i.xrControllerState={axes:[{left:{isTap:!1,startTime:0},right:{isTap:!1,startTime:0}},{up:{isTap:!1,startTime:0},down:{isTap:!1,startTime:0}},{left:{isTap:!1,startTime:0},right:{isTap:!1,startTime:0}},{up:{isTap:!1,startTime:0},down:{isTap:!1,startTime:0}}],select:{startTime:0,istap:!1},squeeze:{startTime:0,istap:!1},leftButtonA:{startTime:0,istap:!1},leftButtonB:{startTime:0,istap:!1},rightButtonA:{startTime:0,istap:!1},rightButtonB:{startTime:0,istap:!1}},i}return te(t,e),t.parseArgs=function(t){var i=ie(ie({},t),{maxLatitude:Math.PI/2,minLatitude:-Math.PI/2});return e.parseArgs.call(this,i)},t.initAnimationEndPose=function(t){var i=this.parseArgs(t);return e.initAnimationEndPose.call(this,i)},t.prototype.moveToPano=function(e,t,i){var r,o,a,s,l=this,c=this.work.observers[e],u=this.imageOptions.size;if(void 0===u&&c){var h=c.images.up.match(/\/cube_(\d+)\//);h&&(u=Number(h[1]))}void 0===u&&(u=2048);var d=this.imageOptions.transform,p=function(e,t){return function(e,t){if(!t)return e;var i=e.match(/\d+_[a-z].png/);return e.substring(0,i.index)+t+"/"+e.substring(i.index)}(Oe(e,d,t))},f=ie({key:"pano.".concat(e)},ci(this.imageOptions,["format","size","quality"])),A=c.images,v=null!==(o=null===(r=c.images.tiles)||void 0===r?void 0:r.filter((function(e){return e.size>u})))&&void 0!==o?o:null,m="pano:"+so([A,f,d]);if(this.pendingTextureTask){if(this.pendingTextureTask.hash===m)return;var g=this.pendingTextureTask.panoIndex;null===(a=this.panoMeshes[g])||void 0===a||a.setProgress(0),this.emit("textureAbort",g,c),this.pendingTextureTask.onError(new Error("texture aborted"))}var y,b=this.model.getMaterial()||{},x=b.pano0,w=b.pano1;if((null==x?void 0:x.map.name)===m?y=x:(null==w?void 0:w.map.name)===m&&(y=w),y){var M={panoIndex:e,workCode:this.work.workCode,effect:null!==(s=t.effect)&&void 0!==s?s:"fade",leftPanoPicture:{map:y.map,luminanceMap:y.luminanceMap,matrix:(new n.Matrix4).compose(c.position,c.quaternion,Oa)},position:c.position.clone()};this.doMoveToPano(e,M,t,i)}else this.pending=!0,this.pendingTextureTask={panoIndex:e,hash:m,onLoad:function(r){var o;if(l.pending=!1,l.destroyed)r.body.dispose();else{r.body.name=m;var a={panoIndex:e,workCode:l.work.workCode,effect:null!==(o=t.effect)&&void 0!==o?o:"fade",leftPanoPicture:{map:r.body,luminanceMap:null,matrix:(new n.Matrix4).compose(c.position,c.quaternion,Oa)},position:c.position.clone()};l.doMoveToPano(e,a,t,i)}},onError:function(i){l.pending=!1,t.moveCancelCallback&&t.moveCancelCallback(),l.emit("panoLoadError",i,e),l.emit("moveToPanoCanceled",e)}},Promise.all([this.tileLevelForFov&&v&&v.length?this.textureLoader.loadTiledCubeTexture(A,v,{tileMaxLevel:this.TILED_CUBE_TEXTURE_LEVEL,imageURL:{transform:p,options:f},format:n.RGBAFormat,viaAjax:!0},void 0,void 0,(function(t){var i,n;l.emit("textureLoading",t,e,c),(null===(i=l.pendingTextureTask)||void 0===i?void 0:i.hash)===m&&(null===(n=l.panoMeshes[e])||void 0===n||n.setProgress(t))}),this.renderer):this.textureLoader.loadCubeTexture(A,{imageURL:{transform:p,options:f},format:n.RGBAFormat},void 0,void 0,(function(t){var i,n;(null===(i=l.pendingTextureTask)||void 0===i?void 0:i.hash)===m&&(null===(n=l.panoMeshes[e])||void 0===n||n.setProgress(t)),l.emit("textureLoading",t,e,c)}),this.renderer)]).then((function(t){var i,n,r=t[0];(null===(i=l.pendingTextureTask)||void 0===i?void 0:i.hash)===m?(l.pendingTextureTask.onLoad(r),null===(n=l.panoMeshes[e])||void 0===n||n.setProgress(0),delete l.pendingTextureTask,l.emit("textureLoaded",e,c,r.meta)):r.body.dispose()})).catch((function(t){var i,n;(null===(i=l.pendingTextureTask)||void 0===i?void 0:i.hash)===m&&(l.pendingTextureTask.onError(t),null===(n=l.panoMeshes[e])||void 0===n||n.setProgress(0),delete l.pendingTextureTask,l.emit("textureError",t,e,c),l.emit("error",t))})),this.emit("textureStartLoad",e,c)},t.prototype.doMoveToPano=function(e,t,i,r){var o,a,s,l=this;void 0===i&&(i={}),this.userAction=r;var c=ue(),u=In();this.panoResources[u]=t;var h,d,p;if(this.locationMotion.ended){var f=this.locationMotion.getKeyFrameSegment(c);f[0];var A=f[1],v=this.locationMotion.value,m=this.panoResourceFromLocationMotionKeyframe(A).position,g=t.position;h=Math.max(m.distanceTo(g),1),d=[{key:A.key,progress:0,value:ie(ie({},v),{count:0})},{key:u,progress:1,value:{distance:0,perspToOrtho:0,orthoDistance:1,modelAlpha:0,count:1}}],p=0}else{var y=this.locationMotion.getKeyFrameSegment(c),b=y[0],x=(A=y[1],v=this.locationMotion.value,this.panoResourceFromLocationMotionKeyframe(b).position),w=(m=this.panoResourceFromLocationMotionKeyframe(A).position,g=t.position,A.value.count-v.count),M=Math.max(x.distanceTo(m),1)*w;h=M+Math.max(m.distanceTo(g),1),d=[{key:b.key,progress:0,value:ie({},v)},{key:A.key,progress:M/h,value:A.value},{key:u,progress:1,value:{count:A.value.count+1,distance:0,perspToOrtho:0,orthoDistance:1,modelAlpha:0}}];var C=this.locationMotionKeyframesLength(this.locationMotion.keyframes),E=this.locationMotionKeyframesLength(d);p=this.locationMotion.getProgressVelocity(c)*C/E}var I=this.calculateMovingDuration(i.duration,h),S={longitude:i.longitude,latitude:i.latitude,fov:i.fov},B={longitude:null!==(o=S.longitude)&&void 0!==o?o:this.camera.pose.longitude,latitude:null!==(a=S.latitude)&&void 0!==a?a:this.camera.pose.latitude,fov:null!==(s=S.fov)&&void 0!==s?s:this.camera.pose.fov,offset:t.position.clone(),distance:0};this.emit("moveToPano",e,this.userAction),i.moveStartCallback&&i.moveStartCallback(e,B),this.emit("panoWillArrive",e,B,this.userAction),this.videoTexture&&this.videoTexture.image instanceof HTMLVideoElement&&this.videoTexture.image.getAttribute("src")&&(this.videoTexture.image.pause(),this.videoTexture.image.removeAttribute("uuid"),this.videoTexture.image.removeAttribute("src"),this.videoTexture.image.oncanplay=le,this.videoTexture.needsUpdate=!0),this.panoVideo.setMaterial(null),this.cameraMotion.set(S,I).catch(le),this.locationMotion.setKeyframes(d,I,p).then((function(){var t,o,a,s={longitude:l.camera.pose.longitude,latitude:l.camera.pose.latitude,fov:l.camera.pose.fov,offset:l.camera.pose.offset.clone(),distance:0};i.moveEndCallback&&i.moveEndCallback(e,s),l.emit("panoArrived",e,s,r);var c=l.work.observers[l.currentPanoIndex];if(c&&c.video&&l.videoTexture&&l.videoTexture.image instanceof HTMLVideoElement){var u=La.clone().multiply(null!==(a=null===(o=null===(t=l.model.getMaterial())||void 0===t?void 0:t.pano1)||void 0===o?void 0:o.matrix)&&void 0!==a?a:new n.Matrix4).multiply(c.video.matrix),h={map:l.videoTexture,size:c.video.size,matrix:u,alpha:1},d=In(),p=l.videoTexture.image;p.setAttribute("uuid",d),uo().then((function(e){e&&c.video&&p.getAttribute("uuid")===d&&(p.oncanplay=function(){p.oncanplay=le,p.play()},p.ontimeupdate=function(){p.currentTime>.5&&(p.ontimeupdate=le,l.panoVideo.setMaterial(h))},p.src=c.video.source)})).catch((function(){p.removeAttribute("uuid")}))}}),(function(){i.moveCancelCallback&&i.moveCancelCallback(),l.emit("moveToPanoCanceled",e)}))},t.prototype.checkSelectedPano=function(){var e=this,t=this.xrControllerRay;this.interiaMovement=!1;var i=this.camera.getDirection(new n.Vector3).setY(0),r=null,o=this.work.observers[this.currentPanoIndex];if(!o)return r;var a=o.accessibleNodes.filter((function(t){if(t===e.currentPanoIndex)return!1;var i=e.work.observers[t];return!(i.position.distanceTo(e.camera.position)>e.maxAccessibleDistance)&&(i.loadable||i.active)})),s=this.model.intersectRaycaster(t)[0];if(s){var l=Vr(a,(function(t){return e.work.observers[t].standingPosition.clone().distanceTo(s.point)}),!0),c=l[0];l[1]<this.panoTapTriggerRadius&&(r=c)}Un(r)&&(r=this.getForwardPanoIndexOrNot(t));for(var u=0,h=this.locationMotion.keyframes;u<h.length;u++){var d=h[u],p=this.panoResourceFromLocationMotionKeyframe(d);if(!(d.progress<this.locationMotion.progress)&&p.panoIndex===r){r=null;break}}if(this.emit("panoSelected",r),Un(r))return!0===this.locationMotion.ended&&this.cameraBounce(),r;var f=this.work.observers[r];if(!f.active)return this.panoMeshes[r]&&(this.panoMeshes[r].setDisabled(!1),this.panoMeshes[r].setLoading(!0)),r;for(var A={effect:"fade"},v=Math.PI/6,m=Math.PI/12,g=new n.Vector3(0,1,0),y=f.position.clone().setY(0).sub(o.position.clone().setY(0)).normalize(),b=y.clone().applyAxisAngle(g,v),x=y.clone().applyAxisAngle(g,-v),w=[],M=[],C=[],E=0,I=f.accessibleNodes;E<I.length;E++){if((c=I[E])!==this.currentPanoIndex&&c!==r){var S=this.work.observers[c].position.clone().sub(f.position).setY(0);y.angleTo(S)<v?C.push(S):b.angleTo(S)<v?w.push(S):x.angleTo(S)<v&&M.push(S)}}var B=(C.length>0?C:ne(ne([],w,!0),M,!0)).slice().sort((function(e,t){return e.angleTo(y)-t.angleTo(y)}))[0];return B&&B.angleTo(i)>m&&(A.longitude=Math.atan2(-B.x,-B.z)),this.cameraMotion.value.latitude<-Math.PI/4&&(A.latitude=Kn(0,this.minLatitude,this.maxLatitude)),this.cameraMotion.value.fov<60&&(A.fov=this.defaultFov),this.emit("wantsMoveToPano",r,A,!0),r},t.prototype.destroy=function(){e.prototype.destroy.call(this)},t.prototype.isReady=function(){return!1},t.prototype.updateTime=function(e,t){for(var i,r,o,a,s,l,c,u=this,h=[],d=2;d<arguments.length;d++)h[d-2]=arguments[d];var p=this.currentPanoIndex,f={},A={},v=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[0]),m=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),g=!1;if(!1===this.locationMotion.ended){this.locationMotion.update(e);var y=this.locationMotion.getKeyFrameSegment(e),b=y[0],x=y[1],w=this.panoResourceFromLocationMotionKeyframe(b),M=this.panoResourceFromLocationMotionKeyframe(x),C=(new n.Vector3).copy(w.position),E=(new n.Vector3).copy(M.position),I=this.locationMotion.value.count-x.value.count+1;f.progress=I,f.modelAlpha=this.locationMotion.value.modelAlpha,this.camera.perspToOrtho.setScalar(Kn(this.locationMotion.value.perspToOrtho,0,1)),this.camera.orthoDistance=this.locationMotion.value.orthoDistance,M.leftPanoPicture&&(I<1?w.leftPanoPicture&&(f.pano0=w.leftPanoPicture):f.pano0=M.leftPanoPicture,f.pano1=M.leftPanoPicture),g=f.useBlackTransition="instant"===M.effect||"montage"===M.effect,"fade"!==M.effect&&"montage"!==M.effect||(f.pano0&&w.leftPanoPicture&&(f.pano0={map:f.pano0.map,luminanceMap:f.pano0.luminanceMap,matrix:w.leftPanoPicture.matrix.clone().setPosition(M.position)}),C.copy(E)),A.distance=this.locationMotion.value.distance,A.offset=new n.Vector3(C.x+(E.x-C.x)*I,C.y+(E.y-C.y)*I,C.z+(E.z-C.z)*I);for(var S=[],B=[],T=0,P=this.locationMotion.keyframes;T<P.length;T++){var R=P[T],k=R.key,Q=R.progress;void 0!==k&&(S.push(k),Q>=this.locationMotion.progress&&B.push(k))}for(var D=0,F=Object.keys(this.panoResources);D<F.length;D++){var L=F[D];if(!(B.indexOf(L)>=0)){var O=this.panoResources[L];if(O.leftPanoPicture){var N=O.leftPanoPicture.map;if(N){if(N===(null===(i=f.pano0)||void 0===i?void 0:i.map))continue;if(N===(null===(r=f.pano1)||void 0===r?void 0:r.map))continue;N instanceof Ct&&N.cubeRenderTarget&&this.colorCubeRenderTargetPool.push(N.cubeRenderTarget),N.dispose(),O.leftPanoPicture=null}}S.indexOf(L)>=0||delete this.panoResources[L]}}w.workCode===M.workCode?this.currentPanoIndex=I<.5?w.panoIndex:M.panoIndex:this.currentPanoIndex=M.panoIndex,this.emit("movingToPano",m.panoIndex,v.panoIndex,this.locationMotion.progress)}!1===this.cameraMotion.ended&&(this.cameraMotion.update(e),A.longitude=this.cameraMotion.value.longitude,A.latitude=this.cameraMotion.value.latitude,A.fov=this.cameraMotion.value.fov),!1===Ur(f)&&((null===(o=f.pano0)||void 0===o?void 0:o.map)&&f.pano0.map instanceof Ct&&!f.pano0.map.cubeRenderTarget&&(f.pano0.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),(null===(a=f.pano1)||void 0===a?void 0:a.map)&&f.pano1.map instanceof Ct&&!f.pano1.map.cubeRenderTarget&&(f.pano1.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),this.model.setMaterial(f)),!1===Ur(A)&&this.setCamera(A);var V=h[1];if(V)if(this.xrManager.session){var U=this.xrManager.referenceSpace;if(U){var z=this.xrManager.cameraVR,q=this.xrManager.cameraL,H=this.xrManager.cameraR,_=[q,H],K=V.getViewerPose(U),j=new n.Vector3(0,0,0);if(K){var G=void 0;switch(this.xrManager.machineType){case"Pico":G=this.xrManager.session.renderState.baseLayer;break;case"Oculus":var W=this.xrManager.session.renderState.layers;W&&(G=W[0]);break;default:this.xrManager.machineType}var X=K.views;if(!G)return void console.error("no layer found");this.renderer.setFramebuffer(G.framebuffer);var Y=!1;X.length!==z.cameras.length&&(z.cameras.length=0,Y=!0),this.parallaxCameraMatrixs=[];var Z=new n.Vector3,J=new n.Vector3;(new n.Matrix4).fromArray(X[0].transform.matrix).decompose(Z,new n.Quaternion,new n.Vector3),(new n.Matrix4).fromArray(X[1].transform.matrix).decompose(J,new n.Quaternion,new n.Vector3),J.clone().sub(Z).normalize();var $=new n.Vector3,ee=new n.Quaternion,te=new n.Vector3;this.camera.matrix.decompose($,ee,te);for(var ie=0;ie<X.length;ie++){var ne=X[ie],re=G.getViewport(ne),oe=_[ie];oe.matrix.fromArray(ne.transform.matrix);var ae=new n.Vector3,se=new n.Quaternion,le=new n.Vector3;oe.matrix.decompose(ae,se,le),j.copy($),oe.position.copy($),oe.quaternion.copy(se),oe.scale.copy(le),oe.updateMatrix(),oe.projectionMatrix.fromArray(ne.projectionMatrix),oe.viewport.set(re.x,re.y,re.width,re.height),!0===Y&&z.cameras.push(oe)}}var ce=this.xrManager.session.inputSources;for(ie=0;ie<this.xrManager.controllers.length;ie++){var ue=this.xrManager.controllers[ie],he=ce[ie];ue.update(he,V,U)}var de=this.xrManager.getController(0),pe=de.position.clone().add(j).sub(new n.Vector3(0,1.35,0));this.xrControllerRay.set(pe,new n.Vector3(0,0,-1).applyEuler(de.rotation));var fe=this.model.intersectRaycaster(this.xrControllerRay);if(0===fe.length&&(fe=this.xrControllerRay.intersectObject(this.boundingMesh,!0)),fe.length>=1&&fe[0].face){this.pointerLine.setPoints(pe,fe[0].point);var Ae=fe[0].face.normal,ve=Ae.clone().multiplyScalar(.05),me=fe[0].point.clone().add(ve);this.intersectMesh.position.copy(me);var ge=me.clone().add(ve);if(this.intersectMesh.lookAt(ge),Math.abs(Ae.y)>.99){var ye=this.camera.position.clone().sub(me);this.intersectMesh.rotation.z=-Math.atan2(ye.z,ye.x)}this.intersectMesh.visible=!0,this.needsRender=!0,this.emit("intersectionOnModelUpdate",fe[0],this.intersectMesh)}if(this.currentPanoIndex!==p&&this.updatePanoMeshesVisible(),this.camera.pose.distance>.1||g){var be=this.work.observers[this.currentPanoIndex];if(be)for(var xe=0,we=Se=be.visibleNodes.concat(this.currentPanoIndex);xe<we.length;xe++){var Me=we[xe];(ke=this.panoMeshes[Me])&&ke.setOpacity(0)}}else{var Ce=this.work.observers[this.currentPanoIndex];if(Ce){var Ee=Vr(Ce.visibleNodes,(function(e){return Ce.standingPosition.distanceTo(u.work.observers[e].standingPosition)}),!0),Ie=Ee[1];Ie=Kn(Ie,2.5,1/0);for(var Se=Ce.visibleNodes.concat(this.currentPanoIndex),Be=this.getForwardPanoIndexOrNot(),Te=this.camera.getDirection(new n.Vector3),Pe=0,Re=Se;Pe<Re.length;Pe++){Me=Re[Pe];var ke,Qe=this.work.observers[Me];if(ke=this.panoMeshes[Me])if(Qe.loadable||Qe.active){var De=ke.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);ke.setCurrent(!ke.loading&&0===ke.progress&&Be===Me),ke.setOpacity(De<.01?0:Kn(Ie/De*1.2,.65,.98));var Fe=this.camera.position.clone().setY(ke.position.y),Le=(new n.Vector3).copy(ke.position).sub(Fe).normalize();if(Me===this.currentPanoIndex){var Oe=Kn((.5-Fe.distanceTo(ke.position))/.5,0,1);Le.multiplyScalar(1-Oe).add(Te.clone().multiplyScalar(Oe))}Le.length()>0&&ke.quaternion.setFromEuler(new n.Euler(0,Math.atan2(Le.x,Le.z),0)),ke.updateTime&&ke.updateTime(e,t)}else ke.setOpacity(0)}}}var Ne,Ve=function(){if(!1===u.tileLevelForFov)return 0;var e=new n.Vector2(4e3,4e3),t=m.panoIndex,i=u.work.observers[t],r=u.imageOptions.size;if(void 0===r&&i){var o=i.images.up.match(/\/cube_(\d+)\//);o&&(r=Number(o[1]))}void 0===r&&(r=2048);var a=0;r>=1024&&(a=1),r>=2048&&(a=2),r>=4096&&(a=3),r>=8192&&(a=4);var s=u.tileLevelForFov(q.fov,e);return s>a?s:0}(),Ue=((Ne=new n.PerspectiveCamera).applyMatrix4(z.matrix),Ne.position.set(0,0,0),Ne.quaternion.premultiply(u.work.observers[m.panoIndex].quaternion.clone().inverse()),Ne.updateProjectionMatrix(),Ne.updateMatrixWorld(!0),(new n.Frustum).setFromProjectionMatrix((new n.Matrix4).multiplyMatrices(Ne.projectionMatrix,Ne.matrixWorldInverse)));m.panoIndex===this.currentPanoIndex&&(null===(s=m.leftPanoPicture)||void 0===s?void 0:s.map)instanceof Ct&&(m.leftPanoPicture.map.update(Ue,Ve),!0===m.leftPanoPicture.map.needsRender&&(this.needsRender=!0));var ze=this.tiling.object.visible;if(Ve>this.TILED_CUBE_TEXTURE_LEVEL&&this.initAnimationed){var qe=m.panoIndex,He=this.work.observers[qe];He&&Er(this.camera.position,He.position)&&this.locationMotion.ended?(this.tiling.object.visible=!0,this.tiling.panoIndex!==qe&&this.tiling.cleanup(),this.tiling.panoIndex=qe,this.tiling.setResource(null!==(c=null===(l=He.images)||void 0===l?void 0:l.tiles)&&void 0!==c?c:[],this.enableIOSEDR&&He.images.luminance?He.images.luminance:null),this.tiling.setRotation(He.quaternion),this.tiling.setPosition(He.position),this.tiling.update(Ue,Ve,e)):this.tiling.object.visible=!1}else this.tiling.object.visible=!1;ze!==this.tiling.object.visible&&(this.tiling.object.needsRender=!0),this.panoVideo.object.position.copy(this.camera.position),this.panoVideo.updateTime(e);var _e=ce[0].gamepad;if((null==_e?void 0:_e.axes)&&this.emit("webXRSelected","Axes",{axes:_e.axes}),-1===(null==_e?void 0:_e.axes[2])){if(!this.xrControllerState.axes[2].left.isTap){var Ke=e-this.xrControllerState.axes[2].left.startTime;Ke>=300&&this.emit("webXRSelected","RightAxesLeftTap"),this.xrControllerState.axes[2].left.isTap=!0}}else this.xrControllerState.axes[2].left.isTap=!1,this.xrControllerState.axes[2].left.startTime=0;if(1===(null==_e?void 0:_e.axes[2])){if(!this.xrControllerState.axes[2].right.isTap){var je=e-this.xrControllerState.axes[2].right.startTime;je>=300&&this.emit("webXRSelected","RightAxesRightTap"),this.xrControllerState.axes[2].right.isTap=!0}}else this.xrControllerState.axes[2].right.isTap=!1,this.xrControllerState.axes[2].right.startTime=0;if(-1===(null==_e?void 0:_e.axes[3])){if(!this.xrControllerState.axes[3].up.isTap){var Ge=e-this.xrControllerState.axes[3].up.startTime;Ge>=300&&this.emit("webXRSelected","RightAxesUpTap"),this.xrControllerState.axes[3].up.isTap=!0}}else this.xrControllerState.axes[3].up.isTap=!1,this.xrControllerState.axes[3].up.startTime=0;if(1===(null==_e?void 0:_e.axes[3])){if(!this.xrControllerState.axes[3].down.isTap){var We=e-this.xrControllerState.axes[3].down.startTime;We>=300&&this.emit("webXRSelected","RightAxesDownTap"),this.xrControllerState.axes[3].down.isTap=!0}}else this.xrControllerState.axes[3].down.isTap=!1,this.xrControllerState.axes[3].down.startTime=0;if(null==_e?void 0:_e.buttons[0].pressed){if(!this.xrControllerState.select.isTap){var Xe=e-this.xrControllerState.select.startTime;Xe>=300&&this.emit("webXRSelected","Select",{raycaster:this.xrControllerRay}),this.xrControllerState.select.isTap=!0}}else this.xrControllerState.select.isTap=!1,this.xrControllerState.select.startTime=0;if(null==_e?void 0:_e.buttons[1].pressed){if(!this.xrControllerState.squeeze.isTap){var Ye=e-this.xrControllerState.squeeze.startTime;Ye>=300&&this.emit("webXRSelected","Squeeze",{raycaster:this.xrControllerRay}),this.xrControllerState.squeeze.isTap=!0}}else this.xrControllerState.squeeze.isTap=!1,this.xrControllerState.squeeze.startTime=0;if(null==_e?void 0:_e.buttons[2].pressed){if(!this.xrControllerState.leftButtonA.isTap){var Ze=e-this.xrControllerState.leftButtonA.startTime;Ze>=300&&this.emit("webXRSelected","LeftButtonA",{raycaster:this.xrControllerRay}),this.xrControllerState.leftButtonA.isTap=!0}}else this.xrControllerState.leftButtonA.isTap=!1,this.xrControllerState.leftButtonA.startTime=0;if(null==_e?void 0:_e.buttons[3].pressed){if(!this.xrControllerState.leftButtonB.isTap){var Je=e-this.xrControllerState.leftButtonB.startTime;Je>=300&&this.emit("webXRSelected","LeftButtonB",{raycaster:this.xrControllerRay}),this.xrControllerState.leftButtonB.isTap=!0}}else this.xrControllerState.leftButtonB.isTap=!1,this.xrControllerState.leftButtonB.startTime=0;if(null==_e?void 0:_e.buttons[4].pressed){if(!this.xrControllerState.rightButtonA.isTap){var $e=e-this.xrControllerState.rightButtonA.startTime;$e>=300&&this.emit("webXRSelected","RightButtonA",{raycaster:this.xrControllerRay}),this.xrControllerState.rightButtonA.isTap=!0}}else this.xrControllerState.rightButtonA.isTap=!1,this.xrControllerState.rightButtonA.startTime=0;if(null==_e?void 0:_e.buttons[5].pressed){if(!this.xrControllerState.rightButtonB.isTap){var et=e-this.xrControllerState.rightButtonB.startTime;et>=300&&this.emit("webXRSelected","RightButtonB",{raycaster:this.xrControllerRay}),this.xrControllerState.rightButtonB.isTap=!0}}else this.xrControllerState.rightButtonB.isTap=!1,this.xrControllerState.rightButtonB.startTime=0}}else console.error("session丢失,请重试");else console.error("xrFrame丢失,请重试")},t.prototype.render=function(){var e=this.xrManager.getCamera(this.camera);this.renderer.render(this.scene,e)},t.prototype.onPanGesture=function(){},t.prototype.onTapGesture=function(){},t.prototype.onPinchGesture=function(){},t.prototype.onMouseMove=function(){},t.prototype.onMouseOut=function(){},t.prototype.panoResourceFromLocationMotionKeyframe=function(e){return this.panoResources[e.key]},t}(Do),Va=["Panorama","DepthPanorama","Model"],Ua={Floorplan:$r,Topview:oo,Panorama:Do,VRPanorama:da,Model:pa,DepthPanorama:ba,Mapview:Ma,XRPanorama:Na};function za(e){for(var t=0,i=Va;t<i.length;t++){var n=i[t];if("string"==typeof e){if(n===e)return!0}else if(e instanceof Jr&&e instanceof Ua[n])return!0}return!1}var qa=["cameraDirectionUpdate","cameraUpdate","cameraPositionUpdate","panoSelected","moveToPano","moveToPanoCanceled","panoWillArrive","movingToPano","panoArrived","panoWillLoad","panoLoaded","panoLoadError","initAnimationEnded","initAnimationWillStart","wantsGesture","gesture","wantsTapGesture","tapGesture","wantsPressGesture","pressGesture","wantsPanGesture","wantsInteriaPan","panGesture","interiaPan","wantsPinchGesture","pinchGesture","wantsMouseWheel","mouseWheel","wantsShowIntersectionOnModel","intersectionOnModelUpdate","intersectionHidden","textureStartLoad","textureLoading","textureAbort","textureLoaded","textureError","webXRSessionStart","webXRSessionEnd","webXRSelected"];function Ha(e){for(var t,i,n={},r=0,o=e.split(/(\;|\,)/);r<o.length;r++){var a=o[r].split("="),s=null===(t=a[0])||void 0===t?void 0:t.trim(),l=null===(i=a[1])||void 0===i?void 0:i.trim();s&&l&&(n[s]=l)}return n}function _a(){for(var e,t=document.getElementsByTagName("meta"),i=0;i<t.length;i++){var n=t[i];if("viewport"===n.getAttribute("name")){var r=Ha(null!==(e=n.getAttribute("content"))&&void 0!==e?e:""),o=Number(r["initial-scale"]);if(!isNaN(o))return o}}return 1}var Ka=[351,63],ja=[20,20],Ga=new Float32Array([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),Wa=new Float32Array([0,0,1,0,0,1,1,1]),Xa=new Uint8Array([0,1,2,1,3,2]),Ya=new n.BufferGeometry;Ya.setAttribute("position",new n.BufferAttribute(Ga,3)),Ya.setAttribute("uv",new n.BufferAttribute(Wa,2)),Ya.setIndex(new n.BufferAttribute(Xa,1));var Za=new n.MeshBasicMaterial({transparent:!0,depthTest:!1,depthWrite:!1,stencilWrite:!1,fog:!1}),Ja=new n.Mesh(Ya,Za);Ja.matrixAutoUpdate=!1;var $a=new n.Scene;$a.add(Ja),$a.matrixAutoUpdate=!1;var es=new n.OrthographicCamera(-.5,.5,.5,-.5,.1,1);es.position.set(0,0,.5),es.lookAt(0,0,0),es.updateMatrixWorld(!0),es.matrixAutoUpdate=!1;var ts=new n.Vector4,is=new n.Vector4;function ns(e){if(Za.map){var t=e.getViewport(ts),i=e.getScissor(is),r=e.getScissorTest(),o=e.autoClear,a=i.x+ja[0]/3,s=i.y+ja[1]/3,l=Ka[0]/3,c=Ka[1]/3;e.setViewport(a,s,l,c),e.setScissor(a,s,l,c),e.setScissorTest(!0),e.autoClear=!1,e.render($a,es),e.setViewport(t),e.setScissor(i),e.setScissorTest(r),e.autoClear=o}else{var u=new n.Texture,h=new Image;h.onload=function(){u.image=h,u.wrapS=n.ClampToEdgeWrapping,u.wrapT=n.ClampToEdgeWrapping,u.minFilter=n.LinearFilter,u.needsUpdate=!0,u.generateMipmaps=!1,Za.needsUpdate=!0,h.onload=le},h.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAV8AAAA/CAQAAADtPwPkAAAR+0lEQVR4AezYg3LEQACH8d1cbdu23Q5qG9G47z/TN/h6tn2b/H+TUTLc7yjcOXV46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QM8oB9dhmP3QAwFX4c079dJNq6Qi5xbuyTmpPSJ1Ur4UtF7GoTtmUL3zxaWqMU8P/k3cXSQ1EQRjHGdzdHTa4u7tzBs7CedhykNwF2/5jq56iU11db6Lv2yTj8hs3JoiU9sZZp5/62J5v1z9NjrDHaSbnbFMf52sHrDUVaidDxNG0o9+uLjfosfdb3jT5d5j757riJgst9NIZQ2Pn+ySZll80vjI6Wz/hQJG4vPG0L/H6poQch/dW3vL3B0u8jl0HvVj5PvHCElEF8DUAFikVYTcvmfBdDzQlvvMXSV5lP5zrXj/fJ54zuWaeeuoqkW8AwCIaqeTZKkmYrpPwR2eqN9X72W7EG57vU67OBeuMV8KXLUzv93UTTj42tvaFS++GVsc5JRyLSLJ8nzO555hFBmiSRCqMr4GwrcmGkib5xSvcwmzFK6e8s7DMa2xH4YZdZumSOwsVzFeBWdr37tpIhOpSwXqONNgZq/2KgvBt54znHN1HzlljTO4oVD5fb+prNIJXQNL1ofDKQisbPLJDv3jNSLq9OkYBEIihKIj3v7S1TRQCX5Kdl1ZQlol7LF+E++fwirfiq2sf4cTXxc6hzxffPuLEeqSWrPGWMF58TWr5viyJAP5/4EV4KePiaSE8eNRgjDy8/tyRW+FZjhS+2tlovNJovtJovNJ0uhK6Wo64SDdxEbM//KesjwAAAABJRU5ErkJggg==",Za.map=u}}var rs=new n.Box3(new n.Vector3(-50,-50,-50),new n.Vector3(50,50,50)),os=function(e){return e.replace("//vrlab-public.ljcdn.com/","//vr-public.realsee-cdn.cn/").replace("//vrlab-image4.ljcdn.com/","//vr-image-4.realsee-cdn.cn/").replace("//vrlab-image3.ljcdn.com/","//vr-image-3.realsee-cdn.cn/").replace("//vrlab-image2.ljcdn.com/","//vr-image-2.realsee-cdn.cn/").replace("//vrlab-image1.ljcdn.com/","//vr-image-1.realsee-cdn.cn/")},as=new n.Vector2,ss=new n.Frustum,ls=new n.Matrix4,cs=new WeakMap,us=new WeakMap,hs=function(e){function t(t){void 0===t&&(t={});var i,r,o,a,s,l,c,u,h,d,p=this;if((p=e.call(this)||this).ident=In(),ds.instances[p.ident]=p,p.renderSwitch01=0,p.panoIndex=0,p.needsRender=!1,p.onlyRenderIfNeeds=null===(i=t.onlyRenderIfNeeds)||void 0===i||i,p.imageOptions=ie({},null!==(r=t.imageOptions)&&void 0!==r?r:{}),p.textureOptions=ie({},null!==(o=t.textureOptions)&&void 0!==o?o:{}),p.poweredByRealsee=null===(a=t.poweredByRealsee)||void 0===a||a,p.extraElements=[],p.controllerInits={Panorama:Object.assign({},t.panorama),Model:Object.assign({},t.model),Floorplan:Object.assign({},t.floorplan),Topview:Object.assign({},t.topview),Mapview:Object.assign({},t.mapview),DepthPanorama:Object.assign({},t.depthPanorama),VRPanorama:Object.assign({},t.vrPanorama),XRPanorama:Object.assign({},t.xrPanorama)},p.fps={testCount:0,testTime:ue()},p.modeChangeDuration=null!==(s=t.modeChangeDuration)&&void 0!==s?s:800,p.panoramaLikeSavedPose={},"undefined"!=typeof window)if(t.renderer)t.renderer instanceof Rt&&p.throwError(new Error("cannot render a internal renderer")),p.renderer=t.renderer;else try{p.renderer=new Rt({preserveDrawingBuffer:t.preserveDrawingBuffer,backgroundColor:t.backgroundColor,backgroundAlpha:t.backgroundAlpha,antialias:t.antialias,webgl2:null==t?void 0:t.webgl2});var f=_a();p.renderer.setPixelRatio(1===f?window.devicePixelRatio:1),p.renderer.setSize(512,512)}catch(e){e instanceof Error&&p.throwError(e)}p.copyEffect=new Zr(p.renderer),p.getPixelsRenderTarget=new n.WebGLRenderTarget(1,1,{encoding:null!==(c=null===(l=p.renderer)||void 0===l?void 0:l.outputEncoding)&&void 0!==c?c:n.sRGBEncoding}),p.scissor=Object.assign({left:0,bottom:0,width:1,height:1},t.scissor),p.camera=new zt(80),p.scene=new kt,p.parallaxScene=new kt,p.lastLoadWorkTask=Promise.resolve(),p.requestProxy=null!==(u=t.requestProxy)&&void 0!==u?u:os,p.networkSubscribe=new Ee,p.networkSubscribe.on("network",(function(e,t,i,n){var r;p.emit("network",e,t,i,n),null===(r=p.analysis)||void 0===r||r.network(p.work,e,t,i,n)})),p.boundingMesh=Tr(new n.Box3(new n.Vector3(-.5,-.5,-.5),new n.Vector3(.5,.5,.5))),p.scene.add(p.boundingMesh),p.model=new _n({allowHosts:[],requestProxy:p.requestProxy,networkSubscribe:p.networkSubscribe});var A=Tr(rs);A.name="model_empty",p.model.add(A),p.model.visible=!1,p.readyCallbacks=[],p.modelPending=!1,p.syncingState=!1,p.scene.add(p.model),p.helperGroup=new n.Group,p.helperGroup.name="helper",p.scene.add(p.helperGroup),p.videoTexture=new n.VideoTexture(t.videoInstance||function(){var e=document.createElement("video");e.loop=!0,e.autoplay=!0,e.playsInline=!0,e.muted=!0,e.crossOrigin="";var t=function(){document.removeEventListener("touchstart",t,!1),document.removeEventListener("mousedown",t,!1),e.muted=!1};return document.addEventListener("touchstart",t,!1),document.addEventListener("mousedown",t,!1),e}()),function(e){(t=new n.DirectionalLight(16777215,.5)).position.copy(new n.Vector3(1,1,1)),e.add(t);var t=new n.DirectionalLight(16777215,.3);e.add(t),t=new n.AmbientLight(16777215,.3),e.add(t)}(p.scene),p.state={mode:null!==(h=p.currentMode)&&void 0!==h?h:"Panorama",panoIndex:null!==(d=p.panoIndex)&&void 0!==d?d:0,longitude:p.camera.pose.longitude,latitude:p.camera.pose.latitude,fov:p.camera.pose.fov,offset:p.camera.pose.offset.clone(),distance:p.camera.pose.distance},p.stateSynced=!1,p._enableIOSEDR=!1,p.destroyed=!1,p.paused=!0,"undefined"!=typeof window&&(!1!==t.play&&p.play(),p.stopAnimationLoop=ke.shared.add((function(e,t){for(var i=[],n=2;n<arguments.length;n++)i[n-2]=arguments[n];p.updateTime.apply(p,ne([e,t],i,!1))}),!1,0,10));var v=function(){"undefined"!=typeof document&&null===document.fullscreenElement&&"VRPanorama"===p.currentMode&&p.controller.emit("vrWantsToExit")};if("undefined"!=typeof document&&document.addEventListener("fullscreenchange",v,!1),p.removeEventListeners=function(){"undefined"!=typeof document&&document.removeEventListener("fullscreenchange",v,!1)},p.plugins={},t.plugins&&t.plugins.length)for(var m=0,g=t.plugins;m<g.length;m++){var y=g[m];if("function"==typeof y)y(p);else if(Array.isArray(y)){var b=y[0],x=y[1],w=y[2];if("function"==typeof b){var M=b(p,w);"string"==typeof x&&(p.plugins[x]?p.throwError(new Error("plugin name ".concat(x," is exists."))):p.plugins[x]=M)}}}return p.gpuPickingRenderTarget=new n.WebGLRenderTarget(1,1),p.meshReplaceMaterialMap=new Map,p.meshOriginMaterialMap=new Map,p}return te(t,e),Object.defineProperty(t,"version",{get:function(){return"5.0.0-alpha.182"},enumerable:!1,configurable:!0}),t.prototype.getGPUPicking=function(e,t,i,r,o){var a=this;if(void 0===r&&(r=1),void 0===o&&(o=new n.Vector3(0,0,0)),!this.renderer)throw new Error("renderer is not initialized.");this.model.setMaterial({modelColorInfo:o}),this.scene.traverse((function(e){if(e instanceof n.Mesh&&!(e instanceof ze)){var t=Object.keys(i).filter((function(t){return t===e.uuid}))[0];if(t)if(a.meshOriginMaterialMap.set(t,e.material),a.meshReplaceMaterialMap.get(t))e.material=a.meshReplaceMaterialMap.get(t);else{var r=new n.ShaderMaterial({uniforms:{color:{value:i[t]}},vertexShader:"\n void main() {\n vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n gl_Position = projectionMatrix * mvPosition;\n }\n ",fragmentShader:"\n uniform vec3 color;\n void main() {\n gl_FragColor = vec4( color, 1.0 );\n }\n "});r.depthTest=e.material.depthTest,r.side=e.material.side,a.meshReplaceMaterialMap.set(t,r),e.material=r}}}));var s=this.renderer.getSize(new n.Vector2);this.camera.setViewOffset(s.width,s.height,e*r,t*r,1,1),this.renderer.setRenderTarget(this.gpuPickingRenderTarget),this.render();var l=new Uint8Array(4);this.renderer.readRenderTargetPixels(this.gpuPickingRenderTarget,0,0,1,1,l),this.renderer.setRenderTarget(null),this.camera.clearViewOffset(),this.scene.traverse((function(e){e instanceof n.Mesh&&!(e instanceof ze)&&a.meshOriginMaterialMap.get(e.uuid)&&(e.material=a.meshOriginMaterialMap.get(e.uuid))})),this.model.setMaterial({modelColorInfo:null});var c=Object.keys(i).filter((function(e){return i[e].equals((new n.Color).setRGB(l[0]/255,l[1]/255,l[2]/255))}))[0];return c||!1},t.prototype.dispose=function(){var e,t;if(!0!==this.destroyed){delete ds.instances[this.ident],this.emit("dispose"),this.destroyed=!0,this.pause(),this.stopAnimationLoop&&(this.stopAnimationLoop(),delete this.stopAnimationLoop),null===(e=this.renderer)||void 0===e||e.setAnimationLoop(null),this.off(),this.networkSubscribe.off(),this.controller&&(this.controller.destroy(),this.controller=void 0);var i=this.getElement();i&&i.parentNode&&i.parentNode.removeChild(i),this.scene.remove(this.model);var n=this.model.getMaterial();n&&(n.pano0&&n.pano0.map.dispose(),n.pano1&&n.pano1.map!==(null===(t=n.pano0)||void 0===t?void 0:t.map)&&n.pano1.map.dispose()),this.model.dispose(),this.diposeGPUPickingMaterial(),this.renderer instanceof Rt&&this.renderer.forceContextLoss&&this.renderer.forceContextLoss()}},t.prototype.setScissor=function(e){Object.assign(this.scissor,e),this.controller&&this.controller.updateRenderSize&&this.controller.updateRenderSize()},Object.defineProperty(t.prototype,"helperVisible",{get:function(){return this.helperGroup.visible},set:function(e){this.helperGroup.visible!==e&&(this.helperGroup.visible=e,this.emit("helpersVisibleChange",e),this.needsRender=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"enableIOSEDR",{get:function(){return this._enableIOSEDR},set:function(e){this._enableIOSEDR!==e&&(this._enableIOSEDR=e,this.currentMode&&"Panorama"===this.currentMode&&this.changeMode(this.currentMode,{},0,!1,!0))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"enablePostProcessing",{get:function(){return void 0!==this.screenBuffers},set:function(e){var t,i,r,o;if(e){if(!this.screenBuffers){var a=this.getDrawingBufferSize(as);this.screenBuffers=[new n.WebGLRenderTarget(a.x,a.y,{encoding:null!==(i=null===(t=this.renderer)||void 0===t?void 0:t.outputEncoding)&&void 0!==i?i:n.sRGBEncoding}),new n.WebGLRenderTarget(a.x,a.y,{encoding:null!==(o=null===(r=this.renderer)||void 0===r?void 0:r.outputEncoding)&&void 0!==o?o:n.sRGBEncoding})]}}else this.screenBuffers&&(this.screenBuffers[0].dispose(),this.screenBuffers[1].dispose(),delete this.screenBuffers);this.needsRender=!0},enumerable:!1,configurable:!0}),t.prototype.updateConfiguration=function(e){var t=!1;e.panorama&&(Object.assign(this.controllerInits.Panorama,e.panorama),"Panorama"===this.currentMode&&(t=!0)),e.model&&(Object.assign(this.controllerInits.Model,e.model),"Model"===this.currentMode&&(t=!0)),e.floorplan&&(Object.assign(this.controllerInits.Floorplan,e.floorplan),"Floorplan"===this.currentMode&&(t=!0)),e.topview&&(Object.assign(this.controllerInits.Topview,e.topview),"Topview"===this.currentMode&&(t=!0)),e.mapview&&(Object.assign(this.controllerInits.Mapview,e.topview),"Mapview"===this.currentMode&&(t=!0)),e.depthPanorama&&(Object.assign(this.controllerInits.DepthPanorama,e.depthPanorama),"DepthPanorama"===this.currentMode&&(t=!0)),e.vrPanorama&&(Object.assign(this.controllerInits.VRPanorama,e.vrPanorama),"VRPanorama"===this.currentMode&&(t=!0)),e.imageOptions&&(Object.assign(this.imageOptions,e.imageOptions),"Panorama"!==this.currentMode&&"DepthPanorama"!==this.currentMode&&"VRPanorama"!==this.currentMode||(t=!0)),t&&this.controller&&this.currentMode&&this.changeMode(this.currentMode,this.getCurrentState(),0,!1,!0)},t.prototype.appendTo=function(e,t){if(void 0===t&&(t={}),this.renderer)if(this.renderer instanceof Rt){var i=this.getElement();if(i){e.appendChild(i),this.refresh(t);var n=window.getComputedStyle(e).position;"relative"!==n&&"absolute"!==n&&"fixed"!==n&&"sticky"!==n&&(e.style.position="relative")}}else this.throwError(new Error("cannot call appendTo method when render a external renderer"))},t.prototype.refresh=function(e,t){if(void 0===e&&(e={}),this.renderer){var i=this.getElement();if(i){var r=i.parentNode;if(r&&r.nodeName){var o=e.width,a=void 0===o?r.offsetWidth:o,s=e.height,l=void 0===s?r.offsetHeight:s;this.renderer instanceof Rt&&(t&&this.renderer.setPixelRatio(t),this.renderer.setSize(a,l))}var c=this.renderer.getSize(new n.Vector2);this.camera.aspect=c.x*this.scissor.width/(c.y*this.scissor.height),this.camera.updateProjectionMatrix(),this.controller&&this.controller.updateRenderSize&&this.controller.updateRenderSize(),this.needsRender=!0}}},t.prototype.addExtraElement=function(e){var t=this;return-1===this.extraElements.indexOf(e)&&(this.extraElements.push(e),this.controller&&this.controller.bindExtraElement(e)),function(){return t.removeExtraElement(e)}},t.prototype.removeExtraElement=function(e){var t=this.extraElements.indexOf(e);-1!==t&&(this.extraElements.splice(t,1),this.controller&&this.controller.unbindExtraElement(e))},t.prototype.getPose=function(){var e=this.camera.copyPose(),t=e.longitude,i=e.latitude,n=e.fov,r=e.offset,o=e.distance;return{longitude:t,latitude:i,fov:n,offset:r.clone(),distance:o}},t.prototype.getSize=function(e){if(!this.renderer)throw new Error("renderer is not initialized");return this.renderer.getSize(e),e.x*=this.scissor.width,e.y*=this.scissor.height,e},t.prototype.getDrawingBufferSize=function(e){if(!this.renderer)throw new Error("renderer is not initialized");return this.renderer.getDrawingBufferSize(e),e.x*=this.scissor.width,e.y*=this.scissor.height,e},t.prototype.updateCamera=function(e,t,i){return void 0===i&&(i=!0),this.controller?this.controller.updateCamera(e,t,i):Promise.reject(new Error("controller is not initialized."))},t.prototype.updateCameraWithKeyframes=function(e,t,i){return void 0===i&&(i=!0),this.controller?this.controller.updateCameraWithKeyframes(e,t,i):Promise.reject(new Error("controller is not initialized."))},t.prototype.getLongitudeAndLatitude=function(){var e=this.getPose();return{longitude:e.longitude,latitude:e.latitude}},t.prototype.getOffset=function(){return this.getPose().offset},t.prototype.getCameraLocal=function(){if("number"==typeof this.panoIndex&&this.controller&&this.work){var e=this.work.observers[this.panoIndex],t=new n.Object3D;return t.position.copy(e.position),t.quaternion.copy(e.quaternion),t.scale.set(1,1,1),t.updateMatrixWorld(!0),function(e,t){var i=new n.Vector3(0,0,-1);i.applyQuaternion(e.quaternion);var r=t.quaternion.clone().inverse();return i.applyQuaternion(r),{theta:Math.atan2(i.x,-i.z),phi:-Math.asin(i.y),lookAtVector:i}}(this.camera,t)}},Object.defineProperty(t.prototype,"work",{get:function(){var e=us.get(this);if(e&&tr.get(e))return e},enumerable:!1,configurable:!0}),t.prototype.load=function(e,t,i,n){var r=this;if(void 0===n&&(n=!0),!this.renderer)throw new Error("renderer is not initialized");var o=this.lastLoadWorkTask.then((function(){return!(o=e)||"object"!=typeof o&&"function"!=typeof o||"function"!=typeof o.then?r.load_(e,t,i,n):e.then((function(e){return r.load_(e,t,i,n)}));var o}));return this.lastLoadWorkTask=o.catch((function(e){r.throwError(e)})),o},t.prototype.load_=function(e,i,r,o){var a,s,l,c,u,h,d,p,f,A=this;void 0===o&&(o=!0);var v,m,g,y=ar(e),b=this.work;void 0===i&&(i=b?"inherit":"initial"),"inherit"===i?(v="number"==typeof this.panoIndex&&y.observers[this.panoIndex]?this.panoIndex:y.initial.panoIndex,m=null!==(a=this.currentMode)&&void 0!==a?a:y.initial.mode,g={longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov}):"initial"===i?(m=null!==(s=this.currentMode)&&void 0!==s?s:y.initial.mode,v=y.initial.panoIndex,g=m===t.Mode.Panorama||m===t.Mode.DepthPanorama||m===t.Mode.Model||m===t.Mode.VRPanorama||m===t.Mode.XRPanorama?{longitude:y.initial.longitude,latitude:y.initial.latitude,fov:y.initial.fov}:{longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov}):(v=null!==(l=i.panoIndex)&&void 0!==l?l:y.initial.panoIndex,m=null!==(u=null!==(c=i.mode)&&void 0!==c?c:this.currentMode)&&void 0!==u?u:"Panorama",g={longitude:null!==(h=i.longitude)&&void 0!==h?h:y.initial.longitude,latitude:null!==(d=i.latitude)&&void 0!==d?d:y.initial.latitude,fov:null!==(p=i.fov)&&void 0!==p?p:y.initial.fov}),this.emit("willLoad",e,y,{panoIndex:v,mode:m,longitude:g.longitude,latitude:g.latitude,fov:g.fov});var x=function(){var t;A.panoIndex=v,A.panoramaLikeSavedPose.longitude=y.initial.longitude,A.panoramaLikeSavedPose.latitude=y.initial.latitude,A.panoramaLikeSavedPose.fov=y.initial.fov;var i=A.controller?null!=r?r:A.modeChangeDuration:0,n=ie(ie({initial:[v,g,i,o]},A.commonParams()),A.controllerInits[m]);A.controller?!1===A.controller.updateWork(y,v,g,i,o)&&(A.controller.destroy(),A.controller=A.applyController(m,n)):A.controller=A.applyController(m,n),A.emit("load",e,y,{panoIndex:v,mode:m,longitude:g.longitude,latitude:g.latitude,fov:g.fov}),null===(t=A.analysis)||void 0===t||t.work(y)},w=function(e){var t;void 0===e&&(e=le),y.model&&(A.model.name!==(null===(t=y.model)||void 0===t?void 0:t.file)?(A.emit("modelWillLoad",y.model),A.loadModel(y.workCode,y.model,y.allowHosts,e,!0)):e&&e())};us.set(this,y);for(var M=new n.Box3,C=0,E=y.observers;C<E.length;C++){var I=E[C];M.expandByPoint(I.standingPosition),M.expandByPoint((new n.Vector3).fromArray([I.position.x,2*I.position.y-I.standingPosition.y,I.position.z]))}return this.model.bounding.union(M),m===t.Mode.Floorplan||m===t.Mode.Topview||m===t.Mode.Mapview||m===t.Mode.Model?w((function(){x(),A.needsRender=!0})):(this.controller||(this.camera.setFromPose({distance:0,fov:y.initial.fov,longitude:y.initial.longitude,latitude:y.initial.latitude,offset:y.observers[y.initial.panoIndex].position}),this.needsRender=!0),x(),null===(f=this.controller)||void 0===f||f.once("panoLoaded",(function(){A.needsRender=!0,A.emit("cameraUpdate",A.camera.copyPose(),o),w()}))),this.ready().then((function(){A.emit("loaded",e,A.work)}))},t.prototype.changeMode=function(e,i,n,r,o){var a=this;if(void 0===i&&(i={}),void 0===n&&(n=this.modeChangeDuration),void 0===r&&(r=!0),void 0===o&&(o=!1),!this.renderer)throw new Error("renderer is not initialized.");return new Promise((function(s,l){if(!t.Mode.hasOwnProperty(e)){var c=new Error('mode "'.concat(e,'" is not existed'));return a.throwError(c),void l(c)}if((e===t.Mode.Floorplan||e===t.Mode.Topview||e===t.Mode.Mapview||e===t.Mode.Model)&&(Un(a.model)||!0!==a.model.loaded)){c=new Error("model is not ready.");return a.throwError(c),void l(c)}if(Un(a.controller)){c=new Error("controller is not ready.");return a.throwError(c),void l(c)}var u=a.controller,h=a.currentMode,d=function(){var c,d,p,f;if(a.emit("wantsChangeMode",e,h))l(new Error("change mode canceled."));else{if(a.controller&&!1===o&&h===e)e===t.Mode.Panorama||e===t.Mode.DepthPanorama||e===t.Mode.Model||e===t.Mode.VRPanorama||e===t.Mode.XRPanorama?"number"==typeof i.panoIndex&&i.panoIndex!==a.panoIndex?a.controller.moveToPano(null!==(d=null!==(c=i.panoIndex)&&void 0!==c?c:a.panoIndex)&&void 0!==d?d:0,ie({duration:n},i),r):a.controller.updateCamera(i,n,r).catch(le):("number"==typeof i.panoIndex&&i.panoIndex!==a.panoIndex&&(a.panoIndex=i.panoIndex),a.controller.updateCamera(i,n,r).catch(le));else{u.destroy();var A=null!==(f=null!==(p=i.panoIndex)&&void 0!==p?p:a.panoIndex)&&void 0!==f?f:0,v=za(e)?a.panoramaLikeSavedPose:{};e===t.Mode.Mapview&&(v.longitude=a.panoramaLikeSavedPose.longitude),"number"!=typeof i.longitude&&"number"!=typeof i.latitude||(v.longitude=i.longitude,v.latitude=i.latitude),"number"==typeof i.fov&&(v.fov=i.fov),"Mapview"===e&&(v.distance=i.distance,v.offset=i.offset);var m=ie(ie({initial:[A,v,n,r]},a.commonParams()),a.controllerInits[e]);a.saveControllerPose(u),a.controller=a.applyController(e,m);var g=Ua[e].initAnimationEndPose(m);a.emit("modeChange",e,h,A,g,r)}s()}};if(e===t.Mode.VRPanorama)a.requestFullscreen(),("undefined"==typeof location||"https:"!==location.protocol?Promise.reject(new Error("Request DeviceOrientation Permission denied.")):"undefined"!=typeof DeviceOrientationEvent&&"function"==typeof DeviceOrientationEvent.requestPermission?DeviceOrientationEvent.requestPermission().then((function(e){if("granted"==e)return Promise.resolve();var t=new Error("Request DeviceOrientation Permission denied.");return Promise.reject(t)})):Promise.resolve()).then((function(){return d()})).catch((function(e){e instanceof Error&&(a.exitFullscreen(),a.throwError(e),l(e))}));else if(e===t.Mode.XRPanorama){var p=ke.shared.getContext();p?p.end():function(){if("xr"in navigator)return navigator.xr.isSessionSupported("immersive-vr").then((function(e){return e?Promise.resolve():Promise.reject()})).then((function(){return navigator.xr.requestSession("immersive-vr",{optionalFeatures:["local-floor","bounded-floor"]}).then((function(e){return Promise.resolve(e)}))}));var e=new Error("Request XR Permission denied.");return Promise.reject(e)}().then((function(e){ke.shared.setContext(e),d()})).catch((function(e){e instanceof Error&&(a.throwError(e),l(e))}))}else d()}))},t.prototype.getPixels=function(e,t,i,r,o){if(void 0===o&&(o=1),!this.renderer)throw new Error("renderer is not initialized.");var a=this.getPixelsRenderTarget,s=this.renderer.getSize(new n.Vector2);e=Kn(e,Math.floor(i/2),Math.floor(s.x-i)),t=Kn(t,Math.floor(r/2),Math.floor(s.y-r)),a.setSize(i*o,r*o),this.renderer.setRenderTarget(a),this.camera.setViewOffset(s.width,s.height,e,s.height-t-r,i,r),this.controller?this.controller.render():this.renderer.render(this.scene,this.camera);var l=new Uint8Array(i*o*r*o*4);return this.renderer.readRenderTargetPixels(a,0,0,i*o,r*o,l),this.renderer.setRenderTarget(null),this.camera.clearViewOffset(),l},t.prototype.getElement=function(){var e;return null===(e=this.renderer)||void 0===e?void 0:e.domElement},t.prototype.render=function(e,t){var i,n=this;if(void 0===t&&(t=!1),!this.renderer)return null;var r=Ue.shared,o=null===(i=this.model.getMaterial())||void 0===i?void 0:i.clippers;if(o&&r.update(o,this.camera),this.model.setMaterial({clipperPlanesArray:o?r.clipperPlanes:null,clipperFloors:o?r.clipperFloors:null}),t){var a=this.renderer.getSize(as);this.scene.traverseVisible((function(e){e.setResolution&&e.setResolution(a.x,a.y)}))}if(this.controller&&this.screenBuffers&&null===this.renderer.getRenderTarget()){var s=this.getDrawingBufferSize(as);return this.screenBuffers[0].setSize(s.x,s.y),this.screenBuffers[1].setSize(s.x,s.y),this.renderer.setRenderTarget(this.screenBuffers[0]),this.controller.render(),"VRPanorama"!==this.currentMode&&"XRPanorama"!==this.currentMode&&this.poweredByRealsee&&ns(this.renderer),this.renderer.setRenderTarget(null),e&&ke.shared.add(e,!0),this.screenBuffers[0]}return this.aroundScissor((function(){n.renderer&&(n.controller?n.controller.render():n.renderer.render(n.scene,n.camera),n.poweredByRealsee&&"VRPanorama"!==n.currentMode&&"XRPanorama"!==n.currentMode&&ns(n.renderer)),e&&ke.shared.add(e,!0)})),null},t.prototype.updateTime=function(e,t){for(var i,r,o,a=this,s=[],l=2;l<arguments.length;l++)s[l-2]=arguments[l];if(!this.destroyed){this.syncingState=this.syncState(e,t),this.controller&&(i=this.controller).updateTime.apply(i,ne([e,t],s,!1)),this.syncingState=!1,this.camera.updateTime(e,t);var c=new n.Vector2(512,512),u=new n.Vector2(512,512);this.renderer&&(this.renderer.getSize(c),c.x*=this.scissor.width,c.y*=this.scissor.height,this.renderer.getDrawingBufferSize(u),u.x*=this.scissor.width,u.y*=this.scissor.height),this.renderer&&this.model.update(this.renderer,this.camera);var h=new n.Box3;this.work&&h.union(this.work.boundingBox),this.model.empty||h.union(this.model.bounding),h.max.x+=1,h.max.y+=1,h.max.z+=1,h.min.x-=1,h.min.y-=.001,h.min.z-=1,h.getCenter(this.boundingMesh.position),h.getSize(this.boundingMesh.scale),this.boundingMesh.boundingBox.copy(h);var d=null!==(r=this.model.getMaterial())&&void 0!==r?r:{},p=1-(null!==(o=d.modelAlpha)&&void 0!==o?o:0);d.opacity=Kn(4*p-3,0,1),this.boundingMesh.setMaterial(d),this.boundingMesh.setTransparent(1!==p);var f=[];ls.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),ss.setFromProjectionMatrix(ls);for(var A=0,v=this.scene.children;A<v.length;A++){var m=v[A];m!==this.model&&(m instanceof n.Object3D&&m.traverseVisible((function(t){if(t.setResolution&&t.setResolution(c.x,c.y),t.setTime&&t.setTime(e),t.mixer instanceof n.AnimationMixer){var i=cs.get(t.mixer);i||(i=new n.Clock,cs.set(t.mixer,i)),t.mixer.update(i.getDelta())}(t instanceof n.Mesh||t instanceof n.Line||t instanceof n.Points)&&(t instanceof n.ImmediateRenderObject||!t.frustumCulled||ss.intersectsObject(t))&&f.push(t)})))}if(u.width*u.height>8388608?this.renderSwitch01=1^this.renderSwitch01:this.renderSwitch01=0,this.renderer&&!1===this.paused&&0===this.renderSwitch01){var g=void 0;if(!0!==this.onlyRenderIfNeeds)g=this.render();else{if(this.controller&&!0===this.controller.needsRender&&(this.controller.needsRender=!1,this.needsRender=!0),!0===this.camera.needsRender&&(this.camera.needsRender=!1,this.needsRender=!0),!0===this.model.needsRender&&(this.model.needsRender=!1,this.needsRender=!0),!0!==this.needsRender)for(var y=0,b=f;y<b.length;y++){var x=b[y],w=function(e){!0===e.needsRender?(e.needsRender=!1,a.needsRender=!0):e.mixer&&e.mixer.stats.actions.inUse>0&&(a.needsRender=!0)};w(x),x.traverseAncestors(w)}!1!==this.needsRender&&(g=this.render())}if(this.needsRender=!1,this.controller&&this.screenBuffers){var M=this.controller,C=this.screenBuffers;this.aroundScissor((function(){M.postProcessing(C[0],C[1]),a.copyEffect.render(C[1],void 0)}))}this.hasListener("renderFrame")&&this.emit("renderFrame",void 0!==g)}this.fps.testTime&&e-this.fps.testTime<1e3?this.fps.testCount++:(this.emit("fps",this.fps.testCount),this.fps.testTime=e,this.fps.testCount=0)}},t.prototype.pause=function(){this.paused=!0,this.renderer&&this.renderer instanceof Rt&&this.renderer.clear(!0,!0,!0)},t.prototype.play=function(){this.needsRender=!0,this.paused=!1},t.prototype.moveToPano=function(e,i,n){var r=this;void 0===i&&(i={}),void 0===n&&(n=!0);var o=this,a=o.controller,s=o.currentMode,l=o.renderer;return a?l?(s===t.Mode.Floorplan||s===t.Mode.Topview||s===t.Mode.Mapview?Un(e)||(this.panoIndex=e,this.once("initAnimationWillStart",(function(e,n){r.currentMode===t.Mode.Panorama&&i.moveStartCallback&&i.moveStartCallback(e,n)})),this.once("initAnimationEnded",(function(e,n){r.currentMode===t.Mode.Panorama&&i.moveEndCallback&&i.moveEndCallback(e,n)})),this.changeMode(t.Mode.Panorama,i,void 0,n)):a.moveToPano(e,i,n),this.ready()):(this.throwError(new Error("renderer is not initialized.")),Promise.resolve()):(this.throwError(new Error("controller is not initialized.")),Promise.resolve())},t.prototype.preloadPano=function(e,t){var i=this;if(void 0===t&&(t=le),!this.work)return Promise.reject(new Error("work never loaded"));var n=this.work.observers[e],r=this.work.allowHosts,o=ue();return Promise.all(["right","left","up","down","front","back"].map((function(t){var o=ie({key:"pano.".concat(e,".").concat(t)},ci(i.imageOptions,["size","format","quality","mappings"])),a=n.images[t];return Be(i.imageOptions.transform?i.imageOptions.transform(a,o):Le(a,o),{allowHosts:r,requestProxy:i.requestProxy,networkSubscribe:i.networkSubscribe})}))).then((function(){var e=ue()-o;return t(e),e}))},t.prototype.project2d=function(e,t){if(void 0===t&&(t=!1),!this.renderer)return null;if(!1===this.model.empty&&t){var i=this.camera.position,r=e.clone().sub(i),o=new n.Raycaster(i,r.clone().normalize()),a=this.model.intersectRaycaster(o)[0];if(a&&a.distance+.01<r.length())return null}var s=e.clone().project(this.camera);if(Math.abs(s.z)>1)return null;var l=this.renderer.getSize(new n.Vector2),c=l.x*this.scissor.width,u=l.y*this.scissor.height,h=l.x*this.scissor.left+(s.x+1)/2*c,d=l.y*(1-this.scissor.bottom-this.scissor.height)+(1-s.y)/2*u;return new n.Vector2(h,d)},t.prototype.getRenderObjects=function(e){ls.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),ss.setFromProjectionMatrix(ls),e||(e=this.scene);var t=[];return e.traverseVisible((function(e){(e instanceof n.Mesh||e instanceof n.Line||e instanceof n.Points)&&(e instanceof n.ImmediateRenderObject||!e.frustumCulled||ss.intersectsObject(e))&&t.push(e)})),t},t.prototype.getCurrentState=function(){return ie(ie({},this.getPose()),{mode:this.currentMode||t.Mode.Panorama,panoIndex:this.panoIndex||0})},t.prototype.setState=function(e,i,r){var o,a,s,l,c,u,h,d,p;void 0===i&&(i=!1),void 0===r&&(r=!0),!(e=Object.assign({},e)).offset||e instanceof n.Vector3||(e.offset=new n.Vector3(e.offset.x,e.offset.y,e.offset.z));var f,A,v,m,g,y=null!==(o=e.panoIndex)&&void 0!==o?o:this.state.panoIndex,b=null!==(a=e.mode)&&void 0!==a?a:this.state.mode;if(this.work)if(this.work.observers[y])if(e.mode!==t.Mode.Floorplan&&e.mode!==t.Mode.Topview&&e.mode!==t.Mode.Mapview&&e.mode!==t.Mode.Model||!Un(this.model)&&!0===this.model.loaded){if(this.state.mode!==b){if("VRPanorama"===b)return void this.changeMode("VRPanorama",void 0,void 0,!0);var x=void 0;x=za(this.state.mode)&&za(b)?ie({},this.state):za(b)?ie({},this.panoramaLikeSavedPose):b===t.Mode.Mapview?{longitude:this.panoramaLikeSavedPose.latitude}:ie({},e),"number"==typeof e.longitude&&(x.longitude=e.longitude),"number"==typeof e.latitude&&(x.latitude=e.latitude),"number"==typeof e.fov&&(x.fov=e.fov),"number"==typeof e.distance&&"Mapview"===e.mode&&(x.distance=e.distance),e.offset instanceof n.Vector3&&"Mapview"===e.mode&&(x.offset=e.offset);var w=ie(ie({initial:[y,x,this.modeChangeDuration,!1]},this.commonParams()),this.controllerInits[b]),M=Ua[b].initAnimationEndPose(w);f=M.longitude,A=M.latitude,v=M.fov,m=M.offset,g=M.distance}else f=null!==(s=e.longitude)&&void 0!==s?s:this.state.longitude,A=null!==(l=e.latitude)&&void 0!==l?l:this.state.latitude,v=null!==(c=e.fov)&&void 0!==c?c:this.state.fov,m=null!==(u=e.offset)&&void 0!==u?u:this.state.offset,g=null!==(h=e.distance)&&void 0!==h?h:this.state.distance;var C={panoIndex:y,mode:b,longitude:f,latitude:A,fov:v,offset:m,distance:g};this.emit("setState",C),Or(this.state,C)||(this.controller&&"VRPanorama"===C.mode&&C.mode!==this.state.mode?(Lr(this.state,C),this.changeMode("VRPanorama")):this.controller&&"XRPanorama"===C.mode&&C.mode!==this.state.mode?(Lr(this.state,C),this.changeMode("XRPanorama")):(Lr(this.state,C),this.controller&&(this.controller.userAction=r),i&&this.state.mode===C.mode&&(this.syncingState=this.syncState(ue(),0,i),this.syncingState&&(null===(d=this.controller)||void 0===d||d.updateTime(ue(),0),this.syncingState=!1)),this.emit("stateChange",this.state,r),null===(p=this.analysis)||void 0===p||p.state(this.work,this.state)))}else this.throwError(new Error("model is not ready."));else this.throwError(new Error("panoIndex not found in work"));else this.throwError(new Error("work never load."))},t.prototype.aroundScissor=function(e){if(this.renderer)if("XRPanorama"!==this.state.mode){var t=new n.Vector2,i=0!==this.scissor.left||0!==this.scissor.bottom||1!==this.scissor.width||1!==this.scissor.height;if(i){this.renderer.getSize(t);var r=Math.floor(t.x*this.scissor.left),o=Math.floor(t.y*this.scissor.bottom),a=Math.floor(t.x*this.scissor.width),s=Math.floor(t.y*this.scissor.height);this.renderer.setViewport(r,o,a,s),this.renderer.setScissor(r,o,a,s),this.renderer.setScissorTest(!0)}e(),i&&(this.renderer.setViewport(0,0,t.x,t.y),this.renderer.setScissor(0,0,t.x,t.y),this.renderer.setScissorTest(!1))}else e()},t.prototype.syncState=function(e,i,r){void 0===r&&(r=!1);var o=this.stateSynced;if(this.stateSynced=!1,!this.work)return!1;if(!this.controller)return!1;if(this.state.mode!==this.currentMode){var a={mode:this.state.mode,panoIndex:this.state.panoIndex,longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset,distance:this.state.distance};return this.changeMode(this.state.mode,a,this.modeChangeDuration,this.controller.userAction),!0}if(!1===this.controller.isReady())return!1;if(this.controller instanceof Ua.Model){if(!this.camera.pose.offset.equals(this.state.offset)){var s={longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset};return this.controller.moveToPosition(this.state.offset,ie(ie({},s),{duration:r?0:void 0}),!1),!0}}else if(this.state.panoIndex!==this.panoIndex){s={longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset,distance:this.state.distance};return this.controller.moveToPano(this.state.panoIndex,s,!1),!0}if(this.controller instanceof Ua.Topview||this.controller instanceof Ua.Mapview){var l=1,c=r?this.state.fov:Dr(this.camera.pose.fov,this.state.fov,l),u=r?this.state.distance:Dr(this.camera.pose.distance,this.state.distance,.2),h=r?new n.Vector3(this.state.offset.x,this.state.offset.y,this.state.offset.z):new n.Vector3(Dr(this.camera.pose.offset.x,this.state.offset.x,.2),Dr(this.camera.pose.offset.y,this.state.offset.y,.2),Dr(this.camera.pose.offset.z,this.state.offset.z,.2));if(Cr(c,this.camera.pose.fov)||Ir(h,this.camera.pose.offset)||Cr(u,this.camera.pose.distance)){var d={x:h.x,y:h.y,z:h.z};return this.controller instanceof Ua.Mapview&&Object.assign(d,{distance:u}),this.controller.cameraMotion.set({fov:c},0).catch(le),this.controller.locationMotion.set(d,0).catch(le),!0}}else{l=1;var p=Math.PI/45,f=(c=r?this.state.fov:Dr(this.camera.pose.fov,this.state.fov,l),r?{longitude:this.state.longitude,latitude:this.state.latitude}:function(e,t,i){if(e.longitude===t.longitude&&e.latitude===t.latitude)return{longitude:t.longitude,latitude:t.latitude};var n=Rr(e.longitude),r=e.latitude,o=Rr(t.longitude),a=t.latitude;o-n>kr?n+=Qr:n-o>kr&&(n-=Qr);var s=i/Math.sqrt(Math.pow(o-n,2)+Math.pow(a-r,2));return s>=1?{longitude:t.longitude,latitude:t.latitude}:{longitude:n+(o-n)*s,latitude:r+(a-r)*s}}({longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude},{longitude:this.state.longitude,latitude:this.state.latitude},p)),A=f.longitude,v=f.latitude;if(Cr(A,this.camera.pose.longitude,2*Math.PI)||Cr(v,this.camera.pose.latitude)||Cr(c,this.camera.pose.fov))return this.controller.cameraMotion.set({longitude:A,latitude:v,fov:c},0).catch(le),!0}if(this.stateSynced=!0,!1===o&&this.emit("stateSynced",this.state),this.readyCallbacks.length&&this.stateSynced){var m=this.currentMode;if(!(m===t.Mode.Floorplan||m===t.Mode.Topview||m===t.Mode.Mapview||m===t.Mode.Model)||!this.modelPending){var g=this.readyCallbacks.slice();this.readyCallbacks.length=0;for(var y=0,b=g;y<b.length;y++){var x=b[y];this.controller instanceof Ua.Panorama?!0!==x.tile||this.controller.isTileReady()?x():this.readyCallbacks.push(x):x()}}}return!1},t.prototype.ready=function(e){var t=this;return void 0===e&&(e={}),new Promise((function(i){var n;t.readyCallbacks.push(Object.assign(i,{tile:null!==(n=e.tile)&&void 0!==n&&n}))}))},t.prototype.requestFullscreen=function(){var e;if(Fr()){var t=null===(e=this.getElement())||void 0===e?void 0:e.parentNode;t&&"requestFullscreen"in t&&"undefined"!=typeof document&&null===document.fullscreenElement&&t.requestFullscreen()}},t.prototype.exitFullscreen=function(){"undefined"!=typeof document&&document.fullscreenElement&&"exitFullscreen"in document&&document.exitFullscreen()},t.prototype.throwError=function(e){this.hasListener("error")?this.emit("error",e):console.error(e)},t.prototype.loadModel=function(e,t,i,r,o){var a=this,s=t.file;this.emit("modelWillLoad",t);var l=new _n({allowHosts:i,requestProxy:this.requestProxy,networkSubscribe:this.networkSubscribe});l.workCode=e,l.once("bvhLoaded",(function(){var e,t;a.destroyed||s===(null===(t=null===(e=a.work)||void 0===e?void 0:e.model)||void 0===t?void 0:t.file)&&a.emit("modelBvhLoaded",l)})),l.once("materialLoaded",(function(){var e,t;a.destroyed||s===(null===(t=null===(e=a.work)||void 0===e?void 0:e.model)||void 0===t?void 0:t.file)&&a.emit("modelMaterialLoaded",l)})),l.once("geometryLoaded",(function(){var e,t;a.destroyed||s===(null===(t=null===(e=a.work)||void 0===e?void 0:e.model)||void 0===t?void 0:t.file)&&(l.bounding.max.y-l.bounding.min.y<1.5&&(l.bounding.max.y=l.bounding.min.y+10),a.emit("modelGeometryLoaded",l))})),l.once("loaded",(function(){var e,t,i,n;if(!a.destroyed&&s===(null===(t=null===(e=a.work)||void 0===e?void 0:e.model)||void 0===t?void 0:t.file)){var o,c=a.model;c&&(c.show(),o=c.getMaterial()||{},a.scene.remove(c),c.dispose(),l.setTransparent(c.getTransparent())),o&&l.setMaterial(o),a.model=l,a.scene.add(l),null===(i=a.controller)||void 0===i||i.updateModel(l),null===(n=a.renderer)||void 0===n||n.compile(a.scene,a.camera),a.needsRender=!0,a.modelPending=!1,r(),a.emit("modelLoaded",l)}})),l.on("shownFloorChange",(function(e,t){var i,n;a.destroyed||s===(null===(n=null===(i=a.work)||void 0===i?void 0:i.model)||void 0===n?void 0:n.file)&&a.emit("modelShownFloorChange",e,t)})),l.on("error",(function(e){var t,i,o,c;if(!a.destroyed&&s===(null===(i=null===(t=a.work)||void 0===t?void 0:t.model)||void 0===i?void 0:i.file)){l.bounding.makeEmpty();for(var u=0,h=a.work.observers;u<h.length;u++){var d=h[u];l.bounding.expandByPoint(d.standingPosition),l.bounding.expandByPoint((new n.Vector3).fromArray([d.position.x,2*d.position.y-d.standingPosition.y,d.position.z]))}var p=Tr(l.bounding,new n.Vector3(1,0,1));p.visible=!0,p.name="model_empty",l.add(p);var f,A=a.model;A&&(A.show(),f=A.getMaterial()||{},a.scene.remove(A),A.dispose(),l.setTransparent(A.getTransparent())),f&&l.setMaterial(f),a.model=l,a.scene.add(l),null===(o=a.controller)||void 0===o||o.updateModel(l),null===(c=a.renderer)||void 0===c||c.compile(a.scene,a.camera),a.emit("modelLoadError",e,l),a.throwError(e),a.modelPending=!1,r()}})),this.modelPending=!0,l.load(t,this.textureOptions).catch(le)},t.prototype.commonParams=function(){return{ident:this.ident,scene:this.scene,parallaxScene:this.parallaxScene,helper:this.helperGroup,boundingMesh:this.boundingMesh,camera:this.camera,renderer:this.renderer,scissor:this.scissor,element:this.getElement(),model:this.model,work:this.work,imageOptions:this.imageOptions,enableIOSEDR:this._enableIOSEDR,extraElements:this.extraElements,videoTexture:this.videoTexture,networkSubscribe:this.networkSubscribe,requestProxy:this.requestProxy}},t.prototype.saveControllerPose=function(e){void 0===e&&(e=this.controller),e&&za(e)&&(this.panoramaLikeSavedPose.longitude=this.camera.pose.longitude,this.panoramaLikeSavedPose.latitude=this.camera.pose.latitude,this.panoramaLikeSavedPose.fov=this.camera.pose.fov)},t.prototype.applyController=function(e,i){var n=this;if(!this.renderer)throw new Error("renderer is not initialized.");var r=Ua[e];e===this.currentMode||this.model.empty||this.model.show(),this.model.setTransparent(e===t.Mode.Floorplan||e===t.Mode.Topview||e===t.Mode.Model||e===t.Mode.Mapview),this.currentMode=e;for(var o=new r(i),a=function(e){o.on(e,(function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];var r=n.emit.apply(n,ne([e],t,!1));if(r)return!1}))},s=0,l=qa;s<l.length;s++){a(l[s])}var c=Ua[e].initAnimationEndPose(i),u=i.initial[3],h={panoIndex:i.initial[0],mode:e,longitude:c.longitude,latitude:c.latitude,fov:c.fov,offset:c.offset,distance:c.distance};return Or(this.state,h)||(Lr(this.state,h),this.emit("stateChange",this.state,u)),this.emit("currentStateChange",this.getCurrentState(),u),o.on("cameraUpdate",(function(t,i){var r;if(n.controller){var o=ie(ie({},n.controller.getTargetPose()),{panoIndex:n.panoIndex,mode:e});i&&!1===n.syncingState&&n.state.mode===o.mode&&!Or(n.state,o)&&(Lr(n.state,o),n.emit("stateChange",n.state,i),null===(r=n.analysis)||void 0===r||r.state(n.work,n.state))}n.emit("currentStateChange",n.getCurrentState(),i)})),o.on("initAnimationWillStart",(function(t,i,r){var o,a=ie(ie({},i),{panoIndex:t,mode:e});r&&n.state.mode===a.mode&&!Or(n.state,a)&&(Lr(n.state,a),n.emit("stateChange",n.state,r),null===(o=n.analysis)||void 0===o||o.state(n.work,n.state))})),o.on("initAnimationEnded",(function(t,i,r){var o,a=ie(ie({},i),{panoIndex:t,mode:e});r&&n.state.mode===a.mode&&!Or(n.state,a)&&(Lr(n.state,a),n.emit("stateChange",n.state,r),null===(o=n.analysis)||void 0===o||o.state(n.work,n.state))})),o.on("panoWillArrive",(function(t,i,r){var o;n.panoIndex=t;var a=ie(ie({},i),{panoIndex:t,mode:e});r&&n.state.mode===a.mode&&!Or(n.state,a)&&(Lr(n.state,a),n.emit("stateChange",n.state,r),null===(o=n.analysis)||void 0===o||o.state(n.work,n.state))})),o.on("panoArrived",(function(t,i,r){var o,a=ie(ie({},i),{panoIndex:t,mode:e});r&&n.state.mode===a.mode&&!Or(n.state,a)&&(Lr(n.state,a),n.emit("stateChange",n.state,r),null===(o=n.analysis)||void 0===o||o.state(n.work,n.state))})),o.on("moveToPano",(function(e,t){n.emit("currentStateChange",n.getCurrentState(),t)})),o.on("wantsMoveToPano",(function(e,t,i){var r=n.emit("wantsMoveToPano",e,t,i);r||(r=n.emit("wantsToMoveToPano",e,t,i)),r||n.moveToPano(e,t,i)})),o.on("vrWantsToExit",(function(){n.currentMode===t.Mode.VRPanorama&&(n.exitFullscreen(),n.changeMode(t.Mode.Panorama))})),o.on("error",(function(e){return n.throwError(e)})),o},t.prototype.removeEventListeners=function(){},t.prototype.diposeGPUPickingMaterial=function(){this.meshReplaceMaterialMap.forEach((function(e){e.dispose()})),this.meshOriginMaterialMap.forEach((function(e){e.dispose()}))},t.Mode={Panorama:"Panorama",Model:"Model",Floorplan:"Floorplan",Topview:"Topview",Mapview:"Mapview",DepthPanorama:"DepthPanorama",VRPanorama:"VRPanorama",XRPanorama:"XRPanorama"},t.Line=null,t}(se),ds={instances:{},constructor:hs};"undefined"!=typeof window&&Object.assign(window,{__FIVE_DEBUG__:ds});var ps=function(){function e(){}return e.createButton=function(e){var t=document.createElement("button");function i(){t.style.display="",t.style.cursor="auto",t.style.left="calc(50% - 75px)",t.style.width="150px",t.onmouseenter=null,t.onmouseleave=null,t.onclick=null,t.textContent="VR NOT SUPPORTED"}function n(e){e.style.position="absolute",e.style.bottom="20px",e.style.padding="12px 6px",e.style.border="1px solid #fff",e.style.borderRadius="4px",e.style.background="rgba(0,0,0,0.1)",e.style.color="#fff",e.style.font="normal 13px sans-serif",e.style.textAlign="center",e.style.opacity="0.5",e.style.outline="none",e.style.zIndex="999"}if("xr"in navigator)return t.id="VRButton",t.style.display="none",n(t),navigator.xr.isSessionSupported("immersive-vr").then((function(n){n?(t.style.display="",t.style.cursor="pointer",t.style.left="calc(50% - 50px)",t.style.width="100px",t.textContent="ENTER VR",t.onmouseenter=function(){t.style.opacity="1.0"},t.onmouseleave=function(){t.style.opacity="0.5"},t.onclick=function(){e&&e()}):i()})),t;var r=document.createElement("a");return!1===window.isSecureContext?(r.href=document.location.href.replace(/^http:/,"https:"),r.innerHTML="WEBXR NEEDS HTTPS"):(r.href="https://immersiveweb.dev/",r.innerHTML="WEBXR NOT AVAILABLE"),r.style.left="calc(50% - 90px)",r.style.width="180px",r.style.textDecoration="none",n(r),r},e}();exports.AnimationFrameLoop=ke,exports.BVH=Xt,exports.BVHIntersect=_t,exports.BVHNode=Ht,exports.BVHVector3=qt,exports.Camera=zt,exports.Clipper=Ue,exports.Five=hs,exports.InternalWebGLRenderer=Rt,exports.IntersectMesh=wr,exports.Model=_n,exports.NetworkSubscribe=Ee,exports.PBMContainer=qe,exports.PBMGroup=He,exports.PBMMaterial=Pt,exports.PBMMesh=ze,exports.PROXY_CONTROLLER_EVENT_NAMES=qa,exports.PanoCircleMesh=pr,exports.PanoCircleMeshCustom=yr,exports.PanoCircleMeshSolid=vr,exports.Scene=kt,exports.Subscribe=se,exports.TextureLoader=Et,exports.Tile3D=bn,exports.Tile3DModel=Vn,exports.TileBoundingSphere=Ki,exports.TileCacheNode=Di,exports.TileCubeTextureTarget=Ct,exports.TileCullingVolume=zi,exports.TileOrientedBoundingBox=hn,exports.TileRequestScheduler=Qi,exports.Tileset3D=Cn,exports.Tileset3DTraverser=wn,exports.TilesetCache=Li,exports.Work=ir,exports.XRButton=ps,exports.defaultImageURLTransform=Le,exports.getViewportScale=_a,exports.imageSupport=function(){return Ve||(Ve=Promise.all([Ne("data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A="),Ne("data:image/webp;base64,UklGRjoAAABXRUJQVlA4IC4AAACyAgCdASoCAAIALmk0mk0iIiIiIgBoSygABc6WWgAA/veff/0PP8bA//LwYAAA")]).then((function(e){var t=e[0];return{webp:e[1],avif:t}})).catch((function(){return{webp:!1,avif:!1}})))},exports.parseWork=ar;
|