@realsee/five 5.0.0-alpha.170 → 5.0.0-alpha.171

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.
Files changed (154) hide show
  1. package/docs/classes/five.AnimationFrameLoop.html +1 -1
  2. package/docs/classes/five.BVH.html +1 -1
  3. package/docs/classes/five.BVHIntersect.html +1 -1
  4. package/docs/classes/five.BVHNode.html +1 -1
  5. package/docs/classes/five.BVHVector3.html +1 -1
  6. package/docs/classes/five.Camera.html +1 -1
  7. package/docs/classes/five.Clipper.html +1 -1
  8. package/docs/classes/five.Five.html +1 -1
  9. package/docs/classes/five.InternalWebGLRenderer.html +1 -1
  10. package/docs/classes/five.IntersectMesh.html +1 -1
  11. package/docs/classes/five.Model.html +1 -1
  12. package/docs/classes/five.NetworkSubscribe.html +1 -1
  13. package/docs/classes/five.PBMContainer.html +1 -1
  14. package/docs/classes/five.PBMGroup.html +1 -1
  15. package/docs/classes/five.PBMMaterial.html +1 -1
  16. package/docs/classes/five.PBMMesh.html +1 -1
  17. package/docs/classes/five.PanoCircleMesh.html +1 -1
  18. package/docs/classes/five.PanoCircleMeshCustom.html +1 -1
  19. package/docs/classes/five.PanoCircleMeshSolid.html +1 -1
  20. package/docs/classes/five.Scene.html +1 -1
  21. package/docs/classes/five.Subscribe.html +1 -1
  22. package/docs/classes/five.TextureLoader.html +1 -1
  23. package/docs/classes/five.Tile3D.html +1 -1
  24. package/docs/classes/five.Tile3DModel.html +1 -1
  25. package/docs/classes/five.TileBoundingSphere.html +1 -1
  26. package/docs/classes/five.TileCacheNode.html +1 -1
  27. package/docs/classes/five.TileCubeTextureTarget.html +1 -1
  28. package/docs/classes/five.TileCullingVolume.html +1 -1
  29. package/docs/classes/five.TileOrientedBoundingBox.html +1 -1
  30. package/docs/classes/five.TileRequestScheduler.html +1 -1
  31. package/docs/classes/five.Tileset3D.html +1 -1
  32. package/docs/classes/five.Tileset3DTraverser.html +1 -1
  33. package/docs/classes/five.TilesetCache.html +1 -1
  34. package/docs/classes/five.Work.html +1 -1
  35. package/docs/classes/five.XRButton.html +1 -1
  36. package/docs/classes/gltf_loader.DDSLoader.html +1 -1
  37. package/docs/classes/gltf_loader.DRACOLoader.html +1 -1
  38. package/docs/classes/gltf_loader.GLTFLoader.html +1 -1
  39. package/docs/classes/gltf_loader.GLTFObject.html +1 -1
  40. package/docs/classes/gltf_loader.GLTFParser.html +1 -1
  41. package/docs/classes/gltf_loader.THREEGLTFLoader.html +1 -1
  42. package/docs/classes/line.Line.html +1 -1
  43. package/docs/classes/line.LineGeometry.html +1 -1
  44. package/docs/classes/line.LineMaterial.html +1 -1
  45. package/docs/classes/line.LineSegmentsGeometry.html +1 -1
  46. package/docs/classes/line.THREE_Line2.html +1 -1
  47. package/docs/classes/line.THREE_LineSegments2.html +1 -1
  48. package/docs/classes/react.Store.html +1 -1
  49. package/docs/classes/server.BVH.html +1 -1
  50. package/docs/classes/server.BVHIntersect.html +1 -1
  51. package/docs/classes/server.BVHNode.html +1 -1
  52. package/docs/classes/server.BVHVector3.html +1 -1
  53. package/docs/classes/server.Model.html +1 -1
  54. package/docs/classes/server.PBMContainer.html +1 -1
  55. package/docs/classes/server.PBMGroup.html +1 -1
  56. package/docs/classes/server.PBMMesh.html +1 -1
  57. package/docs/classes/sticker.Sticker.html +1 -1
  58. package/docs/classes/vfx.Airflow.html +1 -1
  59. package/docs/classes/vfx.Flame.html +1 -1
  60. package/docs/classes/vfx.Particle.html +1 -1
  61. package/docs/classes/vfx.SpotLight.html +1 -1
  62. package/docs/index.html +1 -1
  63. package/docs/interfaces/five.AddableObject.html +1 -1
  64. package/docs/interfaces/five.AnimationFrame.html +1 -1
  65. package/docs/interfaces/five.CameraPose.html +1 -1
  66. package/docs/interfaces/five.ClipperParameter.html +1 -1
  67. package/docs/interfaces/five.DepthPanoramaControllerCustomInitArgs.html +1 -1
  68. package/docs/interfaces/five.EventCallback.html +1 -1
  69. package/docs/interfaces/five.FiveInitArgs.html +1 -1
  70. package/docs/interfaces/five.FloorplanControllerCustomInitArgs.html +1 -1
  71. package/docs/interfaces/five.ImageOptions.html +1 -1
  72. package/docs/interfaces/five.ImageURLMappings.html +1 -1
  73. package/docs/interfaces/five.ImageURLOptions.html +1 -1
  74. package/docs/interfaces/five.IntersectMeshInterface.html +1 -1
  75. package/docs/interfaces/five.Intersection.html +1 -1
  76. package/docs/interfaces/five.MapviewControllerCustomInitArgs.html +1 -1
  77. package/docs/interfaces/five.ModelControllerCustomInitArgs.html +1 -1
  78. package/docs/interfaces/five.ModelEventCallback.html +1 -1
  79. package/docs/interfaces/five.MotionKeyframe.html +1 -1
  80. package/docs/interfaces/five.MovePanoOptions.html +1 -1
  81. package/docs/interfaces/five.NetworkOptions.html +1 -1
  82. package/docs/interfaces/five.PBMPanoPicture.html +1 -1
  83. package/docs/interfaces/five.PBMParameters.html +1 -1
  84. package/docs/interfaces/five.PanoCircleMeshCustomOptions.html +1 -1
  85. package/docs/interfaces/five.PanoCircleMeshInterface.html +1 -1
  86. package/docs/interfaces/five.PanoCircleMeshOptions.html +1 -1
  87. package/docs/interfaces/five.PanoCircleMeshSolidOptions.html +1 -1
  88. package/docs/interfaces/five.PanoramaControllerCustomInitArgs.html +1 -1
  89. package/docs/interfaces/five.PanoramaLikeControllerCustomInitArgs.html +1 -1
  90. package/docs/interfaces/five.Pose.html +1 -1
  91. package/docs/interfaces/five.Scissor.html +1 -1
  92. package/docs/interfaces/five.State.html +1 -1
  93. package/docs/interfaces/five.SubscribeMixinType.emit.html +1 -1
  94. package/docs/interfaces/five.SubscribeMixinType.hasListener.html +1 -1
  95. package/docs/interfaces/five.SubscribeMixinType.off.html +1 -1
  96. package/docs/interfaces/five.SubscribeMixinType.on.html +1 -1
  97. package/docs/interfaces/five.SubscribeMixinType.once.html +1 -1
  98. package/docs/interfaces/five.TextureOptions.html +1 -1
  99. package/docs/interfaces/five.Tile3DModelLoaderOptions.html +1 -1
  100. package/docs/interfaces/five.TileBoundingVolume.html +1 -1
  101. package/docs/interfaces/five.TileContent.html +1 -1
  102. package/docs/interfaces/five.TileCubeNode.html +1 -1
  103. package/docs/interfaces/five.TileCubeTree.html +1 -1
  104. package/docs/interfaces/five.Tileset3dOptions.html +1 -1
  105. package/docs/interfaces/five.TilesetJSON.html +1 -1
  106. package/docs/interfaces/five.TilesetJSONNode.html +1 -1
  107. package/docs/interfaces/five.TopviewControllerCustomInitArgs.html +1 -1
  108. package/docs/interfaces/five.VRPanoramaControllerCustomInitArgs.html +1 -1
  109. package/docs/interfaces/five.WebXRSelectParams.html +1 -1
  110. package/docs/interfaces/five.WorkCubeImage.html +1 -1
  111. package/docs/interfaces/five.WorkImage.html +1 -1
  112. package/docs/interfaces/five.WorkInitial.html +1 -1
  113. package/docs/interfaces/five.WorkModel.html +1 -1
  114. package/docs/interfaces/five.WorkModelTiles.html +1 -1
  115. package/docs/interfaces/five.WorkObserver.html +1 -1
  116. package/docs/interfaces/five.WorkTile.html +1 -1
  117. package/docs/interfaces/five.WorkVideo.html +1 -1
  118. package/docs/interfaces/five.XRPanoramaControllerCustomInitArgs.html +1 -1
  119. package/docs/interfaces/gltf_loader.DDS.html +1 -1
  120. package/docs/interfaces/gltf_loader.GLTF.html +1 -1
  121. package/docs/interfaces/gltf_loader.GLTFReference.html +1 -1
  122. package/docs/interfaces/gltf_loader.THREEGLTF.html +1 -1
  123. package/docs/interfaces/react.FiveActionReactCallbacks.html +1 -1
  124. package/docs/interfaces/react.FiveInjectionTypes.html +1 -1
  125. package/docs/interfaces/react.PropTypeOfFiveFeatures.html +1 -1
  126. package/docs/interfaces/server.Intersection.html +1 -1
  127. package/docs/interfaces/server.ModelEventCallback.html +1 -1
  128. package/docs/interfaces/sticker.IntersectionLike.html +1 -1
  129. package/docs/interfaces/vfx.ParticleArgs.html +1 -1
  130. package/docs/interfaces/vfx.ParticleTweenKeyframe.html +1 -1
  131. package/docs/interfaces/vue.FiveActionVueCallbacks.html +1 -1
  132. package/docs/modules/five.SubscribeMixinType.html +1 -1
  133. package/docs/modules/five.html +1 -1
  134. package/docs/modules/gltf_loader.html +1 -1
  135. package/docs/modules/line.html +1 -1
  136. package/docs/modules/react.html +1 -1
  137. package/docs/modules/server.html +1 -1
  138. package/docs/modules/sticker.html +1 -1
  139. package/docs/modules/vfx.html +1 -1
  140. package/docs/modules/vue.html +1 -1
  141. package/docs/modules.html +1 -1
  142. package/five/index.js +3 -3
  143. package/gltf-loader/index.js +3 -3
  144. package/line/index.js +3 -3
  145. package/package.json +1 -1
  146. package/react/index.js +2 -2
  147. package/server/index.js +2 -2
  148. package/sticker/index.js +3 -3
  149. package/umd/five-gltf-loader.js +1 -1
  150. package/umd/five-line.js +1 -1
  151. package/umd/five-sticker.js +1 -1
  152. package/umd/five.js +1 -1
  153. package/vfx/index.js +2 -2
  154. 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: 2022-12-05
5
- * Version: 5.0.0-alpha.170
4
+ * Generated: 2022-12-08
5
+ * Version: 5.0.0-alpha.171
6
6
  *
7
7
  * Terms:
8
8
  * Realsee SDK License Agreement
@@ -369,4 +369,4 @@ function(e,t){for(var i=e.toByteArray(),n=0;n<i.length&&0==i[n];)++n;if(i.length
369
369
  * http://hammerjs.github.io/
370
370
  *
371
371
  * Copyright (c) 2016 Jorik Tangelder;
372
- * Licensed under the MIT license */var wo=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,u=Date.now;function c(e,t,i){return setTimeout(g(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 g(e,t){return function(){return e.apply(t,arguments)}}function m(e,t){return"function"==typeof e?e.apply(t&&t[0]||n,t):e}function y(e,t){return e===n?t:e}function x(e,t,i){d(S(t),(function(t){e.addEventListener(t,i,!1)}))}function b(e,t,i){d(S(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 E(e,t){return e.indexOf(t)>-1}function S(e){return e.trim().split(/\s+/g)}function M(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 C(e){return Array.prototype.slice.call(e,0)}function I(e,t,i){for(var n=[],r=[],o=0;o<e.length;){var a=t?e[o][t]:e[o];M(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 T(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 B=1;function P(t){var i=t.ownerDocument||t;return i.defaultView||i.parentWindow||e}var R="ontouchstart"in e,D=T(e,"PointerEvent")!==n,O=R&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),L="touch",F="mouse",k=24,N=["x","y"],V=["clientX","clientY"];function Q(e,t){var i=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(t){m(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=H(t));o>1&&!i.firstMultiple?i.firstMultiple=H(t):1===o&&(i.firstMultiple=!1);var a=i.firstInput,s=i.firstMultiple,c=s?s.center:a.center,h=t.center=q(r);t.timeStamp=u(),t.deltaTime=t.timeStamp-a.timeStamp,t.angle=K(c,h),t.distance=_(c,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=j(t.deltaX,t.deltaY);var d=z(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 _(t[0],t[1],V)/_(e[0],e[1],V)}(s.pointers,r):1,t.rotation=s?function(e,t){return K(t[1],t[0],V)+K(e[1],e[0],V)}(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,u=t.timeStamp-s.timeStamp;if(8!=t.eventType&&(u>25||s.velocity===n)){var c=t.deltaX-s.deltaX,h=t.deltaY-s.deltaY,d=z(u,c,h);r=d.x,o=d.y,i=l(d.x)>l(d.y)?d.x:d.y,a=j(c,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 H(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:u(),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 z(e,t,i){return{x:t/e||0,y:i/e||0}}function j(e,t){return e===t?1:l(e)>=l(t)?e<0?2:4:t<0?8:16}function _(e,t,i){i||(i=N);var n=t[i[0]]-e[i[0]],r=t[i[1]]-e[i[1]];return Math.sqrt(n*n+r*r)}function K(e,t,i){i||(i=N);var n=t[i[0]]-e[i[0]],r=t[i[1]]-e[i[1]];return 180*Math.atan2(r,n)/Math.PI}Q.prototype={handler:function(){},init: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)},destroy: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)}};var G={mousedown:1,mousemove:2,mouseup:4},W="mousedown",X="mousemove mouseup";function Y(){this.evEl=W,this.evWin=X,this.pressed=!1,Q.apply(this,arguments)}v(Y,Q,{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:L,3:"pen",4:F,5:"kinect"},$="pointerdown",ee="pointermove pointerup pointercancel";function te(){this.evEl=$,this.evWin=ee,Q.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}e.MSPointerEvent&&!e.PointerEvent&&($="MSPointerDown",ee="MSPointerMove MSPointerUp MSPointerCancel"),v(te,Q,{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==L,l=M(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,Q.apply(this,arguments)}function ae(e,t){var i=C(e.touches),n=C(e.changedTouches);return 12&t&&(i=I(i.concat(n),"identifier",!0)),[i,n]}v(oe,Q,{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:L,srcEvent:e})}}});var se={touchstart:1,touchmove:2,touchend:4,touchcancel:8},le="touchstart touchmove touchend touchcancel";function ue(){this.evTarget=le,this.targetIds={},Q.apply(this,arguments)}function ce(e,t){var i=C(e.touches),n=this.targetIds;if(3&t&&1===i.length)return n[i[0].identifier]=!0,[i,i];var r,o,a=C(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?[I(o.concat(s),"identifier",!0),s]:void 0}v(ue,Q,{handler:function(e){var t=se[e.type],i=ce.call(this,e,t);i&&this.callback(this.manager,t,{pointers:i[0],changedPointers:i[1],pointerType:L,srcEvent:e})}});function he(){Q.apply(this,arguments);var e=g(this.handler,this);this.touch=new ue(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,Q,{handler:function(e,t,i){var n=i.pointerType==L,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?T(a.style,"touchAction"):n,ve=Ae!==n,ge="compute",me="auto",ye="manipulation",xe="none",be="pan-x",we="pan-y",Ee=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 Se(e,t){this.manager=e,this.set(t)}Se.prototype={set:function(e){e==ge&&(e=this.compute()),ve&&this.manager.element.style&&Ee[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){m(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))})),function(e){if(E(e,xe))return xe;var t=E(e,be),i=E(e,we);if(t&&i)return xe;if(t||i)return t?be:we;if(E(e,ye))return ye;return me}(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=E(n,xe)&&!Ee.none,o=E(n,we)&&!Ee["pan-y"],a=E(n,be)&&!Ee["pan-x"];if(r){var s=1===e.pointers.length,l=e.distance<2,u=e.deltaTime<250;if(s&&l&&u)return}if(!a||!o)return r||o&&6&i||a&&i&k?this.preventSrc(t):void 0}},preventSrc:function(e){this.manager.session.prevented=!0,e.preventDefault()}};var Me=32;function Ce(e){this.options=r({},this.defaults,e||{}),this.id=B++,this.manager=null,this.options.enable=y(this.options.enable,!0),this.state=1,this.simultaneous={},this.requireFail=[]}function Ie(e){return 16&e?"cancel":8&e?"end":4&e?"move":2&e?"start":""}function Te(e){return 16==e?"down":8==e?"up":2==e?"left":4==e?"right":""}function Be(e,t){var i=t.manager;return i?i.get(e):e}function Pe(){Ce.apply(this,arguments)}function Re(){Pe.apply(this,arguments),this.pX=null,this.pY=null}function De(){Pe.apply(this,arguments)}function Oe(){Ce.apply(this,arguments),this._timer=null,this._input=null}function Le(){Pe.apply(this,arguments)}function Fe(){Pe.apply(this,arguments)}function ke(){Ce.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function Ne(e,t){return(t=t||{}).recognizers=y(t.recognizers,Ne.defaults.preset),new Ve(e,t)}Ce.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=Be(e,this)).id]||(t[e.id]=e,e.recognizeWith(this)),this},dropRecognizeWith:function(e){return h(e,"dropRecognizeWith",this)||(e=Be(e,this),delete this.simultaneous[e.id]),this},requireFailure:function(e){if(h(e,"requireFailure",this))return this;var t=this.requireFail;return-1===M(t,e=Be(e,this))&&(t.push(e),e.requireFailure(this)),this},dropRequireFailure:function(e){if(h(e,"dropRequireFailure",this))return this;e=Be(e,this);var t=M(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+Ie(i)),n(t.options.event),e.additionalEvent&&n(e.additionalEvent),i>=8&&n(t.options.event+Ie(i))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=Me},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(!m(this.options.enable,[this,t]))return this.reset(),void(this.state=Me);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,Ce,{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:Me}}),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&k&&t.push(be),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=Te(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),v(De,Pe,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[xe]},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(Oe,Ce,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[me]},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=c((function(){this.state=8,this.tryEmit()}),t.time,this);else if(4&e.eventType)return 8;return Me},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=u(),this.manager.emit(this.options.event,this._input)))}}),v(Le,Pe,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[xe]},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&k&&(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=Te(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),v(ke,Ce,{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||_(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=c((function(){this.state=8,this.tryEmit()}),t.interval,this),2):8}return Me},failTimeout:function(){return this._timer=c((function(){this.state=Me}),this.options.interval,this),Me},reset:function(){clearTimeout(this._timer)},emit:function(){8==this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),Ne.VERSION="2.0.7",Ne.defaults={domEvents:!1,touchAction:ge,enable:!0,inputTarget:null,inputClass:null,preset:[[Le,{enable:!1}],[De,{enable:!1},["rotate"]],[Fe,{direction:6}],[Re,{direction:6},["swipe"]],[ke],[ke,{event:"doubletap",taps:2},["tap"]],[Oe]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};function Ve(e,t){var i;this.options=r({},Ne.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||(D?te:O?ue:R?he:Y))(i,U),this.touchAction=new Se(this,this.options.touchAction),Qe(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 Qe(e,t){var i,n=e.element;n.style&&(d(e.options.cssProps,(function(r,o){i=T(n.style,o),t?(e.oldCssProps[i]=n.style[i],n.style[i]=r):n.style[i]=e.oldCssProps[i]||""})),t||(e.oldCssProps={}))}return Ve.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 Ce)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=M(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(S(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(S(e),(function(e){t?i[e]&&i[e].splice(M(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&&Qe(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},r(Ne,{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:Me,DIRECTION_NONE:1,DIRECTION_LEFT:2,DIRECTION_RIGHT:4,DIRECTION_UP:8,DIRECTION_DOWN:16,DIRECTION_HORIZONTAL:6,DIRECTION_VERTICAL:k,DIRECTION_ALL:30,Manager:Ve,Input:Q,TouchAction:Se,TouchInput:ue,MouseInput:Y,PointerEventInput:te,TouchMouseInput:he,SingleTouchInput:oe,Recognizer:Ce,AttrRecognizer:Pe,Tap:ke,Pan:Re,Swipe:Fe,Pinch:De,Rotate:Le,Press:Oe,on:x,off:b,each:d,merge:A,extend:f,assign:r,inherit:v,bindFn:g,prefixed:T}),Ne}("undefined"!=typeof window?window:{},"undefined"!=typeof document?document:{});function Eo(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 So=new n.OrthographicCamera(-1,1,1,-1,0,1),Mo=new n.BufferGeometry;Mo.setAttribute("position",new n.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3)),Mo.setAttribute("uv",new n.Float32BufferAttribute([0,2,0,0,2,0],2));var Co=new n.Mesh(Mo),Io=new n.Scene;Io.add(Co);var To=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=Co.material;this.material.uniforms.inputBuffer.value=e.texture,Co.material=this.material,this.renderer.setRenderTarget(t||null),this.renderer.render(Io,So),this.renderer.setRenderTarget(i),Co.material=n},e.prototype.dispose=function(){this.material.dispose()},e}(),Bo=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=Co.material;this.material.uniforms.inputValue.value.copy(e),Co.material=this.material,this.renderer.setRenderTarget(t||null),this.renderer.render(Io,So),this.renderer.setRenderTarget(i),Co.material=n},e.prototype.dispose=function(){this.material.dispose()},e}(),Po=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 Le(t,e),t}(To),Ro=function(){function e(e){this.enable=!0,this.renderer=e,this.copyPass=new Po(this.renderer)}return e.prototype.render=function(e,t){this.copyPass.render(e,t)},e.prototype.dispose=function(){this.copyPass.dispose()},e}(),Do=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 qr({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)})),dt.shared.add((function(){return r.initAnimation.apply(r,o.initial)}),!0),r}return Le(t,e),t.parseArgs=function(e){return Fe({},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),xo(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 Ro(this.renderer)),this.copyEffect.render(e,t))},t.prototype.updateCamera=function(e,t,i){return this.userAction=i,this.cameraMotion.set(e,t).catch(He)},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(ze())[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,u=null!==(r=e.distance)&&void 0!==r?r:this.camera.pose.distance,c=null!==(o=e.offset)&&void 0!==o?o:this.camera.pose.offset,h=this.camera.position.clone(),d=io(a,this.camera.pose.longitude,2*Math.PI)||io(s,this.camera.pose.latitude),p=io(l,this.camera.pose.fov),f=io(u,this.camera.pose.distance),A=ro(c,this.camera.pose.offset);this.camera.setFromPose({longitude:a,latitude:s,fov:l,distance:u,offset:c});var v=ro(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:c,distance:u},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 Bt(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 Bt(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 Bt(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 Eo(e,this.element,this.scissor)},t.prototype.bindEvents=function(e){var t=this,i=function(e){var i=Eo(e,t.element,t.scissor);return!(Math.abs(i.x)>1||Math.abs(i.y)>1)},n=new wo.Manager(e),r=function(e){return e.session.firstInput||null};n.add(new wo.Pan({threshold:10,pointers:0})),n.add(new wo.Tap({interval:410})),n.add(new wo.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:Er(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,u=s(o?"pinch":"pinchstart",l,e);null===o?o={firstInput:u,prevInput:u}:o.prevInput=u,t.onPinchGesture(u),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()}},u=function(e){if(!Ao()){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()}},c=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:He};var r=n-t.pressState.time;t.onPressGesture({x:e.x,y:e.y,delta:r},!1),t.pressState&&(t.pressState.stop=dt.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},ze())},p=function(e){f(),h({x:e.clientX,y:e.clientY},ze())},f=function(){var e;if(t.pressState){var i=ze()-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}},g=function(e){if(e.preventDefault(),!Ao()){var n=v(e),r=(A={firstInput:n}).firstInput;r&&!i(r.center)||t.onPinchGesture(n)}},m=function(e){if(e.preventDefault(),!Ao()&&A){var n=v(e),r=A.firstInput;r&&!i(r.center)||t.onPinchGesture(n)}},y=function(e){if(e.preventDefault(),!Ao()&&A){var n=v(e),r=A.firstInput;A=null,r&&!i(r.center)||t.onPinchGesture(n)}},x=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",u,!1),e.addEventListener("mouseout",c,!1),e.addEventListener("touchstart",d,!1),e.addEventListener("touchend",f,!1),e.addEventListener("touchcancel",f,!1),e.addEventListener("mousedown",p,!1),e.addEventListener("mouseup",f,!1),e.addEventListener("gesturestart",g,{passive:!1}),e.addEventListener("gesturechange",m,{passive:!1}),e.addEventListener("gestureend",y,{passive:!1}),e.addEventListener("touchstart",x,!1),e.addEventListener("contextmenu",x,!1);return Object.assign((function(){n.destroy(),e.removeEventListener("wheel",l,!1),e.removeEventListener("mousemove",u,!1),e.removeEventListener("mouseout",c,!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",g,!1),e.removeEventListener("gesturechange",m,!1),e.removeEventListener("gestureend",y,!1),e.removeEventListener("touchstart",x,!1),e.removeEventListener("contextmenu",x,!1)}),{element:e})},t}(Ue),Oo=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 qr({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 Le(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,u,c=e.parseArgs.call(this,t);return Fe(Fe({},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,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!==(u=t.intersectMeshCreator)&&void 0!==u?u:function(){return new eo}})},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:Er(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(He)},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(Er(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),xo(i)||this.model.setMaterial(i),xo(r)||this.setCamera(r)}},t.prototype.getTargetPose=function(){var e=this.cameraMotion.getKeyFrameSegment(ze())[1],t=this.locationMotion.getKeyFrameSegment(ze())[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,u=this;if(!this.destroyed){this.pending=!1,this.userAction=o;var c={longitude:null!==(a=i.longitude)&&void 0!==a?a:this.defaultLongitude,latitude:Er(null!==(s=i.latitude)&&void 0!==s?s:this.defaultLatitude,this.minLatitude,this.maxLatitude),fov:Er(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=Bt(c,["longitude","latitude","fov"]),d={x:c.offset.x,y:c.offset.y,z:c.offset.z,distance:c.distance,modelAlpha:1,perspToOrtho:0,orthoDistance:c.distance};this.emit("initAnimationWillStart",e,c,this.userAction),this.cameraMotion.set(h,r).catch(He),this.locationMotion.set(d,r).then((function(){u.emit("initAnimationEnded",e,c,u.userAction)}),(function(t){var i=bo(u.camera.pose);u.emit("initAnimationEnded",e,i,u.userAction)})).catch(He)}},t.prototype.updateRenderSize=function(){this.locationMotion.set({distance:t.distanceFromModel(this.model,this.defaultFov,this.camera.aspect)},0).catch(He)},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=yo(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=Fe({},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=co(this.cameraMotion.value.longitude+r.longitude),s=Er(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(He);var u=n.longitude>1e-4||n.longitude<-1e-4||n.latitude>1e-4||n.latitude<-1e-4;this.emit("interiaPan",l,!u),u?dt.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 Bt(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=co(this.cameraMotion.value.longitude+s.longitude),u=Er(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&&(u=this.cameraMotion.value.latitude);var c={longitude:l,latitude:u,fov:this.camera.pose.fov,offset:this.camera.pose.offset,distance:this.camera.pose.distance};if(!this.emit("wantsPanGesture",c,e.isFinal))if(this.emit("gesture","pan",n,e.isFinal),this.emit("panGesture",c,e.isFinal),this.userAction=!0,this.interiaMovement=!1,this.hideIntersectMesh(),this.cameraMotion.set({longitude:c.longitude,latitude:c.latitude},0).catch(He),e.isFinal)if(!this.emit("wantsInteriaPan",c)){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 Bt(e,["x","y"])}));if(!this.emit("wantsGesture","pinch",r,n)){var o=Er(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(He),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 u=this.camera.position.clone().sub(s);this.intersectMesh.rotation.z=-Math.atan2(u.z,u.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=Er(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(He),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 Bt(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(!mr(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=He);var n=this.work.observers[e],r=this.work.allowHosts;return Promise.all(["right","left","up","down","front","back"].map((function(t){var o=Fe({key:"pano.".concat(e,".").concat(t),basisLoaderInitialized:ii.isInitialized()},Bt(i.imageOptions,["size","format","quality","mappings"])),a=n.images[t];return lt(i.imageOptions.transform?i.imageOptions.transform(a,o):vt(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}(Do),Lo={longitude:0,latitude:Math.PI/2},Fo={longitude:0,latitude:0},ko={longitude:Math.PI/2,latitude:0},No={longitude:Math.PI,latitude:0},Vo={longitude:1.5*Math.PI,latitude:0};var Qo=function(e){function t(i){var n=t.parseArgs(i);return e.call(this,n)||this}return Le(t,e),t.parseArgs=function(t){var i=[t.initial[0],Fe(Fe({},t.initial[1]),{longitude:0,latitude:Math.PI/2}),t.initial[2],t.initial[3]],n=Fe(Fe({},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:Oo.distanceFromModel(this.model,this.defaultFov,this.camera.aspect)},0).catch(He)},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:Er(null!==(o=t.fov)&&void 0!==o?o:this.defaultFov,this.minFov,this.maxFov),offset:this.model.bounding.getCenter(new n.Vector3),distance:Oo.distanceFromModel(this.model,this.defaultFov,this.camera.aspect)},l=Bt(s,["longitude","latitude","fov"]),u={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(He),this.locationMotion.set(u,i).then((function(){a.emit("initAnimationEnded",e,s,a.userAction)}),(function(t){var i=bo(a.camera.pose);a.emit("initAnimationEnded",e,i,a.userAction)}))}},t.prototype.getZoomOffsetFromFov=function(e,t,i){var r=this.camera.getWorldDirection(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 u=l.ray.direction,c=u.angleTo(r),h=Oo.distanceFromModel(this.model,this.defaultFov,this.camera.aspect),d=h*Math.tan(c),p=u.clone().setLength(h*Math.cos(c)).projectOnPlane(r),f=p.length(),A=s/f*p.x*d,v=s/f*p.z*d,g=s/f*p.y*d;return new n.Vector3(A,g,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 Bt(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,u=l.getCenter(new n.Vector3),c=(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===Lo.longitude&&this.cameraMotion.value.latitude===Lo.latitude?(p.left.set(1,0,0),p.up.set(0,0,-1),p.cameraDirection="y"):this.cameraMotion.value.longitude===Fo.longitude&&this.cameraMotion.value.latitude===Fo.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===Vo.longitude&&this.cameraMotion.value.latitude===Vo.latitude?(p.left.set(0,0,-1),p.up.set(0,-1,0),p.cameraDirection="x"):this.cameraMotion.value.longitude===ko.longitude&&this.cameraMotion.value.latitude===ko.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=Er(s.x,u.x-c,u.x+c),s.y=Er(s.y,u.y-h,u.y+h),s.z=Er(s.z,u.z-d,u.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(He))}}},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 Bt(e,["x","y"])}));if(!this.emit("wantsGesture","pinch",r,n)){var o=Er(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===Lo.longitude&&this.cameraMotion.value.latitude===Lo.latitude?s.y=0:this.cameraMotion.value.longitude===Fo.longitude&&this.cameraMotion.value.latitude===Fo.latitude||this.cameraMotion.value.longitude===No.longitude&&this.cameraMotion.value.latitude===No.latitude?s.z=0:(this.cameraMotion.value.longitude===Vo.longitude&&this.cameraMotion.value.latitude===Vo.latitude||this.cameraMotion.value.longitude===ko.longitude&&this.cameraMotion.value.latitude===ko.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(He),this.cameraMotion.set({longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude,fov:o},0).catch(He),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=Er(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===Lo.longitude&&this.cameraMotion.value.latitude===Lo.latitude?a.y=0:this.cameraMotion.value.longitude===Fo.longitude&&this.cameraMotion.value.latitude===Fo.latitude||this.cameraMotion.value.longitude===No.longitude&&this.cameraMotion.value.latitude===No.latitude?a.z=0:(this.cameraMotion.value.longitude===Vo.longitude&&this.cameraMotion.value.latitude===Vo.latitude||this.cameraMotion.value.longitude===ko.longitude&&this.cameraMotion.value.latitude===ko.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(He),this.cameraMotion.set({longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude,fov:r},0).catch(He),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}(Oo);function Uo(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+=Uo(e[o],!1)+",";return r>-1&&(n+=Uo(e[o],!1)),n+"]"}if(e instanceof Object){if("function"==typeof e.toJSON)return Uo(e.toJSON(),t);var a=Object.keys(e).sort(),s=a.length;for(n="",o=0;o<s;){var l=a[o],u=Uo(e[l],!0);void 0!==u&&(o&&""!==n&&(n+=","),n+=JSON.stringify(l)+":"+u),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 Ho(e){return Te(String(Uo(e,!1)))}var qo,zo=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 Le(t,e),t.parseArgs=function(t){var i,n,r,o,a,s,l,u,c,h=e.parseArgs.call(this,t);return Fe(Fe({},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!==(u=t.moveSpeed)&&void 0!==u?u:3.2,intersectMeshCreator:null!==(c=t.intersectMeshCreator)&&void 0!==c?c:function(){return new eo}})},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:Er(null!==(i=s.latitude)&&void 0!==i?i:r.defaultLatitude,r.minLatitude,r.maxLatitude),fov:Er(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 Er(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(He)},t.prototype.requestInteriaMovement=function(e,t){var i=this;if(!1!==this.interiaMovement){for(var n=Fe({},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=co(this.cameraMotion.value.longitude+r.longitude),s=Er(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(He);var u=n.longitude>1e-4||n.longitude<-1e-4||n.latitude>1e-4||n.latitude<-1e-4;this.emit("interiaPan",l,!u),u?dt.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 Bt(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=co(this.cameraMotion.value.longitude+o.longitude),s=Er(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 u={longitude:l.longitude,latitude:l.latitude,fov:l.fov};if(this.cameraMotion.set(u,0).catch(He),e.isFinal)if(!this.emit("wantsInteriaPan",l)){this.interiaMovement=!0;var c=e.velocityX,h=.6*e.velocityY;Math.abs(h)>.5&&Math.abs(c)<.5&&(c=0),this.requestInteriaMovement(this.coordinatesForOffset({x:c,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 Bt(e,["x","y"])}));if(!this.emit("wantsGesture","pinch",o,r)){var a=Er(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(He),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=Er(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(He),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 u=this.camera.position.clone().sub(s);this.intersectMesh.rotation.z=-Math.atan2(u.z,u.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}(Do);function jo(){return qo||(qo=new Promise((function(e){var t,i=document.createElement("video");i.muted=!0,i.src="data:video/mp4;base64,AAAAHGZ0eXBNNFYgAAACAGlzb21pc28yYXZjMQAAAAhmcmVlAAAGF21kYXTeBAAAbGliZmFhYyAxLjI4AABCAJMgBDIARwAAArEGBf//rdxF6b3m2Ui3lizYINkj7u94MjY0IC0gY29yZSAxNDIgcjIgOTU2YzhkOCAtIEguMjY0L01QRUctNCBBVkMgY29kZWMgLSBDb3B5bGVmdCAyMDAzLTIwMTQgLSBodHRwOi8vd3d3LnZpZGVvbGFuLm9yZy94MjY0Lmh0bWwgLSBvcHRpb25zOiBjYWJhYz0wIHJlZj0zIGRlYmxvY2s9MTowOjAgYW5hbHlzZT0weDE6MHgxMTEgbWU9aGV4IHN1Ym1lPTcgcHN5PTEgcHN5X3JkPTEuMDA6MC4wMCBtaXhlZF9yZWY9MSBtZV9yYW5nZT0xNiBjaHJvbWFfbWU9MSB0cmVsbGlzPTEgOHg4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AAATYAAAE9AAABRAAAAUjAAAFPwAABVIAAAVuAAAFgQAABZ0AAAWwAAAFzAAABegAAAX7AAAGFwAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTUuMzMuMTAw",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 _o,Ko=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 Le(t,e),t}(To),Go=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 Le(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}(To),Wo=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 Le(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}(To),Xo=function(e){function t(t){var i=e.call(this,t)||this;return i.enableTime=ze(),i.renderer=t,i.valuePass=new Bo(i.renderer),i.luminancePass=new Ko(i.renderer,Math.sqrt(1/3)),i.nextStepPass=new Go(i.renderer,.01),i.luminanceAdaptivePass=new Wo(i.renderer),i}return Le(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=ze()),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((ze()-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}(Ro),Yo=null!==(_o=Math.SQRT1_2)&&void 0!==_o?_o:Math.sqrt(2),Zo={up:new n.Quaternion(Yo,0,0,Yo),down:new n.Quaternion(-Yo,0,0,Yo),left:new n.Quaternion(0,Yo,0,Yo),right:new n.Quaternion(0,-Yo,0,Yo),front:new n.Quaternion(0,0,0,1),back:new n.Quaternion(0,1,0,0)},Jo=new Float32Array([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),$o=new Float32Array([0,0,1,0,0,1,1,1]),ea=new Uint8Array([0,1,2,1,3,2]),ta=new n.BufferGeometry;ta.setAttribute("position",new n.BufferAttribute(Jo,3)),ta.setAttribute("uv",new n.BufferAttribute($o,2)),ta.setIndex(new n.BufferAttribute(ea,1));var ia=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 Le(t,e),t}(n.ShaderMaterial),na=function(e){function t(t,i){var r=e.call(this,ta,new ia)||this;return t.box.getCenter(r.position),r.quaternion.multiplyQuaternions((new n.Quaternion).setFromAxisAngle(new n.Vector3(0,1,0),-Math.PI),Zo[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(He),r}return Le(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),ra=function(e){function t(){var t=e.call(this)||this;return t.needsRender=!1,t.name="tiling",t}return Le(t,e),t}(n.Group),oa=function(){function e(e,t,i){this.disposed=!1,this.textureLoader=new oi(e),this.minLevel=t,this.level=0,this.panoIndex=0,this.pedding=0,this.tileTree=It(this.minLevel),this.tileMeshes=new Map,this.resource=[],this.luminance=null,this.imageOptions=i,this.object=new ra,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=It(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&&Tt(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,u=function(e){var t=c.resource.filter((function(t){return t.level===e.level}))[0];if(!t)return"continue";if(l.add(e),c.tileMeshes.has(e))return c.tileMeshes.get(e).activeTime=i,"continue";var n=t.size,o=c.imageOptions.transform,a=Math.pow(2,e.level)*e.position.y,s=Math.pow(2,e.level)*e.position.x,u="".concat(c.panoIndex,".").concat(e.face,".").concat(e.level,".").concat(a,".").concat(s),h=Fe(Fe({key:"pano_tile.".concat(u),basisLoaderInitialized:ii.isInitialized()},Bt(c.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=c.textureLoader.loadTexture(t[e.face],{imageURL:{transform:o,options:h},preInit:!0}).then((function(e){return e.body})),p=null;if(c.luminance){var f=c.luminance[e.face],A=f.match(/\/cube_(\d+)\//),v=!!A&&Number(A[1]);if(!1!==v){var g=Fe(Fe({},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(u)});p=c.textureLoader.loadTexture(f,{imageURL:{transform:c.imageOptions.transform,options:g},preInit:!0}).then((function(e){return e.body})).catch((function(){return null}))}}c.pedding++;var m=Promise.all([d,p]).then((function(e){return r.pedding--,e}),(function(e){return r.pedding--,Promise.reject(e)})),y=new na(e,m);y.name="tiling:tile-".concat(u),y.activeTime=i,y.renderOrder=e.level,c.tileMeshes.set(e,y),c.object.needsRender=!0,c.object.add(y)},c=this,h=0,d=a;h<d.length;h++){u(g=d[h])}var p=[];this.tileMeshes.forEach((function(e,t){l.has(t)||p.push(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 g=v[A],m=this.tileMeshes.get(g);m&&(m.dispose(),this.object.remove(m),this.object.needsRender=!0),this.tileMeshes.delete(g)}}},e.prototype.dispose=function(){this.cleanup(),this.resource=[],this.disposed=!0},e}(),aa=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]),sa=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]),la=new n.BufferGeometry;la.setAttribute("position",new n.BufferAttribute(aa,3)),la.setIndex(new n.BufferAttribute(sa,1));var ua=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(la,this.material),this.object.visible=!1,this.object.renderOrder=-1,this.object.frustumCulled=!1,this.object.name="pano-video",this.alphaMotion=new qr({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(He),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(He));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}(),ca=(new n.Matrix4).makeRotationAxis(new n.Vector3(0,1,0),Math.PI),ha=new n.Vector3(-1,1,1),da=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.pop=function(){var e=this.pool.pop();return e||new n.WebGLCubeRenderTarget(this.width,{stencilBuffer:!1,depthBuffer:!1})},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}(),pa=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.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 da,s.luminanceCubeRenderTargetPool=new da;var u=s.model.getMaterial()||{},c=u.pano0,h=u.pano1;c&&(null==h?void 0:h.map)!==c.map&&(s.model.setMaterial({pano0:h}),c.map.dispose(),c.map instanceof ri&&c.map.cubeRenderTarget&&s.colorCubeRenderTargetPool.push(c.map.cubeRenderTarget),c.luminanceMap&&(c.luminanceMap.dispose(),c.luminanceMap instanceof ri&&c.luminanceMap.cubeRenderTarget&&s.luminanceCubeRenderTargetPool.push(c.luminanceMap.cubeRenderTarget))),s.panoMeshes=[],s.panoMeshHitTested={},s.updatePanoMeshes(),s.locationMotion=new qr({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=rr()]={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 d={allowHosts:s.work.allowHosts,requestProxy:s.requestProxy,networkSubscribe:s.networkSubscribe};return s.textureLoader=new oi(d),s.tiling=new oa(d,s.TILED_CUBE_TEXTURE_LEVEL+1,s.imageOptions),s.scene.add(s.tiling.object),s.panoVideo=new ua,s.scene.add(s.panoVideo.object),s}return Le(t,e),t.parseArgs=function(t){var i,n,r,o,a,s=e.parseArgs.call(this,t);return Fe(Fe({},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 _r},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>80?4:n>48?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,u=Object.keys(this.panoResources);l<u.length;l++){var c=u[l],h=this.panoResources[c];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[c]}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 ri&&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,u,c,h,d,p=this;if(!this.destroyed){var f=this.currentPanoIndex,A={},v={},g=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[0]),m=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),y=!1;if(!1===this.locationMotion.ended){this.locationMotion.update(e);var x=this.locationMotion.getKeyFrameSegment(e),b=x[0],w=x[1],E=this.panoResourceFromLocationMotionKeyframe(b),S=this.panoResourceFromLocationMotionKeyframe(w),M=(new n.Vector3).copy(E.position),C=(new n.Vector3).copy(S.position),I=this.locationMotion.value.count-w.value.count+1;A.progress=I,A.modelAlpha=this.locationMotion.value.modelAlpha,this.camera.perspToOrtho.setScalar(Er(this.locationMotion.value.perspToOrtho,0,1)),this.camera.orthoDistance=this.locationMotion.value.orthoDistance,S.panoPicture&&(I<1?E.panoPicture&&(A.pano0=E.panoPicture):A.pano0=S.panoPicture,A.pano1=S.panoPicture),y=A.useBlackTransition="instant"===S.effect||"montage"===S.effect,"fade"!==S.effect&&"montage"!==S.effect||(A.pano0&&E.panoPicture&&(A.pano0={map:A.pano0.map,luminanceMap:A.pano0.luminanceMap,matrix:E.panoPicture.matrix.clone().setPosition(S.position)}),M.copy(C)),v.distance=this.locationMotion.value.distance,v.offset=new n.Vector3(M.x+(C.x-M.x)*I,M.y+(C.y-M.y)*I,M.z+(C.z-M.z)*I);for(var T=[],B=[],P=0,R=this.locationMotion.keyframes;P<R.length;P++){var D=R[P],O=D.key,L=D.progress;void 0!==O&&(T.push(O),L>=this.locationMotion.progress&&B.push(O))}for(var F=0,k=Object.keys(this.panoResources);F<k.length;F++){var N=k[F];if(!(B.indexOf(N)>=0)){var V=this.panoResources[N];if(V.panoPicture){var Q=V.panoPicture.map,U=V.panoPicture.luminanceMap;if(Q){if(Q===(null===(i=A.pano0)||void 0===i?void 0:i.map))continue;if(Q===(null===(r=A.pano1)||void 0===r?void 0:r.map))continue;Q instanceof ri&&Q.cubeRenderTarget&&this.colorCubeRenderTargetPool.push(Q.cubeRenderTarget),Q.dispose(),U&&(U instanceof ri&&U.cubeRenderTarget&&this.luminanceCubeRenderTargetPool.push(U.cubeRenderTarget),U.dispose()),V.panoPicture=null}}T.indexOf(N)>=0||delete this.panoResources[N]}}E.workCode===S.workCode?this.currentPanoIndex=I<.5?E.panoIndex:S.panoIndex:this.currentPanoIndex=S.panoIndex,this.emit("movingToPano",m.panoIndex,g.panoIndex,this.locationMotion.progress)}if(!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===xo(A)&&((null===(o=A.pano0)||void 0===o?void 0:o.map)&&A.pano0.map instanceof ri&&!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 ri&&!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 ri&&!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 ri&&!A.pano1.luminanceMap.cubeRenderTarget&&(A.pano1.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),this.model.setMaterial(A)),!1===xo(v)&&this.setCamera(v),this.currentPanoIndex!==f&&this.updatePanoMeshesVisible(),this.camera.pose.distance>.1||y){var H=this.work.observers[this.currentPanoIndex];if(H)for(var q=0,z=G=H.visibleNodes.concat(this.currentPanoIndex);q<z.length;q++){var j=z[q];(J=this.panoMeshes[j])&&J.setOpacity(0)}}else{var _=this.work.observers[this.currentPanoIndex];if(_){var K=yo(_.visibleNodes,(function(e){return _.standingPosition.distanceTo(p.work.observers[e].standingPosition)}),!0)[1];K=Er(K,2.5,1/0);for(var G=_.visibleNodes.concat(this.currentPanoIndex),W=this.getForwardPanoIndexOrNot(),X=this.camera.getWorldDirection(new n.Vector3),Y=0,Z=G;Y<Z.length;Y++){j=Z[Y];var J,$=this.work.observers[j];if(J=this.panoMeshes[j])if($.loadable||$.active){var ee=J.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);J.setCurrent(!J.loading&&0===J.progress&&W===j),J.setOpacity(ee<.01?0:Er(K/ee*1.2,.4,.85));var te=this.camera.position.clone().setY(J.position.y),ie=(new n.Vector3).copy(J.position).sub(te).normalize();if(j===this.currentPanoIndex){var ne=Er((.5-te.distanceTo(J.position))/.5,0,1);ie.multiplyScalar(1-ne).add(X.clone().multiplyScalar(ne))}ie.length()>0&&J.quaternion.setFromEuler(new n.Euler(0,Math.atan2(ie.x,ie.z),0)),J.updateTime&&J.updateTime(e,t)}else J.setOpacity(0)}}}var re=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=m.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}(),oe=function(){var e,t=p.camera.quaternion.clone();t.premultiply((null!==(e=p.work.observers[m.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))}();m.panoIndex===this.currentPanoIndex&&((null===(u=m.panoPicture)||void 0===u?void 0:u.map)instanceof ri&&(m.panoPicture.map.update(oe,re),!0===m.panoPicture.map.needsRender&&(m.panoPicture.map.needsRender=!1,this.needsRender=!0)),(null===(c=m.panoPicture)||void 0===c?void 0:c.luminanceMap)instanceof ri&&(m.panoPicture.luminanceMap.update(oe,re),!0===m.panoPicture.luminanceMap.needsRender&&(m.panoPicture.luminanceMap.needsRender=!1,this.needsRender=!0)));var ae=this.tiling.object.visible;if(this.initAnimationed){var se=m.panoIndex,le=this.work.observers[se];le&&no(this.camera.position,le.position)&&this.locationMotion.ended?(this.tiling.object.visible=!0,this.tiling.panoIndex!==se&&this.tiling.cleanup(),this.tiling.panoIndex=se,this.tiling.setResource(null!==(d=null===(h=le.images)||void 0===h?void 0:h.tiles)&&void 0!==d?d:[],this.enableIOSEDR&&le.images.luminance?le.images.luminance:null),this.tiling.setRotation(le.quaternion),this.tiling.setPosition(le.position),re>this.TILED_CUBE_TEXTURE_LEVEL?this.tiling.update(oe,re,e):this.tiling.update(oe,0,e)):this.tiling.object.visible=!1}else this.tiling.object.visible=!1;ae!==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 Xo(this.renderer),this.luminanceAdaptiveEffect.enable=this.luminanceAdaptiveEffectEnable),this.luminanceAdaptiveEffect.render(e,t)},t.prototype.getTargetPose=function(){var e=this.cameraMotion.getKeyFrameSegment(ze())[1],t=this.locationMotion.getKeyFrameSegment(ze())[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,u=this.work.observers[e],c=this.imageOptions.size;if(void 0===c&&u){var h=u.images.up.match(/\/cube_(\d+)\//);h&&(c=Number(h[1]))}void 0===c&&(c=2048);var d=this.imageOptions.transform,p=Fe({key:"pano.".concat(e),basisLoaderInitialized:ii.isInitialized()},Bt(this.imageOptions,["format","size","quality","sharpen","mappings"])),f=u.images,A=null!==(o=null===(r=u.images.tiles)||void 0===r?void 0:r.filter((function(e){return e.size>c})))&&void 0!==o?o:null,v=d,g={key:"pano_luminance.".concat(e),basisLoaderInitialized:ii.isInitialized(),size:p.size?p.size/2:1024},m=this.enableIOSEDR&&u.images.luminance?u.images.luminance:null,y=function(){if(!u.images.tiles)return null;if(!m)return null;var e=m.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:m.back,front:m.front,left:m.left,right:m.right,up:m.up,down:m.down}}))}(),x="pano:"+Ho([f,p,d]);if(this.pendingTextureTask){if(this.pendingTextureTask.hash===x)return;var b=this.pendingTextureTask.panoIndex;null===(a=this.panoMeshes[b])||void 0===a||a.setProgress(0),this.emit("textureAbort",b,u),this.pendingTextureTask.onError(new Error("texture aborted"))}this.pending=!0;var w,E=this.model.getMaterial()||{},S=E.pano0,M=E.pano1;if(S&&S.map.name===x&&null!==S.luminanceMap===this.enableIOSEDR?w=S:(null==M?void 0:M.map.name)===x&&null!==M.luminanceMap===this.enableIOSEDR&&(w=M),w){var C={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(u.position,u.quaternion,ha)},position:u.position.clone()};dt.shared.add((function(){l.pending=!1,l.emit("panoLoaded",e),l.doMoveToPano(e,C,t,i)}),!0,1)}else{this.pendingTextureTask={panoIndex:e,hash:x,onLoad:function(r,o){var a,s;if(l.pending=!1,l.destroyed)r.body.dispose();else{r.body.name=x,l.emit("panoLoaded",e);var c={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(u.position,u.quaternion,ha)},position:u.position.clone()};l.doMoveToPano(e,c,t,i)}},onError:function(i){l.pending=!1,t.moveCancelCallback&&t.moveCancelCallback(),l.emit("panoLoadError",i,e),l.emit("moveToPanoCanceled",e)}};var I=this.panoMeshes[e];I&&I.tap&&I.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,u),(null===(i=l.pendingTextureTask)||void 0===i?void 0:i.hash)===x&&(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,preInit:!0},void 0,void 0,(function(t){var i,n;l.emit("textureLoading",t,e,u),(null===(i=l.pendingTextureTask)||void 0===i?void 0:i.hash)===x&&(null===(n=l.panoMeshes[e])||void 0===n||n.setProgress(t))}),this.renderer),m?this.tileLevelForFov&&y&&y.length?this.textureLoader.loadTiledCubeTexture(m,y,{tileImageSize:256,tileMaxLevel:this.TILED_CUBE_TEXTURE_LEVEL,imageURL:{transform:v,options:g}},void 0,void 0,void 0,this.renderer).catch((function(){return null})):this.textureLoader.loadCubeTexture(m,{imageURL:{transform:v,options:g},preInit:!0},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)===x?(l.pendingTextureTask.onLoad(r,o),null===(n=l.panoMeshes[e])||void 0===n||n.setProgress(0),delete l.pendingTextureTask,l.emit("textureLoaded",e,u,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)===x&&(l.pendingTextureTask.onError(t),null===(n=l.panoMeshes[e])||void 0===n||n.setProgress(0),delete l.pendingTextureTask,l.emit("textureError",t,e,u),l.emit("error",t))})),this.emit("textureStartLoad",e,u)}},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:Er(null!==(o=t.latitude)&&void 0!==o?o:this.defaultLatitude,this.minLatitude,this.maxLatitude),fov:Er(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],u=this.panoMeshes[l.panoIndex];u&&(r.indexOf(l.panoIndex)>=0?u.parent!==this.helper&&(this.helper.add(u),!0!==this.panoMeshHitTested["".concat(this.work.workCode,"_").concat(l.panoIndex)]&&o.push(l)):u.parent===this.helper&&(this.helper.remove(u),u.setOpacity(0)))}e&&(o=r.map((function(e){return t.work.observers[e]})));for(var c=0,h=o;c<h.length;c++){var d=h[c];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=yo(e.accessibleNodes,(function(i){return Er(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,u=this.work.observers;l<u.length;l++){s(p=u[l])}var c=Object.keys(a).map((function(e){return a[e]}));c.length&&(o=Er(.6*(c.reduce((function(e,t){return e+t}),0)/c.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 g=v[A];this.helper.remove(i[g]),i[g].dispose(),delete i[g]}this.updatePanoMeshesVisible(e)},t.prototype.doMoveToPano=function(e,t,i,r){var o,a,s,l,u=this;void 0===i&&(i={}),this.userAction=r;var c=ze(),h=rr();this.tiling.cleanup(),this.panoResources[h]=t;var d,p,f;if(this.locationMotion.ended){var A=this.locationMotion.getKeyFrameSegment(c);A[0];var v=A[1],g=this.locationMotion.value,m=(null!==(o=this.panoResourceFromLocationMotionKeyframe(v))&&void 0!==o?o:this.camera).position,y=t.position;d=Math.max(m.distanceTo(y),1),p=[{key:v.key,progress:0,value:Fe(Fe({},g),{count:0})},{key:h,progress:1,value:{distance:0,perspToOrtho:0,orthoDistance:1,modelAlpha:0,count:1}}],f=0}else{var x=this.locationMotion.getKeyFrameSegment(c),b=x[0],w=(v=x[1],g=this.locationMotion.value,this.panoResourceFromLocationMotionKeyframe(b).position),E=(m=this.panoResourceFromLocationMotionKeyframe(v).position,y=t.position,v.value.count-g.count),S=Math.max(w.distanceTo(m),1)*E;d=S+Math.max(m.distanceTo(y),1),p=[{key:b.key,progress:0,value:Fe({},g)},{key:v.key,progress:S/d,value:v.value},{key:h,progress:1,value:{count:v.value.count+1,distance:0,perspToOrtho:0,orthoDistance:1,modelAlpha:0}}];var M=this.locationMotionKeyframesLength(this.locationMotion.keyframes),C=this.locationMotionKeyframesLength(p);f=0===M||0===M?0:this.locationMotion.getProgressVelocity(c)*M/C}var I=this.calculateMovingDuration(i.duration,"fade"===i.effect||"montage"===i.effect?0:d),T={longitude:i.longitude,latitude:i.latitude,fov:i.fov},B={longitude:null!==(a=T.longitude)&&void 0!==a?a:this.camera.pose.longitude,latitude:null!==(s=T.latitude)&&void 0!==s?s:this.camera.pose.latitude,fov:null!==(l=T.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,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=He,this.videoTexture.needsUpdate=!0),this.panoVideo.setMaterial(null),this.cameraMotion.set(T,I).catch(He),this.locationMotion.setKeyframes(p,I,f).then((function(){var t,o,a,s={longitude:u.camera.pose.longitude,latitude:u.camera.pose.latitude,fov:u.camera.pose.fov,offset:u.camera.pose.offset.clone(),distance:u.camera.pose.distance};i.moveEndCallback&&i.moveEndCallback(e,s),u.emit("panoArrived",e,s,r);var l=u.work.observers[u.currentPanoIndex];if(l&&l.video&&u.videoTexture&&u.videoTexture.image instanceof HTMLVideoElement){var c=ca.clone().multiply(null!==(a=null===(o=null===(t=u.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:u.videoTexture,size:l.video.size,matrix:c,alpha:1},d=rr(),p=u.videoTexture.image;p.setAttribute("uuid",d),jo().then((function(e){e&&l.video&&p.getAttribute("uuid")===d&&(p.oncanplay=function(){p.oncanplay=He,p.play()},p.ontimeupdate=function(){p.currentTime>.5&&(p.ontimeupdate=He,u.panoVideo.setMaterial(h))},p.src=l.video.source)})).catch((function(){p.removeAttribute("uuid")}))}}),(function(){i.moveCancelCallback&&i.moveCancelCallback(),u.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.getWorldDirection(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 u=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)))})),c=u.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=c;f<A.length;f++){var v=A[f],g=this.work.observers[v].standingPosition.clone().sub(o);if(0!==g.length()&&l.angleTo(g)<p)return v}return null},t.prototype.onTapGesture=function(e){var t=this,i=e.pointers.map((function(e){return Bt(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.getWorldDirection(new n.Vector3).setY(0),s=null,l=this.work.observers[this.currentPanoIndex];if(l){var u=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)})),c=this.model.intersectRaycaster(o)[0];if(c){var h=yo(u,(function(e){return t.work.observers[e].standingPosition.clone().distanceTo(c.point)}),!0),d=h[0];h[1]<this.panoTapTriggerRadius&&(s=d)}mr(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),mr(s))!0===this.locationMotion.ended&&this.cameraBounce();else{var g=this.work.observers[s];if(g.active){for(var m={},y=Math.PI/6,x=Math.PI/12,b=g.position.clone().setY(0).sub(l.position.clone().setY(0)).normalize(),w=[],E=0,S=g.accessibleNodes;E<S.length;E++){if((d=S[E])!==this.currentPanoIndex&&d!==s){var M=this.work.observers[d].position.clone().sub(g.position).setY(0);b.angleTo(M)<y&&w.push(M)}}var C=(w.length>0?w:ke(ke([],[],!0),[],!0)).slice().sort((function(e,t){return e.angleTo(b)-t.angleTo(b)}))[0];C&&C.angleTo(a)>x&&(m.longitude=Math.atan2(-C.x,-C.z)),this.cameraMotion.value.latitude<-Math.PI/4&&(m.latitude=Er(0,this.minLatitude,this.maxLatitude)),this.cameraMotion.value.fov<60&&(m.fov=this.defaultFov),this.emit("wantsMoveToPano",s,m,!0)}else this.panoMeshes[s]&&(this.panoMeshes[s].setDisabled(!1),this.panoMeshes[s].setLoading(!0))}}}}},t}(zo),fa=Math.PI/180,Aa=180/Math.PI,va=function(){var e="undefined"!=typeof navigator&&/iPad|iPhone|iPod/.test(navigator.platform);return function(){return e}}(),ga=function(){var e="undefined"!=typeof navigator&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent);return function(){return e}}(),ma=function(){var e="undefined"!=typeof navigator&&-1!==navigator.userAgent.indexOf("Firefox")&&-1!==navigator.userAgent.indexOf("Android");return function(){return e}}(),ya=function(){var e="undefined"!=typeof navigator?navigator.userAgent.match(/.*Chrome\/([0-9]+)/):null,t=e?parseInt(e[1],10):null;return function(){return t}}(),xa=function(){var e=!1;if(65===ya()){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}}(),ba=function(){var e=va()&&ga()&&"undefined"!=typeof navigator&&-1!==navigator.userAgent.indexOf("13_4");return function(){return e}}(),wa=function(){var e="undefined"!=typeof navigator&&-1!==navigator.userAgent.indexOf("R7 Build");return function(){return e}}();function Ea(){var e="undefined"!=typeof window&&(90==window.orientation||-90==window.orientation);return wa()?!e:e}var Sa,Ma=(Sa={},function(e,t){void 0===Sa[e]&&(console.warn("cardboard: "+t),Sa[e]=!0)});function Ca(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 Ia,Ta=function(e,t,i){var n,r,o,a,s,l,u,c,h,d,p,f,A,v,g,m,y,x,b,w,E,S,M,C,I,T,B,P,R,D,O;!function(e,t,i){var n=t?t[0]:0,r=t?t[1]:0,o=t?t[2]:0,a=t?t[3]:1,s=n+n,l=r+r,u=o+o,c=n*s,h=n*l,d=n*u,p=r*l,f=r*u,A=o*u,v=a*s,g=a*l,m=a*u;e[0]=1-(p+A),e[1]=h+m,e[2]=d-g,e[3]=0,e[4]=h-m,e[5]=1-(c+A),e[6]=f+v,e[7]=0,e[8]=d+g,e[9]=f-v,e[10]=1-(c+p),e[11]=0,e[12]=i?i[0]:0,e[13]=i?i[1]:0,e[14]=i?i[2]:0,e[15]=1}(e,t),i&&function(e,t,i){var n,r,o,a,s,l,u,c,h,d,p,f,A=i[0],v=i[1],g=i[2];t===e?(e[12]=t[0]*A+t[4]*v+t[8]*g+t[12],e[13]=t[1]*A+t[5]*v+t[9]*g+t[13],e[14]=t[2]*A+t[6]*v+t[10]*g+t[14],e[15]=t[3]*A+t[7]*v+t[11]*g+t[15]):(n=t[0],r=t[1],o=t[2],a=t[3],s=t[4],l=t[5],u=t[6],c=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]=u,e[7]=c,e[8]=h,e[9]=d,e[10]=p,e[11]=f,e[12]=n*A+s*v+h*g+t[12],e[13]=r*A+l*v+d*g+t[13],e[14]=o*A+u*v+p*g+t[14],e[15]=a*A+c*v+f*g+t[15])}(e,e,i),n=e,o=(r=e)[0],a=r[1],s=r[2],l=r[3],u=r[4],c=r[5],h=r[6],d=r[7],p=r[8],f=r[9],A=r[10],v=r[11],g=r[12],m=r[13],y=r[14],x=r[15],(O=(b=o*c-a*u)*(D=A*x-v*y)-(w=o*h-s*u)*(R=f*x-v*m)+(E=o*d-l*u)*(P=f*y-A*m)+(S=a*h-s*c)*(B=p*x-v*g)-(M=a*d-l*c)*(T=p*y-A*g)+(C=s*d-l*h)*(I=p*m-f*g))&&(O=1/O,n[0]=(c*D-h*R+d*P)*O,n[1]=(s*R-a*D-l*P)*O,n[2]=(m*C-y*M+x*S)*O,n[3]=(A*M-f*C-v*S)*O,n[4]=(h*B-u*D-d*T)*O,n[5]=(o*D-s*B+l*T)*O,n[6]=(y*E-g*C-x*w)*O,n[7]=(p*C-A*E+v*w)*O,n[8]=(u*R-c*B+d*I)*O,n[9]=(a*B-o*R-l*I)*O,n[10]=(g*M-m*E+x*b)*O,n[11]=(f*E-p*M-v*b)*O,n[12]=(c*T-u*P-h*I)*O,n[13]=(o*P-a*T+s*I)*O,n[14]=(m*w-g*S-y*b)*O,n[15]=(p*S-f*w+A*b)*O)},Ba=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}(),Pa=function(){function e(e,t){this.kFilter=e,this.isDebug=t,this.currentAccelMeasurement=new Ba,this.currentGyroMeasurement=new Ba,this.previousGyroMeasurement=new Ba,va()?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)",Aa*((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}(),Ra=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*fa)return this.isDebug&&console.log("Moving slowly, at %s deg/s: no prediction",(Aa*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}(),Da=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}(),Oa=function(){this.angularAcceleration=null,this.angularVelocity=null,this.linearAcceleration=null,this.linearVelocity=null,this.orientation=null,this.position=null},La=function(){this.leftDegrees=0,this.rightDegrees=0,this.upDegrees=0,this.downDegrees=0},Fa=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 Pa(e,r),this.posePredictor=new Ra(t,r),this.isFirefoxAndroid=ma(),this.isIOS=va();var o=ya();this.isDeviceMotionInRadians=!this.isIOS&&null!==o&&o<66,this.isWithoutDeviceMotion=xa()||ba(),this.filterToWorldQ=new n.Quaternion,va()?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_(),Ea()&&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||function(){var e=(new n.Quaternion).setFromAxisAngle(new n.Vector3(0,0,-1),0),t=new n.Quaternion;return"undefined"!=typeof window&&-90===window.orientation?t.setFromAxisAngle(new n.Vector3(0,1,0),Math.PI/-2):t.setFromAxisAngle(new n.Vector3(0,1,0),Math.PI/2),e.multiply(t)}(),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=this.filter.getOrientation();e=this.posePredictor.getPrediction(r,this.gyroscope,this.previousTimestampS);var o=new n.Quaternion;return o.copy(this.filterToWorldQ),o.multiply(this.resetQ),o.multiply(e),o.multiply(this.worldToScreenQ),this.yawOnly&&(o.x=0,o.z=0,o.normalize()),this.orientationOut_[0]=o.x,this.orientationOut_[1]=o.y,this.orientationOut_[2]=o.z,this.orientationOut_[3]=o.w,this.orientationOut_},e.prototype.getPose=function(){var e=new Oa;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(),Ea()&&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),Ta(e.leftViewMatrix,t,i.left),Ta(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 va()&&function(){if("undefined"==typeof window)return!1;if("undefined"==typeof document)return!1;var e=window.self!==window.top,t=Ca(document.referrer),i=Ca(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*fa,o=e.left.downDegrees*fa,a=2/((l=e.left.leftDegrees*fa)+(u=e.left.rightDegrees*fa)),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-u)*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,u;r=e.right.upDegrees*fa,o=e.right.downDegrees*fa,a=2/((l=e.right.leftDegrees*fa)+(u=e.right.rightDegrees*fa)),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-u)*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 Da(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=Aa*Math.atan(i.distort(r/n)),u=Aa*Math.atan(i.distort(o/n)),c=Aa*Math.atan(i.distort(a/n)),h=Aa*Math.atan(i.distort(s/n)),d=new La,p=new La;return d.leftDegrees=Math.min(l,e.fov),d.rightDegrees=Math.min(u,e.fov),d.downDegrees=Math.min(c,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?(Ma("fusion-pose-sensor:invalid:non-monotonic","Invalid timestamps detected: non-monotonic timestamp from devicemotion"),void(this.previousTimestampS=n)):r<=.001||r>1?(Ma("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&&(wa()?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}(),ka=[0,0,.5,1],Na=[.5,0,.5,1],Va=function(){function e(e){var t=this;this.renderer=e,this.sensor=new Fa(.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*ka[0]),y:Math.round(i.height*ka[1]),width:Math.round(i.width*ka[2]),height:Math.round(i.height*ka[3])},a={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])};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}(),Qa={zh:{TITLE:"眼镜模式",HIT:"请将手机横屏放入 VR 眼镜中"},en:{TITLE:"GLASSES MODE",HIT:"Please put the mobile phone horizontally into the VR glasses."},ja:{TITLE:"メガネモード",HIT:"携帯電話をVRメガネに水平に入れてください。"}},Ua="undefined"!=typeof navigator&&null!==(Ia=Qa[navigator.language.split("-")[0]])&&void 0!==Ia?Ia:Qa.zh,Ha="\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/OoqKiZmZlpaWmbm5teXl7W1tb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KvinKDlaFdrL4XOcipIACOpcxco820J7BfhsLH1F+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/Pz9aWlpkZGQ3NzdcXFxeXl5MTExHR0dhYWFJSUk9PT1WVlZMTEygoKBERERFRUVmZmZQUFA9PT1LS0tra2tPT09ubm5SUlI2NjZXV1czMzOpqalTU1O3t7dVVVVoaGhaWlpqamq1tbWhoaGenp6lpaWurq6ysrJZWVmjo6OgoKBUVFRdXV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QSHvn5l2o0swV/ipkoFL2PgIC6o3vwC0CJuu0UL9Hu8vu4iCf4qxGrc7QwiiAW61PiaAFPLlfZC/7H6RV6H97MEDcFN1W9/WifBy0NcwDofmTXiE9NqCRqDO0CpFM40MV6oFou1C1ibRatHjGDahVtJgkZE0w5QqXJoQVko1y3Wpc0lGPOBaceJBA1ql93NSfHyCD9Uil512j97HfnM7/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(Ua.TITLE,'</div>\n <div class="$id-modal-content-hit">').concat(Ua.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 qa(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 Ha.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 za=new n.CircleBufferGeometry(.12,16),ja=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 qr({ringScale:1.1,ringOpacity:0,circleFade:0,circleOpacity:.85,circleScale:1}),t.opacityMotion=new qr({opacity:0}),t.loadingMotion=new qr({opacity:0}),t.disableMotion=new qr({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(za,new n.MeshBasicMaterial(Fe(Fe({},i),{color:0,opacity:0}))),t.hitTestMesh.scale.set(1.5,1.5,1.5),t.ringMesh=new n.Mesh(za,new n.ShaderMaterial(Fe(Fe({},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(za,new n.ShaderMaterial(Fe(Fe({},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 Le(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=Er(e,0,1),this.opacityMotion.set({opacity:e},30).catch(He))},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(He)}else{t=[{progress:0,value:Fe({},this.currentMotion.value)},{progress:1,value:{ringScale:1.1,ringOpacity:0,circleFade:0,circleOpacity:.85,circleScale:1}}];this.currentMotion.setKeyframes(t,200).catch(He)}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(He):this.loadingMotion.set({opacity:0},0).catch(He),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(He),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),_a=function(e){function t(i){var n=this,r=t.parseArgs(i);(n=e.call(this,r)||this).cardboard=new Va(n.renderer);var o,a,s,l=(o="five_vr_helper_"+rr(),a=qa(o),(s=document.createElement("div")).className=o,s.innerHTML=a,s);n.helperElement=l;var u=new wo(l);return n.element.parentNode&&(n.element.parentNode.insertBefore(l,n.element),n.setHelperElementSize(),u.on("tap",(function(){return n.emit("vrWantsToExit")}))),n.destroyHelper=function(){u.destroy(),l.parentNode&&l.parentNode.removeChild(l),delete n.helperElement},n}return Le(t,e),t.parseArgs=function(t){var i=Fe(Fe({},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 ja;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 u=this.currentPanoIndex;this.needsRender=!0;var c={},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),g=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[0]),m=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),y=A.position,x=v.position,b=this.locationMotion.value.count-f.value.count+1;c.modelAlpha=this.locationMotion.value.modelAlpha,this.camera.perspToOrtho.setScalar(Er(this.locationMotion.value.perspToOrtho,0,1)),this.camera.orthoDistance=this.locationMotion.value.orthoDistance,c.useBlackTransition="instant"===v.effect,v.panoPicture&&(b<1?A.panoPicture&&(c.pano0=A.panoPicture):c.pano0=v.panoPicture,c.pano1=v.panoPicture),"fade"===v.effect&&(c.pano0&&A.panoPicture&&(c.pano0={map:c.pano0.map,luminanceMap:c.pano0.luminanceMap,matrix:A.panoPicture.matrix.clone().setPosition(v.position)}),y.copy(x)),c.progress=b,h.distance=this.locationMotion.value.distance,h.offset=new n.Vector3(y.x+(x.x-y.x)*b,y.y+(x.y-y.y)*b,y.z+(x.z-y.z)*b);for(var w=[],E=[],S=0,M=this.locationMotion.keyframes;S<M.length;S++){var C=M[S],I=C.key,T=C.progress;void 0!==I&&(w.push(I),T>=this.locationMotion.progress&&E.push(I))}for(var B=0,P=Object.keys(this.panoResources);B<P.length;B++){var R=P[B];if(!(E.indexOf(R)>=0)){var D=this.panoResources[R];if(D.panoPicture){var O=D.panoPicture.map;if(O){if(O===(null===(i=c.pano0)||void 0===i?void 0:i.map))continue;if(O===(null===(r=c.pano1)||void 0===r?void 0:r.map))continue;O.dispose(),D.panoPicture=null}}w.indexOf(R)>=0||delete this.panoResources[R]}}this.currentPanoIndex=b<.5?A.panoIndex:v.panoIndex,this.emit("movingToPano",m.panoIndex,g.panoIndex,this.locationMotion.progress)}!1===xo(c)&&((null===(o=c.pano0)||void 0===o?void 0:o.map)&&c.pano0.map instanceof ri&&!c.pano0.map.cubeRenderTarget&&(c.pano0.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),(null===(a=c.pano0)||void 0===a?void 0:a.luminanceMap)&&c.pano0.luminanceMap instanceof ri&&!c.pano0.luminanceMap.cubeRenderTarget&&(c.pano0.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),(null===(s=c.pano1)||void 0===s?void 0:s.map)&&c.pano1.map instanceof ri&&!c.pano1.map.cubeRenderTarget&&(c.pano1.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),(null===(l=c.pano1)||void 0===l?void 0:l.luminanceMap)&&c.pano1.luminanceMap instanceof ri&&!c.pano1.luminanceMap.cubeRenderTarget&&(c.pano1.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),this.model.setMaterial(c)),h.offset&&this.camera.position.copy(h.offset),this.currentPanoIndex!==u&&this.updatePanoMeshesVisible();var L=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 k=0,N=this.work.observers[this.currentPanoIndex].visibleNodes.concat(this.currentPanoIndex);k<N.length;k++){var V=N[k],Q=this.work.observers[V],U=this.panoMeshes[V];if(Q.loadable||Q.active){var H=U.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);H<.05?U.setOpacity(0):U.setOpacity(Er(1.5/H,0,1)),this.currentPanoIndex===V&&U.setOpacity(0),U.lookAt(this.camera.position)}else U.setOpacity(0)}var q=this.intersect(e);for(V=0;V<this.work.observers.length;V++){null==(U=this.panoMeshes[V])||U.setCurrent(U===q)}for(V=0;V<this.work.observers.length;V++){(U=this.panoMeshes[V])&&U.updateTime&&U.updateTime(e,t)}L===this.camera.pose.longitude&&F===this.camera.pose.latitude||(this.cameraMotion.set(Bt(this.camera.pose,["longitude","latitude"]),0).catch(He),this.emit("cameraDirectionUpdate",Bt(this.camera.pose,["longitude","latitude"]),!0),this.emit("cameraUpdate",bo(Bt(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(u=this.panoMeshes.indexOf(i))>=0&&this.moveToPano(u,{},!0),delete this.activePanoMesh,delete this.activeTime,i}for(var r=this.camera.getWorldDirection(new n.Vector3),o=new n.Raycaster(this.camera.position,r),a=void 0,s=[],l=this.work.observers[this.currentPanoIndex].visibleNodes,u=0;u<this.work.observers.length;u++){var c=this.panoMeshes[u];if(-1!==l.indexOf(u)){var h=o.intersectObject(null!==(t=c.hitTestMesh)&&void 0!==t?t:c,!0)[0];h&&s.push({panoMesh:c,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}(pa),Ka=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 qr({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 Le(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&&e.prototype.isReady.call(this)},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(Er(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=yo(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),xo(i)||this.model.setMaterial(i),xo(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:Er(null!==(o=t.latitude)&&void 0!==o?o:this.defaultLatitude,this.minLatitude,this.maxLatitude),fov:Er(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(ze())[1],t=this.locationMotion.getKeyFrameSegment(ze())[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=ze(),u=new n.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z).distanceTo(e),c=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,g=this.locationMotion.keyframes[d].value,m=g.x,y=g.y,x=g.z;h+=Math.sqrt(Math.pow(m-f,2)+Math.pow(y-A,2)+Math.pow(x-v,2))}var b=0===u?0:c*h/u,w=this.calculateMovingDuration(t.duration,u),E={x:e.x,y:e.y,z:e.z,distance:0,modelAlpha:1,perspToOrtho:0,orthoDistance:1},S={longitude:t.longitude,latitude:t.latitude,fov:t.fov},M={longitude:null!==(r=S.longitude)&&void 0!==r?r:this.camera.pose.longitude,latitude:null!==(o=S.latitude)&&void 0!==o?o:this.camera.pose.latitude,fov:null!==(a=S.fov)&&void 0!==a?a:this.camera.pose.fov,offset:e.clone(),distance:0},C=yo(this.work.observers,(function(t){return t.position.distanceTo(e)})),I=this.work.observers.indexOf(C);this.emit("moveToPano",I,this.userAction),t.moveStartCallback&&t.moveStartCallback(I,M),this.emit("panoWillArrive",I,M,this.userAction),this.cameraMotion.set(S,w).catch(He),this.locationMotion.set(E,w,b).then((function(){var e=bo(s.camera.pose);t.moveEndCallback&&t.moveEndCallback(I,e),s.emit("panoArrived",I,e,s.userAction)}),(function(){t.moveCancelCallback&&t.moveCancelCallback(),s.emit("moveToPanoCanceled",I)}))},t.prototype.onTapGesture=function(e){var t=e.pointers.map((function(e){return Bt(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),u=s.clone().sub(l).setLength(.3),c=s.clone().sub(u);r.set(c,new n.Vector3(0,-1,0)),o=this.model.intersectRaycaster(r)[0]}}if(o){var h=o.point.clone(),d=yo(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}(zo),Ga=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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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"),Wa=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"),Xa=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),Ya=new n.SphereBufferGeometry(.01,128,128);var Za=function(){function e(e){void 0===e&&(e={}),this.textureLoader=new oi({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,u){var c=[0,0],h=function(e,t){c[t]=e,l(.8*c[0]+.2*c[1])},d=[this.textureLoader.loadTexture(e,{imageURL:i,viaAjax:!0},void 0,void 0,(function(e){return h(e,1)}),u),this.textureLoader.loadCubeTexture(t,{imageURL:i,viaAjax:!0},void 0,void 0,(function(e){return h(e,0)}),u)];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:Ga,fragmentShader:Wa,transparent:!0,uniforms:n.UniformsUtils.clone(Xa)}),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(Ya,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:ke([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(He)}return s(e),Promise.reject(e)}))},e}(),Ja=new n.Vector3(-1,1,1),$a=function(e){function t(i){var r,o,a,s,l,u=this,c=t.parseArgs(i);return(u=e.call(this,c)||this).currentPanoIndex=c.initial[0],u.maxAccessibleDistance=c.maxAccessibleDistance,u.panoTapTriggerRadius=c.panoTapTriggerRadius,u.panoCircleMeshCreator=c.panoCircleMeshCreator,u.panoModelGroup=new n.Group,u.panoModelGroup.name="panoModels",u.scene.add(u.panoModelGroup),u.panoMeshes=[],u.updatePanoMeshes(),u.helper.remove(u.intersectMesh),u.locationMotion=new qr({count:0,distance:u.camera.pose.distance,modelAlpha:null!==(o=null===(r=u.model.getMaterial())||void 0===r?void 0:r.modelAlpha)&&void 0!==o?o:0,perspToOrtho:u.camera.perspToOrtho.x,orthoDistance:u.camera.orthoDistance}),u.panoResources={},u.panoResources[u.locationMotion.keyframes[0].key=u.locationMotion.keyframes[1].key=rr()]={panoIndex:u.currentPanoIndex,workCode:u.work.workCode,matrix:null!==(l=null===(s=null===(a=u.model.getMaterial())||void 0===a?void 0:a.pano1)||void 0===s?void 0:s.matrix)&&void 0!==l?l:new n.Matrix4,position:u.camera.pose.offset.clone(),effect:"fly"},u.depthTextureLoader=new Za({allowHosts:u.work.allowHosts,requestProxy:u.requestProxy,networkSubscribe:u.networkSubscribe}),u}return Le(t,e),t.parseArgs=function(t){var i,n,r,o=e.parseArgs.call(this,t);return Fe(Fe({},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 _r}})},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,u=0,c=Object.keys(this.panoResources);u<c.length;u++){var h=c[u],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={},u=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[0]),c=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),g=(new n.Vector3).copy(A.position),m=(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(Er(this.locationMotion.value.perspToOrtho,0,1)),this.camera.orthoDistance=this.locationMotion.value.orthoDistance;for(var x=0,b=this.panoModelGroup.children;x<b.length;x++){var w=b[x];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)}),g.copy(m)),l.distance=this.locationMotion.value.distance,l.offset=new n.Vector3(g.x+(m.x-g.x)*y,g.y+(m.y-g.y)*y,g.z+(m.z-g.z)*y);for(var E=[],S=[],M=0,C=this.locationMotion.keyframes;M<C.length;M++){var I=C[M],T=I.key,B=I.progress;void 0!==T&&(E.push(T),B>=this.locationMotion.progress&&S.push(T))}for(var P=0,R=Object.keys(this.panoResources);P<R.length;P++){var D=R[P];if(!(S.indexOf(D)>=0)){var O=this.panoResources[D];if(O.panoModel){if(O.panoModel.material.uniforms.panoMap.value===(null===(i=s.pano0)||void 0===i?void 0:i.map))continue;if(O.panoModel.material.uniforms.panoMap.value===(null===(r=s.pano1)||void 0===r?void 0:r.map))continue;this.panoModelGroup.remove(O.panoModel),O.panoModel.material.uniforms.panoMap.value.dispose(),O.panoModel.dispose(),delete O.panoModel}E.indexOf(D)>=0||delete this.panoResources[D]}}A.workCode===v.workCode?this.currentPanoIndex=y<.5?A.panoIndex:v.panoIndex:this.currentPanoIndex=v.panoIndex,this.emit("movingToPano",c.panoIndex,u.panoIndex,this.locationMotion.progress)}if(!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===xo(s)&&this.model.setMaterial(s),!1===xo(l)&&this.setCamera(l),this.currentPanoIndex!==a&&this.updatePanoMeshesVisible(),this.camera.pose.distance>.1||h){var L=this.work.observers[this.currentPanoIndex];if(L)for(var F=0,k=U=L.visibleNodes.concat(this.currentPanoIndex);F<k.length;F++){var N=k[F];(_=this.panoMeshes[N])&&_.setOpacity(0)}}else{var V=this.work.observers[this.currentPanoIndex];if(V){var Q=yo(V.visibleNodes,(function(e){return V.standingPosition.distanceTo(o.work.observers[e].standingPosition)}),!0)[1];Q=Er(Q,2.5,1/0);for(var U=V.visibleNodes.concat(this.currentPanoIndex),H=this.getForwardPanoIndexOrNot(),q=this.camera.getWorldDirection(new n.Vector3),z=0,j=U;z<j.length;z++){N=j[z];var _,K=this.work.observers[N];if(_=this.panoMeshes[N])if(K.loadable||K.active){var G=_.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);_.setCurrent(!_.loading&&0===_.progress&&H===N),_.setOpacity(G<.01?0:Er(Q/G*1.2,.65,.98));var W=this.camera.position.clone().setY(_.position.y),X=(new n.Vector3).copy(_.position).sub(W).normalize();if(N===this.currentPanoIndex){var Y=Er((.5-W.distanceTo(_.position))/.5,0,1);X.multiplyScalar(1-Y).add(q.clone().multiplyScalar(Y))}X.length()>0&&_.quaternion.setFromEuler(new n.Euler(0,Math.atan2(X.x,X.z),0)),_.updateTime&&_.updateTime(e,t)}else _.setOpacity(0)}}}}},t.prototype.getTargetPose=function(){var e=this.cameraMotion.getKeyFrameSegment(ze())[1],t=this.locationMotion.getKeyFrameSegment(ze())[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=Fe({key:"pano.".concat(e),basisLoaderInitialized:ii.isInitialized()},Bt(this.imageOptions,["format","size","quality","sharpen","mappings"])),l=this.imageOptions.transform,u=this.work.observers[e].images,c=this.work.observers[e],h=c.position,d=c.quaternion,p=(new n.Matrix4).compose(h,d,new n.Vector3(-1,1,1)),f="pano:"+Ho(u);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,u,{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:Er(null!==(o=t.latitude)&&void 0!==o?o:this.defaultLatitude,this.minLatitude,this.maxLatitude),fov:Er(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=bo(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=yo(t.accessibleNodes,(function(i){return Er(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 u=Object.keys(o).map((function(e){return o[e]}));u.length&&(r=Er(.6*(u.reduce((function(e,t){return e+t}),0)/u.length),1,3));for(var c=0;c<this.work.observers.length;c++){var h="panoCircle_".concat(this.work.workCode,"_").concat(c),d=this.work.observers[c],p=void 0;t[h]?(!0===(p=t[h]).loading&&!1===d.loadable&&p.setLoading(!1),delete t[h]):(p=this.panoCircleMeshCreator(c)).name=h,p.scale.set(r,1,r),p.position.copy(d.standingPosition),this.panoMeshes[c]=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,u=this;void 0===i&&(i={}),this.userAction=r;var c=ze(),h=rr(),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,Ja),position:d.position.clone()};t.visible=!1,t.renderOrder=-1,this.panoModelGroup.add(t);var f,A,v;if(this.locationMotion.ended){var g=this.locationMotion.getKeyFrameSegment(c);g[0];var m=g[1],y=this.locationMotion.value,x=this.panoResourceFromLocationMotionKeyframe(m).position,b=p.position;f=Math.max(x.distanceTo(b),1),A=[{key:m.key,progress:0,value:Fe(Fe({},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(c),E=w[0],S=(m=w[1],y=this.locationMotion.value,this.panoResourceFromLocationMotionKeyframe(E).position),M=(x=this.panoResourceFromLocationMotionKeyframe(m).position,b=p.position,m.value.count-y.count),C=Math.max(S.distanceTo(x),1)*M;f=C+Math.max(x.distanceTo(b),1),A=[{key:E.key,progress:0,value:Fe({},y)},{key:m.key,progress:C/f,value:m.value},{key:h,progress:1,value:{count:m.value.count+1,distance:0,perspToOrtho:0,orthoDistance:1,modelAlpha:0}}];var I=this.locationMotionKeyframesLength(this.locationMotion.keyframes),T=this.locationMotionKeyframesLength(A);v=0===I||0===I?0:this.locationMotion.getProgressVelocity(c)*I/T}var B=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,B).catch(He),this.locationMotion.setKeyframes(A,B,v).then((function(){var t={longitude:u.camera.pose.longitude,latitude:u.camera.pose.latitude,fov:u.camera.pose.fov,offset:u.camera.pose.offset.clone(),distance:u.camera.pose.distance};i.moveEndCallback&&i.moveEndCallback(e,t),u.emit("panoArrived",e,t,r)}),(function(){i.moveCancelCallback&&i.moveCancelCallback(),u.emit("moveToPanoCanceled",e)}))},t.prototype.getForwardPanoIndexOrNot=function(e){var t=this,i=this.camera.getWorldDirection(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)})),u=0,c=[Math.PI/8,Math.PI/6,Math.PI/4,Math.PI/3];u<c.length;u++)for(var h=c[u],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 Bt(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.getWorldDirection(new n.Vector3).setY(0),s=null,l=this.work.observers[this.currentPanoIndex];if(l){var u=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)})),c=o.intersectObject(this.boundingMesh,!0)[0];if(c){var h=yo(u,(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(c.point)}),!0),d=h[0];h[1]<this.panoTapTriggerRadius&&(s=d)}mr(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),mr(s))!0===this.locationMotion.ended&&this.cameraBounce();else{var g=this.work.observers[s];if(g.active){for(var m={},y=Math.PI/6,x=Math.PI/12,b=new n.Vector3(0,1,0),w=g.position.clone().setY(0).sub(l.position.clone().setY(0)).normalize(),E=w.clone().applyAxisAngle(b,y),S=w.clone().applyAxisAngle(b,-y),M=[],C=[],I=[],T=0,B=g.accessibleNodes;T<B.length;T++){if((d=B[T])!==this.currentPanoIndex&&d!==s){var P=this.work.observers[d].position.clone().sub(g.position).setY(0);w.angleTo(P)<y?I.push(P):E.angleTo(P)<y?M.push(P):S.angleTo(P)<y&&C.push(P)}}var R=(I.length>0?I:ke(ke([],M,!0),C,!0)).slice().sort((function(e,t){return e.angleTo(w)-t.angleTo(w)}))[0];R&&R.angleTo(a)>x&&(m.longitude=Math.atan2(-R.x,-R.z)),this.cameraMotion.value.latitude<-Math.PI/4&&(m.latitude=Er(0,this.minLatitude,this.maxLatitude)),this.emit("wantsMoveToPano",s,m,!0)}else this.panoMeshes[s]&&(this.panoMeshes[s].setDisabled(!1),this.panoMeshes[s].setLoading(!0))}}}}},t}(zo);function es(e,t){var i=new n.Vector3;return i.setFromMatrixColumn(t,0),i.multiplyScalar(-e),i}function ts(e,t,i){var r=new n.Vector3;return r.setFromMatrixColumn(i,0),r.crossVectors(t,r),r.multiplyScalar(e),r}var is=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 qr({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 Le(t,e),t.parseArgs=function(t){var i,n,r,o,a,s,l,u=e.parseArgs.call(this,t);return Fe(Fe({},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,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=this.parseArgs(e),o=e.initial[0],a=e.initial[1];return{longitude:null!==(i=a.longitude)&&void 0!==i?i:r.defaultLongitude,latitude:Er(null!==(n=a.latitude)&&void 0!==n?n:r.defaultLatitude,r.minLatitude,r.maxLatitude),fov:90,offset:r.work.observers[o].position.clone(),distance:t.distanceFromModel(r.model,90,r.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(He),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(Er(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),xo(i)||this.model.setMaterial(i),xo(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.getWorldPosition(new n.Vector3),this.camera.getWorldDirection(new n.Vector3)),o=this.model.intersectRaycaster(r)[0];o&&i.copy(o.point)}var a=yo(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,bo(this.camera.pose),this.userAction),this.currentPanoIndex=s,this.emit("panoArrived",s,bo(this.camera.pose),this.userAction))},t.prototype.getTargetPose=function(){var e=this.cameraMotion.getKeyFrameSegment(ze())[1],t=this.locationMotion.getKeyFrameSegment(ze())[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=this;if(!this.destroyed){this.pending=!1,this.userAction=o;var u={longitude:null!==(a=i.longitude)&&void 0!==a?a:this.defaultLongitude,latitude:Er(null!==(s=i.latitude)&&void 0!==s?s:this.defaultLatitude,this.minLatitude,this.maxLatitude),fov:90,offset:this.model.bounding.getCenter(new n.Vector3),distance:t.distanceFromModel(this.model,90,this.camera.aspect)},c=Bt(u,["longitude","latitude","fov"]),h={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(c,r).catch(He),this.locationMotion.set(h,r).then((function(){l.emit("initAnimationEnded",e,u,l.userAction)}),(function(t){var i=bo(l.camera.pose);l.emit("initAnimationEnded",e,i,l.userAction)})).then((function(){l.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=yo(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 Bt(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),u={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},c=(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(es(2*o.x*c/h.y,this.camera.matrix)),a.add(ts(2*o.y*c/h.y,this.camera.up,this.camera.matrix)),a.x=Er(a.x,l.x-u.x,l.x+u.x),a.z=Er(a.z,l.z-u.z,l.z+u.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(He)}else{a={x:e.center.x-t.x,y:e.center.y-t.y};var p=this.coordinatesForOffset(a),f=co(this.cameraMotion.value.longitude+-1*p.longitude),A=Er(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(He),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 Bt(e,["x","y"])}));if(this.emit("wantsGesture","pinch",o,r))return;var a=Er(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(He)}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 u=e.pointers.map((function(e){return Bt(e,["x","y"])}));if(!this.emit("wantsGesture","pinch",u,r)){var c=e.pointers.map((function(e){return Bt(e,["x","y"])}));if(!this.emit("wantsGesture","pinch",c,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),g=this.renderer.getSize(new n.Vector2);d.add(es(2*h.x*v/g.y,this.camera.matrix)),d.add(ts(2*h.y*v/g.y,this.camera.up,this.camera.matrix)),d.x=Er(d.x,f.x-A.x,f.x+A.x),d.z=Er(d.z,f.z-A.z,f.z+A.z);var m={longitude:0,latitude:Math.PI/2,fov:this.cameraMotion.value.fov,offset:d,distance:this.locationMotion.value.distance};this.emit("wantsPanGesture",m,e.isFinal)||(this.emit("gesture","pan",c,e.isFinal),this.emit("panGesture",m,e.isFinal),this.userAction=!0,this.locationMotion.set({x:d.x,y:d.y,z:d.z},0).catch(He))}}}}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=Er(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(He),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 Bt(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(!mr(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}(Do),ns={type:"move"},rs=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,u=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(ns)),u&&e.hand){a=!0;for(var c=0,h=e.hand.values();c<h.length;c++){var d=h[c],p=t.getJointPose(d,i);if(void 0===u.joints[d.jointName]){var f=new n.Group;f.matrixAutoUpdate=!1,f.visible=!1,u.joints[d.jointName]=f,u.add(f)}var A=u.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=u.joints["index-finger-tip"],g=u.joints["thumb-tip"],m=v.position.distanceTo(g.position);u.inputState.pinching&&m>.025?(u.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!u.inputState.pinching&&m<=.015&&(u.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!==u&&(u.visible=null!==a),this},e}(),os=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 rs,new rs],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 Le(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],u=(r[9]-1)/r[5],c=(r[8]-1)/r[0],h=(o[8]+1)/o[0],d=a*c,p=a*h,f=n/(-c+h),A=f*-c;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,g=s+f,m=d-A,y=p+(n-A),x=l*s/g*v,b=u*s/g*v;e.projectionMatrix.makePerspective(m,y,x,b,v,g)},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,dt.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}(Ue),as=["webXRSessionStart","webXRSessionEnd"],ss=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 Le(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(ss.prototype,{isLineSegmentsGeometry:!0});var ls={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"},us=function(e){function t(t){var i=e.call(this,{uniforms:n.UniformsUtils.clone(ls.uniforms),vertexShader:ls.vertexShader,fragmentShader:ls.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 Le(t,e),t}(n.ShaderMaterial);Object.assign(us.prototype,{isLineMaterial:!0});var cs=function(e){function t(t,i){var n=e.call(this)||this;return n.type="LineSegments2",n.geometry=void 0!==t?t:new ss,n.material=void 0!==i?i:new us({color:16777215*Math.random()}),n}return Le(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,u=t.count;s<u;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 c=new n.InstancedInterleavedBuffer(r,2,1);return e.setAttribute("instanceDistanceStart",new n.InterleavedBufferAttribute(c,1,0)),e.setAttribute("instanceDistanceEnd",new n.InterleavedBufferAttribute(c,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,u=s.linewidth,c=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,g=new n.Line3,m=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 x=0,b=c.count;x<b;x++){d.fromBufferAttribute(c,x),p.fromBufferAttribute(h,x),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,E=d.z>1&&p.z>1;if(!w&&!E){d.x*=l.x/2,d.y*=l.y/2,p.x*=l.x/2,p.y*=l.y/2,g.start.copy(d),g.start.z=0,g.end.copy(p),g.end.z=0;var S=g.closestPointToPointParameter(A,!0);g.at(S,m);var M=n.MathUtils.lerp(d.z,p.z,S),C=M>=-1&&M<=1,I=A.distanceTo(m)<.5*u;if(C&&I){g.start.fromBufferAttribute(c,x),g.end.fromBufferAttribute(h,x),g.start.applyMatrix4(y),g.end.applyMatrix4(y);var T=new n.Vector3,B=new n.Vector3;i.distanceSqToSegment(g.start,g.end,B,T),t.push({point:B,pointOnLine:T,distance:i.origin.distanceTo(B),object:this,faceIndex:x})}}}},t}(n.Mesh);Object.assign(cs.prototype,{isLineSegments2:!0});var hs=function(e){function t(t,i){var n=e.call(this,t,i)||this;return n.type="Line2",n}return Le(t,e),t}(cs);Object.assign(hs.prototype,{isLine2:!0});var ds=function(e){function t(){var t=e.call(this)||this;return t.type="LineGeometry",t}return Le(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}(ss);Object.assign(ds.prototype,{isLineGeometry:!0});var ps=null,fs=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 ds,a=new us({color:14467195,linewidth:2,dashScale:20,dashed:!1});r.line=new hs(o,a);var s=new n.BufferGeometry,l=new n.PointsMaterial({color:14467195,size:8,map:ps||(ps=(new n.TextureLoader).load("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sHDgwCEMBJZu0AAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAABM5JREFUWMO1V0tPG2cUPZ4Hxh6DazIOrjFNqJs0FIMqWFgWQkatsmvVbtggKlSVRVf5AWz4AWz4AUSKEChll19QJYSXkECuhFxsHjEhxCYm+DWGMZ5HF72DJq4bAzFXurI0M/I5997v3u9cC65vTJVn2lX/xHINQOYSBLTLEuIuCWw4Z3IGAEvf6ASmVHjNzHCXBG4A0AjACsAOwE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Fs6mpqeTc3Nzu3t7e3wQcA7BPZ8Cov1pNlJplmQtAG8MwHV6v95tAINA5MDBwPxAIuLu6upr8fr/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 Le(t,e),Object.defineProperty(t,"version",{get:function(){return"5.0.0-alpha.170"},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(fs.prototype,{isFiveLine:!0});var As=(new n.Matrix4).makeRotationAxis(new n.Vector3(0,1,0),Math.PI),vs=new n.Vector3(-1,1,1),gs=function(e){function t(t){var i=e.call(this,t)||this;i.xrManager=new os(i.renderer,i.renderer.getContext()),i.xrControllerRay=new n.Raycaster,i.pointerLine=new fs,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=rr()]={panoIndex:i.currentPanoIndex,workCode:i.work.workCode,leftPanoPicture:null,position:i.camera.pose.offset.clone(),effect:"fade"},i.parallaxCameraMatrixs=[];var r=dt.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,ke([e],t,!1))}))},a=this,s=0,l=as;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 Le(t,e),t.parseArgs=function(t){var i=Fe(Fe({},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,u=this.work.observers[e],c=this.imageOptions.size;if(void 0===c&&u){var h=u.images.up.match(/\/cube_(\d+)\//);h&&(c=Number(h[1]))}void 0===c&&(c=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)}(gt(e,d,t))},f=Fe({key:"pano.".concat(e),basisLoaderInitialized:ii.isInitialized()},Bt(this.imageOptions,["format","size","quality"])),A=u.images,v=null!==(o=null===(r=u.images.tiles)||void 0===r?void 0:r.filter((function(e){return e.size>c})))&&void 0!==o?o:null,g="pano:"+Ho([A,f,d]);if(this.pendingTextureTask){if(this.pendingTextureTask.hash===g)return;var m=this.pendingTextureTask.panoIndex;null===(a=this.panoMeshes[m])||void 0===a||a.setProgress(0),this.emit("textureAbort",m,u),this.pendingTextureTask.onError(new Error("texture aborted"))}var y,x=this.model.getMaterial()||{},b=x.pano0,w=x.pano1;if((null==b?void 0:b.map.name)===g?y=b:(null==w?void 0:w.map.name)===g&&(y=w),y){var E={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(u.position,u.quaternion,vs)},position:u.position.clone()};this.doMoveToPano(e,E,t,i)}else this.pending=!0,this.pendingTextureTask={panoIndex:e,hash:g,onLoad:function(r){var o;if(l.pending=!1,l.destroyed)r.body.dispose();else{r.body.name=g;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(u.position,u.quaternion,vs)},position:u.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,u),(null===(i=l.pendingTextureTask)||void 0===i?void 0:i.hash)===g&&(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)===g&&(null===(n=l.panoMeshes[e])||void 0===n||n.setProgress(t)),l.emit("textureLoading",t,e,u)}),this.renderer)]).then((function(t){var i,n,r=t[0];(null===(i=l.pendingTextureTask)||void 0===i?void 0:i.hash)===g?(l.pendingTextureTask.onLoad(r),null===(n=l.panoMeshes[e])||void 0===n||n.setProgress(0),delete l.pendingTextureTask,l.emit("textureLoaded",e,u,r.meta)):r.body.dispose()})).catch((function(t){var i,n;(null===(i=l.pendingTextureTask)||void 0===i?void 0:i.hash)===g&&(l.pendingTextureTask.onError(t),null===(n=l.panoMeshes[e])||void 0===n||n.setProgress(0),delete l.pendingTextureTask,l.emit("textureError",t,e,u),l.emit("error",t))})),this.emit("textureStartLoad",e,u)},t.prototype.doMoveToPano=function(e,t,i,r){var o,a,s,l=this;void 0===i&&(i={}),this.userAction=r;var u=ze(),c=rr();this.panoResources[c]=t;var h,d,p;if(this.locationMotion.ended){var f=this.locationMotion.getKeyFrameSegment(u);f[0];var A=f[1],v=this.locationMotion.value,g=this.panoResourceFromLocationMotionKeyframe(A).position,m=t.position;h=Math.max(g.distanceTo(m),1),d=[{key:A.key,progress:0,value:Fe(Fe({},v),{count:0})},{key:c,progress:1,value:{distance:0,perspToOrtho:0,orthoDistance:1,modelAlpha:0,count:1}}],p=0}else{var y=this.locationMotion.getKeyFrameSegment(u),x=y[0],b=(A=y[1],v=this.locationMotion.value,this.panoResourceFromLocationMotionKeyframe(x).position),w=(g=this.panoResourceFromLocationMotionKeyframe(A).position,m=t.position,A.value.count-v.count),E=Math.max(b.distanceTo(g),1)*w;h=E+Math.max(g.distanceTo(m),1),d=[{key:x.key,progress:0,value:Fe({},v)},{key:A.key,progress:E/h,value:A.value},{key:c,progress:1,value:{count:A.value.count+1,distance:0,perspToOrtho:0,orthoDistance:1,modelAlpha:0}}];var S=this.locationMotionKeyframesLength(this.locationMotion.keyframes),M=this.locationMotionKeyframesLength(d);p=this.locationMotion.getProgressVelocity(u)*S/M}var C=this.calculateMovingDuration(i.duration,h),I={longitude:i.longitude,latitude:i.latitude,fov:i.fov},T={longitude:null!==(o=I.longitude)&&void 0!==o?o:this.camera.pose.longitude,latitude:null!==(a=I.latitude)&&void 0!==a?a:this.camera.pose.latitude,fov:null!==(s=I.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,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=He,this.videoTexture.needsUpdate=!0),this.panoVideo.setMaterial(null),this.cameraMotion.set(I,C).catch(He),this.locationMotion.setKeyframes(d,C,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 u=l.work.observers[l.currentPanoIndex];if(u&&u.video&&l.videoTexture&&l.videoTexture.image instanceof HTMLVideoElement){var c=As.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(u.video.matrix),h={map:l.videoTexture,size:u.video.size,matrix:c,alpha:1},d=rr(),p=l.videoTexture.image;p.setAttribute("uuid",d),jo().then((function(e){e&&u.video&&p.getAttribute("uuid")===d&&(p.oncanplay=function(){p.oncanplay=He,p.play()},p.ontimeupdate=function(){p.currentTime>.5&&(p.ontimeupdate=He,l.panoVideo.setMaterial(h))},p.src=u.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.getWorldDirection(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=yo(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),u=l[0];l[1]<this.panoTapTriggerRadius&&(r=u)}mr(r)&&(r=this.getForwardPanoIndexOrNot(t));for(var c=0,h=this.locationMotion.keyframes;c<h.length;c++){var d=h[c],p=this.panoResourceFromLocationMotionKeyframe(d);if(!(d.progress<this.locationMotion.progress)&&p.panoIndex===r){r=null;break}}if(this.emit("panoSelected",r),mr(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,g=Math.PI/12,m=new n.Vector3(0,1,0),y=f.position.clone().setY(0).sub(o.position.clone().setY(0)).normalize(),x=y.clone().applyAxisAngle(m,v),b=y.clone().applyAxisAngle(m,-v),w=[],E=[],S=[],M=0,C=f.accessibleNodes;M<C.length;M++){if((u=C[M])!==this.currentPanoIndex&&u!==r){var I=this.work.observers[u].position.clone().sub(f.position).setY(0);y.angleTo(I)<v?S.push(I):x.angleTo(I)<v?w.push(I):b.angleTo(I)<v&&E.push(I)}}var T=(S.length>0?S:ke(ke([],w,!0),E,!0)).slice().sort((function(e,t){return e.angleTo(y)-t.angleTo(y)}))[0];return T&&T.angleTo(i)>g&&(A.longitude=Math.atan2(-T.x,-T.z)),this.cameraMotion.value.latitude<-Math.PI/4&&(A.latitude=Er(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,u,c=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]),g=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),m=!1;if(!1===this.locationMotion.ended){this.locationMotion.update(e);var y=this.locationMotion.getKeyFrameSegment(e),x=y[0],b=y[1],w=this.panoResourceFromLocationMotionKeyframe(x),E=this.panoResourceFromLocationMotionKeyframe(b),S=(new n.Vector3).copy(w.position),M=(new n.Vector3).copy(E.position),C=this.locationMotion.value.count-b.value.count+1;f.progress=C,f.modelAlpha=this.locationMotion.value.modelAlpha,this.camera.perspToOrtho.setScalar(Er(this.locationMotion.value.perspToOrtho,0,1)),this.camera.orthoDistance=this.locationMotion.value.orthoDistance,E.leftPanoPicture&&(C<1?w.leftPanoPicture&&(f.pano0=w.leftPanoPicture):f.pano0=E.leftPanoPicture,f.pano1=E.leftPanoPicture),m=f.useBlackTransition="instant"===E.effect||"montage"===E.effect,"fade"!==E.effect&&"montage"!==E.effect||(f.pano0&&w.leftPanoPicture&&(f.pano0={map:f.pano0.map,luminanceMap:f.pano0.luminanceMap,matrix:w.leftPanoPicture.matrix.clone().setPosition(E.position)}),S.copy(M)),A.distance=this.locationMotion.value.distance,A.offset=new n.Vector3(S.x+(M.x-S.x)*C,S.y+(M.y-S.y)*C,S.z+(M.z-S.z)*C);for(var I=[],T=[],B=0,P=this.locationMotion.keyframes;B<P.length;B++){var R=P[B],D=R.key,O=R.progress;void 0!==D&&(I.push(D),O>=this.locationMotion.progress&&T.push(D))}for(var L=0,F=Object.keys(this.panoResources);L<F.length;L++){var k=F[L];if(!(T.indexOf(k)>=0)){var N=this.panoResources[k];if(N.leftPanoPicture){var V=N.leftPanoPicture.map;if(V){if(V===(null===(i=f.pano0)||void 0===i?void 0:i.map))continue;if(V===(null===(r=f.pano1)||void 0===r?void 0:r.map))continue;V instanceof ri&&V.cubeRenderTarget&&this.colorCubeRenderTargetPool.push(V.cubeRenderTarget),V.dispose(),N.leftPanoPicture=null}}I.indexOf(k)>=0||delete this.panoResources[k]}}w.workCode===E.workCode?this.currentPanoIndex=C<.5?w.panoIndex:E.panoIndex:this.currentPanoIndex=E.panoIndex,this.emit("movingToPano",g.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===xo(f)&&((null===(o=f.pano0)||void 0===o?void 0:o.map)&&f.pano0.map instanceof ri&&!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 ri&&!f.pano1.map.cubeRenderTarget&&(f.pano1.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),this.model.setMaterial(f)),!1===xo(A)&&this.setCamera(A);var Q=h[1];if(Q)if(this.xrManager.session){var U=this.xrManager.referenceSpace;if(U){var H=this.xrManager.cameraVR,q=this.xrManager.cameraL,z=this.xrManager.cameraR,j=[q,z],_=Q.getViewerPose(U),K=new n.Vector3(0,0,0);if(_){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=_.views;if(!G)return void console.error("no layer found");this.renderer.setFramebuffer(G.framebuffer);var Y=!1;X.length!==H.cameras.length&&(H.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=j[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),K.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&&H.cameras.push(oe)}}var ue=this.xrManager.session.inputSources;for(ie=0;ie<this.xrManager.controllers.length;ie++){var ce=this.xrManager.controllers[ie],he=ue[ie];ce.update(he,Q,U)}var de=this.xrManager.getController(0),pe=de.position.clone().add(K).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),ge=fe[0].point.clone().add(ve);this.intersectMesh.position.copy(ge);var me=ge.clone().add(ve);if(this.intersectMesh.lookAt(me),Math.abs(Ae.y)>.99){var ye=this.camera.position.clone().sub(ge);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||m){var xe=this.work.observers[this.currentPanoIndex];if(xe)for(var be=0,we=Ie=xe.visibleNodes.concat(this.currentPanoIndex);be<we.length;be++){var Ee=we[be];(De=this.panoMeshes[Ee])&&De.setOpacity(0)}}else{var Se=this.work.observers[this.currentPanoIndex];if(Se){var Me=yo(Se.visibleNodes,(function(e){return Se.standingPosition.distanceTo(c.work.observers[e].standingPosition)}),!0),Ce=Me[1];Ce=Er(Ce,2.5,1/0);for(var Ie=Se.visibleNodes.concat(this.currentPanoIndex),Te=this.getForwardPanoIndexOrNot(),Be=this.camera.getWorldDirection(new n.Vector3),Pe=0,Re=Ie;Pe<Re.length;Pe++){Ee=Re[Pe];var De,Oe=this.work.observers[Ee];if(De=this.panoMeshes[Ee])if(Oe.loadable||Oe.active){var Le=De.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);De.setCurrent(!De.loading&&0===De.progress&&Te===Ee),De.setOpacity(Le<.01?0:Er(Ce/Le*1.2,.65,.98));var Fe=this.camera.position.clone().setY(De.position.y),ke=(new n.Vector3).copy(De.position).sub(Fe).normalize();if(Ee===this.currentPanoIndex){var Ne=Er((.5-Fe.distanceTo(De.position))/.5,0,1);ke.multiplyScalar(1-Ne).add(Be.clone().multiplyScalar(Ne))}ke.length()>0&&De.quaternion.setFromEuler(new n.Euler(0,Math.atan2(ke.x,ke.z),0)),De.updateTime&&De.updateTime(e,t)}else De.setOpacity(0)}}}var Ve,Qe=function(){if(!1===c.tileLevelForFov)return 0;var e=new n.Vector2(4e3,4e3),t=g.panoIndex,i=c.work.observers[t],r=c.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=c.tileLevelForFov(q.fov,e);return s>a?s:0}(),Ue=((Ve=new n.PerspectiveCamera).applyMatrix4(H.matrix),Ve.position.set(0,0,0),Ve.quaternion.premultiply(c.work.observers[g.panoIndex].quaternion.clone().inverse()),Ve.updateProjectionMatrix(),Ve.updateMatrixWorld(!0),(new n.Frustum).setFromProjectionMatrix((new n.Matrix4).multiplyMatrices(Ve.projectionMatrix,Ve.matrixWorldInverse)));g.panoIndex===this.currentPanoIndex&&(null===(s=g.leftPanoPicture)||void 0===s?void 0:s.map)instanceof ri&&(g.leftPanoPicture.map.update(Ue,Qe),!0===g.leftPanoPicture.map.needsRender&&(this.needsRender=!0));var He=this.tiling.object.visible;if(Qe>this.TILED_CUBE_TEXTURE_LEVEL&&this.initAnimationed){var qe=g.panoIndex,ze=this.work.observers[qe];ze&&no(this.camera.position,ze.position)&&this.locationMotion.ended?(this.tiling.object.visible=!0,this.tiling.panoIndex!==qe&&this.tiling.cleanup(),this.tiling.panoIndex=qe,this.tiling.setResource(null!==(u=null===(l=ze.images)||void 0===l?void 0:l.tiles)&&void 0!==u?u:[],this.enableIOSEDR&&ze.images.luminance?ze.images.luminance:null),this.tiling.setRotation(ze.quaternion),this.tiling.setPosition(ze.position),this.tiling.update(Ue,Qe,e)):this.tiling.object.visible=!1}else this.tiling.object.visible=!1;He!==this.tiling.object.visible&&(this.tiling.object.needsRender=!0),this.panoVideo.object.position.copy(this.camera.position),this.panoVideo.updateTime(e);var je=ue[0].gamepad;if((null==je?void 0:je.axes)&&this.emit("webXRSelected","Axes",{axes:je.axes}),-1===(null==je?void 0:je.axes[2])){if(!this.xrControllerState.axes[2].left.isTap){var _e=e-this.xrControllerState.axes[2].left.startTime;_e>=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==je?void 0:je.axes[2])){if(!this.xrControllerState.axes[2].right.isTap){var Ke=e-this.xrControllerState.axes[2].right.startTime;Ke>=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==je?void 0:je.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==je?void 0:je.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==je?void 0:je.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==je?void 0:je.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==je?void 0:je.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==je?void 0:je.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==je?void 0:je.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==je?void 0:je.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}(pa),ms=["Panorama","DepthPanorama","Model"],ys={Floorplan:Oo,Topview:Qo,Panorama:pa,VRPanorama:_a,Model:Ka,DepthPanorama:$a,Mapview:is,XRPanorama:gs};function xs(e){for(var t=0,i=ms;t<i.length;t++){var n=i[t];if("string"==typeof e){if(n===e)return!0}else if(e instanceof Do&&e instanceof ys[n])return!0}return!1}var bs=["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 ws(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 Es(){for(var e,t=document.getElementsByTagName("meta"),i=0;i<t.length;i++){var n=t[i];if("viewport"===n.getAttribute("name")){var r=ws(null!==(e=n.getAttribute("content"))&&void 0!==e?e:""),o=Number(r["initial-scale"]);if(!isNaN(o))return o}}return 1}var Ss=[351,63],Ms=[20,20],Cs=new Float32Array([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),Is=new Float32Array([0,0,1,0,0,1,1,1]),Ts=new Uint8Array([0,1,2,1,3,2]),Bs=new n.BufferGeometry;Bs.setAttribute("position",new n.BufferAttribute(Cs,3)),Bs.setAttribute("uv",new n.BufferAttribute(Is,2)),Bs.setIndex(new n.BufferAttribute(Ts,1));var Ps=new n.MeshBasicMaterial({transparent:!0,depthTest:!1,depthWrite:!1,stencilWrite:!1}),Rs=new n.Mesh(Bs,Ps),Ds=new n.Scene;Ds.add(Rs);var Os=new n.OrthographicCamera(-.5,.5,.5,-.5,.1,1);Os.position.set(0,0,.5),Os.lookAt(0,0,0);var Ls=new n.Vector4,Fs=new n.Vector4;function ks(e){if(Ps.map){var t=e.getViewport(Ls),i=e.getScissor(Fs),r=e.getScissorTest(),o=e.autoClear;e.setViewport(i.x+Ms[0]/3,i.y+Ms[1]/3,Ss[0]/3,Ss[1]/3),e.setScissor(i.x+Ms[0]/3,i.y+Ms[1]/3,Ss[0]/3,Ss[1]/3),e.setScissorTest(!0),e.autoClear=!1,e.render(Ds,Os),e.setViewport(t),e.setScissor(i),e.setScissorTest(r),e.autoClear=o}else{var a=new n.Texture,s=new Image;s.onload=function(){a.image=s,a.wrapS=n.ClampToEdgeWrapping,a.wrapT=n.ClampToEdgeWrapping,a.minFilter=n.LinearFilter,a.needsUpdate=!0,Ps.needsUpdate=!0,s.onload=function(){}},s.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAV8AAAA/CAQAAADtPwPkAAAR+0lEQVR4AezYg3LEQACH8d1cbdu23Q5qG9G47z/TN/h6tn2b/H+TUTLc7yjcOXV46OUAnUs6EbUp022ZBXc1NhoZYYd7fjDRvdcHAwrlK2QBVJ4sgoqONmY45RUT23sZ6H42F2hK5CtkMbjhZlDmUUcvq1zyieUVyjbE4I1GBfItwxG56YaUZTQwyh4P6NgJ4YYYvCuQb5kOyI03pORjiqe4Lwpq5pt1vJqfUwKWJVbSMYfppYconG+maNNQOWBZuwHTzicGel75NtFOkxr5apmV8cikcko0DrDQs863AeGl0cE0+1xy573m0/wf0cEKW6H7BWtggiMG8sy3oHRDpJMw4NWb6am/bv9znkqEzjd61t5oo5clTrjhwevO75EJRBKSRt745Z16ZEjcM73sccZplBPm8PyTcxZAkSRdHm/acJ0Z3JZhHB0BxqDHgWFZFmm0ZbCw87twI/zc3e/Cz93vPneXtU/WdQS3oTviXdY/q5PsJKfoGuQjZuO/0in1qsj85cuXrxqeAOJpGqdJOqrUutgVl2Qb0BWqp/RE8AWWVB7t2KrIzY2Wx2fWKl7yfswgxqj8lYummYa3hfwF9MuQRmbfQE4ocPDjtUWQ6Tq1M2w7gC2EcrMGtWS6xlpGKEDDcb1vUQ25zT4lrC2s0dU4gFPppKkbeIYr7NMpqjStuFg5rNU9epGyt8PXyfX4DE1bKLhR/1XPxwJhp5DAV67T9ZPwFdovhBMIGUYoRBN4wim6S3eoXVEHXdLgmwY0x6BQnO4xPJ0Ar5O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map=a}}var Ns=new n.Box3(new n.Vector3(-50,-50,-50),new n.Vector3(50,50,50)),Vs=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/")},Qs=new n.Vector2,Us=new n.Frustum,Hs=new n.Matrix4,qs=new WeakMap,zs=new WeakMap,js=function(e){function t(t){void 0===t&&(t={});var i,r,o,a,s,l,u,c,h,d,p,f=this;if((f=e.call(this)||this).ident=rr(),_s.instances[f.ident]=f,f.renderSwitch01=0,f.panoIndex=0,f.needsRender=!1,f.onlyRenderIfNeeds=null===(i=t.onlyRenderIfNeeds)||void 0===i||i,f.imageOptions=Fe({},null!==(r=t.imageOptions)&&void 0!==r?r:{}),f.textureOptions=Fe({},null!==(o=t.textureOptions)&&void 0!==o?o:{}),f.poweredByRealsee=null===(a=t.poweredByRealsee)||void 0===a||a,f.extraElements=[],f.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)},f.fps={testCount:0,testTime:ze()},f.modeChangeDuration=null!==(s=t.modeChangeDuration)&&void 0!==s?s:800,f.panoramaLikeSavedPose={},"undefined"!=typeof window)if(t.renderer)t.renderer instanceof hi&&f.throwError(new Error("cannot render a internal renderer")),f.renderer=t.renderer;else try{f.renderer=new hi({preserveDrawingBuffer:t.preserveDrawingBuffer,backgroundColor:t.backgroundColor,backgroundAlpha:t.backgroundAlpha,antialias:t.antialias,webgl2:null==t?void 0:t.webgl2});var A=Es();f.renderer.setPixelRatio(1===A?window.devicePixelRatio:1),f.renderer.setSize(512,512)}catch(e){e instanceof Error&&f.throwError(e)}f.copyEffect=new Ro(f.renderer),f.getPixelsRenderTarget=new n.WebGLRenderTarget(1,1,{encoding:null!==(u=null===(l=f.renderer)||void 0===l?void 0:l.outputEncoding)&&void 0!==u?u:n.sRGBEncoding}),f.scissor=Object.assign({left:0,bottom:0,width:1,height:1},t.scissor),f.camera=new xi(80),f.scene=new di,f.parallaxScene=new di,f.lastLoadWorkTask=Promise.resolve(),f.requestProxy=null!==(c=t.requestProxy)&&void 0!==c?c:Vs,f.networkSubscribe=new ot,f.networkSubscribe.on("network",(function(e,t,i,n){var r;f.emit("network",e,t,i,n),null===(r=f.analysis)||void 0===r||r.network(f.work,e,t,i,n)})),f.boundingMesh=so(new n.Box3(new n.Vector3(-.5,-.5,-.5),new n.Vector3(.5,.5,.5))),f.scene.add(f.boundingMesh),f.model=new wr({allowHosts:[],requestProxy:f.requestProxy,networkSubscribe:f.networkSubscribe});var v=so(Ns);v.name="model_empty",f.model.add(v),f.model.visible=!1,f.readyCallbacks=[],f.modelPending=!1,f.syncingState=!1,f.scene.add(f.model),f.helperGroup=new n.Group,f.helperGroup.name="helper",f.scene.add(f.helperGroup),f.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)}(f.scene),f.state={mode:null!==(h=f.currentMode)&&void 0!==h?h:"Panorama",panoIndex:null!==(d=f.panoIndex)&&void 0!==d?d:0,longitude:f.camera.pose.longitude,latitude:f.camera.pose.latitude,fov:f.camera.pose.fov,offset:f.camera.pose.offset.clone(),distance:f.camera.pose.distance},f.stateSynced=!1,f._enableIOSEDR=!1,f.destroyed=!1,f.paused=!0,"undefined"!=typeof window&&(!1!==t.play&&f.play(),!1!==(null!==(p=t.initialBasisLoader)&&void 0!==p&&p)&&("string"==typeof t.initialBasisLoader?f.initBasisLoader(t.initialBasisLoader):f.initBasisLoader()),f.stopAnimationLoop=dt.shared.add((function(e,t){for(var i=[],n=2;n<arguments.length;n++)i[n-2]=arguments[n];f.updateTime.apply(f,ke([e,t],i,!1))}),!1,0,10));var g=function(){"undefined"!=typeof document&&null===document.fullscreenElement&&"VRPanorama"===f.currentMode&&f.controller.emit("vrWantsToExit")};if("undefined"!=typeof document&&document.addEventListener("fullscreenchange",g,!1),f.removeEventListeners=function(){"undefined"!=typeof document&&document.removeEventListener("fullscreenchange",g,!1)},f.plugins={},t.plugins&&t.plugins.length)for(var m=0,y=t.plugins;m<y.length;m++){var x=y[m];if("function"==typeof x)x(f);else if(Array.isArray(x)){var b=x[0],w=x[1],E=x[2];if("function"==typeof b){var S=b(f,E);"string"==typeof w&&(f.plugins[w]?f.throwError(new Error("plugin name ".concat(w," is exists."))):f.plugins[w]=S)}}}return f.gpuPickingRenderTarget=new n.WebGLRenderTarget(1,1),f.meshReplaceMaterialMap=new Map,f.meshOriginMaterialMap=new Map,f}return Le(t,e),Object.defineProperty(t,"version",{get:function(){return"5.0.0-alpha.170"},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 bt)){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 bt)&&a.meshOriginMaterialMap.get(e.uuid)&&(e.material=a.meshOriginMaterialMap.get(e.uuid))})),this.model.setMaterial({modelColorInfo:null});var u=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 u||!1},t.prototype.dispose=function(){var e,t;if(!0!==this.destroyed){delete _s.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 hi&&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(Qs);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 hi){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;if(this.renderer instanceof hi){if(t)this.renderer.setPixelRatio(t);else{if((t=1===Es()?Math.floor(window.devicePixelRatio):1)>1)for(;t>1&&a*l*t*t>7372800;)t--;this.renderer.setPixelRatio(t)}this.renderer.setSize(a,l)}}var u=this.renderer.getSize(new n.Vector2);this.camera.aspect=u.x*this.scissor.width/(u.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)}},t.prototype.initBasisLoader=function(e){try{if(!this.renderer)throw new Error("renderer is not initialized.");if("undefined"==typeof Promise||"undefined"==typeof WeakMap||"undefined"==typeof WebAssembly)throw new Error("Basis loader not support.");"string"==typeof e&&ii.setTranscoderPath(e),ii.workerConfig.format||ii.detectSupport(this.renderer),ii._allocateWorker(0)}catch(e){e instanceof Error&&this.throwError(e)}},Object.defineProperty(t.prototype,"work",{get:function(){var e=zs.get(this);if(e&&Or.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,u,c,h,d,p,f,A=this;void 0===o&&(o=!0);var v,g,m,y=Vr(e),x=this.work;void 0===i&&(i=x?"inherit":"initial"),"inherit"===i?(v="number"==typeof this.panoIndex&&y.observers[this.panoIndex]?this.panoIndex:y.initial.panoIndex,g=null!==(a=this.currentMode)&&void 0!==a?a:y.initial.mode,m={longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov}):"initial"===i?(g=null!==(s=this.currentMode)&&void 0!==s?s:y.initial.mode,v=y.initial.panoIndex,m=g===t.Mode.Panorama||g===t.Mode.DepthPanorama||g===t.Mode.Model||g===t.Mode.VRPanorama||g===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,g=null!==(c=null!==(u=i.mode)&&void 0!==u?u:this.currentMode)&&void 0!==c?c:"Panorama",m={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:g,longitude:m.longitude,latitude:m.latitude,fov:m.fov});var b=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=Fe(Fe({initial:[v,m,i,o]},A.commonParams()),A.controllerInits[g]);A.controller?!1===A.controller.updateWork(y,v,m,i,o)&&(A.controller.destroy(),A.controller=A.applyController(g,n)):A.controller=A.applyController(g,n),A.emit("load",e,y,{panoIndex:v,mode:g,longitude:m.longitude,latitude:m.latitude,fov:m.fov}),null===(t=A.analysis)||void 0===t||t.work(y)},w=function(e){var t;void 0===e&&(e=He),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())};zs.set(this,y);for(var E=new n.Box3,S=0,M=y.observers;S<M.length;S++){var C=M[S];E.expandByPoint(C.standingPosition),E.expandByPoint((new n.Vector3).fromArray([C.position.x,2*C.position.y-C.standingPosition.y,C.position.z]))}return this.model.bounding.union(E),g===t.Mode.Floorplan||g===t.Mode.Topview||g===t.Mode.Mapview||g===t.Mode.Model?w((function(){b(),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),b(),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 u=new Error('mode "'.concat(e,'" is not existed'));return a.throwError(u),void l(u)}if((e===t.Mode.Floorplan||e===t.Mode.Topview||e===t.Mode.Mapview||e===t.Mode.Model)&&(mr(a.model)||!0!==a.model.loaded)){u=new Error("model is not ready.");return a.throwError(u),void l(u)}if(mr(a.controller)){u=new Error("controller is not ready.");return a.throwError(u),void l(u)}var c=a.controller,h=a.currentMode,d=function(){var u,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!==(u=i.panoIndex)&&void 0!==u?u:a.panoIndex)&&void 0!==d?d:0,Fe({duration:n},i),r):a.controller.updateCamera(i,n,r).catch(He):("number"==typeof i.panoIndex&&i.panoIndex!==a.panoIndex&&(a.panoIndex=i.panoIndex),a.controller.updateCamera(i,n,r).catch(He));else{c.destroy();var A=null!==(f=null!==(p=i.panoIndex)&&void 0!==p?p:a.panoIndex)&&void 0!==f?f:0,v=xs(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);var g=Fe(Fe({initial:[A,v,n,r]},a.commonParams()),a.controllerInits[e]);a.saveControllerPose(c),a.controller=a.applyController(e,g);var m=ys[e].initAnimationEndPose(g);a.emit("modeChange",e,h,A,m,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=dt.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){dt.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=Er(e,Math.floor(i/2),Math.floor(s.x-i)),t=Er(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=xt.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(Qs);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(Qs);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&&ks(this.renderer),this.renderer.setRenderTarget(null),e&&dt.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&&ks(n.renderer)),e&&dt.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,ke([e,t],s,!1)),this.camera.updateTime(e,t),this.syncingState=!1;var u=new n.Vector2(512,512),c=new n.Vector2(512,512);this.renderer&&(this.renderer.getSize(u),u.x*=this.scissor.width,u.y*=this.scissor.height,this.renderer.getDrawingBufferSize(c),c.x*=this.scissor.width,c.y*=this.scissor.height),this.renderer&&this.model.update(this.renderer,this.camera);var h=new n.Box3;if(this.work)for(var d=0,p=this.work.observers;d<p.length;d++){var f=p[d];h.expandByPoint(f.standingPosition),h.expandByPoint((new n.Vector3).fromArray([f.position.x,2*f.position.y-f.standingPosition.y,f.position.z]))}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 A=null!==(r=this.model.getMaterial())&&void 0!==r?r:{},v=1-(null!==(o=A.modelAlpha)&&void 0!==o?o:0);A.opacity=Er(4*v-3,0,1),this.boundingMesh.setMaterial(A),this.boundingMesh.setTransparent(1!==v);var g=[];Hs.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),Us.setFromProjectionMatrix(Hs);for(var m=0,y=this.scene.children;m<y.length;m++){var x=y[m];x!==this.model&&(x instanceof n.Object3D&&x.traverseVisible((function(t){if(t.setResolution&&t.setResolution(u.x,u.y),t.setTime&&t.setTime(e),t.mixer instanceof n.AnimationMixer){var i=qs.get(t.mixer);i||(i=new n.Clock,qs.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||Us.intersectsObject(t))&&g.push(t)})))}if(c.width*c.height>8388608?this.renderSwitch01=1^this.renderSwitch01:this.renderSwitch01=0,this.renderer&&!1===this.paused&&0===this.renderSwitch01){var b=void 0;if(!0!==this.onlyRenderIfNeeds)b=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.needsRender)for(var w=0,E=g;w<E.length;w++){var S=E[w],M=function(e){!0===e.needsRender?(e.needsRender=!1,a.needsRender=!0):e.mixer&&e.mixer.stats.actions.inUse>0&&(a.needsRender=!0)};M(S),S.traverseAncestors(M)}!1!==this.needsRender&&(b=this.render())}if(this.needsRender=!1,this.controller&&this.screenBuffers){var C=this.controller,I=this.screenBuffers;this.aroundScissor((function(){C.postProcessing(I[0],I[1]),a.copyEffect.render(I[1],void 0)}))}this.hasListener("renderFrame")&&this.emit("renderFrame",void 0!==b)}if(this.fps.testTime&&e-this.fps.testTime<1e3)this.fps.testCount++;else if(this.emit("fps",this.fps.testCount),this.fps.testTime=e,this.fps.testCount=0,this.renderer){var T=this.renderer.getContext(),B=lo(T);B&&this.throwError(B)}}},t.prototype.pause=function(){this.paused=!0,this.renderer&&this.renderer instanceof hi&&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?mr(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=He),!this.work)return Promise.reject(new Error("work never loaded"));var n=this.work.observers[e],r=this.work.allowHosts,o=ze();return Promise.all(["right","left","up","down","front","back"].map((function(t){var o=Fe({key:"pano.".concat(e,".").concat(t),basisLoaderInitialized:ii.isInitialized()},Bt(i.imageOptions,["size","format","quality","mappings"])),a=n.images[t];return lt(i.imageOptions.transform?i.imageOptions.transform(a,o):vt(a,o),{allowHosts:r,requestProxy:i.requestProxy,networkSubscribe:i.networkSubscribe})}))).then((function(){var e=ze()-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),u=l.x*this.scissor.width,c=l.y*this.scissor.height,h=l.x*this.scissor.left+(s.x+1)/2*u,d=l.y*(1-this.scissor.bottom-this.scissor.height)+(1-s.y)/2*c;return new n.Vector2(h,d)},t.prototype.getRenderObjects=function(e){Hs.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),Us.setFromProjectionMatrix(Hs),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||Us.intersectsObject(e))&&t.push(e)})),t},t.prototype.getCurrentState=function(){return Fe(Fe({},this.getPose()),{mode:this.currentMode||t.Mode.Panorama,panoIndex:this.panoIndex||0})},t.prototype.setState=function(e,i,r){var o,a,s,l,u,c,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,g,m,y=null!==(o=e.panoIndex)&&void 0!==o?o:this.state.panoIndex,x=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||!mr(this.model)&&!0===this.model.loaded){if(this.state.mode!==x){if("VRPanorama"===x)return void this.changeMode("VRPanorama",void 0,void 0,!0);var b=void 0;b=xs(this.state.mode)&&xs(x)?Fe({},this.state):xs(x)?Fe({},this.panoramaLikeSavedPose):x===t.Mode.Mapview?{longitude:this.panoramaLikeSavedPose.latitude}:Fe({},e),"number"==typeof e.longitude&&(b.longitude=e.longitude),"number"==typeof e.latitude&&(b.latitude=e.latitude),"number"==typeof e.fov&&(b.fov=e.fov);var w=Fe(Fe({initial:[y,b,this.modeChangeDuration,!1]},this.commonParams()),this.controllerInits[x]),E=ys[x].initAnimationEndPose(w);f=E.longitude,A=E.latitude,v=E.fov,g=E.offset,m=E.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!==(u=e.fov)&&void 0!==u?u:this.state.fov,g=null!==(c=e.offset)&&void 0!==c?c:this.state.offset,m=null!==(h=e.distance)&&void 0!==h?h:this.state.distance;var S={panoIndex:y,mode:x,longitude:f,latitude:A,fov:v,offset:g,distance:m};this.emit("setState",S),go(this.state,S)||(this.controller&&"VRPanorama"===S.mode&&S.mode!==this.state.mode?(vo(this.state,S),this.changeMode("VRPanorama")):this.controller&&"XRPanorama"===S.mode&&S.mode!==this.state.mode?(vo(this.state,S),this.changeMode("XRPanorama")):(vo(this.state,S),this.controller&&(this.controller.userAction=r),i&&this.state.mode===S.mode&&(this.syncingState=this.syncState(ze(),0,i),this.syncingState&&(null===(d=this.controller)||void 0===d||d.updateTime(ze(),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};return this.changeMode(this.state.mode,a,this.modeChangeDuration,this.controller.userAction),!0}if(!1===this.controller.isReady())return!1;if(this.controller instanceof ys.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,s,!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 ys.Topview||this.controller instanceof ys.Mapview){var l=1,u=r?this.state.fov:fo(this.camera.pose.fov,this.state.fov,l),c=r?new n.Vector3(this.state.offset.x,this.state.offset.y,this.state.offset.z):new n.Vector3(fo(this.camera.pose.offset.x,this.state.offset.x,.2),fo(this.camera.pose.offset.y,this.state.offset.y,.2),fo(this.camera.pose.offset.z,this.state.offset.z,.2));if(io(u,this.camera.pose.fov)||ro(c,this.camera.pose.offset))return this.controller.cameraMotion.set({fov:u},0).catch(He),this.controller.locationMotion.set({x:c.x,y:c.y,z:c.z},0).catch(He),!0}else{l=1;var h=Math.PI/45,d=(u=r?this.state.fov:fo(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=co(e.longitude),r=e.latitude,o=co(t.longitude),a=t.latitude;o-n>ho?n+=po:n-o>ho&&(n-=po);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},h)),p=d.longitude,f=d.latitude;if(io(p,this.camera.pose.longitude,2*Math.PI)||io(f,this.camera.pose.latitude)||io(u,this.camera.pose.fov))return this.controller.cameraMotion.set({longitude:p,latitude:f,fov:u},0).catch(He),!0}if(this.stateSynced=!0,!1===o&&this.emit("stateSynced",this.state),this.readyCallbacks.length&&this.stateSynced){var A=this.currentMode;if(!(A===t.Mode.Floorplan||A===t.Mode.Topview||A===t.Mode.Mapview||A===t.Mode.Model)||!this.modelPending){var v=this.readyCallbacks.slice();this.readyCallbacks.length=0;for(var g=0,m=v;g<m.length;g++){var y=m[g];this.controller instanceof ys.Panorama?!0!==y.tile||this.controller.isTileReady()?y():this.readyCallbacks.push(y):y()}}}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(Ao()){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 wr({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,u=a.model;u&&(u.show(),o=u.getMaterial()||{},a.scene.remove(u),u.dispose(),l.setTransparent(u.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,u;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 c=0,h=a.work.observers;c<h.length;c++){var d=h[c];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=so(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===(u=a.renderer)||void 0===u||u.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(He)},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&&xs(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=ys[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,ke([e],t,!1));if(r)return!1}))},s=0,l=bs;s<l.length;s++){a(l[s])}var u=ys[e].initAnimationEndPose(i),c=i.initial[3],h={panoIndex:i.initial[0],mode:e,longitude:u.longitude,latitude:u.latitude,fov:u.fov,offset:u.offset,distance:u.distance};return go(this.state,h)||(vo(this.state,h),this.emit("stateChange",this.state,c)),this.emit("currentStateChange",this.getCurrentState(),c),o.on("cameraUpdate",(function(t,i){var r;if(n.controller){var o=Fe(Fe({},n.controller.getTargetPose()),{panoIndex:n.panoIndex,mode:e});i&&!1===n.syncingState&&n.state.mode===o.mode&&!go(n.state,o)&&(vo(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=Fe(Fe({},i),{panoIndex:t,mode:e});r&&n.state.mode===a.mode&&!go(n.state,a)&&(vo(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=Fe(Fe({},i),{panoIndex:t,mode:e});r&&n.state.mode===a.mode&&!go(n.state,a)&&(vo(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=Fe(Fe({},i),{panoIndex:t,mode:e});r&&n.state.mode===a.mode&&!go(n.state,a)&&(vo(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=Fe(Fe({},i),{panoIndex:t,mode:e});r&&n.state.mode===a.mode&&!go(n.state,a)&&(vo(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}(Ue),_s={instances:{},constructor:js};"undefined"!=typeof window&&Object.assign(window,{__FIVE_DEBUG__:_s});var Ks=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=dt,exports.BVH=Ti,exports.BVHIntersect=Ei,exports.BVHNode=wi,exports.BVHVector3=bi,exports.Camera=xi,exports.Clipper=xt,exports.Five=js,exports.InternalWebGLRenderer=hi,exports.IntersectMesh=eo,exports.Model=wr,exports.NetworkSubscribe=ot,exports.PBMContainer=wt,exports.PBMGroup=Et,exports.PBMMaterial=ci,exports.PBMMesh=bt,exports.PROXY_CONTROLLER_EVENT_NAMES=bs,exports.PanoCircleMesh=_r,exports.PanoCircleMeshCustom=Zr,exports.PanoCircleMeshSolid=Wr,exports.Scene=di,exports.Subscribe=Ue,exports.TextureLoader=oi,exports.Tile3D=Jn,exports.Tile3DModel=gr,exports.TileBoundingSphere=Sn,exports.TileCacheNode=pn,exports.TileCubeTextureTarget=ri,exports.TileCullingVolume=xn,exports.TileOrientedBoundingBox=zn,exports.TileRequestScheduler=dn,exports.Tileset3D=ir,exports.Tileset3DTraverser=er,exports.TilesetCache=An,exports.Work=Lr,exports.XRButton=Ks,exports.defaultImageURLTransform=vt,exports.getViewportScale=Es,exports.imageSupport=function(){return yt||(yt=Promise.all([mt("data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A="),mt("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=Vr;
372
+ * Licensed under the MIT license */var wo=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,u=Date.now;function c(e,t,i){return setTimeout(g(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 g(e,t){return function(){return e.apply(t,arguments)}}function m(e,t){return"function"==typeof e?e.apply(t&&t[0]||n,t):e}function y(e,t){return e===n?t:e}function x(e,t,i){d(S(t),(function(t){e.addEventListener(t,i,!1)}))}function b(e,t,i){d(S(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 E(e,t){return e.indexOf(t)>-1}function S(e){return e.trim().split(/\s+/g)}function M(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 C(e){return Array.prototype.slice.call(e,0)}function I(e,t,i){for(var n=[],r=[],o=0;o<e.length;){var a=t?e[o][t]:e[o];M(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 T(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 B=1;function P(t){var i=t.ownerDocument||t;return i.defaultView||i.parentWindow||e}var R="ontouchstart"in e,D=T(e,"PointerEvent")!==n,O=R&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),L="touch",F="mouse",k=24,N=["x","y"],V=["clientX","clientY"];function Q(e,t){var i=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(t){m(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=H(t));o>1&&!i.firstMultiple?i.firstMultiple=H(t):1===o&&(i.firstMultiple=!1);var a=i.firstInput,s=i.firstMultiple,c=s?s.center:a.center,h=t.center=q(r);t.timeStamp=u(),t.deltaTime=t.timeStamp-a.timeStamp,t.angle=K(c,h),t.distance=_(c,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=j(t.deltaX,t.deltaY);var d=z(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 _(t[0],t[1],V)/_(e[0],e[1],V)}(s.pointers,r):1,t.rotation=s?function(e,t){return K(t[1],t[0],V)+K(e[1],e[0],V)}(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,u=t.timeStamp-s.timeStamp;if(8!=t.eventType&&(u>25||s.velocity===n)){var c=t.deltaX-s.deltaX,h=t.deltaY-s.deltaY,d=z(u,c,h);r=d.x,o=d.y,i=l(d.x)>l(d.y)?d.x:d.y,a=j(c,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 H(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:u(),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 z(e,t,i){return{x:t/e||0,y:i/e||0}}function j(e,t){return e===t?1:l(e)>=l(t)?e<0?2:4:t<0?8:16}function _(e,t,i){i||(i=N);var n=t[i[0]]-e[i[0]],r=t[i[1]]-e[i[1]];return Math.sqrt(n*n+r*r)}function K(e,t,i){i||(i=N);var n=t[i[0]]-e[i[0]],r=t[i[1]]-e[i[1]];return 180*Math.atan2(r,n)/Math.PI}Q.prototype={handler:function(){},init: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)},destroy: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)}};var G={mousedown:1,mousemove:2,mouseup:4},W="mousedown",X="mousemove mouseup";function Y(){this.evEl=W,this.evWin=X,this.pressed=!1,Q.apply(this,arguments)}v(Y,Q,{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:L,3:"pen",4:F,5:"kinect"},$="pointerdown",ee="pointermove pointerup pointercancel";function te(){this.evEl=$,this.evWin=ee,Q.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}e.MSPointerEvent&&!e.PointerEvent&&($="MSPointerDown",ee="MSPointerMove MSPointerUp MSPointerCancel"),v(te,Q,{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==L,l=M(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,Q.apply(this,arguments)}function ae(e,t){var i=C(e.touches),n=C(e.changedTouches);return 12&t&&(i=I(i.concat(n),"identifier",!0)),[i,n]}v(oe,Q,{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:L,srcEvent:e})}}});var se={touchstart:1,touchmove:2,touchend:4,touchcancel:8},le="touchstart touchmove touchend touchcancel";function ue(){this.evTarget=le,this.targetIds={},Q.apply(this,arguments)}function ce(e,t){var i=C(e.touches),n=this.targetIds;if(3&t&&1===i.length)return n[i[0].identifier]=!0,[i,i];var r,o,a=C(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?[I(o.concat(s),"identifier",!0),s]:void 0}v(ue,Q,{handler:function(e){var t=se[e.type],i=ce.call(this,e,t);i&&this.callback(this.manager,t,{pointers:i[0],changedPointers:i[1],pointerType:L,srcEvent:e})}});function he(){Q.apply(this,arguments);var e=g(this.handler,this);this.touch=new ue(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,Q,{handler:function(e,t,i){var n=i.pointerType==L,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?T(a.style,"touchAction"):n,ve=Ae!==n,ge="compute",me="auto",ye="manipulation",xe="none",be="pan-x",we="pan-y",Ee=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 Se(e,t){this.manager=e,this.set(t)}Se.prototype={set:function(e){e==ge&&(e=this.compute()),ve&&this.manager.element.style&&Ee[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){m(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))})),function(e){if(E(e,xe))return xe;var t=E(e,be),i=E(e,we);if(t&&i)return xe;if(t||i)return t?be:we;if(E(e,ye))return ye;return me}(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=E(n,xe)&&!Ee.none,o=E(n,we)&&!Ee["pan-y"],a=E(n,be)&&!Ee["pan-x"];if(r){var s=1===e.pointers.length,l=e.distance<2,u=e.deltaTime<250;if(s&&l&&u)return}if(!a||!o)return r||o&&6&i||a&&i&k?this.preventSrc(t):void 0}},preventSrc:function(e){this.manager.session.prevented=!0,e.preventDefault()}};var Me=32;function Ce(e){this.options=r({},this.defaults,e||{}),this.id=B++,this.manager=null,this.options.enable=y(this.options.enable,!0),this.state=1,this.simultaneous={},this.requireFail=[]}function Ie(e){return 16&e?"cancel":8&e?"end":4&e?"move":2&e?"start":""}function Te(e){return 16==e?"down":8==e?"up":2==e?"left":4==e?"right":""}function Be(e,t){var i=t.manager;return i?i.get(e):e}function Pe(){Ce.apply(this,arguments)}function Re(){Pe.apply(this,arguments),this.pX=null,this.pY=null}function De(){Pe.apply(this,arguments)}function Oe(){Ce.apply(this,arguments),this._timer=null,this._input=null}function Le(){Pe.apply(this,arguments)}function Fe(){Pe.apply(this,arguments)}function ke(){Ce.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function Ne(e,t){return(t=t||{}).recognizers=y(t.recognizers,Ne.defaults.preset),new Ve(e,t)}Ce.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=Be(e,this)).id]||(t[e.id]=e,e.recognizeWith(this)),this},dropRecognizeWith:function(e){return h(e,"dropRecognizeWith",this)||(e=Be(e,this),delete this.simultaneous[e.id]),this},requireFailure:function(e){if(h(e,"requireFailure",this))return this;var t=this.requireFail;return-1===M(t,e=Be(e,this))&&(t.push(e),e.requireFailure(this)),this},dropRequireFailure:function(e){if(h(e,"dropRequireFailure",this))return this;e=Be(e,this);var t=M(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+Ie(i)),n(t.options.event),e.additionalEvent&&n(e.additionalEvent),i>=8&&n(t.options.event+Ie(i))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=Me},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(!m(this.options.enable,[this,t]))return this.reset(),void(this.state=Me);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,Ce,{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:Me}}),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&k&&t.push(be),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=Te(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),v(De,Pe,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[xe]},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(Oe,Ce,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[me]},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=c((function(){this.state=8,this.tryEmit()}),t.time,this);else if(4&e.eventType)return 8;return Me},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=u(),this.manager.emit(this.options.event,this._input)))}}),v(Le,Pe,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[xe]},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&k&&(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=Te(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),v(ke,Ce,{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||_(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=c((function(){this.state=8,this.tryEmit()}),t.interval,this),2):8}return Me},failTimeout:function(){return this._timer=c((function(){this.state=Me}),this.options.interval,this),Me},reset:function(){clearTimeout(this._timer)},emit:function(){8==this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),Ne.VERSION="2.0.7",Ne.defaults={domEvents:!1,touchAction:ge,enable:!0,inputTarget:null,inputClass:null,preset:[[Le,{enable:!1}],[De,{enable:!1},["rotate"]],[Fe,{direction:6}],[Re,{direction:6},["swipe"]],[ke],[ke,{event:"doubletap",taps:2},["tap"]],[Oe]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};function Ve(e,t){var i;this.options=r({},Ne.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||(D?te:O?ue:R?he:Y))(i,U),this.touchAction=new Se(this,this.options.touchAction),Qe(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 Qe(e,t){var i,n=e.element;n.style&&(d(e.options.cssProps,(function(r,o){i=T(n.style,o),t?(e.oldCssProps[i]=n.style[i],n.style[i]=r):n.style[i]=e.oldCssProps[i]||""})),t||(e.oldCssProps={}))}return Ve.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 Ce)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=M(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(S(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(S(e),(function(e){t?i[e]&&i[e].splice(M(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&&Qe(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},r(Ne,{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:Me,DIRECTION_NONE:1,DIRECTION_LEFT:2,DIRECTION_RIGHT:4,DIRECTION_UP:8,DIRECTION_DOWN:16,DIRECTION_HORIZONTAL:6,DIRECTION_VERTICAL:k,DIRECTION_ALL:30,Manager:Ve,Input:Q,TouchAction:Se,TouchInput:ue,MouseInput:Y,PointerEventInput:te,TouchMouseInput:he,SingleTouchInput:oe,Recognizer:Ce,AttrRecognizer:Pe,Tap:ke,Pan:Re,Swipe:Fe,Pinch:De,Rotate:Le,Press:Oe,on:x,off:b,each:d,merge:A,extend:f,assign:r,inherit:v,bindFn:g,prefixed:T}),Ne}("undefined"!=typeof window?window:{},"undefined"!=typeof document?document:{});function Eo(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 So=new n.OrthographicCamera(-1,1,1,-1,0,1),Mo=new n.BufferGeometry;Mo.setAttribute("position",new n.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3)),Mo.setAttribute("uv",new n.Float32BufferAttribute([0,2,0,0,2,0],2));var Co=new n.Mesh(Mo),Io=new n.Scene;Io.add(Co);var To=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=Co.material;this.material.uniforms.inputBuffer.value=e.texture,Co.material=this.material,this.renderer.setRenderTarget(t||null),this.renderer.render(Io,So),this.renderer.setRenderTarget(i),Co.material=n},e.prototype.dispose=function(){this.material.dispose()},e}(),Bo=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=Co.material;this.material.uniforms.inputValue.value.copy(e),Co.material=this.material,this.renderer.setRenderTarget(t||null),this.renderer.render(Io,So),this.renderer.setRenderTarget(i),Co.material=n},e.prototype.dispose=function(){this.material.dispose()},e}(),Po=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 Le(t,e),t}(To),Ro=function(){function e(e){this.enable=!0,this.renderer=e,this.copyPass=new Po(this.renderer)}return e.prototype.render=function(e,t){this.copyPass.render(e,t)},e.prototype.dispose=function(){this.copyPass.dispose()},e}(),Do=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 qr({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)})),dt.shared.add((function(){return r.initAnimation.apply(r,o.initial)}),!0),r}return Le(t,e),t.parseArgs=function(e){return Fe({},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),xo(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 Ro(this.renderer)),this.copyEffect.render(e,t))},t.prototype.updateCamera=function(e,t,i){return this.userAction=i,this.cameraMotion.set(e,t).catch(He)},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(ze())[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,u=null!==(r=e.distance)&&void 0!==r?r:this.camera.pose.distance,c=null!==(o=e.offset)&&void 0!==o?o:this.camera.pose.offset,h=this.camera.position.clone(),d=io(a,this.camera.pose.longitude,2*Math.PI)||io(s,this.camera.pose.latitude),p=io(l,this.camera.pose.fov),f=io(u,this.camera.pose.distance),A=ro(c,this.camera.pose.offset);this.camera.setFromPose({longitude:a,latitude:s,fov:l,distance:u,offset:c});var v=ro(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:c,distance:u},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 Bt(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 Bt(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 Bt(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 Eo(e,this.element,this.scissor)},t.prototype.bindEvents=function(e){var t=this,i=function(e){var i=Eo(e,t.element,t.scissor);return!(Math.abs(i.x)>1||Math.abs(i.y)>1)},n=new wo.Manager(e),r=function(e){return e.session.firstInput||null};n.add(new wo.Pan({threshold:10,pointers:0})),n.add(new wo.Tap({interval:410})),n.add(new wo.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:Er(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,u=s(o?"pinch":"pinchstart",l,e);null===o?o={firstInput:u,prevInput:u}:o.prevInput=u,t.onPinchGesture(u),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()}},u=function(e){if(!Ao()){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()}},c=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:He};var r=n-t.pressState.time;t.onPressGesture({x:e.x,y:e.y,delta:r},!1),t.pressState&&(t.pressState.stop=dt.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},ze())},p=function(e){f(),h({x:e.clientX,y:e.clientY},ze())},f=function(){var e;if(t.pressState){var i=ze()-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}},g=function(e){if(e.preventDefault(),!Ao()){var n=v(e),r=(A={firstInput:n}).firstInput;r&&!i(r.center)||t.onPinchGesture(n)}},m=function(e){if(e.preventDefault(),!Ao()&&A){var n=v(e),r=A.firstInput;r&&!i(r.center)||t.onPinchGesture(n)}},y=function(e){if(e.preventDefault(),!Ao()&&A){var n=v(e),r=A.firstInput;A=null,r&&!i(r.center)||t.onPinchGesture(n)}},x=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",u,!1),e.addEventListener("mouseout",c,!1),e.addEventListener("touchstart",d,!1),e.addEventListener("touchend",f,!1),e.addEventListener("touchcancel",f,!1),e.addEventListener("mousedown",p,!1),e.addEventListener("mouseup",f,!1),e.addEventListener("gesturestart",g,{passive:!1}),e.addEventListener("gesturechange",m,{passive:!1}),e.addEventListener("gestureend",y,{passive:!1}),e.addEventListener("touchstart",x,!1),e.addEventListener("contextmenu",x,!1);return Object.assign((function(){n.destroy(),e.removeEventListener("wheel",l,!1),e.removeEventListener("mousemove",u,!1),e.removeEventListener("mouseout",c,!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",g,!1),e.removeEventListener("gesturechange",m,!1),e.removeEventListener("gestureend",y,!1),e.removeEventListener("touchstart",x,!1),e.removeEventListener("contextmenu",x,!1)}),{element:e})},t}(Ue),Oo=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 qr({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 Le(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,u,c=e.parseArgs.call(this,t);return Fe(Fe({},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,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!==(u=t.intersectMeshCreator)&&void 0!==u?u:function(){return new eo}})},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:Er(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(He)},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(Er(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),xo(i)||this.model.setMaterial(i),xo(r)||this.setCamera(r)}},t.prototype.getTargetPose=function(){var e=this.cameraMotion.getKeyFrameSegment(ze())[1],t=this.locationMotion.getKeyFrameSegment(ze())[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,u=this;if(!this.destroyed){this.pending=!1,this.userAction=o;var c={longitude:null!==(a=i.longitude)&&void 0!==a?a:this.defaultLongitude,latitude:Er(null!==(s=i.latitude)&&void 0!==s?s:this.defaultLatitude,this.minLatitude,this.maxLatitude),fov:Er(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=Bt(c,["longitude","latitude","fov"]),d={x:c.offset.x,y:c.offset.y,z:c.offset.z,distance:c.distance,modelAlpha:1,perspToOrtho:0,orthoDistance:c.distance};this.emit("initAnimationWillStart",e,c,this.userAction),this.cameraMotion.set(h,r).catch(He),this.locationMotion.set(d,r).then((function(){u.emit("initAnimationEnded",e,c,u.userAction)}),(function(t){var i=bo(u.camera.pose);u.emit("initAnimationEnded",e,i,u.userAction)})).catch(He)}},t.prototype.updateRenderSize=function(){this.locationMotion.set({distance:t.distanceFromModel(this.model,this.defaultFov,this.camera.aspect)},0).catch(He)},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=yo(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=Fe({},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=co(this.cameraMotion.value.longitude+r.longitude),s=Er(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(He);var u=n.longitude>1e-4||n.longitude<-1e-4||n.latitude>1e-4||n.latitude<-1e-4;this.emit("interiaPan",l,!u),u?dt.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 Bt(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=co(this.cameraMotion.value.longitude+s.longitude),u=Er(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&&(u=this.cameraMotion.value.latitude);var c={longitude:l,latitude:u,fov:this.camera.pose.fov,offset:this.camera.pose.offset,distance:this.camera.pose.distance};if(!this.emit("wantsPanGesture",c,e.isFinal))if(this.emit("gesture","pan",n,e.isFinal),this.emit("panGesture",c,e.isFinal),this.userAction=!0,this.interiaMovement=!1,this.hideIntersectMesh(),this.cameraMotion.set({longitude:c.longitude,latitude:c.latitude},0).catch(He),e.isFinal)if(!this.emit("wantsInteriaPan",c)){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 Bt(e,["x","y"])}));if(!this.emit("wantsGesture","pinch",r,n)){var o=Er(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(He),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 u=this.camera.position.clone().sub(s);this.intersectMesh.rotation.z=-Math.atan2(u.z,u.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=Er(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(He),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 Bt(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(!mr(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=He);var n=this.work.observers[e],r=this.work.allowHosts;return Promise.all(["right","left","up","down","front","back"].map((function(t){var o=Fe({key:"pano.".concat(e,".").concat(t),basisLoaderInitialized:ii.isInitialized()},Bt(i.imageOptions,["size","format","quality","mappings"])),a=n.images[t];return lt(i.imageOptions.transform?i.imageOptions.transform(a,o):vt(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}(Do),Lo={longitude:0,latitude:Math.PI/2},Fo={longitude:0,latitude:0},ko={longitude:Math.PI/2,latitude:0},No={longitude:Math.PI,latitude:0},Vo={longitude:1.5*Math.PI,latitude:0};var Qo=function(e){function t(i){var n=t.parseArgs(i);return e.call(this,n)||this}return Le(t,e),t.parseArgs=function(t){var i=[t.initial[0],Fe(Fe({},t.initial[1]),{longitude:0,latitude:Math.PI/2}),t.initial[2],t.initial[3]],n=Fe(Fe({},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:Oo.distanceFromModel(this.model,this.defaultFov,this.camera.aspect)},0).catch(He)},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:Er(null!==(o=t.fov)&&void 0!==o?o:this.defaultFov,this.minFov,this.maxFov),offset:this.model.bounding.getCenter(new n.Vector3),distance:Oo.distanceFromModel(this.model,this.defaultFov,this.camera.aspect)},l=Bt(s,["longitude","latitude","fov"]),u={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(He),this.locationMotion.set(u,i).then((function(){a.emit("initAnimationEnded",e,s,a.userAction)}),(function(t){var i=bo(a.camera.pose);a.emit("initAnimationEnded",e,i,a.userAction)}))}},t.prototype.getZoomOffsetFromFov=function(e,t,i){var r=this.camera.getWorldDirection(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 u=l.ray.direction,c=u.angleTo(r),h=Oo.distanceFromModel(this.model,this.defaultFov,this.camera.aspect),d=h*Math.tan(c),p=u.clone().setLength(h*Math.cos(c)).projectOnPlane(r),f=p.length(),A=s/f*p.x*d,v=s/f*p.z*d,g=s/f*p.y*d;return new n.Vector3(A,g,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 Bt(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,u=l.getCenter(new n.Vector3),c=(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===Lo.longitude&&this.cameraMotion.value.latitude===Lo.latitude?(p.left.set(1,0,0),p.up.set(0,0,-1),p.cameraDirection="y"):this.cameraMotion.value.longitude===Fo.longitude&&this.cameraMotion.value.latitude===Fo.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===Vo.longitude&&this.cameraMotion.value.latitude===Vo.latitude?(p.left.set(0,0,-1),p.up.set(0,-1,0),p.cameraDirection="x"):this.cameraMotion.value.longitude===ko.longitude&&this.cameraMotion.value.latitude===ko.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=Er(s.x,u.x-c,u.x+c),s.y=Er(s.y,u.y-h,u.y+h),s.z=Er(s.z,u.z-d,u.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(He))}}},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 Bt(e,["x","y"])}));if(!this.emit("wantsGesture","pinch",r,n)){var o=Er(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===Lo.longitude&&this.cameraMotion.value.latitude===Lo.latitude?s.y=0:this.cameraMotion.value.longitude===Fo.longitude&&this.cameraMotion.value.latitude===Fo.latitude||this.cameraMotion.value.longitude===No.longitude&&this.cameraMotion.value.latitude===No.latitude?s.z=0:(this.cameraMotion.value.longitude===Vo.longitude&&this.cameraMotion.value.latitude===Vo.latitude||this.cameraMotion.value.longitude===ko.longitude&&this.cameraMotion.value.latitude===ko.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(He),this.cameraMotion.set({longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude,fov:o},0).catch(He),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=Er(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===Lo.longitude&&this.cameraMotion.value.latitude===Lo.latitude?a.y=0:this.cameraMotion.value.longitude===Fo.longitude&&this.cameraMotion.value.latitude===Fo.latitude||this.cameraMotion.value.longitude===No.longitude&&this.cameraMotion.value.latitude===No.latitude?a.z=0:(this.cameraMotion.value.longitude===Vo.longitude&&this.cameraMotion.value.latitude===Vo.latitude||this.cameraMotion.value.longitude===ko.longitude&&this.cameraMotion.value.latitude===ko.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(He),this.cameraMotion.set({longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude,fov:r},0).catch(He),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}(Oo);function Uo(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+=Uo(e[o],!1)+",";return r>-1&&(n+=Uo(e[o],!1)),n+"]"}if(e instanceof Object){if("function"==typeof e.toJSON)return Uo(e.toJSON(),t);var a=Object.keys(e).sort(),s=a.length;for(n="",o=0;o<s;){var l=a[o],u=Uo(e[l],!0);void 0!==u&&(o&&""!==n&&(n+=","),n+=JSON.stringify(l)+":"+u),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 Ho(e){return Te(String(Uo(e,!1)))}var qo,zo=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 Le(t,e),t.parseArgs=function(t){var i,n,r,o,a,s,l,u,c,h=e.parseArgs.call(this,t);return Fe(Fe({},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!==(u=t.moveSpeed)&&void 0!==u?u:3.2,intersectMeshCreator:null!==(c=t.intersectMeshCreator)&&void 0!==c?c:function(){return new eo}})},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:Er(null!==(i=s.latitude)&&void 0!==i?i:r.defaultLatitude,r.minLatitude,r.maxLatitude),fov:Er(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 Er(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(He)},t.prototype.requestInteriaMovement=function(e,t){var i=this;if(!1!==this.interiaMovement){for(var n=Fe({},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=co(this.cameraMotion.value.longitude+r.longitude),s=Er(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(He);var u=n.longitude>1e-4||n.longitude<-1e-4||n.latitude>1e-4||n.latitude<-1e-4;this.emit("interiaPan",l,!u),u?dt.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 Bt(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=co(this.cameraMotion.value.longitude+o.longitude),s=Er(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 u={longitude:l.longitude,latitude:l.latitude,fov:l.fov};if(this.cameraMotion.set(u,0).catch(He),e.isFinal)if(!this.emit("wantsInteriaPan",l)){this.interiaMovement=!0;var c=e.velocityX,h=.6*e.velocityY;Math.abs(h)>.5&&Math.abs(c)<.5&&(c=0),this.requestInteriaMovement(this.coordinatesForOffset({x:c,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 Bt(e,["x","y"])}));if(!this.emit("wantsGesture","pinch",o,r)){var a=Er(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(He),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=Er(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(He),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 u=this.camera.position.clone().sub(s);this.intersectMesh.rotation.z=-Math.atan2(u.z,u.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}(Do);function jo(){return qo||(qo=new Promise((function(e){var t,i=document.createElement("video");i.muted=!0,i.src="data:video/mp4;base64,AAAAHGZ0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AAAIAAAABAAAAHQAAAAEAAAABAAAAHgAAAAIAAAABAAAAHwAAAAQAAAABAAAA4HN0c3oAAAAAAAAAAAAAADMAAAAaAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAACMc3RjbwAAAAAAAAAfAAAALAAAA1UAAANyAAADhgAAA6IAAAO+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 _o,Ko=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 Le(t,e),t}(To),Go=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 Le(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}(To),Wo=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 Le(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}(To),Xo=function(e){function t(t){var i=e.call(this,t)||this;return i.enableTime=ze(),i.renderer=t,i.valuePass=new Bo(i.renderer),i.luminancePass=new Ko(i.renderer,Math.sqrt(1/3)),i.nextStepPass=new Go(i.renderer,.01),i.luminanceAdaptivePass=new Wo(i.renderer),i}return Le(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=ze()),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((ze()-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}(Ro),Yo=null!==(_o=Math.SQRT1_2)&&void 0!==_o?_o:Math.sqrt(2),Zo={up:new n.Quaternion(Yo,0,0,Yo),down:new n.Quaternion(-Yo,0,0,Yo),left:new n.Quaternion(0,Yo,0,Yo),right:new n.Quaternion(0,-Yo,0,Yo),front:new n.Quaternion(0,0,0,1),back:new n.Quaternion(0,1,0,0)},Jo=new Float32Array([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),$o=new Float32Array([0,0,1,0,0,1,1,1]),ea=new Uint8Array([0,1,2,1,3,2]),ta=new n.BufferGeometry;ta.setAttribute("position",new n.BufferAttribute(Jo,3)),ta.setAttribute("uv",new n.BufferAttribute($o,2)),ta.setIndex(new n.BufferAttribute(ea,1));var ia=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 Le(t,e),t}(n.ShaderMaterial),na=function(e){function t(t,i){var r=e.call(this,ta,new ia)||this;return t.box.getCenter(r.position),r.quaternion.multiplyQuaternions((new n.Quaternion).setFromAxisAngle(new n.Vector3(0,1,0),-Math.PI),Zo[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(He),r}return Le(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),ra=function(e){function t(){var t=e.call(this)||this;return t.needsRender=!1,t.name="tiling",t}return Le(t,e),t}(n.Group),oa=function(){function e(e,t,i){this.disposed=!1,this.textureLoader=new oi(e),this.minLevel=t,this.level=0,this.panoIndex=0,this.pedding=0,this.tileTree=It(this.minLevel),this.tileMeshes=new Map,this.resource=[],this.luminance=null,this.imageOptions=i,this.object=new ra,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=It(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&&Tt(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,u=function(e){var t=c.resource.filter((function(t){return t.level===e.level}))[0];if(!t)return"continue";if(l.add(e),c.tileMeshes.has(e))return c.tileMeshes.get(e).activeTime=i,"continue";var n=t.size,o=c.imageOptions.transform,a=Math.pow(2,e.level)*e.position.y,s=Math.pow(2,e.level)*e.position.x,u="".concat(c.panoIndex,".").concat(e.face,".").concat(e.level,".").concat(a,".").concat(s),h=Fe(Fe({key:"pano_tile.".concat(u),basisLoaderInitialized:ii.isInitialized()},Bt(c.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=c.textureLoader.loadTexture(t[e.face],{imageURL:{transform:o,options:h},preInit:!0}).then((function(e){return e.body})),p=null;if(c.luminance){var f=c.luminance[e.face],A=f.match(/\/cube_(\d+)\//),v=!!A&&Number(A[1]);if(!1!==v){var g=Fe(Fe({},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(u)});p=c.textureLoader.loadTexture(f,{imageURL:{transform:c.imageOptions.transform,options:g},preInit:!0}).then((function(e){return e.body})).catch((function(){return null}))}}c.pedding++;var m=Promise.all([d,p]).then((function(e){return r.pedding--,e}),(function(e){return r.pedding--,Promise.reject(e)})),y=new na(e,m);y.name="tiling:tile-".concat(u),y.activeTime=i,y.renderOrder=e.level,c.tileMeshes.set(e,y),c.object.needsRender=!0,c.object.add(y)},c=this,h=0,d=a;h<d.length;h++){u(g=d[h])}var p=[];this.tileMeshes.forEach((function(e,t){l.has(t)||p.push(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 g=v[A],m=this.tileMeshes.get(g);m&&(m.dispose(),this.object.remove(m),this.object.needsRender=!0),this.tileMeshes.delete(g)}}},e.prototype.dispose=function(){this.cleanup(),this.resource=[],this.disposed=!0},e}(),aa=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]),sa=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]),la=new n.BufferGeometry;la.setAttribute("position",new n.BufferAttribute(aa,3)),la.setIndex(new n.BufferAttribute(sa,1));var ua=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(la,this.material),this.object.visible=!1,this.object.renderOrder=-1,this.object.frustumCulled=!1,this.object.name="pano-video",this.alphaMotion=new qr({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(He),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(He));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}(),ca=(new n.Matrix4).makeRotationAxis(new n.Vector3(0,1,0),Math.PI),ha=new n.Vector3(-1,1,1),da=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.pop=function(){var e=this.pool.pop();return e||new n.WebGLCubeRenderTarget(this.width,{stencilBuffer:!1,depthBuffer:!1})},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}(),pa=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.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 da,s.luminanceCubeRenderTargetPool=new da;var u=s.model.getMaterial()||{},c=u.pano0,h=u.pano1;c&&(null==h?void 0:h.map)!==c.map&&(s.model.setMaterial({pano0:h}),c.map.dispose(),c.map instanceof ri&&c.map.cubeRenderTarget&&s.colorCubeRenderTargetPool.push(c.map.cubeRenderTarget),c.luminanceMap&&(c.luminanceMap.dispose(),c.luminanceMap instanceof ri&&c.luminanceMap.cubeRenderTarget&&s.luminanceCubeRenderTargetPool.push(c.luminanceMap.cubeRenderTarget))),s.panoMeshes=[],s.panoMeshHitTested={},s.updatePanoMeshes(),s.locationMotion=new qr({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=rr()]={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 d={allowHosts:s.work.allowHosts,requestProxy:s.requestProxy,networkSubscribe:s.networkSubscribe};return s.textureLoader=new oi(d),s.tiling=new oa(d,s.TILED_CUBE_TEXTURE_LEVEL+1,s.imageOptions),s.scene.add(s.tiling.object),s.panoVideo=new ua,s.scene.add(s.panoVideo.object),s}return Le(t,e),t.parseArgs=function(t){var i,n,r,o,a,s=e.parseArgs.call(this,t);return Fe(Fe({},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 _r},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>80?4:n>48?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,u=Object.keys(this.panoResources);l<u.length;l++){var c=u[l],h=this.panoResources[c];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[c]}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 ri&&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,u,c,h,d,p=this;if(!this.destroyed){var f=this.currentPanoIndex,A={},v={},g=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[0]),m=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),y=!1;if(!1===this.locationMotion.ended){this.locationMotion.update(e);var x=this.locationMotion.getKeyFrameSegment(e),b=x[0],w=x[1],E=this.panoResourceFromLocationMotionKeyframe(b),S=this.panoResourceFromLocationMotionKeyframe(w),M=(new n.Vector3).copy(E.position),C=(new n.Vector3).copy(S.position),I=this.locationMotion.value.count-w.value.count+1;A.progress=I,A.modelAlpha=this.locationMotion.value.modelAlpha,this.camera.perspToOrtho.setScalar(Er(this.locationMotion.value.perspToOrtho,0,1)),this.camera.orthoDistance=this.locationMotion.value.orthoDistance,S.panoPicture&&(I<1?E.panoPicture&&(A.pano0=E.panoPicture):A.pano0=S.panoPicture,A.pano1=S.panoPicture),y=A.useBlackTransition="instant"===S.effect||"montage"===S.effect,"fade"!==S.effect&&"montage"!==S.effect||(A.pano0&&E.panoPicture&&(A.pano0={map:A.pano0.map,luminanceMap:A.pano0.luminanceMap,matrix:E.panoPicture.matrix.clone().setPosition(S.position)}),M.copy(C)),v.distance=this.locationMotion.value.distance,v.offset=new n.Vector3(M.x+(C.x-M.x)*I,M.y+(C.y-M.y)*I,M.z+(C.z-M.z)*I);for(var T=[],B=[],P=0,R=this.locationMotion.keyframes;P<R.length;P++){var D=R[P],O=D.key,L=D.progress;void 0!==O&&(T.push(O),L>=this.locationMotion.progress&&B.push(O))}for(var F=0,k=Object.keys(this.panoResources);F<k.length;F++){var N=k[F];if(!(B.indexOf(N)>=0)){var V=this.panoResources[N];if(V.panoPicture){var Q=V.panoPicture.map,U=V.panoPicture.luminanceMap;if(Q){if(Q===(null===(i=A.pano0)||void 0===i?void 0:i.map))continue;if(Q===(null===(r=A.pano1)||void 0===r?void 0:r.map))continue;Q instanceof ri&&Q.cubeRenderTarget&&this.colorCubeRenderTargetPool.push(Q.cubeRenderTarget),Q.dispose(),U&&(U instanceof ri&&U.cubeRenderTarget&&this.luminanceCubeRenderTargetPool.push(U.cubeRenderTarget),U.dispose()),V.panoPicture=null}}T.indexOf(N)>=0||delete this.panoResources[N]}}E.workCode===S.workCode?this.currentPanoIndex=I<.5?E.panoIndex:S.panoIndex:this.currentPanoIndex=S.panoIndex,this.emit("movingToPano",m.panoIndex,g.panoIndex,this.locationMotion.progress)}if(!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===xo(A)&&((null===(o=A.pano0)||void 0===o?void 0:o.map)&&A.pano0.map instanceof ri&&!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 ri&&!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 ri&&!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 ri&&!A.pano1.luminanceMap.cubeRenderTarget&&(A.pano1.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),this.model.setMaterial(A)),!1===xo(v)&&this.setCamera(v),this.currentPanoIndex!==f&&this.updatePanoMeshesVisible(),this.camera.pose.distance>.1||y){var H=this.work.observers[this.currentPanoIndex];if(H)for(var q=0,z=G=H.visibleNodes.concat(this.currentPanoIndex);q<z.length;q++){var j=z[q];(J=this.panoMeshes[j])&&J.setOpacity(0)}}else{var _=this.work.observers[this.currentPanoIndex];if(_){var K=yo(_.visibleNodes,(function(e){return _.standingPosition.distanceTo(p.work.observers[e].standingPosition)}),!0)[1];K=Er(K,2.5,1/0);for(var G=_.visibleNodes.concat(this.currentPanoIndex),W=this.getForwardPanoIndexOrNot(),X=this.camera.getWorldDirection(new n.Vector3),Y=0,Z=G;Y<Z.length;Y++){j=Z[Y];var J,$=this.work.observers[j];if(J=this.panoMeshes[j])if($.loadable||$.active){var ee=J.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);J.setCurrent(!J.loading&&0===J.progress&&W===j),J.setOpacity(ee<.01?0:Er(K/ee*1.2,.4,.85));var te=this.camera.position.clone().setY(J.position.y),ie=(new n.Vector3).copy(J.position).sub(te).normalize();if(j===this.currentPanoIndex){var ne=Er((.5-te.distanceTo(J.position))/.5,0,1);ie.multiplyScalar(1-ne).add(X.clone().multiplyScalar(ne))}ie.length()>0&&J.quaternion.setFromEuler(new n.Euler(0,Math.atan2(ie.x,ie.z),0)),J.updateTime&&J.updateTime(e,t)}else J.setOpacity(0)}}}var re=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=m.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}(),oe=function(){var e,t=p.camera.quaternion.clone();t.premultiply((null!==(e=p.work.observers[m.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))}();m.panoIndex===this.currentPanoIndex&&((null===(u=m.panoPicture)||void 0===u?void 0:u.map)instanceof ri&&(m.panoPicture.map.update(oe,re),!0===m.panoPicture.map.needsRender&&(m.panoPicture.map.needsRender=!1,this.needsRender=!0)),(null===(c=m.panoPicture)||void 0===c?void 0:c.luminanceMap)instanceof ri&&(m.panoPicture.luminanceMap.update(oe,re),!0===m.panoPicture.luminanceMap.needsRender&&(m.panoPicture.luminanceMap.needsRender=!1,this.needsRender=!0)));var ae=this.tiling.object.visible;if(this.initAnimationed){var se=m.panoIndex,le=this.work.observers[se];le&&no(this.camera.position,le.position)&&this.locationMotion.ended?(this.tiling.object.visible=!0,this.tiling.panoIndex!==se&&this.tiling.cleanup(),this.tiling.panoIndex=se,this.tiling.setResource(null!==(d=null===(h=le.images)||void 0===h?void 0:h.tiles)&&void 0!==d?d:[],this.enableIOSEDR&&le.images.luminance?le.images.luminance:null),this.tiling.setRotation(le.quaternion),this.tiling.setPosition(le.position),re>this.TILED_CUBE_TEXTURE_LEVEL?this.tiling.update(oe,re,e):this.tiling.update(oe,0,e)):this.tiling.object.visible=!1}else this.tiling.object.visible=!1;ae!==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 Xo(this.renderer),this.luminanceAdaptiveEffect.enable=this.luminanceAdaptiveEffectEnable),this.luminanceAdaptiveEffect.render(e,t)},t.prototype.getTargetPose=function(){var e=this.cameraMotion.getKeyFrameSegment(ze())[1],t=this.locationMotion.getKeyFrameSegment(ze())[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,u=this.work.observers[e],c=this.imageOptions.size;if(void 0===c&&u){var h=u.images.up.match(/\/cube_(\d+)\//);h&&(c=Number(h[1]))}void 0===c&&(c=2048);var d=this.imageOptions.transform,p=Fe({key:"pano.".concat(e),basisLoaderInitialized:ii.isInitialized()},Bt(this.imageOptions,["format","size","quality","sharpen","mappings"])),f=u.images,A=null!==(o=null===(r=u.images.tiles)||void 0===r?void 0:r.filter((function(e){return e.size>c})))&&void 0!==o?o:null,v=d,g={key:"pano_luminance.".concat(e),basisLoaderInitialized:ii.isInitialized(),size:p.size?p.size/2:1024},m=this.enableIOSEDR&&u.images.luminance?u.images.luminance:null,y=function(){if(!u.images.tiles)return null;if(!m)return null;var e=m.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:m.back,front:m.front,left:m.left,right:m.right,up:m.up,down:m.down}}))}(),x="pano:"+Ho([f,p,d]);if(this.pendingTextureTask){if(this.pendingTextureTask.hash===x)return;var b=this.pendingTextureTask.panoIndex;null===(a=this.panoMeshes[b])||void 0===a||a.setProgress(0),this.emit("textureAbort",b,u),this.pendingTextureTask.onError(new Error("texture aborted"))}this.pending=!0;var w,E=this.model.getMaterial()||{},S=E.pano0,M=E.pano1;if(S&&S.map.name===x&&null!==S.luminanceMap===this.enableIOSEDR?w=S:(null==M?void 0:M.map.name)===x&&null!==M.luminanceMap===this.enableIOSEDR&&(w=M),w){var C={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(u.position,u.quaternion,ha)},position:u.position.clone()};dt.shared.add((function(){l.pending=!1,l.emit("panoLoaded",e),l.doMoveToPano(e,C,t,i)}),!0,1)}else{this.pendingTextureTask={panoIndex:e,hash:x,onLoad:function(r,o){var a,s;if(l.pending=!1,l.destroyed)r.body.dispose();else{r.body.name=x,l.emit("panoLoaded",e);var c={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(u.position,u.quaternion,ha)},position:u.position.clone()};l.doMoveToPano(e,c,t,i)}},onError:function(i){l.pending=!1,t.moveCancelCallback&&t.moveCancelCallback(),l.emit("panoLoadError",i,e),l.emit("moveToPanoCanceled",e)}};var I=this.panoMeshes[e];I&&I.tap&&I.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,u),(null===(i=l.pendingTextureTask)||void 0===i?void 0:i.hash)===x&&(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,preInit:!0},void 0,void 0,(function(t){var i,n;l.emit("textureLoading",t,e,u),(null===(i=l.pendingTextureTask)||void 0===i?void 0:i.hash)===x&&(null===(n=l.panoMeshes[e])||void 0===n||n.setProgress(t))}),this.renderer),m?this.tileLevelForFov&&y&&y.length?this.textureLoader.loadTiledCubeTexture(m,y,{tileImageSize:256,tileMaxLevel:this.TILED_CUBE_TEXTURE_LEVEL,imageURL:{transform:v,options:g}},void 0,void 0,void 0,this.renderer).catch((function(){return null})):this.textureLoader.loadCubeTexture(m,{imageURL:{transform:v,options:g},preInit:!0},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)===x?(l.pendingTextureTask.onLoad(r,o),null===(n=l.panoMeshes[e])||void 0===n||n.setProgress(0),delete l.pendingTextureTask,l.emit("textureLoaded",e,u,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)===x&&(l.pendingTextureTask.onError(t),null===(n=l.panoMeshes[e])||void 0===n||n.setProgress(0),delete l.pendingTextureTask,l.emit("textureError",t,e,u),l.emit("error",t))})),this.emit("textureStartLoad",e,u)}},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:Er(null!==(o=t.latitude)&&void 0!==o?o:this.defaultLatitude,this.minLatitude,this.maxLatitude),fov:Er(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],u=this.panoMeshes[l.panoIndex];u&&(r.indexOf(l.panoIndex)>=0?u.parent!==this.helper&&(this.helper.add(u),!0!==this.panoMeshHitTested["".concat(this.work.workCode,"_").concat(l.panoIndex)]&&o.push(l)):u.parent===this.helper&&(this.helper.remove(u),u.setOpacity(0)))}e&&(o=r.map((function(e){return t.work.observers[e]})));for(var c=0,h=o;c<h.length;c++){var d=h[c];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=yo(e.accessibleNodes,(function(i){return Er(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,u=this.work.observers;l<u.length;l++){s(p=u[l])}var c=Object.keys(a).map((function(e){return a[e]}));c.length&&(o=Er(.6*(c.reduce((function(e,t){return e+t}),0)/c.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 g=v[A];this.helper.remove(i[g]),i[g].dispose(),delete i[g]}this.updatePanoMeshesVisible(e)},t.prototype.doMoveToPano=function(e,t,i,r){var o,a,s,l,u=this;void 0===i&&(i={}),this.userAction=r;var c=ze(),h=rr();this.tiling.cleanup(),this.panoResources[h]=t;var d,p,f;if(this.locationMotion.ended){var A=this.locationMotion.getKeyFrameSegment(c);A[0];var v=A[1],g=this.locationMotion.value,m=(null!==(o=this.panoResourceFromLocationMotionKeyframe(v))&&void 0!==o?o:this.camera).position,y=t.position;d=Math.max(m.distanceTo(y),1),p=[{key:v.key,progress:0,value:Fe(Fe({},g),{count:0})},{key:h,progress:1,value:{distance:0,perspToOrtho:0,orthoDistance:1,modelAlpha:0,count:1}}],f=0}else{var x=this.locationMotion.getKeyFrameSegment(c),b=x[0],w=(v=x[1],g=this.locationMotion.value,this.panoResourceFromLocationMotionKeyframe(b).position),E=(m=this.panoResourceFromLocationMotionKeyframe(v).position,y=t.position,v.value.count-g.count),S=Math.max(w.distanceTo(m),1)*E;d=S+Math.max(m.distanceTo(y),1),p=[{key:b.key,progress:0,value:Fe({},g)},{key:v.key,progress:S/d,value:v.value},{key:h,progress:1,value:{count:v.value.count+1,distance:0,perspToOrtho:0,orthoDistance:1,modelAlpha:0}}];var M=this.locationMotionKeyframesLength(this.locationMotion.keyframes),C=this.locationMotionKeyframesLength(p);f=0===M||0===M?0:this.locationMotion.getProgressVelocity(c)*M/C}var I=this.calculateMovingDuration(i.duration,"fade"===i.effect||"montage"===i.effect?0:d),T={longitude:i.longitude,latitude:i.latitude,fov:i.fov},B={longitude:null!==(a=T.longitude)&&void 0!==a?a:this.camera.pose.longitude,latitude:null!==(s=T.latitude)&&void 0!==s?s:this.camera.pose.latitude,fov:null!==(l=T.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,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=He,this.videoTexture.needsUpdate=!0),this.panoVideo.setMaterial(null),this.cameraMotion.set(T,I).catch(He),this.locationMotion.setKeyframes(p,I,f).then((function(){var t,o,a,s={longitude:u.camera.pose.longitude,latitude:u.camera.pose.latitude,fov:u.camera.pose.fov,offset:u.camera.pose.offset.clone(),distance:u.camera.pose.distance};i.moveEndCallback&&i.moveEndCallback(e,s),u.emit("panoArrived",e,s,r);var l=u.work.observers[u.currentPanoIndex];if(l&&l.video&&u.videoTexture&&u.videoTexture.image instanceof HTMLVideoElement){var c=ca.clone().multiply(null!==(a=null===(o=null===(t=u.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:u.videoTexture,size:l.video.size,matrix:c,alpha:1},d=rr(),p=u.videoTexture.image;p.setAttribute("uuid",d),jo().then((function(e){e&&l.video&&p.getAttribute("uuid")===d&&(p.oncanplay=function(){p.oncanplay=He,p.play()},p.ontimeupdate=function(){p.currentTime>.5&&(p.ontimeupdate=He,u.panoVideo.setMaterial(h))},p.src=l.video.source)})).catch((function(){p.removeAttribute("uuid")}))}}),(function(){i.moveCancelCallback&&i.moveCancelCallback(),u.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.getWorldDirection(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 u=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)))})),c=u.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=c;f<A.length;f++){var v=A[f],g=this.work.observers[v].standingPosition.clone().sub(o);if(0!==g.length()&&l.angleTo(g)<p)return v}return null},t.prototype.onTapGesture=function(e){var t=this,i=e.pointers.map((function(e){return Bt(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.getWorldDirection(new n.Vector3).setY(0),s=null,l=this.work.observers[this.currentPanoIndex];if(l){var u=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)})),c=this.model.intersectRaycaster(o)[0];if(c){var h=yo(u,(function(e){return t.work.observers[e].standingPosition.clone().distanceTo(c.point)}),!0),d=h[0];h[1]<this.panoTapTriggerRadius&&(s=d)}mr(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),mr(s))!0===this.locationMotion.ended&&this.cameraBounce();else{var g=this.work.observers[s];if(g.active){for(var m={},y=Math.PI/6,x=Math.PI/12,b=g.position.clone().setY(0).sub(l.position.clone().setY(0)).normalize(),w=[],E=0,S=g.accessibleNodes;E<S.length;E++){if((d=S[E])!==this.currentPanoIndex&&d!==s){var M=this.work.observers[d].position.clone().sub(g.position).setY(0);b.angleTo(M)<y&&w.push(M)}}var C=(w.length>0?w:ke(ke([],[],!0),[],!0)).slice().sort((function(e,t){return e.angleTo(b)-t.angleTo(b)}))[0];C&&C.angleTo(a)>x&&(m.longitude=Math.atan2(-C.x,-C.z)),this.cameraMotion.value.latitude<-Math.PI/4&&(m.latitude=Er(0,this.minLatitude,this.maxLatitude)),this.cameraMotion.value.fov<60&&(m.fov=this.defaultFov),this.emit("wantsMoveToPano",s,m,!0)}else this.panoMeshes[s]&&(this.panoMeshes[s].setDisabled(!1),this.panoMeshes[s].setLoading(!0))}}}}},t}(zo),fa=Math.PI/180,Aa=180/Math.PI,va=function(){var e="undefined"!=typeof navigator&&/iPad|iPhone|iPod/.test(navigator.platform);return function(){return e}}(),ga=function(){var e="undefined"!=typeof navigator&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent);return function(){return e}}(),ma=function(){var e="undefined"!=typeof navigator&&-1!==navigator.userAgent.indexOf("Firefox")&&-1!==navigator.userAgent.indexOf("Android");return function(){return e}}(),ya=function(){var e="undefined"!=typeof navigator?navigator.userAgent.match(/.*Chrome\/([0-9]+)/):null,t=e?parseInt(e[1],10):null;return function(){return t}}(),xa=function(){var e=!1;if(65===ya()){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}}(),ba=function(){var e=va()&&ga()&&"undefined"!=typeof navigator&&-1!==navigator.userAgent.indexOf("13_4");return function(){return e}}(),wa=function(){var e="undefined"!=typeof navigator&&-1!==navigator.userAgent.indexOf("R7 Build");return function(){return e}}();function Ea(){var e="undefined"!=typeof window&&(90==window.orientation||-90==window.orientation);return wa()?!e:e}var Sa,Ma=(Sa={},function(e,t){void 0===Sa[e]&&(console.warn("cardboard: "+t),Sa[e]=!0)});function Ca(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 Ia,Ta=function(e,t,i){var n,r,o,a,s,l,u,c,h,d,p,f,A,v,g,m,y,x,b,w,E,S,M,C,I,T,B,P,R,D,O;!function(e,t,i){var n=t?t[0]:0,r=t?t[1]:0,o=t?t[2]:0,a=t?t[3]:1,s=n+n,l=r+r,u=o+o,c=n*s,h=n*l,d=n*u,p=r*l,f=r*u,A=o*u,v=a*s,g=a*l,m=a*u;e[0]=1-(p+A),e[1]=h+m,e[2]=d-g,e[3]=0,e[4]=h-m,e[5]=1-(c+A),e[6]=f+v,e[7]=0,e[8]=d+g,e[9]=f-v,e[10]=1-(c+p),e[11]=0,e[12]=i?i[0]:0,e[13]=i?i[1]:0,e[14]=i?i[2]:0,e[15]=1}(e,t),i&&function(e,t,i){var n,r,o,a,s,l,u,c,h,d,p,f,A=i[0],v=i[1],g=i[2];t===e?(e[12]=t[0]*A+t[4]*v+t[8]*g+t[12],e[13]=t[1]*A+t[5]*v+t[9]*g+t[13],e[14]=t[2]*A+t[6]*v+t[10]*g+t[14],e[15]=t[3]*A+t[7]*v+t[11]*g+t[15]):(n=t[0],r=t[1],o=t[2],a=t[3],s=t[4],l=t[5],u=t[6],c=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]=u,e[7]=c,e[8]=h,e[9]=d,e[10]=p,e[11]=f,e[12]=n*A+s*v+h*g+t[12],e[13]=r*A+l*v+d*g+t[13],e[14]=o*A+u*v+p*g+t[14],e[15]=a*A+c*v+f*g+t[15])}(e,e,i),n=e,o=(r=e)[0],a=r[1],s=r[2],l=r[3],u=r[4],c=r[5],h=r[6],d=r[7],p=r[8],f=r[9],A=r[10],v=r[11],g=r[12],m=r[13],y=r[14],x=r[15],(O=(b=o*c-a*u)*(D=A*x-v*y)-(w=o*h-s*u)*(R=f*x-v*m)+(E=o*d-l*u)*(P=f*y-A*m)+(S=a*h-s*c)*(B=p*x-v*g)-(M=a*d-l*c)*(T=p*y-A*g)+(C=s*d-l*h)*(I=p*m-f*g))&&(O=1/O,n[0]=(c*D-h*R+d*P)*O,n[1]=(s*R-a*D-l*P)*O,n[2]=(m*C-y*M+x*S)*O,n[3]=(A*M-f*C-v*S)*O,n[4]=(h*B-u*D-d*T)*O,n[5]=(o*D-s*B+l*T)*O,n[6]=(y*E-g*C-x*w)*O,n[7]=(p*C-A*E+v*w)*O,n[8]=(u*R-c*B+d*I)*O,n[9]=(a*B-o*R-l*I)*O,n[10]=(g*M-m*E+x*b)*O,n[11]=(f*E-p*M-v*b)*O,n[12]=(c*T-u*P-h*I)*O,n[13]=(o*P-a*T+s*I)*O,n[14]=(m*w-g*S-y*b)*O,n[15]=(p*S-f*w+A*b)*O)},Ba=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}(),Pa=function(){function e(e,t){this.kFilter=e,this.isDebug=t,this.currentAccelMeasurement=new Ba,this.currentGyroMeasurement=new Ba,this.previousGyroMeasurement=new Ba,va()?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)",Aa*((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}(),Ra=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*fa)return this.isDebug&&console.log("Moving slowly, at %s deg/s: no prediction",(Aa*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}(),Da=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}(),Oa=function(){this.angularAcceleration=null,this.angularVelocity=null,this.linearAcceleration=null,this.linearVelocity=null,this.orientation=null,this.position=null},La=function(){this.leftDegrees=0,this.rightDegrees=0,this.upDegrees=0,this.downDegrees=0},Fa=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 Pa(e,r),this.posePredictor=new Ra(t,r),this.isFirefoxAndroid=ma(),this.isIOS=va();var o=ya();this.isDeviceMotionInRadians=!this.isIOS&&null!==o&&o<66,this.isWithoutDeviceMotion=xa()||ba(),this.filterToWorldQ=new n.Quaternion,va()?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_(),Ea()&&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||function(){var e=(new n.Quaternion).setFromAxisAngle(new n.Vector3(0,0,-1),0),t=new n.Quaternion;return"undefined"!=typeof window&&-90===window.orientation?t.setFromAxisAngle(new n.Vector3(0,1,0),Math.PI/-2):t.setFromAxisAngle(new n.Vector3(0,1,0),Math.PI/2),e.multiply(t)}(),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=this.filter.getOrientation();e=this.posePredictor.getPrediction(r,this.gyroscope,this.previousTimestampS);var o=new n.Quaternion;return o.copy(this.filterToWorldQ),o.multiply(this.resetQ),o.multiply(e),o.multiply(this.worldToScreenQ),this.yawOnly&&(o.x=0,o.z=0,o.normalize()),this.orientationOut_[0]=o.x,this.orientationOut_[1]=o.y,this.orientationOut_[2]=o.z,this.orientationOut_[3]=o.w,this.orientationOut_},e.prototype.getPose=function(){var e=new Oa;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(),Ea()&&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),Ta(e.leftViewMatrix,t,i.left),Ta(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 va()&&function(){if("undefined"==typeof window)return!1;if("undefined"==typeof document)return!1;var e=window.self!==window.top,t=Ca(document.referrer),i=Ca(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*fa,o=e.left.downDegrees*fa,a=2/((l=e.left.leftDegrees*fa)+(u=e.left.rightDegrees*fa)),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-u)*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,u;r=e.right.upDegrees*fa,o=e.right.downDegrees*fa,a=2/((l=e.right.leftDegrees*fa)+(u=e.right.rightDegrees*fa)),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-u)*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 Da(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=Aa*Math.atan(i.distort(r/n)),u=Aa*Math.atan(i.distort(o/n)),c=Aa*Math.atan(i.distort(a/n)),h=Aa*Math.atan(i.distort(s/n)),d=new La,p=new La;return d.leftDegrees=Math.min(l,e.fov),d.rightDegrees=Math.min(u,e.fov),d.downDegrees=Math.min(c,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?(Ma("fusion-pose-sensor:invalid:non-monotonic","Invalid timestamps detected: non-monotonic timestamp from devicemotion"),void(this.previousTimestampS=n)):r<=.001||r>1?(Ma("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&&(wa()?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}(),ka=[0,0,.5,1],Na=[.5,0,.5,1],Va=function(){function e(e){var t=this;this.renderer=e,this.sensor=new Fa(.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*ka[0]),y:Math.round(i.height*ka[1]),width:Math.round(i.width*ka[2]),height:Math.round(i.height*ka[3])},a={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])};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}(),Qa={zh:{TITLE:"眼镜模式",HIT:"请将手机横屏放入 VR 眼镜中"},en:{TITLE:"GLASSES MODE",HIT:"Please put the mobile phone horizontally into the VR glasses."},ja:{TITLE:"メガネモード",HIT:"携帯電話をVRメガネに水平に入れてください。"}},Ua="undefined"!=typeof navigator&&null!==(Ia=Qa[navigator.language.split("-")[0]])&&void 0!==Ia?Ia:Qa.zh,Ha="\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+urq4wMDCxsbG2tra5ubliYmIuLi6zs7NHR0empqY0NDRCQkKqqqo5OTmoqKg7OztfX19dXV1oaGikpKRkZGStra0hISE/Pz89PT0pKSlmZmZJSUlERERbW1s2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gVdZPcTsE5RCJqs+/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+Hh4eTk5Ojo6NwcHCenp6mpqZ6enqlpaWWlpaJiYmlpaVjY2OcnJyKiop9fX1/f3+CgoKlpaV4eHiUlJSIiIixsbGqqqqGhoZxcXGPj4+ysrK1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odgiWcVMVLVeSS1ATCZoc88qjVKlSc3kSLJ5c5V6rTZQAcVkGbBeuOkgCgq2CBM3MoFwGr1tvim2aMpZZqyBBc3N1UF2GX90j9SQJKCBB83OfYAcNVjFcSrvzo95WOShB83Ody5V24fqzO0nAUSzB/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(Ua.TITLE,'</div>\n <div class="$id-modal-content-hit">').concat(Ua.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 qa(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 Ha.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 za=new n.CircleBufferGeometry(.12,16),ja=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 qr({ringScale:1.1,ringOpacity:0,circleFade:0,circleOpacity:.85,circleScale:1}),t.opacityMotion=new qr({opacity:0}),t.loadingMotion=new qr({opacity:0}),t.disableMotion=new qr({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(za,new n.MeshBasicMaterial(Fe(Fe({},i),{color:0,opacity:0}))),t.hitTestMesh.scale.set(1.5,1.5,1.5),t.ringMesh=new n.Mesh(za,new n.ShaderMaterial(Fe(Fe({},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(za,new n.ShaderMaterial(Fe(Fe({},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 Le(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=Er(e,0,1),this.opacityMotion.set({opacity:e},30).catch(He))},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(He)}else{t=[{progress:0,value:Fe({},this.currentMotion.value)},{progress:1,value:{ringScale:1.1,ringOpacity:0,circleFade:0,circleOpacity:.85,circleScale:1}}];this.currentMotion.setKeyframes(t,200).catch(He)}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(He):this.loadingMotion.set({opacity:0},0).catch(He),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(He),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),_a=function(e){function t(i){var n=this,r=t.parseArgs(i);(n=e.call(this,r)||this).cardboard=new Va(n.renderer);var o,a,s,l=(o="five_vr_helper_"+rr(),a=qa(o),(s=document.createElement("div")).className=o,s.innerHTML=a,s);n.helperElement=l;var u=new wo(l);return n.element.parentNode&&(n.element.parentNode.insertBefore(l,n.element),n.setHelperElementSize(),u.on("tap",(function(){return n.emit("vrWantsToExit")}))),n.destroyHelper=function(){u.destroy(),l.parentNode&&l.parentNode.removeChild(l),delete n.helperElement},n}return Le(t,e),t.parseArgs=function(t){var i=Fe(Fe({},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 ja;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 u=this.currentPanoIndex;this.needsRender=!0;var c={},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),g=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[0]),m=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),y=A.position,x=v.position,b=this.locationMotion.value.count-f.value.count+1;c.modelAlpha=this.locationMotion.value.modelAlpha,this.camera.perspToOrtho.setScalar(Er(this.locationMotion.value.perspToOrtho,0,1)),this.camera.orthoDistance=this.locationMotion.value.orthoDistance,c.useBlackTransition="instant"===v.effect,v.panoPicture&&(b<1?A.panoPicture&&(c.pano0=A.panoPicture):c.pano0=v.panoPicture,c.pano1=v.panoPicture),"fade"===v.effect&&(c.pano0&&A.panoPicture&&(c.pano0={map:c.pano0.map,luminanceMap:c.pano0.luminanceMap,matrix:A.panoPicture.matrix.clone().setPosition(v.position)}),y.copy(x)),c.progress=b,h.distance=this.locationMotion.value.distance,h.offset=new n.Vector3(y.x+(x.x-y.x)*b,y.y+(x.y-y.y)*b,y.z+(x.z-y.z)*b);for(var w=[],E=[],S=0,M=this.locationMotion.keyframes;S<M.length;S++){var C=M[S],I=C.key,T=C.progress;void 0!==I&&(w.push(I),T>=this.locationMotion.progress&&E.push(I))}for(var B=0,P=Object.keys(this.panoResources);B<P.length;B++){var R=P[B];if(!(E.indexOf(R)>=0)){var D=this.panoResources[R];if(D.panoPicture){var O=D.panoPicture.map;if(O){if(O===(null===(i=c.pano0)||void 0===i?void 0:i.map))continue;if(O===(null===(r=c.pano1)||void 0===r?void 0:r.map))continue;O.dispose(),D.panoPicture=null}}w.indexOf(R)>=0||delete this.panoResources[R]}}this.currentPanoIndex=b<.5?A.panoIndex:v.panoIndex,this.emit("movingToPano",m.panoIndex,g.panoIndex,this.locationMotion.progress)}!1===xo(c)&&((null===(o=c.pano0)||void 0===o?void 0:o.map)&&c.pano0.map instanceof ri&&!c.pano0.map.cubeRenderTarget&&(c.pano0.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),(null===(a=c.pano0)||void 0===a?void 0:a.luminanceMap)&&c.pano0.luminanceMap instanceof ri&&!c.pano0.luminanceMap.cubeRenderTarget&&(c.pano0.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),(null===(s=c.pano1)||void 0===s?void 0:s.map)&&c.pano1.map instanceof ri&&!c.pano1.map.cubeRenderTarget&&(c.pano1.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),(null===(l=c.pano1)||void 0===l?void 0:l.luminanceMap)&&c.pano1.luminanceMap instanceof ri&&!c.pano1.luminanceMap.cubeRenderTarget&&(c.pano1.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),this.model.setMaterial(c)),h.offset&&this.camera.position.copy(h.offset),this.currentPanoIndex!==u&&this.updatePanoMeshesVisible();var L=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 k=0,N=this.work.observers[this.currentPanoIndex].visibleNodes.concat(this.currentPanoIndex);k<N.length;k++){var V=N[k],Q=this.work.observers[V],U=this.panoMeshes[V];if(Q.loadable||Q.active){var H=U.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);H<.05?U.setOpacity(0):U.setOpacity(Er(1.5/H,0,1)),this.currentPanoIndex===V&&U.setOpacity(0),U.lookAt(this.camera.position)}else U.setOpacity(0)}var q=this.intersect(e);for(V=0;V<this.work.observers.length;V++){null==(U=this.panoMeshes[V])||U.setCurrent(U===q)}for(V=0;V<this.work.observers.length;V++){(U=this.panoMeshes[V])&&U.updateTime&&U.updateTime(e,t)}L===this.camera.pose.longitude&&F===this.camera.pose.latitude||(this.cameraMotion.set(Bt(this.camera.pose,["longitude","latitude"]),0).catch(He),this.emit("cameraDirectionUpdate",Bt(this.camera.pose,["longitude","latitude"]),!0),this.emit("cameraUpdate",bo(Bt(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(u=this.panoMeshes.indexOf(i))>=0&&this.moveToPano(u,{},!0),delete this.activePanoMesh,delete this.activeTime,i}for(var r=this.camera.getWorldDirection(new n.Vector3),o=new n.Raycaster(this.camera.position,r),a=void 0,s=[],l=this.work.observers[this.currentPanoIndex].visibleNodes,u=0;u<this.work.observers.length;u++){var c=this.panoMeshes[u];if(-1!==l.indexOf(u)){var h=o.intersectObject(null!==(t=c.hitTestMesh)&&void 0!==t?t:c,!0)[0];h&&s.push({panoMesh:c,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}(pa),Ka=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 qr({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 Le(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&&e.prototype.isReady.call(this)},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(Er(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=yo(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),xo(i)||this.model.setMaterial(i),xo(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:Er(null!==(o=t.latitude)&&void 0!==o?o:this.defaultLatitude,this.minLatitude,this.maxLatitude),fov:Er(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(ze())[1],t=this.locationMotion.getKeyFrameSegment(ze())[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=ze(),u=new n.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z).distanceTo(e),c=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,g=this.locationMotion.keyframes[d].value,m=g.x,y=g.y,x=g.z;h+=Math.sqrt(Math.pow(m-f,2)+Math.pow(y-A,2)+Math.pow(x-v,2))}var b=0===u?0:c*h/u,w=this.calculateMovingDuration(t.duration,u),E={x:e.x,y:e.y,z:e.z,distance:0,modelAlpha:1,perspToOrtho:0,orthoDistance:1},S={longitude:t.longitude,latitude:t.latitude,fov:t.fov},M={longitude:null!==(r=S.longitude)&&void 0!==r?r:this.camera.pose.longitude,latitude:null!==(o=S.latitude)&&void 0!==o?o:this.camera.pose.latitude,fov:null!==(a=S.fov)&&void 0!==a?a:this.camera.pose.fov,offset:e.clone(),distance:0},C=yo(this.work.observers,(function(t){return t.position.distanceTo(e)})),I=this.work.observers.indexOf(C);this.emit("moveToPano",I,this.userAction),t.moveStartCallback&&t.moveStartCallback(I,M),this.emit("panoWillArrive",I,M,this.userAction),this.cameraMotion.set(S,w).catch(He),this.locationMotion.set(E,w,b).then((function(){var e=bo(s.camera.pose);t.moveEndCallback&&t.moveEndCallback(I,e),s.emit("panoArrived",I,e,s.userAction)}),(function(){t.moveCancelCallback&&t.moveCancelCallback(),s.emit("moveToPanoCanceled",I)}))},t.prototype.onTapGesture=function(e){var t=e.pointers.map((function(e){return Bt(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),u=s.clone().sub(l).setLength(.3),c=s.clone().sub(u);r.set(c,new n.Vector3(0,-1,0)),o=this.model.intersectRaycaster(r)[0]}}if(o){var h=o.point.clone(),d=yo(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}(zo),Ga=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"),Wa=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"),Xa=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),Ya=new n.SphereBufferGeometry(.01,128,128);var Za=function(){function e(e){void 0===e&&(e={}),this.textureLoader=new oi({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,u){var c=[0,0],h=function(e,t){c[t]=e,l(.8*c[0]+.2*c[1])},d=[this.textureLoader.loadTexture(e,{imageURL:i,viaAjax:!0},void 0,void 0,(function(e){return h(e,1)}),u),this.textureLoader.loadCubeTexture(t,{imageURL:i,viaAjax:!0},void 0,void 0,(function(e){return h(e,0)}),u)];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:Ga,fragmentShader:Wa,transparent:!0,uniforms:n.UniformsUtils.clone(Xa)}),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(Ya,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:ke([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(He)}return s(e),Promise.reject(e)}))},e}(),Ja=new n.Vector3(-1,1,1),$a=function(e){function t(i){var r,o,a,s,l,u=this,c=t.parseArgs(i);return(u=e.call(this,c)||this).currentPanoIndex=c.initial[0],u.maxAccessibleDistance=c.maxAccessibleDistance,u.panoTapTriggerRadius=c.panoTapTriggerRadius,u.panoCircleMeshCreator=c.panoCircleMeshCreator,u.panoModelGroup=new n.Group,u.panoModelGroup.name="panoModels",u.scene.add(u.panoModelGroup),u.panoMeshes=[],u.updatePanoMeshes(),u.helper.remove(u.intersectMesh),u.locationMotion=new qr({count:0,distance:u.camera.pose.distance,modelAlpha:null!==(o=null===(r=u.model.getMaterial())||void 0===r?void 0:r.modelAlpha)&&void 0!==o?o:0,perspToOrtho:u.camera.perspToOrtho.x,orthoDistance:u.camera.orthoDistance}),u.panoResources={},u.panoResources[u.locationMotion.keyframes[0].key=u.locationMotion.keyframes[1].key=rr()]={panoIndex:u.currentPanoIndex,workCode:u.work.workCode,matrix:null!==(l=null===(s=null===(a=u.model.getMaterial())||void 0===a?void 0:a.pano1)||void 0===s?void 0:s.matrix)&&void 0!==l?l:new n.Matrix4,position:u.camera.pose.offset.clone(),effect:"fly"},u.depthTextureLoader=new Za({allowHosts:u.work.allowHosts,requestProxy:u.requestProxy,networkSubscribe:u.networkSubscribe}),u}return Le(t,e),t.parseArgs=function(t){var i,n,r,o=e.parseArgs.call(this,t);return Fe(Fe({},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 _r}})},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,u=0,c=Object.keys(this.panoResources);u<c.length;u++){var h=c[u],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={},u=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[0]),c=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),g=(new n.Vector3).copy(A.position),m=(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(Er(this.locationMotion.value.perspToOrtho,0,1)),this.camera.orthoDistance=this.locationMotion.value.orthoDistance;for(var x=0,b=this.panoModelGroup.children;x<b.length;x++){var w=b[x];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)}),g.copy(m)),l.distance=this.locationMotion.value.distance,l.offset=new n.Vector3(g.x+(m.x-g.x)*y,g.y+(m.y-g.y)*y,g.z+(m.z-g.z)*y);for(var E=[],S=[],M=0,C=this.locationMotion.keyframes;M<C.length;M++){var I=C[M],T=I.key,B=I.progress;void 0!==T&&(E.push(T),B>=this.locationMotion.progress&&S.push(T))}for(var P=0,R=Object.keys(this.panoResources);P<R.length;P++){var D=R[P];if(!(S.indexOf(D)>=0)){var O=this.panoResources[D];if(O.panoModel){if(O.panoModel.material.uniforms.panoMap.value===(null===(i=s.pano0)||void 0===i?void 0:i.map))continue;if(O.panoModel.material.uniforms.panoMap.value===(null===(r=s.pano1)||void 0===r?void 0:r.map))continue;this.panoModelGroup.remove(O.panoModel),O.panoModel.material.uniforms.panoMap.value.dispose(),O.panoModel.dispose(),delete O.panoModel}E.indexOf(D)>=0||delete this.panoResources[D]}}A.workCode===v.workCode?this.currentPanoIndex=y<.5?A.panoIndex:v.panoIndex:this.currentPanoIndex=v.panoIndex,this.emit("movingToPano",c.panoIndex,u.panoIndex,this.locationMotion.progress)}if(!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===xo(s)&&this.model.setMaterial(s),!1===xo(l)&&this.setCamera(l),this.currentPanoIndex!==a&&this.updatePanoMeshesVisible(),this.camera.pose.distance>.1||h){var L=this.work.observers[this.currentPanoIndex];if(L)for(var F=0,k=U=L.visibleNodes.concat(this.currentPanoIndex);F<k.length;F++){var N=k[F];(_=this.panoMeshes[N])&&_.setOpacity(0)}}else{var V=this.work.observers[this.currentPanoIndex];if(V){var Q=yo(V.visibleNodes,(function(e){return V.standingPosition.distanceTo(o.work.observers[e].standingPosition)}),!0)[1];Q=Er(Q,2.5,1/0);for(var U=V.visibleNodes.concat(this.currentPanoIndex),H=this.getForwardPanoIndexOrNot(),q=this.camera.getWorldDirection(new n.Vector3),z=0,j=U;z<j.length;z++){N=j[z];var _,K=this.work.observers[N];if(_=this.panoMeshes[N])if(K.loadable||K.active){var G=_.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);_.setCurrent(!_.loading&&0===_.progress&&H===N),_.setOpacity(G<.01?0:Er(Q/G*1.2,.65,.98));var W=this.camera.position.clone().setY(_.position.y),X=(new n.Vector3).copy(_.position).sub(W).normalize();if(N===this.currentPanoIndex){var Y=Er((.5-W.distanceTo(_.position))/.5,0,1);X.multiplyScalar(1-Y).add(q.clone().multiplyScalar(Y))}X.length()>0&&_.quaternion.setFromEuler(new n.Euler(0,Math.atan2(X.x,X.z),0)),_.updateTime&&_.updateTime(e,t)}else _.setOpacity(0)}}}}},t.prototype.getTargetPose=function(){var e=this.cameraMotion.getKeyFrameSegment(ze())[1],t=this.locationMotion.getKeyFrameSegment(ze())[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=Fe({key:"pano.".concat(e),basisLoaderInitialized:ii.isInitialized()},Bt(this.imageOptions,["format","size","quality","sharpen","mappings"])),l=this.imageOptions.transform,u=this.work.observers[e].images,c=this.work.observers[e],h=c.position,d=c.quaternion,p=(new n.Matrix4).compose(h,d,new n.Vector3(-1,1,1)),f="pano:"+Ho(u);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,u,{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:Er(null!==(o=t.latitude)&&void 0!==o?o:this.defaultLatitude,this.minLatitude,this.maxLatitude),fov:Er(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=bo(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=yo(t.accessibleNodes,(function(i){return Er(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 u=Object.keys(o).map((function(e){return o[e]}));u.length&&(r=Er(.6*(u.reduce((function(e,t){return e+t}),0)/u.length),1,3));for(var c=0;c<this.work.observers.length;c++){var h="panoCircle_".concat(this.work.workCode,"_").concat(c),d=this.work.observers[c],p=void 0;t[h]?(!0===(p=t[h]).loading&&!1===d.loadable&&p.setLoading(!1),delete t[h]):(p=this.panoCircleMeshCreator(c)).name=h,p.scale.set(r,1,r),p.position.copy(d.standingPosition),this.panoMeshes[c]=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,u=this;void 0===i&&(i={}),this.userAction=r;var c=ze(),h=rr(),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,Ja),position:d.position.clone()};t.visible=!1,t.renderOrder=-1,this.panoModelGroup.add(t);var f,A,v;if(this.locationMotion.ended){var g=this.locationMotion.getKeyFrameSegment(c);g[0];var m=g[1],y=this.locationMotion.value,x=this.panoResourceFromLocationMotionKeyframe(m).position,b=p.position;f=Math.max(x.distanceTo(b),1),A=[{key:m.key,progress:0,value:Fe(Fe({},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(c),E=w[0],S=(m=w[1],y=this.locationMotion.value,this.panoResourceFromLocationMotionKeyframe(E).position),M=(x=this.panoResourceFromLocationMotionKeyframe(m).position,b=p.position,m.value.count-y.count),C=Math.max(S.distanceTo(x),1)*M;f=C+Math.max(x.distanceTo(b),1),A=[{key:E.key,progress:0,value:Fe({},y)},{key:m.key,progress:C/f,value:m.value},{key:h,progress:1,value:{count:m.value.count+1,distance:0,perspToOrtho:0,orthoDistance:1,modelAlpha:0}}];var I=this.locationMotionKeyframesLength(this.locationMotion.keyframes),T=this.locationMotionKeyframesLength(A);v=0===I||0===I?0:this.locationMotion.getProgressVelocity(c)*I/T}var B=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,B).catch(He),this.locationMotion.setKeyframes(A,B,v).then((function(){var t={longitude:u.camera.pose.longitude,latitude:u.camera.pose.latitude,fov:u.camera.pose.fov,offset:u.camera.pose.offset.clone(),distance:u.camera.pose.distance};i.moveEndCallback&&i.moveEndCallback(e,t),u.emit("panoArrived",e,t,r)}),(function(){i.moveCancelCallback&&i.moveCancelCallback(),u.emit("moveToPanoCanceled",e)}))},t.prototype.getForwardPanoIndexOrNot=function(e){var t=this,i=this.camera.getWorldDirection(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)})),u=0,c=[Math.PI/8,Math.PI/6,Math.PI/4,Math.PI/3];u<c.length;u++)for(var h=c[u],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 Bt(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.getWorldDirection(new n.Vector3).setY(0),s=null,l=this.work.observers[this.currentPanoIndex];if(l){var u=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)})),c=o.intersectObject(this.boundingMesh,!0)[0];if(c){var h=yo(u,(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(c.point)}),!0),d=h[0];h[1]<this.panoTapTriggerRadius&&(s=d)}mr(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),mr(s))!0===this.locationMotion.ended&&this.cameraBounce();else{var g=this.work.observers[s];if(g.active){for(var m={},y=Math.PI/6,x=Math.PI/12,b=new n.Vector3(0,1,0),w=g.position.clone().setY(0).sub(l.position.clone().setY(0)).normalize(),E=w.clone().applyAxisAngle(b,y),S=w.clone().applyAxisAngle(b,-y),M=[],C=[],I=[],T=0,B=g.accessibleNodes;T<B.length;T++){if((d=B[T])!==this.currentPanoIndex&&d!==s){var P=this.work.observers[d].position.clone().sub(g.position).setY(0);w.angleTo(P)<y?I.push(P):E.angleTo(P)<y?M.push(P):S.angleTo(P)<y&&C.push(P)}}var R=(I.length>0?I:ke(ke([],M,!0),C,!0)).slice().sort((function(e,t){return e.angleTo(w)-t.angleTo(w)}))[0];R&&R.angleTo(a)>x&&(m.longitude=Math.atan2(-R.x,-R.z)),this.cameraMotion.value.latitude<-Math.PI/4&&(m.latitude=Er(0,this.minLatitude,this.maxLatitude)),this.emit("wantsMoveToPano",s,m,!0)}else this.panoMeshes[s]&&(this.panoMeshes[s].setDisabled(!1),this.panoMeshes[s].setLoading(!0))}}}}},t}(zo);function es(e,t){var i=new n.Vector3;return i.setFromMatrixColumn(t,0),i.multiplyScalar(-e),i}function ts(e,t,i){var r=new n.Vector3;return r.setFromMatrixColumn(i,0),r.crossVectors(t,r),r.multiplyScalar(e),r}var is=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 qr({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 Le(t,e),t.parseArgs=function(t){var i,n,r,o,a,s,l,u=e.parseArgs.call(this,t);return Fe(Fe({},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,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=this.parseArgs(e),o=e.initial[0],a=e.initial[1];return{longitude:null!==(i=a.longitude)&&void 0!==i?i:r.defaultLongitude,latitude:Er(null!==(n=a.latitude)&&void 0!==n?n:r.defaultLatitude,r.minLatitude,r.maxLatitude),fov:90,offset:r.work.observers[o].position.clone(),distance:t.distanceFromModel(r.model,90,r.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(He),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(Er(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),xo(i)||this.model.setMaterial(i),xo(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.getWorldPosition(new n.Vector3),this.camera.getWorldDirection(new n.Vector3)),o=this.model.intersectRaycaster(r)[0];o&&i.copy(o.point)}var a=yo(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,bo(this.camera.pose),this.userAction),this.currentPanoIndex=s,this.emit("panoArrived",s,bo(this.camera.pose),this.userAction))},t.prototype.getTargetPose=function(){var e=this.cameraMotion.getKeyFrameSegment(ze())[1],t=this.locationMotion.getKeyFrameSegment(ze())[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=this;if(!this.destroyed){this.pending=!1,this.userAction=o;var u={longitude:null!==(a=i.longitude)&&void 0!==a?a:this.defaultLongitude,latitude:Er(null!==(s=i.latitude)&&void 0!==s?s:this.defaultLatitude,this.minLatitude,this.maxLatitude),fov:90,offset:this.model.bounding.getCenter(new n.Vector3),distance:t.distanceFromModel(this.model,90,this.camera.aspect)},c=Bt(u,["longitude","latitude","fov"]),h={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(c,r).catch(He),this.locationMotion.set(h,r).then((function(){l.emit("initAnimationEnded",e,u,l.userAction)}),(function(t){var i=bo(l.camera.pose);l.emit("initAnimationEnded",e,i,l.userAction)})).then((function(){l.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=yo(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 Bt(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),u={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},c=(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(es(2*o.x*c/h.y,this.camera.matrix)),a.add(ts(2*o.y*c/h.y,this.camera.up,this.camera.matrix)),a.x=Er(a.x,l.x-u.x,l.x+u.x),a.z=Er(a.z,l.z-u.z,l.z+u.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(He)}else{a={x:e.center.x-t.x,y:e.center.y-t.y};var p=this.coordinatesForOffset(a),f=co(this.cameraMotion.value.longitude+-1*p.longitude),A=Er(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(He),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 Bt(e,["x","y"])}));if(this.emit("wantsGesture","pinch",o,r))return;var a=Er(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(He)}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 u=e.pointers.map((function(e){return Bt(e,["x","y"])}));if(!this.emit("wantsGesture","pinch",u,r)){var c=e.pointers.map((function(e){return Bt(e,["x","y"])}));if(!this.emit("wantsGesture","pinch",c,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),g=this.renderer.getSize(new n.Vector2);d.add(es(2*h.x*v/g.y,this.camera.matrix)),d.add(ts(2*h.y*v/g.y,this.camera.up,this.camera.matrix)),d.x=Er(d.x,f.x-A.x,f.x+A.x),d.z=Er(d.z,f.z-A.z,f.z+A.z);var m={longitude:0,latitude:Math.PI/2,fov:this.cameraMotion.value.fov,offset:d,distance:this.locationMotion.value.distance};this.emit("wantsPanGesture",m,e.isFinal)||(this.emit("gesture","pan",c,e.isFinal),this.emit("panGesture",m,e.isFinal),this.userAction=!0,this.locationMotion.set({x:d.x,y:d.y,z:d.z},0).catch(He))}}}}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=Er(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(He),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 Bt(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(!mr(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}(Do),ns={type:"move"},rs=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,u=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(ns)),u&&e.hand){a=!0;for(var c=0,h=e.hand.values();c<h.length;c++){var d=h[c],p=t.getJointPose(d,i);if(void 0===u.joints[d.jointName]){var f=new n.Group;f.matrixAutoUpdate=!1,f.visible=!1,u.joints[d.jointName]=f,u.add(f)}var A=u.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=u.joints["index-finger-tip"],g=u.joints["thumb-tip"],m=v.position.distanceTo(g.position);u.inputState.pinching&&m>.025?(u.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!u.inputState.pinching&&m<=.015&&(u.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!==u&&(u.visible=null!==a),this},e}(),os=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 rs,new rs],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 Le(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],u=(r[9]-1)/r[5],c=(r[8]-1)/r[0],h=(o[8]+1)/o[0],d=a*c,p=a*h,f=n/(-c+h),A=f*-c;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,g=s+f,m=d-A,y=p+(n-A),x=l*s/g*v,b=u*s/g*v;e.projectionMatrix.makePerspective(m,y,x,b,v,g)},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,dt.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}(Ue),as=["webXRSessionStart","webXRSessionEnd"],ss=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 Le(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(ss.prototype,{isLineSegmentsGeometry:!0});var ls={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"},us=function(e){function t(t){var i=e.call(this,{uniforms:n.UniformsUtils.clone(ls.uniforms),vertexShader:ls.vertexShader,fragmentShader:ls.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 Le(t,e),t}(n.ShaderMaterial);Object.assign(us.prototype,{isLineMaterial:!0});var cs=function(e){function t(t,i){var n=e.call(this)||this;return n.type="LineSegments2",n.geometry=void 0!==t?t:new ss,n.material=void 0!==i?i:new us({color:16777215*Math.random()}),n}return Le(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,u=t.count;s<u;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 c=new n.InstancedInterleavedBuffer(r,2,1);return e.setAttribute("instanceDistanceStart",new n.InterleavedBufferAttribute(c,1,0)),e.setAttribute("instanceDistanceEnd",new n.InterleavedBufferAttribute(c,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,u=s.linewidth,c=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,g=new n.Line3,m=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 x=0,b=c.count;x<b;x++){d.fromBufferAttribute(c,x),p.fromBufferAttribute(h,x),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,E=d.z>1&&p.z>1;if(!w&&!E){d.x*=l.x/2,d.y*=l.y/2,p.x*=l.x/2,p.y*=l.y/2,g.start.copy(d),g.start.z=0,g.end.copy(p),g.end.z=0;var S=g.closestPointToPointParameter(A,!0);g.at(S,m);var M=n.MathUtils.lerp(d.z,p.z,S),C=M>=-1&&M<=1,I=A.distanceTo(m)<.5*u;if(C&&I){g.start.fromBufferAttribute(c,x),g.end.fromBufferAttribute(h,x),g.start.applyMatrix4(y),g.end.applyMatrix4(y);var T=new n.Vector3,B=new n.Vector3;i.distanceSqToSegment(g.start,g.end,B,T),t.push({point:B,pointOnLine:T,distance:i.origin.distanceTo(B),object:this,faceIndex:x})}}}},t}(n.Mesh);Object.assign(cs.prototype,{isLineSegments2:!0});var hs=function(e){function t(t,i){var n=e.call(this,t,i)||this;return n.type="Line2",n}return Le(t,e),t}(cs);Object.assign(hs.prototype,{isLine2:!0});var ds=function(e){function t(){var t=e.call(this)||this;return t.type="LineGeometry",t}return Le(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}(ss);Object.assign(ds.prototype,{isLineGeometry:!0});var ps=null,fs=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 ds,a=new us({color:14467195,linewidth:2,dashScale:20,dashed:!1});r.line=new hs(o,a);var s=new n.BufferGeometry,l=new n.PointsMaterial({color:14467195,size:8,map:ps||(ps=(new n.TextureLoader).load("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sHDgwCEMBJZu0AAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAABM5JREFUWMO1V0tPG2cUPZ4Hxh6DazIOrjFNqJs0FIMqWFgWQkatsmvVbtggKlSVRVf5AWz4AWz4AUSKEChll19QJYSXkECuhFxsHjEhxCYm+DWGMZ5HF72DJq4bAzFXurI0M/I5997v3u9cC65vTJVn2lX/xHINQOYSBLTLEuIuCWw4Z3IGAEvf6ASmVHjNzHCXBG4A0AjACsAOwEbO0nsFQBnAGYASAIl+ZRMR7SolMEdsByD09fV5R0ZGgg8ePPjW5/N1iqLYpuu6RZblciKR2I9Go69evnwZnZ+fjwI4IS8AKBIRzeQfJWCANwKwh0KhtrGxsYehUOin1tbW+zzP23ietzY2NnIAoGmaLsuyUiqVyvl8XtrY2NiamZn589mzZxsAUgCOAeQAnFI2tI+VxIjaAeDzoaGh7xYWFuZOTk6OZVk+12uYqqq6JEnn0Wg0OT4+/geAXwGEAdwDIFJQXC1wO4DWR48e/RCPxxclSSroVzRFUbSDg4P848ePFwH8DuAhkWih83TRQWxFOXgAwvDwcOfo6OhvXV1d39tsNtuVBwTDWBwOh1UUxVsMw1hXVlbSdCgNV43uYSvrHg6H24aHh38eHBz85TrgF9FYLHA4HLzH43FvbW2d7u/vG+dANp8FpqIlbd3d3V8Fg8EfBUFw4BONZVmL3+9vHhkZCQL4AoAHgJPK8G+yzC0XDofdoVAo5PP5vkadTBAEtr+/39ff3x8gAp/RPOEqx2qjx+NpvXv3bk9DQ0NDvQgwDIOWlhZrMBj8kgi0UJdxRgYMArzL5XJ7vd57qLPZ7Xamp6fnNgBXtQxcjFuHw+Hyer3t9SYgCAITCAScAJoBNNEY/08GOFVVrfVMv7kMNDntFD1vjIAPrlRN0xjckOm6biFQ3jwNPwDMZrOnqVTqfb3Bi8Wivru7W/VCYkwPlKOjo0IikXh7EwQikYgE4Nw0CfXKDCipVCoTj8df3QABbW1tLUc6oUgkFPMkVACUNjc337148eKvw8PDbJ2jP1taWkoCyNDVXDSECmNSK4qiKNLq6urW8+fPI/UicHx8rD59+jSVy+WOAKSJhKENwFItLtoxk8mwsixzHR0dHe3t7c5PAU+n09rs7OzJkydPYqVSaQfANoDXALIk31S2smU1TWMPDg7K5XKZ7+3t9TudTut1U7+wsFCcmJiIpdPpbQBxADsAknQWymYCOukBHYCuKApisdhpMpnURFEU79y503TVyKenpzOTk5M7e3t7MQKPV0Zv1gNm+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 Le(t,e),Object.defineProperty(t,"version",{get:function(){return"5.0.0-alpha.171"},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(fs.prototype,{isFiveLine:!0});var As=(new n.Matrix4).makeRotationAxis(new n.Vector3(0,1,0),Math.PI),vs=new n.Vector3(-1,1,1),gs=function(e){function t(t){var i=e.call(this,t)||this;i.xrManager=new os(i.renderer,i.renderer.getContext()),i.xrControllerRay=new n.Raycaster,i.pointerLine=new fs,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=rr()]={panoIndex:i.currentPanoIndex,workCode:i.work.workCode,leftPanoPicture:null,position:i.camera.pose.offset.clone(),effect:"fade"},i.parallaxCameraMatrixs=[];var r=dt.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,ke([e],t,!1))}))},a=this,s=0,l=as;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 Le(t,e),t.parseArgs=function(t){var i=Fe(Fe({},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,u=this.work.observers[e],c=this.imageOptions.size;if(void 0===c&&u){var h=u.images.up.match(/\/cube_(\d+)\//);h&&(c=Number(h[1]))}void 0===c&&(c=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)}(gt(e,d,t))},f=Fe({key:"pano.".concat(e),basisLoaderInitialized:ii.isInitialized()},Bt(this.imageOptions,["format","size","quality"])),A=u.images,v=null!==(o=null===(r=u.images.tiles)||void 0===r?void 0:r.filter((function(e){return e.size>c})))&&void 0!==o?o:null,g="pano:"+Ho([A,f,d]);if(this.pendingTextureTask){if(this.pendingTextureTask.hash===g)return;var m=this.pendingTextureTask.panoIndex;null===(a=this.panoMeshes[m])||void 0===a||a.setProgress(0),this.emit("textureAbort",m,u),this.pendingTextureTask.onError(new Error("texture aborted"))}var y,x=this.model.getMaterial()||{},b=x.pano0,w=x.pano1;if((null==b?void 0:b.map.name)===g?y=b:(null==w?void 0:w.map.name)===g&&(y=w),y){var E={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(u.position,u.quaternion,vs)},position:u.position.clone()};this.doMoveToPano(e,E,t,i)}else this.pending=!0,this.pendingTextureTask={panoIndex:e,hash:g,onLoad:function(r){var o;if(l.pending=!1,l.destroyed)r.body.dispose();else{r.body.name=g;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(u.position,u.quaternion,vs)},position:u.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,u),(null===(i=l.pendingTextureTask)||void 0===i?void 0:i.hash)===g&&(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)===g&&(null===(n=l.panoMeshes[e])||void 0===n||n.setProgress(t)),l.emit("textureLoading",t,e,u)}),this.renderer)]).then((function(t){var i,n,r=t[0];(null===(i=l.pendingTextureTask)||void 0===i?void 0:i.hash)===g?(l.pendingTextureTask.onLoad(r),null===(n=l.panoMeshes[e])||void 0===n||n.setProgress(0),delete l.pendingTextureTask,l.emit("textureLoaded",e,u,r.meta)):r.body.dispose()})).catch((function(t){var i,n;(null===(i=l.pendingTextureTask)||void 0===i?void 0:i.hash)===g&&(l.pendingTextureTask.onError(t),null===(n=l.panoMeshes[e])||void 0===n||n.setProgress(0),delete l.pendingTextureTask,l.emit("textureError",t,e,u),l.emit("error",t))})),this.emit("textureStartLoad",e,u)},t.prototype.doMoveToPano=function(e,t,i,r){var o,a,s,l=this;void 0===i&&(i={}),this.userAction=r;var u=ze(),c=rr();this.panoResources[c]=t;var h,d,p;if(this.locationMotion.ended){var f=this.locationMotion.getKeyFrameSegment(u);f[0];var A=f[1],v=this.locationMotion.value,g=this.panoResourceFromLocationMotionKeyframe(A).position,m=t.position;h=Math.max(g.distanceTo(m),1),d=[{key:A.key,progress:0,value:Fe(Fe({},v),{count:0})},{key:c,progress:1,value:{distance:0,perspToOrtho:0,orthoDistance:1,modelAlpha:0,count:1}}],p=0}else{var y=this.locationMotion.getKeyFrameSegment(u),x=y[0],b=(A=y[1],v=this.locationMotion.value,this.panoResourceFromLocationMotionKeyframe(x).position),w=(g=this.panoResourceFromLocationMotionKeyframe(A).position,m=t.position,A.value.count-v.count),E=Math.max(b.distanceTo(g),1)*w;h=E+Math.max(g.distanceTo(m),1),d=[{key:x.key,progress:0,value:Fe({},v)},{key:A.key,progress:E/h,value:A.value},{key:c,progress:1,value:{count:A.value.count+1,distance:0,perspToOrtho:0,orthoDistance:1,modelAlpha:0}}];var S=this.locationMotionKeyframesLength(this.locationMotion.keyframes),M=this.locationMotionKeyframesLength(d);p=this.locationMotion.getProgressVelocity(u)*S/M}var C=this.calculateMovingDuration(i.duration,h),I={longitude:i.longitude,latitude:i.latitude,fov:i.fov},T={longitude:null!==(o=I.longitude)&&void 0!==o?o:this.camera.pose.longitude,latitude:null!==(a=I.latitude)&&void 0!==a?a:this.camera.pose.latitude,fov:null!==(s=I.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,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=He,this.videoTexture.needsUpdate=!0),this.panoVideo.setMaterial(null),this.cameraMotion.set(I,C).catch(He),this.locationMotion.setKeyframes(d,C,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 u=l.work.observers[l.currentPanoIndex];if(u&&u.video&&l.videoTexture&&l.videoTexture.image instanceof HTMLVideoElement){var c=As.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(u.video.matrix),h={map:l.videoTexture,size:u.video.size,matrix:c,alpha:1},d=rr(),p=l.videoTexture.image;p.setAttribute("uuid",d),jo().then((function(e){e&&u.video&&p.getAttribute("uuid")===d&&(p.oncanplay=function(){p.oncanplay=He,p.play()},p.ontimeupdate=function(){p.currentTime>.5&&(p.ontimeupdate=He,l.panoVideo.setMaterial(h))},p.src=u.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.getWorldDirection(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=yo(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),u=l[0];l[1]<this.panoTapTriggerRadius&&(r=u)}mr(r)&&(r=this.getForwardPanoIndexOrNot(t));for(var c=0,h=this.locationMotion.keyframes;c<h.length;c++){var d=h[c],p=this.panoResourceFromLocationMotionKeyframe(d);if(!(d.progress<this.locationMotion.progress)&&p.panoIndex===r){r=null;break}}if(this.emit("panoSelected",r),mr(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,g=Math.PI/12,m=new n.Vector3(0,1,0),y=f.position.clone().setY(0).sub(o.position.clone().setY(0)).normalize(),x=y.clone().applyAxisAngle(m,v),b=y.clone().applyAxisAngle(m,-v),w=[],E=[],S=[],M=0,C=f.accessibleNodes;M<C.length;M++){if((u=C[M])!==this.currentPanoIndex&&u!==r){var I=this.work.observers[u].position.clone().sub(f.position).setY(0);y.angleTo(I)<v?S.push(I):x.angleTo(I)<v?w.push(I):b.angleTo(I)<v&&E.push(I)}}var T=(S.length>0?S:ke(ke([],w,!0),E,!0)).slice().sort((function(e,t){return e.angleTo(y)-t.angleTo(y)}))[0];return T&&T.angleTo(i)>g&&(A.longitude=Math.atan2(-T.x,-T.z)),this.cameraMotion.value.latitude<-Math.PI/4&&(A.latitude=Er(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,u,c=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]),g=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),m=!1;if(!1===this.locationMotion.ended){this.locationMotion.update(e);var y=this.locationMotion.getKeyFrameSegment(e),x=y[0],b=y[1],w=this.panoResourceFromLocationMotionKeyframe(x),E=this.panoResourceFromLocationMotionKeyframe(b),S=(new n.Vector3).copy(w.position),M=(new n.Vector3).copy(E.position),C=this.locationMotion.value.count-b.value.count+1;f.progress=C,f.modelAlpha=this.locationMotion.value.modelAlpha,this.camera.perspToOrtho.setScalar(Er(this.locationMotion.value.perspToOrtho,0,1)),this.camera.orthoDistance=this.locationMotion.value.orthoDistance,E.leftPanoPicture&&(C<1?w.leftPanoPicture&&(f.pano0=w.leftPanoPicture):f.pano0=E.leftPanoPicture,f.pano1=E.leftPanoPicture),m=f.useBlackTransition="instant"===E.effect||"montage"===E.effect,"fade"!==E.effect&&"montage"!==E.effect||(f.pano0&&w.leftPanoPicture&&(f.pano0={map:f.pano0.map,luminanceMap:f.pano0.luminanceMap,matrix:w.leftPanoPicture.matrix.clone().setPosition(E.position)}),S.copy(M)),A.distance=this.locationMotion.value.distance,A.offset=new n.Vector3(S.x+(M.x-S.x)*C,S.y+(M.y-S.y)*C,S.z+(M.z-S.z)*C);for(var I=[],T=[],B=0,P=this.locationMotion.keyframes;B<P.length;B++){var R=P[B],D=R.key,O=R.progress;void 0!==D&&(I.push(D),O>=this.locationMotion.progress&&T.push(D))}for(var L=0,F=Object.keys(this.panoResources);L<F.length;L++){var k=F[L];if(!(T.indexOf(k)>=0)){var N=this.panoResources[k];if(N.leftPanoPicture){var V=N.leftPanoPicture.map;if(V){if(V===(null===(i=f.pano0)||void 0===i?void 0:i.map))continue;if(V===(null===(r=f.pano1)||void 0===r?void 0:r.map))continue;V instanceof ri&&V.cubeRenderTarget&&this.colorCubeRenderTargetPool.push(V.cubeRenderTarget),V.dispose(),N.leftPanoPicture=null}}I.indexOf(k)>=0||delete this.panoResources[k]}}w.workCode===E.workCode?this.currentPanoIndex=C<.5?w.panoIndex:E.panoIndex:this.currentPanoIndex=E.panoIndex,this.emit("movingToPano",g.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===xo(f)&&((null===(o=f.pano0)||void 0===o?void 0:o.map)&&f.pano0.map instanceof ri&&!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 ri&&!f.pano1.map.cubeRenderTarget&&(f.pano1.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),this.model.setMaterial(f)),!1===xo(A)&&this.setCamera(A);var Q=h[1];if(Q)if(this.xrManager.session){var U=this.xrManager.referenceSpace;if(U){var H=this.xrManager.cameraVR,q=this.xrManager.cameraL,z=this.xrManager.cameraR,j=[q,z],_=Q.getViewerPose(U),K=new n.Vector3(0,0,0);if(_){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=_.views;if(!G)return void console.error("no layer found");this.renderer.setFramebuffer(G.framebuffer);var Y=!1;X.length!==H.cameras.length&&(H.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=j[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),K.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&&H.cameras.push(oe)}}var ue=this.xrManager.session.inputSources;for(ie=0;ie<this.xrManager.controllers.length;ie++){var ce=this.xrManager.controllers[ie],he=ue[ie];ce.update(he,Q,U)}var de=this.xrManager.getController(0),pe=de.position.clone().add(K).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),ge=fe[0].point.clone().add(ve);this.intersectMesh.position.copy(ge);var me=ge.clone().add(ve);if(this.intersectMesh.lookAt(me),Math.abs(Ae.y)>.99){var ye=this.camera.position.clone().sub(ge);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||m){var xe=this.work.observers[this.currentPanoIndex];if(xe)for(var be=0,we=Ie=xe.visibleNodes.concat(this.currentPanoIndex);be<we.length;be++){var Ee=we[be];(De=this.panoMeshes[Ee])&&De.setOpacity(0)}}else{var Se=this.work.observers[this.currentPanoIndex];if(Se){var Me=yo(Se.visibleNodes,(function(e){return Se.standingPosition.distanceTo(c.work.observers[e].standingPosition)}),!0),Ce=Me[1];Ce=Er(Ce,2.5,1/0);for(var Ie=Se.visibleNodes.concat(this.currentPanoIndex),Te=this.getForwardPanoIndexOrNot(),Be=this.camera.getWorldDirection(new n.Vector3),Pe=0,Re=Ie;Pe<Re.length;Pe++){Ee=Re[Pe];var De,Oe=this.work.observers[Ee];if(De=this.panoMeshes[Ee])if(Oe.loadable||Oe.active){var Le=De.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);De.setCurrent(!De.loading&&0===De.progress&&Te===Ee),De.setOpacity(Le<.01?0:Er(Ce/Le*1.2,.65,.98));var Fe=this.camera.position.clone().setY(De.position.y),ke=(new n.Vector3).copy(De.position).sub(Fe).normalize();if(Ee===this.currentPanoIndex){var Ne=Er((.5-Fe.distanceTo(De.position))/.5,0,1);ke.multiplyScalar(1-Ne).add(Be.clone().multiplyScalar(Ne))}ke.length()>0&&De.quaternion.setFromEuler(new n.Euler(0,Math.atan2(ke.x,ke.z),0)),De.updateTime&&De.updateTime(e,t)}else De.setOpacity(0)}}}var Ve,Qe=function(){if(!1===c.tileLevelForFov)return 0;var e=new n.Vector2(4e3,4e3),t=g.panoIndex,i=c.work.observers[t],r=c.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=c.tileLevelForFov(q.fov,e);return s>a?s:0}(),Ue=((Ve=new n.PerspectiveCamera).applyMatrix4(H.matrix),Ve.position.set(0,0,0),Ve.quaternion.premultiply(c.work.observers[g.panoIndex].quaternion.clone().inverse()),Ve.updateProjectionMatrix(),Ve.updateMatrixWorld(!0),(new n.Frustum).setFromProjectionMatrix((new n.Matrix4).multiplyMatrices(Ve.projectionMatrix,Ve.matrixWorldInverse)));g.panoIndex===this.currentPanoIndex&&(null===(s=g.leftPanoPicture)||void 0===s?void 0:s.map)instanceof ri&&(g.leftPanoPicture.map.update(Ue,Qe),!0===g.leftPanoPicture.map.needsRender&&(this.needsRender=!0));var He=this.tiling.object.visible;if(Qe>this.TILED_CUBE_TEXTURE_LEVEL&&this.initAnimationed){var qe=g.panoIndex,ze=this.work.observers[qe];ze&&no(this.camera.position,ze.position)&&this.locationMotion.ended?(this.tiling.object.visible=!0,this.tiling.panoIndex!==qe&&this.tiling.cleanup(),this.tiling.panoIndex=qe,this.tiling.setResource(null!==(u=null===(l=ze.images)||void 0===l?void 0:l.tiles)&&void 0!==u?u:[],this.enableIOSEDR&&ze.images.luminance?ze.images.luminance:null),this.tiling.setRotation(ze.quaternion),this.tiling.setPosition(ze.position),this.tiling.update(Ue,Qe,e)):this.tiling.object.visible=!1}else this.tiling.object.visible=!1;He!==this.tiling.object.visible&&(this.tiling.object.needsRender=!0),this.panoVideo.object.position.copy(this.camera.position),this.panoVideo.updateTime(e);var je=ue[0].gamepad;if((null==je?void 0:je.axes)&&this.emit("webXRSelected","Axes",{axes:je.axes}),-1===(null==je?void 0:je.axes[2])){if(!this.xrControllerState.axes[2].left.isTap){var _e=e-this.xrControllerState.axes[2].left.startTime;_e>=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==je?void 0:je.axes[2])){if(!this.xrControllerState.axes[2].right.isTap){var Ke=e-this.xrControllerState.axes[2].right.startTime;Ke>=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==je?void 0:je.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==je?void 0:je.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==je?void 0:je.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==je?void 0:je.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==je?void 0:je.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==je?void 0:je.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==je?void 0:je.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==je?void 0:je.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}(pa),ms=["Panorama","DepthPanorama","Model"],ys={Floorplan:Oo,Topview:Qo,Panorama:pa,VRPanorama:_a,Model:Ka,DepthPanorama:$a,Mapview:is,XRPanorama:gs};function xs(e){for(var t=0,i=ms;t<i.length;t++){var n=i[t];if("string"==typeof e){if(n===e)return!0}else if(e instanceof Do&&e instanceof ys[n])return!0}return!1}var bs=["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 ws(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 Es(){for(var e,t=document.getElementsByTagName("meta"),i=0;i<t.length;i++){var n=t[i];if("viewport"===n.getAttribute("name")){var r=ws(null!==(e=n.getAttribute("content"))&&void 0!==e?e:""),o=Number(r["initial-scale"]);if(!isNaN(o))return o}}return 1}var Ss=[351,63],Ms=[20,20],Cs=new Float32Array([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),Is=new Float32Array([0,0,1,0,0,1,1,1]),Ts=new Uint8Array([0,1,2,1,3,2]),Bs=new n.BufferGeometry;Bs.setAttribute("position",new n.BufferAttribute(Cs,3)),Bs.setAttribute("uv",new n.BufferAttribute(Is,2)),Bs.setIndex(new n.BufferAttribute(Ts,1));var Ps=new n.MeshBasicMaterial({transparent:!0,depthTest:!1,depthWrite:!1,stencilWrite:!1}),Rs=new n.Mesh(Bs,Ps),Ds=new n.Scene;Ds.add(Rs);var Os=new n.OrthographicCamera(-.5,.5,.5,-.5,.1,1);Os.position.set(0,0,.5),Os.lookAt(0,0,0);var Ls=new n.Vector4,Fs=new n.Vector4;function ks(e){if(Ps.map){var t=e.getViewport(Ls),i=e.getScissor(Fs),r=e.getScissorTest(),o=e.autoClear;e.setViewport(i.x+Ms[0]/3,i.y+Ms[1]/3,Ss[0]/3,Ss[1]/3),e.setScissor(i.x+Ms[0]/3,i.y+Ms[1]/3,Ss[0]/3,Ss[1]/3),e.setScissorTest(!0),e.autoClear=!1,e.render(Ds,Os),e.setViewport(t),e.setScissor(i),e.setScissorTest(r),e.autoClear=o}else{var a=new n.Texture,s=new Image;s.onload=function(){a.image=s,a.wrapS=n.ClampToEdgeWrapping,a.wrapT=n.ClampToEdgeWrapping,a.minFilter=n.LinearFilter,a.needsUpdate=!0,Ps.needsUpdate=!0,s.onload=function(){}},s.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAV8AAAA/CAQAAADtPwPkAAAR+0lEQVR4AezYg3LEQACH8d1cbdu23Q5qG9G47z/TN/h6tn2b/H+TUTLc7yjcOXV46OUAnUs6EbUp022ZBXc1NhoZYYd7fjDRvdcHAwrlK2QBVJ4sgoqONmY45RUT23sZ6H42F2hK5CtkMbjhZlDmUUcvq1zyieUVyjbE4I1GBfItwxG56YaUZTQwyh4P6NgJ4YYYvCuQb5kOyI03pORjiqe4Lwpq5pt1vJqfUwKWJVbSMYfppYconG+maNNQOWBZuwHTzicGel75NtFOkxr5apmV8cikcko0DrDQs863AeGl0cE0+1xy573m0/wf0cEKW6H7BWtgg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l0HvVj5PvHCElEF8DUAFikVYTcvmfBdDzQlvvMXSV5lP5zrXj/fJ54zuWaeeuoqkW8AwCIaqeTZKkmYrpPwR2eqN9X72W7EG57vU67OBeuMV8KXLUzv93UTTj42tvaFS++GVsc5JRyLSLJ8nzO555hFBmiSRCqMr4GwrcmGkib5xSvcwmzFK6e8s7DMa2xH4YZdZumSOwsVzFeBWdr37tpIhOpSwXqONNgZq/2KgvBt54znHN1HzlljTO4oVD5fb+prNIJXQNL1ofDKQisbPLJDv3jNSLq9OkYBEIihKIj3v7S1TRQCX5Kdl1ZQlol7LF+E++fwirfiq2sf4cTXxc6hzxffPuLEeqSWrPGWMF58TWr5viyJAP5/4EV4KePiaSE8eNRgjDy8/tyRW+FZjhS+2tlovNJovtJovNJ0uhK6Wo64SDdxEbM//KesjwAAAABJRU5ErkJggg==",Ps.map=a}}var Ns=new n.Box3(new n.Vector3(-50,-50,-50),new n.Vector3(50,50,50)),Vs=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/")},Qs=new n.Vector2,Us=new n.Frustum,Hs=new n.Matrix4,qs=new WeakMap,zs=new WeakMap,js=function(e){function t(t){void 0===t&&(t={});var i,r,o,a,s,l,u,c,h,d,p,f=this;if((f=e.call(this)||this).ident=rr(),_s.instances[f.ident]=f,f.renderSwitch01=0,f.panoIndex=0,f.needsRender=!1,f.onlyRenderIfNeeds=null===(i=t.onlyRenderIfNeeds)||void 0===i||i,f.imageOptions=Fe({},null!==(r=t.imageOptions)&&void 0!==r?r:{}),f.textureOptions=Fe({},null!==(o=t.textureOptions)&&void 0!==o?o:{}),f.poweredByRealsee=null===(a=t.poweredByRealsee)||void 0===a||a,f.extraElements=[],f.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)},f.fps={testCount:0,testTime:ze()},f.modeChangeDuration=null!==(s=t.modeChangeDuration)&&void 0!==s?s:800,f.panoramaLikeSavedPose={},"undefined"!=typeof window)if(t.renderer)t.renderer instanceof hi&&f.throwError(new Error("cannot render a internal renderer")),f.renderer=t.renderer;else try{f.renderer=new hi({preserveDrawingBuffer:t.preserveDrawingBuffer,backgroundColor:t.backgroundColor,backgroundAlpha:t.backgroundAlpha,antialias:t.antialias,webgl2:null==t?void 0:t.webgl2});var A=Es();f.renderer.setPixelRatio(1===A?window.devicePixelRatio:1),f.renderer.setSize(512,512)}catch(e){e instanceof Error&&f.throwError(e)}f.copyEffect=new Ro(f.renderer),f.getPixelsRenderTarget=new n.WebGLRenderTarget(1,1,{encoding:null!==(u=null===(l=f.renderer)||void 0===l?void 0:l.outputEncoding)&&void 0!==u?u:n.sRGBEncoding}),f.scissor=Object.assign({left:0,bottom:0,width:1,height:1},t.scissor),f.camera=new xi(80),f.scene=new di,f.parallaxScene=new di,f.lastLoadWorkTask=Promise.resolve(),f.requestProxy=null!==(c=t.requestProxy)&&void 0!==c?c:Vs,f.networkSubscribe=new ot,f.networkSubscribe.on("network",(function(e,t,i,n){var r;f.emit("network",e,t,i,n),null===(r=f.analysis)||void 0===r||r.network(f.work,e,t,i,n)})),f.boundingMesh=so(new n.Box3(new n.Vector3(-.5,-.5,-.5),new n.Vector3(.5,.5,.5))),f.scene.add(f.boundingMesh),f.model=new wr({allowHosts:[],requestProxy:f.requestProxy,networkSubscribe:f.networkSubscribe});var v=so(Ns);v.name="model_empty",f.model.add(v),f.model.visible=!1,f.readyCallbacks=[],f.modelPending=!1,f.syncingState=!1,f.scene.add(f.model),f.helperGroup=new n.Group,f.helperGroup.name="helper",f.scene.add(f.helperGroup),f.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)}(f.scene),f.state={mode:null!==(h=f.currentMode)&&void 0!==h?h:"Panorama",panoIndex:null!==(d=f.panoIndex)&&void 0!==d?d:0,longitude:f.camera.pose.longitude,latitude:f.camera.pose.latitude,fov:f.camera.pose.fov,offset:f.camera.pose.offset.clone(),distance:f.camera.pose.distance},f.stateSynced=!1,f._enableIOSEDR=!1,f.destroyed=!1,f.paused=!0,"undefined"!=typeof window&&(!1!==t.play&&f.play(),!1!==(null!==(p=t.initialBasisLoader)&&void 0!==p&&p)&&("string"==typeof t.initialBasisLoader?f.initBasisLoader(t.initialBasisLoader):f.initBasisLoader()),f.stopAnimationLoop=dt.shared.add((function(e,t){for(var i=[],n=2;n<arguments.length;n++)i[n-2]=arguments[n];f.updateTime.apply(f,ke([e,t],i,!1))}),!1,0,10));var g=function(){"undefined"!=typeof document&&null===document.fullscreenElement&&"VRPanorama"===f.currentMode&&f.controller.emit("vrWantsToExit")};if("undefined"!=typeof document&&document.addEventListener("fullscreenchange",g,!1),f.removeEventListeners=function(){"undefined"!=typeof document&&document.removeEventListener("fullscreenchange",g,!1)},f.plugins={},t.plugins&&t.plugins.length)for(var m=0,y=t.plugins;m<y.length;m++){var x=y[m];if("function"==typeof x)x(f);else if(Array.isArray(x)){var b=x[0],w=x[1],E=x[2];if("function"==typeof b){var S=b(f,E);"string"==typeof w&&(f.plugins[w]?f.throwError(new Error("plugin name ".concat(w," is exists."))):f.plugins[w]=S)}}}return f.gpuPickingRenderTarget=new n.WebGLRenderTarget(1,1),f.meshReplaceMaterialMap=new Map,f.meshOriginMaterialMap=new Map,f}return Le(t,e),Object.defineProperty(t,"version",{get:function(){return"5.0.0-alpha.171"},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 bt)){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 bt)&&a.meshOriginMaterialMap.get(e.uuid)&&(e.material=a.meshOriginMaterialMap.get(e.uuid))})),this.model.setMaterial({modelColorInfo:null});var u=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 u||!1},t.prototype.dispose=function(){var e,t;if(!0!==this.destroyed){delete _s.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 hi&&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(Qs);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 hi){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 hi&&(t&&this.renderer.setPixelRatio(t),this.renderer.setSize(a,l))}var u=this.renderer.getSize(new n.Vector2);this.camera.aspect=u.x*this.scissor.width/(u.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)}},t.prototype.initBasisLoader=function(e){try{if(!this.renderer)throw new Error("renderer is not initialized.");if("undefined"==typeof Promise||"undefined"==typeof WeakMap||"undefined"==typeof WebAssembly)throw new Error("Basis loader not support.");"string"==typeof e&&ii.setTranscoderPath(e),ii.workerConfig.format||ii.detectSupport(this.renderer),ii._allocateWorker(0)}catch(e){e instanceof Error&&this.throwError(e)}},Object.defineProperty(t.prototype,"work",{get:function(){var e=zs.get(this);if(e&&Or.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,u,c,h,d,p,f,A=this;void 0===o&&(o=!0);var v,g,m,y=Vr(e),x=this.work;void 0===i&&(i=x?"inherit":"initial"),"inherit"===i?(v="number"==typeof this.panoIndex&&y.observers[this.panoIndex]?this.panoIndex:y.initial.panoIndex,g=null!==(a=this.currentMode)&&void 0!==a?a:y.initial.mode,m={longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov}):"initial"===i?(g=null!==(s=this.currentMode)&&void 0!==s?s:y.initial.mode,v=y.initial.panoIndex,m=g===t.Mode.Panorama||g===t.Mode.DepthPanorama||g===t.Mode.Model||g===t.Mode.VRPanorama||g===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,g=null!==(c=null!==(u=i.mode)&&void 0!==u?u:this.currentMode)&&void 0!==c?c:"Panorama",m={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:g,longitude:m.longitude,latitude:m.latitude,fov:m.fov});var b=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=Fe(Fe({initial:[v,m,i,o]},A.commonParams()),A.controllerInits[g]);A.controller?!1===A.controller.updateWork(y,v,m,i,o)&&(A.controller.destroy(),A.controller=A.applyController(g,n)):A.controller=A.applyController(g,n),A.emit("load",e,y,{panoIndex:v,mode:g,longitude:m.longitude,latitude:m.latitude,fov:m.fov}),null===(t=A.analysis)||void 0===t||t.work(y)},w=function(e){var t;void 0===e&&(e=He),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())};zs.set(this,y);for(var E=new n.Box3,S=0,M=y.observers;S<M.length;S++){var C=M[S];E.expandByPoint(C.standingPosition),E.expandByPoint((new n.Vector3).fromArray([C.position.x,2*C.position.y-C.standingPosition.y,C.position.z]))}return this.model.bounding.union(E),g===t.Mode.Floorplan||g===t.Mode.Topview||g===t.Mode.Mapview||g===t.Mode.Model?w((function(){b(),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),b(),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 u=new Error('mode "'.concat(e,'" is not existed'));return a.throwError(u),void l(u)}if((e===t.Mode.Floorplan||e===t.Mode.Topview||e===t.Mode.Mapview||e===t.Mode.Model)&&(mr(a.model)||!0!==a.model.loaded)){u=new Error("model is not ready.");return a.throwError(u),void l(u)}if(mr(a.controller)){u=new Error("controller is not ready.");return a.throwError(u),void l(u)}var c=a.controller,h=a.currentMode,d=function(){var u,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!==(u=i.panoIndex)&&void 0!==u?u:a.panoIndex)&&void 0!==d?d:0,Fe({duration:n},i),r):a.controller.updateCamera(i,n,r).catch(He):("number"==typeof i.panoIndex&&i.panoIndex!==a.panoIndex&&(a.panoIndex=i.panoIndex),a.controller.updateCamera(i,n,r).catch(He));else{c.destroy();var A=null!==(f=null!==(p=i.panoIndex)&&void 0!==p?p:a.panoIndex)&&void 0!==f?f:0,v=xs(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);var g=Fe(Fe({initial:[A,v,n,r]},a.commonParams()),a.controllerInits[e]);a.saveControllerPose(c),a.controller=a.applyController(e,g);var m=ys[e].initAnimationEndPose(g);a.emit("modeChange",e,h,A,m,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=dt.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){dt.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=Er(e,Math.floor(i/2),Math.floor(s.x-i)),t=Er(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=xt.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(Qs);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(Qs);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&&ks(this.renderer),this.renderer.setRenderTarget(null),e&&dt.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&&ks(n.renderer)),e&&dt.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,ke([e,t],s,!1)),this.camera.updateTime(e,t),this.syncingState=!1;var u=new n.Vector2(512,512),c=new n.Vector2(512,512);this.renderer&&(this.renderer.getSize(u),u.x*=this.scissor.width,u.y*=this.scissor.height,this.renderer.getDrawingBufferSize(c),c.x*=this.scissor.width,c.y*=this.scissor.height),this.renderer&&this.model.update(this.renderer,this.camera);var h=new n.Box3;if(this.work)for(var d=0,p=this.work.observers;d<p.length;d++){var f=p[d];h.expandByPoint(f.standingPosition),h.expandByPoint((new n.Vector3).fromArray([f.position.x,2*f.position.y-f.standingPosition.y,f.position.z]))}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 A=null!==(r=this.model.getMaterial())&&void 0!==r?r:{},v=1-(null!==(o=A.modelAlpha)&&void 0!==o?o:0);A.opacity=Er(4*v-3,0,1),this.boundingMesh.setMaterial(A),this.boundingMesh.setTransparent(1!==v);var g=[];Hs.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),Us.setFromProjectionMatrix(Hs);for(var m=0,y=this.scene.children;m<y.length;m++){var x=y[m];x!==this.model&&(x instanceof n.Object3D&&x.traverseVisible((function(t){if(t.setResolution&&t.setResolution(u.x,u.y),t.setTime&&t.setTime(e),t.mixer instanceof n.AnimationMixer){var i=qs.get(t.mixer);i||(i=new n.Clock,qs.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||Us.intersectsObject(t))&&g.push(t)})))}if(c.width*c.height>8388608?this.renderSwitch01=1^this.renderSwitch01:this.renderSwitch01=0,this.renderer&&!1===this.paused&&0===this.renderSwitch01){var b=void 0;if(!0!==this.onlyRenderIfNeeds)b=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.needsRender)for(var w=0,E=g;w<E.length;w++){var S=E[w],M=function(e){!0===e.needsRender?(e.needsRender=!1,a.needsRender=!0):e.mixer&&e.mixer.stats.actions.inUse>0&&(a.needsRender=!0)};M(S),S.traverseAncestors(M)}!1!==this.needsRender&&(b=this.render())}if(this.needsRender=!1,this.controller&&this.screenBuffers){var C=this.controller,I=this.screenBuffers;this.aroundScissor((function(){C.postProcessing(I[0],I[1]),a.copyEffect.render(I[1],void 0)}))}this.hasListener("renderFrame")&&this.emit("renderFrame",void 0!==b)}if(this.fps.testTime&&e-this.fps.testTime<1e3)this.fps.testCount++;else if(this.emit("fps",this.fps.testCount),this.fps.testTime=e,this.fps.testCount=0,this.renderer){var T=this.renderer.getContext(),B=lo(T);B&&this.throwError(B)}}},t.prototype.pause=function(){this.paused=!0,this.renderer&&this.renderer instanceof hi&&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?mr(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=He),!this.work)return Promise.reject(new Error("work never loaded"));var n=this.work.observers[e],r=this.work.allowHosts,o=ze();return Promise.all(["right","left","up","down","front","back"].map((function(t){var o=Fe({key:"pano.".concat(e,".").concat(t),basisLoaderInitialized:ii.isInitialized()},Bt(i.imageOptions,["size","format","quality","mappings"])),a=n.images[t];return lt(i.imageOptions.transform?i.imageOptions.transform(a,o):vt(a,o),{allowHosts:r,requestProxy:i.requestProxy,networkSubscribe:i.networkSubscribe})}))).then((function(){var e=ze()-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),u=l.x*this.scissor.width,c=l.y*this.scissor.height,h=l.x*this.scissor.left+(s.x+1)/2*u,d=l.y*(1-this.scissor.bottom-this.scissor.height)+(1-s.y)/2*c;return new n.Vector2(h,d)},t.prototype.getRenderObjects=function(e){Hs.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),Us.setFromProjectionMatrix(Hs),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||Us.intersectsObject(e))&&t.push(e)})),t},t.prototype.getCurrentState=function(){return Fe(Fe({},this.getPose()),{mode:this.currentMode||t.Mode.Panorama,panoIndex:this.panoIndex||0})},t.prototype.setState=function(e,i,r){var o,a,s,l,u,c,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,g,m,y=null!==(o=e.panoIndex)&&void 0!==o?o:this.state.panoIndex,x=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||!mr(this.model)&&!0===this.model.loaded){if(this.state.mode!==x){if("VRPanorama"===x)return void this.changeMode("VRPanorama",void 0,void 0,!0);var b=void 0;b=xs(this.state.mode)&&xs(x)?Fe({},this.state):xs(x)?Fe({},this.panoramaLikeSavedPose):x===t.Mode.Mapview?{longitude:this.panoramaLikeSavedPose.latitude}:Fe({},e),"number"==typeof e.longitude&&(b.longitude=e.longitude),"number"==typeof e.latitude&&(b.latitude=e.latitude),"number"==typeof e.fov&&(b.fov=e.fov);var w=Fe(Fe({initial:[y,b,this.modeChangeDuration,!1]},this.commonParams()),this.controllerInits[x]),E=ys[x].initAnimationEndPose(w);f=E.longitude,A=E.latitude,v=E.fov,g=E.offset,m=E.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!==(u=e.fov)&&void 0!==u?u:this.state.fov,g=null!==(c=e.offset)&&void 0!==c?c:this.state.offset,m=null!==(h=e.distance)&&void 0!==h?h:this.state.distance;var S={panoIndex:y,mode:x,longitude:f,latitude:A,fov:v,offset:g,distance:m};this.emit("setState",S),go(this.state,S)||(this.controller&&"VRPanorama"===S.mode&&S.mode!==this.state.mode?(vo(this.state,S),this.changeMode("VRPanorama")):this.controller&&"XRPanorama"===S.mode&&S.mode!==this.state.mode?(vo(this.state,S),this.changeMode("XRPanorama")):(vo(this.state,S),this.controller&&(this.controller.userAction=r),i&&this.state.mode===S.mode&&(this.syncingState=this.syncState(ze(),0,i),this.syncingState&&(null===(d=this.controller)||void 0===d||d.updateTime(ze(),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};return this.changeMode(this.state.mode,a,this.modeChangeDuration,this.controller.userAction),!0}if(!1===this.controller.isReady())return!1;if(this.controller instanceof ys.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,s,!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 ys.Topview||this.controller instanceof ys.Mapview){var l=1,u=r?this.state.fov:fo(this.camera.pose.fov,this.state.fov,l),c=r?new n.Vector3(this.state.offset.x,this.state.offset.y,this.state.offset.z):new n.Vector3(fo(this.camera.pose.offset.x,this.state.offset.x,.2),fo(this.camera.pose.offset.y,this.state.offset.y,.2),fo(this.camera.pose.offset.z,this.state.offset.z,.2));if(io(u,this.camera.pose.fov)||ro(c,this.camera.pose.offset))return this.controller.cameraMotion.set({fov:u},0).catch(He),this.controller.locationMotion.set({x:c.x,y:c.y,z:c.z},0).catch(He),!0}else{l=1;var h=Math.PI/45,d=(u=r?this.state.fov:fo(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=co(e.longitude),r=e.latitude,o=co(t.longitude),a=t.latitude;o-n>ho?n+=po:n-o>ho&&(n-=po);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},h)),p=d.longitude,f=d.latitude;if(io(p,this.camera.pose.longitude,2*Math.PI)||io(f,this.camera.pose.latitude)||io(u,this.camera.pose.fov))return this.controller.cameraMotion.set({longitude:p,latitude:f,fov:u},0).catch(He),!0}if(this.stateSynced=!0,!1===o&&this.emit("stateSynced",this.state),this.readyCallbacks.length&&this.stateSynced){var A=this.currentMode;if(!(A===t.Mode.Floorplan||A===t.Mode.Topview||A===t.Mode.Mapview||A===t.Mode.Model)||!this.modelPending){var v=this.readyCallbacks.slice();this.readyCallbacks.length=0;for(var g=0,m=v;g<m.length;g++){var y=m[g];this.controller instanceof ys.Panorama?!0!==y.tile||this.controller.isTileReady()?y():this.readyCallbacks.push(y):y()}}}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(Ao()){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 wr({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,u=a.model;u&&(u.show(),o=u.getMaterial()||{},a.scene.remove(u),u.dispose(),l.setTransparent(u.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,u;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 c=0,h=a.work.observers;c<h.length;c++){var d=h[c];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=so(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===(u=a.renderer)||void 0===u||u.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(He)},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&&xs(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=ys[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,ke([e],t,!1));if(r)return!1}))},s=0,l=bs;s<l.length;s++){a(l[s])}var u=ys[e].initAnimationEndPose(i),c=i.initial[3],h={panoIndex:i.initial[0],mode:e,longitude:u.longitude,latitude:u.latitude,fov:u.fov,offset:u.offset,distance:u.distance};return go(this.state,h)||(vo(this.state,h),this.emit("stateChange",this.state,c)),this.emit("currentStateChange",this.getCurrentState(),c),o.on("cameraUpdate",(function(t,i){var r;if(n.controller){var o=Fe(Fe({},n.controller.getTargetPose()),{panoIndex:n.panoIndex,mode:e});i&&!1===n.syncingState&&n.state.mode===o.mode&&!go(n.state,o)&&(vo(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=Fe(Fe({},i),{panoIndex:t,mode:e});r&&n.state.mode===a.mode&&!go(n.state,a)&&(vo(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=Fe(Fe({},i),{panoIndex:t,mode:e});r&&n.state.mode===a.mode&&!go(n.state,a)&&(vo(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=Fe(Fe({},i),{panoIndex:t,mode:e});r&&n.state.mode===a.mode&&!go(n.state,a)&&(vo(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=Fe(Fe({},i),{panoIndex:t,mode:e});r&&n.state.mode===a.mode&&!go(n.state,a)&&(vo(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}(Ue),_s={instances:{},constructor:js};"undefined"!=typeof window&&Object.assign(window,{__FIVE_DEBUG__:_s});var Ks=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=dt,exports.BVH=Ti,exports.BVHIntersect=Ei,exports.BVHNode=wi,exports.BVHVector3=bi,exports.Camera=xi,exports.Clipper=xt,exports.Five=js,exports.InternalWebGLRenderer=hi,exports.IntersectMesh=eo,exports.Model=wr,exports.NetworkSubscribe=ot,exports.PBMContainer=wt,exports.PBMGroup=Et,exports.PBMMaterial=ci,exports.PBMMesh=bt,exports.PROXY_CONTROLLER_EVENT_NAMES=bs,exports.PanoCircleMesh=_r,exports.PanoCircleMeshCustom=Zr,exports.PanoCircleMeshSolid=Wr,exports.Scene=di,exports.Subscribe=Ue,exports.TextureLoader=oi,exports.Tile3D=Jn,exports.Tile3DModel=gr,exports.TileBoundingSphere=Sn,exports.TileCacheNode=pn,exports.TileCubeTextureTarget=ri,exports.TileCullingVolume=xn,exports.TileOrientedBoundingBox=zn,exports.TileRequestScheduler=dn,exports.Tileset3D=ir,exports.Tileset3DTraverser=er,exports.TilesetCache=An,exports.Work=Lr,exports.XRButton=Ks,exports.defaultImageURLTransform=vt,exports.getViewportScale=Es,exports.imageSupport=function(){return yt||(yt=Promise.all([mt("data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A="),mt("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=Vr;